From d2d7fbc431a06ec58f537921dc1b898167a69adc Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Sun, 15 Dec 2019 13:30:40 -0800 Subject: [PATCH] gzip: Don't depend on gzip being in $PATH --- pkgs/tools/compression/gzip/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/tools/compression/gzip/default.nix b/pkgs/tools/compression/gzip/default.nix index 10cfa086860..65760a0b6cc 100644 --- a/pkgs/tools/compression/gzip/default.nix +++ b/pkgs/tools/compression/gzip/default.nix @@ -17,6 +17,15 @@ stdenv.mkDerivation rec { makeFlags = [ "SHELL=/bin/sh" "GREP=grep" ]; + # Many gzip executables are shell scripts that depend upon other gzip + # executables being in $PATH. Rather than try to re-write all the + # internal cross-references, just add $out/bin to PATH at the top of + # all the executables that are shell scripts. + preFixup = '' + sed -i '1{;/#!\/bin\/sh/aPATH="'$out'/bin:$PATH" + }' $out/bin/* + ''; + meta = { homepage = "https://www.gnu.org/software/gzip/"; description = "GNU zip compression program";