diff options
author | Sander van der Burg <svanderburg@gmail.com> | 2014-10-07 15:31:11 +0200 |
---|---|---|
committer | Sander van der Burg <svanderburg@gmail.com> | 2014-10-07 15:31:11 +0200 |
commit | 0a7449775d8bb34864040583d53cf7bec72d8415 (patch) | |
tree | b19b17e56d55e45221988357b7d85268ae4899b6 /pkgs/development/mobile | |
parent | 2b5a27c3d89d23b6a29029266b36a830a3e51e51 (diff) | |
download | nixlib-0a7449775d8bb34864040583d53cf7bec72d8415.tar nixlib-0a7449775d8bb34864040583d53cf7bec72d8415.tar.gz nixlib-0a7449775d8bb34864040583d53cf7bec72d8415.tar.bz2 nixlib-0a7449775d8bb34864040583d53cf7bec72d8415.tar.lz nixlib-0a7449775d8bb34864040583d53cf7bec72d8415.tar.xz nixlib-0a7449775d8bb34864040583d53cf7bec72d8415.tar.zst nixlib-0a7449775d8bb34864040583d53cf7bec72d8415.zip |
titaniumsdk: Add expression to 3.4.0 SDK
Diffstat (limited to 'pkgs/development/mobile')
-rw-r--r-- | pkgs/development/mobile/titaniumenv/titaniumsdk-3.4.nix | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk-3.4.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-3.4.nix new file mode 100644 index 000000000000..1baf57a94cfb --- /dev/null +++ b/pkgs/development/mobile/titaniumenv/titaniumsdk-3.4.nix @@ -0,0 +1,77 @@ +{stdenv, fetchurl, unzip, makeWrapper, python, jdk}: + +stdenv.mkDerivation { + name = "mobilesdk-3.4.0.GA"; + src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl { + url = http://builds.appcelerator.com/mobile/3.4.0/mobilesdk-3.4.0.GA-linux.zip; + sha1 = "c281a3a3f3af35adc95fc00dcd525b84516c2083"; + } + else if stdenv.system == "x86_64-darwin" then fetchurl { + url = http://builds.appcelerator.com/mobile/3.4.0/mobilesdk-3.4.0.GA-osx.zip; + sha1 = "2f10426462e5f8e487be83c8038f2934d5079f0d"; + } + 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.4.0.GA + + # 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 + ''; +} |