1{
2 lib,
3 fetchurl,
4 bash,
5 tinycc,
6 gnumake,
7 gnused,
8 gnugrep,
9}:
10let
11 pname = "gzip";
12 version = "1.2.4";
13
14 src = fetchurl {
15 url = "mirror://gnu/gzip/gzip-${version}.tar.gz";
16 sha256 = "0ryr5b00qz3xcdcv03qwjdfji8pasp0007ay3ppmk71wl8c1i90w";
17 };
18in
19bash.runCommand "${pname}-${version}"
20 {
21 inherit pname version;
22
23 nativeBuildInputs = [
24 tinycc.compiler
25 gnumake
26 gnused
27 gnugrep
28 ];
29
30 passthru.tests.get-version =
31 result:
32 bash.runCommand "${pname}-get-version-${version}" { } ''
33 ${result}/bin/gzip --version
34 mkdir $out
35 '';
36
37 meta = with lib; {
38 description = "GNU zip compression program";
39 homepage = "https://www.gnu.org/software/gzip";
40 license = licenses.gpl3Plus;
41 teams = [ teams.minimal-bootstrap ];
42 platforms = platforms.unix;
43 };
44 }
45 ''
46 # Unpack
47 ungz --file ${src} --output gzip.tar
48 untar --file gzip.tar
49 rm gzip.tar
50 cd gzip-${version}
51
52 # Configure
53 export CC="tcc -B ${tinycc.libs}/lib -Dstrlwr=unused"
54 bash ./configure --prefix=$out
55
56 # Build
57 make
58
59 # Install
60 mkdir $out
61 make install
62 ''