gnu: Update diffoscope to 121.

* gnu/packages/package-management (diffoscope): Update to 121.
  [version] Only define version once.
  [arguments] Add writeable-test-data phase.
This commit is contained in:
Vagrant Cascadian 2019-08-19 20:36:22 +00:00 committed by Vagrant Cascadian
parent 6063a56140
commit 8c1379ba40
No known key found for this signature in database
GPG Key ID: DC518FC87F9716AA
1 changed files with 74 additions and 66 deletions

View File

@ -561,75 +561,83 @@ transactions from C or Python.")
(license license:gpl2+))) (license license:gpl2+)))
(define-public diffoscope (define-public diffoscope
(package (let ((version "121"))
(name "diffoscope") (package
(version "120") (name "diffoscope")
(source (origin (version version)
(method git-fetch) (source (origin
(uri (git-reference (method git-fetch)
(url "https://salsa.debian.org/reproducible-builds/diffoscope.git") (uri (git-reference
(commit "120"))) (url "https://salsa.debian.org/reproducible-builds/diffoscope.git")
(file-name (git-file-name name version)) (commit version)))
(sha256 (file-name (git-file-name name version))
(base32 (sha256
"07z9yclvfkw4326739l2ywzzihax5vdijiaqqpfix9rz1rb923aa")))) (base32
(build-system python-build-system) "1bw7s8qs1vnr93vhifl6pj6h6w6r6nrpc5anzhh9wx2gcaipkb3m"))))
(arguments (build-system python-build-system)
`(#:phases (modify-phases %standard-phases (arguments
;; setup.py mistakenly requires python-magic from PyPi, even `(#:phases (modify-phases %standard-phases
;; though the Python bindings of `file` are sufficient. ;; setup.py mistakenly requires python-magic from PyPi, even
;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815844 ;; though the Python bindings of `file` are sufficient.
(add-after 'unpack 'dependency-on-python-magic ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815844
(lambda _ (add-after 'unpack 'dependency-on-python-magic
(substitute* "setup.py" (lambda _
(("'python-magic',") "")))) (substitute* "setup.py"
;; This test is broken because our `file` package has a (("'python-magic',") ""))))
;; bug in berkeley-db file type detection. ;; This test is broken because our `file` package has a
(add-after 'unpack 'remove-berkeley-test ;; bug in berkeley-db file type detection.
(lambda _ (add-after 'unpack 'remove-berkeley-test
(delete-file "tests/comparators/test_berkeley_db.py") (lambda _
#t)) (delete-file "tests/comparators/test_berkeley_db.py")
(add-after 'unpack 'embed-tool-references #t))
(lambda* (#:key inputs #:allow-other-keys) (add-after 'unpack 'embed-tool-references
(substitute* "diffoscope/comparators/utils/compare.py" (lambda* (#:key inputs #:allow-other-keys)
(("\\['xxd',") (substitute* "diffoscope/comparators/utils/compare.py"
(string-append "['" (which "xxd") "',"))) (("\\['xxd',")
(substitute* "diffoscope/comparators/elf.py" (string-append "['" (which "xxd") "',")))
(("@tool_required\\('readelf'\\)") "") (substitute* "diffoscope/comparators/elf.py"
(("get_tool_name\\('readelf'\\)") (("@tool_required\\('readelf'\\)") "")
(string-append "'" (which "readelf") "'"))) (("get_tool_name\\('readelf'\\)")
(substitute* "diffoscope/comparators/directory.py" (string-append "'" (which "readelf") "'")))
(("@tool_required\\('stat'\\)") "") (substitute* "diffoscope/comparators/directory.py"
(("@tool_required\\('getfacl'\\)") "") (("@tool_required\\('stat'\\)") "")
(("\\['stat',") (("@tool_required\\('getfacl'\\)") "")
(string-append "['" (which "stat") "',")) (("\\['stat',")
(("\\['getfacl',") (string-append "['" (which "stat") "',"))
(string-append "['" (which "getfacl") "',"))) (("\\['getfacl',")
#t)) (string-append "['" (which "getfacl") "',")))
(add-before 'check 'delete-failing-test #t))
(lambda _ (add-before 'check 'writable-test-data
;; this requires /sbin to be on the path (lambda _
(delete-file "tests/test_tools.py") ;; tests/comparators/test_elf.py needs write access to
#t))))) ;; test data
(inputs `(("rpm" ,rpm) ;for rpm-python (make-file-writable
("python-file" ,python-file) "tests/data/ignore_readelf_errors_expected_diff")
("python-debian" ,python-debian) #t))
("python-libarchive-c" ,python-libarchive-c) (add-before 'check 'delete-failing-test
("python-tlsh" ,python-tlsh) (lambda _
("acl" ,acl) ;for getfacl ;; this requires /sbin to be on the path
("colordiff" ,colordiff) (delete-file "tests/test_tools.py")
("xxd" ,xxd))) #t)))))
;; Below are modules used for tests. (inputs `(("rpm" ,rpm) ;for rpm-python
(native-inputs `(("python-pytest" ,python-pytest) ("python-file" ,python-file)
("python-chardet" ,python-chardet))) ("python-debian" ,python-debian)
(home-page "https://diffoscope.org/") ("python-libarchive-c" ,python-libarchive-c)
(synopsis "Compare files, archives, and directories in depth") ("python-tlsh" ,python-tlsh)
(description ("acl" ,acl) ;for getfacl
"Diffoscope tries to get to the bottom of what makes files or directories ("colordiff" ,colordiff)
("xxd" ,xxd)))
;; Below are modules used for tests.
(native-inputs `(("python-pytest" ,python-pytest)
("python-chardet" ,python-chardet)))
(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 different. It recursively unpacks archives of many kinds and transforms
various binary formats into more human readable forms to compare them. It can 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.")
(license license:gpl3+))) (license license:gpl3+))))
(define-public trydiffoscope (define-public trydiffoscope
(package (package