stdenv/darwin: fix portable libsystem hook

Some packages don’t have /bin directories. We should only run
install_name_tool if that directory exists.

(cherry picked from commit 0b8574540b8691924a8dac6dc4d03004d8b25efa)
This commit is contained in:
Matthew Bauer 2018-12-05 12:51:44 -06:00 committed by John Ericson
parent 3c36dccd7c
commit af2cebe78f

View File

@ -5,6 +5,8 @@
fixupOutputHooks+=('fixLibsystemRefs $prefix')
fixLibsystemRefs() {
find "$1/bin" \
-exec install_name_tool -change @libsystem@ /usr/lib/libSystem.B.dylib {} \;
if [ -d "$1/bin" ]; then
find "$1/bin" -exec \
install_name_tool -change @libsystem@ /usr/lib/libSystem.B.dylib {} \;
fi
}