xcbuild: only override version with 1 arg

sometimes we want the "SDK" version from xcbuild so we do something
like:

$ xcbuild -version -sdk MacOSX10.10
SDKSettings.plist - MacOSX10.10 (MacOSX10.10)
SDKVersion: 10.10
Path: /nix/store/6k7crm1n4drf09ga0dwvbmb59x4zl2i2-SDKs/MacOSX10.10.sdk
PlatformPath: /nix/store/vhfwb1znfy65s2xs27j8xribk6mp6lbw-Platforms/MacOSX.platform
ProductName: Mac OS X
ProductVersion: 10.10

This was previously overriden by the current xcode version so you
would get:

Xcode 9.4.1
Build version 17E189

This should fix the other usage of -version in nodejs 6.x.
This commit is contained in:
Matthew Bauer 2018-08-20 13:14:05 -05:00
parent cfa4e0ac14
commit b300dddae1

View file

@ -112,7 +112,7 @@ runCommand "xcodebuild-${xcbuild.version}" {
--add-flags "DERIVED_DATA_DIR=." \
--set DEVELOPER_DIR "$out" \
--set SDKROOT ${sdkName} \
--run '[ "$1" = "-version" ] && (echo Xcode ${xcodeVer}; echo Build version ${sdkBuildVersion}) && exit 0' \
--run '[ "$1" = "-version" ] && [ "$#" -eq 1 ] && (echo Xcode ${xcodeVer}; echo Build version ${sdkBuildVersion}) && exit 0' \
--run '[ "$1" = "-license" ] && exit 0'
substitute ${xcode-select} $out/bin/xcode-select \