Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

79 lines
1.6 KiB
Nix

{
lib,
buildPlatform,
hostPlatform,
fetchurl,
bash,
tinycc,
gnumake,
gnugrep,
gnused,
gawk,
gnutar,
gzip,
}:
let
pname = "bootstrap-coreutils-musl";
version = "9.4";
src = fetchurl {
url = "mirror://gnu/coreutils/coreutils-${version}.tar.gz";
hash = "sha256-X2ANkJOXOwr+JTk9m8GMRPIjJlf0yg2V6jHHAutmtzk=";
};
configureFlags = [
"--prefix=${placeholder "out"}"
"--build=${buildPlatform.config}"
"--host=${hostPlatform.config}"
# musl 1.1.x doesn't use 64bit time_t
"--disable-year2038"
# libstdbuf.so fails in static builds
"--enable-no-install-program=stdbuf"
];
in
bash.runCommand "${pname}-${version}"
{
inherit pname version;
nativeBuildInputs = [
tinycc.compiler
gnumake
gnused
gnugrep
gawk
gnutar
gzip
];
passthru.tests.get-version =
result:
bash.runCommand "${pname}-get-version-${version}" { } ''
${result}/bin/cat --version
mkdir $out
'';
meta = with lib; {
description = "GNU Core Utilities";
homepage = "https://www.gnu.org/software/coreutils";
license = licenses.gpl3Plus;
teams = [ teams.minimal-bootstrap ];
platforms = platforms.unix;
};
}
''
# Unpack
tar xzf ${src}
cd coreutils-${version}
# Configure
export CC="tcc -B ${tinycc.libs}/lib"
export LD=tcc
bash ./configure ${lib.concatStringsSep " " configureFlags}
# Build
make -j $NIX_BUILD_CORES AR="tcc -ar" MAKEINFO="true"
# Install
make -j $NIX_BUILD_CORES install MAKEINFO="true"
''