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

59 lines
1.2 KiB
Nix

{
lib,
fetchurl,
bash,
tinycc,
gnumake,
}:
let
pname = "gnugrep";
version = "2.4";
src = fetchurl {
url = "mirror://gnu/grep/grep-${version}.tar.gz";
sha256 = "05iayw5sfclc476vpviz67hdy03na0pz2kb5csa50232nfx34853";
};
in
bash.runCommand "${pname}-${version}"
{
inherit pname version;
nativeBuildInputs = [
tinycc.compiler
gnumake
];
passthru.tests.get-version =
result:
bash.runCommand "${pname}-get-version-${version}" { } ''
${result}/bin/grep --version
mkdir ''${out}
'';
meta = {
description = "GNU implementation of the Unix grep command";
homepage = "https://www.gnu.org/software/grep";
license = lib.licenses.gpl3Plus;
teams = [ lib.teams.minimal-bootstrap ];
mainProgram = "grep";
platforms = lib.platforms.unix;
};
}
''
# Unpack
ungz --file ${src} --output grep.tar
untar --file grep.tar
rm grep.tar
cd grep-${version}
# Configure
cp ${./main.mk} Makefile
# Build
# NOTE: parallel build (-j) breaks custom Makefile here; keep serial.
make CC="tcc -B ${tinycc.libs}/lib"
# Install
make install PREFIX=$out
''