2018-08-20 20:43:41 +02:00
|
|
|
{ stdenv, requireFile, lib }:
|
2018-05-23 21:32:15 +02:00
|
|
|
|
|
|
|
let requireXcode = version: sha256:
|
|
|
|
let
|
|
|
|
xip = "Xcode_" + version + ".xip";
|
|
|
|
# TODO(alexfmpe): Find out how to validate the .xip signature in Linux
|
|
|
|
unxip = if stdenv.isDarwin
|
|
|
|
then ''
|
|
|
|
open -W ${xip}
|
|
|
|
rm -rf ${xip}
|
|
|
|
''
|
|
|
|
else ''
|
|
|
|
xar -xf ${xip}
|
|
|
|
rm -rf ${xip}
|
|
|
|
pbzx -n Content | cpio -i
|
|
|
|
rm Content Metadata
|
|
|
|
'';
|
|
|
|
app = requireFile rec {
|
|
|
|
name = "Xcode.app";
|
2018-06-08 16:27:40 +02:00
|
|
|
url = "https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_${version}/${xip}";
|
2018-05-23 21:32:15 +02:00
|
|
|
hashMode = "recursive";
|
|
|
|
inherit sha256;
|
|
|
|
message = ''
|
|
|
|
Unfortunately, we cannot download ${name} automatically.
|
|
|
|
Please go to ${url}
|
2018-05-30 23:10:49 +02:00
|
|
|
to download it yourself, and add it to the Nix store by running the following commands.
|
2018-05-23 21:32:15 +02:00
|
|
|
Note: download (~ 5GB), extraction and storing of Xcode will take a while
|
|
|
|
|
|
|
|
${unxip}
|
|
|
|
nix-store --add-fixed --recursive sha256 Xcode.app
|
|
|
|
rm -rf Xcode.app
|
|
|
|
'';
|
|
|
|
};
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://developer.apple.com/downloads/";
|
2018-05-23 21:32:15 +02:00
|
|
|
description = "Apple's XCode SDK";
|
|
|
|
license = licenses.unfree;
|
|
|
|
platforms = platforms.darwin ++ platforms.linux;
|
|
|
|
};
|
|
|
|
|
|
|
|
in app.overrideAttrs ( oldAttrs: oldAttrs // { inherit meta; });
|
|
|
|
|
2018-06-22 23:20:00 +02:00
|
|
|
in lib.makeExtensible (self: {
|
2018-05-23 21:32:15 +02:00
|
|
|
xcode_8_1 = requireXcode "8.1" "18xjvfipwzia66gm3r9p770xdd4r375vak7chw5vgqnv9yyjiq2n";
|
|
|
|
xcode_8_2 = requireXcode "8.2" "13nd1zsfqcp9hwp15hndr0rsbb8rgprrz7zr2ablj4697qca06m2";
|
|
|
|
xcode_9_1 = requireXcode "9.1" "0ab1403wy84ys3yn26fj78cazhpnslmh3nzzp1wxib3mr1afjvic";
|
|
|
|
xcode_9_2 = requireXcode "9.2" "1bgfgdp266cbbqf2axcflz92frzvhi0qw0jdkcw6r85kdpc8dj4c";
|
2019-10-16 01:14:33 +02:00
|
|
|
xcode_9_3 = requireXcode "9.3" "12m9kb4759s2ky42b1vf7y38qqxn2j99s99adzc6ljnmy26ii12w";
|
|
|
|
xcode_9_4 = requireXcode "9.4" "00az1cf9pm8zmvzs6yq04prdmxp8xi3ymxw94jjh4mh7hlbkhcb7";
|
|
|
|
xcode_9_4_1 = requireXcode "9.4.1" "0y9kphj86c14jl6aibv57sd7ln0w06vdhzm8ysp0s98rfgyq2lbw";
|
2019-01-25 22:36:28 +01:00
|
|
|
xcode_10_1 = requireXcode "10.1" "1ssdbg4v8r11fjf4jl38pwyry2aia1qihbxyxapz0v0n5gfnp05v";
|
2019-10-16 01:14:33 +02:00
|
|
|
xcode_10_2 = requireXcode "10.2" "1xzybl1gvb3q5qwlwchanzpws4sb70i3plf0vrzvlfdp2hsb3pg7";
|
|
|
|
xcode_10_2_1 = requireXcode "10.2.1" "11sdb54nr0x7kp987qq839x6k5gdx7vqdxjiy5xm5279n1n47bmg";
|
|
|
|
xcode_10_3 = requireXcode "10.3" "1i628vfn6zad81fsz3zpc6z15chhskvyp8qnajp2wnpzvrwl6ngb";
|
|
|
|
xcode_11 = requireXcode "11" "1r03j3kkp4blfp2kqpn538w3dx57ms930fj8apjkq6dk7fv3jcqh";
|
2020-07-20 22:46:24 +02:00
|
|
|
xcode_11_3_1 = requireXcode "11.3.1" "1p6nicj91kr6ad3rmycahd1i7z4hj7ccjs93ixsiximjzaahx3q4";
|
2020-07-22 04:58:51 +02:00
|
|
|
xcode = self."xcode_${lib.replaceStrings ["."] ["_"] (if (stdenv.targetPlatform ? xcodeVer) then stdenv.targetPlatform.xcodeVer else "11.3.1")}";
|
2018-06-22 23:20:00 +02:00
|
|
|
})
|