4 , updateAutotoolsGnuConfigScriptsHook
8 # Note: this package is used for bootstrapping fetchurl, and thus
9 # cannot use fetchpatch! All mutable patches (generated by GitHub or
10 # cgit) that are needed here should be included directly in Nixpkgs as
13 stdenv.mkDerivation rec {
18 url = "mirror://gnu/gzip/${pname}-${version}.tar.xz";
19 hash = "sha256-dFTraTXbF8ZlVXbC4bD6vv04tNCTbg+H9IzQYs6RoFc=";
22 outputs = [ "out" "man" "info" ];
24 enableParallelBuilding = true;
26 nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook makeWrapper ];
27 buildInputs = [ runtimeShellPackage ];
32 # gzip 1.12 doesn't build `zless` unless it can find `less`, but we
33 # can avoid having `less` as a build input if we just override these.
38 # Many gzip executables are shell scripts that depend upon other gzip
39 # executables being in $PATH. Rather than try to re-write all the
40 # internal cross-references, just add $out/bin to PATH at the top of
41 # all the executables that are shell scripts.
43 sed -i '1{;/#!\/bin\/sh/aPATH="'$out'/bin:$PATH"
46 # run gzip with "-n" when $GZIP_NO_TIMESTAMPS (set by stdenv's setup.sh) is set to stop gzip from adding timestamps
47 # to archive headers: https://github.com/NixOS/nixpkgs/issues/86348
48 # if changing so that there's no longer a .gzip-wrapped then update copy in make-bootstrap-tools.nix
50 wrapProgram $out/bin/gzip \
51 --add-flags "\''${GZIP_NO_TIMESTAMPS:+-n}"
55 homepage = "https://www.gnu.org/software/gzip/";
56 description = "GNU zip compression program";
59 gzip (GNU zip) is a popular data compression program written by
60 Jean-loup Gailly for the GNU project. Mark Adler wrote the
63 We developed this program as a replacement for compress because of
64 the Unisys and IBM patents covering the LZW algorithm used by
65 compress. These patents made it impossible for us to use compress,
66 and we needed a replacement. The superior compression ratio of gzip
70 platforms = lib.platforms.all;
72 license = lib.licenses.gpl3Plus;