gnu: Borg: Update to 1.2.0.

* gnu/packages/backup.scm (borg): Update to 1.2.0.
[source]: Adjust the list of Cython files to rebuild. Remove an obsolete
substitution. Delete the bundled xxhash. Blake2 is no longer bundled.
[native-inputs]: Add python-dateutil.
[inputs]: Add xxhash. Add python-msgpack-1.2. Remove libb2.
[arguments]: Export BORG_LIBXXHASH_PREFIX to ensure the build script can find
xxhash. Adjust the list of skipped tests and make the custom 'check' phase honor
tests?. Install some more documentation.
This commit is contained in:
Leo Famulari 2022-01-21 02:44:34 -05:00
parent b9e01b7516
commit 50ccffb89e
No known key found for this signature in database
GPG key ID: 2646FA30BACA7F08

View file

@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014, 2015, 2020 Eric Bavier <bavier@posteo.net> ;;; Copyright © 2014, 2015, 2020 Eric Bavier <bavier@posteo.net>
;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net> ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
;;; Copyright © 2015, 2016, 2017, 2021 Leo Famulari <leo@famulari.name> ;;; Copyright © 2015, 2016, 2017, 2021, 2022 Leo Famulari <leo@famulari.name>
;;; Copyright © 20172021 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 20172021 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be> ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
;;; Copyright © 2017, 2021 Arun Isaac <arunisaac@systemreboot.net> ;;; Copyright © 2017, 2021 Arun Isaac <arunisaac@systemreboot.net>
@ -62,6 +62,7 @@ (define-module (gnu packages backup)
#:use-module (gnu packages crypto) #:use-module (gnu packages crypto)
#:use-module (gnu packages databases) #:use-module (gnu packages databases)
#:use-module (gnu packages datastructures) #:use-module (gnu packages datastructures)
#:use-module (gnu packages digest)
#:use-module (gnu packages dbm) #:use-module (gnu packages dbm)
#:use-module (gnu packages dejagnu) #:use-module (gnu packages dejagnu)
#:use-module (gnu packages ftp) #:use-module (gnu packages ftp)
@ -629,13 +630,13 @@ (define-public libchop
(define-public borg (define-public borg
(package (package
(name "borg") (name "borg")
(version "1.1.17") (version "1.2.0")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (pypi-uri "borgbackup" version)) (uri (pypi-uri "borgbackup" version))
(sha256 (sha256
(base32 "0x0ncy0b0bmf586hbdgrif3gjmkdw760vfnfxndr493v07y29fbs")) (base32 "0rvzmy9qyicfs65qwy0n1nkvsidkcvx7kix43885dx1fj13mb6p3"))
(modules '((guix build utils))) (modules '((guix build utils)))
(snippet (snippet
'(begin '(begin
@ -645,8 +646,6 @@ (define-public borg
;; generate the wrong list. ;; generate the wrong list.
(for-each delete-file (for-each delete-file
'("src/borg/algorithms/checksums.c" '("src/borg/algorithms/checksums.c"
"src/borg/algorithms/msgpack/_packer.cpp"
"src/borg/algorithms/msgpack/_unpacker.cpp"
"src/borg/chunker.c" "src/borg/chunker.c"
"src/borg/compress.c" "src/borg/compress.c"
"src/borg/crypto/low_level.c" "src/borg/crypto/low_level.c"
@ -656,11 +655,12 @@ (define-public borg
"src/borg/platform/freebsd.c" "src/borg/platform/freebsd.c"
"src/borg/platform/linux.c" "src/borg/platform/linux.c"
"src/borg/platform/posix.c" "src/borg/platform/posix.c"
"src/borg/platform/syncfilerange.c")) "src/borg/platform/syncfilerange.c"
"src/borg/platform/windows.c"))
;; Remove bundled shared libraries. ;; Remove bundled shared libraries.
(with-directory-excursion "src/borg/algorithms" (with-directory-excursion "src/borg/algorithms"
(for-each delete-file-recursively (for-each delete-file-recursively
(list "blake2" "lz4" "zstd"))) (list "lz4" "xxh64" "zstd")))
#t)))) #t))))
(build-system python-build-system) (build-system python-build-system)
(arguments (arguments
@ -672,12 +672,12 @@ (define-public borg
(add-after 'unpack 'set-env (add-after 'unpack 'set-env
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let ((openssl (assoc-ref inputs "openssl")) (let ((openssl (assoc-ref inputs "openssl"))
(libb2 (assoc-ref inputs "libb2"))
(lz4 (assoc-ref inputs "lz4")) (lz4 (assoc-ref inputs "lz4"))
(xxhash (assoc-ref inputs "xxhash"))
(zstd (assoc-ref inputs "zstd"))) (zstd (assoc-ref inputs "zstd")))
(setenv "BORG_OPENSSL_PREFIX" openssl) (setenv "BORG_OPENSSL_PREFIX" openssl)
(setenv "BORG_LIBB2_PREFIX" libb2)
(setenv "BORG_LIBLZ4_PREFIX" lz4) (setenv "BORG_LIBLZ4_PREFIX" lz4)
(setenv "BORG_LIBXXHASH_PREFIX" xxhash)
(setenv "BORG_LIBZSTD_PREFIX" zstd) (setenv "BORG_LIBZSTD_PREFIX" zstd)
(setenv "PYTHON_EGG_CACHE" "/tmp") (setenv "PYTHON_EGG_CACHE" "/tmp")
;; The test 'test_return_codes[python]' fails when ;; The test 'test_return_codes[python]' fails when
@ -687,32 +687,37 @@ (define-public borg
;; The tests need to be run after Borg is installed. ;; The tests need to be run after Borg is installed.
(delete 'check) (delete 'check)
(add-after 'install 'check (add-after 'install 'check
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs tests? #:allow-other-keys)
;; Make the installed package available for the test suite. (when tests?
(add-installed-pythonpath inputs outputs) ;; Make the installed package available for the test suite.
;; The tests should be run in an empty directory. (add-installed-pythonpath inputs outputs)
(mkdir-p "tests") ;; The tests should be run in an empty directory.
(with-directory-excursion "tests" (mkdir-p "tests")
(invoke "py.test" "-v" "--pyargs" "borg.testsuite" "-k" (with-directory-excursion "tests"
(string-append (invoke "py.test" "-v" "--pyargs" "borg.testsuite" "-k"
;; These tests need to write to '/var'. (string-append
"not test_get_cache_dir " ;; These tests need to write to '/var'.
"and not test_get_config_dir " "not test_get_cache_dir "
"and not test_get_keys_dir " "and not test_get_config_dir "
"and not test_get_security_dir " "and not test_get_keys_dir "
;; These tests assume there is a root user in "and not test_get_security_dir "
;; '/etc/passwd'. ;; These tests assume there is a root user in '/etc/passwd'.
"and not test_access_acl " "and not test_access_acl "
"and not test_default_acl " "and not test_default_acl "
"and not test_non_ascii_acl " "and not test_get_item_uid_gid "
"and not test_create_stdin " "and not test_non_ascii_acl "
;; This test needs the unpackaged pytest-benchmark. "and not test_create_content_from_command "
"and not benchmark " "and not test_create_content_from_command_with_failed_command "
;; These tests assume the kernel supports FUSE. "and not test_create_stdin "
"and not test_fuse " ;; We don't need to run benchmarks
"and not test_fuse_allow_damaged_files " "and not benchmark "
"and not test_mount_hardlinks " ;; These tests assume the kernel supports FUSE.
"and not test_readonly_mount "))))) "and not test_fuse "
"and not test_fuse_allow_damaged_files "
"and not test_mount_hardlinks "
"and not test_readonly_mount "
"and not test_fuse_versions_view "
"and not test_migrate_lock_alive"))))))
(add-after 'install 'install-doc (add-after 'install 'install-doc
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))
@ -720,10 +725,10 @@ (define-public borg
(misc (string-append out "/share/borg/misc"))) (misc (string-append out "/share/borg/misc")))
(for-each (cut install-file <> misc) (for-each (cut install-file <> misc)
'("docs/misc/create_chunker-params.txt" '("docs/misc/create_chunker-params.txt"
"docs/misc/borg-data-flow.png"
"docs/misc/internals-picture.txt" "docs/misc/internals-picture.txt"
"docs/misc/prune-example.txt")) "docs/misc/prune-example.txt"))
(copy-recursively "docs/man" man) (copy-recursively "docs/man" man))))
#t)))
(add-after 'install-docs 'install-shell-completions (add-after 'install-docs 'install-shell-completions
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))
@ -735,24 +740,27 @@ (define-public borg
(install-file "zsh/_borg" (install-file "zsh/_borg"
(string-append share "/zsh/site-functions")) (string-append share "/zsh/site-functions"))
(install-file "fish/borg.fish" (install-file "fish/borg.fish"
(string-append share "/fish/vendor_completions.d"))) (string-append share "/fish/vendor_completions.d")))))))))
#t))))))
(native-inputs (native-inputs
(list python-cython python-setuptools-scm python-pytest)) (list python-cython python-dateutil python-setuptools-scm python-pytest))
(inputs (inputs
(list acl (list acl
libb2
lz4 lz4
openssl openssl
;; This is the latest version of msgpack accepted by 'setup.py'.
python-msgpack-1.0.2
;; FUSE 3 isn't working well, so we stick with FUSE 2 for now:
;; <https://issues.guix.gnu.org/53407>
python-llfuse python-llfuse
`(,zstd "lib"))) `(,zstd "lib")
xxhash))
(synopsis "Deduplicated, encrypted, authenticated and compressed backups") (synopsis "Deduplicated, encrypted, authenticated and compressed backups")
(description "Borg is a deduplicating backup program. Optionally, it (description "Borg is a deduplicating backup program. Optionally, it
supports compression and authenticated encryption. The main goal of Borg is to supports compression and authenticated encryption. The main goal of Borg is to
provide an efficient and secure way to backup data. The data deduplication provide an efficient and secure way to backup data. The data deduplication
technique used makes Borg suitable for daily backups since only changes are technique used makes Borg suitable for daily backups since only changes are
stored. The authenticated encryption technique makes it suitable for stored. The authenticated encryption technique makes it suitable for storing
storing backups on untrusted computers.") backups on untrusted computers.")
(home-page "https://www.borgbackup.org/") (home-page "https://www.borgbackup.org/")
(license license:bsd-3))) (license license:bsd-3)))