diff --git a/pkgs/development/mobile/titaniumenv/default.nix b/pkgs/development/mobile/titaniumenv/default.nix index b7b5a048b978..f3d2d7dda96f 100644 --- a/pkgs/development/mobile/titaniumenv/default.nix +++ b/pkgs/development/mobile/titaniumenv/default.nix @@ -1,19 +1,11 @@ -{pkgs, pkgs_i686, version ? "3.1"}: +{pkgs, pkgs_i686}: -let - titaniumexpr = if version == "2.1" then - ./titaniumsdk-2.1.nix - else if version == "3.1" then - ./titaniumsdk.nix - else - throw "Unknown Titanium SDK version: ${version}"; -in rec { androidenv = pkgs.androidenv; xcodeenv = if pkgs.stdenv.system == "x86_64-darwin" then pkgs.xcodeenv else null; - titaniumsdk = import titaniumexpr { + titaniumsdk = import ./titaniumsdk.nix { inherit (pkgs) stdenv fetchurl unzip makeWrapper python jdk; }; diff --git a/pkgs/development/mobile/titaniumenv/fixselfruntimev8.sed b/pkgs/development/mobile/titaniumenv/fixselfruntimev8.sed deleted file mode 100644 index c849aaa611c6..000000000000 --- a/pkgs/development/mobile/titaniumenv/fixselfruntimev8.sed +++ /dev/null @@ -1 +0,0 @@ -s|apk_zip.write(os.path.join(lib_source_dir, fname), lib_dest_dir + fname)|info = zipfile.ZipInfo(lib_dest_dir + fname)\n\t\t\t\t\tinfo.compress_type = zipfile.ZIP_DEFLATED\n\t\t\t\t\tinfo.create_system = 3\n\t\t\t\t\tf = open(os.path.join(lib_source_dir, fname))\n\t\t\t\t\tapk_zip.writestr(info, f.read())\n\t\t\t\t\tf.close()| diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk-2.1.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-2.1.nix deleted file mode 100644 index 414b444fb46d..000000000000 --- a/pkgs/development/mobile/titaniumenv/titaniumsdk-2.1.nix +++ /dev/null @@ -1,60 +0,0 @@ -{stdenv, fetchurl, unzip, makeWrapper, python, jdk}: - -stdenv.mkDerivation { - name = "titanium-mobilesdk-2.1.4.v20121109124659"; - src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl { - url = http://builds.appcelerator.com.s3.amazonaws.com/mobile/2_1_X/mobilesdk-2.1.4.v20121109124659-linux.zip; - sha1 = "381eb4b06b5a261ddf336c52d4714e5626142697"; - } - else if stdenv.system == "x86_64-darwin" then fetchurl { - url = http://builds.appcelerator.com.s3.amazonaws.com/mobile/2_1_X/mobilesdk-2.1.4.v20121109124659-osx.zip; - sha1 = "1cef5803f0c7b7bb35feb88d3f91bbb191e3953e"; - } - 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 - - # 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 mobilesdk/*/*/android - - sed -i -f ${./fixtiverify.sed} builder.py - sed -i -f ${./fixselfruntimev8.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 - - wrapProgram `pwd`/builder.py \ - --prefix PYTHONPATH : ${python.modules.sqlite3}/lib/python*/site-packages \ - --prefix PATH : ${jdk}/bin \ - --prefix JAVA_HOME : ${jdk} - '' + 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 - ''; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 662027059c85..f86210fecc91 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -483,19 +483,11 @@ let xcodeenv = callPackage ../development/mobile/xcodeenv { }; - titaniumenv_2_1 = import ../development/mobile/titaniumenv { - inherit pkgs; - pkgs_i686 = pkgsi686Linux; - version = "2.1"; - }; - - titaniumenv_3_1 = import ../development/mobile/titaniumenv { + titaniumenv = import ../development/mobile/titaniumenv { inherit pkgs; pkgs_i686 = pkgsi686Linux; }; - titaniumenv = titaniumenv_3_1; - inherit (androidenv) androidsdk_4_1; aria = builderDefsPackage (import ../tools/networking/aria) { };