projects/guix·blob python-team · refs

1528 lines · 64.0 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014, 2015, 2020, 2023 Eric Bavier <[email protected]>
3;;; Copyright © 2014 Ian Denhardt <[email protected]>
4;;; Copyright © 2015, 2016, 2017, 2021, 2022 Leo Famulari <[email protected]>
5;;; Copyright © 2017–2022 Tobias Geerinckx-Rice <[email protected]>
6;;; Copyright © 2017 Thomas Danckaert <[email protected]>
7;;; Copyright © 2017, 2021 Arun Isaac <[email protected]>
8;;; Copyright © 2017 Kei Kebreau <[email protected]>
9;;; Copyright © 2017, 2020, 2021, 2025 Efraim Flashner <[email protected]>
10;;; Copyright © 2017 Christine Lemmer-Webber <[email protected]>
11;;; Copyright © 2017 Rutger Helling <[email protected]>
12;;; Copyright © 2018 Mark H Weaver <[email protected]>
13;;; Copyright © 2018 Oleg Pykhalov <[email protected]>
14;;; Copyright © 2018, 2019, 2020 Ricardo Wurmus <[email protected]>
15;;; Copyright © 2019 Alex Vong <[email protected]>
16;;; Copyright © 2019, 2022 Marius Bakke <[email protected]>
17;;; Copyright © 2019 Mathieu Othacehe <[email protected]>
18;;; Copyright © 2020, 2022 Nicolas Goaziou <[email protected]>
19;;; Copyright © 2020 Marcin Karpezo <[email protected]>
20;;; Copyright © 2020 Michael Rohleder <[email protected]>
21;;; Copyright © 2021 Timothy Sample <[email protected]>
22;;; Copyright © 2021 Brice Waegeneire <[email protected]>
23;;; Copyright © 2021 Sarah Morgensen <[email protected]>
24;;; Copyright © 2022, 2025 Maxim Cournoyer <[email protected]>
25;;; Copyright © 2022 Feng Shu <[email protected]>
26;;; Copyright © 2023 Timo Wilken <[email protected]>
27;;; Copyright © 2024 Nicolas Graves <[email protected]>
28;;; Copyright © 2024 jgart <[email protected]>
29;;; Copyright © 2025 Kjartan Oli Agustsson <[email protected]>
30;;; Copyright © 2025 mstenek <[email protected]>
31;;; Copyright © 2026 Vinicius Monego <[email protected]>
32;;;
33;;; This file is part of GNU Guix.
34;;;
35;;; GNU Guix is free software; you can redistribute it and/or modify it
36;;; under the terms of the GNU General Public License as published by
37;;; the Free Software Foundation; either version 3 of the License, or (at
38;;; your option) any later version.
39;;;
40;;; GNU Guix is distributed in the hope that it will be useful, but
41;;; WITHOUT ANY WARRANTY; without even the implied warranty of
42;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43;;; GNU General Public License for more details.
44;;;
45;;; You should have received a copy of the GNU General Public License
46;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
47
48(define-module (gnu packages backup)
49 #:use-module ((guix licenses) #:prefix license:)
50 #:use-module (guix build-system cmake)
51 #:use-module (guix build-system gnu)
52 #:use-module (guix build-system go)
53 #:use-module (guix build-system pyproject)
54 #:use-module (guix build-system qt)
55 #:use-module (guix download)
56 #:use-module (guix gexp)
57 #:use-module (guix gexp)
58 #:use-module (guix git-download)
59 #:use-module (guix packages)
60 #:use-module (guix utils)
61 #:use-module (gnu packages)
62 #:use-module (gnu packages acl)
63 #:use-module (gnu packages autotools)
64 #:use-module (gnu packages base)
65 #:use-module (gnu packages bash)
66 #:use-module (gnu packages check)
67 #:use-module (gnu packages compression)
68 #:use-module (gnu packages crypto)
69 #:use-module (gnu packages databases)
70 #:use-module (gnu packages datastructures)
71 #:use-module (gnu packages dbm)
72 #:use-module (gnu packages dejagnu)
73 #:use-module (gnu packages digest)
74 #:use-module (gnu packages docbook)
75 #:use-module (gnu packages file-systems)
76 #:use-module (gnu packages ftp)
77 #:use-module (gnu packages gettext)
78 #:use-module (gnu packages glib)
79 #:use-module (gnu packages gnupg)
80 #:use-module (gnu packages golang)
81 #:use-module (gnu packages golang-build)
82 #:use-module (gnu packages golang-check)
83 #:use-module (gnu packages golang-compression)
84 #:use-module (gnu packages golang-crypto)
85 #:use-module (gnu packages golang-web)
86 #:use-module (gnu packages golang-xyz)
87 #:use-module (gnu packages gperf)
88 #:use-module (gnu packages gtk)
89 #:use-module (gnu packages guile)
90 #:use-module (gnu packages guile-xyz)
91 #:use-module (gnu packages haskell-xyz)
92 #:use-module (gnu packages linux)
93 #:use-module (gnu packages man)
94 #:use-module (gnu packages mcrypt)
95 #:use-module (gnu packages ncurses)
96 #:use-module (gnu packages nettle)
97 #:use-module (gnu packages networking)
98 #:use-module (gnu packages onc-rpc)
99 #:use-module (gnu packages pcre)
100 #:use-module (gnu packages perl)
101 #:use-module (gnu packages pkg-config)
102 #:use-module (gnu packages prometheus)
103 #:use-module (gnu packages protobuf)
104 #:use-module (gnu packages python)
105 #:use-module (gnu packages python-build)
106 #:use-module (gnu packages python-check)
107 #:use-module (gnu packages python-crypto)
108 #:use-module (gnu packages python-web)
109 #:use-module (gnu packages python-xyz)
110 #:use-module (gnu packages qt)
111 #:use-module (gnu packages readline)
112 #:use-module (gnu packages rsync)
113 #:use-module (gnu packages ruby-xyz)
114 #:use-module (gnu packages serialization)
115 #:use-module (gnu packages sphinx)
116 #:use-module (gnu packages ssh)
117 #:use-module (gnu packages time)
118 #:use-module (gnu packages tls)
119 #:use-module (gnu packages valgrind)
120 #:use-module (gnu packages version-control)
121 #:use-module (gnu packages xml))
122
123(define-public duplicity
124 (package
125 (name "duplicity")
126 (version "2.1.4")
127 (source
128 (origin
129 (method git-fetch)
130 (uri (git-reference
131 (url "https://gitlab.com/duplicity/duplicity")
132 (commit (string-append "rel." version))))
133 (file-name (git-file-name name version))
134 (sha256
135 (base32 "14x5brpq1l400i9l2hnyqmbn19cc1hnbmj5fn8cs8zzwzbgrfxng"))))
136 (build-system pyproject-build-system)
137 (native-inputs
138 (list gettext-minimal ; for msgfmt
139 gobject-introspection
140 util-linux ; setsid command, for the tests
141 par2cmdline
142 python-fasteners
143 python-future ; for tests
144 python-paramiko
145 python-pexpect
146 python-pytest
147 python-setuptools-scm
148 tzdata-for-tests
149 python-mock))
150 (propagated-inputs
151 (list python-pygobject python-urllib3))
152 (inputs
153 (list bash-minimal ; to run the wrapped program
154 dbus ; dbus-launch (Gio backend)
155 librsync
156 lftp
157 gnupg ; gpg executable needed
158 util-linux)) ; for setsid
159 (arguments
160 (list #:phases
161 #~(modify-phases %standard-phases
162 (add-before 'build 'use-store-file-names
163 (lambda* (#:key inputs #:allow-other-keys)
164 (substitute* "duplicity/gpginterface.py"
165 (("self.call = u'gpg'")
166 (string-append "self.call = '"
167 (search-input-file inputs
168 "/bin/gpg")
169 "'")))
170 (substitute* "duplicity/backends/giobackend.py"
171 (("subprocess.Popen\\(\\[u'dbus-launch'\\]")
172 (string-append "subprocess.Popen([u'"
173 (search-input-file inputs
174 "/bin/dbus-launch") "']")))
175 (substitute* '("testing/functional/__init__.py"
176 "testing/overrides/bin/lftp")
177 (("/bin/sh")
178 (which "sh")))))
179 (add-before 'build 'fix-version
180 (lambda _
181 (substitute* "duplicity/__init__.py"
182 (("\\$version")
183 #$(package-version this-package)))))
184 (add-before 'check 'set-up-tests
185 (lambda* (#:key inputs #:allow-other-keys)
186 (setenv "HOME"
187 (getcwd)) ; gpg needs to write to $HOME
188 (setenv "TZDIR" ; some timestamp checks need TZDIR
189 (search-input-directory inputs
190 "share/zoneinfo"))
191 ;; Some things respect TMPDIR, others hard-code /tmp, and the
192 ;; defaults don't match up, breaking test_restart. Fix it.
193 (setenv "TMPDIR" "/tmp")))
194 (add-after 'wrap 'gi-wrap
195 (lambda _
196 (let ((prog (string-append #$output "/bin/duplicity")))
197 (wrap-program prog
198 `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH"))))))))))
199 (home-page "https://duplicity.gitlab.io/duplicity-web/")
200 (synopsis "Encrypted backup using rsync algorithm")
201 (description
202 "Duplicity backs up directories by producing encrypted tar-format volumes
203and uploading them to a remote or local file server. Because duplicity uses
204librsync, the incremental archives are space efficient and only record the
205parts of files that have changed since the last backup. Because duplicity
206uses GnuPG to encrypt and/or sign these archives, they will be safe from
207spying and/or modification by the server.")
208 (license license:gpl2+)))
209
210(define-public par2cmdline
211 (package
212 (name "par2cmdline")
213 (version "0.8.1")
214 (source (origin
215 (method git-fetch)
216 (uri (git-reference
217 (url "https://github.com/Parchive/par2cmdline")
218 (commit (string-append "v" version))))
219 (file-name (git-file-name name version))
220 (sha256
221 (base32
222 "11mx8q29cr0sryd11awab7y4mhqgbamb1ss77rffjj6in8pb4hdk"))))
223 (native-inputs
224 (list automake autoconf))
225 (build-system gnu-build-system)
226 (synopsis "File verification and repair tools")
227 (description "Par2cmdline uses Reed-Solomon error-correcting codes to
228generate and verify PAR2 recovery files. These files can be distributed
229alongside the source files or stored together with back-ups to protect against
230transmission errors or @dfn{bit rot}, the degradation of storage media over
231time.
232Unlike a simple checksum, PAR2 doesn't merely detect errors: as long as the
233damage isn't too extensive (and smaller than the size of the recovery file), it
234can even repair them.")
235 (home-page "https://github.com/Parchive/par2cmdline")
236 (license license:gpl3+)))
237
238(define-public libarchive
239 (package
240 (name "libarchive")
241 (version "3.7.7")
242 (source
243 (origin
244 (method url-fetch)
245 (uri (list (string-append "https://libarchive.org/downloads/libarchive-"
246 version ".tar.xz")
247 (string-append "https://github.com/libarchive/libarchive"
248 "/releases/download/v" version "/libarchive-"
249 version ".tar.xz")))
250 (sha256
251 (base32
252 "1vps57mrpqmrk4zayh5g5amqfq7031s5zzkkxsm7r71rqf1wv6l7"))))
253 (build-system gnu-build-system)
254 (inputs
255 (list bzip2
256 libxml2
257 lzo
258 nettle
259 xz
260 zlib
261 `(,zstd "lib")))
262 (arguments
263 (list
264 #:configure-flags
265 #~'("--disable-static"
266 ;; Because of the circular dependency, we cannot use openssl here.
267 ;; Explicitly disable openssl to avoid unnecessary dependencies in the
268 ;; pc file.
269 "--without-openssl")
270 #:phases
271 #~(modify-phases %standard-phases
272 (add-before 'build 'patch-pwd
273 (lambda _
274 (substitute* "Makefile"
275 (("/bin/pwd") (which "pwd")))))
276 (replace 'check
277 (lambda* (#:key tests? #:allow-other-keys)
278 (if tests?
279 ;; XXX: The test_owner_parse, test_read_disk, and
280 ;; test_write_disk_lookup tests expect user 'root' to
281 ;; exist, but the chroot's /etc/passwd doesn't have
282 ;; it. Turn off those tests.
283 (begin
284 ;; The tests allow one to disable tests matching a globbing pattern.
285 (invoke "make"
286 "libarchive_test"
287 "bsdcpio_test"
288 "bsdtar_test")
289
290 ;; XXX: This glob disables too much.
291 (invoke "./libarchive_test" "^test_*_disk*")
292 (invoke "./bsdcpio_test" "^test_owner_parse")
293 (invoke "./bsdtar_test"))
294 ;; Tests may be disabled if cross-compiling.
295 (format #t "Test suite not run.~%"))))
296 (add-after 'install 'add--L-in-libarchive-pc
297 (lambda* (#:key inputs outputs #:allow-other-keys)
298 (let* ((out #$output)
299 (lib (string-append out "/lib"))
300 (nettle (assoc-ref inputs "nettle"))
301 (libxml2 (assoc-ref inputs "libxml2"))
302 (xz (assoc-ref inputs "xz"))
303 (zlib (assoc-ref inputs "zlib"))
304 (zstd (assoc-ref inputs "zstd"))
305 (bzip2 (assoc-ref inputs "bzip2")))
306 ;; Embed absolute references to these inputs to avoid propagation.
307 (substitute* (list (string-append lib "/pkgconfig/libarchive.pc")
308 (string-append lib "/libarchive.la"))
309 (("-lnettle")
310 (string-append "-L" nettle "/lib -lnettle"))
311 (("-lxml2")
312 (string-append "-L" libxml2 "/lib -lxml2"))
313 (("-llzma")
314 (string-append "-L" xz "/lib -llzma"))
315 (("-lz")
316 (string-append "-L" zlib "/lib -lz"))
317 (("-lzstd")
318 (string-append "-L" zstd "/lib -lzstd"))
319 (("-lbz2")
320 (string-append "-L" bzip2 "/lib -lbz2")))))))))
321 (home-page "https://libarchive.org/")
322 (synopsis "Multi-format archive and compression library")
323 (description
324 "Libarchive provides a flexible interface for reading and writing
325archives in various formats such as tar and cpio. Libarchive also supports
326reading and writing archives compressed using various compression filters such
327as gzip and bzip2. The library is inherently stream-oriented; readers
328serially iterate through the archive, writers serially add things to the
329archive. In particular, note that there is currently no built-in support for
330random access nor for in-place modification. This package provides the
331@command{bsdcat}, @command{bsdcpio} and @command{bsdtar} commands.")
332 (license license:bsd-2)))
333
334;;; TODO: core update (20k rebuilds).
335(define-public libarchive-next
336 (package
337 (inherit libarchive)
338 (name "libarchive")
339 (version "3.8.7")
340 (source
341 (origin
342 (method url-fetch)
343 (uri (list (string-append "https://libarchive.org/downloads/libarchive-"
344 version ".tar.xz")
345 (string-append "https://github.com/libarchive/libarchive"
346 "/releases/download/v" version "/libarchive-"
347 version ".tar.xz")))
348 (sha256
349 (base32
350 "0x27bngfjiszsfq4wpaqpx01snyczlp0m0yj9z42fp72g92vma6k"))))
351 (arguments
352 (substitute-keyword-arguments arguments
353 ((#:phases phases)
354 #~(modify-phases #$phases
355 (delete 'patch-pwd)
356 (add-before 'build 'patch-commands
357 (lambda _
358 (substitute* "Makefile"
359 (("/bin/pwd") (which "pwd")))
360 (substitute* "test_utils/test_main.c"
361 (("/bin/sh") (which "sh")))))
362 (replace 'check
363 (lambda* (#:key parallel-build? tests? #:allow-other-keys)
364 (if tests?
365 (begin
366 ;; These environment variables are taken from
367 ;; <https://raw.githubusercontent.com/libarchive/libarchive/refs/heads/master/.github/workflows/ci.yml>
368 (setenv "SKIP_OPEN_FD_ERR_TEST" "1")
369 (setenv "IGNORE_TRAVERSALS_TEST4" "1")
370
371 ;; XXX: The test_owner_parse, test_read_disk, and
372 ;; test_write_disk_lookup tests expect user 'root' to
373 ;; exist, but the chroot's /etc/passwd doesn't have it
374 ;; (see:
375 ;; <https://github.com/libarchive/libarchive/issues/2794>).
376 (invoke "make" "-j" (number->string
377 (if parallel-build?
378 (parallel-job-count)
379 1))
380 "libarchive_test"
381 "bsdcpio_test"
382 "bsdtar_test")
383 ;; XXX: This glob disables too much.
384 (invoke "./libarchive_test" "^test_*_disk*")
385 (invoke "./bsdcpio_test" "^test_owner_parse")
386 (invoke "./bsdtar_test"))
387 ;; Tests may be disabled if cross-compiling.
388 (format #t "Test suite not run.~%"))))))))))
389
390(define-public rdup
391 (package
392 (name "rdup")
393 (version "1.1.15")
394 (source
395 (origin
396 (method git-fetch)
397 (uri (git-reference
398 (url "https://github.com/miekg/rdup")
399 (commit version)))
400 (file-name (git-file-name name version))
401 (sha256
402 (base32 "0bzyv6qmnivxnv9nw7lnfn46k0m1dlxcjj53zcva6v8y8084l1iw"))))
403 (build-system gnu-build-system)
404 (native-inputs
405 (list autoconf automake pkg-config
406 ;; For tests.
407 dejagnu))
408 (inputs
409 ;; XXX Compiling with nettle (encryption) support requires patching out
410 ;; -Werror from GNUmakefile.in. Then, rdup-tr-{en,de}crypt tests fail:
411 ;; free(): invalid pointer
412 ;; ** rdup-tr: SIGPIPE received, exiting
413 (list glib pcre libarchive mcrypt))
414 (arguments
415 `(#:parallel-build? #f ;race conditions
416 #:phases
417 (modify-phases %standard-phases
418 (add-before 'build 'qualify-inputs
419 (lambda* (#:key inputs #:allow-other-keys)
420 ;; This script is full of pitfalls. Fix some that particularly
421 ;; affect Guix users & leave the rest as reader excercises.
422 (substitute* "rdup-simple"
423 ;; Use the input ‘mcrypt’, not whatever's in $PATH at run time.
424 (("([' ])mcrypt " all delimiter)
425 (string-append delimiter (which "mcrypt") " "))
426 ;; Avoid frivolous dependency on ‘which’ with a shell builtin.
427 (("which") "command -v"))
428 #t))
429 (add-before 'check 'disable-encryption-tests
430 (lambda _
431 (for-each delete-file
432 (list "testsuite/rdup/rdup.rdup-tr-crypt.exp"
433 "testsuite/rdup/rdup.rdup-tr-decrypt.exp"
434 "testsuite/rdup/rdup.rdup-tr-encrypt.exp"))
435 #t))
436 (add-before 'check 'pre-check
437 (lambda _
438 (setenv "HOME" (getcwd))
439 (substitute* "testsuite/rdup/rdup.rdup-up-t-with-file.exp"
440 (("/bin/cat") (which "cat")))
441 #t)))))
442 (home-page "https://github.com/miekg/rdup")
443 (synopsis "Provide a list of files to backup")
444 (description
445 "Rdup is a utility inspired by rsync and the plan9 way of doing backups.
446Rdup itself does not backup anything, it only print a list of absolute
447file names to standard output. Auxiliary scripts are needed that act on this
448list and implement the backup strategy.")
449 (license license:gpl3+)))
450
451(define-public snapraid
452 (package
453 (name "snapraid")
454 (version "12.2")
455 (source
456 (origin
457 (method git-fetch)
458 (uri (git-reference
459 (url "https://github.com/amadvance/snapraid")
460 (commit (string-append "v" version))))
461 (file-name (git-file-name name version))
462 (sha256
463 (base32 "0xgvyhyyl2v6azxwzqbpgyln4r2dw34xa8z09116vpkgdgivh36z"))))
464 (build-system gnu-build-system)
465 (arguments
466 (list #:configure-flags
467 ;; XXX --enable-valgrind fails with ‘A must-be-redirected function
468 ;; whose name matches the pattern: strlen in an object with soname
469 ;; matching: ld-linux-x86-64.so.2 was not found […]’; used to work.
470 #~(list "--with-blkid")
471 #:phases
472 #~(modify-phases %standard-phases
473 (add-before 'bootstrap 'set-version
474 (lambda _
475 (setenv "VERSION" #$version)
476 (patch-shebang "autover.sh"))))))
477 (native-inputs
478 (list automake autoconf))
479 (inputs
480 (list `(,util-linux "lib"))) ; libblkid
481 (home-page "https://www.snapraid.it/")
482 (synopsis "Efficient backups using parity snapshots across disk arrays")
483 (description
484 "SnapRAID backs up files stored across multiple storage devices, such as
485disk arrays, in an efficient way reminiscent of its namesake @acronym{RAID,
486Redundant Array of Independent Disks} level 4.
487
488Instead of creating a complete copy of the data like classic backups do, it
489saves space by calculating one or more sets of parity information that's a
490fraction of the size. Each parity set is stored on an additional device the
491size of the largest single storage volume, and protects against the loss of any
492one device, up to a total of six. If more devices fail than there are parity
493sets, (only) the files they contained are lost, not the entire array. Data
494corruption by unreliable devices can also be detected and repaired.
495
496SnapRAID is distinct from actual RAID in that it operates on files and creates
497distinct snapshots only when run. It mainly targets large collections of big
498files that rarely change, like home media centers. One disadvantage is that
499@emph{all} data not in the latest snapshot may be lost if one device fails. An
500advantage is that accidentally deleted files can be recovered, which is not the
501case with RAID.
502
503It's also more flexible than true RAID: devices can have different sizes and
504more can be added without disturbing others. Devices that are not in use can
505remain fully idle, saving power and producing less noise.")
506 (license license:gpl3+)))
507
508(define-public btar
509 (package
510 (name "btar")
511 (version "1.1.1")
512 (source
513 (origin
514 (method url-fetch)
515 (uri (string-append "http://vicerveza.homeunix.net/~viric/soft/btar/"
516 "btar-" version ".tar.gz"))
517 (sha256
518 (base32
519 "0miklk4bqblpyzh1bni4x6lqn88fa8fjn15x1k1n8bxkx60nlymd"))))
520 (build-system gnu-build-system)
521 (inputs
522 (list librsync))
523 (arguments
524 `(#:make-flags `("CFLAGS=-fcommon"
525 ,(string-append "PREFIX=" (assoc-ref %outputs "out"))
526 ,(string-append "CC=" ,(cc-for-target)))
527 #:tests? #f ;test input not distributed
528 #:phases
529 ;; no configure phase
530 (modify-phases %standard-phases
531 (delete 'configure))))
532 (home-page "http://viric.name/cgi-bin/btar/doc/trunk/doc/home.wiki")
533 (synopsis "Tar-compatible archiver")
534 (description
535 "Btar is a tar-compatible archiver which allows arbitrary compression and
536ciphering, redundancy, differential backup, indexed extraction, multicore
537compression, input and output serialisation, and tolerance to partial archive
538errors.")
539 (license license:gpl3+)))
540
541(define-public rdiff-backup
542 (package
543 (name "rdiff-backup")
544 (version "2.2.6")
545 (source
546 (origin
547 (method url-fetch)
548 (uri (string-append "https://github.com/rdiff-backup/rdiff-backup/releases/"
549 "download/v" version "/rdiff-backup-" version ".tar.gz"))
550 (sha256
551 (base32 "1ksqjkqadhxzp83zdfs80dvb494vn9q4anppnwxm3ikb4rbq6xyh"))))
552 (build-system pyproject-build-system)
553 (native-inputs
554 (list python-setuptools-scm python-setuptools python-wheel))
555 (inputs
556 (list python python-pyaml librsync))
557 (arguments
558 `(#:tests? #f)) ; Tests require root/sudo
559 (home-page "https://rdiff-backup.net/")
560 (synopsis "Local/remote mirroring+incremental backup")
561 (description
562 "Rdiff-backup backs up one directory to another, possibly over a network.
563The target directory ends up a copy of the source directory, but extra reverse
564diffs are stored in a special subdirectory of that target directory, so you
565can still recover files lost some time ago. The idea is to combine the best
566features of a mirror and an incremental backup. Rdiff-backup also preserves
567subdirectories, hard links, dev files, permissions, uid/gid ownership,
568modification times, extended attributes, acls, and resource forks. Also,
569rdiff-backup can operate in a bandwidth efficient manner over a pipe, like
570rsync. Thus you can use rdiff-backup and ssh to securely back a hard drive up
571to a remote location, and only the differences will be transmitted. Finally,
572rdiff-backup is easy to use and settings have sensible defaults.")
573 (license license:gpl2+)))
574
575(define-public rsnapshot
576 (package
577 (name "rsnapshot")
578 (version "1.4.5")
579 (source
580 (origin
581 (method url-fetch)
582 (uri (string-append
583 "https://github.com/rsnapshot/rsnapshot/releases/download/"
584 version "/rsnapshot-" version ".tar.gz"))
585 (sha256
586 (base32 "0hl2ncld0xkwlnv1cqjmmnld2nlp65alkkdacs11wl95r80mxdqh"))))
587 (build-system gnu-build-system)
588 (arguments
589 `(#:phases
590 (modify-phases %standard-phases
591 (replace 'check
592 (lambda _
593 (invoke "make" "test"))))))
594 (inputs
595 (list perl rsync))
596 (home-page "https://rsnapshot.org")
597 (synopsis "Deduplicating snapshot backup utility based on rsync")
598 (description "rsnapshot is a file system snapshot utility based on rsync.
599rsnapshot makes it easy to make periodic snapshots of local machines, and
600remote machines over SSH. To reduce the disk space required for each backup,
601rsnapshot uses hard links to deduplicate identical files.")
602 (license license:gpl2+)))
603
604(define-public borg
605 (package
606 (name "borg")
607 (version "1.4.4")
608 (source
609 (origin
610 (method git-fetch)
611 (uri (git-reference
612 (url "https://github.com/borgbackup/borg")
613 (commit version)))
614 (file-name (git-file-name name version))
615 (sha256
616 (base32 "0bk302lbjjz1y8dg78wqqys80bm7mzkj5yf6wgyqdwvbqpsnpim4"))))
617 (build-system pyproject-build-system)
618 (arguments
619 (list
620 #:modules '((srfi srfi-26) ; for cut
621 (guix build utils)
622 (guix build pyproject-build-system))
623 ;; tests: 1318 passed, 293 skipped
624 #:test-flags
625 #~(list "--benchmark-skip"
626 "--numprocesses" (number->string (min 8 (parallel-job-count)))
627 "--pyargs" "borg.testsuite"
628 "-k" (string-join
629 ;; These tests need to write to '/var'.
630 (list "not test_get_cache_dir "
631 "test_get_config_dir "
632 "test_get_keys_dir "
633 "test_get_security_dir "
634 ;; These tests assume there is a root user in '/etc/passwd'.
635 "test_access_acl "
636 "test_default_acl "
637 "test_get_item_uid_gid "
638 "test_create_content_from_command "
639 "test_create_content_from_command_with_failed_command "
640 "test_create_stdin "
641 ;; These tests assume the kernel supports FUSE.
642 "test_fuse "
643 "test_fuse_allow_damaged_files "
644 "test_mount_hardlinks "
645 "test_readonly_mount "
646 "test_fuse_versions_view "
647 "test_migrate_lock_alive"
648 ;; Test files are not in /gnu/store
649 "test_convert_all[False]"
650 "test_convert_all[True]"
651 "test_convert_segments[False]"
652 "test_convert_segments[True]"
653 "test_detect_attic_repo"
654 "test_key_export_qr"
655 "test_keys")
656 " and not "))
657 #:phases
658 #~(modify-phases %standard-phases
659 (add-after 'unpack 'set-env
660 (lambda* (#:key inputs #:allow-other-keys)
661 (let ((acl #$(this-package-input "acl"))
662 (openssl #$(this-package-input "openssl"))
663 (lz4 #$(this-package-input "lz4"))
664 (xxhash #$(this-package-input "xxhash"))
665 (zstd #$(this-package-input "zstd")))
666 (setenv "BORG_LIBACL_PREFIX" acl)
667 (setenv "BORG_OPENSSL_PREFIX" openssl)
668 (setenv "BORG_LIBLZ4_PREFIX" lz4)
669 (setenv "BORG_LIBXXHASH_PREFIX" xxhash)
670 (setenv "BORG_LIBZSTD_PREFIX" zstd))))
671 (add-before 'build 'fix-testsuite-setuid-mode
672 (lambda _
673 (substitute* "src/borg/testsuite/archiver.py"
674 (("0o4755") "0o0755"))))
675 (add-after 'install 'build-and-install-docs
676 (lambda _
677 (let* ((doc (string-append #$output "/share/doc/borg-" #$version))
678 (html (string-append doc "/html"))
679 (txt (string-append doc "/txt"))
680 (misc (string-append doc "/misc"))
681 (man (string-append #$output "/share/man/man1")))
682 (with-directory-excursion "docs"
683 (invoke "make" "text" "man" "singlehtml"))
684 (for-each (cut install-file <> misc)
685 '("docs/misc/create_chunker-params.txt"
686 "docs/misc/borg-data-flow.png"
687 "docs/misc/internals-picture.txt"
688 "docs/misc/prune-example.txt"))
689 (copy-recursively "docs/_build/man" man)
690 (copy-recursively "docs/_build/singlehtml" html)
691 (copy-recursively "docs/_build/text" txt))))
692 (add-after 'build-and-install-docs 'install-shell-completions
693 (lambda _
694 (let* ((etc (string-append #$output "/etc"))
695 (share (string-append #$output "/share"))
696 (bash (string-append etc "/bash_completion.d"))
697 (zsh (string-append share "/zsh/site-functions"))
698 (fish (string-append share "/fish/vendor_completions.d")))
699 (with-directory-excursion "scripts/shell_completions"
700 (install-file "bash/borg" bash)
701 (install-file "zsh/_borg" zsh)
702 (install-file "fish/borg.fish" fish))))))))
703 (native-inputs
704 (list python-cython
705 python-guzzle-sphinx-theme
706 python-pkgconfig
707 python-pytest
708 python-pytest-benchmark
709 python-pytest-xdist
710 python-setuptools
711 python-setuptools-scm
712 python-sphinx
713 python-sphinxcontrib-jquery))
714 (inputs
715 (list acl
716 lz4
717 openssl
718 python-msgpack
719 ;; FUSE 3 isn't working well, so we stick with FUSE 2 for now:
720 ;; <https://issues.guix.gnu.org/53407>
721 python-llfuse
722 python-packaging
723 xxhash
724 `(,zstd "lib")))
725 (synopsis "Deduplicated, encrypted, authenticated and compressed backups")
726 (description "Borg is a deduplicating backup program. Optionally, it
727supports compression and authenticated encryption. The main goal of Borg is to
728provide an efficient and secure way to backup data. The data deduplication
729technique used makes Borg suitable for daily backups since only changes are
730stored. The authenticated encryption technique makes it suitable for storing
731backups on untrusted computers.")
732 (home-page "https://www.borgbackup.org/")
733 (license license:bsd-3)))
734
735(define-public wimlib
736 (package
737 (name "wimlib")
738 (version "1.14.5")
739 (source (origin
740 (method url-fetch)
741 (uri (string-append "https://wimlib.net/downloads/"
742 "wimlib-" version ".tar.gz"))
743 (sha256
744 (base32
745 "1551c6jyw6glbfvrg0bknlvn4css6df0drpq2n7j54avplx1l8l4"))))
746 (build-system gnu-build-system)
747 (native-inputs
748 (list pkg-config))
749 (inputs
750 (list fuse libxml2 ntfs-3g openssl))
751 (arguments
752 `(#:configure-flags
753 (list "--disable-static"
754 "--enable-test-support")))
755 (home-page "https://wimlib.net/")
756 (synopsis "WIM file manipulation library and utilities")
757 (description "wimlib is a C library and set of command-line utilities for
758creating, modifying, extracting, and mounting archives in the Windows Imaging
759Format (@dfn{WIM files}). It can capture and apply WIMs directly from and to
760NTFS volumes using @code{ntfs-3g}, preserving NTFS-specific attributes.")
761 ;; wimlib is dual-licenced under version 3 or later of either the GPL or
762 ;; LGPL, except those files explicitly marked as being released into the
763 ;; public domain (CC0) in their headers.
764 (license (list license:gpl3+
765 license:lgpl3+
766 license:cc0))))
767
768(define-public dirvish
769 (package
770 (name "dirvish")
771 (version "1.2.1")
772 (build-system gnu-build-system)
773 (source (origin
774 (method url-fetch)
775 (uri (string-append
776 "http://dirvish.org/dirvish-" version ".tgz"))
777 (sha256
778 (base32
779 "1kbxa1irszp2zw8hd5qzqnrrzb4vxfivs1vn64yxnj0lak1jjzvb"))))
780 (arguments
781 `(#:modules ((ice-9 match) (ice-9 rdelim)
782 ,@%default-gnu-modules)
783 #:phases
784 ;; This mostly mirrors the steps taken in the install.sh that ships
785 ;; with dirvish, but simplified because we aren't prompting interactively
786 (modify-phases %standard-phases
787 (delete 'configure)
788 (delete 'build)
789 (delete 'check)
790 (replace 'install
791 (lambda* (#:key inputs outputs #:allow-other-keys)
792 ;; These are mostly the same steps the install.sh that comes with
793 ;; dirvish does
794 (let* (;; Files we'll be copying
795 (executables
796 '("dirvish" "dirvish-runall"
797 "dirvish-expire" "dirvish-locate"))
798 (man-pages
799 '(("dirvish" "8") ("dirvish-runall" "8")
800 ("dirvish-expire" "8") ("dirvish-locate" "8")
801 ("dirvish.conf" "5")))
802
803 (output-dir
804 (assoc-ref outputs "out"))
805
806 ;; Just a default... not so useful on Guix Systems though.
807 ;; You probably want a service with file(s) to point to.
808 (confdir "/etc/dirvish")
809
810 (perl (search-input-file inputs "/bin/perl"))
811 (loadconfig.pl (call-with-input-file "loadconfig.pl"
812 read-string)))
813
814
815 (define (write-pl filename)
816 (define pl-header
817 (string-append "#!" perl "\n\n"
818 "$CONFDIR = \"" confdir "\";\n\n"))
819 (define input-file-location
820 (string-append filename ".pl"))
821 (define target-file-location
822 (string-append output-dir "/bin/" filename ".pl"))
823 (define text-to-write
824 (string-append pl-header
825 (call-with-input-file input-file-location
826 read-string)
827 "\n" loadconfig.pl))
828 (with-output-to-file target-file-location
829 (lambda ()
830 (display text-to-write)))
831 (chmod target-file-location #o755)
832 (wrap-program target-file-location
833 `("PERL5LIB" ":" prefix
834 ,(map (lambda (l) (string-append (assoc-ref %build-inputs l)
835 "/lib/perl5/site_perl"))
836 '("perl-libtime-period"
837 "perl-libtime-parsedate")))))
838
839 (define write-man
840 (match-lambda
841 ((file-base man-num)
842 (let* ((filename
843 (string-append file-base "." man-num))
844 (output-path
845 (string-append output-dir
846 "/share/man/man" man-num
847 "/" filename)))
848 (copy-file filename output-path)))))
849
850 ;; Make directories
851 (mkdir-p (string-append output-dir "/bin/"))
852 (mkdir-p (string-append output-dir "/share/man/man8/"))
853 (mkdir-p (string-append output-dir "/share/man/man5/"))
854
855 ;; Write out executables
856 (for-each write-pl executables)
857 ;; Write out man pages
858 (for-each write-man man-pages)))))))
859 (inputs
860 (list bash-minimal perl rsync perl-libtime-period perl-libtime-parsedate))
861 (home-page "http://dirvish.org/")
862 (synopsis "Fast, disk based, rotating network backup system")
863 (description
864 "With dirvish you can maintain a set of complete images of your
865file systems with unattended creation and expiration. A dirvish backup vault
866is like a time machine for your data.")
867 (license (license:fsf-free "file://COPYING"
868 "Open Software License 2.0"))))
869
870(define-public partclone
871 (package
872 (name "partclone")
873 (version "0.3.49")
874 (source (origin
875 (method git-fetch)
876 (uri (git-reference
877 (url "https://github.com/Thomas-Tsai/partclone")
878 (commit version)))
879 (file-name (git-file-name name version))
880 (sha256
881 (base32
882 "1b8gk6z55ck2q5fpgyb7cwfmzl57hddqqpr7g8crcinslq2bvxnr"))))
883 (build-system gnu-build-system)
884 (arguments
885 (list
886 #:configure-flags #~(list "--enable-btrfs"
887 "--enable-exfat"
888 "--enable-extfs"
889 "--enable-f2fs"
890 "--enable-fat"
891 "--enable-fuse"
892 "--enable-hfsp"
893 "--enable-minix"
894 "--enable-nilfs2"
895 "--enable-ntfs"
896 "--enable-xfs")
897 #:phases
898 #~(modify-phases %standard-phases
899 (add-after 'unpack 'local-man-stylesheet
900 (lambda _
901 (substitute* "docs/Makefile.am"
902 (("MAN_STYLESHEET=.*")
903 (string-append "MAN_STYLESHEET="
904 #$(this-package-native-input "docbook-xsl")
905 "/xml/xsl/docbook-xsl-"
906 #$(package-version
907 (this-package-native-input "docbook-xsl"))
908 "/manpages/docbook.xsl"))))))))
909 (native-inputs (list autoconf
910 automake
911 docbook-xsl
912 gettext-minimal
913 libtool
914 libxslt
915 nilfs-utils
916 pkg-config))
917 (inputs (list e2fsprogs ; ext2/3/4 support
918 fuse ; fuse support
919 liburcu ; xfs support
920 nilfs-utils ; nilfs support
921 ntfs-3g ; ntfs support
922 openssl
923 `(,util-linux "lib")
924 xxhash
925 zlib
926 `(,zstd "lib")))
927 (home-page "https://partclone.org/")
928 (synopsis "Utilities to save and restore used blocks on a partition")
929 (description "Partclone provides utilities to save and restore used blocks
930on a partition and is designed for higher compatibility of the file system by
931using existing libraries.")
932 (license license:gpl2+)))
933
934(define-public restic
935 (package
936 (name "restic")
937 (version "0.18.1")
938 (source
939 (origin
940 (method git-fetch)
941 (uri (git-reference
942 (url "https://github.com/restic/restic")
943 (commit (string-append "v" version))))
944 (file-name (git-file-name name version))
945 (sha256
946 (base32 "0gxhknn022bwg2s8hababqg3vjkzflq59vr67y7r1c8fjnlsgf4l"))))
947 (build-system go-build-system)
948 (arguments
949 (list
950 #:install-source? #f
951 #:import-path "github.com/restic/restic/cmd/restic"
952 #:unpack-path "github.com/restic/restic"
953 #:embed-files #~(list "children" "nodes" "text")
954 #:test-subdirs #~(list "../../...")
955 #:phases
956 #~(modify-phases %standard-phases
957 (add-after 'unpack 'fix-python-path
958 (lambda* (#:key inputs unpack-path #:allow-other-keys)
959 (with-directory-excursion (string-append "src/" unpack-path)
960 (substitute* "cmd/restic/cmd_backup_integration_test.go"
961 (("python")
962 (search-input-file inputs "/bin/python3"))))))
963 (add-after 'install 'install-docs
964 (lambda* (#:key unpack-path #:allow-other-keys)
965 (with-directory-excursion (string-append "src/" unpack-path)
966 (let* ((man "/share/man")
967 (man-section (string-append man "/man")))
968 ;; Install all the man pages to "out".
969 (for-each
970 (lambda (file)
971 (install-file file
972 (string-append #$output man-section
973 (string-take-right file 1))))
974 (find-files "doc/man" "\\.[1-9]"))))))
975 (add-before 'check 'pre-check
976 (lambda _
977 (setenv "RESTIC_TEST_FUSE" "0"))))))
978 (native-inputs
979 (list go-cloud-google-com-go-storage
980 go-github-com-anacrolix-fuse
981 go-github-com-azure-azure-sdk-for-go-sdk-azcore
982 go-github-com-azure-azure-sdk-for-go-sdk-azidentity
983 go-github-com-azure-azure-sdk-for-go-sdk-storage-azblob
984 go-github-com-backblaze-blazer
985 go-github-com-cenkalti-backoff-v4
986 go-github-com-cespare-xxhash-v2
987 go-github-com-elithrar-simple-scrypt
988 ;; go-github-com-go-ole-go-ole ;Windows only
989 go-github-com-google-go-cmp
990 go-github-com-hashicorp-golang-lru-v2
991 go-github-com-klauspost-compress
992 ;; go-github-com-microsoft-go-winio ;Windows only
993 go-github-com-minio-minio-go-v7
994 go-github-com-ncw-swift-v2
995 go-github-com-peterbourgon-unixtransport
996 go-github-com-pkg-errors
997 go-github-com-pkg-profile
998 go-github-com-pkg-sftp
999 go-github-com-pkg-xattr
1000 go-github-com-restic-chunker
1001 go-github-com-spf13-cobra
1002 go-github-com-spf13-pflag
1003 go-go-uber-org-automaxprocs
1004 go-golang-org-x-crypto
1005 go-golang-org-x-net
1006 go-golang-org-x-oauth2
1007 go-golang-org-x-sync
1008 go-golang-org-x-sys
1009 go-golang-org-x-term
1010 go-golang-org-x-text
1011 go-golang-org-x-time
1012 go-google-golang-org-api
1013 python-minimal
1014
1015 ;; XXX: These packages have to be bootstrapped to break cycle with
1016 ;; go-google-golang-org-grpc.
1017 go-github-com-envoyproxy-go-control-plane
1018 go-github-com-envoyproxy-go-control-plane-envoy))
1019 (home-page "https://restic.net/")
1020 (synopsis "Backup program with multiple revisions, encryption and more")
1021 (description "Restic is a program that does backups right and was designed
1022with the following principles in mind:
1023
1024@itemize
1025@item Easy: Doing backups should be a frictionless process, otherwise you
1026might be tempted to skip it. Restic should be easy to configure and use, so
1027that, in the event of a data loss, you can just restore it. Likewise,
1028restoring data should not be complicated.
1029
1030@item Fast: Backing up your data with restic should only be limited by your
1031network or hard disk bandwidth so that you can backup your files every day.
1032Nobody does backups if it takes too much time. Restoring backups should only
1033transfer data that is needed for the files that are to be restored, so that
1034this process is also fast.
1035
1036@item Verifiable: Much more important than backup is restore, so restic
1037enables you to easily verify that all data can be restored. @item Secure:
1038Restic uses cryptography to guarantee confidentiality and integrity of your
1039data. The location the backup data is stored is assumed not to be a trusted
1040environment (e.g. a shared space where others like system administrators are
1041able to access your backups). Restic is built to secure your data against
1042such attackers.
1043
1044@item Efficient: With the growth of data, additional snapshots should only
1045take the storage of the actual increment. Even more, duplicate data should be
1046de-duplicated before it is actually written to the storage back end to save
1047precious backup space.
1048@end itemize")
1049 (license license:bsd-2)))
1050
1051(define-public restic-rest-server
1052 (package
1053 (name "restic-rest-server")
1054 (version "0.13.0")
1055 (source (origin
1056 (method git-fetch)
1057 (uri (git-reference
1058 (url "https://github.com/restic/rest-server")
1059 (commit (string-append "v" version))))
1060 (file-name (git-file-name name version))
1061 (sha256
1062 (base32
1063 "1ncsmwn4g1j555cgwkk5p8f093s42fip7dajhnh554jp1zx757m3"))))
1064 (build-system go-build-system)
1065 (arguments
1066 (list
1067 #:install-source? #f
1068 #:import-path "github.com/restic/rest-server/cmd/rest-server"
1069 #:unpack-path "github.com/restic/rest-server"
1070 #:phases
1071 #~(modify-phases %standard-phases
1072 ;; Unit tests seems to break with Guix' non-standard TMPDIR.
1073 (add-before 'check 'set-tmpdir
1074 (lambda _
1075 (setenv "TMPDIR" "/tmp")))
1076 (add-after 'install 'rename-binary
1077 (lambda _
1078 (with-directory-excursion #$output
1079 ;; "rest-server" is a bit too generic.
1080 (rename-file "bin/rest-server"
1081 "bin/restic-rest-server")))))))
1082 (native-inputs (list go-github-com-coreos-go-systemd-v22
1083 go-github-com-gorilla-handlers
1084 go-github-com-minio-sha256-simd
1085 go-github-com-miolini-datacounter
1086 go-github-com-prometheus-client-golang
1087 go-github-com-spf13-cobra
1088 go-golang-org-x-crypto))
1089 (home-page "https://github.com/restic/rest-server")
1090 (synopsis "Restic REST server")
1091 (description
1092 "The Restic REST server is a high performance HTTP server that implements
1093restic's REST backend API. It provides a secure and efficient way to backup
1094data remotely, using the restic backup client and a @code{rest:} URL.")
1095 (license license:bsd-2)))
1096
1097(define-public dump
1098 (package
1099 (name "dump")
1100 (version "0.4b47")
1101 (source
1102 (origin
1103 (method url-fetch)
1104 (uri (string-append "mirror://sourceforge/dump/dump/"
1105 version "/dump-" version ".tar.gz"))
1106 (sha256
1107 (base32
1108 "1l2gzzxyqhinx1yqvj4yn9k8vx3iyqi1965dxf9kvvdv9zgaq8fh"))))
1109 (build-system gnu-build-system)
1110 (arguments
1111 (list #:configure-flags
1112 #~(list "--sysconfdir=/etc"
1113 "--disable-readline"
1114 "--disable-rmt"
1115 ;; Add CFLAGS to relax gcc-14's strictness.
1116 "CFLAGS=-O2 -g -Wno-error=int-conversion")))
1117 (native-inputs
1118 (list pkg-config))
1119 (inputs
1120 (list openssl zlib
1121 `(,util-linux "lib") e2fsprogs))
1122 (home-page "https://dump.sourceforge.io/")
1123 (synopsis "Ext2/3/4 file system dump/restore utilities")
1124 (description "Dump examines files in a file system, determines which ones
1125need to be backed up, and copies those files to a specified disk, tape or
1126other storage medium. Subsequent incremental backups can then be layered on
1127top of the full backup. The restore command performs the inverse function of
1128dump; it can restore a full backup of a file system. Single files and
1129directory subtrees may also be restored from full or partial backups in
1130interactive mode.")
1131 (license license:bsd-3)))
1132
1133(define-public btrbk
1134 (package
1135 (name "btrbk")
1136 (version "0.32.6")
1137 (source (origin
1138 (method url-fetch)
1139 (uri (string-append "https://digint.ch/download/btrbk/releases/"
1140 "btrbk-" version ".tar.xz"))
1141 (sha256
1142 (base32
1143 "0sxppfraakf56d1i4sbh4gyzg92panwpnq5y5hh6714igijarqh2"))))
1144 (build-system gnu-build-system)
1145 (arguments
1146 (list
1147 #:make-flags #~(list (string-append "PREFIX=" #$output))
1148 #:phases #~(modify-phases %standard-phases
1149 (replace 'configure
1150 (lambda _
1151 (substitute* "Makefile"
1152 (("= /etc")
1153 (string-append "= $(PREFIX)/etc")))))
1154 (delete 'check)
1155 #$@(if (this-package-native-input "ruby-asciidoctor")
1156 #~()
1157 ;; The 'build phase only builds the manpages.
1158 #~((delete 'build)
1159 (add-before 'install 'adjust-install-targets
1160 (lambda _
1161 (substitute* "Makefile"
1162 (("install-man ") ""))))))
1163 (add-after 'install 'wrap-scripts
1164 (lambda* (#:key inputs outputs #:allow-other-keys)
1165 (define btrbk (search-input-file outputs "bin/btrbk"))
1166 ;; From a comment in btrbk, "Calling btrbk via 'lsbtr'
1167 ;; symlink acts as an alias for 'btrbk ls', while also
1168 ;; changing the semantics of the command line options."
1169 (substitute* btrbk
1170 (("program_name = \\$0")
1171 (string-append "program_name = "
1172 "$ENV{'BTRBK_PROGRAM_NAME'}")))
1173 ;; Wrap the script, so that it works with SSH URI and
1174 ;; finds mbuffer and other tools out of the box.
1175 (wrap-program btrbk
1176 #:sh (search-input-file inputs "bin/bash")
1177 '("BTRBK_PROGRAM_NAME" = ("$0"))
1178 `("PATH" prefix
1179 ,(map (lambda (command)
1180 (dirname (search-input-file inputs command)))
1181 (list "bin/btrfs"
1182 "bin/cat"
1183 "bin/find"
1184 "bin/mbuffer"
1185 "bin/ssh")))))))))
1186 (native-inputs
1187 (if (supported-package? ruby-asciidoctor/minimal)
1188 (list ruby-asciidoctor/minimal)
1189 '()))
1190 (inputs (list bash-minimal
1191 btrfs-progs
1192 coreutils
1193 findutils
1194 mbuffer
1195 openssh
1196 perl))
1197 (home-page "https://digint.ch/btrbk/")
1198 (synopsis "Backup tool for Btrfs subvolumes")
1199 (description "Btrbk is a backup tool for Btrfs subvolumes, taking
1200advantage of Btrfs specific capabilities to create atomic snapshots and
1201transfer them incrementally to your backup locations. The source and target
1202locations are specified in a config file, which allows easily configuring
1203simple scenarios like e.g. a @i{laptop with locally attached backup disks}, as
1204well as more complex ones, e.g. a @i{server receiving backups from several
1205hosts via SSH, with different retention policy}. It has features such as:
1206@itemize
1207@item atomic snapshots
1208@item incremental backups
1209@item flexible retention policy
1210@item backups to multiple destinations
1211@item transfer via SSH
1212@item resume backups (for removable and mobile devices)
1213@item archive to offline storage
1214@item encrypted backups to non-btrfs storage
1215@item wildcard subvolumes (useful for Docker and LXC containers)
1216@item transaction log
1217@item comprehensive list and statistics output
1218@item resolve and trace Btrfs parent-child and received-from relationships
1219@item list file changes between backups
1220@item calculate accurate disk space usage based on block regions.
1221@end itemize
1222Btrbk is designed to run as a cron job for triggering periodic snapshots and
1223backups, as well as from the command line (e.g. for instantly creating
1224additional snapshots).")
1225 (license license:gpl3+)))
1226
1227(define-public burp
1228 (package
1229 (name "burp")
1230 (version "3.2.0")
1231 (source
1232 (origin
1233 (method git-fetch)
1234 (uri (git-reference
1235 (url "https://github.com/grke/burp")
1236 (commit version)))
1237 (sha256
1238 (base32 "0wxn59h6685swmr410l08k8baxsc0f2r6djixxddcbyxmlgap54d"))
1239 (file-name (git-file-name name version))))
1240 (build-system gnu-build-system)
1241 (arguments
1242 (list
1243 #:phases
1244 #~(modify-phases %standard-phases
1245 (add-before 'check 'extend-test-time-outs
1246 ;; The defaults are far too low for busy boxes & spinning storage.
1247 (lambda _
1248 (substitute* (find-files "utest" "\\.c$")
1249 (("(tcase_set_timeout\\(tc_core,)[ 0-9]*(\\);.*)$" _ prefix suffix)
1250 (string-append prefix " 3600" suffix "\n"))))))))
1251 (inputs
1252 (list acl
1253 libxcrypt ; it is needed to pass utest/server/test_auth.c:53 and
1254 ; utest/builders/build_asfd_mock.c:54
1255 librsync
1256 ncurses ; for the live status monitor
1257 openssl
1258 uthash
1259 zlib))
1260 (native-inputs
1261 (list autoconf automake check pkg-config))
1262 (home-page "https://burp.grke.org")
1263 (synopsis "Differential backup and restore")
1264 (description "Burp is a network backup and restore program. It attempts
1265to reduce network traffic and the amount of space that is used by each
1266backup.")
1267 (license license:agpl3)))
1268
1269(define-public disarchive
1270 (package
1271 (name "disarchive")
1272 (version "0.6.0")
1273 (source (origin
1274 (method url-fetch)
1275 (uri (string-append "https://files.ngyro.com/disarchive/"
1276 "disarchive-" version ".tar.gz"))
1277 (sha256
1278 (base32
1279 "1s4lyhhh1zsaxgn11hy2b1kdvnvpipii68wba0hwr471rd43m08k"))))
1280 (build-system gnu-build-system)
1281 (native-inputs
1282 (list autoconf
1283 automake
1284 pkg-config
1285 guile-3.0 ;for cross-compilation
1286 guile-bzip2
1287 guile-gcrypt
1288 guile-lzma
1289 guile-quickcheck))
1290 (inputs
1291 (list guile-3.0 zlib))
1292 (propagated-inputs
1293 (list guile-bzip2 guile-gcrypt guile-lzma))
1294 (home-page "https://ngyro.com/software/disarchive.html")
1295 (synopsis "Software archive disassembler")
1296 (description "Disarchive can disassemble software archives into data
1297and metadata. The goal is to create a small amount of metadata that
1298can be used to recreate a software archive bit-for-bit from the
1299original files. For example, a software archive made using tar and
1300Gzip will need to describe the order of files in the tarball and the
1301compression parameters used by Gzip.")
1302 (license license:gpl3+)))
1303
1304(define-public borgmatic
1305 (package
1306 (name "borgmatic")
1307 (version "2.1.5")
1308 (source
1309 (origin
1310 (method git-fetch)
1311 (uri (git-reference
1312 (url "https://projects.torsion.org/borgmatic-collective/borgmatic")
1313 (commit version)))
1314 (file-name (git-file-name name version))
1315 (sha256
1316 (base32
1317 "17i15ysg0wbcnfvki8wz2z9gx3zx99czv3czjh83y2m1xppvqbl5"))))
1318 (build-system pyproject-build-system)
1319 (arguments
1320 (list
1321 ;; tests: 2609 passed
1322 #:phases
1323 #~(modify-phases %standard-phases
1324 (add-after 'unpack 'configure
1325 (lambda* (#:key inputs #:allow-other-keys)
1326 ;; Set absolute store path to borg.
1327 (substitute* "borgmatic/commands/borgmatic.py"
1328 (("\\.get\\('local_path', 'borg'\\)")
1329 (string-append ".get('local_path', '"
1330 (search-input-file inputs "bin/borg")
1331 "')")))
1332 (substitute* "tests/unit/commands/test_borgmatic.py"
1333 (("(module.get_local_path.+ == )'borg'" all start)
1334 (string-append start "'"
1335 (search-input-file inputs "bin/borg")
1336 "'"))))))))
1337 (native-inputs
1338 (list python-flexmock
1339 python-pytest
1340 python-pytest-timeout
1341 python-setuptools))
1342 (inputs
1343 (list borg
1344 python-apprise
1345 python-jsonschema
1346 python-requests
1347 python-ruamel.yaml))
1348 (home-page "https://torsion.org/borgmatic/")
1349 (synopsis "Simple, configuration-driven backup software")
1350 (description
1351 "borgmatic is simple, configuration-driven backup software for servers
1352and workstations. Protect your files with client-side encryption. Backup
1353your databases too. Monitor it all with integrated third-party services.
1354borgmatic is powered by borg.")
1355 (license license:gpl3+)))
1356
1357(define-public bup
1358 (package
1359 (name "bup")
1360 (version "0.34")
1361 (source
1362 (origin
1363 (method git-fetch)
1364 (uri (git-reference
1365 (url "https://github.com/bup/bup/")
1366 (commit version)))
1367 (file-name (git-file-name name version))
1368 (sha256
1369 (base32
1370 "04a0582i5rkz4mhwpp5345kap98g1mg2vn4vwldifh2ja89aqghp"))))
1371 (build-system gnu-build-system)
1372 (arguments
1373 (list
1374 #:make-flags #~(list (string-append "PREFIX=" #$output))
1375 #:phases
1376 #~(modify-phases %standard-phases
1377 (add-after 'unpack 'fix-version-placeholder
1378 (lambda _
1379 (substitute* "lib/bup/source_info.py"
1380 (("\\$Format:%H\\$") #$(string-append "v" version))
1381 (("\\$Format:%ci\\$") "2026-09-01 20:36:00 -0300")
1382 (("\\$Format:%d\\$") ""))))
1383 (add-after 'unpack 'fix-test-treesplit
1384 (lambda* (#:key inputs #:allow-other-keys)
1385 (substitute* "test/ext/test-treesplit"
1386 (("/bin/sh" all)
1387 (search-input-file inputs all)))))
1388 (replace 'configure
1389 (lambda* (#:key inputs #:allow-other-keys)
1390 (setenv "BUP_PYTHON_CONFIG"
1391 (search-input-file inputs "/bin/python3-config"))
1392 (invoke "./configure" "--with-pylint=no")))
1393 (add-after 'build 'skip-broken-tests
1394 ;; meta and on: needs root and complete /etc/group.
1395 ;; TODO: install, set test MANPATH correctly,
1396 ;; Deselected tests are deprecated, bup works with [email protected].
1397 ;; the tests use string to set attr instead byte.
1398 (lambda _
1399 (setenv "PYTEST_ADDOPTS"
1400 (string-join
1401 (list "--ignore=test/ext/test-meta"
1402 "--ignore=test/ext/test-on"
1403 "--ignore=test/ext/test-install"
1404 (string-append
1405 "--deselect=test/int/test_metadata.py::"
1406 "test_user_xattr")
1407 (string-append
1408 "--deselect=test/int/test_metadata.py::"
1409 "test_handling_of_incorrect_existing_linux_xattrs"))
1410 " ")))))))
1411 (native-inputs
1412 (list bash-minimal
1413 man-db
1414 pandoc
1415 pkg-config
1416 python-pytest
1417 rsync
1418 tzdata)) ;for tests
1419 (inputs
1420 (list acl
1421 par2cmdline
1422 python
1423 readline))
1424 (propagated-inputs
1425 (list git-minimal
1426 perl
1427 python-xattr))
1428 (home-page "https://bup.github.io/")
1429 (synopsis "Backup program using rolling checksums and git file formats")
1430 (description "Backup system based on the git packfile format, providing
1431fast incremental saves and global deduplication (among and within files,
1432including virtual machine images).")
1433 (license license:lgpl2.0)))
1434
1435(define-public vorta
1436 (package
1437 (name "vorta")
1438 (version "0.11.3")
1439 ;; The test folder is not included in the PyPI archive.
1440 (source (origin
1441 (method git-fetch)
1442 (uri (git-reference
1443 (url "https://github.com/borgbase/vorta")
1444 (commit (string-append "v" version))))
1445 (file-name (git-file-name name version))
1446 (sha256
1447 (base32
1448 "0505id65lbbqj42lp4cvbw1q6v9qjhsnldr72ssv1kyir672j2pr"))))
1449 (build-system pyproject-build-system)
1450 (arguments
1451 (list
1452 #:test-flags
1453 #~(list "-k" "not test_excludes"
1454 "--ignore=tests/integration"
1455 "--ignore=tests/unit"
1456 "--ignore=tests/network_manager/test_darwin.py")
1457 #:imported-modules `((guix build qt-utils)
1458 (guix build cmake-build-system)
1459 (guix build qt-build-system)
1460 ,@%pyproject-build-system-modules)
1461 #:modules '((guix build utils)
1462 (guix build pyproject-build-system)
1463 ((guix build qt-build-system) #:prefix qt:))
1464 #:phases
1465 #~(modify-phases %standard-phases
1466 (add-after 'unpack 'patch-borg-path
1467 (lambda* (#:key inputs #:allow-other-keys)
1468 (substitute* "src/vorta/borg/borg_job.py"
1469 (("which\\('borg'\\)")
1470 (string-append "which('" #$(this-package-input "borg")
1471 "/bin/borg')")))))
1472 ;; XXX The test suite tries to write to $HOME.
1473 (add-before 'sanity-check 'set-HOME
1474 (lambda _
1475 (setenv "HOME" "/tmp")))
1476 ;; Otherwise, the user interface's icons will be missing.
1477 (add-after 'wrap 'qt-wrap
1478 (assoc-ref qt:%standard-phases 'qt-wrap)))))
1479 (native-inputs
1480 (list python-platformdirs
1481 python-pytest
1482 python-pytest-mock
1483 python-pytest-qt
1484 python-setuptools
1485 python-setuptools-git))
1486 (inputs
1487 (list borg
1488 python-appdirs
1489 python-dateutil
1490 python-keyring
1491 python-paramiko
1492 python-peewee
1493 python-psutil
1494 python-pyqt-6
1495 python-secretstorage
1496 ;; This is included so that the qt-wrap phase picks it up.
1497 qtsvg))
1498 (home-page "https://vorta.borgbase.com")
1499 (synopsis "Graphical backup client based on BorgBackup")
1500 (description "Vorta is a graphical backup client based on the Borg backup
1501tool. It supports the use of remote backup repositories. It can perform
1502scheduled backups, and has a graphical tool for browsing and extracting the Borg
1503archives.")
1504 (license license:gpl3+)))
1505
1506(define-public grsync
1507 (package
1508 (name "grsync")
1509 (version "1.3.1")
1510 (source (origin
1511 (method url-fetch)
1512 (uri (string-append "http://www.opbyte.it/release/"
1513 "grsync-" version ".tar.gz"))
1514 (sha256
1515 (base32
1516 "1ly6ng211wj9sc0la73jsz2lviwd7b4a7bhw16kmnbm6v8jhxk1k"))))
1517 (build-system gnu-build-system)
1518 (native-inputs (list intltool pkg-config))
1519 (inputs (list gtk+))
1520 (propagated-inputs (list rsync))
1521 (home-page "https://www.opbyte.it/grsync/")
1522 (synopsis "GTK frontend for rsync")
1523 (description
1524 "Grsync is a simple graphical interface using GTK for the @command{rsync}
1525command line program. It currently supports only a limited set of the most
1526important rsync features, but can be used effectively for local directory
1527synchronization.")
1528 (license license:gpl2)))