gnu: Add rust-bitflags-0.5
[jackhill/guix/guix.git] / gnu / packages / diffoscope.scm
index a362285..1df8552 100644 (file)
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2018, 2019 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2019 Vagrant Cascadian <vagrant@reproducible-builds.org>
@@ -44,6 +44,8 @@
   #:use-module (gnu packages java)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
+  #:use-module (gnu packages man)
+  #:use-module (gnu packages maths)
   #:use-module (gnu packages mono)
   #:use-module (gnu packages ocaml)
   #:use-module (gnu packages package-management)
@@ -55,6 +57,7 @@
   #:use-module (gnu packages ssh)
   #:use-module (gnu packages statistics)
   #:use-module (gnu packages textutils)
+  #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages vim)
   #:use-module (gnu packages web)
@@ -67,7 +70,7 @@
   #:use-module (ice-9 match))
 
 (define-public diffoscope
-  (let ((version "134"))
+  (let ((version "143"))
     (package
       (name "diffoscope")
       (version version)
@@ -79,7 +82,7 @@
                 (file-name (git-file-name name version))
                 (sha256
                  (base32
-                  "04078cn3lazcrpgzzzy1s9721hprkylrvfa58izm4dcvgd7a593z"))))
+                  "0j58dqdk8ln8y0bcnfy37ljs37nkl56lzxqns396300ysln0qiwm"))))
       (build-system python-build-system)
       (arguments
        `(#:phases (modify-phases %standard-phases
                       (lambda _
                         (substitute* "setup.py"
                           (("'python-magic',") ""))))
+                    ;; Patch in support for known tools
+                    (add-after 'unpack 'add-known-tools
+                      (lambda _
+                        (substitute* "diffoscope/external_tools.py"
+                          (("'debian': 'openssl'")
+                           "'debian': 'openssl', 'guix': 'openssl'"))))
                     ;; This test is broken because our `file` package has a
                     ;; bug in berkeley-db file type detection.
                     (add-after 'unpack 'remove-berkeley-test
       (native-inputs `(("python-pytest" ,python-pytest)
                        ("python-chardet" ,python-chardet)
                        ("python-binwalk" ,python-binwalk)
+                       ("python-h5py" ,python-h5py)
                        ("python-pypdf2" ,python-pypdf2)
                        ("python-progressbar33" ,python-progressbar33)
                        ;; test suite skips tests when tool is missing
                        ("giflib:bin" ,giflib "bin")
                        ("gnumeric" ,gnumeric)
                        ("gnupg" ,gnupg)
+                       ("hdf5" ,hdf5)
                        ("imagemagick" ,imagemagick)
                        ("libarchive" ,libarchive)
                        ("llvm" ,llvm)
                        ("ocaml" ,ocaml)
                        ("odt2txt" ,odt2txt)
                        ("openssh" ,openssh)
+                       ("openssl" ,openssl)
                        ("pgpdump" ,pgpdump)
                        ("poppler" ,poppler)
                        ("python-jsbeautifier" ,python-jsbeautifier)
        "Diffoscope tries to get to the bottom of what makes files or directories
 different.  It recursively unpacks archives of many kinds and transforms
 various binary formats into more human readable forms to compare them.  It can
-compare two tarballs, ISO images, or PDFs just as easily.")
+compare two tarballs, ISO images, or PDFs just as easily.
+
+Diffoscope has many optional dependencies; @code{diffoscope
+--list-missing-tools guix} will display optional packages to
+install.")
       (license license:gpl3+))))
 
+(define-public reprotest
+  (package
+    (name "reprotest")
+    (version "0.7.14")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://salsa.debian.org/reproducible-builds/reprotest.git")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "12d07xq5zx5dfbsgakm6zcn7hgf0h9f5kvfjqkiyak4ix5aa6xkf"))))
+    (inputs
+     `(("python-debian" ,python-debian)
+       ("python-distro" ,python-distro)
+       ("python-libarchive-c", python-libarchive-c)
+       ("python-rstr" ,python-rstr)))
+    (native-inputs
+     `(("diffoscope" ,diffoscope)
+       ("help2man" ,help2man)
+       ("libfaketime" ,libfaketime)
+       ("python-coverage" ,python-coverage)
+       ("python-docutils" ,python-docutils)
+       ("python-pytest " ,python-pytest)
+       ("python-tlsh" ,python-tlsh)
+       ("python-tox" ,python-tox)
+       ("unzip" ,unzip)
+       ("xxd" ,xxd)))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; Neither glibc-locales nor glibc-utf8-locales have the C.UTF-8
+         ;; locale or several other locales used in reprotest.
+         (add-after 'unpack 'adjust-locales
+           (lambda _
+             (substitute* "reprotest/build.py"
+               (("'C.UTF-8'") "'en_US.UTF-8'")
+               (("'ru_RU.CP1251'") "'ru_RU.KOI8-R'")
+               (("'kk_KZ.RK1048'") "'kk_KZ'"))
+             (substitute* "reprotest/lib/adt_testbed.py"
+               (("export LANG=C.UTF-8") "export LANG=en_US.UTF-8"))
+             #t))
+         (add-after 'install 'install-doc
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((mandir1 (string-append
+                              (assoc-ref outputs "out") "/share/man/man1"))
+                    (docdir (string-append
+                             (assoc-ref outputs "out") "/share/doc/" ,name "-" ,version)))
+               (invoke "make" "-C" "doc")
+               (mkdir-p mandir1)
+               (install-file "doc/reprotest.1" mandir1)
+               (mkdir-p docdir)
+               (install-file "./README.rst" docdir)
+               (install-file "./README-dev.rst" docdir))
+             #t)))))
+    (home-page "https://salsa.debian.org/reproducible-builds/reprotest")
+    (synopsis "Build software and check it for reproducibility")
+    (description "Reprotest builds the same source code twice in different
+environments, and then checks the binaries produced by each build for
+differences.  If any are found, then diffoscope or diff is used to display
+them in detail for later analysis.")
+    (license (list license:gpl3+ license:gpl2+))))
+
 (define-public trydiffoscope
  (package
    (name "trydiffoscope")