From 61139839b6dc207915b7259ceacab8f7636c6c3c Mon Sep 17 00:00:00 2001 From: isabel Date: Sat, 22 Jun 2024 10:39:58 +0100 Subject: [PATCH] fix: don't use bash to call the builds allow them to infer from the shebang --- foundation/src/stages/stage1/bash/default.nix | 27 ++--- .../src/stages/stage1/binutils/default.nix | 59 +++++----- .../src/stages/stage1/bison/default.nix | 12 +- .../src/stages/stage1/coreutils/default.nix | 37 +++--- .../src/stages/stage1/diffutils/default.nix | 12 +- .../src/stages/stage1/findutils/default.nix | 12 +- foundation/src/stages/stage1/gawk/boot.nix | 25 +++-- foundation/src/stages/stage1/gawk/default.nix | 14 +-- foundation/src/stages/stage1/gcc/default.nix | 12 +- foundation/src/stages/stage1/gcc/v4.6.cxx.nix | 25 +++-- foundation/src/stages/stage1/gcc/v4.6.nix | 25 +++-- foundation/src/stages/stage1/gcc/v8.nix | 12 +- .../src/stages/stage1/gnum4/default.nix | 12 +- .../src/stages/stage1/gnumake/default.nix | 35 +++--- foundation/src/stages/stage1/gnutar/boot.nix | 17 +-- .../src/stages/stage1/gnutar/default.nix | 12 +- foundation/src/stages/stage1/gnutar/musl.nix | 12 +- foundation/src/stages/stage1/gzip/default.nix | 62 +++++------ foundation/src/stages/stage1/musl/boot.nix | 105 +++++++++--------- foundation/src/stages/stage1/musl/default.nix | 14 +-- .../src/stages/stage1/python/default.nix | 33 +++--- foundation/src/stages/stage1/xz/default.nix | 12 +- foundation/src/stages/stage1/zlib/default.nix | 12 +- foundation/src/stages/stage2/bash/default.nix | 12 +- .../src/stages/stage2/binutils/default.nix | 63 +++++------ .../src/stages/stage2/coreutils/default.nix | 37 +++--- .../src/stages/stage2/diffutils/default.nix | 12 +- .../src/stages/stage2/findutils/default.nix | 12 +- foundation/src/stages/stage2/gawk/default.nix | 12 +- foundation/src/stages/stage2/gcc/default.nix | 12 +- .../src/stages/stage2/glibc/default.nix | 12 +- .../src/stages/stage2/gnugrep/default.nix | 12 +- .../src/stages/stage2/gnumake/default.nix | 33 +++--- .../src/stages/stage2/gnupatch/default.nix | 12 +- .../src/stages/stage2/gnused/default.nix | 12 +- .../src/stages/stage2/gnutar/default.nix | 12 +- foundation/src/stages/stage2/gzip/default.nix | 12 +- .../src/stages/stage2/patchelf/default.nix | 12 +- 38 files changed, 443 insertions(+), 432 deletions(-) diff --git a/foundation/src/stages/stage1/bash/default.nix b/foundation/src/stages/stage1/bash/default.nix index 82bd80f..a4eebac 100644 --- a/foundation/src/stages/stage1/bash/default.nix +++ b/foundation/src/stages/stage1/bash/default.nix @@ -1,15 +1,14 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.bash; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { - includes = [./boot.nix]; +in +{ + includes = [ ./boot.nix ]; options.aux.foundation.stages.stage1.bash = { meta = { @@ -73,12 +72,13 @@ in { sha256 = "132qng0jy600mv1fs95ylnlisx2wavkkgpb19c6kmz7lnmjhjwhk"; }; - package = let - patches = [ - # flush output for generated code - ./patches/mksignames-flush.patch - ]; - in + package = + let + patches = [ + # flush output for generated code + ./patches/mksignames-flush.patch + ]; + in builders.bash.boot.build { name = "bash-${cfg.version}"; @@ -109,7 +109,8 @@ in { export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib" export AR="tcc -ar" export LD=tcc - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage1/binutils/default.nix b/foundation/src/stages/stage1/binutils/default.nix index 6d0408c..0a323e9 100644 --- a/foundation/src/stages/stage1/binutils/default.nix +++ b/foundation/src/stages/stage1/binutils/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.binutils; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage1.binutils = { meta = { description = lib.options.create { @@ -65,32 +64,33 @@ in { sha256 = "rppXieI0WeWWBuZxRyPy0//DHAMXQZHvDQFb3wYAdFA="; }; - package = let - patches = [ - # Make binutils output deterministic by default. - ./patches/deterministic.patch - ]; + package = + let + patches = [ + # Make binutils output deterministic by default. + ./patches/deterministic.patch + ]; - configureFlags = [ - "--prefix=${builtins.placeholder "out"}" - "--build=${platform.build}" - "--host=${platform.host}" - "--with-sysroot=/" - "--enable-deterministic-archives" - # depends on bison - "--disable-gprofng" + configureFlags = [ + "--prefix=${builtins.placeholder "out"}" + "--build=${platform.build}" + "--host=${platform.host}" + "--with-sysroot=/" + "--enable-deterministic-archives" + # depends on bison + "--disable-gprofng" - # Turn on --enable-new-dtags by default to make the linker set - # RUNPATH instead of RPATH on binaries. This is important because - # RUNPATH can be overridden using LD_LIBRARY_PATH at runtime. - "--enable-new-dtags" + # Turn on --enable-new-dtags by default to make the linker set + # RUNPATH instead of RPATH on binaries. This is important because + # RUNPATH can be overridden using LD_LIBRARY_PATH at runtime. + "--enable-new-dtags" - # By default binutils searches $libdir for libraries. This brings in - # libbfd and libopcodes into a default visibility. Drop default lib - # path to force users to declare their use of these libraries. - "--with-lib-path=:" - ]; - in + # By default binutils searches $libdir for libraries. This brings in + # libbfd and libopcodes into a default visibility. Drop default lib + # path to force users to declare their use of these libraries. + "--with-lib-path=:" + ]; + in builders.bash.boot.build { name = "binutils-${cfg.version}"; @@ -133,7 +133,8 @@ in { export AR="tcc -ar" export lt_cv_sys_max_cmd_len=32768 export CFLAGS="-D__LITTLE_ENDIAN__=1" - bash ./configure ${builtins.concatStringsSep " " configureFlags} + chmod +x ./configure + ./configure ${builtins.concatStringsSep " " configureFlags} # Build make -j $NIX_BUILD_CORES all-libiberty all-gas all-bfd all-libctf all-zlib all-gprof diff --git a/foundation/src/stages/stage1/bison/default.nix b/foundation/src/stages/stage1/bison/default.nix index fc5fe71..b01ba1f 100644 --- a/foundation/src/stages/stage1/bison/default.nix +++ b/foundation/src/stages/stage1/bison/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.bison; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage1.bison = { meta = { description = lib.options.create { @@ -90,7 +89,8 @@ in { cd bison-${cfg.version} # Configure - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage1/coreutils/default.nix b/foundation/src/stages/stage1/coreutils/default.nix index 4067019..77869a6 100644 --- a/foundation/src/stages/stage1/coreutils/default.nix +++ b/foundation/src/stages/stage1/coreutils/default.nix @@ -1,15 +1,14 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.coreutils; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { - includes = [./boot.nix]; +in +{ + includes = [ ./boot.nix ]; options.aux.foundation.stages.stage1.coreutils = { meta = { @@ -67,17 +66,18 @@ in { sha256 = "X2ANkJOXOwr+JTk9m8GMRPIjJlf0yg2V6jHHAutmtzk="; }; - package = let - configureFlags = [ - "--prefix=${builtins.placeholder "out"}" - "--build=${platform.build}" - "--host=${platform.host}" - # musl 1.1.x doesn't use 64bit time_t - "--disable-year2038" - # libstdbuf.so fails in static builds - "--enable-no-install-program=stdbuf" - ]; - in + package = + let + configureFlags = [ + "--prefix=${builtins.placeholder "out"}" + "--build=${platform.build}" + "--host=${platform.host}" + # musl 1.1.x doesn't use 64bit time_t + "--disable-year2038" + # libstdbuf.so fails in static builds + "--enable-no-install-program=stdbuf" + ]; + in builders.bash.boot.build { name = "coreutils-${cfg.version}"; @@ -101,7 +101,8 @@ in { # Configure export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib" export LD=tcc - bash ./configure ${builtins.concatStringsSep " " configureFlags} + chmod +x ./configure + ./configure ${builtins.concatStringsSep " " configureFlags} # Build make -j $NIX_BUILD_CORES AR="tcc -ar" MAKEINFO="true" diff --git a/foundation/src/stages/stage1/diffutils/default.nix b/foundation/src/stages/stage1/diffutils/default.nix index 6da1585..440abad 100644 --- a/foundation/src/stages/stage1/diffutils/default.nix +++ b/foundation/src/stages/stage1/diffutils/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.diffutils; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage1.diffutils = { meta = { description = lib.options.create { @@ -91,7 +90,8 @@ in { # Configure export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib" export LD=tcc - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} diff --git a/foundation/src/stages/stage1/findutils/default.nix b/foundation/src/stages/stage1/findutils/default.nix index cb03e45..244752f 100644 --- a/foundation/src/stages/stage1/findutils/default.nix +++ b/foundation/src/stages/stage1/findutils/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.findutils; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage1.findutils = { meta = { description = lib.options.create { @@ -96,7 +95,8 @@ in { export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib" export AR="tcc -ar" export LD=tcc - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} diff --git a/foundation/src/stages/stage1/gawk/boot.nix b/foundation/src/stages/stage1/gawk/boot.nix index 165ab89..e58c063 100644 --- a/foundation/src/stages/stage1/gawk/boot.nix +++ b/foundation/src/stages/stage1/gawk/boot.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.gawk.boot; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage1.gawk.boot = { package = lib.options.create { type = lib.types.derivation; @@ -35,12 +34,13 @@ in { sha256 = "1z4bibjm7ldvjwq3hmyifyb429rs2d9bdwkvs0r171vv1khpdwmb"; }; - package = let - patches = [ - # for reproducibility don't generate date stamp - ./patches/no-stamp.patch - ]; - in + package = + let + patches = [ + # for reproducibility don't generate date stamp + ./patches/no-stamp.patch + ]; + in builders.bash.boot.build { name = "gawk-boot-${cfg.version}"; @@ -68,7 +68,8 @@ in { export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib" export ac_cv_func_getpgrp_void=yes export ac_cv_func_tzset=yes - bash ./configure \ + chmod +x ./configure + ./configure \ --build=${platform.build} \ --host=${platform.host} \ --disable-nls \ diff --git a/foundation/src/stages/stage1/gawk/default.nix b/foundation/src/stages/stage1/gawk/default.nix index 3efd0d3..457fca7 100644 --- a/foundation/src/stages/stage1/gawk/default.nix +++ b/foundation/src/stages/stage1/gawk/default.nix @@ -1,15 +1,14 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.gawk; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { - includes = [./boot.nix]; +in +{ + includes = [ ./boot.nix ]; options.aux.foundation.stages.stage1.gawk = { meta = { @@ -97,7 +96,8 @@ in { export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib" export AR="tcc -ar" export LD=tcc - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} diff --git a/foundation/src/stages/stage1/gcc/default.nix b/foundation/src/stages/stage1/gcc/default.nix index 3a25822..16752f3 100644 --- a/foundation/src/stages/stage1/gcc/default.nix +++ b/foundation/src/stages/stage1/gcc/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.gcc; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ includes = [ ./v4.6.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 LIBRARY_PATH="${stage1.musl.package}/lib" - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage1/gcc/v4.6.cxx.nix b/foundation/src/stages/stage1/gcc/v4.6.cxx.nix index bc4835b..028e44f 100644 --- a/foundation/src/stages/stage1/gcc/v4.6.cxx.nix +++ b/foundation/src/stages/stage1/gcc/v4.6.cxx.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.gcc.v46.cxx; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage1.gcc.v46.cxx = { package = lib.options.create { type = lib.types.derivation; @@ -112,12 +111,13 @@ in { }; }; - package = let - patches = [ - # Remove hardcoded NATIVE_SYSTEM_HEADER_DIR - ./patches/no-system-headers.patch - ]; - in + package = + let + patches = [ + # Remove hardcoded NATIVE_SYSTEM_HEADER_DIR + ./patches/no-system-headers.patch + ]; + in builders.bash.build { name = "gcc-cxx-${cfg.version}"; @@ -162,7 +162,8 @@ in { export CPLUS_INCLUDE_PATH="$C_INCLUDE_PATH" export LIBRARY_PATH="${stage1.musl.package}/lib" - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage1/gcc/v4.6.nix b/foundation/src/stages/stage1/gcc/v4.6.nix index c47df89..7dade6f 100644 --- a/foundation/src/stages/stage1/gcc/v4.6.nix +++ b/foundation/src/stages/stage1/gcc/v4.6.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.gcc.v46; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage1.gcc.v46 = { package = lib.options.create { type = lib.types.derivation; @@ -112,12 +111,13 @@ in { }; }; - package = let - patches = [ - # Remove hardcoded NATIVE_SYSTEM_HEADER_DIR - ./patches/no-system-headers.patch - ]; - in + package = + let + patches = [ + # Remove hardcoded NATIVE_SYSTEM_HEADER_DIR + ./patches/no-system-headers.patch + ]; + in builders.bash.build { name = "gcc-${cfg.version}"; @@ -163,7 +163,8 @@ in { export ac_cv_func_memcpy=yes export ac_cv_func_strerror=yes - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage1/gcc/v8.nix b/foundation/src/stages/stage1/gcc/v8.nix index 6188475..0479de7 100644 --- a/foundation/src/stages/stage1/gcc/v8.nix +++ b/foundation/src/stages/stage1/gcc/v8.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.gcc.v8; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage1.gcc.v8 = { package = lib.options.create { type = lib.types.derivation; @@ -168,7 +167,8 @@ in { export CPLUS_INCLUDE_PATH="$C_INCLUDE_PATH" export LIBRARY_PATH="${stage1.musl.package}/lib" - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage1/gnum4/default.nix b/foundation/src/stages/stage1/gnum4/default.nix index 341e8f6..7110754 100644 --- a/foundation/src/stages/stage1/gnum4/default.nix +++ b/foundation/src/stages/stage1/gnum4/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.gnum4; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage1.gnum4 = { meta = { description = lib.options.create { @@ -89,7 +88,8 @@ in { cd m4-${cfg.version} # Configure - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage1/gnumake/default.nix b/foundation/src/stages/stage1/gnumake/default.nix index f6bcace..51b6f8c 100644 --- a/foundation/src/stages/stage1/gnumake/default.nix +++ b/foundation/src/stages/stage1/gnumake/default.nix @@ -1,15 +1,14 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.gnumake; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { - includes = [./boot.nix]; +in +{ + includes = [ ./boot.nix ]; options.aux.foundation.stages.stage1.gnumake = { meta = { @@ -67,16 +66,17 @@ in { sha256 = "3Rb7HWe/q3mnL16DkHNcSePo5wtJRaFasfgd23hlj7M="; }; - package = let - patches = [ - # Replaces /bin/sh with sh, see patch file for reasoning - ./patches/0001-No-impure-bin-sh.patch - # Purity: don't look for library dependencies (of the form `-lfoo') in /lib - # and /usr/lib. It's a stupid feature anyway. Likewise, when searching for - # included Makefiles, don't look in /usr/include and friends. - ./patches/0002-remove-impure-dirs.patch - ]; - in + package = + let + patches = [ + # Replaces /bin/sh with sh, see patch file for reasoning + ./patches/0001-No-impure-bin-sh.patch + # Purity: don't look for library dependencies (of the form `-lfoo') in /lib + # and /usr/lib. It's a stupid feature anyway. Likewise, when searching for + # included Makefiles, don't look in /usr/include and friends. + ./patches/0002-remove-impure-dirs.patch + ]; + in builders.bash.boot.build { name = "gnumake-${cfg.version}"; @@ -104,7 +104,8 @@ in { # Configure export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib" export LD=tcc - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} diff --git a/foundation/src/stages/stage1/gnutar/boot.nix b/foundation/src/stages/stage1/gnutar/boot.nix index 178e2dc..264a8de 100644 --- a/foundation/src/stages/stage1/gnutar/boot.nix +++ b/foundation/src/stages/stage1/gnutar/boot.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.gnutar.boot; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage1.gnutar.boot = { package = lib.options.create { type = lib.types.derivation; @@ -35,8 +34,9 @@ in { sha256 = "02m6gajm647n8l9a5bnld6fnbgdpyi4i3i83p7xcwv0kif47xhy6"; }; - package = let - in + package = + let + in builders.bash.boot.build { name = "gnutar-boot-${cfg.version}"; @@ -58,7 +58,8 @@ in { # Configure export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib" - bash ./configure \ + chmod +x ./configure + ./configure \ --build=${platform.build} \ --host=${platform.host} \ --disable-nls \ diff --git a/foundation/src/stages/stage1/gnutar/default.nix b/foundation/src/stages/stage1/gnutar/default.nix index c00c516..a2e0ba2 100644 --- a/foundation/src/stages/stage1/gnutar/default.nix +++ b/foundation/src/stages/stage1/gnutar/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.gnutar; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ includes = [ ./boot.nix ./musl.nix @@ -99,7 +98,8 @@ in { cd tar-${cfg.version} # Configure - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage1/gnutar/musl.nix b/foundation/src/stages/stage1/gnutar/musl.nix index ea02d70..d40c59c 100644 --- a/foundation/src/stages/stage1/gnutar/musl.nix +++ b/foundation/src/stages/stage1/gnutar/musl.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.gnutar.musl; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage1.gnutar.musl = { package = lib.options.create { type = lib.types.derivation; @@ -60,7 +59,8 @@ in { export ac_cv_sizeof_unsigned_long=4 export ac_cv_sizeof_long_long=8 export ac_cv_header_netdb_h=no - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage1/gzip/default.nix b/foundation/src/stages/stage1/gzip/default.nix index 7195099..f7ebd85 100644 --- a/foundation/src/stages/stage1/gzip/default.nix +++ b/foundation/src/stages/stage1/gzip/default.nix @@ -1,13 +1,12 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.gzip; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage1.gzip = { meta = { description = lib.options.create { @@ -64,38 +63,37 @@ in { sha256 = "0ryr5b00qz3xcdcv03qwjdfji8pasp0007ay3ppmk71wl8c1i90w"; }; - package = let - in - builders.bash.boot.build { - name = "gzip-${cfg.version}"; - meta = cfg.meta; + package = builders.bash.boot.build { + name = "gzip-${cfg.version}"; + meta = cfg.meta; - deps.build.host = [ - stage1.tinycc.mes.compiler.package - stage1.gnumake.boot.package - stage1.gnused.boot.package - stage1.gnugrep.package - ]; + deps.build.host = [ + stage1.tinycc.mes.compiler.package + stage1.gnumake.boot.package + stage1.gnused.boot.package + stage1.gnugrep.package + ]; - script = '' - # Unpack - ungz --file ${cfg.src} --output gzip.tar - untar --file gzip.tar - rm gzip.tar - cd gzip-${cfg.version} + script = '' + # Unpack + ungz --file ${cfg.src} --output gzip.tar + untar --file gzip.tar + rm gzip.tar + cd gzip-${cfg.version} - # Configure - export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib -Dstrlwr=unused" - bash ./configure --prefix=$out + # Configure + export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib -Dstrlwr=unused" + chmod +x ./configure + ./configure --prefix=$out - # Build - make + # Build + make - # Install - mkdir $out - make install - ''; - }; + # Install + mkdir $out + make install + ''; + }; }; }; } diff --git a/foundation/src/stages/stage1/musl/boot.nix b/foundation/src/stages/stage1/musl/boot.nix index 28e751a..a846790 100644 --- a/foundation/src/stages/stage1/musl/boot.nix +++ b/foundation/src/stages/stage1/musl/boot.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.musl.boot; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage1.musl.boot = { package = lib.options.create { type = lib.types.derivation; @@ -35,52 +34,53 @@ in { sha256 = "E3DJqBKyzyp9koAlEMygBYzDfmanvt1wBR8KNAFQIqM="; }; - package = let - # 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 - liveBootstrap = "https://github.com/fosslinux/live-bootstrap/raw/d98f97e21413efc32c770d0356f1feda66025686/sysa/musl-1.1.24"; - patches = [ - (builtins.fetchurl { - url = "${liveBootstrap}/patches/avoid_set_thread_area.patch"; - sha256 = "TsbBZXk4/KMZG9EKi7cF+sullVXrxlizLNH0UHGXsPs="; - }) - (builtins.fetchurl { - url = "${liveBootstrap}/patches/avoid_sys_clone.patch"; - sha256 = "/ZmH64J57MmbxdfQ4RNjamAiBdkImMTlHsHdgV4gMj4="; - }) - (builtins.fetchurl { - url = "${liveBootstrap}/patches/fenv.patch"; - sha256 = "vMVGjoN4deAJW5gsSqA207SJqAbvhrnOsGK49DdEiTI="; - }) - (builtins.fetchurl { - url = "${liveBootstrap}/patches/makefile.patch"; - sha256 = "03iYBAUnsrEdLIIhhhq5mM6BGnPn2EfUmIHu51opxbw="; - }) - (builtins.fetchurl { - url = "${liveBootstrap}/patches/musl_weak_symbols.patch"; - sha256 = "/d9a2eUkpe9uyi1ye6T4CiYc9MR3FZ9na0Gb90+g4v0="; - }) - (builtins.fetchurl { - url = "${liveBootstrap}/patches/set_thread_area.patch"; - sha256 = "RIZYqbbRSx4X/0iFUhriwwBRmoXVR295GNBUjf2UrM0="; - }) - (builtins.fetchurl { - url = "${liveBootstrap}/patches/sigsetjmp.patch"; - sha256 = "wd2Aev1zPJXy3q933aiup5p1IMKzVJBquAyl3gbK4PU="; - }) - # FIXME: this patch causes the build to fail - # (builtins.fetchurl { - # url = "${liveBootstrap}/patches/stdio_flush_on_exit.patch"; - # sha256 = "/z5ze3h3QTysay8nRvyvwPv3pmTcKptdkBIaMCoeLDg="; - # }) - # HACK: always flush stdio immediately - ./patches/always-flush.patch - (builtins.fetchurl { - url = "${liveBootstrap}/patches/va_list.patch"; - sha256 = "UmcMIl+YCi3wIeVvjbsCyqFlkyYsM4ECNwTfXP+s7vg="; - }) - ]; - in + package = + let + # 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 + liveBootstrap = "https://github.com/fosslinux/live-bootstrap/raw/d98f97e21413efc32c770d0356f1feda66025686/sysa/musl-1.1.24"; + patches = [ + (builtins.fetchurl { + url = "${liveBootstrap}/patches/avoid_set_thread_area.patch"; + sha256 = "TsbBZXk4/KMZG9EKi7cF+sullVXrxlizLNH0UHGXsPs="; + }) + (builtins.fetchurl { + url = "${liveBootstrap}/patches/avoid_sys_clone.patch"; + sha256 = "/ZmH64J57MmbxdfQ4RNjamAiBdkImMTlHsHdgV4gMj4="; + }) + (builtins.fetchurl { + url = "${liveBootstrap}/patches/fenv.patch"; + sha256 = "vMVGjoN4deAJW5gsSqA207SJqAbvhrnOsGK49DdEiTI="; + }) + (builtins.fetchurl { + url = "${liveBootstrap}/patches/makefile.patch"; + sha256 = "03iYBAUnsrEdLIIhhhq5mM6BGnPn2EfUmIHu51opxbw="; + }) + (builtins.fetchurl { + url = "${liveBootstrap}/patches/musl_weak_symbols.patch"; + sha256 = "/d9a2eUkpe9uyi1ye6T4CiYc9MR3FZ9na0Gb90+g4v0="; + }) + (builtins.fetchurl { + url = "${liveBootstrap}/patches/set_thread_area.patch"; + sha256 = "RIZYqbbRSx4X/0iFUhriwwBRmoXVR295GNBUjf2UrM0="; + }) + (builtins.fetchurl { + url = "${liveBootstrap}/patches/sigsetjmp.patch"; + sha256 = "wd2Aev1zPJXy3q933aiup5p1IMKzVJBquAyl3gbK4PU="; + }) + # FIXME: this patch causes the build to fail + # (builtins.fetchurl { + # url = "${liveBootstrap}/patches/stdio_flush_on_exit.patch"; + # sha256 = "/z5ze3h3QTysay8nRvyvwPv3pmTcKptdkBIaMCoeLDg="; + # }) + # HACK: always flush stdio immediately + ./patches/always-flush.patch + (builtins.fetchurl { + url = "${liveBootstrap}/patches/va_list.patch"; + sha256 = "UmcMIl+YCi3wIeVvjbsCyqFlkyYsM4ECNwTfXP+s7vg="; + }) + ]; + in builders.bash.boot.build { name = "musl-boot-${cfg.version}"; @@ -118,7 +118,8 @@ in { src/misc/wordexp.c # Configure - bash ./configure \ + chmod +x configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage1/musl/default.nix b/foundation/src/stages/stage1/musl/default.nix index 9f0f08b..ea3cd1c 100644 --- a/foundation/src/stages/stage1/musl/default.nix +++ b/foundation/src/stages/stage1/musl/default.nix @@ -1,15 +1,14 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.musl; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { - includes = [./boot.nix]; +in +{ + includes = [ ./boot.nix ]; options.aux.foundation.stages.stage1.musl = { meta = { @@ -99,7 +98,8 @@ in { src/misc/wordexp.c # Configure - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage1/python/default.nix b/foundation/src/stages/stage1/python/default.nix index 49083fd..55d4d64 100644 --- a/foundation/src/stages/stage1/python/default.nix +++ b/foundation/src/stages/stage1/python/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.python; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage1.python = { meta = { description = lib.options.create { @@ -65,16 +64,17 @@ in { sha256 = "eVw09E30Wg6blxDIxxwVxnGHFSTNQSyhTe8hLozLFV0="; }; - package = let - patches = [ - # Disable the use of ldconfig in ctypes.util.find_library (since - # ldconfig doesn't work on NixOS), and don't use - # ctypes.util.find_library during the loading of the uuid module - # (since it will do a futile invocation of gcc (!) to find - # libuuid, slowing down program startup a lot). - ./patches/no-ldconfig.patch - ]; - in + package = + let + patches = [ + # Disable the use of ldconfig in ctypes.util.find_library (since + # ldconfig doesn't work on NixOS), and don't use + # ctypes.util.find_library during the loading of the uuid module + # (since it will do a futile invocation of gcc (!) to find + # libuuid, slowing down program startup a lot). + ./patches/no-ldconfig.patch + ]; + in builders.bash.build { name = "python-${cfg.version}"; meta = cfg.meta; @@ -107,7 +107,8 @@ in { export C_INCLUDE_PATH="${stage1.zlib.package}/include" export LIBRARY_PATH="${stage1.zlib.package}/lib" export LD_LIBRARY_PATH="$LIBRARY_PATH" - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} diff --git a/foundation/src/stages/stage1/xz/default.nix b/foundation/src/stages/stage1/xz/default.nix index cf64b28..0d828df 100644 --- a/foundation/src/stages/stage1/xz/default.nix +++ b/foundation/src/stages/stage1/xz/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.xz; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage1.xz = { meta = { description = lib.options.create { @@ -92,7 +91,8 @@ in { export CC="tcc -B ${stage1.tinycc.musl.libs.package}/lib" export AR="tcc -ar" export LD=tcc - bash ./configure \ + chmod +x configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage1/zlib/default.nix b/foundation/src/stages/stage1/zlib/default.nix index b413d56..5b21e84 100644 --- a/foundation/src/stages/stage1/zlib/default.nix +++ b/foundation/src/stages/stage1/zlib/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage1.zlib; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage1.zlib = { meta = { description = lib.options.create { @@ -87,7 +86,8 @@ in { # Configure export CC=musl-gcc - bash ./configure --prefix=$out + chmod +x configure + ./configure --prefix=$out # Build make -j $NIX_BUILD_CORES diff --git a/foundation/src/stages/stage2/bash/default.nix b/foundation/src/stages/stage2/bash/default.nix index f88244a..0471231 100644 --- a/foundation/src/stages/stage2/bash/default.nix +++ b/foundation/src/stages/stage2/bash/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage2.bash; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage2.bash = { meta = { description = lib.options.create { @@ -98,7 +97,8 @@ in { cd bash-${cfg.version} # Configure - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage2/binutils/default.nix b/foundation/src/stages/stage2/binutils/default.nix index 6a06ddd..f8915d0 100644 --- a/foundation/src/stages/stage2/binutils/default.nix +++ b/foundation/src/stages/stage2/binutils/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage2.binutils; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage2.binutils = { meta = { description = lib.options.create { @@ -65,35 +64,36 @@ in { sha256 = "rppXieI0WeWWBuZxRyPy0//DHAMXQZHvDQFb3wYAdFA="; }; - package = let - patches = [ - # Make binutils output deterministic by default. - ./patches/deterministic.patch - ]; + package = + let + patches = [ + # Make binutils output deterministic by default. + ./patches/deterministic.patch + ]; - configureFlags = [ - "CC=musl-gcc" - "LDFLAGS=--static" - "--prefix=${builtins.placeholder "out"}" - "--build=${platform.build}" - "--host=${platform.host}" + configureFlags = [ + "CC=musl-gcc" + "LDFLAGS=--static" + "--prefix=${builtins.placeholder "out"}" + "--build=${platform.build}" + "--host=${platform.host}" - "--with-sysroot=/" - "--enable-deterministic-archives" - # depends on bison - "--disable-gprofng" + "--with-sysroot=/" + "--enable-deterministic-archives" + # depends on bison + "--disable-gprofng" - # Turn on --enable-new-dtags by default to make the linker set - # RUNPATH instead of RPATH on binaries. This is important because - # RUNPATH can be overridden using LD_LIBRARY_PATH at runtime. - "--enable-new-dtags" + # Turn on --enable-new-dtags by default to make the linker set + # RUNPATH instead of RPATH on binaries. This is important because + # RUNPATH can be overridden using LD_LIBRARY_PATH at runtime. + "--enable-new-dtags" - # By default binutils searches $libdir for libraries. This brings in - # libbfd and libopcodes into a default visibility. Drop default lib - # path to force users to declare their use of these libraries. - "--with-lib-path=:" - ]; - in + # By default binutils searches $libdir for libraries. This brings in + # libbfd and libopcodes into a default visibility. Drop default lib + # path to force users to declare their use of these libraries. + "--with-lib-path=:" + ]; + in builders.bash.build { name = "binutils-static-${cfg.version}"; @@ -123,7 +123,8 @@ in { ${lib.strings.concatMapSep "\n" (file: "patch -Np1 -i ${file}") patches} # Configure - bash ./configure ${builtins.concatStringsSep " " configureFlags} + chmod +x ./configure + ./configure ${builtins.concatStringsSep " " configureFlags} # Build make -j $NIX_BUILD_CORES diff --git a/foundation/src/stages/stage2/coreutils/default.nix b/foundation/src/stages/stage2/coreutils/default.nix index d2d51df..5e8e7b7 100644 --- a/foundation/src/stages/stage2/coreutils/default.nix +++ b/foundation/src/stages/stage2/coreutils/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage2.coreutils; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage2.coreutils = { meta = { description = lib.options.create { @@ -65,18 +64,19 @@ in { sha256 = "X2ANkJOXOwr+JTk9m8GMRPIjJlf0yg2V6jHHAutmtzk="; }; - package = let - configureFlags = [ - "--prefix=${builtins.placeholder "out"}" - "--build=${platform.build}" - "--host=${platform.host}" - # libstdbuf.so fails in static builds - "--enable-no-install-program=stdbuf" - "--enable-single-binary=symlinks" - "CC=musl-gcc" - "CFLAGS=-static" - ]; - in + package = + let + configureFlags = [ + "--prefix=${builtins.placeholder "out"}" + "--build=${platform.build}" + "--host=${platform.host}" + # libstdbuf.so fails in static builds + "--enable-no-install-program=stdbuf" + "--enable-single-binary=symlinks" + "CC=musl-gcc" + "CFLAGS=-static" + ]; + in builders.bash.build { name = "coreutils-${cfg.version}"; @@ -102,7 +102,8 @@ in { cd coreutils-${cfg.version} # Configure - bash ./configure ${builtins.concatStringsSep " " configureFlags} + chmod +x ./configure + ./configure ${builtins.concatStringsSep " " configureFlags} # Build make -j $NIX_BUILD_CORES diff --git a/foundation/src/stages/stage2/diffutils/default.nix b/foundation/src/stages/stage2/diffutils/default.nix index eec8333..cfbb377 100644 --- a/foundation/src/stages/stage2/diffutils/default.nix +++ b/foundation/src/stages/stage2/diffutils/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage2.diffutils; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage2.diffutils = { meta = { description = lib.options.create { @@ -90,7 +89,8 @@ in { cd diffutils-${cfg.version} # Configure - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage2/findutils/default.nix b/foundation/src/stages/stage2/findutils/default.nix index b352430..9466398 100644 --- a/foundation/src/stages/stage2/findutils/default.nix +++ b/foundation/src/stages/stage2/findutils/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage2.findutils; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage2.findutils = { meta = { description = lib.options.create { @@ -90,7 +89,8 @@ in { cd findutils-${cfg.version} # Configure - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage2/gawk/default.nix b/foundation/src/stages/stage2/gawk/default.nix index 081e913..fe56028 100644 --- a/foundation/src/stages/stage2/gawk/default.nix +++ b/foundation/src/stages/stage2/gawk/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage2.gawk; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage2.gawk = { meta = { description = lib.options.create { @@ -96,7 +95,8 @@ in { cd gawk-${cfg.version} # Configure - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage2/gcc/default.nix b/foundation/src/stages/stage2/gcc/default.nix index 4d54ba9..7a0a10e 100644 --- a/foundation/src/stages/stage2/gcc/default.nix +++ b/foundation/src/stages/stage2/gcc/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage2.gcc; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage2.gcc = { meta = { description = lib.options.create { @@ -195,7 +194,8 @@ in { export CFLAGS_FOR_TARGET="-Wl,-dynamic-linker -Wl,${stage1.musl.package}/lib/libc.so" export LIBRARY_PATH="${stage1.musl.package}/lib" - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage2/glibc/default.nix b/foundation/src/stages/stage2/glibc/default.nix index 603fb8c..0f4bd57 100644 --- a/foundation/src/stages/stage2/glibc/default.nix +++ b/foundation/src/stages/stage2/glibc/default.nix @@ -1,7 +1,5 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage2.glibc; platform = config.aux.platform; @@ -9,7 +7,8 @@ stage1 = config.aux.foundation.stages.stage1; stage2 = config.aux.foundation.stages.stage2; -in { +in +{ options.aux.foundation.stages.stage2.glibc = { meta = { description = lib.options.create { @@ -95,7 +94,8 @@ in { cd build # libstdc++.so is built against musl and fails to link export CXX=false - bash ../configure \ + chmod +x ../configure + ../configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage2/gnugrep/default.nix b/foundation/src/stages/stage2/gnugrep/default.nix index 73fddab..d80d57f 100644 --- a/foundation/src/stages/stage2/gnugrep/default.nix +++ b/foundation/src/stages/stage2/gnugrep/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage2.gnugrep; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage2.gnugrep = { meta = { description = lib.options.create { @@ -95,7 +94,8 @@ in { cd grep-${cfg.version} # Configure - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage2/gnumake/default.nix b/foundation/src/stages/stage2/gnumake/default.nix index 51a1cd7..a265bb4 100644 --- a/foundation/src/stages/stage2/gnumake/default.nix +++ b/foundation/src/stages/stage2/gnumake/default.nix @@ -1,7 +1,5 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage2.gnumake; platform = config.aux.platform; @@ -9,7 +7,8 @@ stage1 = config.aux.foundation.stages.stage1; stage2 = config.aux.foundation.stages.stage2; -in { +in +{ options.aux.foundation.stages.stage2.gnumake = { meta = { description = lib.options.create { @@ -66,16 +65,17 @@ in { sha256 = "3Rb7HWe/q3mnL16DkHNcSePo5wtJRaFasfgd23hlj7M="; }; - package = let - patches = [ - # Replaces /bin/sh with sh, see patch file for reasoning - ./patches/0001-No-impure-bin-sh.patch - # Purity: don't look for library dependencies (of the form `-lfoo') in /lib - # and /usr/lib. It's a stupid feature anyway. Likewise, when searching for - # included Makefiles, don't look in /usr/include and friends. - ./patches/0002-remove-impure-dirs.patch - ]; - in + package = + let + patches = [ + # Replaces /bin/sh with sh, see patch file for reasoning + ./patches/0001-No-impure-bin-sh.patch + # Purity: don't look for library dependencies (of the form `-lfoo') in /lib + # and /usr/lib. It's a stupid feature anyway. Likewise, when searching for + # included Makefiles, don't look in /usr/include and friends. + ./patches/0002-remove-impure-dirs.patch + ]; + in builders.bash.boot.build { name = "gnumake-static-${cfg.version}"; @@ -105,7 +105,8 @@ in { ${lib.strings.concatMapSep "\n" (file: "patch -Np1 -i ${file}") patches} # Configure - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage2/gnupatch/default.nix b/foundation/src/stages/stage2/gnupatch/default.nix index 3bc83aa..a543a8f 100644 --- a/foundation/src/stages/stage2/gnupatch/default.nix +++ b/foundation/src/stages/stage2/gnupatch/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage2.gnupatch; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage2.gnupatch = { meta = { description = lib.options.create { @@ -91,7 +90,8 @@ in { cd patch-${cfg.version} # Configure - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage2/gnused/default.nix b/foundation/src/stages/stage2/gnused/default.nix index e3a249e..280c38f 100644 --- a/foundation/src/stages/stage2/gnused/default.nix +++ b/foundation/src/stages/stage2/gnused/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage2.gnused; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage2.gnused = { meta = { description = lib.options.create { @@ -97,7 +96,8 @@ in { cd sed-${cfg.version} # Configure - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage2/gnutar/default.nix b/foundation/src/stages/stage2/gnutar/default.nix index c31634c..e49eb0a 100644 --- a/foundation/src/stages/stage2/gnutar/default.nix +++ b/foundation/src/stages/stage2/gnutar/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage2.gnutar; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage2.gnutar = { meta = { description = lib.options.create { @@ -96,7 +95,8 @@ in { cd tar-${cfg.version} # Configure - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage2/gzip/default.nix b/foundation/src/stages/stage2/gzip/default.nix index 7a0567c..eb88ed0 100644 --- a/foundation/src/stages/stage2/gzip/default.nix +++ b/foundation/src/stages/stage2/gzip/default.nix @@ -1,14 +1,13 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage2.gzip; platform = config.aux.platform; builders = config.aux.foundation.builders; stage1 = config.aux.foundation.stages.stage1; -in { +in +{ options.aux.foundation.stages.stage2.gzip = { meta = { description = lib.options.create { @@ -89,7 +88,8 @@ in { cd gzip-${cfg.version} # Configure - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \ diff --git a/foundation/src/stages/stage2/patchelf/default.nix b/foundation/src/stages/stage2/patchelf/default.nix index c19e373..df4d490 100644 --- a/foundation/src/stages/stage2/patchelf/default.nix +++ b/foundation/src/stages/stage2/patchelf/default.nix @@ -1,7 +1,5 @@ -{ - lib, - config, -}: let +{ lib, config }: +let cfg = config.aux.foundation.stages.stage2.patchelf; platform = config.aux.platform; @@ -9,7 +7,8 @@ stage1 = config.aux.foundation.stages.stage1; stage2 = config.aux.foundation.stages.stage2; -in { +in +{ options.aux.foundation.stages.stage2.patchelf = { meta = { description = lib.options.create { @@ -90,7 +89,8 @@ in { cd patchelf-${cfg.version} # Configure - bash ./configure \ + chmod +x ./configure + ./configure \ --prefix=$out \ --build=${platform.build} \ --host=${platform.host} \