minimal-bootstrap.gawk: build with musl

This commit is contained in:
Emily Trau
2023-09-26 22:20:34 -07:00
parent 60ae6bf751
commit 4166e1fded
2 changed files with 12 additions and 25 deletions
@@ -19,14 +19,12 @@ lib.makeScope
bootBash = bash_2_05;
gcc = gcc2;
glibc = glibc22;
gawk = gawk-mes;
};
binutils = callPackage ./binutils {
bash = bash_2_05;
tinycc = tinycc-musl;
musl = musl11;
gawk = gawk-mes;
};
bzip2 = callPackage ./bzip2 {
@@ -40,14 +38,12 @@ lib.makeScope
bash = bash_2_05;
tinycc = tinycc-musl;
musl = musl11;
gawk = gawk-mes;
};
findutils = callPackage ./findutils {
bash = bash_2_05;
gcc = gcc2;
glibc = glibc22;
gawk = gawk-mes;
};
gawk-mes = callPackage ./gawk/mes.nix {
@@ -58,8 +54,8 @@ lib.makeScope
gawk = callPackage ./gawk {
bash = bash_2_05;
gcc = gcc2;
glibc = glibc22;
tinycc = tinycc-musl;
musl = musl11;
bootGawk = gawk-mes;
};
@@ -77,13 +73,11 @@ lib.makeScope
gcc46 = callPackage ./gcc/4.6.nix {
gcc = gcc2;
glibc = glibc22;
gawk = gawk-mes;
};
inherit (callPackage ./glibc {
bash = bash_2_05;
gnused = gnused-mes;
gawk = gawk-mes;
}) glibc22;
gnugrep = callPackage ./gnugrep {
@@ -156,7 +150,6 @@ lib.makeScope
xz = callPackage ./xz {
bash = bash_2_05;
tinycc = tinycc-mes;
gawk = gawk-mes;
inherit (heirloom) sed;
};
@@ -3,10 +3,8 @@
, hostPlatform
, fetchurl
, bash
, gcc
, glibc
, binutils
, linux-headers
, tinycc
, musl
, gnumake
, gnugrep
, gnused
@@ -17,21 +15,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.0";
src = fetchurl {
url = "mirror://gnu/gawk/gawk-${version}.tar.gz";
sha256 = "0dadjkpyyizmyd0l098qps8lb39r0vrz3xl3hwz2cmjs5c70h0wc";
hash = "sha256-71r0RJywJp+vOvJL9MAic9RV8HQb88UPht3AkzLWz1Y=";
};
in
bash.runCommand "${pname}-${version}" {
inherit pname version meta;
nativeBuildInputs = [
gcc
binutils
tinycc.compiler
gnumake
gnused
gnugrep
@@ -51,18 +46,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 ${musl}/lib"
export AR="tcc -ar"
export LD=tcc
bash ./configure \
--prefix=$out \
--build=${buildPlatform.config} \
--host=${hostPlatform.config}
# Build
make gawk
make
# Install
install -D gawk $out/bin/gawk
ln -s gawk $out/bin/awk
make install
''