summary refs log tree commit diff
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2023-07-09 02:00:01 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2023-07-16 02:00:11 +0200
commitba9fdaa81439004889f944f6ccef794abd33c907 (patch)
treedccbba833d061f6674e69c5abf95d8465ce562c9
parentaeb6cdacbc3e245c515cd2c1dde869c462754687 (diff)
downloadguix-ba9fdaa81439004889f944f6ccef794abd33c907.tar.gz
gnu: diffoscope: Don't embed build-time references.
* gnu/packages/diffoscope.scm (diffoscope)[arguments]:
Avoid using WHICH in the 'embed-tool-references phase.
-rw-r--r--gnu/packages/diffoscope.scm18
1 files changed, 10 insertions, 8 deletions
diff --git a/gnu/packages/diffoscope.scm b/gnu/packages/diffoscope.scm
index 61bd23f3e2..5846c4cbd4 100644
--- a/gnu/packages/diffoscope.scm
+++ b/gnu/packages/diffoscope.scm
@@ -97,20 +97,22 @@
               (delete-file "tests/comparators/test_wasm.py")))
           (add-after 'unpack 'embed-tool-references
             (lambda* (#:key inputs #:allow-other-keys)
+              (define (bin command)
+                (search-input-file inputs (string-append "bin/" command)))
               (substitute* "diffoscope/comparators/utils/compare.py"
-                (("\\[\"xxd\",")
-                 (string-append "[\"" (which "xxd") "\",")))
+                (("\\[\"(xxd)\"," _ command)
+                 (string-append "[\"" (bin command) "\",")))
               (substitute* "diffoscope/diff.py"
                 (("@tool_required\\(\"diff\"\\)") "")
-                (("get_tool_name\\(\"diff\"\\)")
-                 (string-append "get_tool_name(\"" (which "diff") "\")")))
+                (("get_tool_name\\(\"(diff)\"\\)" _ command)
+                 (string-append "get_tool_name(\"" (bin command) "\")")))
               (substitute* "diffoscope/comparators/directory.py"
                 (("@tool_required\\(\"stat\"\\)") "")
                 (("@tool_required\\(\"getfacl\"\\)") "")
-                (("\\[\"stat\",")
-                 (string-append "[\"" (which "stat") "\","))
-                (("\\[\"getfacl\",")
-                 (string-append "[\"" (which "getfacl") "\",")))))
+                (("\\[\"(stat)\"," _ command)
+                 (string-append "[\"" (bin command) "\","))
+                (("\\[\"(getfacl)\"," _ command)
+                 (string-append "[\"" (bin command) "\",")))))
           (add-after 'build 'build-man-page
             (lambda _
               (invoke "make" "-C" "doc")))