mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-19 18:44:13 +00:00
makeStaticDarwin: drop darwin-portable-libSystem-hook
`${stdenv.cc.libc}/lib/libSystem.B.dylib` does not exist and not existed for as long as I have used nixpkgs. Since `/usr/lib/libSystem.B.dylib` is already linked via text-based stubs, continue relying on those.
This commit is contained in:
parent
8a0d884405
commit
66fcbb94e7
@ -141,16 +141,7 @@ rec {
|
||||
(mkDerivationSuper args).overrideAttrs (prevAttrs: {
|
||||
NIX_CFLAGS_LINK = toString (prevAttrs.NIX_CFLAGS_LINK or "")
|
||||
+ lib.optionalString (stdenv.cc.isGNU or false) " -static-libgcc";
|
||||
nativeBuildInputs = (prevAttrs.nativeBuildInputs or [])
|
||||
++ lib.optionals stdenv.hasCC [
|
||||
(pkgs.buildPackages.makeSetupHook {
|
||||
name = "darwin-portable-libSystem-hook";
|
||||
substitutions = {
|
||||
libsystem = "${stdenv.cc.libc}/lib/libSystem.B.dylib";
|
||||
targetPrefix = stdenv.cc.bintools.targetPrefix;
|
||||
};
|
||||
} ./darwin/portable-libsystem.sh)
|
||||
];
|
||||
nativeBuildInputs = (prevAttrs.nativeBuildInputs or []);
|
||||
}));
|
||||
});
|
||||
|
||||
|
@ -1,12 +0,0 @@
|
||||
# Make /nix/store/...-libSystem “portable” for static built binaries.
|
||||
# This just rewrites everything in $1/bin to use the
|
||||
# /usr/lib/libSystem.B.dylib that is provided on every macOS system.
|
||||
|
||||
fixupOutputHooks+=('fixLibsystemRefs $prefix')
|
||||
|
||||
fixLibsystemRefs() {
|
||||
if [ -d "$1/bin" ]; then
|
||||
find "$1/bin" -type f -exec \
|
||||
@targetPrefix@install_name_tool -change @libsystem@ /usr/lib/libSystem.B.dylib {} \;
|
||||
fi
|
||||
}
|
Loading…
Reference in New Issue
Block a user