Skip to content

Commit

Permalink
darwin-CF: use @rpath for library id and add an rpath entry for CF ba…
Browse files Browse the repository at this point in the history
…sed on NIX_COREFOUNDATION_RPATH
  • Loading branch information
LnL7 committed Jul 26, 2017
1 parent 40a568b commit bf9279d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pkgs/build-support/cc-wrapper/ld-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,14 @@ if [ "$NIX_DONT_SET_RPATH" != 1 ]; then
done
done


# Finally, add `-rpath' switches.
for i in $rpath; do
extra+=(-rpath $i)
done

if [ -n "$NIX_COREFOUNDATION_RPATH" ]; then
extra+=(-rpath $NIX_COREFOUNDATION_RPATH)
fi
fi


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ appleDerivation {
--replace "/usr/sbin/" "" \
--replace "/bin/" "" \
--replace "INSTALLNAME=/System" "INSTALLNAME=$out" \
--replace "install_name_tool -id /System" "install_name_tool -id $out" \
--replace "install_name_tool -id /System/Library/Frameworks" "install_name_tool -id @rpath" \
--replace 'chown -RH -f root:wheel $(DSTBASE)/CoreFoundation.framework' "" \
--replace 'chmod -RH' 'chmod -R'
Expand Down
1 change: 1 addition & 0 deletions pkgs/stdenv/darwin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ in rec {
targetPlatform = localSystem;

preHook = commonPreHook + ''
export NIX_COREFOUNDATION_RPATH=${pkgs.darwin.CF}/Library/Frameworks
export PATH_LOCALE=${pkgs.darwin.locale}/share/locale
'';

Expand Down

0 comments on commit bf9279d

Please sign in to comment.