git.iko.soy/typeable/nixpkgs
on master help sign in
titaniumenv: fix android builds on darwin and get rid of allowUnfree since the OpenJDK just works fine
commit4d0e732168d1747f2d01fac74d70b7f112a247f4 authorSander van der Burg <svanderburg@gmail.com> dateMon 1 Feb 2016, 15:11 (11 years ago) parent0c5ad78
2 files changed+35−7
pkgs/development/mobile/titaniumenv/build-app.nix+29 pkgs/development/mobile/titaniumenv/examples/default.nix+6−7
pkgs/development/mobile/titaniumenv/build-app.nix+29
@@ -20,6 +20,28 @@ let
2020 security default-keychain -s login.keychain
2121 security delete-keychain $keychainName
2222 '';
23+
24+ # On Mac OS X, the java executable shows an -unoffical postfix in the version
25+ # number. This confuses the build script's version detector.
26+ # We fix this by creating a wrapper that strips it out of the output.
27+
28+ javaVersionFixWrapper = stdenv.mkDerivation {
29+ name = "javaVersionFixWrapper";
30+ buildCommand = ''
31+ mkdir -p $out/bin
32+ cat > $out/bin/javac <<EOF
33+ #! ${stdenv.shell} -e
34+
35+ if [ "\$1" = "-version" ]
36+ then
37+ ${jdk}/bin/javac "\$@" 2>&1 | sed "s|-unofficial||" | sed "s|-u60|_60|" >&2
38+ else
39+ exec ${jdk}/bin/javac "\$@"
40+ fi
41+ EOF
42+ chmod +x $out/bin/javac
43+ '';
44+ };
2345in
2446stdenv.mkDerivation {
2547 name = stdenv.lib.replaceChars [" "] [""] name;
@@ -49,6 +71,13 @@ stdenv.mkDerivation {
4971
5072 ${if target == "android" then
5173 ''
74+ ${stdenv.lib.optionalString (stdenv.system == "x86_64-darwin") ''
75+ # Hack to make version detection work with OpenJDK on Mac OS X
76+ export PATH=${javaVersionFixWrapper}/bin:$PATH
77+ export JAVA_HOME=${javaVersionFixWrapper}
78+ javac -version
79+ ''}
80+
5281 titanium config --config-file $TMPDIR/config.json --no-colors android.sdk ${androidsdkComposition}/libexec/android-sdk-*
5382 titanium config --config-file $TMPDIR/config.json --no-colors android.buildTools.selectedVersion 23.0.1
5483
pkgs/development/mobile/titaniumenv/examples/default.nix+6−7
@@ -5,17 +5,16 @@
55, tiVersion ? "5.1.2.GA"
66, rename ? false
77, newBundleId ? "com.example.kitchensink", iosMobileProvisioningProfile ? null, iosCertificate ? null, iosCertificateName ? "Example", iosCertificatePassword ? "", iosVersion ? "9.2"
8−, allowUnfree ? false
98, enableWirelessDistribution ? false, installURL ? null
109}:
1110
1211let
13− pkgs = import nixpkgs { config.allowUnfree = allowUnfree; };
12+ pkgs = import nixpkgs {};
1413in
1514rec {
1615 kitchensink_android_debug = pkgs.lib.genAttrs systems (system:
1716 let
18− pkgs = import nixpkgs { inherit system; config.allowUnfree = allowUnfree; };
17+ pkgs = import nixpkgs { inherit system; };
1918 in
2019 import ./kitchensink {
2120 inherit (pkgs) fetchgit;
@@ -26,7 +25,7 @@ rec {
2625
2726 kitchensink_android_release = pkgs.lib.genAttrs systems (system:
2827 let
29− pkgs = import nixpkgs { inherit system; config.allowUnfree = allowUnfree; };
28+ pkgs = import nixpkgs { inherit system; };
3029 in
3130 import ./kitchensink {
3231 inherit (pkgs) fetchgit;
@@ -38,7 +37,7 @@ rec {
3837
3938 emulate_kitchensink_debug = pkgs.lib.genAttrs systems (system:
4039 let
41− pkgs = import nixpkgs { inherit system; config.allowUnfree = allowUnfree; };
40+ pkgs = import nixpkgs { inherit system; };
4241 in
4342 import ./emulate-kitchensink {
4443 inherit (pkgs) androidenv;
@@ -47,7 +46,7 @@ rec {
4746
4847 emulate_kitchensink_release = pkgs.lib.genAttrs systems (system:
4948 let
50− pkgs = import nixpkgs { inherit system; config.allowUnfree = allowUnfree; };
49+ pkgs = import nixpkgs { inherit system; };
5150 in
5251 import ./emulate-kitchensink {
5352 inherit (pkgs) androidenv;
@@ -74,7 +73,7 @@ rec {
7473 };
7574} else {}) // (if rename then
7675 let
77− pkgs = import nixpkgs { system = "x86_64-darwin"; config.allowUnfree = allowUnfree; };
76+ pkgs = import nixpkgs { system = "x86_64-darwin"; };
7877 in
7978 {
8079 kitchensink_ipa = import ./kitchensink {