Merge pull request #241025 from uri-canva/fix-native

stdenv: fix stagesNative
This commit is contained in:
Uri Baghin 2023-07-17 13:18:40 +10:00 committed by GitHub
commit 0275cf0e6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -195,9 +195,11 @@ stdenv.mkDerivation (rec {
substituteInPlace "$out"/lib/perl5/*/*/Config_heavy.pl \
--replace "${libcInc}" /no-such-path \
--replace "${
if stdenv.hasCC then stdenv.cc.cc else "/no-such-path"
if stdenv.hasCC then stdenv.cc else "/no-such-path"
}" /no-such-path \
--replace "${stdenv.cc}" /no-such-path \
--replace "${
if stdenv.hasCC && stdenv.cc.cc != null then stdenv.cc.cc else "/no-such-path"
}" /no-such-path \
--replace "$man" /no-such-path
'' + lib.optionalString crossCompiling
''

View File

@ -152,7 +152,10 @@ in
inherit config overlays;
stdenv = makeStdenv {
inherit (prevStage) cc fetchurl;
} // { inherit (prevStage) fetchurl; };
overrides = prev: final: { inherit (prevStage) fetchurl; };
} // {
inherit (prevStage) fetchurl;
};
})
# Using that, build a stdenv that adds the xz command (which most systems
@ -162,7 +165,7 @@ in
stdenv = makeStdenv {
inherit (prevStage.stdenv) cc fetchurl;
extraPath = [ prevStage.xz ];
overrides = self: super: { inherit (prevStage) xz; };
overrides = self: super: { inherit (prevStage) fetchurl xz; };
extraNativeBuildInputs = if localSystem.isLinux then [ prevStage.patchelf ] else [];
};
})