summary refs log tree commit diff
path: root/pkgs/development/mobile/titaniumenv
diff options
context:
space:
mode:
authorSander van der Burg <svanderburg@gmail.com>2018-11-17 23:13:44 +0100
committerSander van der Burg <svanderburg@gmail.com>2018-12-18 21:16:06 +0100
commit27f8b6b89e431ba7c1c98231ff297022d928e2ef (patch)
treed754f2468bb1a4f99ea923bf82115eb53e02cdb2 /pkgs/development/mobile/titaniumenv
parent907216a57d1c478486d71f8b085f7019114c6fce (diff)
downloadnixpkgs-27f8b6b89e431ba7c1c98231ff297022d928e2ef.tar
nixpkgs-27f8b6b89e431ba7c1c98231ff297022d928e2ef.tar.gz
nixpkgs-27f8b6b89e431ba7c1c98231ff297022d928e2ef.tar.bz2
nixpkgs-27f8b6b89e431ba7c1c98231ff297022d928e2ef.tar.lz
nixpkgs-27f8b6b89e431ba7c1c98231ff297022d928e2ef.tar.xz
nixpkgs-27f8b6b89e431ba7c1c98231ff297022d928e2ef.tar.zst
nixpkgs-27f8b6b89e431ba7c1c98231ff297022d928e2ef.zip
Replace titaniumenv with new implementation
Diffstat (limited to 'pkgs/development/mobile/titaniumenv')
-rw-r--r--pkgs/development/mobile/titaniumenv/build-app.nix311
-rw-r--r--pkgs/development/mobile/titaniumenv/default.nix24
-rw-r--r--pkgs/development/mobile/titaniumenv/examples/default.nix91
-rw-r--r--pkgs/development/mobile/titaniumenv/examples/emulate-kitchensink/default.nix10
-rw-r--r--pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix44
-rwxr-xr-xpkgs/development/mobile/titaniumenv/examples/kitchensink/generatekeystore.sh10
-rw-r--r--pkgs/development/mobile/titaniumenv/examples/kitchensink/keystorebin1315 -> 0 bytes
-rw-r--r--pkgs/development/mobile/titaniumenv/examples/simulate-kitchensink/default.nix7
-rw-r--r--pkgs/development/mobile/titaniumenv/titaniumsdk-6.3.nix43
-rw-r--r--pkgs/development/mobile/titaniumenv/titaniumsdk-7.1.nix12
10 files changed, 160 insertions, 392 deletions
diff --git a/pkgs/development/mobile/titaniumenv/build-app.nix b/pkgs/development/mobile/titaniumenv/build-app.nix
index 0250e5bf2e2..472f85fbc45 100644
--- a/pkgs/development/mobile/titaniumenv/build-app.nix
+++ b/pkgs/development/mobile/titaniumenv/build-app.nix
@@ -1,200 +1,181 @@
-{stdenv, androidsdk, titaniumsdk, titanium, alloy, xcodewrapper, jdk, python, nodejs, which, file, xcodeBaseDir}:
-{ name, src, preBuild ? "", target, androidPlatformVersions ? [ "25" ], androidAbiVersions ? [ "armeabi" "armeabi-v7a" ], tiVersion ? null
+{stdenv, composeAndroidPackages, composeXcodeWrapper, titaniumsdk, titanium, alloy, jdk, python, nodejs, which, file}:
+{ name, src, preBuild ? "", target, tiVersion ? null
 , release ? false, androidKeyStore ? null, androidKeyAlias ? null, androidKeyStorePassword ? null
-, iosMobileProvisioningProfile ? null, iosCertificateName ? null, iosCertificate ? null, iosCertificatePassword ? null, iosVersion ? "11.2"
-, enableWirelessDistribution ? false, iosBuildStore ? false, installURL ? null
-}:
+, iosMobileProvisioningProfile ? null, iosCertificateName ? null, iosCertificate ? null, iosCertificatePassword ? null, iosVersion ? "11.3", iosBuildStore ? false
+, enableWirelessDistribution ? false, installURL ? null
+, xcodeBaseDir ? "/Applications/Xcode.app"
+, androidsdkArgs ? {}
+, xcodewrapperArgs ? {}
+, ...
+}@args:
 
 assert (release && target == "android") -> androidKeyStore != null && androidKeyAlias != null && androidKeyStorePassword != null;
 assert (release && target == "iphone") -> iosMobileProvisioningProfile != null && iosCertificateName != null && iosCertificate != null && iosCertificatePassword != null;
 assert enableWirelessDistribution -> installURL != null;
 
 let
