mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-12 00:07:17 +00:00
Merge pull request #106115 from matthewbauer/static-nix-darwin
Improve static Nix Darwin support
This commit is contained in:
commit
1fb6bb9791
@ -34,14 +34,18 @@ self: super: let
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
staticAdapters = [ makeStaticLibraries propagateBuildInputs ]
|
staticAdapters =
|
||||||
|
# makeStaticDarwin must go first so that the extraBuildInputs
|
||||||
|
# override does not recreate mkDerivation, removing subsequent
|
||||||
|
# adapters.
|
||||||
|
optional super.stdenv.hostPlatform.isDarwin makeStaticDarwin
|
||||||
|
|
||||||
|
++ [ makeStaticLibraries propagateBuildInputs ]
|
||||||
|
|
||||||
# Apple does not provide a static version of libSystem or crt0.o
|
# Apple does not provide a static version of libSystem or crt0.o
|
||||||
# So we can’t build static binaries without extensive hacks.
|
# So we can’t build static binaries without extensive hacks.
|
||||||
++ optional (!super.stdenv.hostPlatform.isDarwin) makeStaticBinaries
|
++ optional (!super.stdenv.hostPlatform.isDarwin) makeStaticBinaries
|
||||||
|
|
||||||
++ optional super.stdenv.hostPlatform.isDarwin makeStaticDarwin
|
|
||||||
|
|
||||||
# Glibc doesn’t come with static runtimes by default.
|
# Glibc doesn’t come with static runtimes by default.
|
||||||
# ++ optional (super.stdenv.hostPlatform.libc == "glibc") ((flip overrideInStdenv) [ self.stdenv.glibc.static ])
|
# ++ optional (super.stdenv.hostPlatform.libc == "glibc") ((flip overrideInStdenv) [ self.stdenv.glibc.static ])
|
||||||
;
|
;
|
||||||
@ -163,6 +167,7 @@ in {
|
|||||||
};
|
};
|
||||||
mkl = super.mkl.override { enableStatic = true; };
|
mkl = super.mkl.override { enableStatic = true; };
|
||||||
nix = super.nix.override { enableStatic = true; };
|
nix = super.nix.override { enableStatic = true; };
|
||||||
|
nixUnstable = super.nixUnstable.override { enableStatic = true; };
|
||||||
openssl = (super.openssl_1_1.override { static = true; }).overrideAttrs (o: {
|
openssl = (super.openssl_1_1.override { static = true; }).overrideAttrs (o: {
|
||||||
# OpenSSL doesn't like the `--enable-static` / `--disable-shared` flags.
|
# OpenSSL doesn't like the `--enable-static` / `--disable-shared` flags.
|
||||||
configureFlags = (removeUnknownConfigureFlags o.configureFlags);
|
configureFlags = (removeUnknownConfigureFlags o.configureFlags);
|
||||||
@ -281,8 +286,8 @@ in {
|
|||||||
python39 = super.python39.override { static = true; };
|
python39 = super.python39.override { static = true; };
|
||||||
python3Minimal = super.python3Minimal.override { static = true; };
|
python3Minimal = super.python3Minimal.override { static = true; };
|
||||||
|
|
||||||
|
# Note: -static doesn’t work on darwin
|
||||||
libev = super.libev.override { static = true; };
|
libev = super.libev.override { static = !super.stdenv.hostPlatform.isDarwin; };
|
||||||
|
|
||||||
libexecinfo = super.libexecinfo.override { enableShared = false; };
|
libexecinfo = super.libexecinfo.override { enableShared = false; };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user