summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2021-03-27 13:11:00 +0100
committerTobias Geerinckx-Rice <me@tobias.gr>2021-03-27 13:47:59 +0100
commit57e8e8c91624546a1d73e436fb831c662fb37fbd (patch)
tree3a209fdfab197df5fe0e856a53eae0143a10593b /gnu
parent76b689f339c7ef6f10917e18c630189bb2449110 (diff)
downloadguix-57e8e8c91624546a1d73e436fb831c662fb37fbd.tar.gz
gnu: zstd: Fix unnecessary dependency upon $PATH.
* gnu/packages/compression (zstd)[arguments]:
Add a 'patch-command-file-names phase.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/compression.scm13
1 files changed, 13 insertions, 0 deletions
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index ddebc55d34..1a41e5ab8d 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -1423,6 +1423,19 @@ or junctions, and always follows hard links.")
                (("error configured .*dir ")
                 "true "))
              #t))
+         (add-after 'unpack 'patch-command-file-names
+           ;; Don't require hard requirements to be in $PATH.
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (our (lambda (name) (string-append out "/bin/" name))))
+               (substitute* "programs/zstdgrep"
+                 (("(:-)(grep)" _ prefix command)
+                  (string-append prefix (which command)))
+                 (("(:-)(zstdcat)" _ prefix command)
+                  (string-append prefix (our command))))
+               (substitute* "programs/zstdless"
+                 (("zstdcat" command)
+                  (our command))))))
          (delete 'configure)            ;no configure script
          (add-after 'install 'adjust-library-locations
            (lambda* (#:key outputs #:allow-other-keys)