2019-09-08 17:36:33 -04:00
|
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
|
|
|
|
;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
|
2021-10-24 11:07:35 -04:00
|
|
|
|
;;; Copyright © 2017, 2021 Ricardo Wurmus <rekado@elephly.net>
|
2022-05-14 20:00:01 -04:00
|
|
|
|
;;; Copyright © 2017–2022 Tobias Geerinckx-Rice <me@tobias.gr>
|
2019-09-08 17:36:33 -04:00
|
|
|
|
;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
|
|
|
|
|
;;; Copyright © 2018, 2019 Rutger Helling <rhelling@mykolab.com>
|
|
|
|
|
;;; Copyright © 2019 Vagrant Cascadian <vagrant@reproducible-builds.org>
|
2023-01-25 02:41:43 -05:00
|
|
|
|
;;; Copyright © 2022, 2023 Efraim Flashner <efraim@flashner.co.il>
|
2019-09-08 17:36:33 -04:00
|
|
|
|
;;;
|
|
|
|
|
;;; 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
(define-module (gnu packages diffoscope)
|
|
|
|
|
#:use-module (gnu packages)
|
|
|
|
|
#:use-module (gnu packages acl)
|
|
|
|
|
#:use-module (gnu packages admin)
|
2019-09-08 18:35:33 -04:00
|
|
|
|
#:use-module (gnu packages android)
|
2019-09-08 17:36:33 -04:00
|
|
|
|
#:use-module (gnu packages backup)
|
|
|
|
|
#:use-module (gnu packages base)
|
2019-09-08 18:35:33 -04:00
|
|
|
|
#:use-module (gnu packages bootloaders)
|
2019-09-08 17:36:33 -04:00
|
|
|
|
#: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)
|
2020-02-07 19:06:17 -05:00
|
|
|
|
#:use-module (gnu packages man)
|
2020-04-17 02:33:37 -04:00
|
|
|
|
#:use-module (gnu packages maths)
|
2019-09-18 20:28:11 -04:00
|
|
|
|
#:use-module (gnu packages ocaml)
|
2019-09-08 17:36:33 -04:00
|
|
|
|
#:use-module (gnu packages package-management)
|
2021-10-27 11:58:22 -04:00
|
|
|
|
#:use-module (gnu packages pascal)
|
2019-09-08 17:36:33 -04:00
|
|
|
|
#:use-module (gnu packages patchutils)
|
|
|
|
|
#:use-module (gnu packages pdf)
|
2022-09-01 09:18:39 -04:00
|
|
|
|
#:use-module (gnu packages python-check)
|
2019-09-08 17:36:33 -04:00
|
|
|
|
#:use-module (gnu packages python-web)
|
|
|
|
|
#:use-module (gnu packages python-xyz)
|
|
|
|
|
#:use-module (gnu packages sqlite)
|
|
|
|
|
#:use-module (gnu packages ssh)
|
2019-09-08 18:35:33 -04:00
|
|
|
|
#:use-module (gnu packages statistics)
|
2019-09-08 17:36:33 -04:00
|
|
|
|
#:use-module (gnu packages textutils)
|
2020-04-30 14:46:30 -04:00
|
|
|
|
#:use-module (gnu packages tls)
|
2019-09-08 17:36:33 -04:00
|
|
|
|
#:use-module (gnu packages video)
|
|
|
|
|
#:use-module (gnu packages vim)
|
2019-09-05 14:13:22 -04:00
|
|
|
|
#:use-module (gnu packages web)
|
2019-09-08 17:36:33 -04:00
|
|
|
|
#: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)
|
2019-09-21 18:31:41 -04:00
|
|
|
|
#:use-module (guix utils)
|
|
|
|
|
#:use-module (ice-9 match))
|
2019-09-08 17:36:33 -04:00
|
|
|
|
|
|
|
|
|
(define-public diffoscope
|
2020-06-05 12:58:02 -04:00
|
|
|
|
(package
|
|
|
|
|
(name "diffoscope")
|
2023-07-29 20:00:00 -04:00
|
|
|
|
(version "247")
|
2021-10-04 14:59:29 -04:00
|
|
|
|
(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
|
2023-07-29 20:00:00 -04:00
|
|
|
|
(base32 "0c81pvdq0bz47sk3gcgpm2l3g5hxdi2s1jz05krv1cr2bd0sfq4j"))))
|
2020-06-05 12:58:02 -04:00
|
|
|
|
(build-system python-build-system)
|
|
|
|
|
(arguments
|
2023-07-08 20:00:01 -04:00
|
|
|
|
(list
|
|
|
|
|
#:phases
|
|
|
|
|
#~(modify-phases %standard-phases
|
|
|
|
|
;; These tests are broken because our `file` package has a
|
|
|
|
|
;; bug in berkeley-db and wasm file type detection.
|
|
|
|
|
(add-after 'unpack 'remove-broken-file-type-detection-test
|
|
|
|
|
(lambda _
|
|
|
|
|
(delete-file "tests/comparators/test_berkeley_db.py")
|
|
|
|
|
(delete-file "tests/comparators/test_wasm.py")))
|
|
|
|
|
(add-after 'unpack 'embed-tool-references
|
|
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
2023-07-08 20:00:01 -04:00
|
|
|
|
(define (bin command)
|
|
|
|
|
(search-input-file inputs (string-append "bin/" command)))
|
2023-07-08 20:00:01 -04:00
|
|
|
|
(substitute* "diffoscope/comparators/utils/compare.py"
|
2023-07-08 20:00:01 -04:00
|
|
|
|
(("\\[\"(xxd)\"," _ command)
|
|
|
|
|
(string-append "[\"" (bin command) "\",")))
|
2023-07-08 20:00:01 -04:00
|
|
|
|
(substitute* "diffoscope/diff.py"
|
|
|
|
|
(("@tool_required\\(\"diff\"\\)") "")
|
2023-07-08 20:00:01 -04:00
|
|
|
|
(("get_tool_name\\(\"(diff)\"\\)" _ command)
|
|
|
|
|
(string-append "get_tool_name(\"" (bin command) "\")")))
|
2023-07-08 20:00:01 -04:00
|
|
|
|
(substitute* "diffoscope/comparators/directory.py"
|
|
|
|
|
(("@tool_required\\(\"stat\"\\)") "")
|
|
|
|
|
(("@tool_required\\(\"getfacl\"\\)") "")
|
2023-07-08 20:00:01 -04:00
|
|
|
|
(("\\[\"(stat)\"," _ command)
|
|
|
|
|
(string-append "[\"" (bin command) "\","))
|
|
|
|
|
(("\\[\"(getfacl)\"," _ command)
|
|
|
|
|
(string-append "[\"" (bin command) "\",")))))
|
2023-07-08 20:00:01 -04:00
|
|
|
|
(add-after 'build 'build-man-page
|
|
|
|
|
(lambda _
|
|
|
|
|
(invoke "make" "-C" "doc")))
|
|
|
|
|
(add-before 'check 'writable-test-data
|
|
|
|
|
(lambda _
|
|
|
|
|
;; Tests may need write access to tests directory.
|
|
|
|
|
(for-each make-file-writable (find-files "tests"))))
|
|
|
|
|
(add-before 'check 'fix-failing-test
|
|
|
|
|
(lambda _
|
|
|
|
|
;; There is no user name mapping in the build environment.
|
|
|
|
|
;; Pytest made it so much harder than should be necessary,
|
|
|
|
|
;; so I'm leaving… this here in case I ever need it again:
|
|
|
|
|
;; (substitute* "tests/comparators/test_squashfs.py"
|
|
|
|
|
;; (("^def test_symlink_root.*" match) ; no, I don't
|
|
|
|
|
;; (string-append ; know Python
|
|
|
|
|
;; match "\n raise ValueError(" ; why do you
|
|
|
|
|
;; "differences_root[1].unified_diff)\n"))) ; ask
|
|
|
|
|
(substitute* "tests/data/squashfs_root_expected_diff"
|
|
|
|
|
(("root/root")
|
|
|
|
|
'"0/0 "))))
|
|
|
|
|
(add-before 'check 'delete-failing-test
|
|
|
|
|
;; Please add new tests to fix-failing-test and not here ;-)
|
|
|
|
|
(lambda _
|
|
|
|
|
;; This requires /sbin to be in $PATH.
|
|
|
|
|
(delete-file "tests/test_tools.py")))
|
|
|
|
|
(add-after 'install 'install-man-page
|
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
|
(let* ((out (assoc-ref outputs "out"))
|
|
|
|
|
(man (string-append out "/share/man/man1")))
|
|
|
|
|
(install-file "doc/diffoscope.1" man)))))))
|
2023-01-22 19:46:49 -05:00
|
|
|
|
(inputs (list rpm ;for rpm-python
|
2021-12-13 11:18:24 -05:00
|
|
|
|
python-debian
|
|
|
|
|
python-libarchive-c
|
|
|
|
|
python-magic
|
|
|
|
|
python-tlsh
|
2023-01-22 19:46:49 -05:00
|
|
|
|
acl ;for getfacl
|
|
|
|
|
coreutils ;for stat
|
|
|
|
|
diffutils ;for diff
|
2021-12-13 11:18:24 -05:00
|
|
|
|
xxd))
|
2021-12-18 14:16:36 -05:00
|
|
|
|
(native-inputs
|
|
|
|
|
(append
|
2023-01-22 19:46:49 -05:00
|
|
|
|
(list help2man
|
2021-12-16 15:10:34 -05:00
|
|
|
|
|
2023-01-22 19:46:49 -05:00
|
|
|
|
;; Below are packages used for tests.
|
|
|
|
|
binwalk
|
|
|
|
|
python-pytest
|
|
|
|
|
python-chardet
|
|
|
|
|
python-h5py
|
|
|
|
|
python-pypdf
|
|
|
|
|
python-progressbar33
|
2021-12-16 15:10:34 -05:00
|
|
|
|
|
2023-01-22 19:46:49 -05:00
|
|
|
|
abootimg
|
|
|
|
|
bdb
|
|
|
|
|
binutils
|
|
|
|
|
bzip2
|
2023-01-25 02:46:37 -05:00
|
|
|
|
cdrkit-libre
|
2023-01-22 19:46:49 -05:00
|
|
|
|
colord
|
|
|
|
|
cpio
|
|
|
|
|
docx2txt
|
|
|
|
|
dtc
|
|
|
|
|
e2fsprogs
|
2023-01-30 04:33:18 -05:00
|
|
|
|
ffmpeg)
|
2021-12-18 14:16:36 -05:00
|
|
|
|
|
2023-01-22 19:46:49 -05:00
|
|
|
|
(match (%current-system)
|
|
|
|
|
;; fpc is only available on x86 currently.
|
|
|
|
|
((or "x86_64-linux" "i686-linux")
|
|
|
|
|
(list fpc))
|
|
|
|
|
(_ '()))
|
2022-07-20 07:55:35 -04:00
|
|
|
|
|
2023-01-22 19:46:49 -05:00
|
|
|
|
(list gettext-minimal
|
|
|
|
|
ghostscript
|
|
|
|
|
`(,giflib "bin")
|
|
|
|
|
gnumeric
|
|
|
|
|
gnupg
|
|
|
|
|
hdf5
|
|
|
|
|
imagemagick
|
|
|
|
|
libarchive
|
2023-01-25 02:41:43 -05:00
|
|
|
|
llvm
|
2023-01-22 19:46:49 -05:00
|
|
|
|
lz4
|
|
|
|
|
lzip
|
|
|
|
|
ocaml
|
|
|
|
|
odt2txt
|
|
|
|
|
openssh
|
|
|
|
|
openssl
|
|
|
|
|
pgpdump
|
2023-03-20 20:42:58 -04:00
|
|
|
|
poppler
|
2023-01-22 19:46:49 -05:00
|
|
|
|
python-jsbeautifier
|
|
|
|
|
r-minimal
|
|
|
|
|
rpm
|
|
|
|
|
sng
|
|
|
|
|
sqlite
|
|
|
|
|
squashfs-tools
|
|
|
|
|
tcpdump
|
|
|
|
|
unzip
|
|
|
|
|
wabt
|
|
|
|
|
xxd
|
|
|
|
|
xz
|
|
|
|
|
zip
|
|
|
|
|
zstd)
|
2021-12-18 14:16:36 -05:00
|
|
|
|
|
2023-01-22 19:46:49 -05:00
|
|
|
|
;; Also for tests. The test suite skips tests when these are missing.
|
|
|
|
|
(match (%current-system)
|
|
|
|
|
;; ghc is only available on x86 currently.
|
|
|
|
|
((or "x86_64-linux" "i686-linux")
|
|
|
|
|
(list ghc))
|
|
|
|
|
(_ '()))
|
|
|
|
|
(match (%current-system)
|
|
|
|
|
;; openjdk and dependent packages are only
|
|
|
|
|
;; available on x86_64 currently.
|
|
|
|
|
((or "x86_64-linux")
|
|
|
|
|
(list enjarify)
|
|
|
|
|
;; No unversioned openjdk available.
|
|
|
|
|
(list `(,openjdk12 "jdk")))
|
|
|
|
|
(_ '()))))
|
2020-06-05 12:58:02 -04:00
|
|
|
|
(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
|
2019-09-08 17:36:33 -04:00
|
|
|
|
different. It recursively unpacks archives of many kinds and transforms
|
|
|
|
|
various binary formats into more human readable forms to compare them. It can
|
2020-02-06 16:45:28 -05:00
|
|
|
|
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.")
|
2020-06-05 12:58:02 -04:00
|
|
|
|
(license license:gpl3+)))
|
2019-09-08 17:36:33 -04:00
|
|
|
|
|
2020-02-07 19:06:17 -05:00
|
|
|
|
(define-public reprotest
|
|
|
|
|
(package
|
|
|
|
|
(name "reprotest")
|
2023-07-29 20:00:00 -04:00
|
|
|
|
(version "0.7.26")
|
2020-02-07 19:06:17 -05:00
|
|
|
|
(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
|
2023-07-29 20:00:00 -04:00
|
|
|
|
(base32 "1992wlkil07fmj64lw3i7l16dgkkzphz0f932hbkkj9rlcamdwxd"))))
|
2020-02-07 19:06:17 -05:00
|
|
|
|
(inputs
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list python-debian python-distro python-libarchive-c python-rstr))
|
2020-02-07 19:06:17 -05:00
|
|
|
|
(native-inputs
|
|
|
|
|
`(("diffoscope" ,diffoscope)
|
|
|
|
|
("help2man" ,help2man)
|
|
|
|
|
("libfaketime" ,libfaketime)
|
|
|
|
|
("python-coverage" ,python-coverage)
|
|
|
|
|
("python-docutils" ,python-docutils)
|
2020-10-24 19:37:18 -04:00
|
|
|
|
("python-magic " ,python-magic)
|
2020-02-07 19:06:17 -05:00
|
|
|
|
("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"
|
2023-03-13 19:34:26 -04:00
|
|
|
|
(("'C.UTF-8'") "'en_US.UTF-8'"))
|
2020-02-07 19:06:17 -05:00
|
|
|
|
(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)
|
2022-12-10 19:00:02 -05:00
|
|
|
|
(install-file "./README-dev.rst" docdir)))))))
|
2020-02-07 19:06:17 -05:00
|
|
|
|
(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+))))
|
|
|
|
|
|
2019-09-08 17:36:33 -04:00
|
|
|
|
(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
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list python-requests))
|
2019-09-08 17:36:33 -04:00
|
|
|
|
(native-inputs
|
2021-12-13 11:18:24 -05:00
|
|
|
|
(list gzip python-docutils))
|
2019-09-08 17:36:33 -04:00
|
|
|
|
(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+)))
|