mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 21:10:08 +00:00
stdenv: move NIX_CFLAGS_LINK into env by default for makeStaticBinaries (#498046)
This commit is contained in:
@@ -92,16 +92,22 @@ rec {
|
||||
(mkDerivationSuper args).overrideAttrs (
|
||||
args:
|
||||
(
|
||||
if (args.__structuredAttrs or false) || (args ? env.NIX_CFLAGS_LINK) then
|
||||
if (args ? NIX_CFLAGS_LINK) then
|
||||
lib.warn
|
||||
(
|
||||
"NIX_CFLAGS_LINK is an environment variable and should be defined inside `env`"
|
||||
+ lib.optionalString (args ? pname) " for package ${args.pname}"
|
||||
+ lib.optionalString (args ? version) "-${args.version}"
|
||||
)
|
||||
{
|
||||
NIX_CFLAGS_LINK = toString (args.NIX_CFLAGS_LINK or "") + " -static";
|
||||
}
|
||||
else
|
||||
{
|
||||
env = (args.env or { }) // {
|
||||
NIX_CFLAGS_LINK = toString (args.env.NIX_CFLAGS_LINK or "") + " -static";
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
NIX_CFLAGS_LINK = toString (args.NIX_CFLAGS_LINK or "") + " -static";
|
||||
}
|
||||
)
|
||||
// lib.optionalAttrs (!(args.dontAddStaticConfigureFlags or false)) {
|
||||
configureFlags = (args.configureFlags or [ ]) ++ [
|
||||
|
||||
Reference in New Issue
Block a user