gnu-config: enable strictDeps

it would be as simple as setting `strictDeps = true` and
`buildInputs = [ bashNonInteractive ]` except this package is used
during the bootstrap of `stdenv`: this method of manually patching
seems to be the least complex way to get correct behavior while
avoiding cyclic when deriving `stdenv` itself.

successfully built the following, from x86_64-linux:
- `gnu-config`
- `pkgsCross.aarch64-multiplatform.buildPackages.gnu-config` (equivalent)
- `pkgsCross.aarch64-multiplatform.gnu-config`
- `pkgsCross.musl32.gnu-config`
- `pkgsMusl.gnu-config`
- `pkgsStatic.gnu-config`
- `pkgsi686Linux.gnu-config`

successfully eval'd `gnu-config` for the following systems:
- `aarch64-darwin`
- `aarch64-freebsd`
- `aarch64-linux-musl`
- `aarch64-linux`
- `x86_64-cygwin`
- `x86_64-darwin`
- `x86_64-freebsd`
- `x86_64-linux-musl`
- `x86_64-linux`
This commit is contained in:
Colin
2026-01-25 06:25:12 +00:00
parent c2f6f942c4
commit 44b893a9f0
4 changed files with 19 additions and 3 deletions
+14
View File
@@ -2,6 +2,7 @@
lib,
stdenv,
fetchurl,
runtimeShell,
}:
# Note: this package is used for bootstrapping fetchurl, and thus
@@ -53,6 +54,19 @@ stdenv.mkDerivation {
runHook postInstall
'';
fixupPhase = ''
runHook preFixup
if [[ -z "''${dontPatchShebangs-}" ]]; then
substituteInPlace $out/config.guess \
--replace-fail '#! /bin/sh' '#!${runtimeShell}'
substituteInPlace $out/config.sub \
--replace-fail '#! /bin/sh' '#!${runtimeShell}'
fi
runHook postFixup
'';
strictDeps = true;
meta = {
description = "Attempt to guess a canonical system name";
homepage = "https://savannah.gnu.org/projects/config";
+1 -1
View File
@@ -1069,7 +1069,7 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check
)
++ lib.optionals localSystem.isAarch64 [
prevStage.updateAutotoolsGnuConfigScriptsHook
prevStage.gnu-config
prevStage.updateAutotoolsGnuConfigScriptsHook.gnu_config
]
++ lib.optionals localSystem.isx86_64 [ prevStage.darwin.Csu ]
++ (with prevStage.darwin; [
+1 -1
View File
@@ -875,7 +875,7 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check
++ lib.optionals (localSystem.libc == "musl") [ fortify-headers ]
++ [
prevStage.updateAutotoolsGnuConfigScriptsHook
prevStage.gnu-config
prevStage.updateAutotoolsGnuConfigScriptsHook.gnu_config
]
++ [
gcc-unwrapped.gmp
+3 -1
View File
@@ -287,7 +287,9 @@ with pkgs;
updateAutotoolsGnuConfigScriptsHook = makeSetupHook {
name = "update-autotools-gnu-config-scripts-hook";
substitutions = {
gnu_config = gnu-config;
gnu_config = gnu-config.override {
runtimeShell = targetPackages.stdenv.shell;
};
};
} ../build-support/setup-hooks/update-autotools-gnu-config-scripts.sh;