Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 824d6d73dbd4
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4fcf69f9eca4
Choose a head ref
  • 2 commits
  • 5 files changed
  • 1 contributor

Commits on Mar 20, 2018

  1. titaniumenv: add 7.1 SDK and make it the default

    (cherry picked from commit e8e7e78)
    svanderburg committed Mar 20, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    NeQuissimus Tim Steinbach
    Copy the full SHA
    8968f68 View commit details
  2. titaniumenv: remove obsolete java fix wrapper on darwin

    (cherry picked from commit 5532cc1)
    svanderburg committed Mar 20, 2018
    Copy the full SHA
    4fcf69f View commit details
36 changes: 4 additions & 32 deletions pkgs/development/mobile/titaniumenv/build-app.nix
Original file line number Diff line number Diff line change
@@ -15,39 +15,17 @@ let
abiVersions = androidAbiVersions;
useGoogleAPIs = true;
};

deleteKeychain = ''
security default-keychain -s login.keychain
security delete-keychain $keychainName
rm -f $HOME/lock-keychain
'';

# On macOS, the java executable shows an -unoffical postfix in the version
# number. This confuses the build script's version detector.
# We fix this by creating a wrapper that strips it out of the output.

javaVersionFixWrapper = stdenv.mkDerivation {
name = "javaVersionFixWrapper";
buildCommand = ''
mkdir -p $out/bin
cat > $out/bin/javac <<EOF
#! ${stdenv.shell} -e
if [ "\$1" = "-version" ]
then
${jdk}/bin/javac "\$@" 2>&1 | sed "s|-unofficial||" | sed "s|-u60|_60|" >&2
else
exec ${jdk}/bin/javac "\$@"
fi
EOF
chmod +x $out/bin/javac
'';
};
in
stdenv.mkDerivation {
name = stdenv.lib.replaceChars [" "] [""] name;
inherit src;

buildInputs = [ nodejs titanium alloy jdk python which file ] ++ stdenv.lib.optional (stdenv.system == "x86_64-darwin") xcodewrapper;

buildPhase = ''
@@ -74,17 +52,11 @@ stdenv.mkDerivation {
${if target == "android" then
''
${stdenv.lib.optionalString (stdenv.system == "x86_64-darwin") ''
# Hack to make version detection work with OpenJDK on macOS
export PATH=${javaVersionFixWrapper}/bin:$PATH
export JAVA_HOME=${javaVersionFixWrapper}
javac -version
''}
titanium config --config-file $TMPDIR/config.json --no-colors android.sdkPath ${androidsdkComposition}/libexec
export PATH=$(echo ${androidsdkComposition}/libexec/tools):$(echo ${androidsdkComposition}/libexec/build-tools/android-*):$PATH
export GRADLE_USER_HOME=$TMPDIR/gradle
${if release then
''titanium build --config-file $TMPDIR/config.json --no-colors --force --platform android --target dist-playstore --keystore ${androidKeyStore} --alias ${androidKeyAlias} --store-password ${androidKeyStorePassword} --output-dir $out''
else
3 changes: 2 additions & 1 deletion pkgs/development/mobile/titaniumenv/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{pkgs, pkgs_i686, xcodeVersion ? "9.2", xcodeBaseDir ? "/Applications/Xcode.app", tiVersion ? "6.3.1.GA"}:
{pkgs, pkgs_i686, xcodeVersion ? "9.2", xcodeBaseDir ? "/Applications/Xcode.app", tiVersion ? "7.1.0.GA"}:

rec {
androidenv = pkgs.androidenv;
@@ -10,6 +10,7 @@ rec {

titaniumsdk = let
titaniumSdkFile = if tiVersion == "6.3.1.GA" then ./titaniumsdk-6.3.nix
else if tiVersion == "7.1.0.GA" then ./titaniumsdk-7.1.nix
else throw "Titanium version not supported: "+tiVersion;
in
import titaniumSdkFile {
2 changes: 1 addition & 1 deletion pkgs/development/mobile/titaniumenv/examples/default.nix
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
, systems ? [ "x86_64-linux" "x86_64-darwin" ]
, xcodeVersion ? "9.2"
, xcodeBaseDir ? "/Applications/Xcode.app"
, tiVersion ? "6.3.1.GA"
, tiVersion ? "7.1.0.GA"
, rename ? false
, newBundleId ? "com.example.kitchensink", iosMobileProvisioningProfile ? null, iosCertificate ? null, iosCertificateName ? "Example", iosCertificatePassword ? "", iosVersion ? "11.2"
, enableWirelessDistribution ? false, installURL ? null
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ titaniumenv, fetchgit, target, androidPlatformVersions ? [ "25" "26" ], tiVersion ? "6.3.1.GA", release ? false
{ titaniumenv, fetchgit, target, androidPlatformVersions ? [ "25" "26" ], tiVersion ? "7.1.0.GA", release ? false
, rename ? false, stdenv ? null, newBundleId ? null, iosMobileProvisioningProfile ? null, iosCertificate ? null, iosCertificateName ? null, iosCertificatePassword ? null, iosVersion ? "11.2"
, enableWirelessDistribution ? false, installURL ? null
}:
102 changes: 102 additions & 0 deletions pkgs/development/mobile/titaniumenv/titaniumsdk-7.1.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{stdenv, fetchurl, unzip, makeWrapper, python, jdk}:

let
# Gradle is a build system that bootstraps itself. This is what it actually
# downloads in the bootstrap phase.
gradleAllZip = fetchurl {
url = http://services.gradle.org/distributions/gradle-4.1-all.zip;
sha256 = "1rcrh263vq7a0is800y5z36jj97p67c6zpqzzfcbr7r0qaxb61sw";
};

# A Titanium-Android build requires proguard plugins. We create a fake
# repository so that Gradle does not attempt to download them in the builder.
# Since there are only 3 plugins required, this is still (sort of) manageable
# without a generator.
proguardVersion = "5.3.3";

proguardGradlePOM = fetchurl {
url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-gradle/${proguardVersion}/proguard-gradle-${proguardVersion}.pom";
sha256 = "03v9zm3ykfkyb5cs5ald07ph103fh68d5c33rv070r29p71dwszj";
};
proguardGradleJAR = fetchurl {
url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-gradle/${proguardVersion}/proguard-gradle-${proguardVersion}.jar";
sha256 = "0shhpsjfc5gam15jnv1hk718v5c7vi7dwdc3gvmnid6dc85kljzk";
};
proguardParentPOM = fetchurl {
url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-parent/${proguardVersion}/proguard-parent-${proguardVersion}.pom";
sha256 = "0mv0zbwyw8xa4mkc5kw69y5xqashkz9gp123akfvh9f6152l3202";
};
proguardBasePOM = fetchurl {
url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-base/${proguardVersion}/proguard-base-${proguardVersion}.pom";
sha256 = "1jnr6zsxfimb8wglqlwa6rrdc3g3nqf1dyw0k2dq9cj0q4pgn7p5";
};
proguardBaseJAR = fetchurl {
url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-base/${proguardVersion}/proguard-base-${proguardVersion}.jar";
sha256 = "11nwdb9y84cghcx319nsjjf9m035s4s1184zrhzpvaxq2wvqhbhx";
};

# Put the download plugins in a fake Maven repository
fakeMavenRepo = stdenv.mkDerivation {
name = "fake-maven-repo";
buildCommand = ''
mkdir -p $out
cd $out
mkdir -p net/sf/proguard/proguard-gradle/${proguardVersion}
cp ${proguardGradlePOM} net/sf/proguard/proguard-gradle/${proguardVersion}/proguard-gradle-${proguardVersion}.pom
cp ${proguardGradleJAR} net/sf/proguard/proguard-gradle/${proguardVersion}/proguard-gradle-${proguardVersion}.jar
mkdir -p net/sf/proguard/proguard-parent/${proguardVersion}
cp ${proguardParentPOM} net/sf/proguard/proguard-parent/${proguardVersion}/proguard-parent-${proguardVersion}.pom
mkdir -p net/sf/proguard/proguard-base/${proguardVersion}
cp ${proguardBasePOM} net/sf/proguard/proguard-base/${proguardVersion}/proguard-base-${proguardVersion}.pom
cp ${proguardBaseJAR} net/sf/proguard/proguard-base/${proguardVersion}/proguard-base-${proguardVersion}.jar
'';
};
in
stdenv.mkDerivation {
name = "mobilesdk-7.1.0.GA";
src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl {
url = http://builds.appcelerator.com/mobile/7_1_X/mobilesdk-7.1.0.v20180314133955-linux.zip;
sha256 = "18b3jnr65sdn5wj191bcl48gvhyklxmighxakv4vrz1fb59kyvqn";
}
else if stdenv.system == "x86_64-darwin" then fetchurl {
url = http://builds.appcelerator.com/mobile/7_1_X/mobilesdk-7.1.0.v20180314133955-osx.zip;
sha256 = "1f62616biwsw1fqxz2sq7lpa6bsfjazffliplyf5dpnh298cnc1m";
}
else throw "Platform: ${stdenv.system} not supported!";

buildInputs = [ unzip makeWrapper ];

buildCommand = ''
mkdir -p $out
cd $out
(yes y | unzip $src) || true
# Rename ugly version number
cd mobilesdk/*
mv * 7.1.0.GA
cd *
# Patch bundled gradle build infrastructure to make shebangs work
patchShebangs android/templates/gradle
# Substitute the gradle-all zip URL by a local file to prevent downloads from happening while building an Android app
sed -i -e "s|distributionUrl=|#distributionUrl=|" android/templates/gradle/gradle/wrapper/gradle-wrapper.properties
cp ${gradleAllZip} android/templates/gradle/gradle/wrapper/gradle-4.1-all.zip
echo "distributionUrl=gradle-4.1-all.zip" >> android/templates/gradle/gradle/wrapper/gradle-wrapper.properties
# Patch maven central repository with our own local directory. This prevents the builder from downloading Maven artifacts
sed -i -e 's|mavenCentral()|maven { url "${fakeMavenRepo}" }|' android/templates/build/proguard.gradle
# Patch some executables
${if stdenv.system == "i686-linux" then
''
patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 android/titanium_prep.linux32
''
else if stdenv.system == "x86_64-linux" then
''
patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 android/titanium_prep.linux64
''
else ""}
'';
}