2015-05-19 15:25:28 +01:00
|
|
|
{pkgs, pkgs_i686, xcodeVersion ? "6.1.1", xcodeBaseDir ? "/Applications/Xcode.app", tiVersion ? "3.5.1.GA"}:
|
2013-01-07 17:22:10 +00:00
|
|
|
|
2014-01-21 16:19:26 +00:00
|
|
|
let
|
|
|
|
# We have to use Oracle's JDK. On Darwin, just simply expose the host system's
|
|
|
|
# JDK. According to their docs, OpenJDK is not supported.
|
|
|
|
|
|
|
|
jdkWrapper = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "jdk-wrapper";
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cd $out/bin
|
|
|
|
ln -s /usr/bin/javac
|
|
|
|
ln -s /usr/bin/java
|
|
|
|
ln -s /usr/bin/jarsigner
|
|
|
|
ln -s /usr/bin/jar
|
|
|
|
ln -s /usr/bin/keytool
|
|
|
|
'';
|
|
|
|
setupHook = ''
|
|
|
|
export JAVA_HOME=/usr
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
2013-01-07 17:22:10 +00:00
|
|
|
rec {
|
|
|
|
androidenv = pkgs.androidenv;
|
|
|
|
|
2014-01-13 13:24:48 +00:00
|
|
|
xcodeenv = if pkgs.stdenv.system == "x86_64-darwin" then pkgs.xcodeenv.override {
|
|
|
|
version = xcodeVersion;
|
2014-10-07 17:13:52 +01:00
|
|
|
inherit xcodeBaseDir;
|
2014-01-13 13:24:48 +00:00
|
|
|
} else null;
|
2013-04-16 13:08:37 +01:00
|
|
|
|
2014-02-18 15:34:34 +00:00
|
|
|
titaniumsdk = let
|
|
|
|
titaniumSdkFile = if tiVersion == "3.1.4.GA" then ./titaniumsdk-3.1.nix
|
2014-07-15 15:05:25 +01:00
|
|
|
else if tiVersion == "3.2.3.GA" then ./titaniumsdk-3.2.nix
|
2014-07-18 15:59:03 +01:00
|
|
|
else if tiVersion == "3.3.0.GA" then ./titaniumsdk-3.3.nix
|
2014-10-07 14:29:58 +01:00
|
|
|
else if tiVersion == "3.4.0.GA" then ./titaniumsdk-3.4.nix
|
2015-05-19 15:25:28 +01:00
|
|
|
else if tiVersion == "3.5.1.GA" then ./titaniumsdk-3.5.nix
|
2014-02-18 15:34:34 +00:00
|
|
|
else throw "Titanium version not supported: "+tiVersion;
|
|
|
|
in
|
|
|
|
import titaniumSdkFile {
|
|
|
|
inherit (pkgs) stdenv fetchurl unzip makeWrapper python jdk;
|
|
|
|
};
|
2013-01-07 17:22:10 +00:00
|
|
|
|
|
|
|
buildApp = import ./build-app.nix {
|
2014-02-18 15:34:34 +00:00
|
|
|
inherit (pkgs) stdenv python which;
|
2014-01-21 16:19:26 +00:00
|
|
|
jdk = if pkgs.stdenv.isLinux then pkgs.oraclejdk7
|
|
|
|
else if pkgs.stdenv.isDarwin then jdkWrapper
|
|
|
|
else throw "Platform not supported: ${pkgs.stdenv.system}";
|
|
|
|
inherit (pkgs.nodePackages) titanium;
|
2013-01-07 17:22:10 +00:00
|
|
|
inherit (androidenv) androidsdk;
|
|
|
|
inherit (xcodeenv) xcodewrapper;
|
2014-10-14 13:57:11 +01:00
|
|
|
inherit titaniumsdk xcodeBaseDir;
|
2013-01-07 17:22:10 +00:00
|
|
|
};
|
|
|
|
}
|