-
Notifications
You must be signed in to change notification settings - Fork 984
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nix: allow XCode versions 11.5 and higher
This is kinda hacky, but is simple enough since the version check uses grep. For details see: https://github.com/status-im/nixpkgs/blob/status-mods/pkgs/development/mobile/xcodeenv/compose-xcodewrapper.nix Signed-off-by: Jakub Sokołowski <jakub@status.im>
- Loading branch information
Showing
3 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ stdenv }: | ||
|
||
{ version ? "11.1" | ||
, allowHigher ? false | ||
, xcodeBaseDir ? "/Applications/Xcode.app" }: | ||
|
||
assert stdenv.isDarwin; | ||
|
||
stdenv.mkDerivation { | ||
name = "xcode-wrapper-${version}${if allowHigher then "-plus" else ""}"; | ||
buildCommand = '' | ||
mkdir -p $out/bin | ||
cd $out/bin | ||
ln -s /usr/bin/xcode-select | ||
ln -s /usr/bin/security | ||
ln -s /usr/bin/codesign | ||
ln -s /usr/bin/xcrun | ||
ln -s /usr/bin/plutil | ||
ln -s /usr/bin/clang | ||
ln -s /usr/bin/lipo | ||
ln -s /usr/bin/file | ||
ln -s /usr/bin/rev | ||
ln -s "${xcodeBaseDir}/Contents/Developer/usr/bin/xcodebuild" | ||
ln -s "${xcodeBaseDir}/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator" | ||
cd .. | ||
ln -s "${xcodeBaseDir}/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs" | ||
# Check if we have the xcodebuild version that we want | ||
currVer=$($out/bin/xcodebuild -version) | ||
${if allowHigher then '' | ||
if [ -z "$(printf '%s\n' "${version}" "$currVer" | sort -V | head -n1)""" != "${version}" ] | ||
'' else '' | ||
if [ -z "$(echo $currVer | grep -x 'Xcode ${version}')" ] | ||
''} | ||
then | ||
echo "We require xcodebuild version${if allowHigher then " or higher" else ""}: ${version}" | ||
exit 1 | ||
fi | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters