lol

Merge pull request #233389 from emilytrau/minimal-gawk

minimal-bootstrap.gawk: init at 3.0.6

authored by

John Ericson and committed by
GitHub
8c8b03ba f4520c5e

+93
+6
pkgs/os-specific/linux/minimal-bootstrap/default.nix
··· 15 15 16 16 coreutils = callPackage ./coreutils { tinycc = tinycc-mes; }; 17 17 18 + gawk = callPackage ./gawk { 19 + bash = bash_2_05; 20 + tinycc = tinycc-mes; 21 + }; 22 + 18 23 gnugrep = callPackage ./gnugrep { 19 24 bash = bash_2_05; 20 25 tinycc = tinycc-mes; ··· 45 50 46 51 test = kaem.runCommand "minimal-bootstrap-test" {} '' 47 52 echo ${bash_2_05.tests.get-version} 53 + echo ${gawk.tests.get-version} 48 54 echo ${gnugrep.tests.get-version} 49 55 echo ${gnused.tests.get-version} 50 56 echo ${mes.compiler.tests.get-version}
+77
pkgs/os-specific/linux/minimal-bootstrap/gawk/default.nix
··· 1 + { lib 2 + , buildPlatform 3 + , hostPlatform 4 + , fetchurl 5 + , bash 6 + , tinycc 7 + , gnumake 8 + , gnupatch 9 + , gnused 10 + , gnugrep 11 + }: 12 + let 13 + pname = "gawk"; 14 + # >=3.1.x is incompatible with mes-libc 15 + version = "3.0.6"; 16 + 17 + src = fetchurl { 18 + url = "mirror://gnu/gawk/gawk-${version}.tar.gz"; 19 + sha256 = "1z4bibjm7ldvjwq3hmyifyb429rs2d9bdwkvs0r171vv1khpdwmb"; 20 + }; 21 + 22 + patches = [ 23 + # for reproducibility don't generate date stamp 24 + ./no-stamp.patch 25 + ]; 26 + in 27 + bash.runCommand "${pname}-${version}" { 28 + inherit pname version; 29 + 30 + nativeBuildInputs = [ 31 + tinycc.compiler 32 + gnumake 33 + gnupatch 34 + gnused 35 + gnugrep 36 + ]; 37 + 38 + passthru.tests.get-version = result: 39 + bash.runCommand "${pname}-get-version-${version}" {} '' 40 + ${result}/bin/awk --version 41 + mkdir $out 42 + ''; 43 + 44 + meta = with lib; { 45 + description = "GNU implementation of the Awk programming language"; 46 + homepage = "https://www.gnu.org/software/gawk"; 47 + license = licenses.gpl3Plus; 48 + maintainers = teams.minimal-bootstrap.members; 49 + platforms = platforms.unix; 50 + }; 51 + } '' 52 + # Unpack 53 + ungz --file ${src} --output gawk.tar 54 + untar --file gawk.tar 55 + rm gawk.tar 56 + cd gawk-${version} 57 + 58 + # Patch 59 + ${lib.concatMapStringsSep "\n" (f: "patch -Np0 -i ${f}") patches} 60 + 61 + # Configure 62 + export CC="tcc -static -B ${tinycc.libs}/lib" 63 + export ac_cv_func_getpgrp_void=yes 64 + export ac_cv_func_tzset=yes 65 + bash ./configure \ 66 + --build=${buildPlatform.config} \ 67 + --host=${hostPlatform.config} \ 68 + --disable-nls \ 69 + --prefix=$out 70 + 71 + # Build 72 + make gawk 73 + 74 + # Install 75 + install -D gawk $out/bin/gawk 76 + ln -s gawk $out/bin/awk 77 + ''
+10
pkgs/os-specific/linux/minimal-bootstrap/gawk/no-stamp.patch
··· 1 + --- configure 2 + +++ configure 3 + @@ -3676,7 +3676,6 @@ cat >> $CONFIG_STATUS <<EOF 4 + 5 + EOF 6 + cat >> $CONFIG_STATUS <<\EOF 7 + -date > stamp-h 8 + exit 0 9 + EOF 10 + chmod +x $CONFIG_STATUS