summary refs log tree commit diff
path: root/pkgs/os-specific/linux/minimal-bootstrap/gawk/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/minimal-bootstrap/gawk/default.nix')
-rw-r--r--pkgs/os-specific/linux/minimal-bootstrap/gawk/default.nix25
1 files changed, 9 insertions, 16 deletions
diff --git a/pkgs/os-specific/linux/minimal-bootstrap/gawk/default.nix b/pkgs/os-specific/linux/minimal-bootstrap/gawk/default.nix
index 935414f2176..879b98bf00c 100644
--- a/pkgs/os-specific/linux/minimal-bootstrap/gawk/default.nix
+++ b/pkgs/os-specific/linux/minimal-bootstrap/gawk/default.nix
@@ -3,10 +3,7 @@
 , hostPlatform
 , fetchurl
 , bash
-, gcc
-, glibc
-, binutils
-, linux-headers
+, tinycc
 , gnumake
 , gnugrep
 , gnused
@@ -17,21 +14,18 @@
 let
   inherit (import ./common.nix { inherit lib; }) meta;
   pname = "gawk";
-  # >= 4.2.0 fails to cleanly build. may be worth investigating in the future.
-  # for now this version is sufficient to build glibc 2.16
-  version = "4.1.4";
+  version = "5.2.2";
 
   src = fetchurl {
     url = "mirror://gnu/gawk/gawk-${version}.tar.gz";
-    sha256 = "0dadjkpyyizmyd0l098qps8lb39r0vrz3xl3hwz2cmjs5c70h0wc";
+    hash = "sha256-lFrvfM/xAfILIqEIArwAXplKsrjqPnJMwaGXxi9B9lA=";
   };
 in
 bash.runCommand "${pname}-${version}" {
   inherit pname version meta;
 
   nativeBuildInputs = [
-    gcc
-    binutils
+    tinycc.compiler
     gnumake
     gnused
     gnugrep
@@ -51,18 +45,17 @@ bash.runCommand "${pname}-${version}" {
   cd gawk-${version}
 
   # Configure
-  export C_INCLUDE_PATH="${glibc}/include:${linux-headers}/include"
-  export LIBRARY_PATH="${glibc}/lib"
-  export LIBS="-lc -lnss_files -lnss_dns -lresolv"
+  export CC="tcc -B ${tinycc.libs}/lib"
+  export AR="tcc -ar"
+  export LD=tcc
   bash ./configure \
     --prefix=$out \
     --build=${buildPlatform.config} \
     --host=${hostPlatform.config}
 
   # Build
-  make gawk
+  make -j $NIX_BUILD_CORES
 
   # Install
-  install -D gawk $out/bin/gawk
-  ln -s gawk $out/bin/awk
+  make -j $NIX_BUILD_CORES install
 ''