Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / backup.scm
index 1bb05d9..e663cdc 100644 (file)
@@ -13,6 +13,8 @@
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
 ;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2019 Alex Vong <alexvong1995@gmail.com>
+;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -212,14 +214,16 @@ backups (called chunks) to allow easy burning to CD/DVD.")
          "0pl25mmz1b1cnwf35kxmygyy9g7z7hslxbx329a9yx8csh7dahw6"))))
     (build-system gnu-build-system)
     (inputs
-     `(("zlib" ,zlib)
-       ("nettle" ,nettle)
-       ("lzo" ,lzo)
-       ("bzip2" ,bzip2)
+     `(("bzip2" ,bzip2)
        ("libxml2" ,libxml2)
-       ("xz" ,xz)))
+       ("lzo" ,lzo)
+       ("nettle" ,nettle)
+       ("xz" ,xz)
+       ("zlib" ,zlib)
+       ("zstd" ,zstd "lib")))
     (arguments
-     `(#:phases
+     `(#:configure-flags '("--disable-static")
+       #:phases
        (modify-phases %standard-phases
          (add-before 'build 'patch-pwd
            (lambda _
@@ -227,17 +231,34 @@ backups (called chunks) to allow easy burning to CD/DVD.")
                (("/bin/pwd") (which "pwd")))
              #t))
          (replace 'check
-           (lambda _
-             ;; XXX: The test_owner_parse, test_read_disk, and
-             ;; test_write_disk_lookup tests expect user 'root' to exist, but
-             ;; the chroot's /etc/passwd doesn't have it.  Turn off those tests.
-             ;;
-             ;; The tests allow one to disable tests matching a globbing pattern.
-             (invoke "make" "libarchive_test" "bsdcpio_test" "bsdtar_test")
-             ;; XXX: This glob disables too much.
-             (invoke "./libarchive_test" "^test_*_disk*")
-             (invoke "./bsdcpio_test" "^test_owner_parse")
-             (invoke "./bsdtar_test")))
+           (lambda* (#:key (tests? #t) #:allow-other-keys)
+             (if tests?
+                ;; XXX: The test_owner_parse, test_read_disk, and
+                ;; test_write_disk_lookup tests expect user 'root' to
+                ;; exist, but the chroot's /etc/passwd doesn't have
+                ;; it.  Turn off those tests.
+                ;;
+                ;; XXX: Adjust test that fails with zstd 1.4.1
+                ;; because the default options compresses two bytes
+                ;; better than this test expects.
+                ;; https://github.com/libarchive/libarchive/issues/1226
+                 (begin
+                   (substitute* "libarchive/test/test_write_filter_zstd.c"
+                    (("compression-level\", \"6\"")
+                     "compression-level\", \"7\""))
+
+                  ;; The tests allow one to disable tests matching a globbing pattern.
+                  (invoke "make"
+                          "libarchive_test"
+                          "bsdcpio_test"
+                          "bsdtar_test")
+
+                  ;; XXX: This glob disables too much.
+                  (invoke "./libarchive_test" "^test_*_disk*")
+                  (invoke "./bsdcpio_test" "^test_owner_parse")
+                  (invoke "./bsdtar_test"))
+                 ;; Tests may be disabled if cross-compiling.
+                 (format #t "Test suite not run.~%"))))
          (add-after 'install 'add--L-in-libarchive-pc
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out     (assoc-ref outputs "out"))
@@ -246,8 +267,11 @@ backups (called chunks) to allow easy burning to CD/DVD.")
                     (libxml2 (assoc-ref inputs "libxml2"))
                     (xz      (assoc-ref inputs "xz"))
                     (zlib    (assoc-ref inputs "zlib"))
+                    (zstd    (assoc-ref inputs "zstd"))
                     (bzip2   (assoc-ref inputs "bzip2")))
-               (substitute* (string-append lib "/pkgconfig/libarchive.pc")
+               ;; Embed absolute references to these inputs to avoid propagation.
+               (substitute* (list (string-append lib "/pkgconfig/libarchive.pc")
+                                  (string-append lib "/libarchive.la"))
                  (("-lnettle")
                   (string-append "-L" nettle "/lib -lnettle"))
                  (("-lxml2")
@@ -256,6 +280,8 @@ backups (called chunks) to allow easy burning to CD/DVD.")
                   (string-append "-L" xz "/lib -llzma"))
                  (("-lz")
                   (string-append "-L" zlib "/lib -lz"))
+                 (("-lzstd")
+                  (string-append "-L" zstd "/lib -lzstd"))
                  (("-lbz2")
                   (string-append "-L" bzip2 "/lib -lbz2")))
                #t))))))
@@ -277,13 +303,13 @@ random access nor for in-place modification.")
     (version "1.1.15")
     (source
      (origin
-       (method url-fetch)
-       (file-name (string-append name "-" version ".tar.gz"))
-       (uri (string-append "https://github.com/miekg/rdup/archive/"
-                           version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/miekg/rdup.git")
+             (commit version)))
+       (file-name (git-file-name name version))
        (sha256
-        (base32
-         "1jr91hgcf0rrpanqlwws72ql9db6d6grs2i122ki1s4bx0vqqyvq"))))
+        (base32 "0bzyv6qmnivxnv9nw7lnfn46k0m1dlxcjj53zcva6v8y8084l1iw"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("autoconf" ,autoconf)
@@ -293,11 +319,14 @@ random access nor for in-place modification.")
        ;; For tests.
        ("dejagnu" ,dejagnu)))
     (inputs
+     ;; XXX Compiling with nettle (encryption) support requires patching out
+     ;; -Werror from GNUmakefile.in.  Then, rdup-tr-{en,de}crypt tests fail:
+     ;; free(): invalid pointer
+     ;; ** rdup-tr: SIGPIPE received, exiting
      `(("glib" ,glib)
        ("pcre" ,pcre)
        ("libarchive" ,libarchive)
-       ("mcrypt" ,mcrypt)
-       ("nettle" ,nettle)))
+       ("mcrypt" ,mcrypt)))
     (arguments
      `(#:parallel-build? #f             ;race conditions
        #:phases
@@ -313,6 +342,13 @@ random access nor for in-place modification.")
                ;; Avoid frivolous dependency on ‘which’ with a shell builtin.
                (("which") "command -v"))
              #t))
+         (add-before 'check 'disable-encryption-tests
+           (lambda _
+             (for-each delete-file
+                       (list "testsuite/rdup/rdup.rdup-tr-crypt.exp"
+                             "testsuite/rdup/rdup.rdup-tr-decrypt.exp"
+                             "testsuite/rdup/rdup.rdup-tr-encrypt.exp"))
+             #t))
          (add-before 'check 'pre-check
            (lambda _
              (setenv "HOME" (getcwd))
@@ -696,63 +732,6 @@ NTFS volumes using @code{ntfs-3g}, preserving NTFS-specific attributes.")
                    license:lgpl3+
                    license:cc0))))
 
-(define-public obnam
-  (package
-    (name "obnam")
-    (version "1.21")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append
-             "http://code.liw.fi/debian/pool/main/o/obnam/obnam_"
-             version ".orig.tar.xz"))
-       (sha256
-        (base32
-         "0qlipsq50hca71zc0dp1mg9zs12qm0sbblw7qfzl0hj6mk2rv1by"))))
-    (build-system python-build-system)
-    (arguments
-     `(#:python ,python-2
-       #:phases
-       (modify-phases %standard-phases
-         (replace 'check
-                  (lambda _
-                    (substitute* "obnamlib/vfs_local_tests.py"
-                      ;; Check for the nobody user instead of root.
-                      (("self.fs.get_username\\(0\\), 'root'")
-                       "self.fs.get_username(65534), 'nobody'")
-                      ;; Disable tests checking for root group.
-                      (("self.fs.get_groupname\\(0\\)") "'root'"))
-                    (substitute* "obnamlib/vfs_local.py"
-                      ;; Don't cover get_groupname function.
-                      (("def get_groupname\\(self, gid\\):")
-                       "def get_groupname(self, gid):  # pragma: no cover"))
-                    ;; Can't run network tests.
-                    (invoke "./check" "--unit-tests"))))))
-    (inputs
-     `(("python2-cliapp" ,python2-cliapp)
-       ("python2-larch" ,python2-larch)
-       ("python2-paramiko" ,python2-paramiko)
-       ("python2-pyaml" ,python2-pyaml)
-       ("python2-tracing" ,python2-tracing)
-       ("python2-ttystatus" ,python2-ttystatus)))
-    (native-inputs
-     `(("gnupg" ,gnupg)
-       ("python2-coverage" ,python2-coverage)
-       ("python2-coverage-test-runner" ,python2-coverage-test-runner)
-       ("python2-pep8" ,python2-pep8)
-       ("python2-pylint" ,python2-pylint)))
-    (home-page "https://obnam.org/")
-    (synopsis "Retired backup program")
-    (description
-     "Warning: @uref{https://blog.liw.fi/posts/2017/08/13/retiring_obnam/,
-the Obnam project is retired}.  You should use another backup solution instead.
-
-Obnam was an easy, secure backup program.  Features included snapshot backups,
-data de-duplication and encrypted backups using GnuPG.  Backups can be stored on
-local hard disks, or online via the SSH SFTP protocol.  The backup server, if
-used, does not require any special software, on top of SSH.")
-    (license license:gpl3+)))
-
 (define-public dirvish
   (package
     (name "dirvish")
@@ -863,7 +842,7 @@ is like a time machine for your data. ")
 (define-public restic
   (package
     (name "restic")
-    (version "0.9.5")
+    (version "0.9.6")
     ;; TODO Try packaging the bundled / vendored dependencies in the 'vendor/'
     ;; directory.
     (source (origin
@@ -874,7 +853,7 @@ is like a time machine for your data. ")
               (file-name (string-append name "-" version ".tar.gz"))
               (sha256
                (base32
-                "0afl3dv7gzwdc9klikk3fsb57d0px2fwihb0xxb7zq7d8vlhh8p2"))))
+                "1zmh42aah32ah8w5n6ilz9bci0y2xrf8p7qshy3yf1lzm5gnbj0w"))))
     (build-system go-build-system)
     (arguments
      `(#:import-path "github.com/restic/restic"