2018-11-17 12:55:49 -08:00
|
|
|
{stdenv}:
|
2019-11-10 15:17:47 -08:00
|
|
|
{version ? "11.1", xcodeBaseDir ? "/Applications/Xcode.app"}:
|
2018-11-17 12:55:49 -08:00
|
|
|
|
|
|
|
assert stdenv.isDarwin;
|
2013-01-07 07:52:42 -08:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "xcode-wrapper-"+version;
|
|
|
|
buildCommand = ''
|
2014-06-30 05:56:10 -07:00
|
|
|
mkdir -p $out/bin
|
2013-01-07 07:52:42 -08:00
|
|
|
cd $out/bin
|
|
|
|
ln -s /usr/bin/xcode-select
|
|
|
|
ln -s /usr/bin/security
|
2013-10-15 07:32:38 -07:00
|
|
|
ln -s /usr/bin/codesign
|
2017-01-25 07:56:55 -08:00
|
|
|
ln -s /usr/bin/xcrun
|
2018-11-17 12:55:49 -08:00
|
|
|
ln -s /usr/bin/plutil
|
2019-02-04 13:43:48 -08:00
|
|
|
ln -s /usr/bin/clang
|
2019-03-10 15:18:08 -07:00
|
|
|
ln -s /usr/bin/lipo
|
|
|
|
ln -s /usr/bin/file
|
|
|
|
ln -s /usr/bin/rev
|
2014-10-02 06:49:33 -07:00
|
|
|
ln -s "${xcodeBaseDir}/Contents/Developer/usr/bin/xcodebuild"
|
2016-01-07 06:43:17 -08:00
|
|
|
ln -s "${xcodeBaseDir}/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator"
|
2013-01-07 07:52:42 -08:00
|
|
|
|
2013-08-16 04:20:59 -07:00
|
|
|
cd ..
|
2014-10-02 06:49:33 -07:00
|
|
|
ln -s "${xcodeBaseDir}/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs"
|
2013-08-16 04:20:59 -07:00
|
|
|
|
2013-01-07 07:52:42 -08:00
|
|
|
# Check if we have the xcodebuild version that we want
|
2013-12-24 05:34:56 -08:00
|
|
|
if [ -z "$($out/bin/xcodebuild -version | grep -x 'Xcode ${version}')" ]
|
2013-01-07 07:52:42 -08:00
|
|
|
then
|
|
|
|
echo "We require xcodebuild version: ${version}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
}
|