Files
Ben Siraphob f6bbbded6d minimal-bootstrap: trim configure flags and slim python
Adds --enable-checking=release and --disable-{libgomp,libquadmath,libitm,libvtv,libssp,libatomic,libstdcxx-pch,nls} to all GCCs (those runtime libs are unused by the stdenv); switches gcc-4.6{,cxx} to install-strip; adds --disable-nls to binutils and coreutils; adds --disable-test-modules --without-ensurepip --without-static-libpython to python.

Bootstrap self-size 1.45 GB -> 940 MB; gcc46-cxx -14%, glibc -10%, gcc-latest -6% wall on the heavy builds.

(make -j was tried on tcc-built derivations and broke them silently; NOTE comments left in the affected files so this isn't re-attempted.)
2026-04-26 22:25:28 -07:00

77 lines
1.6 KiB
Nix

{
lib,
buildPlatform,
hostPlatform,
fetchurl,
bash,
tinycc,
gnumake,
gnupatch,
gnused,
gnugrep,
}:
let
inherit (import ./common.nix { inherit lib; }) meta;
pname = "gawk-mes";
# >=3.1.x is incompatible with mes-libc
version = "3.0.6";
src = fetchurl {
url = "mirror://gnu/gawk/gawk-${version}.tar.gz";
sha256 = "1z4bibjm7ldvjwq3hmyifyb429rs2d9bdwkvs0r171vv1khpdwmb";
};
patches = [
# for reproducibility don't generate date stamp
./no-stamp.patch
];
in
bash.runCommand "${pname}-${version}"
{
inherit pname version meta;
nativeBuildInputs = [
tinycc.compiler
gnumake
gnupatch
gnused
gnugrep
];
passthru.tests.get-version =
result:
bash.runCommand "${pname}-get-version-${version}" { } ''
${result}/bin/awk --version
mkdir $out
'';
}
''
# Unpack
ungz --file ${src} --output gawk.tar
untar --file gawk.tar
rm gawk.tar
cd gawk-${version}
# Patch
${lib.concatMapStringsSep "\n" (f: "patch -Np0 -i ${f}") patches}
# Configure
export CC="tcc -B ${tinycc.libs}/lib"
export ac_cv_func_getpgrp_void=yes
export ac_cv_func_tzset=yes
bash ./configure \
--build=${buildPlatform.config} \
--host=${hostPlatform.config} \
--disable-dependency-tracking \
--disable-nls \
--prefix=$out
# Build
# NOTE: parallel build (-j) breaks gawk autoconf'd Makefile under tcc-mes; keep serial.
make gawk
# Install
install -D gawk $out/bin/gawk
ln -s gawk $out/bin/awk
''