Repository navigation
Expand file tree
/
Copy pathguix.scm
More file actions
54 lines (47 loc) · 1.66 KB
/
Copy pathguix.scm
File metadata and controls
54 lines (47 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
; SPDX-FileCopyrightText: 2025 Fredrik Salomonsson <plattfot@posteo.net>
;
; SPDX-License-Identifier: GPL-3.0-or-later
(use-modules
(gnu packages bash)
(gnu packages base)
(gnu packages linux)
(gnu packages)
((guix licenses) #:prefix license:)
(guix build-system meson)
(guix download)
(guix gexp)
(guix git-download)
(guix packages)
(guix utils)
(ice-9 popen)
(ice-9 rdelim))
;; From the talk "Just build it with Guix" by Efraim Flashner
;; presented on the Guix days 2020
;; https://guix.gnu.org/en/blog/2020/online-guix-day-announce-2/
(define %source-dir (current-source-directory))
(define %git-commit
(read-string (open-pipe "git show HEAD | head -1 | cut -d ' ' -f2" OPEN_READ)))
(define %package-version
(string-trim-right (read-string (open-pipe "./build-aux/version" OPEN_READ))))
(define (skip-git-and-meson-artifacts file stat)
"Skip git and autotools artifacts when collecting the sources."
(let ((name (substring file (+ 1 (string-prefix-length %source-dir file)))))
(not (or (string=? name ".envrc")
(string-prefix? "./build" name)
))))
(define-public baksnapper
(package
(name "baksnapper")
(version (git-version %package-version "HEAD" %git-commit))
(source (local-file %source-dir
#:recursive? #t
#:select? skip-git-and-meson-artifacts))
(build-system meson-build-system)
(inputs (list bash util-linux))
(synopsis "Backup tool for snapper")
(description
"Baksnapper is a script for backing up snapshots created by the program
snapper using btrfs send and receive.")
(home-page "")
(license license:gpl3+)))
baksnapper