3
0
Fork 0
forked from mirrors/nixpkgs

Fix building on Xcode

92188d9d17 broke the case where the user
has Xcode but not the command-line tools. So this commit restores
using xcrun to get the path to the SDK (falling back to / for the
non-Xcode case).

http://hydra.nixos.org/build/19953295
This commit is contained in:
Eelco Dolstra 2015-02-24 17:05:52 +01:00
parent b1ec8e6c64
commit dad86b4f54

View file

@ -50,10 +50,10 @@ rec {
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s" stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
xargsFlags=" " xargsFlags=" "
export MACOSX_DEPLOYMENT_TARGET=10.7 export MACOSX_DEPLOYMENT_TARGET=10.7
export SDKROOT= # Use the SDK from Xcode by default, falling back to /usr/{lib,include}.
export SDKROOT_X=/ # FIXME: impure! export SDKROOT=$(/usr/bin/xcrun --sdk macosx10.9 --show-sdk-path 2> /dev/null || echo /)
export NIX_CFLAGS_COMPILE+=" --sysroot=/var/empty -idirafter $SDKROOT_X/usr/include -F$SDKROOT_X/System/Library/Frameworks -Wno-multichar -Wno-deprecated-declarations" export NIX_CFLAGS_COMPILE+=" --sysroot=/var/empty -idirafter $SDKROOT/usr/include -F$SDKROOT/System/Library/Frameworks -Wno-multichar -Wno-deprecated-declarations"
export NIX_LDFLAGS_AFTER+=" -L$SDKROOT_X/usr/lib" export NIX_LDFLAGS_AFTER+=" -L$SDKROOT/usr/lib"
export CMAKE_OSX_ARCHITECTURES=x86_64 export CMAKE_OSX_ARCHITECTURES=x86_64
''; '';