From 52211add0b125be7e8a00bea2b3b030286109022 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Sun, 8 Sep 2019 14:36:33 -0700 Subject: gnu: Move diffoscope and trydiffoscope to new diffoscope.scm. * gnu/packages/package-management (diffoscope): Remove variable. (trydiffoscope): Remove variable. Update copyright information. * gnu/packages/diffoscope.scm: New file. (diffoscope): Add variable. (trydiffoscope): Add variable. * gnu/local.mk [GNU_SYSTEM_MODULES]: Add diffoscope.scm. --- gnu/packages/diffoscope.scm | 231 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 231 insertions(+) create mode 100644 gnu/packages/diffoscope.scm (limited to 'gnu/packages/diffoscope.scm') diff --git a/gnu/packages/diffoscope.scm b/gnu/packages/diffoscope.scm new file mode 100644 index 0000000000..6eb5c1d9fe --- /dev/null +++ b/gnu/packages/diffoscope.scm @@ -0,0 +1,231 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2017 Ricardo Wurmus +;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice +;;; Copyright © 2018 Julien Lepiller +;;; Copyright © 2018, 2019 Rutger Helling +;;; Copyright © 2019 Vagrant Cascadian +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages diffoscope) + #:use-module (gnu packages) + #:use-module (gnu packages acl) + #:use-module (gnu packages admin) + #:use-module (gnu packages backup) + #:use-module (gnu packages base) + #:use-module (gnu packages cdrom) + #:use-module (gnu packages check) + #:use-module (gnu packages compression) + #:use-module (gnu packages cpio) + #:use-module (gnu packages dbm) + #:use-module (gnu packages gettext) + #:use-module (gnu packages ghostscript) + #:use-module (gnu packages gnome) + #:use-module (gnu packages gnupg) + #:use-module (gnu packages haskell) + #:use-module (gnu packages image) + #:use-module (gnu packages imagemagick) + #:use-module (gnu packages java) + #:use-module (gnu packages linux) + #:use-module (gnu packages llvm) + #:use-module (gnu packages mono) + #:use-module (gnu packages package-management) + #:use-module (gnu packages patchutils) + #:use-module (gnu packages pdf) + #:use-module (gnu packages python-web) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages sqlite) + #:use-module (gnu packages ssh) + #:use-module (gnu packages textutils) + #:use-module (gnu packages video) + #:use-module (gnu packages vim) + #:use-module (guix build-system python) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix utils)) + +(define-public diffoscope + (let ((version "123")) + (package + (name "diffoscope") + (version version) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://salsa.debian.org/reproducible-builds/diffoscope.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "11bxms5rkhi0v4pxx29v4qgvhp3fmf0fkzci6gn5xcv4fl1zy4wj")))) + (build-system python-build-system) + (arguments + `(#:phases (modify-phases %standard-phases + ;; setup.py mistakenly requires python-magic from PyPi, even + ;; though the Python bindings of `file` are sufficient. + ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815844 + (add-after 'unpack 'dependency-on-python-magic + (lambda _ + (substitute* "setup.py" + (("'python-magic',") "")))) + ;; This test is broken because our `file` package has a + ;; bug in berkeley-db file type detection. + (add-after 'unpack 'remove-berkeley-test + (lambda _ + (delete-file "tests/comparators/test_berkeley_db.py") + #t)) + ;; Test is dynamically generated and may have false + ;; negatives with different ocaml versions. Further + ;; background in: https://bugs.debian.org/939386 + (add-after 'unpack 'remove-ocaml-test + (lambda _ + (delete-file "tests/comparators/test_ocaml.py") + #t)) + (add-after 'unpack 'embed-tool-references + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "diffoscope/comparators/utils/compare.py" + (("\\['xxd',") + (string-append "['" (which "xxd") "',"))) + (substitute* "diffoscope/comparators/elf.py" + (("@tool_required\\('readelf'\\)") "") + (("get_tool_name\\('readelf'\\)") + (string-append "'" (which "readelf") "'"))) + (substitute* "diffoscope/comparators/directory.py" + (("@tool_required\\('stat'\\)") "") + (("@tool_required\\('getfacl'\\)") "") + (("\\['stat',") + (string-append "['" (which "stat") "',")) + (("\\['getfacl',") + (string-append "['" (which "getfacl") "',"))) + #t)) + (add-before 'check 'writable-test-data + (lambda _ + ;; tests may need needs write access to tests + ;; directory + (for-each make-file-writable (find-files "tests")) + #t)) + (add-before 'check 'delete-failing-test + (lambda _ + ;; this requires /sbin to be on the path + (delete-file "tests/test_tools.py") + #t))))) + (inputs `(("rpm" ,rpm) ;for rpm-python + ("python-file" ,python-file) + ("python-debian" ,python-debian) + ("python-libarchive-c" ,python-libarchive-c) + ("python-tlsh" ,python-tlsh) + ("acl" ,acl) ;for getfacl + ("colordiff" ,colordiff) + ("xxd" ,xxd))) + ;; Below are modules used for tests. + (native-inputs `(("python-pytest" ,python-pytest) + ("python-chardet" ,python-chardet) + ;; test suite skips tests when tool is missing + ("bdb" ,bdb) + ("binutils" ,binutils) + ("bzip2" ,bzip2) + ("cdrtools" ,cdrtools) + ("colord" ,colord) + ("cpio" ,cpio) + ("docx2txt" ,docx2txt) + ("e2fsprogs" ,e2fsprogs) + ("ffmpeg" ,ffmpeg) + ("gettext" ,gettext-minimal) + ("ghc" ,ghc) + ("ghostscript" ,ghostscript) + ("giflib:bin" ,giflib "bin") + ("gnumeric" ,gnumeric) + ("gnupg" ,gnupg) + ("imagemagick" ,imagemagick) + ("libarchive" ,libarchive) + ("llvm" ,llvm) + ("lz4" ,lz4) + ("mono" ,mono) + ("odt2txt" ,odt2txt) + ;; no unversioned openjdk available + ("openjdk:jdk" ,openjdk12 "jdk") + ("openssh" ,openssh) + ("pgpdump" ,pgpdump) + ("poppler" ,poppler) + ("rpm" ,rpm) + ("sng" ,sng) + ("sqlite" ,sqlite) + ("squashfs-tools" ,squashfs-tools) + ("tcpdump" ,tcpdump) + ("unzip" ,unzip) + ("xxd" ,xxd) + ("xz" ,xz) + ("zip" ,zip))) + (home-page "https://diffoscope.org/") + (synopsis "Compare files, archives, and directories in depth") + (description + "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.") + (license license:gpl3+)))) + +(define-public trydiffoscope + (package + (name "trydiffoscope") + (version "67.0.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://salsa.debian.org/reproducible-builds/trydiffoscope.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "03b66cjii7l2yiwffj6ym6mycd5drx7prfp4j2550281pias6mjh")))) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'install 'install-doc + (lambda* (#:key outputs #:allow-other-keys) + (let* ((share (string-append (assoc-ref outputs "out") "/share/"))) + (mkdir-p (string-append share "/man/man1/" )) + (invoke "rst2man.py" + "trydiffoscope.1.rst" + (string-append share "/man/man1/trydiffoscope.1")) + (mkdir-p (string-append share "/doc/" ,name "-" ,version)) + (install-file "./README.rst" + (string-append share "/doc/" ,name "-" ,version))) + #t))))) + (propagated-inputs + `(("python-requests" ,python-requests))) + (native-inputs + `(("gzip" ,gzip) + ("python-docutils" ,python-docutils))) + (build-system python-build-system) + (home-page "https://try.diffoscope.org") + (synopsis "Client for remote diffoscope service") + (description "This is a client for the @url{https://try.diffoscope.org, +remote diffoscope service}. + +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. + +Results are displayed by default, stored as local text or html files, or made +available via a URL on @url{https://try.diffoscope.org}. Results stored on the +server are purged after 30 days.") + (license license:gpl3+))) -- cgit v1.2.3 From 3244b64f708a5b3161bfada2043718c004f199a4 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Sun, 8 Sep 2019 15:35:33 -0700 Subject: gnu: diffoscope: Add additional test dependencies. * gnu/packages/diffoscope (diffoscope)[native-inputs]: Add abootimg, dtc, and r-minimal. --- gnu/packages/diffoscope.scm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gnu/packages/diffoscope.scm') diff --git a/gnu/packages/diffoscope.scm b/gnu/packages/diffoscope.scm index 6eb5c1d9fe..828e06a818 100644 --- a/gnu/packages/diffoscope.scm +++ b/gnu/packages/diffoscope.scm @@ -25,8 +25,10 @@ #:use-module (gnu packages) #:use-module (gnu packages acl) #:use-module (gnu packages admin) + #:use-module (gnu packages android) #:use-module (gnu packages backup) #:use-module (gnu packages base) + #:use-module (gnu packages bootloaders) #:use-module (gnu packages cdrom) #:use-module (gnu packages check) #:use-module (gnu packages compression) @@ -50,6 +52,7 @@ #:use-module (gnu packages python-xyz) #:use-module (gnu packages sqlite) #:use-module (gnu packages ssh) + #:use-module (gnu packages statistics) #:use-module (gnu packages textutils) #:use-module (gnu packages video) #:use-module (gnu packages vim) @@ -137,6 +140,7 @@ (native-inputs `(("python-pytest" ,python-pytest) ("python-chardet" ,python-chardet) ;; test suite skips tests when tool is missing + ("abootimg" ,abootimg) ("bdb" ,bdb) ("binutils" ,binutils) ("bzip2" ,bzip2) @@ -144,6 +148,7 @@ ("colord" ,colord) ("cpio" ,cpio) ("docx2txt" ,docx2txt) + ("dtc" ,dtc) ("e2fsprogs" ,e2fsprogs) ("ffmpeg" ,ffmpeg) ("gettext" ,gettext-minimal) @@ -163,6 +168,7 @@ ("openssh" ,openssh) ("pgpdump" ,pgpdump) ("poppler" ,poppler) + ("r-minimal" ,r-minimal) ("rpm" ,rpm) ("sng" ,sng) ("sqlite" ,sqlite) -- cgit v1.2.3 From 3fb581ca9f18fe61e070195f4f8d1a670931b722 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Wed, 18 Sep 2019 17:28:11 -0700 Subject: gnu: diffoscope: Update to 125. * gnu/packages/diffoscope (diffoscope): Update to 125. [arguments] Adjust remove-ocaml-test to selectively disable a single test. Add skip-elf-tests to disable a new failing test. [native-inputs] Add ocaml for tests. --- gnu/packages/diffoscope.scm | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'gnu/packages/diffoscope.scm') diff --git a/gnu/packages/diffoscope.scm b/gnu/packages/diffoscope.scm index 828e06a818..59a15205c0 100644 --- a/gnu/packages/diffoscope.scm +++ b/gnu/packages/diffoscope.scm @@ -45,6 +45,7 @@ #:use-module (gnu packages linux) #:use-module (gnu packages llvm) #:use-module (gnu packages mono) + #:use-module (gnu packages ocaml) #:use-module (gnu packages package-management) #:use-module (gnu packages patchutils) #:use-module (gnu packages pdf) @@ -64,7 +65,7 @@ #:use-module (guix utils)) (define-public diffoscope - (let ((version "123")) + (let ((version "125")) (package (name "diffoscope") (version version) @@ -76,7 +77,7 @@ (file-name (git-file-name name version)) (sha256 (base32 - "11bxms5rkhi0v4pxx29v4qgvhp3fmf0fkzci6gn5xcv4fl1zy4wj")))) + "02kwisp9j63w27hhcwpdhg66dgxzz61q4fcyfz8z4hwlz6r0gyqy")))) (build-system python-build-system) (arguments `(#:phases (modify-phases %standard-phases @@ -98,7 +99,17 @@ ;; background in: https://bugs.debian.org/939386 (add-after 'unpack 'remove-ocaml-test (lambda _ - (delete-file "tests/comparators/test_ocaml.py") + (substitute* "tests/comparators/test_ocaml.py" + (("def test_diff.differences.:") + "def skip_test_diff(differences):")) + #t)) + (add-after 'unpack 'skip-elf-tests + ;; FIXME: libmix_differences test added in 125, and is + ;; failing, need to explore why... + (lambda _ + (substitute* "tests/comparators/test_elf.py" + (("def test_libmix_differences.libmix_differences.:") + "def skip_test_libmix_differences(libmix_differences):")) #t)) (add-after 'unpack 'embed-tool-references (lambda* (#:key inputs #:allow-other-keys) @@ -162,6 +173,7 @@ ("llvm" ,llvm) ("lz4" ,lz4) ("mono" ,mono) + ("ocaml" ,ocaml) ("odt2txt" ,odt2txt) ;; no unversioned openjdk available ("openjdk:jdk" ,openjdk12 "jdk") -- cgit v1.2.3 From f315673d9e56f4f2398098590ebdc080b63ce8b1 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Thu, 19 Sep 2019 10:23:47 -0700 Subject: gnu: Add python-binwalk. * gnu/packages/python-xyz (python-binwalk): New variable. * gnu/packages/diffoscope (diffoscope)[native-inputs]: Add python-binwalk for tests. --- gnu/packages/diffoscope.scm | 1 + 1 file changed, 1 insertion(+) (limited to 'gnu/packages/diffoscope.scm') diff --git a/gnu/packages/diffoscope.scm b/gnu/packages/diffoscope.scm index 59a15205c0..17a2d212e5 100644 --- a/gnu/packages/diffoscope.scm +++ b/gnu/packages/diffoscope.scm @@ -150,6 +150,7 @@ ;; Below are modules used for tests. (native-inputs `(("python-pytest" ,python-pytest) ("python-chardet" ,python-chardet) + ("python-binwalk" ,python-binwalk) ;; test suite skips tests when tool is missing ("abootimg" ,abootimg) ("bdb" ,bdb) -- cgit v1.2.3 From 4d83157cd806aeb864664ebb380c19f6be04648c Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Thu, 5 Sep 2019 11:13:22 -0700 Subject: gnu: Add wabt. * gnu/packages/web (wabt): New variable. * gnu/packages/diffoscope (diffoscope)[native-inputs]: Add wabt for tests. [arguments]: Add phase patching wabt into known tools. --- gnu/packages/diffoscope.scm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gnu/packages/diffoscope.scm') diff --git a/gnu/packages/diffoscope.scm b/gnu/packages/diffoscope.scm index 17a2d212e5..e2b2565004 100644 --- a/gnu/packages/diffoscope.scm +++ b/gnu/packages/diffoscope.scm @@ -57,6 +57,7 @@ #:use-module (gnu packages textutils) #:use-module (gnu packages video) #:use-module (gnu packages vim) + #:use-module (gnu packages web) #:use-module (guix build-system python) #:use-module (guix gexp) #:use-module (guix git-download) @@ -88,6 +89,12 @@ (lambda _ (substitute* "setup.py" (("'python-magic',") "")))) + ;; Patch in support for known tools + (add-after 'unpack 'add-known-tools + (lambda _ + (substitute* "diffoscope/external_tools.py" + (("'arch': 'wabt'},") + "'arch': 'wabt', 'guix': 'wabt'},")))) ;; This test is broken because our `file` package has a ;; bug in berkeley-db file type detection. (add-after 'unpack 'remove-berkeley-test @@ -188,6 +195,7 @@ ("squashfs-tools" ,squashfs-tools) ("tcpdump" ,tcpdump) ("unzip" ,unzip) + ("wabt" ,wabt) ("xxd" ,xxd) ("xz" ,xz) ("zip" ,zip))) -- cgit v1.2.3 From 6ec872231fdf746bd6e11b97f8a6b3a23498806c Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Thu, 19 Sep 2019 13:45:41 -0700 Subject: gnu: Add python-jsbeautifier. * gnu/packages/python-xyz (python-jsbeautifier): New variable. * gnu/packages/diffoscope (diffoscope)[native-arguments]: Add python-jsbeautifier. [arguments]: Add python-jsbeautifier to add-known-tools phase. --- gnu/packages/diffoscope.scm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gnu/packages/diffoscope.scm') diff --git a/gnu/packages/diffoscope.scm b/gnu/packages/diffoscope.scm index e2b2565004..fff331ac13 100644 --- a/gnu/packages/diffoscope.scm +++ b/gnu/packages/diffoscope.scm @@ -92,6 +92,9 @@ ;; Patch in support for known tools (add-after 'unpack 'add-known-tools (lambda _ + (substitute* "diffoscope/external_tools.py" + (("'arch': 'python-jsbeautifier'},") + "'arch': 'python-jsbeautifier', 'guix': 'python-jsbeautifier'},")) (substitute* "diffoscope/external_tools.py" (("'arch': 'wabt'},") "'arch': 'wabt', 'guix': 'wabt'},")))) @@ -188,6 +191,7 @@ ("openssh" ,openssh) ("pgpdump" ,pgpdump) ("poppler" ,poppler) + ("python-jsbeautifier" ,python-jsbeautifier) ("r-minimal" ,r-minimal) ("rpm" ,rpm) ("sng" ,sng) -- cgit v1.2.3 From 68620d62f5cd49d6455c351f3a68e3c41dc6ce22 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Thu, 19 Sep 2019 16:43:47 -0700 Subject: gnu: Add enjarify. * gnu/packages/android (enjarify): New variable. * gnu/packages/diffoscope (diffoscope)[native-inputs]: Add enjarify. [arguments]: add enjarify to add-known-tools phase. * gnu/packages/patches/enjarify-setup-py.patch: New file. * gnu/local.mk: Add enjarify-setup-py.patch. --- gnu/packages/diffoscope.scm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gnu/packages/diffoscope.scm') diff --git a/gnu/packages/diffoscope.scm b/gnu/packages/diffoscope.scm index fff331ac13..8df5a9cc0e 100644 --- a/gnu/packages/diffoscope.scm +++ b/gnu/packages/diffoscope.scm @@ -92,6 +92,9 @@ ;; Patch in support for known tools (add-after 'unpack 'add-known-tools (lambda _ + (substitute* "diffoscope/external_tools.py" + (("'arch': 'enjarify'},") + "'arch': 'enjarify', 'guix': 'enjarify'},")) (substitute* "diffoscope/external_tools.py" (("'arch': 'python-jsbeautifier'},") "'arch': 'python-jsbeautifier', 'guix': 'python-jsbeautifier'},")) @@ -172,6 +175,7 @@ ("docx2txt" ,docx2txt) ("dtc" ,dtc) ("e2fsprogs" ,e2fsprogs) + ("enjarify" ,enjarify) ("ffmpeg" ,ffmpeg) ("gettext" ,gettext-minimal) ("ghc" ,ghc) -- cgit v1.2.3 From aaeb2b34cbebb12da326caed09d9d9625a8a2af1 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Sat, 21 Sep 2019 15:31:41 -0700 Subject: gnu: diffoscope: Adjust native-inputs for architecture limitations. * gnu/packages/diffoscope (diffoscope)[native-inputs]: Only add ghc on x86_64-linux and i686-linux. Only add openjdk and enjarify on x86_64-linux. --- gnu/packages/diffoscope.scm | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'gnu/packages/diffoscope.scm') diff --git a/gnu/packages/diffoscope.scm b/gnu/packages/diffoscope.scm index 8df5a9cc0e..15d5a5787e 100644 --- a/gnu/packages/diffoscope.scm +++ b/gnu/packages/diffoscope.scm @@ -63,7 +63,8 @@ #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) - #:use-module (guix utils)) + #:use-module (guix utils) + #:use-module (ice-9 match)) (define-public diffoscope (let ((version "125")) @@ -165,6 +166,22 @@ ("python-chardet" ,python-chardet) ("python-binwalk" ,python-binwalk) ;; test suite skips tests when tool is missing + ,@(match (%current-system) + ;; ghc is only available on x86 currently. + ((or "x86_64-linux" "i686-linux") + `(("ghc" ,ghc))) + (_ + `())) + ,@(match (%current-system) + ;; openjdk and dependent packages are only + ;; available on x86_64 currently. + ((or "x86_64-linux") + `(("enjarify" ,enjarify) + ;; no unversioned openjdk available + ("openjdk:jdk" ,openjdk12 "jdk") + )) + (_ + `())) ("abootimg" ,abootimg) ("bdb" ,bdb) ("binutils" ,binutils) @@ -175,10 +192,8 @@ ("docx2txt" ,docx2txt) ("dtc" ,dtc) ("e2fsprogs" ,e2fsprogs) - ("enjarify" ,enjarify) ("ffmpeg" ,ffmpeg) ("gettext" ,gettext-minimal) - ("ghc" ,ghc) ("ghostscript" ,ghostscript) ("giflib:bin" ,giflib "bin") ("gnumeric" ,gnumeric) @@ -190,8 +205,6 @@ ("mono" ,mono) ("ocaml" ,ocaml) ("odt2txt" ,odt2txt) - ;; no unversioned openjdk available - ("openjdk:jdk" ,openjdk12 "jdk") ("openssh" ,openssh) ("pgpdump" ,pgpdump) ("poppler" ,poppler) -- cgit v1.2.3