Archived
1
0
Fork 0

gnu: diffoscope: Don't embed build-time references.

* gnu/packages/diffoscope.scm (diffoscope)[arguments]:
Avoid using WHICH in the 'embed-tool-references phase.
This commit is contained in:
Tobias Geerinckx-Rice 2023-07-09 02:00:01 +02:00
parent aeb6cdacbc
commit ba9fdaa814
No known key found for this signature in database
GPG key ID: 0DB0FF884F556D79

View file

@ -97,20 +97,22 @@
(delete-file "tests/comparators/test_wasm.py"))) (delete-file "tests/comparators/test_wasm.py")))
(add-after 'unpack 'embed-tool-references (add-after 'unpack 'embed-tool-references
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(define (bin command)
(search-input-file inputs (string-append "bin/" command)))
(substitute* "diffoscope/comparators/utils/compare.py" (substitute* "diffoscope/comparators/utils/compare.py"
(("\\[\"xxd\",") (("\\[\"(xxd)\"," _ command)
(string-append "[\"" (which "xxd") "\","))) (string-append "[\"" (bin command) "\",")))
(substitute* "diffoscope/diff.py" (substitute* "diffoscope/diff.py"
(("@tool_required\\(\"diff\"\\)") "") (("@tool_required\\(\"diff\"\\)") "")
(("get_tool_name\\(\"diff\"\\)") (("get_tool_name\\(\"(diff)\"\\)" _ command)
(string-append "get_tool_name(\"" (which "diff") "\")"))) (string-append "get_tool_name(\"" (bin command) "\")")))
(substitute* "diffoscope/comparators/directory.py" (substitute* "diffoscope/comparators/directory.py"
(("@tool_required\\(\"stat\"\\)") "") (("@tool_required\\(\"stat\"\\)") "")
(("@tool_required\\(\"getfacl\"\\)") "") (("@tool_required\\(\"getfacl\"\\)") "")
(("\\[\"stat\",") (("\\[\"(stat)\"," _ command)
(string-append "[\"" (which "stat") "\",")) (string-append "[\"" (bin command) "\","))
(("\\[\"getfacl\",") (("\\[\"(getfacl)\"," _ command)
(string-append "[\"" (which "getfacl") "\","))))) (string-append "[\"" (bin command) "\",")))))
(add-after 'build 'build-man-page (add-after 'build 'build-man-page
(lambda _ (lambda _
(invoke "make" "-C" "doc"))) (invoke "make" "-C" "doc")))