From 0f6eab52e133f2e54723aed7d946efb6f25ca3ea Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Wed, 25 Jan 2017 16:56:55 +0100 Subject: [PATCH] xcodeenv: make it work with Xcode 8.2.1 --- pkgs/development/mobile/titaniumenv/build-app.nix | 2 +- pkgs/development/mobile/titaniumenv/default.nix | 2 +- .../mobile/titaniumenv/examples/default.nix | 4 ++-- .../examples/simulate-kitchensink/default.nix | 2 +- pkgs/development/mobile/xcodeenv/build-app.nix | 10 ++-------- pkgs/development/mobile/xcodeenv/default.nix | 2 +- pkgs/development/mobile/xcodeenv/simulate-app.nix | 5 ++--- pkgs/development/mobile/xcodeenv/xcodewrapper.nix | 2 +- 8 files changed, 11 insertions(+), 18 deletions(-) diff --git a/pkgs/development/mobile/titaniumenv/build-app.nix b/pkgs/development/mobile/titaniumenv/build-app.nix index cafe329c0767..3c56b3ecb8af 100644 --- a/pkgs/development/mobile/titaniumenv/build-app.nix +++ b/pkgs/development/mobile/titaniumenv/build-app.nix @@ -1,7 +1,7 @@ {stdenv, androidsdk, titaniumsdk, titanium, alloy, xcodewrapper, jdk, python, nodejs, which, xcodeBaseDir}: { name, src, target, androidPlatformVersions ? [ "23" ], androidAbiVersions ? [ "armeabi" "armeabi-v7a" ], tiVersion ? null , release ? false, androidKeyStore ? null, androidKeyAlias ? null, androidKeyStorePassword ? null -, iosMobileProvisioningProfile ? null, iosCertificateName ? null, iosCertificate ? null, iosCertificatePassword ? null, iosVersion ? "9.2" +, iosMobileProvisioningProfile ? null, iosCertificateName ? null, iosCertificate ? null, iosCertificatePassword ? null, iosVersion ? "10.2" , enableWirelessDistribution ? false, installURL ? null }: diff --git a/pkgs/development/mobile/titaniumenv/default.nix b/pkgs/development/mobile/titaniumenv/default.nix index b3c48d55ab77..6ca4c441e640 100644 --- a/pkgs/development/mobile/titaniumenv/default.nix +++ b/pkgs/development/mobile/titaniumenv/default.nix @@ -1,4 +1,4 @@ -{pkgs, pkgs_i686, xcodeVersion ? "7.2", xcodeBaseDir ? "/Applications/Xcode.app", tiVersion ? "6.0.2.GA"}: +{pkgs, pkgs_i686, xcodeVersion ? "8.2.1", xcodeBaseDir ? "/Applications/Xcode.app", tiVersion ? "6.0.2.GA"}: rec { androidenv = pkgs.androidenv; diff --git a/pkgs/development/mobile/titaniumenv/examples/default.nix b/pkgs/development/mobile/titaniumenv/examples/default.nix index 612eb40d192a..3c5d3a018ec8 100644 --- a/pkgs/development/mobile/titaniumenv/examples/default.nix +++ b/pkgs/development/mobile/titaniumenv/examples/default.nix @@ -1,10 +1,10 @@ { nixpkgs ? , systems ? [ "x86_64-linux" "x86_64-darwin" ] -, xcodeVersion ? "7.2" +, xcodeVersion ? "8.2.1" , xcodeBaseDir ? "/Applications/Xcode.app" , tiVersion ? "6.0.2.GA" , rename ? false -, newBundleId ? "com.example.kitchensink", iosMobileProvisioningProfile ? null, iosCertificate ? null, iosCertificateName ? "Example", iosCertificatePassword ? "", iosVersion ? "9.2" +, newBundleId ? "com.example.kitchensink", iosMobileProvisioningProfile ? null, iosCertificate ? null, iosCertificateName ? "Example", iosCertificatePassword ? "", iosVersion ? "10.2" , enableWirelessDistribution ? false, installURL ? null }: diff --git a/pkgs/development/mobile/titaniumenv/examples/simulate-kitchensink/default.nix b/pkgs/development/mobile/titaniumenv/examples/simulate-kitchensink/default.nix index 15a86e338dea..5bdd0fd63c5a 100644 --- a/pkgs/development/mobile/titaniumenv/examples/simulate-kitchensink/default.nix +++ b/pkgs/development/mobile/titaniumenv/examples/simulate-kitchensink/default.nix @@ -3,5 +3,5 @@ xcodeenv.simulateApp { name = "simulate-${kitchensink.name}"; inherit bundleId; - app = "${kitchensink}/build/iphone/build/Debug-iphonesimulator"; + app = "${kitchensink}/build/iphone/build/Products/Debug-iphonesimulator"; } diff --git a/pkgs/development/mobile/xcodeenv/build-app.nix b/pkgs/development/mobile/xcodeenv/build-app.nix index b2e6f84bb000..7e46aefb2997 100644 --- a/pkgs/development/mobile/xcodeenv/build-app.nix +++ b/pkgs/development/mobile/xcodeenv/build-app.nix @@ -1,12 +1,11 @@ {stdenv, xcodewrapper}: { name , src -, sdkVersion ? "6.1" +, sdkVersion ? "10.2" , target ? null , configuration ? null , scheme ? null , sdk ? null -, arch ? null , xcodeFlags ? "" , release ? false , codeSignIdentity ? null @@ -35,11 +34,6 @@ let if release then "Release" else "Debug" else configuration; - _arch = if arch == null - then - if release then "armv7" else "x86_64" - else arch; - _sdk = if sdk == null then if release then "iphoneos" + sdkVersion else "iphonesimulator" + sdkVersion @@ -83,7 +77,7 @@ stdenv.mkDerivation { ''} # Do the building - xcodebuild -target ${_target} -configuration ${_configuration} ${stdenv.lib.optionalString (scheme != null) "-scheme ${scheme}"} -sdk ${_sdk} -arch ${_arch} ONLY_ACTIVE_ARCH=NO VALID_ARCHS="${_arch}" CONFIGURATION_TEMP_DIR=$TMPDIR CONFIGURATION_BUILD_DIR=$out ${if generateXCArchive then "archive" else ""} ${xcodeFlags} ${if release then ''"CODE_SIGN_IDENTITY=${codeSignIdentity}" PROVISIONING_PROFILE=$PROVISIONING_PROFILE OTHER_CODE_SIGN_FLAGS="--keychain $HOME/Library/Keychains/$keychainName"'' else ""} + xcodebuild -target ${_target} -configuration ${_configuration} ${stdenv.lib.optionalString (scheme != null) "-scheme ${scheme}"} -sdk ${_sdk} TARGETED_DEVICE_FAMILY="1, 2" ONLY_ACTIVE_ARCH=NO CONFIGURATION_TEMP_DIR=$TMPDIR CONFIGURATION_BUILD_DIR=$out ${if generateXCArchive then "archive" else ""} ${xcodeFlags} ${if release then ''"CODE_SIGN_IDENTITY=${codeSignIdentity}" PROVISIONING_PROFILE=$PROVISIONING_PROFILE OTHER_CODE_SIGN_FLAGS="--keychain $HOME/Library/Keychains/$keychainName"'' else ""} ${stdenv.lib.optionalString release '' ${stdenv.lib.optionalString generateIPA '' diff --git a/pkgs/development/mobile/xcodeenv/default.nix b/pkgs/development/mobile/xcodeenv/default.nix index d7e35142be4c..afe430df383a 100644 --- a/pkgs/development/mobile/xcodeenv/default.nix +++ b/pkgs/development/mobile/xcodeenv/default.nix @@ -1,4 +1,4 @@ -{stdenv, version ? "7.2", xcodeBaseDir ? "/Applications/Xcode.app"}: +{stdenv, version ? "8.2.1", xcodeBaseDir ? "/Applications/Xcode.app"}: rec { xcodewrapper = import ./xcodewrapper.nix { diff --git a/pkgs/development/mobile/xcodeenv/simulate-app.nix b/pkgs/development/mobile/xcodeenv/simulate-app.nix index ecfdbe2a6e39..5f71b5994080 100644 --- a/pkgs/development/mobile/xcodeenv/simulate-app.nix +++ b/pkgs/development/mobile/xcodeenv/simulate-app.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation { # Copy the app and restore the write permissions appTmpDir=$(mktemp -d -t appTmpDir) - cp -r "$(echo ${app}/*.app)" $appTmpDir + cp -r "$(echo ${app}/*.app)" "$appTmpDir" chmod -R 755 "$(echo $appTmpDir/*.app)" # Wait for the simulator to start @@ -33,7 +33,7 @@ stdenv.mkDerivation { read # Install the app - xcrun simctl install $udid "$(echo $appTmpDir/*.app)" + xcrun simctl install "$udid" "$(echo $appTmpDir/*.app)" # Remove the app tempdir rm -Rf $appTmpDir @@ -45,4 +45,3 @@ stdenv.mkDerivation { chmod +x $out/bin/run-test-simulator ''; } - diff --git a/pkgs/development/mobile/xcodeenv/xcodewrapper.nix b/pkgs/development/mobile/xcodeenv/xcodewrapper.nix index 26b0197b2e13..38afe86c5aa5 100644 --- a/pkgs/development/mobile/xcodeenv/xcodewrapper.nix +++ b/pkgs/development/mobile/xcodeenv/xcodewrapper.nix @@ -8,8 +8,8 @@ stdenv.mkDerivation { ln -s /usr/bin/xcode-select ln -s /usr/bin/security ln -s /usr/bin/codesign + ln -s /usr/bin/xcrun ln -s "${xcodeBaseDir}/Contents/Developer/usr/bin/xcodebuild" - ln -s "${xcodeBaseDir}/Contents/Developer/usr/bin/xcrun" ln -s "${xcodeBaseDir}/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator" cd ..