at 25.11-pre 86 lines 2.5 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 makeShellWrapper, 6 updateAutotoolsGnuConfigScriptsHook, 7 runtimeShellPackage, 8}: 9 10# Note: this package is used for bootstrapping fetchurl, and thus 11# cannot use fetchpatch! All mutable patches (generated by GitHub or 12# cgit) that are needed here should be included directly in Nixpkgs as 13# files. 14 15stdenv.mkDerivation rec { 16 pname = "gzip"; 17 version = "1.14"; 18 19 src = fetchurl { 20 url = "mirror://gnu/gzip/${pname}-${version}.tar.xz"; 21 hash = "sha256-Aae4gb0iC/32Ffl7hxj4C9/T9q3ThbmT3Pbv0U6MCsY="; 22 }; 23 24 outputs = [ 25 "out" 26 "man" 27 "info" 28 ]; 29 30 enableParallelBuilding = true; 31 32 nativeBuildInputs = [ 33 updateAutotoolsGnuConfigScriptsHook 34 makeShellWrapper 35 ]; 36 buildInputs = [ runtimeShellPackage ]; 37 38 makeFlags = [ 39 "SHELL=/bin/sh" 40 "GREP=grep" 41 # gzip 1.12 doesn't build `zless` unless it can find `less`, but we 42 # can avoid having `less` as a build input if we just override these. 43 "ZLESS_MAN=zless.1" 44 "ZLESS_PROG=zless" 45 ]; 46 47 # Many gzip executables are shell scripts that depend upon other gzip 48 # executables being in $PATH. Rather than try to re-write all the 49 # internal cross-references, just add $out/bin to PATH at the top of 50 # all the executables that are shell scripts. 51 preFixup = 52 '' 53 sed -i '1{;/#!\/bin\/sh/aPATH="'$out'/bin:$PATH" 54 }' $out/bin/* 55 '' 56 # run gzip with "-n" when $GZIP_NO_TIMESTAMPS (set by stdenv's setup.sh) is set to stop gzip from adding timestamps 57 # to archive headers: https://github.com/NixOS/nixpkgs/issues/86348 58 # if changing so that there's no longer a .gzip-wrapped then update copy in make-bootstrap-tools.nix 59 + '' 60 wrapProgram $out/bin/gzip \ 61 --add-flags "\''${GZIP_NO_TIMESTAMPS:+-n}" 62 ''; 63 64 meta = { 65 homepage = "https://www.gnu.org/software/gzip/"; 66 description = "GNU zip compression program"; 67 68 longDescription = '' 69 gzip (GNU zip) is a popular data compression program written by 70 Jean-loup Gailly for the GNU project. Mark Adler wrote the 71 decompression part. 72 73 We developed this program as a replacement for compress because of 74 the Unisys and IBM patents covering the LZW algorithm used by 75 compress. These patents made it impossible for us to use compress, 76 and we needed a replacement. The superior compression ratio of gzip 77 is just a bonus. 78 ''; 79 80 platforms = lib.platforms.all; 81 82 license = lib.licenses.gpl3Plus; 83 84 mainProgram = "gzip"; 85 }; 86}