gnu: zstd: Fix unnecessary dependency upon $PATH.

* gnu/packages/compression (zstd)[arguments]:
Add a 'patch-command-file-names phase.
This commit is contained in:
Tobias Geerinckx-Rice 2021-03-27 13:11:00 +01:00
parent 76b689f339
commit 57e8e8c916
No known key found for this signature in database
GPG key ID: 0DB0FF884F556D79

View file

@ -1423,6 +1423,19 @@ (define-public zstd
(("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)