From fb346c34023bc30f43ac14e7d7da25be48dcf4f4 Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Fri, 5 Jan 2018 12:34:03 +0100 Subject: [PATCH] titaniumenv: upgrade to 6.3 and remove deprecated old versions --- .../mobile/titaniumenv/build-app.nix | 16 +++---- .../mobile/titaniumenv/default.nix | 8 ++-- .../mobile/titaniumenv/examples/default.nix | 6 +-- .../examples/kitchensink/default.nix | 17 ++++---- .../mobile/titaniumenv/titaniumsdk-5.1.nix | 42 ------------------- .../mobile/titaniumenv/titaniumsdk-5.2.nix | 42 ------------------- ...itaniumsdk-6.0.nix => titaniumsdk-6.3.nix} | 12 +++--- 7 files changed, 31 insertions(+), 112 deletions(-) delete mode 100644 pkgs/development/mobile/titaniumenv/titaniumsdk-5.1.nix delete mode 100644 pkgs/development/mobile/titaniumenv/titaniumsdk-5.2.nix rename pkgs/development/mobile/titaniumenv/{titaniumsdk-6.0.nix => titaniumsdk-6.3.nix} (70%) diff --git a/pkgs/development/mobile/titaniumenv/build-app.nix b/pkgs/development/mobile/titaniumenv/build-app.nix index 0c9c3e3f42ca..96ffaa00f9a4 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 +{stdenv, androidsdk, titaniumsdk, titanium, alloy, xcodewrapper, jdk, python, nodejs, which, file, xcodeBaseDir}: +{ name, src, preBuild ? "", target, androidPlatformVersions ? [ "25" ], androidAbiVersions ? [ "armeabi" "armeabi-v7a" ], tiVersion ? null , release ? false, androidKeyStore ? null, androidKeyAlias ? null, androidKeyStorePassword ? null -, iosMobileProvisioningProfile ? null, iosCertificateName ? null, iosCertificate ? null, iosCertificatePassword ? null, iosVersion ? "10.2" +, iosMobileProvisioningProfile ? null, iosCertificateName ? null, iosCertificate ? null, iosCertificatePassword ? null, iosVersion ? "11.2" , enableWirelessDistribution ? false, installURL ? null }: @@ -47,9 +47,11 @@ stdenv.mkDerivation { name = stdenv.lib.replaceChars [" "] [""] name; inherit src; - buildInputs = [ nodejs titanium alloy jdk python which ] ++ stdenv.lib.optional (stdenv.system == "x86_64-darwin") xcodewrapper; + buildInputs = [ nodejs titanium alloy jdk python which file ] ++ stdenv.lib.optional (stdenv.system == "x86_64-darwin") xcodewrapper; buildPhase = '' + ${preBuild} + export HOME=$TMPDIR ${stdenv.lib.optionalString (tiVersion != null) '' @@ -77,9 +79,9 @@ stdenv.mkDerivation { export JAVA_HOME=${javaVersionFixWrapper} javac -version ''} - - titanium config --config-file $TMPDIR/config.json --no-colors android.sdk ${androidsdkComposition}/libexec - + + 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 ${if release then diff --git a/pkgs/development/mobile/titaniumenv/default.nix b/pkgs/development/mobile/titaniumenv/default.nix index 6ca4c441e640..af3fe3592db3 100644 --- a/pkgs/development/mobile/titaniumenv/default.nix +++ b/pkgs/development/mobile/titaniumenv/default.nix @@ -9,9 +9,7 @@ rec { } else null; titaniumsdk = let - titaniumSdkFile = if tiVersion == "5.1.2.GA" then ./titaniumsdk-5.1.nix - else if tiVersion == "5.2.3.GA" then ./titaniumsdk-5.2.nix - else if tiVersion == "6.0.2.GA" then ./titaniumsdk-6.0.nix + titaniumSdkFile = if tiVersion == "6.3.1.GA" then ./titaniumsdk-6.3.nix else throw "Titanium version not supported: "+tiVersion; in import titaniumSdkFile { @@ -19,8 +17,8 @@ rec { }; buildApp = import ./build-app.nix { - inherit (pkgs) stdenv python which jdk nodejs; - inherit (pkgs.nodePackages_4_x) titanium alloy; + inherit (pkgs) stdenv python which file jdk nodejs; + inherit (pkgs.nodePackages_6_x) alloy titanium; inherit (androidenv) androidsdk; inherit (xcodeenv) xcodewrapper; inherit titaniumsdk xcodeBaseDir; diff --git a/pkgs/development/mobile/titaniumenv/examples/default.nix b/pkgs/development/mobile/titaniumenv/examples/default.nix index 3c5d3a018ec8..5753c8d7da97 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 ? "8.2.1" +, xcodeVersion ? "9.2" , xcodeBaseDir ? "/Applications/Xcode.app" -, tiVersion ? "6.0.2.GA" +, tiVersion ? "6.3.1.GA" , rename ? false -, newBundleId ? "com.example.kitchensink", iosMobileProvisioningProfile ? null, iosCertificate ? null, iosCertificateName ? "Example", iosCertificatePassword ? "", iosVersion ? "10.2" +, newBundleId ? "com.example.kitchensink", iosMobileProvisioningProfile ? null, iosCertificate ? null, iosCertificateName ? "Example", iosCertificatePassword ? "", iosVersion ? "11.2" , enableWirelessDistribution ? false, installURL ? null }: diff --git a/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix b/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix index 4abf650ebee1..5849ee368c1b 100644 --- a/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix +++ b/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix @@ -1,5 +1,5 @@ -{ titaniumenv, fetchgit, target, androidPlatformVersions ? [ "23" ], tiVersion ? "5.1.2.GA", release ? false -, rename ? false, stdenv ? null, newBundleId ? null, iosMobileProvisioningProfile ? null, iosCertificate ? null, iosCertificateName ? null, iosCertificatePassword ? null, iosVersion ? "8.1" +{ titaniumenv, fetchgit, target, androidPlatformVersions ? [ "25" "26" ], tiVersion ? "6.3.1.GA", release ? false +, rename ? false, stdenv ? null, newBundleId ? null, iosMobileProvisioningProfile ? null, iosCertificate ? null, iosCertificateName ? null, iosCertificatePassword ? null, iosVersion ? "11.2" , enableWirelessDistribution ? false, installURL ? null }: @@ -9,9 +9,9 @@ let src = fetchgit { url = https://github.com/appcelerator/KitchenSink.git; rev = "ec9edebf35030f61368000a8a9071dd7a0773884"; - sha256 = "1j41w4nhcbl40x550pjgabqrach80f9dybv7ya32771wnw2000iy"; + sha256 = "3e020004b73c9c2386f2672fdf9203083295f1524f5e504a07842e062de181c8"; }; - + # Rename the bundle id to something else renamedSrc = stdenv.mkDerivation { name = "KitchenSink-renamedsrc"; @@ -29,14 +29,17 @@ 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/titaniumsdk-5.1.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-5.1.nix deleted file mode 100644 index 670e55e0f304..000000000000 --- a/pkgs/development/mobile/titaniumenv/titaniumsdk-5.1.nix +++ /dev/null @@ -1,42 +0,0 @@ -{stdenv, fetchurl, unzip, makeWrapper, python, jdk}: - -stdenv.mkDerivation { - name = "mobilesdk-5.1.2.GA"; - src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl { - url = http://builds.appcelerator.com/mobile/5_1_X/mobilesdk-5.1.2.v20151216190036-linux.zip; - sha256 = "013ipqwkfqj60mn09jbbf6a9mc4pjrn0kr0ix906whzb888zz6bv"; - } - else if stdenv.system == "x86_64-darwin" then fetchurl { - url = http://builds.appcelerator.com/mobile/5_1_X/mobilesdk-5.1.2.v20151216190036-osx.zip; - sha256 = "1ylwh7zxa5yfyckzn3a9zc4cmh8gdndgb3jyr61s3j7zb1whn9ww"; - } - else throw "Platform: ${stdenv.system} not supported!"; - - buildInputs = [ unzip makeWrapper ]; - - buildCommand = '' - mkdir -p $out - cd $out - (yes y | unzip $src) || true - - # Rename ugly version number - cd mobilesdk/* - mv * 5.1.2.GA - cd * - - # Hack to make dx.jar work with new build-tools - sed -i -e "s|path.join(dir, 'platform-tools', 'lib', 'dx.jar')|path.join(dir, 'build-tools', 'android-6.0', 'lib', 'dx.jar')|" $out/mobilesdk/*/*/node_modules/titanium-sdk/lib/android.js - - # Patch some executables - - ${if stdenv.system == "i686-linux" then - '' - patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 android/titanium_prep.linux32 - '' - 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 - '' - else ""} - ''; -} diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk-5.2.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-5.2.nix deleted file mode 100644 index 511e8f0301b2..000000000000 --- a/pkgs/development/mobile/titaniumenv/titaniumsdk-5.2.nix +++ /dev/null @@ -1,42 +0,0 @@ -{stdenv, fetchurl, unzip, makeWrapper, python, jdk}: - -stdenv.mkDerivation { - name = "mobilesdk-5.2.3.GA"; - src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl { - url = http://builds.appcelerator.com/mobile/5_2_X/mobilesdk-5.2.3.v20160404160237-linux.zip; - sha256 = "1acvkj3nrkgf9ch4js0pnjnwq5x6ddc15pkcanshp1zlc41z16gj"; - } - else if stdenv.system == "x86_64-darwin" then fetchurl { - url = http://builds.appcelerator.com/mobile/5_2_X/mobilesdk-5.2.3.v20160404160237-osx.zip; - sha256 = "04l7mrwiy3il2kzxz6sbfmczkqlkcrnwwndfzi8h5dzgh1672b7d"; - } - else throw "Platform: ${stdenv.system} not supported!"; - - buildInputs = [ unzip makeWrapper ]; - - buildCommand = '' - mkdir -p $out - cd $out - (yes y | unzip $src) || true - - # Rename ugly version number - cd mobilesdk/* - mv * 5.2.3.GA - cd * - - # Hack to make dx.jar work with new build-tools - #sed -i -e "s|path.join(dir, 'platform-tools', 'lib', 'dx.jar')|path.join(dir, 'build-tools', 'android-6.0', 'lib', 'dx.jar')|" $out/mobilesdk/*/*/node_modules/titanium-sdk/lib/android.js - - # Patch some executables - - ${if stdenv.system == "i686-linux" then - '' - patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 android/titanium_prep.linux32 - '' - 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 - '' - else ""} - ''; -} diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk-6.0.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-6.3.nix similarity index 70% rename from pkgs/development/mobile/titaniumenv/titaniumsdk-6.0.nix rename to pkgs/development/mobile/titaniumenv/titaniumsdk-6.3.nix index fdaaff394534..fac8af2b6f7e 100644 --- a/pkgs/development/mobile/titaniumenv/titaniumsdk-6.0.nix +++ b/pkgs/development/mobile/titaniumenv/titaniumsdk-6.3.nix @@ -1,14 +1,14 @@ {stdenv, fetchurl, unzip, makeWrapper, python, jdk}: stdenv.mkDerivation { - name = "mobilesdk-6.0.2.GA"; + name = "mobilesdk-6.3.1.GA"; src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl { - url = http://builds.appcelerator.com/mobile/6_0_X/mobilesdk-6.0.2.v20170123140026-linux.zip; - sha256 = "1yjhr4fgjnxfxzwmgw71yynrfzhsjqj2cirjr5rd14zlp4q9751q"; + url = http://builds.appcelerator.com/mobile/6_3_X/mobilesdk-6.3.1.v20171101154403-linux.zip; + sha256 = "0g8dqqf5ffa7ll3rqm5naywipnv2vvfxcj9fmqg1wnvvxf0rflqj"; } else if stdenv.system == "x86_64-darwin" then fetchurl { - url = http://builds.appcelerator.com/mobile/6_0_X/mobilesdk-6.0.2.v20170123140026-osx.zip; - sha256 = "1ijd1wp56ygy238xpcffy112akim208wbv5zm901dvych83ibw1c"; + url = http://builds.appcelerator.com/mobile/6_3_X/mobilesdk-6.3.1.v20171101154403-osx.zip; + sha256 = "00bm8vv70mg4kd7jvmxd1bfqafv6zdpdx816i0hvf801zwnak4nj"; } else throw "Platform: ${stdenv.system} not supported!"; @@ -21,7 +21,7 @@ stdenv.mkDerivation { # Rename ugly version number cd mobilesdk/* - mv * 6.0.2.GA + mv * 6.3.1.GA cd * # Patch some executables