darwin.stdenv: fix portable libsystem hook with sandboxing
When sandboxing is enabled, the hook tries to run `install_name_tool` and fails because the system one is inaccessible. Having it use `targetPrefix` allows it to find and use the cross-install_name_tool.
This commit is contained in:
parent
94c52940c4
commit
feb89eed00
|
@ -105,6 +105,7 @@ rec {
|
||||||
name = "darwin-portable-libSystem-hook";
|
name = "darwin-portable-libSystem-hook";
|
||||||
substitutions = {
|
substitutions = {
|
||||||
libsystem = "${stdenv.cc.libc}/lib/libSystem.B.dylib";
|
libsystem = "${stdenv.cc.libc}/lib/libSystem.B.dylib";
|
||||||
|
targetPrefix = stdenv.cc.bintools.targetPrefix;
|
||||||
};
|
};
|
||||||
} ./darwin/portable-libsystem.sh)
|
} ./darwin/portable-libsystem.sh)
|
||||||
];
|
];
|
||||||
|
|
|
@ -7,6 +7,6 @@ fixupOutputHooks+=('fixLibsystemRefs $prefix')
|
||||||
fixLibsystemRefs() {
|
fixLibsystemRefs() {
|
||||||
if [ -d "$1/bin" ]; then
|
if [ -d "$1/bin" ]; then
|
||||||
find "$1/bin" -exec \
|
find "$1/bin" -exec \
|
||||||
install_name_tool -change @libsystem@ /usr/lib/libSystem.B.dylib {} \;
|
@targetPrefix@install_name_tool -change @libsystem@ /usr/lib/libSystem.B.dylib {} \;
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue