depot/third_party/nixpkgs/pkgs/stdenv/darwin/portable-libsystem.sh
Default email 9c6ee729d6 Project import generated by Copybara.
GitOrigin-RevId: 6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222
2023-07-15 19:15:38 +02:00

12 lines
429 B
Bash

# 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
}