titaniumsdk: add SDK version 5.1 and remove older versions
This commit is contained in:
parent
d3de3db077
commit
d268fa7676
@ -1,7 +1,7 @@
|
||||
{stdenv, androidsdk, titaniumsdk, titanium, xcodewrapper, jdk, python, which, xcodeBaseDir}:
|
||||
{ name, src, target, androidPlatformVersions ? [ "8" ], androidAbiVersions ? [ "armeabi" "armeabi-v7a" ], tiVersion ? null
|
||||
{ name, src, target, androidPlatformVersions ? [ "23" ], androidAbiVersions ? [ "armeabi" "armeabi-v7a" ], tiVersion ? null
|
||||
, release ? false, androidKeyStore ? null, androidKeyAlias ? null, androidKeyStorePassword ? null
|
||||
, iosMobileProvisioningProfile ? null, iosCertificateName ? null, iosCertificate ? null, iosCertificatePassword ? null, iosVersion ? "8.1", iosWwdrCertificate ? null
|
||||
, iosMobileProvisioningProfile ? null, iosCertificateName ? null, iosCertificate ? null, iosCertificatePassword ? null, iosVersion ? "9.2"
|
||||
, enableWirelessDistribution ? false, installURL ? null
|
||||
}:
|
||||
|
||||
@ -43,31 +43,29 @@ stdenv.mkDerivation {
|
||||
|
||||
echo "{}" > $TMPDIR/config.json
|
||||
titanium --config-file $TMPDIR/config.json --no-colors config sdk.defaultInstallLocation ${titaniumsdk}
|
||||
|
||||
titanium --config-file $TMPDIR/config.json --no-colors config paths.modules ${titaniumsdk}
|
||||
|
||||
mkdir -p $out
|
||||
|
||||
${if target == "android" then
|
||||
''
|
||||
titanium config --config-file $TMPDIR/config.json --no-colors android.sdkPath ${androidsdkComposition}/libexec/android-sdk-*
|
||||
titanium config --config-file $TMPDIR/config.json --no-colors android.sdk ${androidsdkComposition}/libexec/android-sdk-*
|
||||
titanium config --config-file $TMPDIR/config.json --no-colors android.buildTools.selectedVersion 23.0.1
|
||||
titanium config --config-file $TMPDIR/config.json --no-colors android.buildTools.path ${androidsdkComposition}/libexec/android-sdk-*/build-tools/android-*
|
||||
titanium config --config-file $TMPDIR/config.json android.executables.zipalign ${androidsdkComposition}/libexec/android-sdk-*/build-tools/android-*/zipalign
|
||||
titanium config --config-file $TMPDIR/config.json android.executables.aapt ${androidsdkComposition}/libexec/android-sdk-*/build-tools/android-*/aapt
|
||||
titanium config --config-file $TMPDIR/config.json android.executables.aidl ${androidsdkComposition}/libexec/android-sdk-*/build-tools/android-*/aidl
|
||||
titanium config --config-file $TMPDIR/config.json android.executables.dx ${androidsdkComposition}/libexec/android-sdk-*/build-tools/android-*/dx
|
||||
|
||||
# Add zipalign to PATH to make Ti 3.1 builds still work
|
||||
for i in $(find -L ${androidsdkComposition}/libexec/android-sdk-*/build-tools -name zipalign)
|
||||
do
|
||||
export PATH=$(dirname $i):$PATH
|
||||
break
|
||||
done
|
||||
export PATH=$(echo ${androidsdkComposition}/libexec/android-sdk-*/tools):$(echo ${androidsdkComposition}/libexec/android-sdk-*/build-tools/android-*):$PATH
|
||||
|
||||
${if release then
|
||||
''titanium build --config-file $TMPDIR/config.json --no-colors --force --platform android --target dist-playstore --keystore ${androidKeyStore} --alias ${androidKeyAlias} --password ${androidKeyStorePassword} --output-dir $out''
|
||||
''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
|
||||
''titanium build --config-file $TMPDIR/config.json --no-colors --force --platform android --target emulator --build-only -B foo --output $out''}
|
||||
''
|
||||
else if target == "iphone" then
|
||||
''
|
||||
export NIX_TITANIUM_WORKAROUND="--config-file $TMPDIR/config.json"
|
||||
|
||||
${if release then
|
||||
''
|
||||
export HOME=/Users/$(whoami)
|
||||
@ -78,9 +76,6 @@ stdenv.mkDerivation {
|
||||
security default-keychain -s $keychainName
|
||||
security unlock-keychain -p "" $keychainName
|
||||
security import ${iosCertificate} -k $keychainName -P "${iosCertificatePassword}" -A
|
||||
${stdenv.lib.optionalString (iosWwdrCertificate != null) ''
|
||||
security import ${iosWwdrCertificate} -k $keychainName
|
||||
''}
|
||||
provisioningId=$(grep UUID -A1 -a ${iosMobileProvisioningProfile} | grep -o "[-A-Za-z0-9]\{36\}")
|
||||
|
||||
# Ensure that the requested provisioning profile can be found
|
||||
@ -91,16 +86,6 @@ stdenv.mkDerivation {
|
||||
cp ${iosMobileProvisioningProfile} "$HOME/Library/MobileDevice/Provisioning Profiles/$provisioningId.mobileprovision"
|
||||
fi
|
||||
|
||||
# Make a copy of the Titanium SDK and fix its permissions. Without it,
|
||||
# builds using the facebook module fail, because it needs to be writable
|
||||
|
||||
cp -av ${titaniumsdk} $TMPDIR/titaniumsdk
|
||||
|
||||
find $TMPDIR/titaniumsdk | while read i
|
||||
do
|
||||
chmod 755 "$i"
|
||||
done
|
||||
|
||||
# Simulate a login
|
||||
mkdir -p $HOME/.titanium
|
||||
cat > $HOME/.titanium/auth_session.json <<EOF
|
||||
@ -110,14 +95,21 @@ stdenv.mkDerivation {
|
||||
# Configure the path to Xcode
|
||||
titanium --config-file $TMPDIR/config.json --no-colors config paths.xcode ${xcodeBaseDir}
|
||||
|
||||
# Set the SDK to our copy
|
||||
titanium --config-file $TMPDIR/config.json --no-colors config sdk.defaultInstallLocation $TMPDIR/titaniumsdk
|
||||
# Make plutil available
|
||||
mkdir -p $TMPDIR/bin
|
||||
ln -s /usr/bin/plutil $TMPDIR/bin
|
||||
export PATH=$TMPDIR/bin:$PATH
|
||||
|
||||
# Link the modules folder
|
||||
if [ ! -e modules ]
|
||||
then
|
||||
ln -s ${titaniumsdk}/modules modules
|
||||
fi
|
||||
|
||||
# Do the actual build
|
||||
titanium build --config-file $TMPDIR/config.json --force --no-colors --platform ios --target dist-adhoc --pp-uuid $provisioningId --distribution-name "${iosCertificateName}" --keychain $HOME/Library/Keychains/$keychainName --device-family universal --ios-version ${iosVersion} --output-dir $out
|
||||
|
||||
# Remove our generated keychain
|
||||
|
||||
${deleteKeychain}
|
||||
''
|
||||
else
|
||||
@ -130,10 +122,27 @@ stdenv.mkDerivation {
|
||||
cp -av * $out
|
||||
cd $out
|
||||
|
||||
# We need to consult a real home directory to find the available simulators
|
||||
export HOME=/Users/$(whoami)
|
||||
|
||||
# Configure the path to Xcode
|
||||
titanium --config-file $TMPDIR/config.json --no-colors config paths.xcode ${xcodeBaseDir}
|
||||
|
||||
# Link the modules folder
|
||||
if [ ! -e modules ]
|
||||
then
|
||||
ln -s ${titaniumsdk}/modules modules
|
||||
createdModulesSymlink=1
|
||||
fi
|
||||
|
||||
# Execute the build
|
||||
titanium build --config-file $TMPDIR/config.json --force --no-colors --platform ios --target simulator --build-only --device-family universal --ios-version ${iosVersion} --output-dir $out
|
||||
|
||||
# Remove the modules symlink
|
||||
if [ "$createdModulesSymlink" = "1" ]
|
||||
then
|
||||
rm $out/modules
|
||||
fi
|
||||
''}
|
||||
''
|
||||
|
||||
|
3
pkgs/development/mobile/titaniumenv/cli/cli.json
Normal file
3
pkgs/development/mobile/titaniumenv/cli/cli.json
Normal file
@ -0,0 +1,3 @@
|
||||
[
|
||||
"titanium"
|
||||
]
|
15
pkgs/development/mobile/titaniumenv/cli/default.nix
Normal file
15
pkgs/development/mobile/titaniumenv/cli/default.nix
Normal file
@ -0,0 +1,15 @@
|
||||
{system ? builtins.currentSystem, pkgs ? import <nixpkgs> {
|
||||
inherit system;
|
||||
}, overrides ? {}}:
|
||||
|
||||
let
|
||||
nodeEnv = import ./node-env.nix {
|
||||
inherit (pkgs) stdenv fetchurl nodejs python utillinux runCommand;
|
||||
};
|
||||
registry = (import ./registry.nix {
|
||||
inherit (nodeEnv) buildNodePackage;
|
||||
inherit (pkgs) fetchurl fetchgit;
|
||||
self = registry;
|
||||
}) // overrides;
|
||||
in
|
||||
registry
|
309
pkgs/development/mobile/titaniumenv/cli/node-env.nix
Normal file
309
pkgs/development/mobile/titaniumenv/cli/node-env.nix
Normal file
@ -0,0 +1,309 @@
|
||||
{ stdenv, fetchurl, nodejs, python, utillinux, runCommand }:
|
||||
|
||||
let
|
||||
# Function that generates a TGZ file from a NPM project
|
||||
buildNodeSourceDist =
|
||||
{ name, version, src }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "node-tarball-${name}-${version}";
|
||||
inherit src;
|
||||
buildInputs = [ nodejs ];
|
||||
buildPhase = ''
|
||||
export HOME=$TMPDIR
|
||||
tgzFile=$(npm pack)
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out/tarballs
|
||||
mv $tgzFile $out/tarballs
|
||||
mkdir -p $out/nix-support
|
||||
echo "file source-dist $out/tarballs/$tgzFile" >> $out/nix-support/hydra-build-products
|
||||
'';
|
||||
};
|
||||
|
||||
# We must run semver to determine whether a provided dependency conforms to a certain version range
|
||||
semver = buildNodePackage {
|
||||
name = "semver";
|
||||
version = "5.0.3";
|
||||
src = fetchurl {
|
||||
url = http://registry.npmjs.org/semver/-/semver-5.0.3.tgz;
|
||||
sha1 = "77466de589cd5d3c95f138aa78bc569a3cb5d27a";
|
||||
};
|
||||
} {};
|
||||
|
||||
# Function that produces a deployed NPM package in the Nix store
|
||||
buildNodePackage =
|
||||
{ name, version, src, dependencies ? {}, buildInputs ? [], production ? true, npmFlags ? "", meta ? {}, linkDependencies ? false }:
|
||||
{ providedDependencies ? {} }:
|
||||
|
||||
let
|
||||
# Generate and import a Nix expression that determines which dependencies
|
||||
# are required and which are not required (and must be shimmed).
|
||||
#
|
||||
# It uses the semver utility to check whether a version range matches any
|
||||
# of the provided dependencies.
|
||||
|
||||
analysedDependencies =
|
||||
if dependencies == {} then {}
|
||||
else
|
||||
import (stdenv.mkDerivation {
|
||||
name = "${name}-${version}-analysedDependencies.nix";
|
||||
buildInputs = [ semver ];
|
||||
buildCommand = ''
|
||||
cat > $out <<EOF
|
||||
{
|
||||
${stdenv.lib.concatMapStrings (dependencyName:
|
||||
let
|
||||
dependency = builtins.getAttr dependencyName dependencies;
|
||||
versionSpecs = builtins.attrNames dependency;
|
||||
in
|
||||
stdenv.lib.concatMapStrings (versionSpec:
|
||||
if builtins.hasAttr dependencyName providedDependencies # Search for any provided dependencies that match the required version spec. If one matches, the dependency should not be included
|
||||
then
|
||||
let
|
||||
providedDependency = builtins.getAttr dependencyName providedDependencies;
|
||||
versions = builtins.attrNames providedDependency;
|
||||
|
||||
# If there is a version range match, add the dependency to
|
||||
# the set of shimmed dependencies.
|
||||
# Otherwise, it is a required dependency.
|
||||
in
|
||||
''
|
||||
$(latestVersion=$(semver -r '${versionSpec}' ${stdenv.lib.concatMapStrings (version: " '${version}'") versions} | tail -1 | tr -d '\n')
|
||||
|
||||
if semver -r '${versionSpec}' ${stdenv.lib.concatMapStrings (version: " '${version}'") versions} >/dev/null
|
||||
then
|
||||
echo "shimmedDependencies.\"${dependencyName}\".\"$latestVersion\" = true;"
|
||||
else
|
||||
echo 'requiredDependencies."${dependencyName}"."${versionSpec}" = true;'
|
||||
fi)
|
||||
''
|
||||
else # If a dependency is not provided by an includer, we must always include it ourselves
|
||||
"requiredDependencies.\"${dependencyName}\".\"${versionSpec}\" = true;\n"
|
||||
) versionSpecs
|
||||
) (builtins.attrNames dependencies)}
|
||||
}
|
||||
EOF
|
||||
'';
|
||||
});
|
||||
|
||||
requiredDependencies = analysedDependencies.requiredDependencies or {};
|
||||
shimmedDependencies = analysedDependencies.shimmedDependencies or {};
|
||||
|
||||
# Extract the Node.js source code which is used to compile packages with native bindings
|
||||
nodeSources = runCommand "node-sources" {} ''
|
||||
tar --no-same-owner --no-same-permissions -xf ${nodejs.src}
|
||||
mv node-* $out
|
||||
'';
|
||||
|
||||
# Compose dependency information that this package must propagate to its
|
||||
# dependencies, so that provided dependencies are not included a second time.
|
||||
# This prevents cycles and wildcard version mismatches.
|
||||
|
||||
propagatedProvidedDependencies =
|
||||
(stdenv.lib.mapAttrs (dependencyName: dependency:
|
||||
builtins.listToAttrs (map (versionSpec:
|
||||
{ name = dependency."${versionSpec}".version;
|
||||
value = true;
|
||||
}
|
||||
) (builtins.attrNames dependency))
|
||||
) dependencies) //
|
||||
providedDependencies //
|
||||
{ "${name}"."${version}" = true; };
|
||||
|
||||
# Create a node_modules folder containing all required dependencies of the
|
||||
# package
|
||||
|
||||
nodeDependencies = stdenv.mkDerivation {
|
||||
name = "node-dependencies-${name}-${version}";
|
||||
inherit src;
|
||||
buildCommand = ''
|
||||
mkdir -p $out/lib/node_modules
|
||||
cd $out/lib/node_modules
|
||||
|
||||
# Create copies of (or symlinks to) the dependencies that must be deployed in this package's private node_modules folder.
|
||||
# This package's private dependencies are NPM packages that have not been provided by any of the includers.
|
||||
|
||||
${stdenv.lib.concatMapStrings (requiredDependencyName:
|
||||
stdenv.lib.concatMapStrings (versionSpec:
|
||||
let
|
||||
dependency = dependencies."${requiredDependencyName}"."${versionSpec}".pkg {
|
||||
providedDependencies = propagatedProvidedDependencies;
|
||||
};
|
||||
in
|
||||
''
|
||||
depPath=$(echo ${dependency}/lib/node_modules/*)
|
||||
|
||||
${if linkDependencies then ''
|
||||
ln -s $depPath .
|
||||
'' else ''
|
||||
cp -r $depPath .
|
||||
''}
|
||||
''
|
||||
) (builtins.attrNames (requiredDependencies."${requiredDependencyName}"))
|
||||
) (builtins.attrNames requiredDependencies)}
|
||||
'';
|
||||
};
|
||||
|
||||
# Deploy the Node package with some tricks
|
||||
self = stdenv.lib.makeOverridable stdenv.mkDerivation {
|
||||
inherit src meta;
|
||||
dontStrip = true;
|
||||
|
||||
name = "node-${name}-${version}";
|
||||
buildInputs = [ nodejs python ] ++ stdenv.lib.optional (stdenv.isLinux) utillinux ++ buildInputs;
|
||||
buildPhase = "true";
|
||||
|
||||
installPhase = ''
|
||||
# Move the contents of the tarball into the output folder
|
||||
mkdir -p "$out/lib/node_modules/${name}"
|
||||
mv * "$out/lib/node_modules/${name}"
|
||||
|
||||
# Enter the target directory
|
||||
cd "$out/lib/node_modules/${name}"
|
||||
|
||||
# Patch the shebangs of the bundled modules. For "regular" dependencies
|
||||
# this is step is not required, because it has already been done by the generic builder.
|
||||
|
||||
if [ -d node_modules ]
|
||||
then
|
||||
patchShebangs node_modules
|
||||
fi
|
||||
|
||||
# Copy the required dependencies
|
||||
mkdir -p node_modules
|
||||
|
||||
${stdenv.lib.optionalString (requiredDependencies != {}) ''
|
||||
for i in ${nodeDependencies}/lib/node_modules/*
|
||||
do
|
||||
if [ ! -d "node_modules/$(basename $i)" ]
|
||||
then
|
||||
cp -a $i node_modules
|
||||
fi
|
||||
done
|
||||
''}
|
||||
|
||||
# Create shims for the packages that have been provided by earlier includers to allow the NPM install operation to still succeed
|
||||
|
||||
${stdenv.lib.concatMapStrings (shimmedDependencyName:
|
||||
stdenv.lib.concatMapStrings (versionSpec:
|
||||
''
|
||||
mkdir -p node_modules/${shimmedDependencyName}
|
||||
cat > node_modules/${shimmedDependencyName}/package.json <<EOF
|
||||
{
|
||||
"name": "${shimmedDependencyName}",
|
||||
"version": "${versionSpec}"
|
||||
}
|
||||
EOF
|
||||
''
|
||||
) (builtins.attrNames (shimmedDependencies."${shimmedDependencyName}"))
|
||||
) (builtins.attrNames shimmedDependencies)}
|
||||
|
||||
# Ignore npm-shrinkwrap.json for now. Ideally, it should be supported as well
|
||||
rm -f npm-shrinkwrap.json
|
||||
|
||||
# Some version specifiers (latest, unstable, URLs, file paths) force NPM to make remote connections or consult paths outside the Nix store.
|
||||
# The following JavaScript replaces these by * to prevent that:
|
||||
|
||||
(
|
||||
cat <<EOF
|
||||
var fs = require('fs');
|
||||
var url = require('url');
|
||||
|
||||
/*
|
||||
* Replaces an impure version specification by *
|
||||
*/
|
||||
function replaceImpureVersionSpec(versionSpec) {
|
||||
var parsedUrl = url.parse(versionSpec);
|
||||
|
||||
if(versionSpec == "latest" || versionSpec == "unstable" ||
|
||||
versionSpec.substr(0, 2) == ".." || dependency.substr(0, 2) == "./" || dependency.substr(0, 2) == "~/" || dependency.substr(0, 1) == '/')
|
||||
return '*';
|
||||
else if(parsedUrl.protocol == "git:" || parsedUrl.protocol == "git+ssh:" || parsedUrl.protocol == "git+http:" || parsedUrl.protocol == "git+https:" ||
|
||||
parsedUrl.protocol == "http:" || parsedUrl.protocol == "https:")
|
||||
return '*';
|
||||
else
|
||||
return versionSpec;
|
||||
}
|
||||
|
||||
var packageObj = JSON.parse(fs.readFileSync('./package.json'));
|
||||
|
||||
/* Replace dependencies */
|
||||
if(packageObj.dependencies !== undefined) {
|
||||
for(var dependency in packageObj.dependencies) {
|
||||
var versionSpec = packageObj.dependencies[dependency];
|
||||
packageObj.dependencies[dependency] = replaceImpureVersionSpec(versionSpec);
|
||||
}
|
||||
}
|
||||
|
||||
/* Replace development dependencies */
|
||||
if(packageObj.devDependencies !== undefined) {
|
||||
for(var dependency in packageObj.devDependencies) {
|
||||
var versionSpec = packageObj.devDependencies[dependency];
|
||||
packageObj.devDependencies[dependency] = replaceImpureVersionSpec(versionSpec);
|
||||
}
|
||||
}
|
||||
|
||||
/* Replace optional dependencies */
|
||||
if(packageObj.optionalDependencies !== undefined) {
|
||||
for(var dependency in packageObj.optionalDependencies) {
|
||||
var versionSpec = packageObj.optionalDependencies[dependency];
|
||||
packageObj.optionalDependencies[dependency] = replaceImpureVersionSpec(versionSpec);
|
||||
}
|
||||
}
|
||||
|
||||
/* Write the fixed JSON file */
|
||||
fs.writeFileSync("package.json", JSON.stringify(packageObj));
|
||||
EOF
|
||||
) | node
|
||||
|
||||
# Deploy the Node.js package by running npm install. Since the dependencies have been symlinked, it should not attempt to install them again,
|
||||
# which is good, because we want to make it Nix's responsibility. If it needs to install any dependencies anyway (e.g. because the dependency
|
||||
# parameters are incomplete/incorrect), it fails.
|
||||
|
||||
export HOME=$TMPDIR
|
||||
npm --registry http://www.example.com --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} install
|
||||
|
||||
# After deployment of the NPM package, we must remove the shims again
|
||||
${stdenv.lib.concatMapStrings (shimmedDependencyName:
|
||||
''
|
||||
rm node_modules/${shimmedDependencyName}/package.json
|
||||
rmdir node_modules/${shimmedDependencyName}
|
||||
''
|
||||
) (builtins.attrNames shimmedDependencies)}
|
||||
|
||||
# It makes no sense to keep an empty node_modules folder around, so delete it if this is the case
|
||||
if [ -d node_modules ]
|
||||
then
|
||||
rmdir --ignore-fail-on-non-empty node_modules
|
||||
fi
|
||||
|
||||
# Create symlink to the deployed executable folder, if applicable
|
||||
if [ -d "$out/lib/node_modules/.bin" ]
|
||||
then
|
||||
ln -s $out/lib/node_modules/.bin $out/bin
|
||||
fi
|
||||
|
||||
# Create symlinks to the deployed manual page folders, if applicable
|
||||
if [ -d "$out/lib/node_modules/${name}/man" ]
|
||||
then
|
||||
mkdir -p $out/share
|
||||
for dir in "$out/lib/node_modules/${name}/man/"*
|
||||
do
|
||||
mkdir -p $out/share/man/$(basename "$dir")
|
||||
for page in "$dir"/*
|
||||
do
|
||||
ln -s $page $out/share/man/$(basename "$dir")
|
||||
done
|
||||
done
|
||||
fi
|
||||
'';
|
||||
|
||||
shellHook = stdenv.lib.optionalString (requiredDependencies != {}) ''
|
||||
export NODE_PATH=${nodeDependencies}/lib/node_modules
|
||||
'';
|
||||
};
|
||||
in
|
||||
self;
|
||||
in
|
||||
{ inherit buildNodeSourceDist buildNodePackage; }
|
2393
pkgs/development/mobile/titaniumenv/cli/registry.nix
Normal file
2393
pkgs/development/mobile/titaniumenv/cli/registry.nix
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,25 +1,5 @@
|
||||
{pkgs, pkgs_i686, xcodeVersion ? "6.1.1", xcodeBaseDir ? "/Applications/Xcode.app", tiVersion ? "3.5.1.GA"}:
|
||||
{pkgs, pkgs_i686, xcodeVersion ? "7.2", xcodeBaseDir ? "/Applications/Xcode.app", tiVersion ? "5.1.1.GA"}:
|
||||
|
||||
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
|
||||
rec {
|
||||
androidenv = pkgs.androidenv;
|
||||
|
||||
@ -29,11 +9,7 @@ rec {
|
||||
} else null;
|
||||
|
||||
titaniumsdk = let
|
||||
titaniumSdkFile = if tiVersion == "3.1.4.GA" then ./titaniumsdk-3.1.nix
|
||||
else if tiVersion == "3.2.3.GA" then ./titaniumsdk-3.2.nix
|
||||
else if tiVersion == "3.3.0.GA" then ./titaniumsdk-3.3.nix
|
||||
else if tiVersion == "3.4.0.GA" then ./titaniumsdk-3.4.nix
|
||||
else if tiVersion == "3.5.1.GA" then ./titaniumsdk-3.5.nix
|
||||
titaniumSdkFile = if tiVersion == "5.1.1.GA" then ./titaniumsdk-5.1.nix
|
||||
else throw "Titanium version not supported: "+tiVersion;
|
||||
in
|
||||
import titaniumSdkFile {
|
||||
@ -41,11 +17,8 @@ rec {
|
||||
};
|
||||
|
||||
buildApp = import ./build-app.nix {
|
||||
inherit (pkgs) stdenv python which;
|
||||
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;
|
||||
inherit (pkgs) stdenv python which jdk;
|
||||
titanium = (import ./cli { inherit (pkgs.stdenv) system; }).titanium {};
|
||||
inherit (androidenv) androidsdk;
|
||||
inherit (xcodeenv) xcodewrapper;
|
||||
inherit titaniumsdk xcodeBaseDir;
|
||||
|
@ -1,10 +1,10 @@
|
||||
{ nixpkgs ? <nixpkgs>
|
||||
, systems ? [ "x86_64-linux" "x86_64-darwin" ]
|
||||
, xcodeVersion ? "6.1.1"
|
||||
, xcodeVersion ? "7.2"
|
||||
, xcodeBaseDir ? "/Applications/Xcode.app"
|
||||
, tiVersion ? "3.5.1.GA"
|
||||
, tiVersion ? "5.1.1.GA"
|
||||
, rename ? false
|
||||
, newBundleId ? "com.example.kitchensink", iosMobileProvisioningProfile ? null, iosCertificate ? null, iosCertificateName ? "Example", iosCertificatePassword ? "", iosVersion ? "8.1", iosWwdrCertificate ? null
|
||||
, newBundleId ? "com.example.kitchensink", iosMobileProvisioningProfile ? null, iosCertificate ? null, iosCertificateName ? "Example", iosCertificatePassword ? "", iosVersion ? "9.2", iosWwdrCertificate ? null
|
||||
, allowUnfree ? false
|
||||
, enableWirelessDistribution ? false, installURL ? null
|
||||
}:
|
||||
|
@ -1,5 +1,5 @@
|
||||
{ titaniumenv, fetchgit, target, androidPlatformVersions ? [ "14" ], tiVersion ? "3.2.3.GA", release ? false
|
||||
, rename ? false, stdenv ? null, newBundleId ? null, iosMobileProvisioningProfile ? null, iosCertificate ? null, iosCertificateName ? null, iosCertificatePassword ? null, iosVersion ? "8.1", iosWwdrCertificate ? null
|
||||
{ titaniumenv, fetchgit, target, androidPlatformVersions ? [ "23" ], tiVersion ? "5.1.1.GA", release ? false
|
||||
, rename ? false, stdenv ? null, newBundleId ? null, iosMobileProvisioningProfile ? null, iosCertificate ? null, iosCertificateName ? null, iosCertificatePassword ? null, iosVersion ? "8.1"
|
||||
, enableWirelessDistribution ? false, installURL ? null
|
||||
}:
|
||||
|
||||
@ -8,8 +8,8 @@ assert rename -> (stdenv != null && newBundleId != null && iosMobileProvisioning
|
||||
let
|
||||
src = fetchgit {
|
||||
url = https://github.com/appcelerator/KitchenSink.git;
|
||||
rev = "37d766ef9cba6a2d0b22634d3edc1fa8402109a0";
|
||||
sha256 = "1d4x9zwq92p1krds52bd41qqsnsnb3a7x74bysbiphrvrphz80kk";
|
||||
rev = "6e9f509069fafdebfa78e15b2d14f20a27a485cc";
|
||||
sha256 = "0370dc0ca78b96a7e0befbff9cb1c248695e1aff66aceea98043bbb16c5121e6";
|
||||
};
|
||||
|
||||
# Rename the bundle id to something else
|
||||
@ -37,6 +37,6 @@ titaniumenv.buildApp {
|
||||
androidKeyAlias = "myfirstapp";
|
||||
androidKeyStorePassword = "mykeystore";
|
||||
|
||||
inherit iosMobileProvisioningProfile iosCertificate iosCertificateName iosCertificatePassword iosVersion iosWwdrCertificate;
|
||||
inherit iosMobileProvisioningProfile iosCertificate iosCertificateName iosCertificatePassword iosVersion;
|
||||
inherit enableWirelessDistribution installURL;
|
||||
}
|
||||
|
@ -1 +0,0 @@
|
||||
s|\t\t\t\t\t\t\t\tapk_zip.write(native_lib, path_in_zip)|\t\t\t\t\t\t\t\tinfo = zipfile.ZipInfo(path_in_zip)\n\t\t\t\t\t\t\t\tinfo.compress_type = zipfile.ZIP_DEFLATED\n\t\t\t\t\t\t\t\tinfo.create_system = 3\n\t\t\t\t\t\t\t\tf = open(native_lib)\n\t\t\t\t\t\t\t\tapk_zip.writestr(info, f.read())\n\t\t\t\t\t\t\t\tf.close()|
|
@ -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\tinfo.compress_type = zipfile.ZIP_DEFLATED\n\t\t\t\tinfo.create_system = 3\n\t\t\t\tf = open(os.path.join(lib_source_dir, fname))\n\t\t\t\tapk_zip.writestr(info, f.read())\n\t\t\t\tf.close()|
|
@ -1 +0,0 @@
|
||||
s|apk_zip.write(os.path.join(lib_source_dir, 'libtiprofiler.so'), lib_dest_dir + 'libtiprofiler.so')|info = zipfile.ZipInfo(lib_dest_dir + 'libtiprofiler.so')\n\t\t\tinfo.compress_type = zipfile.ZIP_DEFLATED\n\t\t\tinfo.create_system = 3\n\t\t\tf = open(os.path.join(lib_source_dir, 'libtiprofiler.so'))\n\t\t\tapk_zip.writestr(info, f.read())\n\t\t\tf.close()\n|
|
@ -1 +0,0 @@
|
||||
s|apk_zip.write(os.path.join(lib_source_dir, 'libtiverify.so'), lib_dest_dir + 'libtiverify.so')|info = zipfile.ZipInfo(lib_dest_dir + 'libtiverify.so')\n\t\t\tinfo.compress_type = zipfile.ZIP_DEFLATED\n\t\t\tinfo.create_system = 3\n\t\t\tf = open(os.path.join(lib_source_dir, 'libtiverify.so'))\n\t\t\tapk_zip.writestr(info, f.read())\n\t\t\tf.close()|
|
@ -1,80 +0,0 @@
|
||||
{stdenv, fetchurl, unzip, makeWrapper, python, jdk}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "mobilesdk-3.1.4.v20130926144546";
|
||||
src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl {
|
||||
url = http://builds.appcelerator.com.s3.amazonaws.com/mobile/3_1_X/mobilesdk-3.1.4.v20130926144546-linux.zip;
|
||||
sha1 = "da4a03ced67f0e8f442d551bbd41ea01fceeee00";
|
||||
}
|
||||
else if stdenv.system == "x86_64-darwin" then fetchurl {
|
||||
url = http://builds.appcelerator.com.s3.amazonaws.com/mobile/3_1_X/mobilesdk-3.1.4.v20130926144546-osx.zip;
|
||||
sha1 = "55f604c8edb989ba214c8ed7538d1b416df0419e";
|
||||
}
|
||||
else throw "Platform: ${stdenv.system} not supported!";
|
||||
|
||||
buildInputs = [ unzip makeWrapper ];
|
||||
|
||||
buildCommand = ''
|
||||
mkdir -p $out
|
||||
cd $out
|
||||
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/*
|
||||
mv 3.1.4.v20130926144546 3.1.4.GA
|
||||
cd 3.1.4.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.cc.libc}/lib/ld-linux.so.2 titanium_prep.linux32
|
||||
''
|
||||
else if stdenv.system == "x86_64-linux" then
|
||||
''
|
||||
patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 titanium_prep.linux64
|
||||
''
|
||||
else ""}
|
||||
|
||||
# Fix zipalign compatibility issue with newer Android SDKs
|
||||
sed -i -e 's|zipalign = self.sdk.get_zipalign()|zipalign = "zipalign"|' builder.py
|
||||
|
||||
# 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'] = '${jdk.home}'
|
||||
|
||||
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
|
||||
'';
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
{stdenv, fetchurl, unzip, makeWrapper, python, jdk}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "mobilesdk-3.2.3.GA";
|
||||
src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl {
|
||||
url = http://builds.appcelerator.com/mobile/3.2.3/mobilesdk-3.2.3.GA-linux.zip;
|
||||
sha1 = "303e6d19a0ca099d47f6862c00b261c6d0206cea";
|
||||
}
|
||||
else if stdenv.system == "x86_64-darwin" then fetchurl {
|
||||
url = http://builds.appcelerator.com/mobile/3.2.3/mobilesdk-3.2.3.GA-osx.zip;
|
||||
sha1 = "8c358cbd8624ffe3dfbd0283738105157067e0fb";
|
||||
}
|
||||
else throw "Platform: ${stdenv.system} not supported!";
|
||||
|
||||
buildInputs = [ unzip makeWrapper ];
|
||||
|
||||
buildCommand = ''
|
||||
mkdir -p $out
|
||||
cd $out
|
||||
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.2.3.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.cc.libc}/lib/ld-linux.so.2 titanium_prep.linux32
|
||||
''
|
||||
else if stdenv.system == "x86_64-linux" then
|
||||
''
|
||||
patchelf --set-interpreter ${stdenv.cc.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'] = '${jdk.home}'
|
||||
|
||||
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
|
||||
'';
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
{stdenv, fetchurl, unzip, makeWrapper, python, jdk}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "mobilesdk-3.3.0.GA";
|
||||
src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl {
|
||||
url = http://builds.appcelerator.com/mobile/3.3.0/mobilesdk-3.3.0.GA-linux.zip;
|
||||
sha1 = "9a9cca05a4cf8700df60b7e9d9cd969ecb70d81e";
|
||||
}
|
||||
else if stdenv.system == "x86_64-darwin" then fetchurl {
|
||||
url = http://builds.appcelerator.com/mobile/3.3.0/mobilesdk-3.3.0.GA-osx.zip;
|
||||
sha1 = "c6333e4da2564b9c51b865c1db49a062fbc743af";
|
||||
}
|
||||
else throw "Platform: ${stdenv.system} not supported!";
|
||||
|
||||
buildInputs = [ unzip makeWrapper ];
|
||||
|
||||
buildCommand = ''
|
||||
mkdir -p $out
|
||||
cd $out
|
||||
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.3.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.cc.libc}/lib/ld-linux.so.2 titanium_prep.linux32
|
||||
''
|
||||
else if stdenv.system == "x86_64-linux" then
|
||||
''
|
||||
patchelf --set-interpreter ${stdenv.cc.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'] = '${jdk.home}'
|
||||
|
||||
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
|
||||
'';
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
{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
|
||||
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.cc.libc}/lib/ld-linux.so.2 titanium_prep.linux32
|
||||
''
|
||||
else if stdenv.system == "x86_64-linux" then
|
||||
''
|
||||
patchelf --set-interpreter ${stdenv.cc.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'] = '${jdk.home}'
|
||||
|
||||
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
|
||||
'';
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
{stdenv, fetchurl, unzip, makeWrapper, python, jdk}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "mobilesdk-3.5.1.GA";
|
||||
src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl {
|
||||
url = http://builds.appcelerator.com/mobile/3.5.1/mobilesdk-3.5.1.GA-linux.zip;
|
||||
sha1 = "2fd8c50081af9d03b65ffaf824e2e417832efd92";
|
||||
}
|
||||
else if stdenv.system == "x86_64-darwin" then fetchurl {
|
||||
url = http://builds.appcelerator.com/mobile/3.5.1/mobilesdk-3.5.1.GA-osx.zip;
|
||||
sha1 = "f000e66980c2c3a40b6a6fd40a0bd0554fcb0424";
|
||||
}
|
||||
else throw "Platform: ${stdenv.system} not supported!";
|
||||
|
||||
buildInputs = [ unzip makeWrapper ];
|
||||
|
||||
buildCommand = ''
|
||||
mkdir -p $out
|
||||
cd $out
|
||||
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.5.1.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.cc.libc}/lib/ld-linux.so.2 titanium_prep.linux32
|
||||
''
|
||||
else if stdenv.system == "x86_64-linux" then
|
||||
''
|
||||
patchelf --set-interpreter ${stdenv.cc.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'] = '${jdk.home}'
|
||||
|
||||
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
|
||||
'';
|
||||
}
|
42
pkgs/development/mobile/titaniumenv/titaniumsdk-5.1.nix
Normal file
42
pkgs/development/mobile/titaniumenv/titaniumsdk-5.1.nix
Normal file
@ -0,0 +1,42 @@
|
||||
{stdenv, fetchurl, unzip, makeWrapper, python, jdk}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "mobilesdk-5.1.1.GA";
|
||||
src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl {
|
||||
url = http://builds.appcelerator.com/mobile/5_1_1/mobilesdk-5.1.1.v20151203123251-linux.zip;
|
||||
sha256 = "197pia5a0bacwwyi0s7s69iyx4i2jdrgjc3ybiahaqv27dhw9zr2";
|
||||
}
|
||||
else if stdenv.system == "x86_64-darwin" then fetchurl {
|
||||
url = http://builds.appcelerator.com/mobile/5_1_1/mobilesdk-5.1.1.v20151203123251-osx.zip;
|
||||
sha256 = "1ij2zc5450fnl13w8ia1z6pa12vja6ks1ssvlb73n2rx52krgvxr";
|
||||
}
|
||||
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 * 5.1.1.GA
|
||||
cd *
|
||||
|
||||
# Hack to make dx.jar work with new build-tools
|
||||
sed -i -e "s|path.join(dir, 'platform-tools', 'lib', 'dx.jar')|path.join(dir, 'build-tools', 'android-6.0', 'lib', 'dx.jar')|" $out/mobilesdk/*/*/node_modules/titanium-sdk/lib/android.js
|
||||
|
||||
# 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 ""}
|
||||
'';
|
||||
}
|
Loading…
Reference in New Issue
Block a user