From 63a8461b203c8d3b567eec1c858ece3d82dc9142 Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Sat, 25 May 2024 16:35:53 -0700 Subject: [PATCH 1/4] ed: Add runtimeShell to buildInputs This package distributes shell scripts in /bin. Its shebangs are always patched to a /nix/store shell, but by default, they are patched to use the stdenv's shell, which during bootstrap is build in the previous stdenv. By using runtimeShell from the current stdenv, we can shorten the FreeBSD bootstrap process significantly. --- pkgs/applications/editors/ed/generic.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/editors/ed/generic.nix b/pkgs/applications/editors/ed/generic.nix index 70ec6badf25ec..70ffdb4c4af93 100644 --- a/pkgs/applications/editors/ed/generic.nix +++ b/pkgs/applications/editors/ed/generic.nix @@ -13,12 +13,14 @@ , stdenv , fetchurl , lzip +, runtimeShellPackage }: stdenv.mkDerivation { inherit pname version src patches; nativeBuildInputs = [ lzip ]; + buildInputs = [ runtimeShellPackage ]; configureFlags = [ "CC=${stdenv.cc.targetPrefix}cc" From be0a824971392d38ceba9f871f4922f04e8e332f Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Sat, 25 May 2024 16:36:49 -0700 Subject: [PATCH 2/4] gzip: Add runtimeShell to buildInputs This package distributes shell scripts in /bin. Its shebangs are always patched to a /nix/store shell, but by default, they are patched to use the stdenv's shell, which during bootstrap is build in the previous stdenv. By using runtimeShell from the current stdenv, we can shorten the FreeBSD bootstrap process significantly. --- pkgs/tools/compression/gzip/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/tools/compression/gzip/default.nix b/pkgs/tools/compression/gzip/default.nix index baff7f0303874..56803742d605e 100644 --- a/pkgs/tools/compression/gzip/default.nix +++ b/pkgs/tools/compression/gzip/default.nix @@ -2,6 +2,7 @@ , fetchurl , makeWrapper , xz +, runtimeShellPackage }: # Note: this package is used for bootstrapping fetchurl, and thus @@ -22,6 +23,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + buildInputs = [ runtimeShellPackage]; nativeBuildInputs = [ xz.bin makeWrapper ]; makeFlags = [ From fa8c2ac3be0df58c8787004e69f284916ec089ab Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Sat, 25 May 2024 16:37:01 -0700 Subject: [PATCH 3/4] gawk: Add runtimeShell to buildInputs This package distributes shell scripts in /bin. Its shebangs are always patched to a /nix/store shell, but by default, they are patched to use the stdenv's shell, which during bootstrap is build in the previous stdenv. By using runtimeShell from the current stdenv, we can shorten the FreeBSD bootstrap process significantly. --- pkgs/tools/text/gawk/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/text/gawk/default.nix b/pkgs/tools/text/gawk/default.nix index d85880e82e155..8857fa29d1c63 100644 --- a/pkgs/tools/text/gawk/default.nix +++ b/pkgs/tools/text/gawk/default.nix @@ -1,4 +1,5 @@ { lib, stdenv, fetchurl +, runtimeShellPackage # TODO: links -lsigsegv but loses the reference for some reason , withSigsegv ? (false && stdenv.hostPlatform.system != "x86_64-cygwin"), libsigsegv , interactive ? false, readline @@ -39,7 +40,9 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ] ++ lib.optional (doCheck && stdenv.isLinux) glibcLocales; - buildInputs = lib.optional withSigsegv libsigsegv + buildInputs = [ + runtimeShellPackage + ] ++ lib.optional withSigsegv libsigsegv ++ lib.optional interactive readline ++ lib.optional stdenv.isDarwin locale; From 125d947ed51cad2e9fdb30fdd89e573619ebfb1f Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Sat, 25 May 2024 16:37:47 -0700 Subject: [PATCH 4/4] gnugrep: Add runtimeShell to buildInputs This package distributes shell scripts in /bin. Its shebangs are always patched to a /nix/store shell, but by default, they are patched to use the stdenv's shell, which during bootstrap is build in the previous stdenv. By using runtimeShell from the current stdenv, we can shorten the FreeBSD bootstrap process significantly. --- pkgs/tools/text/gnugrep/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/text/gnugrep/default.nix b/pkgs/tools/text/gnugrep/default.nix index 5df81274c6a5d..55e0a97f35945 100644 --- a/pkgs/tools/text/gnugrep/default.nix +++ b/pkgs/tools/text/gnugrep/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, glibcLocales, fetchurl, pcre2, libiconv, perl }: +{ lib, stdenv, glibcLocales, fetchurl, pcre2, libiconv, perl, runtimeShellPackage }: # Note: this package is used for bootstrapping fetchurl, and thus # cannot use fetchpatch! All mutable patches (generated by GitHub or @@ -26,7 +26,7 @@ stdenv.mkDerivation { nativeCheckInputs = [ perl glibcLocales ]; outputs = [ "out" "info" ]; # the man pages are rather small - buildInputs = [ pcre2 libiconv ]; + buildInputs = [ pcre2 libiconv runtimeShellPackage ]; # cygwin: FAIL: multibyte-white-space # freebsd: FAIL mb-non-UTF8-performance