about summary refs log tree commit diff
path: root/pkgs/development/mobile
diff options
context:
space:
mode:
authorSander van der Burg <svanderburg@gmail.com>2019-02-04 22:43:48 +0100
committerSander van der Burg <svanderburg@gmail.com>2019-02-04 22:43:48 +0100
commit9edc2d4dbb4a87ecb8c608cb49a72cbe30872421 (patch)
tree67296968c61c050603d267b75cd350e3a8d0f131 /pkgs/development/mobile
parent8626808c72623d0394153c93b760c24a20425558 (diff)
xcodeenv: enable Xcode 10.1 support
Diffstat (limited to 'pkgs/development/mobile')
-rw-r--r--pkgs/development/mobile/xcodeenv/build-app.nix20
-rw-r--r--pkgs/development/mobile/xcodeenv/compose-xcodewrapper.nix3
2 files changed, 16 insertions, 7 deletions
diff --git a/pkgs/development/mobile/xcodeenv/build-app.nix b/pkgs/development/mobile/xcodeenv/build-app.nix
index 90fa307fbf237..b88f806d58664 100644
--- a/pkgs/development/mobile/xcodeenv/build-app.nix
+++ b/pkgs/development/mobile/xcodeenv/build-app.nix
@@ -1,7 +1,7 @@
 {stdenv, composeXcodeWrapper}:
 { name
 , src
-, sdkVersion ? "11.3"
+, sdkVersion ? "12.1"
 , target ? null
 , configuration ? null
 , scheme ? null
@@ -11,6 +11,7 @@
 , certificateFile ? null
 , certificatePassword ? null
 , provisioningProfile ? null
+, codeSignIdentity ? null
 , signMethod ? null
 , generateIPA ? false
 , generateXCArchive ? false
@@ -21,7 +22,7 @@
 , ...
 }@args:
 
-assert release -> certificateFile != null && certificatePassword != null && provisioningProfile != null && signMethod != null;
+assert release -> certificateFile != null && certificatePassword != null && provisioningProfile != null && signMethod != null && codeSignIdentity != null;
 assert enableWirelessDistribution -> installURL != null && bundleId != null && appVersion != null;
 
 let
@@ -53,8 +54,11 @@ let
 in
 stdenv.mkDerivation ({
   name = stdenv.lib.replaceChars [" "] [""] name; # iOS app names can contain spaces, but in the Nix store this is not allowed
-  buildInputs = [ xcodewrapper ];
   buildPhase = ''
+    # Be sure that the Xcode wrapper has priority over everything else.
+    # When using buildInputs this does not seem to be the case.
+    export PATH=${xcodewrapper}/bin:$PATH
+    
     ${stdenv.lib.optionalString release ''
       export HOME=/Users/$(whoami)
       keychainName="$(basename $out)"
@@ -85,9 +89,9 @@ stdenv.mkDerivation ({
     ''}
 
     # Do the building
-    export LD=clang # To avoid problem with -isysroot parameter that is unrecognized by the stock ld. Comparison with an impure build shows that it uses clang instead. Ugly, but it works
+    export LD=/usr/bin/clang # To avoid problem with -isysroot parameter that is unrecognized by the stock ld. Comparison with an impure build shows that it uses clang instead. Ugly, but it works
 
-    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 generateIPA || generateXCArchive then "-archivePath \"${name}.xcarchive\" archive" else ""} ${if release then ''PROVISIONING_PROFILE=$PROVISIONING_PROFILE OTHER_CODE_SIGN_FLAGS="--keychain $HOME/Library/Keychains/$keychainName-db"'' else ""} ${xcodeFlags}
+    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 generateIPA || generateXCArchive then "-archivePath \"${name}.xcarchive\" archive" else ""} ${if release then '' PROVISIONING_PROFILE=$PROVISIONING_PROFILE OTHER_CODE_SIGN_FLAGS="--keychain $HOME/Library/Keychains/$keychainName-db"'' else ""} ${xcodeFlags}
 
     ${stdenv.lib.optionalString release ''
       ${stdenv.lib.optionalString generateIPA ''
@@ -97,11 +101,15 @@ stdenv.mkDerivation ({
         <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
         <plist version="1.0">
         <dict>
+            <key>signingCertificate</key>
+            <string>${codeSignIdentity}</string>
             <key>provisioningProfiles</key>
             <dict>
-                <key>${bundleId}</key>
+                <key>${stdenv.lib.toLower bundleId}</key>
                 <string>$PROVISIONING_PROFILE</string>
             </dict>
+            <key>signingStyle</key>
+            <string>manual</string>
             <key>method</key>
             <string>${signMethod}</string>
             ${stdenv.lib.optionalString (signMethod == "enterprise" || signMethod == "ad-hoc") ''
diff --git a/pkgs/development/mobile/xcodeenv/compose-xcodewrapper.nix b/pkgs/development/mobile/xcodeenv/compose-xcodewrapper.nix
index d0093ffac91b9..dea1b77211bd4 100644
--- a/pkgs/development/mobile/xcodeenv/compose-xcodewrapper.nix
+++ b/pkgs/development/mobile/xcodeenv/compose-xcodewrapper.nix
@@ -1,5 +1,5 @@
 {stdenv}:
-{version ? "9.3", xcodeBaseDir ? "/Applications/Xcode.app"}:
+{version ? "10.1", xcodeBaseDir ? "/Applications/Xcode.app"}:
 
 assert stdenv.isDarwin;
 
@@ -13,6 +13,7 @@ stdenv.mkDerivation {
     ln -s /usr/bin/codesign
     ln -s /usr/bin/xcrun
     ln -s /usr/bin/plutil
+    ln -s /usr/bin/clang
     ln -s "${xcodeBaseDir}/Contents/Developer/usr/bin/xcodebuild"
     ln -s "${xcodeBaseDir}/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator"