summary refs log blame commit diff
path: root/pkgs/stdenv/darwin/portable-libsystem.sh
blob: f50ccc8d32eea4b6678264300479562dcc3ca4f9 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11






                                                                         



                                                                              
 
# 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" -exec \
        install_name_tool -change @libsystem@ /usr/lib/libSystem.B.dylib {} \;
  fi
}