fix: don't use bash to call the builds allow them to infer from the shebang

This commit is contained in:
isabel roses 2024-06-22 10:39:58 +01:00
parent 120d4b3257
commit 7adf088998
Signed by: isabelroses
GPG key ID: 08A97B9A107A1798
38 changed files with 443 additions and 432 deletions

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.bash; cfg = config.aux.foundation.stages.stage1.bash;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
includes = [ ./boot.nix ]; includes = [ ./boot.nix ];
options.aux.foundation.stages.stage1.bash = { options.aux.foundation.stages.stage1.bash = {
@ -73,7 +72,8 @@ in {
sha256 = "132qng0jy600mv1fs95ylnlisx2wavkkgpb19c6kmz7lnmjhjwhk"; sha256 = "132qng0jy600mv1fs95ylnlisx2wavkkgpb19c6kmz7lnmjhjwhk";
}; };
package = let package =
let
patches = [ patches = [
# flush output for generated code # flush output for generated code
./patches/mksignames-flush.patch ./patches/mksignames-flush.patch
@ -109,7 +109,8 @@ in {
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib" export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
export AR="tcc -ar" export AR="tcc -ar"
export LD=tcc export LD=tcc
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.binutils; cfg = config.aux.foundation.stages.stage1.binutils;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage1.binutils = { options.aux.foundation.stages.stage1.binutils = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -65,7 +64,8 @@ in {
sha256 = "rppXieI0WeWWBuZxRyPy0//DHAMXQZHvDQFb3wYAdFA="; sha256 = "rppXieI0WeWWBuZxRyPy0//DHAMXQZHvDQFb3wYAdFA=";
}; };
package = let package =
let
patches = [ patches = [
# Make binutils output deterministic by default. # Make binutils output deterministic by default.
./patches/deterministic.patch ./patches/deterministic.patch
@ -133,7 +133,8 @@ in {
export AR="tcc -ar" export AR="tcc -ar"
export lt_cv_sys_max_cmd_len=32768 export lt_cv_sys_max_cmd_len=32768
export CFLAGS="-D__LITTLE_ENDIAN__=1" export CFLAGS="-D__LITTLE_ENDIAN__=1"
bash ./configure ${builtins.concatStringsSep " " configureFlags} chmod +x ./configure
./configure ${builtins.concatStringsSep " " configureFlags}
# Build # Build
make -j $NIX_BUILD_CORES all-libiberty all-gas all-bfd all-libctf all-zlib all-gprof make -j $NIX_BUILD_CORES all-libiberty all-gas all-bfd all-libctf all-zlib all-gprof

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.bison; cfg = config.aux.foundation.stages.stage1.bison;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage1.bison = { options.aux.foundation.stages.stage1.bison = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -90,7 +89,8 @@ in {
cd bison-${cfg.version} cd bison-${cfg.version}
# Configure # Configure
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.coreutils; cfg = config.aux.foundation.stages.stage1.coreutils;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
includes = [ ./boot.nix ]; includes = [ ./boot.nix ];
options.aux.foundation.stages.stage1.coreutils = { options.aux.foundation.stages.stage1.coreutils = {
@ -67,7 +66,8 @@ in {
sha256 = "X2ANkJOXOwr+JTk9m8GMRPIjJlf0yg2V6jHHAutmtzk="; sha256 = "X2ANkJOXOwr+JTk9m8GMRPIjJlf0yg2V6jHHAutmtzk=";
}; };
package = let package =
let
configureFlags = [ configureFlags = [
"--prefix=${builtins.placeholder "out"}" "--prefix=${builtins.placeholder "out"}"
"--build=${platform.build}" "--build=${platform.build}"
@ -101,7 +101,8 @@ in {
# Configure # Configure
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib" export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
export LD=tcc export LD=tcc
bash ./configure ${builtins.concatStringsSep " " configureFlags} chmod +x ./configure
./configure ${builtins.concatStringsSep " " configureFlags}
# Build # Build
make -j $NIX_BUILD_CORES AR="tcc -ar" MAKEINFO="true" make -j $NIX_BUILD_CORES AR="tcc -ar" MAKEINFO="true"

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.diffutils; cfg = config.aux.foundation.stages.stage1.diffutils;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage1.diffutils = { options.aux.foundation.stages.stage1.diffutils = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -91,7 +90,8 @@ in {
# Configure # Configure
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib" export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
export LD=tcc export LD=tcc
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} --host=${platform.host}

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.findutils; cfg = config.aux.foundation.stages.stage1.findutils;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage1.findutils = { options.aux.foundation.stages.stage1.findutils = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -96,7 +95,8 @@ in {
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib" export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
export AR="tcc -ar" export AR="tcc -ar"
export LD=tcc export LD=tcc
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} --host=${platform.host}

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.gawk.boot; cfg = config.aux.foundation.stages.stage1.gawk.boot;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage1.gawk.boot = { options.aux.foundation.stages.stage1.gawk.boot = {
package = lib.options.create { package = lib.options.create {
type = lib.types.derivation; type = lib.types.derivation;
@ -35,7 +34,8 @@ in {
sha256 = "1z4bibjm7ldvjwq3hmyifyb429rs2d9bdwkvs0r171vv1khpdwmb"; sha256 = "1z4bibjm7ldvjwq3hmyifyb429rs2d9bdwkvs0r171vv1khpdwmb";
}; };
package = let package =
let
patches = [ patches = [
# for reproducibility don't generate date stamp # for reproducibility don't generate date stamp
./patches/no-stamp.patch ./patches/no-stamp.patch
@ -68,7 +68,8 @@ in {
export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib" export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib"
export ac_cv_func_getpgrp_void=yes export ac_cv_func_getpgrp_void=yes
export ac_cv_func_tzset=yes export ac_cv_func_tzset=yes
bash ./configure \ chmod +x ./configure
./configure \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \
--disable-nls \ --disable-nls \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.gawk; cfg = config.aux.foundation.stages.stage1.gawk;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
includes = [ ./boot.nix ]; includes = [ ./boot.nix ];
options.aux.foundation.stages.stage1.gawk = { options.aux.foundation.stages.stage1.gawk = {
@ -97,7 +96,8 @@ in {
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib" export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
export AR="tcc -ar" export AR="tcc -ar"
export LD=tcc export LD=tcc
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} --host=${platform.host}

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.gcc; cfg = config.aux.foundation.stages.stage1.gcc;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
includes = [ includes = [
./v4.6.nix ./v4.6.nix
./v4.6.cxx.nix ./v4.6.cxx.nix
@ -201,7 +200,8 @@ in {
export CFLAGS_FOR_TARGET="-Wl,-dynamic-linker -Wl,${stage1.musl.package}/lib/libc.so" export CFLAGS_FOR_TARGET="-Wl,-dynamic-linker -Wl,${stage1.musl.package}/lib/libc.so"
export LIBRARY_PATH="${stage1.musl.package}/lib" export LIBRARY_PATH="${stage1.musl.package}/lib"
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.gcc.v46.cxx; cfg = config.aux.foundation.stages.stage1.gcc.v46.cxx;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage1.gcc.v46.cxx = { options.aux.foundation.stages.stage1.gcc.v46.cxx = {
package = lib.options.create { package = lib.options.create {
type = lib.types.derivation; type = lib.types.derivation;
@ -112,7 +111,8 @@ in {
}; };
}; };
package = let package =
let
patches = [ patches = [
# Remove hardcoded NATIVE_SYSTEM_HEADER_DIR # Remove hardcoded NATIVE_SYSTEM_HEADER_DIR
./patches/no-system-headers.patch ./patches/no-system-headers.patch
@ -162,7 +162,8 @@ in {
export CPLUS_INCLUDE_PATH="$C_INCLUDE_PATH" export CPLUS_INCLUDE_PATH="$C_INCLUDE_PATH"
export LIBRARY_PATH="${stage1.musl.package}/lib" export LIBRARY_PATH="${stage1.musl.package}/lib"
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.gcc.v46; cfg = config.aux.foundation.stages.stage1.gcc.v46;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage1.gcc.v46 = { options.aux.foundation.stages.stage1.gcc.v46 = {
package = lib.options.create { package = lib.options.create {
type = lib.types.derivation; type = lib.types.derivation;
@ -112,7 +111,8 @@ in {
}; };
}; };
package = let package =
let
patches = [ patches = [
# Remove hardcoded NATIVE_SYSTEM_HEADER_DIR # Remove hardcoded NATIVE_SYSTEM_HEADER_DIR
./patches/no-system-headers.patch ./patches/no-system-headers.patch
@ -163,7 +163,8 @@ in {
export ac_cv_func_memcpy=yes export ac_cv_func_memcpy=yes
export ac_cv_func_strerror=yes export ac_cv_func_strerror=yes
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.gcc.v8; cfg = config.aux.foundation.stages.stage1.gcc.v8;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage1.gcc.v8 = { options.aux.foundation.stages.stage1.gcc.v8 = {
package = lib.options.create { package = lib.options.create {
type = lib.types.derivation; type = lib.types.derivation;
@ -168,7 +167,8 @@ in {
export CPLUS_INCLUDE_PATH="$C_INCLUDE_PATH" export CPLUS_INCLUDE_PATH="$C_INCLUDE_PATH"
export LIBRARY_PATH="${stage1.musl.package}/lib" export LIBRARY_PATH="${stage1.musl.package}/lib"
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.gnum4; cfg = config.aux.foundation.stages.stage1.gnum4;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage1.gnum4 = { options.aux.foundation.stages.stage1.gnum4 = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -89,7 +88,8 @@ in {
cd m4-${cfg.version} cd m4-${cfg.version}
# Configure # Configure
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.gnumake; cfg = config.aux.foundation.stages.stage1.gnumake;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
includes = [ ./boot.nix ]; includes = [ ./boot.nix ];
options.aux.foundation.stages.stage1.gnumake = { options.aux.foundation.stages.stage1.gnumake = {
@ -67,7 +66,8 @@ in {
sha256 = "3Rb7HWe/q3mnL16DkHNcSePo5wtJRaFasfgd23hlj7M="; sha256 = "3Rb7HWe/q3mnL16DkHNcSePo5wtJRaFasfgd23hlj7M=";
}; };
package = let package =
let
patches = [ patches = [
# Replaces /bin/sh with sh, see patch file for reasoning # Replaces /bin/sh with sh, see patch file for reasoning
./patches/0001-No-impure-bin-sh.patch ./patches/0001-No-impure-bin-sh.patch
@ -104,7 +104,8 @@ in {
# Configure # Configure
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib" export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
export LD=tcc export LD=tcc
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} --host=${platform.host}

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.gnutar.boot; cfg = config.aux.foundation.stages.stage1.gnutar.boot;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage1.gnutar.boot = { options.aux.foundation.stages.stage1.gnutar.boot = {
package = lib.options.create { package = lib.options.create {
type = lib.types.derivation; type = lib.types.derivation;
@ -35,7 +34,8 @@ in {
sha256 = "02m6gajm647n8l9a5bnld6fnbgdpyi4i3i83p7xcwv0kif47xhy6"; sha256 = "02m6gajm647n8l9a5bnld6fnbgdpyi4i3i83p7xcwv0kif47xhy6";
}; };
package = let package =
let
in in
builders.bash.boot.build { builders.bash.boot.build {
name = "gnutar-boot-${cfg.version}"; name = "gnutar-boot-${cfg.version}";
@ -58,7 +58,8 @@ in {
# Configure # Configure
export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib" export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib"
bash ./configure \ chmod +x ./configure
./configure \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \
--disable-nls \ --disable-nls \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.gnutar; cfg = config.aux.foundation.stages.stage1.gnutar;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
includes = [ includes = [
./boot.nix ./boot.nix
./musl.nix ./musl.nix
@ -99,7 +98,8 @@ in {
cd tar-${cfg.version} cd tar-${cfg.version}
# Configure # Configure
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.gnutar.musl; cfg = config.aux.foundation.stages.stage1.gnutar.musl;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage1.gnutar.musl = { options.aux.foundation.stages.stage1.gnutar.musl = {
package = lib.options.create { package = lib.options.create {
type = lib.types.derivation; type = lib.types.derivation;
@ -60,7 +59,8 @@ in {
export ac_cv_sizeof_unsigned_long=4 export ac_cv_sizeof_unsigned_long=4
export ac_cv_sizeof_long_long=8 export ac_cv_sizeof_long_long=8
export ac_cv_header_netdb_h=no export ac_cv_header_netdb_h=no
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,13 +1,12 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.gzip; cfg = config.aux.foundation.stages.stage1.gzip;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage1.gzip = { options.aux.foundation.stages.stage1.gzip = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -64,9 +63,7 @@ in {
sha256 = "0ryr5b00qz3xcdcv03qwjdfji8pasp0007ay3ppmk71wl8c1i90w"; sha256 = "0ryr5b00qz3xcdcv03qwjdfji8pasp0007ay3ppmk71wl8c1i90w";
}; };
package = let package = builders.bash.boot.build {
in
builders.bash.boot.build {
name = "gzip-${cfg.version}"; name = "gzip-${cfg.version}";
meta = cfg.meta; meta = cfg.meta;
@ -86,7 +83,8 @@ in {
# Configure # Configure
export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib -Dstrlwr=unused" export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib -Dstrlwr=unused"
bash ./configure --prefix=$out chmod +x ./configure
./configure --prefix=$out
# Build # Build
make make

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.musl.boot; cfg = config.aux.foundation.stages.stage1.musl.boot;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage1.musl.boot = { options.aux.foundation.stages.stage1.musl.boot = {
package = lib.options.create { package = lib.options.create {
type = lib.types.derivation; type = lib.types.derivation;
@ -35,7 +34,8 @@ in {
sha256 = "E3DJqBKyzyp9koAlEMygBYzDfmanvt1wBR8KNAFQIqM="; sha256 = "E3DJqBKyzyp9koAlEMygBYzDfmanvt1wBR8KNAFQIqM=";
}; };
package = let package =
let
# Thanks to the live-bootstrap project! # Thanks to the live-bootstrap project!
# See https://github.com/fosslinux/live-bootstrap/blob/d98f97e21413efc32c770d0356f1feda66025686/sysa/musl-1.1.24/musl-1.1.24.sh # See https://github.com/fosslinux/live-bootstrap/blob/d98f97e21413efc32c770d0356f1feda66025686/sysa/musl-1.1.24/musl-1.1.24.sh
liveBootstrap = "https://github.com/fosslinux/live-bootstrap/raw/d98f97e21413efc32c770d0356f1feda66025686/sysa/musl-1.1.24"; liveBootstrap = "https://github.com/fosslinux/live-bootstrap/raw/d98f97e21413efc32c770d0356f1feda66025686/sysa/musl-1.1.24";
@ -118,7 +118,8 @@ in {
src/misc/wordexp.c src/misc/wordexp.c
# Configure # Configure
bash ./configure \ chmod +x configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.musl; cfg = config.aux.foundation.stages.stage1.musl;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
includes = [ ./boot.nix ]; includes = [ ./boot.nix ];
options.aux.foundation.stages.stage1.musl = { options.aux.foundation.stages.stage1.musl = {
@ -99,7 +98,8 @@ in {
src/misc/wordexp.c src/misc/wordexp.c
# Configure # Configure
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.python; cfg = config.aux.foundation.stages.stage1.python;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage1.python = { options.aux.foundation.stages.stage1.python = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -65,7 +64,8 @@ in {
sha256 = "eVw09E30Wg6blxDIxxwVxnGHFSTNQSyhTe8hLozLFV0="; sha256 = "eVw09E30Wg6blxDIxxwVxnGHFSTNQSyhTe8hLozLFV0=";
}; };
package = let package =
let
patches = [ patches = [
# Disable the use of ldconfig in ctypes.util.find_library (since # Disable the use of ldconfig in ctypes.util.find_library (since
# ldconfig doesn't work on NixOS), and don't use # ldconfig doesn't work on NixOS), and don't use
@ -107,7 +107,8 @@ in {
export C_INCLUDE_PATH="${stage1.zlib.package}/include" export C_INCLUDE_PATH="${stage1.zlib.package}/include"
export LIBRARY_PATH="${stage1.zlib.package}/lib" export LIBRARY_PATH="${stage1.zlib.package}/lib"
export LD_LIBRARY_PATH="$LIBRARY_PATH" export LD_LIBRARY_PATH="$LIBRARY_PATH"
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} --host=${platform.host}

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.xz; cfg = config.aux.foundation.stages.stage1.xz;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage1.xz = { options.aux.foundation.stages.stage1.xz = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -92,7 +91,8 @@ in {
export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib" export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib"
export AR="tcc -ar" export AR="tcc -ar"
export LD=tcc export LD=tcc
bash ./configure \ chmod +x configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage1.zlib; cfg = config.aux.foundation.stages.stage1.zlib;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage1.zlib = { options.aux.foundation.stages.stage1.zlib = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -87,7 +86,8 @@ in {
# Configure # Configure
export CC=musl-gcc export CC=musl-gcc
bash ./configure --prefix=$out chmod +x configure
./configure --prefix=$out
# Build # Build
make -j $NIX_BUILD_CORES make -j $NIX_BUILD_CORES

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage2.bash; cfg = config.aux.foundation.stages.stage2.bash;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage2.bash = { options.aux.foundation.stages.stage2.bash = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -98,7 +97,8 @@ in {
cd bash-${cfg.version} cd bash-${cfg.version}
# Configure # Configure
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage2.binutils; cfg = config.aux.foundation.stages.stage2.binutils;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage2.binutils = { options.aux.foundation.stages.stage2.binutils = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -65,7 +64,8 @@ in {
sha256 = "rppXieI0WeWWBuZxRyPy0//DHAMXQZHvDQFb3wYAdFA="; sha256 = "rppXieI0WeWWBuZxRyPy0//DHAMXQZHvDQFb3wYAdFA=";
}; };
package = let package =
let
patches = [ patches = [
# Make binutils output deterministic by default. # Make binutils output deterministic by default.
./patches/deterministic.patch ./patches/deterministic.patch
@ -123,7 +123,8 @@ in {
${lib.strings.concatMapSep "\n" (file: "patch -Np1 -i ${file}") patches} ${lib.strings.concatMapSep "\n" (file: "patch -Np1 -i ${file}") patches}
# Configure # Configure
bash ./configure ${builtins.concatStringsSep " " configureFlags} chmod +x ./configure
./configure ${builtins.concatStringsSep " " configureFlags}
# Build # Build
make -j $NIX_BUILD_CORES make -j $NIX_BUILD_CORES

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage2.coreutils; cfg = config.aux.foundation.stages.stage2.coreutils;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage2.coreutils = { options.aux.foundation.stages.stage2.coreutils = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -65,7 +64,8 @@ in {
sha256 = "X2ANkJOXOwr+JTk9m8GMRPIjJlf0yg2V6jHHAutmtzk="; sha256 = "X2ANkJOXOwr+JTk9m8GMRPIjJlf0yg2V6jHHAutmtzk=";
}; };
package = let package =
let
configureFlags = [ configureFlags = [
"--prefix=${builtins.placeholder "out"}" "--prefix=${builtins.placeholder "out"}"
"--build=${platform.build}" "--build=${platform.build}"
@ -102,7 +102,8 @@ in {
cd coreutils-${cfg.version} cd coreutils-${cfg.version}
# Configure # Configure
bash ./configure ${builtins.concatStringsSep " " configureFlags} chmod +x ./configure
./configure ${builtins.concatStringsSep " " configureFlags}
# Build # Build
make -j $NIX_BUILD_CORES make -j $NIX_BUILD_CORES

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage2.diffutils; cfg = config.aux.foundation.stages.stage2.diffutils;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage2.diffutils = { options.aux.foundation.stages.stage2.diffutils = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -90,7 +89,8 @@ in {
cd diffutils-${cfg.version} cd diffutils-${cfg.version}
# Configure # Configure
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage2.findutils; cfg = config.aux.foundation.stages.stage2.findutils;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage2.findutils = { options.aux.foundation.stages.stage2.findutils = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -90,7 +89,8 @@ in {
cd findutils-${cfg.version} cd findutils-${cfg.version}
# Configure # Configure
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage2.gawk; cfg = config.aux.foundation.stages.stage2.gawk;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage2.gawk = { options.aux.foundation.stages.stage2.gawk = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -96,7 +95,8 @@ in {
cd gawk-${cfg.version} cd gawk-${cfg.version}
# Configure # Configure
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage2.gcc; cfg = config.aux.foundation.stages.stage2.gcc;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage2.gcc = { options.aux.foundation.stages.stage2.gcc = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -195,7 +194,8 @@ in {
export CFLAGS_FOR_TARGET="-Wl,-dynamic-linker -Wl,${stage1.musl.package}/lib/libc.so" export CFLAGS_FOR_TARGET="-Wl,-dynamic-linker -Wl,${stage1.musl.package}/lib/libc.so"
export LIBRARY_PATH="${stage1.musl.package}/lib" export LIBRARY_PATH="${stage1.musl.package}/lib"
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,7 +1,5 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage2.glibc; cfg = config.aux.foundation.stages.stage2.glibc;
platform = config.aux.platform; platform = config.aux.platform;
@ -9,7 +7,8 @@
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
stage2 = config.aux.foundation.stages.stage2; stage2 = config.aux.foundation.stages.stage2;
in { in
{
options.aux.foundation.stages.stage2.glibc = { options.aux.foundation.stages.stage2.glibc = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -95,7 +94,8 @@ in {
cd build cd build
# libstdc++.so is built against musl and fails to link # libstdc++.so is built against musl and fails to link
export CXX=false export CXX=false
bash ../configure \ chmod +x ../configure
../configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage2.gnugrep; cfg = config.aux.foundation.stages.stage2.gnugrep;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage2.gnugrep = { options.aux.foundation.stages.stage2.gnugrep = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -95,7 +94,8 @@ in {
cd grep-${cfg.version} cd grep-${cfg.version}
# Configure # Configure
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,7 +1,5 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage2.gnumake; cfg = config.aux.foundation.stages.stage2.gnumake;
platform = config.aux.platform; platform = config.aux.platform;
@ -9,7 +7,8 @@
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
stage2 = config.aux.foundation.stages.stage2; stage2 = config.aux.foundation.stages.stage2;
in { in
{
options.aux.foundation.stages.stage2.gnumake = { options.aux.foundation.stages.stage2.gnumake = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -66,7 +65,8 @@ in {
sha256 = "3Rb7HWe/q3mnL16DkHNcSePo5wtJRaFasfgd23hlj7M="; sha256 = "3Rb7HWe/q3mnL16DkHNcSePo5wtJRaFasfgd23hlj7M=";
}; };
package = let package =
let
patches = [ patches = [
# Replaces /bin/sh with sh, see patch file for reasoning # Replaces /bin/sh with sh, see patch file for reasoning
./patches/0001-No-impure-bin-sh.patch ./patches/0001-No-impure-bin-sh.patch
@ -105,7 +105,8 @@ in {
${lib.strings.concatMapSep "\n" (file: "patch -Np1 -i ${file}") patches} ${lib.strings.concatMapSep "\n" (file: "patch -Np1 -i ${file}") patches}
# Configure # Configure
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage2.gnupatch; cfg = config.aux.foundation.stages.stage2.gnupatch;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage2.gnupatch = { options.aux.foundation.stages.stage2.gnupatch = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -91,7 +90,8 @@ in {
cd patch-${cfg.version} cd patch-${cfg.version}
# Configure # Configure
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage2.gnused; cfg = config.aux.foundation.stages.stage2.gnused;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage2.gnused = { options.aux.foundation.stages.stage2.gnused = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -97,7 +96,8 @@ in {
cd sed-${cfg.version} cd sed-${cfg.version}
# Configure # Configure
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage2.gnutar; cfg = config.aux.foundation.stages.stage2.gnutar;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage2.gnutar = { options.aux.foundation.stages.stage2.gnutar = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -96,7 +95,8 @@ in {
cd tar-${cfg.version} cd tar-${cfg.version}
# Configure # Configure
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,14 +1,13 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage2.gzip; cfg = config.aux.foundation.stages.stage2.gzip;
platform = config.aux.platform; platform = config.aux.platform;
builders = config.aux.foundation.builders; builders = config.aux.foundation.builders;
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in
{
options.aux.foundation.stages.stage2.gzip = { options.aux.foundation.stages.stage2.gzip = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -89,7 +88,8 @@ in {
cd gzip-${cfg.version} cd gzip-${cfg.version}
# Configure # Configure
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \

View file

@ -1,7 +1,5 @@
{ { lib, config }:
lib, let
config,
}: let
cfg = config.aux.foundation.stages.stage2.patchelf; cfg = config.aux.foundation.stages.stage2.patchelf;
platform = config.aux.platform; platform = config.aux.platform;
@ -9,7 +7,8 @@
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
stage2 = config.aux.foundation.stages.stage2; stage2 = config.aux.foundation.stages.stage2;
in { in
{
options.aux.foundation.stages.stage2.patchelf = { options.aux.foundation.stages.stage2.patchelf = {
meta = { meta = {
description = lib.options.create { description = lib.options.create {
@ -90,7 +89,8 @@ in {
cd patchelf-${cfg.version} cd patchelf-${cfg.version}
# Configure # Configure
bash ./configure \ chmod +x ./configure
./configure \
--prefix=$out \ --prefix=$out \
--build=${platform.build} \ --build=${platform.build} \
--host=${platform.host} \ --host=${platform.host} \