summary refs log tree commit diff
path: root/pkgs/development/mobile/titaniumenv
diff options
context:
space:
mode:
authorSander van der Burg <svanderburg@gmail.com>2014-07-15 16:46:59 +0200
committerSander van der Burg <svanderburg@gmail.com>2014-07-15 16:46:59 +0200
commita8e4abaf6fe6819ea57213bb63217f3992a2be64 (patch)
tree0c8d027ca8fb41ecf6f568bfde200870eebd0532 /pkgs/development/mobile/titaniumenv
parent1dc5e5fb8ca1dc7446bcfcf7c911a0a118ae6ab5 (diff)
downloadnixpkgs-a8e4abaf6fe6819ea57213bb63217f3992a2be64.tar
nixpkgs-a8e4abaf6fe6819ea57213bb63217f3992a2be64.tar.gz
nixpkgs-a8e4abaf6fe6819ea57213bb63217f3992a2be64.tar.bz2
nixpkgs-a8e4abaf6fe6819ea57213bb63217f3992a2be64.tar.lz
nixpkgs-a8e4abaf6fe6819ea57213bb63217f3992a2be64.tar.xz
nixpkgs-a8e4abaf6fe6819ea57213bb63217f3992a2be64.tar.zst
nixpkgs-a8e4abaf6fe6819ea57213bb63217f3992a2be64.zip
titaniumsdk: add version 3.3 SDK and update kitchensink example
Diffstat (limited to 'pkgs/development/mobile/titaniumenv')
-rw-r--r--pkgs/development/mobile/titaniumenv/default.nix1
-rw-r--r--pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix6
-rw-r--r--pkgs/development/mobile/titaniumenv/titaniumsdk-3.3.nix77
3 files changed, 81 insertions, 3 deletions
diff --git a/pkgs/development/mobile/titaniumenv/default.nix b/pkgs/development/mobile/titaniumenv/default.nix
index 9fceb1a0560..463a773537c 100644
--- a/pkgs/development/mobile/titaniumenv/default.nix
+++ b/pkgs/development/mobile/titaniumenv/default.nix
@@ -30,6 +30,7 @@ rec {
   titaniumsdk = let
     titaniumSdkFile = if tiVersion == "3.1.4.GA" then ./titaniumsdk-3.1.nix
       else if tiVersion == "3.2.3.GA" then ./titaniumsdk-3.2.nix
+      else if tiVersion == "3.3.0.RC2" then ./titaniumsdk-3.3.nix
       else throw "Titanium version not supported: "+tiVersion;
     in
     import titaniumSdkFile {
diff --git a/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix b/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix
index 95dd09be30d..1725c826a52 100644
--- a/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix
+++ b/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix
@@ -1,4 +1,4 @@
-{ titaniumenv, fetchgit, target, androidPlatformVersions ? [ "11" ], tiVersion ? "3.2.1.GA", release ? false
+{ titaniumenv, fetchgit, target, androidPlatformVersions ? [ "14" ], tiVersion ? "3.2.3.GA", release ? false
 , rename ? false, stdenv ? null, newBundleId ? null, iosMobileProvisioningProfile ? null, iosCertificate ? null, iosCertificateName ? null, iosCertificatePassword ? null
 }:
 
@@ -7,8 +7,8 @@ assert rename -> (stdenv != null && newBundleId != null && iosMobileProvisioning
 let
   src = fetchgit {
     url = https://github.com/appcelerator/KitchenSink.git;
-    rev = "0b8175f20f0aa71f93921025dec5d0f3299960ae";
-    sha256 = "0b2p4wbnlp46wpanqj5h3yfb2hdbh20nxbis8zscj4qlgrnyjdjz";
+    rev = "37d766ef9cba6a2d0b22634d3edc1fa8402109a0";
+    sha256 = "1d4x9zwq92p1krds52bd41qqsnsnb3a7x74bysbiphrvrphz80kk";
   };
   
   # Rename the bundle id to something else
diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk-3.3.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-3.3.nix
new file mode 100644
index 00000000000..641d83bb465
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/titaniumsdk-3.3.nix
@@ -0,0 +1,77 @@
+{stdenv, fetchurl, unzip, makeWrapper, python, jdk}:
+
+stdenv.mkDerivation {
+  name = "mobilesdk-3.3.0.RC2";
+  src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl {
+    url = http://builds.appcelerator.com/mobile/3.3.0/mobilesdk-3.3.0.RC2-linux.zip;
+    sha1 = "ad4d0003b81ffc5947c1961548ad4b8591aaec5b";
+  }
+  else if stdenv.system == "x86_64-darwin" then fetchurl {
+    url = http://builds.appcelerator.com/mobile/3.3.0/mobilesdk-3.3.0.RC2-osx.zip;
+    sha1 = "621080fdd48801bfec7113fef1f224caabf0d4dd";
+  }
+  else throw "Platform: ${stdenv.system} not supported!";
+  
+  buildInputs = [ unzip makeWrapper ];
+  
+  buildCommand = ''
+    mkdir -p $out
+    cd $out
+    yes y | unzip $src
+    
+    # Fix shebang header for python scripts
+    
+    find . -name \*.py | while read i
+    do
+        sed -i -e "s|#!/usr/bin/env python|#!${python}/bin/python|" $i
+    done
+   
+    # Rename ugly version number
+    cd mobilesdk/*
+    cd 3.3.0.RC2
+    
+    # Zip files do not support timestamps lower than 1980. We have to apply a few work-arounds to cope with that
+    # Yes, I know it's nasty :-)
+    
+    cd android
+    
+    sed -i -f ${./fixtiverify.sed} builder.py
+    sed -i -f ${./fixtiprofiler.sed} builder.py
+    sed -i -f ${./fixso.sed} builder.py
+    sed -i -f ${./fixnativelibs.sed} builder.py
+    
+    # Patch some executables
+    
+    ${if stdenv.system == "i686-linux" then
+      ''
+        patchelf --set-interpreter ${stdenv.gcc.libc}/lib/ld-linux.so.2 titanium_prep.linux32
+      ''
+      else if stdenv.system == "x86_64-linux" then
+      ''
+        patchelf --set-interpreter ${stdenv.gcc.libc}/lib/ld-linux-x86-64.so.2 titanium_prep.linux64
+      ''
+      else ""}
+    
+    # Wrap builder script
+    
+    mv builder.py .builder.py
+    cat > builder.py <<EOF
+    #!${python}/bin/python
+    
+    import os, sys
+    
+    os.environ['PYTHONPATH'] = '$(echo ${python.modules.sqlite3}/lib/python*/site-packages)'
+    os.environ['JAVA_HOME'] = '${if stdenv.system == "x86_64-darwin" then jdk else "${jdk}/lib/openjdk"}'
+    
+    os.execv('$(pwd)/.builder.py', sys.argv)
+    EOF
+    
+    chmod +x builder.py
+    
+  '' + stdenv.lib.optionalString (stdenv.system == "x86_64-darwin") ''
+    # 'ditto' utility is needed to copy stuff to the Xcode organizer. Dirty, but this allows it to work.
+    sed -i -e "s|ditto|/usr/bin/ditto|g" $out/mobilesdk/osx/*/iphone/builder.py
+    
+    sed -i -e "s|--xcode|--xcode '+process.env['NIX_TITANIUM_WORKAROUND']+'|" $out/mobilesdk/osx/*/iphone/cli/commands/_build.js
+  '';
+}