mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-02 18:42:15 +00:00
30 lines
857 B
Nix
30 lines
857 B
Nix
{stdenv}:
|
|
{version ? "9.3", xcodeBaseDir ? "/Applications/Xcode.app"}:
|
|
|
|
assert stdenv.isDarwin;
|
|
|
|
stdenv.mkDerivation {
|
|
name = "xcode-wrapper-"+version;
|
|
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 "${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
|
|
if [ -z "$($out/bin/xcodebuild -version | grep -x 'Xcode ${version}')" ]
|
|
then
|
|
echo "We require xcodebuild version: ${version}"
|
|
exit 1
|
|
fi
|
|
'';
|
|
}
|