me
/
guix
Archived
1
0
Fork 0

gnu: diffoscope: Use G-expressions.

* gnu/packages/diffoscope.scm (diffoscope)[arguments]:
Rewrite as G-expressions.
master
Tobias Geerinckx-Rice 2023-07-09 02:00:01 +02:00
parent 2db3fa4a76
commit aeb6cdacbc
No known key found for this signature in database
GPG Key ID: 0DB0FF884F556D79
1 changed files with 55 additions and 53 deletions

View File

@ -86,59 +86,61 @@
(base32 "16v6p970kckyv5pa93sj7r5k4b0hgbyralvzddbj73g7srysa02v")))) (base32 "16v6p970kckyv5pa93sj7r5k4b0hgbyralvzddbj73g7srysa02v"))))
(build-system python-build-system) (build-system python-build-system)
(arguments (arguments
`(#:phases (modify-phases %standard-phases (list
;; These tests are broken because our `file` package has a #:phases
;; bug in berkeley-db and wasm file type detection. #~(modify-phases %standard-phases
(add-after 'unpack 'remove-broken-file-type-detection-test ;; These tests are broken because our `file` package has a
(lambda _ ;; bug in berkeley-db and wasm file type detection.
(delete-file "tests/comparators/test_berkeley_db.py") (add-after 'unpack 'remove-broken-file-type-detection-test
(delete-file "tests/comparators/test_wasm.py"))) (lambda _
(add-after 'unpack 'embed-tool-references (delete-file "tests/comparators/test_berkeley_db.py")
(lambda* (#:key inputs #:allow-other-keys) (delete-file "tests/comparators/test_wasm.py")))
(substitute* "diffoscope/comparators/utils/compare.py" (add-after 'unpack 'embed-tool-references
(("\\[\"xxd\",") (lambda* (#:key inputs #:allow-other-keys)
(string-append "[\"" (which "xxd") "\","))) (substitute* "diffoscope/comparators/utils/compare.py"
(substitute* "diffoscope/diff.py" (("\\[\"xxd\",")
(("@tool_required\\(\"diff\"\\)") "") (string-append "[\"" (which "xxd") "\",")))
(("get_tool_name\\(\"diff\"\\)") (substitute* "diffoscope/diff.py"
(string-append "get_tool_name(\"" (which "diff") "\")"))) (("@tool_required\\(\"diff\"\\)") "")
(substitute* "diffoscope/comparators/directory.py" (("get_tool_name\\(\"diff\"\\)")
(("@tool_required\\(\"stat\"\\)") "") (string-append "get_tool_name(\"" (which "diff") "\")")))
(("@tool_required\\(\"getfacl\"\\)") "") (substitute* "diffoscope/comparators/directory.py"
(("\\[\"stat\",") (("@tool_required\\(\"stat\"\\)") "")
(string-append "[\"" (which "stat") "\",")) (("@tool_required\\(\"getfacl\"\\)") "")
(("\\[\"getfacl\",") (("\\[\"stat\",")
(string-append "[\"" (which "getfacl") "\","))))) (string-append "[\"" (which "stat") "\","))
(add-after 'build 'build-man-page (("\\[\"getfacl\",")
(lambda _ (string-append "[\"" (which "getfacl") "\",")))))
(invoke "make" "-C" "doc"))) (add-after 'build 'build-man-page
(add-before 'check 'writable-test-data (lambda _
(lambda _ (invoke "make" "-C" "doc")))
;; Tests may need write access to tests directory. (add-before 'check 'writable-test-data
(for-each make-file-writable (find-files "tests")))) (lambda _
(add-before 'check 'fix-failing-test ;; Tests may need write access to tests directory.
(lambda _ (for-each make-file-writable (find-files "tests"))))
;; There is no user name mapping in the build environment. (add-before 'check 'fix-failing-test
;; Pytest made it so much harder than should be necessary, (lambda _
;; so I'm leaving… this here in case I ever need it again: ;; There is no user name mapping in the build environment.
;; (substitute* "tests/comparators/test_squashfs.py" ;; Pytest made it so much harder than should be necessary,
;; (("^def test_symlink_root.*" match) ; no, I don't ;; so I'm leaving… this here in case I ever need it again:
;; (string-append ; know Python ;; (substitute* "tests/comparators/test_squashfs.py"
;; match "\n raise ValueError(" ; why do you ;; (("^def test_symlink_root.*" match) ; no, I don't
;; "differences_root[1].unified_diff)\n"))) ; ask ;; (string-append ; know Python
(substitute* "tests/data/squashfs_root_expected_diff" ;; match "\n raise ValueError(" ; why do you
(("root/root") ;; "differences_root[1].unified_diff)\n"))) ; ask
'"0/0 ")))) (substitute* "tests/data/squashfs_root_expected_diff"
(add-before 'check 'delete-failing-test (("root/root")
;; Please add new tests to fix-failing-test and not here ;-) '"0/0 "))))
(lambda _ (add-before 'check 'delete-failing-test
;; This requires /sbin to be in $PATH. ;; Please add new tests to fix-failing-test and not here ;-)
(delete-file "tests/test_tools.py"))) (lambda _
(add-after 'install 'install-man-page ;; This requires /sbin to be in $PATH.
(lambda* (#:key outputs #:allow-other-keys) (delete-file "tests/test_tools.py")))
(let* ((out (assoc-ref outputs "out")) (add-after 'install 'install-man-page
(man (string-append out "/share/man/man1"))) (lambda* (#:key outputs #:allow-other-keys)
(install-file "doc/diffoscope.1" man))))))) (let* ((out (assoc-ref outputs "out"))
(man (string-append out "/share/man/man1")))
(install-file "doc/diffoscope.1" man)))))))
(inputs (list rpm ;for rpm-python (inputs (list rpm ;for rpm-python
python-debian python-debian
python-libarchive-c python-libarchive-c