-  androidsdkComposition = androidsdk {
-    platformVersions = androidPlatformVersions;
-    abiVersions = androidAbiVersions;
-    useGoogleAPIs = true;
-  };
+  realAndroidsdkArgs = {
+    platformVersions = [ "26" ];
+  } // androidsdkArgs;
+
+  androidsdk = (composeAndroidPackages realAndroidsdkArgs).androidsdk;
+
+  realXcodewrapperArgs = {
+    inherit xcodeBaseDir;
+  } // xcodewrapperArgs;
+
+  xcodewrapper = composeXcodeWrapper xcodewrapperArgs;
 
   deleteKeychain = ''
-    security default-keychain -s login.keychain
-    security delete-keychain $keychainName
-    rm -f $HOME/lock-keychain
+    if [ -f $HOME/lock-keychain ]
+    then
+        security default-keychain -s login.keychain
+        security delete-keychain $keychainName
+        rm -f $HOME/lock-keychain
+    fi
   '';
+
+  extraArgs = removeAttrs args [ "name" "preRebuild" "androidsdkArgs" "xcodewrapperArgs" ];
 in
-stdenv.mkDerivation {
+stdenv.mkDerivation ({
   name = stdenv.lib.replaceChars [" "] [""] name;
-  inherit src;
 
-  buildInputs = [ nodejs titanium alloy jdk python which file ] ++ stdenv.lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") xcodewrapper;
-  
+  buildInputs = [ nodejs titanium alloy python which file jdk ]
+    ++ stdenv.lib.optional (target == "iphone") xcodewrapper;
+
   buildPhase = ''
     ${preBuild}
 
-    export HOME=$TMPDIR
-    
+    export HOME=${if target == "iphone" then "/Users/$(whoami)" else "$TMPDIR"}
+
     ${stdenv.lib.optionalString (tiVersion != null) ''
       # Replace titanium version by the provided one
       sed -i -e "s|<sdk-version>[0-9a-zA-Z\.]*</sdk-version>|<sdk-version>${tiVersion}</sdk-version>|" tiapp.xml
     ''}
-    
+
     # Simulate a login
     mkdir -p $HOME/.titanium
     cat > $HOME/.titanium/auth_session.json <<EOF
     { "loggedIn": true }
     EOF
-    
+
+    # Configure the paths to the Titanium SDK and modules
     echo "{}" > $TMPDIR/config.json
     titanium --config-file $TMPDIR/config.json --no-colors config sdk.defaultInstallLocation ${titaniumsdk}
     titanium --config-file $TMPDIR/config.json --no-colors config paths.modules ${titaniumsdk}
-    
+
     mkdir -p $out
-    
-    ${if target == "android" then
-        ''
-          titanium config --config-file $TMPDIR/config.json --no-colors android.sdkPath ${androidsdkComposition}/libexec
-
-          export PATH=$(echo ${androidsdkComposition}/libexec/tools):$(echo ${androidsdkComposition}/libexec/build-tools/android-*):$PATH
-          export GRADLE_USER_HOME=$TMPDIR/gradle
-
-          ${if release then
-            ''
-              ${stdenv.lib.optionalString stdenv.isDarwin ''
-                # Signing the app does not work with OpenJDK on macOS, use host SDK instead
-                export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"
-              ''}
-              titanium build --config-file $TMPDIR/config.json --no-colors --force --platform android --target dist-playstore --keystore ${androidKeyStore} --alias ${androidKeyAlias} --store-password ${androidKeyStorePassword} --output-dir $out
-            ''
-          else
-            ''titanium build --config-file $TMPDIR/config.json --no-colors --force --platform android --target emulator --build-only -B foo --output $out''}
-        ''
-      else if target == "iphone" then
-        ''
-          ${if release then
-            ''
-              export HOME=/Users/$(whoami)
-              export keychainName=$(basename $out)
-            
-              # Create a keychain with the component hash name (should always be unique)
-              security create-keychain -p "" $keychainName
-              security default-keychain -s $keychainName
-              security unlock-keychain -p "" $keychainName
-              security import ${iosCertificate} -k $keychainName -P "${iosCertificatePassword}" -A
-              security set-key-partition-list -S apple-tool:,apple: -s -k "" $keychainName
-              provisioningId=$(grep UUID -A1 -a ${iosMobileProvisioningProfile} | grep -o "[-A-Za-z0-9]\{36\}")
-   
-              # Ensure that the requested provisioning profile can be found
-        
-              if [ ! -f "$HOME/Library/MobileDevice/Provisioning Profiles/$provisioningId.mobileprovision" ]
-              then
-                  mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles"
-                  cp ${iosMobileProvisioningProfile} "$HOME/Library/MobileDevice/Provisioning Profiles/$provisioningId.mobileprovision"
-              fi
-            
-              # Simulate a login
-              mkdir -p $HOME/.titanium
-              cat > $HOME/.titanium/auth_session.json <<EOF
-              { "loggedIn": true }
-              EOF
-              
-              # Configure the path to Xcode
-              titanium --config-file $TMPDIR/config.json --no-colors config paths.xcode ${xcodeBaseDir}
-              
-              # Make plutil available
-              mkdir -p $TMPDIR/bin
-              ln -s /usr/bin/plutil $TMPDIR/bin
-              export PATH=$TMPDIR/bin:$PATH
-              
-              # Link the modules folder
-              if [ ! -e modules ]
-              then
-                  ln -s ${titaniumsdk}/modules modules
-              fi
-
-              # Take precautions to prevent concurrent builds blocking the keychain
-              while [ -f $HOME/lock-keychain ]
-              do
-                  echo "Keychain locked, waiting for a couple of seconds, or remove $HOME/lock-keychain to unblock..."
-                  sleep 3
-              done
-
-              touch $HOME/lock-keychain
-
-              security default-keychain -s $keychainName
-
-              # Do the actual build
-              titanium build --config-file $TMPDIR/config.json --force --no-colors --platform ios --target ${if iosBuildStore then "dist-appstore" else "dist-adhoc"} --pp-uuid $provisioningId --distribution-name "${iosCertificateName}" --keychain $HOME/Library/Keychains/$keychainName-db --device-family universal --ios-version ${iosVersion} --output-dir $out
-            
-              # Remove our generated keychain
-              ${deleteKeychain}
-            ''
-          else
-            ''
-              # Copy all sources to the output store directory.
-              # Why? Debug application include *.js files, which are symlinked into their
-              # sources. If they are not copied, we have dangling references to the
-              # temp folder.
-            
-              cp -av * $out
-              cd $out
-              
-              # We need to consult a real home directory to find the available simulators
-              export HOME=/Users/$(whoami)
-              
-              # Configure the path to Xcode
-              titanium --config-file $TMPDIR/config.json --no-colors config paths.xcode ${xcodeBaseDir}
-              
-              # Link the modules folder
-              if [ ! -e modules ]
-              then
-                  ln -s ${titaniumsdk}/modules modules
-                  createdModulesSymlink=1
-              fi
-              
-              # Execute the build
-              titanium build --config-file $TMPDIR/config.json --force --no-colors --platform ios --target simulator --build-only --device-family universal --ios-version ${iosVersion} --output-dir $out
-              
-              # Remove the modules symlink
-              if [ "$createdModulesSymlink" = "1" ]
-              then
-                  rm $out/modules
-              fi
-          ''}
-        ''
-
-      else throw "Target: ${target} is not supported!"}
+
+    ${if target == "android" then ''
+      titanium config --config-file $TMPDIR/config.json --no-colors android.sdkPath ${androidsdk}/libexec/android-sdk
+
+      export PATH=${androidsdk}/libexec/android-sdk/tools:$(echo ${androidsdk}/libexec/android-sdk/build-tools/android-*):$PATH
+      export GRADLE_USER_HOME=$TMPDIR/gradle
+
+      ${if release then ''
+        ${stdenv.lib.optionalString stdenv.isDarwin ''
+          # Signing the app does not work with OpenJDK on macOS, use host SDK instead
+          export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"
+        ''}
+        titanium build --config-file $TMPDIR/config.json --no-colors --force --platform android --target dist-playstore --keystore ${androidKeyStore} --alias "${androidKeyAlias}" --store-password "${androidKeyStorePassword}" --output-dir $out
+      '' else ''
+        titanium build --config-file $TMPDIR/config.json --no-colors --force --platform android --target emulator --build-only -B foo --output $out
+      ''}
+    ''
+    else if target == "iphone" then ''
+      # Configure the path to Xcode
+      titanium --config-file $TMPDIR/config.json --no-colors config paths.xcode ${xcodeBaseDir}
+
+      # Link the modules folder
+      if [ ! -e modules ]
+      then
+          ln -s ${titaniumsdk}/modules modules
+          createdModulesSymlink=1
+      fi
+
+      ${if release then ''
+        # Create a keychain with the component hash name (should always be unique)
+        export keychainName=$(basename $out)
+
+        security create-keychain -p "" $keychainName
+        security default-keychain -s $keychainName
+        security unlock-keychain -p "" $keychainName
+        security import ${iosCertificate} -k $keychainName -P "${iosCertificatePassword}" -A
+        security set-key-partition-list -S apple-tool:,apple: -s -k "" $keychainName
+        provisioningId=$(grep UUID -A1 -a ${iosMobileProvisioningProfile} | grep -o "[-A-Za-z0-9]\{36\}")
+
+        # Ensure that the requested provisioning profile can be found
+
+        if [ ! -f "$HOME/Library/MobileDevice/Provisioning Profiles/$provisioningId.mobileprovision" ]
+        then
+            mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles"
+            cp ${iosMobileProvisioningProfile} "$HOME/Library/MobileDevice/Provisioning Profiles/$provisioningId.mobileprovision"
+        fi
+
+        # Take precautions to prevent concurrent builds blocking the keychain
+        while [ -f $HOME/lock-keychain ]
+        do
+            echo "Keychain locked, waiting for a couple of seconds, or remove $HOME/lock-keychain to unblock..."
+            sleep 3
+        done
+
+        touch $HOME/lock-keychain
+
+        security default-keychain -s $keychainName
+
+        # Do the actual build
+        titanium build --config-file $TMPDIR/config.json --force --no-colors --platform ios --target ${if iosBuildStore then "dist-appstore" else "dist-adhoc"} --pp-uuid $provisioningId --distribution-name "${iosCertificateName}" --keychain $HOME/Library/Keychains/$keychainName-db --device-family universal --ios-version ${iosVersion} --output-dir $out
+
+        # Remove our generated keychain
+        ${deleteKeychain}
+      '' else ''
+        # Copy all sources to the output store directory.
+        # Why? Debug application include *.js files, which are symlinked into their
+        # sources. If they are not copied, we have dangling references to the
+        # temp folder.
+
+        cp -av * $out
+        cd $out
+
+        # Execute the build
+        titanium build --config-file $TMPDIR/config.json --force --no-colors --platform ios --target simulator --build-only --device-family universal --ios-version ${iosVersion} --output-dir $out
+
+        # Remove the modules symlink
+        if [ "$createdModulesSymlink" = "1" ]
+        then
+            rm $out/modules
+        fi
+      ''}
+    '' else throw "Target: ${target} is not supported!"}
   '';
-  
+
   installPhase = ''
-    mkdir -p $out
-    
-    ${if target == "android" && release then ""
-      else
-        if target == "android" then
-          ''cp "$(ls build/android/bin/*.apk | grep -v '\-unsigned.apk')" $out''
-        else if target == "iphone" && release then
-           ''
-             cp -av build/iphone/build/* $out
-             mkdir -p $out/nix-support
-             echo "file binary-dist \"$(echo $out/*.ipa)\"" > $out/nix-support/hydra-build-products
-             
-             ${stdenv.lib.optionalString enableWirelessDistribution ''
-               appname=$(basename $out/*.ipa .ipa)
-               bundleId=$(grep '<id>[a-zA-Z0-9.]*</id>' tiapp.xml | sed -e 's|<id>||' -e 's|</id>||' -e 's/ //g')
-               version=$(grep '<version>[a-zA-Z0-9.]*</version>' tiapp.xml | sed -e 's|<version>||' -e 's|</version>||' -e 's/ //g')
-               
-               sed -e "s|@INSTALL_URL@|${installURL}?bundleId=$bundleId\&amp;version=$version\&amp;title=$appname|" ${../xcodeenv/install.html.template} > "$out/$appname.html"
-               echo "doc install \"$out/$appname.html\"" >> $out/nix-support/hydra-build-products
-             ''}
-           ''
-        else if target == "iphone" then ""
-        else throw "Target: ${target} is not supported!"}
-    
     ${if target == "android" then ''
+      ${if release then ""
+      else ''
+        cp "$(ls build/android/bin/*.apk | grep -v '\-unsigned.apk')" $out
+      ''}
+
+      mkdir -p $out/nix-support
+      echo "file binary-dist \"$(ls $out/*.apk)\"" > $out/nix-support/hydra-build-products
+    ''
+    else if target == "iphone" then
+      if release then ''
         mkdir -p $out/nix-support
-        echo "file binary-dist \"$(ls $out/*.apk)\"" > $out/nix-support/hydra-build-products
-    '' else ""}
+        echo "file binary-dist \"$(echo $out/*.ipa)\"" > $out/nix-support/hydra-build-products
+
+        ${stdenv.lib.optionalString enableWirelessDistribution ''
+          appname="$(basename "$out/*.ipa" .ipa)"
+          bundleId=$(grep '<id>[a-zA-Z0-9.]*</id>' tiapp.xml | sed -e 's|<id>||' -e 's|</id>||' -e 's/ //g')
+          version=$(grep '<version>[a-zA-Z0-9.]*</version>' tiapp.xml | sed -e 's|<version>||' -e 's|</version>||' -e 's/ //g')
+
+          sed -e "s|@INSTALL_URL@|${installURL}?bundleId=$bundleId\&amp;version=$version\&amp;title=$appname|" ${../xcodeenv/install.html.template} > "$out/$appname.html"
+          echo "doc install \"$out/$appname.html\"" >> $out/nix-support/hydra-build-products
+        ''}
+      ''
+      else ""
+    else throw "Target: ${target} is not supported!"}
   '';
-  
+
   failureHook = stdenv.lib.optionalString (release && target == "iphone") deleteKeychain;
-}
+} // extraArgs)
diff --git a/pkgs/development/mobile/titaniumenv/default.nix b/pkgs/development/mobile/titaniumenv/default.nix
index f411a8d61fd..e9f6344680b 100644
--- a/pkgs/development/mobile/titaniumenv/default.nix
+++ b/pkgs/development/mobile/titaniumenv/default.nix
@@ -1,27 +1,19 @@
-{pkgs, xcodeVersion ? "9.2", xcodeBaseDir ? "/Applications/Xcode.app", tiVersion ? "7.1.0.GA"}:
+{pkgs, pkgs_i686, androidenv, xcodeenv, tiVersion ? "7.1.0.GA"}:
 
 rec {
-  androidenv = pkgs.androidenv;
-
-  xcodeenv = if pkgs.stdenv.hostPlatform.system == "x86_64-darwin" then pkgs.xcodeenv.override {
-    version = xcodeVersion;
-    inherit xcodeBaseDir;
-  } else null;
-  
   titaniumsdk = let
-    titaniumSdkFile = if tiVersion == "6.3.1.GA" then ./titaniumsdk-6.3.nix
-      else if tiVersion == "7.1.0.GA" then ./titaniumsdk-7.1.nix
+    titaniumSdkFile = if tiVersion == "7.1.0.GA" then ./titaniumsdk-7.1.nix
       else throw "Titanium version not supported: "+tiVersion;
     in
     import titaniumSdkFile {
-      inherit (pkgs) stdenv fetchurl unzip makeWrapper python jdk;
+      inherit (pkgs) stdenv fetchurl unzip makeWrapper;
     };
-  
+
   buildApp = import ./build-app.nix {
     inherit (pkgs) stdenv python which file jdk nodejs;
-    inherit (pkgs.nodePackages_6_x) alloy titanium;
-    inherit (androidenv) androidsdk;
-    inherit (xcodeenv) xcodewrapper;
-    inherit titaniumsdk xcodeBaseDir;
+    inherit (pkgs.nodePackages_8_x) alloy titanium;
+    inherit (androidenv) composeAndroidPackages;
+    inherit (xcodeenv) composeXcodeWrapper;
+    inherit titaniumsdk;
   };
 }
diff --git a/pkgs/development/mobile/titaniumenv/examples/default.nix b/pkgs/development/mobile/titaniumenv/examples/default.nix
deleted file mode 100644
index 78f91dd39fb..00000000000
--- a/pkgs/development/mobile/titaniumenv/examples/default.nix
+++ /dev/null
@@ -1,91 +0,0 @@
-{ nixpkgs ? <nixpkgs>
-, systems ? [ "x86_64-linux" "x86_64-darwin" ]
-, xcodeVersion ? "9.2"
-, xcodeBaseDir ? "/Applications/Xcode.app"
-, tiVersion ? "7.1.0.GA"
-, rename ? false
-, newBundleId ? "com.example.kitchensink", iosMobileProvisioningProfile ? null, iosCertificate ? null, iosCertificateName ? "Example", iosCertificatePassword ? "", iosVersion ? "11.2"
-, enableWirelessDistribution ? false, installURL ? null
-}:
-
-let
-  pkgs = import nixpkgs {};
-in
-rec {
-  kitchensink_android_debug = pkgs.lib.genAttrs systems (system:
-  let
-    pkgs = import nixpkgs { inherit system; };
-  in
-  import ./kitchensink {
-    inherit (pkgs) fetchgit;
-    titaniumenv = pkgs.titaniumenv.override { inherit xcodeVersion xcodeBaseDir tiVersion; };
-    inherit tiVersion;
-    target = "android";
-  });
-  
-  kitchensink_android_release = pkgs.lib.genAttrs systems (system:
-  let
-    pkgs = import nixpkgs { inherit system; };
-  in
-  import ./kitchensink {
-    inherit (pkgs) fetchgit;
-    titaniumenv = pkgs.titaniumenv.override { inherit xcodeVersion xcodeBaseDir tiVersion; };
-    inherit tiVersion;
-    target = "android";
-    release = true;
-  });
-  
-  emulate_kitchensink_debug = pkgs.lib.genAttrs systems (system:
-  let
-    pkgs = import nixpkgs { inherit system; };
-  in
-  import ./emulate-kitchensink {
-    inherit (pkgs) androidenv;
-    kitchensink = builtins.getAttr system kitchensink_android_debug;
-  });
-  
-  emulate_kitchensink_release = pkgs.lib.genAttrs systems (system:
-  let
-    pkgs = import nixpkgs { inherit system; };
-  in
-  import ./emulate-kitchensink {
-    inherit (pkgs) androidenv;
-    kitchensink = builtins.getAttr system kitchensink_android_release;
-  });
-  
-} // (if builtins.elem "x86_64-darwin" systems then 
-  let
-    pkgs = import nixpkgs { system = "x86_64-darwin"; };
-  in
-  rec {
-  kitchensink_ios_development = import ./kitchensink {
-    inherit (pkgs) fetchgit;
-    titaniumenv = pkgs.titaniumenv.override { inherit xcodeVersion xcodeBaseDir tiVersion; };
-    inherit tiVersion iosVersion;
-    target = "iphone";
-  };
-
-  simulate_kitchensink = import ./simulate-kitchensink {
-    inherit (pkgs) stdenv;
-    xcodeenv = pkgs.xcodeenv.override { version = xcodeVersion; inherit xcodeBaseDir; };
-    kitchensink = kitchensink_ios_development;
-    bundleId = if rename then newBundleId else "com.appcelerator.kitchensink";
-  };
-} else {}) // (if rename then
-  let
-    pkgs = import nixpkgs { system = "x86_64-darwin"; };
-  in
-  {
-    kitchensink_ipa = import ./kitchensink {
-      inherit (pkgs) stdenv fetchgit;
-      titaniumenv = pkgs.titaniumenv.override { inherit xcodeVersion xcodeBaseDir tiVersion; };
-      target = "iphone";
-      inherit tiVersion;
-      release = true;
-      rename = true;
-      inherit newBundleId iosMobileProvisioningProfile iosCertificate iosCertificateName iosCertificatePassword iosVersion;
-      inherit enableWirelessDistribution installURL;
-    };
-  }
-  
-else {})
diff --git a/pkgs/development/mobile/titaniumenv/examples/emulate-kitchensink/default.nix b/pkgs/development/mobile/titaniumenv/examples/emulate-kitchensink/default.nix
deleted file mode 100644
index cad4503dc96..00000000000
--- a/pkgs/development/mobile/titaniumenv/examples/emulate-kitchensink/default.nix
+++ /dev/null
@@ -1,10 +0,0 @@
-{androidenv, kitchensink}:
-
-androidenv.emulateApp {
-  name = "emulate-${kitchensink.name}";
-  app = kitchensink;
-  platformVersion = "16";
-  useGoogleAPIs = true;
-  package = "com.appcelerator.kitchensink";
-  activity = ".KitchensinkActivity";
-}
diff --git a/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix b/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix
deleted file mode 100644
index 70ab1b168c4..00000000000
--- a/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix
+++ /dev/null
@@ -1,44 +0,0 @@
-{ titaniumenv, fetchgit, target, androidPlatformVersions ? [ "25" "26" ], tiVersion ? "7.1.0.GA", release ? false
-, rename ? false, stdenv ? null, newBundleId ? null, iosMobileProvisioningProfile ? null, iosCertificate ? null, iosCertificateName ? null, iosCertificatePassword ? null, iosVersion ? "11.2"
-, enableWirelessDistribution ? false, installURL ? null
-}:
-
-assert rename -> (stdenv != null && newBundleId != null && iosMobileProvisioningProfile != null && iosCertificate != null && iosCertificateName != null && iosCertificatePassword != null);
-
-let
-  src = fetchgit {
-    url = https://github.com/appcelerator/kitchensink-v2.git;
-    rev = "94364df2ef60a80bd354a4273e3cb5f4c5185537";
-    sha256 = "0q4gzidpsq401frkngy4yk5kqvm8dz00ls74bw3fnpvg4714d6gf";
-  };
-
-  # Rename the bundle id to something else
-  renamedSrc = stdenv.mkDerivation {
-    name = "KitchenSink-renamedsrc";
-    inherit src;
-    buildPhase = ''
-      sed -i -e "s|com.appcelerator.kitchensink|${newBundleId}|" tiapp.xml
-    '';
-    installPhase = ''
-      mkdir -p $out
-      mv * $out
-    '';
-  };
-in
-titaniumenv.buildApp {
-  name = "KitchenSink-${target}-${if release then "release" else "debug"}";
-  src = if rename then renamedSrc else src;
-  preBuild = ''
-    sed -i -e "s|23|25|" tiapp.xml
-  ''; # Raise minimum android SDK from 23 to 25
-  inherit tiVersion;
-
-  inherit target androidPlatformVersions release;
-
-  androidKeyStore = ./keystore;
-  androidKeyAlias = "myfirstapp";
-  androidKeyStorePassword = "mykeystore";
-
-  inherit iosMobileProvisioningProfile iosCertificate iosCertificateName iosCertificatePassword iosVersion;
-  inherit enableWirelessDistribution installURL;
-}
diff --git a/pkgs/development/mobile/titaniumenv/examples/kitchensink/generatekeystore.sh b/pkgs/development/mobile/titaniumenv/examples/kitchensink/generatekeystore.sh
deleted file mode 100755
index 57451e8a507..00000000000
--- a/pkgs/development/mobile/titaniumenv/examples/kitchensink/generatekeystore.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh -e
-
-( echo "John Doe"
-  echo "My Company"
-  echo "My Organization"
-  echo "My City"
-  echo "My State"
-  echo "US"
-  echo "yes"
-) | keytool --genkeypair --alias myfirstapp --keystore ./keystore --storepass mykeystore
diff --git a/pkgs/development/mobile/titaniumenv/examples/kitchensink/keystore b/pkgs/development/mobile/titaniumenv/examples/kitchensink/keystore
deleted file mode 100644
index ee0a9c7989b..00000000000
--- a/pkgs/development/mobile/titaniumenv/examples/kitchensink/keystore
+++ /dev/null
Binary files differdiff --git a/pkgs/development/mobile/titaniumenv/examples/simulate-kitchensink/default.nix b/pkgs/development/mobile/titaniumenv/examples/simulate-kitchensink/default.nix
deleted file mode 100644
index bbd94cb7882..00000000000
--- a/pkgs/development/mobile/titaniumenv/examples/simulate-kitchensink/default.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{xcodeenv, kitchensink, bundleId}:
-
-xcodeenv.simulateApp {
-  name = "simulate-${kitchensink.name}";
-  inherit bundleId;
-  app = "${kitchensink}/build/iphone/build/Products/Debug-iphonesimulator";
-}
diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk-6.3.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-6.3.nix
deleted file mode 100644
index b8c2688708b..00000000000
--- a/pkgs/development/mobile/titaniumenv/titaniumsdk-6.3.nix
+++ /dev/null
@@ -1,43 +0,0 @@
-{stdenv, fetchurl, unzip, makeWrapper}:
-
-stdenv.mkDerivation {
-  name = "mobilesdk-6.3.1.GA";
-  src = if (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux") then fetchurl {
-    url = http://builds.appcelerator.com/mobile/6_3_X/mobilesdk-6.3.1.v20171101154403-linux.zip;
-    sha256 = "0g8dqqf5ffa7ll3rqm5naywipnv2vvfxcj9fmqg1wnvvxf0rflqj";
-  }
-  else if stdenv.hostPlatform.system == "x86_64-darwin" then fetchurl {
-    url = http://builds.appcelerator.com/mobile/6_3_X/mobilesdk-6.3.1.v20171101154403-osx.zip;
-    sha256 = "00bm8vv70mg4kd7jvmxd1bfqafv6zdpdx816i0hvf801zwnak4nj";
-  }
-  else throw "Platform: ${stdenv.hostPlatform.system} not supported!";
-  
-  buildInputs = [ unzip makeWrapper ];
-  
-  buildCommand = ''
-    mkdir -p $out
-    cd $out
-    (yes y | unzip $src) || true
-    
-    # Rename ugly version number
-    cd mobilesdk/*
-    mv * 6.3.1.GA
-    cd *
-    ${stdenv.lib.optionalString (stdenv.hostPlatform.system == "x86_64-darwin") ''
-      # Fixes a bad archive copying error when generating an IPA file
-      sed -i -e "s|cp -rf|/bin/cp -rf|" iphone/cli/commands/_build.js
-    ''}
-
-    # Patch some executables
-    
-    ${if stdenv.hostPlatform.system == "i686-linux" then
-      ''
-        patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 android/titanium_prep.linux32
-      ''
-      else if stdenv.hostPlatform.system == "x86_64-linux" then
-      ''
-        patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 android/titanium_prep.linux64
-      ''
-      else ""}
-  '';
-}
diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk-7.1.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-7.1.nix
index 4d3bd420969..13abc18f76e 100644
--- a/pkgs/development/mobile/titaniumenv/titaniumsdk-7.1.nix
+++ b/pkgs/development/mobile/titaniumenv/titaniumsdk-7.1.nix
@@ -35,7 +35,7 @@ let
     sha256 = "11nwdb9y84cghcx319nsjjf9m035s4s1184zrhzpvaxq2wvqhbhx";
   };
 
-  # Put the download plugins in a fake Maven repository
+  # Put the downloaded plugins in a fake Maven repository
   fakeMavenRepo = stdenv.mkDerivation {
     name = "fake-maven-repo";
     buildCommand = ''
@@ -54,15 +54,15 @@ let
 in
 stdenv.mkDerivation {
   name = "mobilesdk-7.1.0.GA";
-  src = if (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux") then fetchurl {
+  src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl {
     url = http://builds.appcelerator.com/mobile/7_1_X/mobilesdk-7.1.0.v20180314133955-linux.zip;
     sha256 = "18b3jnr65sdn5wj191bcl48gvhyklxmighxakv4vrz1fb59kyvqn";
   }
-  else if stdenv.hostPlatform.system == "x86_64-darwin" then fetchurl {
+  else if stdenv.system == "x86_64-darwin" then fetchurl {
     url = http://builds.appcelerator.com/mobile/7_1_X/mobilesdk-7.1.0.v20180314133955-osx.zip;
     sha256 = "1f62616biwsw1fqxz2sq7lpa6bsfjazffliplyf5dpnh298cnc1m";
   }
-  else throw "Platform: ${stdenv.hostPlatform.system} not supported!";
+  else throw "Platform: ${stdenv.system} not supported!";
 
   buildInputs = [ unzip makeWrapper ];
 
@@ -89,11 +89,11 @@ stdenv.mkDerivation {
 
     # Patch some executables
 
-    ${if stdenv.hostPlatform.system == "i686-linux" then
+    ${if stdenv.system == "i686-linux" then
       ''
         patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 android/titanium_prep.linux32
       ''
-      else if stdenv.hostPlatform.system == "x86_64-linux" then
+      else if stdenv.system == "x86_64-linux" then
       ''
         patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 android/titanium_prep.linux64
       ''