projects/guix·blob java-team · refs

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