stdenv/adapters.nix: fixup makeStaticBinaries

- makeStaticBinaries don’t work on Darwin (no stable ABI!)
- Need to make sure NIX_CFLAGS_LINK appends
- isStatic is not used anymore

(cherry picked from commit 8726f6a558)
This commit is contained in:
Matthew Bauer
2018-12-13 14:04:33 -05:00
committed by John Ericson
parent e84255296f
commit 7fcbc52d7d
+5 -3
View File
@@ -32,13 +32,15 @@ rec {
# Return a modified stdenv that tries to build statically linked # Return a modified stdenv that tries to build statically linked
# binaries. # binaries.
makeStaticBinaries = stdenv: stdenv // makeStaticBinaries = stdenv: stdenv //
{ mkDerivation = args: stdenv.mkDerivation (args // { { mkDerivation = args:
NIX_CFLAGS_LINK = "-static"; if stdenv.hostPlatform.isDarwin
then throw "Cannot build fully static binaries on Darwin/macOS"
else stdenv.mkDerivation (args // {
NIX_CFLAGS_LINK = toString (args.NIX_CFLAGS_LINK or "") + "-static";
configureFlags = (args.configureFlags or []) ++ [ configureFlags = (args.configureFlags or []) ++ [
"--disable-shared" # brrr... "--disable-shared" # brrr...
]; ];
}); });
isStatic = true;
}; };