3
0
Fork 0
forked from mirrors/nixpkgs

stdenvAdapters: fix preservation of env

This commit is contained in:
Artturin 2023-04-11 21:25:52 +03:00
parent 49f40c090c
commit 9adf83737f

View file

@ -176,7 +176,7 @@ rec {
stdenv.override (old: {
mkDerivationFromStdenv = extendMkDerivationArgs old (args: {
dontStrip = true;
env.NIX_CFLAGS_COMPILE = toString (args.NIX_CFLAGS_COMPILE or "") + " -ggdb -Og";
env = (args.env or {}) // { NIX_CFLAGS_COMPILE = toString (args.NIX_CFLAGS_COMPILE or "") + " -ggdb -Og"; };
});
});
@ -219,7 +219,8 @@ rec {
impureUseNativeOptimizations = stdenv:
stdenv.override (old: {
mkDerivationFromStdenv = extendMkDerivationArgs old (args: {
env.NIX_CFLAGS_COMPILE = toString (args.NIX_CFLAGS_COMPILE or "") + " -march=native";
env = (args.env or {}) // { NIX_CFLAGS_COMPILE = toString (args.NIX_CFLAGS_COMPILE or "") + " -march=native"; };
NIX_ENFORCE_NO_NATIVE = false;
preferLocalBuild = true;
@ -244,7 +245,7 @@ rec {
withCFlags = compilerFlags: stdenv:
stdenv.override (old: {
mkDerivationFromStdenv = extendMkDerivationArgs old (args: {
env.NIX_CFLAGS_COMPILE = toString (args.NIX_CFLAGS_COMPILE or "") + " ${toString compilerFlags}";
env = (args.env or {}) // { NIX_CFLAGS_COMPILE = toString (args.NIX_CFLAGS_COMPILE or "") + " ${toString compilerFlags}"; };
});
});
}