From 9b0b31d9813220de53e950d0f207a3b874dc0780 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Fri, 22 Jun 2018 17:20:00 -0400 Subject: [PATCH] xcode: add xcodeVer to system This version number controls which xcode version to use when building cross to iOS. --- lib/systems/examples.nix | 4 ++++ pkgs/os-specific/darwin/xcode/default.nix | 8 ++++---- pkgs/top-level/darwin-packages.nix | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index 108996206a7d..1817a6380ddd 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -100,6 +100,7 @@ rec { config = "aarch64-apple-ios"; # config = "aarch64-apple-darwin14"; sdkVer = "10.2"; + xcodeVer = "8.2"; useiOSPrebuilt = true; platform = {}; }; @@ -108,6 +109,7 @@ rec { config = "armv7a-apple-ios"; # config = "arm-apple-darwin10"; sdkVer = "10.2"; + xcodeVer = "8.2"; useiOSPrebuilt = true; platform = {}; }; @@ -116,6 +118,7 @@ rec { config = "x86_64-apple-ios"; # config = "x86_64-apple-darwin14"; sdkVer = "10.2"; + xcodeVer = "8.2"; useiOSPrebuilt = true; isiPhoneSimulator = true; platform = {}; @@ -125,6 +128,7 @@ rec { config = "i686-apple-ios"; # config = "i386-apple-darwin11"; sdkVer = "10.2"; + xcodeVer = "8.2"; useiOSPrebuilt = true; isiPhoneSimulator = true; platform = {}; diff --git a/pkgs/os-specific/darwin/xcode/default.nix b/pkgs/os-specific/darwin/xcode/default.nix index d153ef16c14e..252fe5abf49f 100644 --- a/pkgs/os-specific/darwin/xcode/default.nix +++ b/pkgs/os-specific/darwin/xcode/default.nix @@ -1,4 +1,4 @@ -{ stdenv, requireFile }: +{ stdenv, requireFile, targetPlatform, lib }: let requireXcode = version: sha256: let @@ -40,11 +40,11 @@ let requireXcode = version: sha256: in app.overrideAttrs ( oldAttrs: oldAttrs // { inherit meta; }); -in rec { +in lib.makeExtensible (self: { 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"; xcode_9_4 = requireXcode "9.4" "6731381785075602a52489f7ea47ece8f6daf225007ba3ffae1fd59b1c0b5f01"; - xcode = xcode_9_4; -} + xcode = self."xcode_${lib.replaceStrings ["."] ["_"] (if targetPlatform.useiOSPrebuilt then targetPlatform.xcodeVer else "9.4")}"; +}) diff --git a/pkgs/top-level/darwin-packages.nix b/pkgs/top-level/darwin-packages.nix index a1d5772fe6da..03a32260710a 100644 --- a/pkgs/top-level/darwin-packages.nix +++ b/pkgs/top-level/darwin-packages.nix @@ -47,7 +47,7 @@ in iosSdkPkgs = darwin.callPackage ../os-specific/darwin/ios-sdk-pkgs { buildIosSdk = buildPackages.darwin.iosSdkPkgs.sdk; targetIosSdkPkgs = targetPackages.darwin.iosSdkPkgs; - xcode = darwin.xcode_8_2; + xcode = darwin.xcode; inherit (pkgs.llvmPackages) clang-unwrapped; };