diff options
Diffstat (limited to 'pkgs/development/mobile')
18 files changed, 550 insertions, 60 deletions
diff --git a/pkgs/development/mobile/abootimg/default.nix b/pkgs/development/mobile/abootimg/default.nix new file mode 100644 index 000000000000..a2ddda34347a --- /dev/null +++ b/pkgs/development/mobile/abootimg/default.nix @@ -0,0 +1,43 @@ +{ stdenv, fetchFromGitHub, coreutils, cpio, findutils, gzip, makeWrapper, utillinux }: + +let + version = "0.6"; +in +stdenv.mkDerivation { + name = "abootimg-${version}"; + + src = fetchFromGitHub { + owner = "ggrandou"; + repo = "abootimg"; + rev = "7e127fee6a3981f6b0a50ce9910267cd501e09d4"; + sha256 = "1qgx9fxwhylgnixzkz2mzv2707f65qq7rar2rsqak536vhig1z9a"; + }; + + nativeBuildInputs = [ makeWrapper utillinux ]; + + postPatch = '' + cat <<EOF > version.h + #define VERSION_STR "${version}" + EOF + ''; + + installPhase = '' + mkdir -p $out/bin + install -D -m 755 abootimg $out/bin + install -D -m444 ./debian/abootimg.1 $out/share/man/man1/abootimg.1; + + install -D -m 755 abootimg-pack-initrd $out/bin + wrapProgram $out/bin/abootimg-pack-initrd --prefix PATH : ${stdenv.lib.makeBinPath [ coreutils cpio findutils gzip ]} + + install -D -m 755 abootimg-unpack-initrd $out/bin + wrapProgram $out/bin/abootimg-unpack-initrd --prefix PATH : ${stdenv.lib.makeBinPath [ cpio gzip ]} + ''; + + meta = with stdenv.lib; { + homepage = https://github.com/ggrandou/abootimg; + description = "Manipulate Android Boot Images"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = [ maintainers.flokli ]; + }; +} diff --git a/pkgs/development/mobile/androidenv/androidndk.nix b/pkgs/development/mobile/androidenv/androidndk.nix index 81ec5732b9a2..2fe4005532d4 100644 --- a/pkgs/development/mobile/androidenv/androidndk.nix +++ b/pkgs/development/mobile/androidenv/androidndk.nix @@ -3,8 +3,6 @@ , platformTools }: -assert stdenv.isLinux; - stdenv.mkDerivation rec { name = "android-ndk-r10e"; diff --git a/pkgs/development/mobile/androidenv/androidndk_r8e.nix b/pkgs/development/mobile/androidenv/androidndk_r8e.nix index 271a18e4ee06..3b5da19da9e1 100644 --- a/pkgs/development/mobile/androidenv/androidndk_r8e.nix +++ b/pkgs/development/mobile/androidenv/androidndk_r8e.nix @@ -3,8 +3,6 @@ , platformTools }: -assert stdenv.isLinux; - stdenv.mkDerivation rec { name = "android-ndk-r8e"; diff --git a/pkgs/development/mobile/androidenv/build-tools.nix b/pkgs/development/mobile/androidenv/build-tools.nix index c09fd6142703..457a9b6720af 100644 --- a/pkgs/development/mobile/androidenv/build-tools.nix +++ b/pkgs/development/mobile/androidenv/build-tools.nix @@ -1,16 +1,16 @@ {stdenv, stdenv_32bit, fetchurl, unzip, zlib_32bit, ncurses_32bit, file, zlib, ncurses}: stdenv.mkDerivation rec { - version = "26.0.1"; + version = "26.0.2"; name = "android-build-tools-r${version}"; src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl { url = "https://dl.google.com/android/repository/build-tools_r${version}-linux.zip"; - sha256 = "1sp0ir1d88ffw0gz78zlbvnxalz02fsaxwdcvjfynanylwjpyqf8"; + sha256 = "1kii880bwhjkc343zwx1ysxyisxhczrwhphnxbwsgi45mjgq8lm7"; } else if stdenv.system == "x86_64-darwin" then fetchurl { url = "https://dl.google.com/android/repository/build-tools_r${version}-macosx.zip"; - sha256 = "1ns6c8361l18s3a5x0jc2m3qr06glsb6ak7csrrw6dkzlv8cj5dk"; + sha256 = "1x0ycprl6hgsm23kck5ind7x00hzydc5k3h3ch4a13407xbpvzvx"; } else throw "System ${stdenv.system} not supported!"; @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { cd $out/build-tools unzip $src mv android-* ${version} - + ${stdenv.lib.optionalString (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") '' cd ${version} @@ -48,9 +48,9 @@ stdenv.mkDerivation rec { fi done ''} - + patchShebangs . ''; - + buildInputs = [ unzip file ]; } diff --git a/pkgs/development/mobile/cocoapods/Gemfile b/pkgs/development/mobile/cocoapods/Gemfile new file mode 100644 index 000000000000..8308684860e6 --- /dev/null +++ b/pkgs/development/mobile/cocoapods/Gemfile @@ -0,0 +1,2 @@ +source 'https://rubygems.org' +gem 'cocoapods' diff --git a/pkgs/development/mobile/cocoapods/Gemfile.lock b/pkgs/development/mobile/cocoapods/Gemfile.lock new file mode 100644 index 000000000000..7ca6e40406a4 --- /dev/null +++ b/pkgs/development/mobile/cocoapods/Gemfile.lock @@ -0,0 +1,76 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.0) + activesupport (4.2.10) + i18n (~> 0.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + atomos (0.1.2) + claide (1.0.2) + cocoapods (1.5.0) + activesupport (>= 4.0.2, < 5) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.5.0) + cocoapods-deintegrate (>= 1.0.2, < 2.0) + cocoapods-downloader (>= 1.2.0, < 2.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-stats (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.3.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored2 (~> 3.1) + escape (~> 0.0.4) + fourflusher (~> 2.0.1) + gh_inspector (~> 1.0) + molinillo (~> 0.6.5) + nap (~> 1.0) + ruby-macho (~> 1.1) + xcodeproj (>= 1.5.7, < 2.0) + cocoapods-core (1.5.0) + activesupport (>= 4.0.2, < 6) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + cocoapods-deintegrate (1.0.2) + cocoapods-downloader (1.2.0) + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.0) + cocoapods-stats (1.0.0) + cocoapods-trunk (1.3.0) + nap (>= 0.8, < 2.0) + netrc (~> 0.11) + cocoapods-try (1.1.0) + colored2 (3.1.2) + concurrent-ruby (1.0.5) + escape (0.0.4) + fourflusher (2.0.1) + fuzzy_match (2.0.4) + gh_inspector (1.1.3) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + minitest (5.11.3) + molinillo (0.6.5) + nanaimo (0.2.5) + nap (1.1.0) + netrc (0.11.0) + ruby-macho (1.1.0) + thread_safe (0.3.6) + tzinfo (1.2.5) + thread_safe (~> 0.1) + xcodeproj (1.5.7) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.2) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.2.4) + +PLATFORMS + ruby + +DEPENDENCIES + cocoapods + +BUNDLED WITH + 1.14.6 diff --git a/pkgs/development/mobile/cocoapods/default.nix b/pkgs/development/mobile/cocoapods/default.nix new file mode 100644 index 000000000000..56624370b14a --- /dev/null +++ b/pkgs/development/mobile/cocoapods/default.nix @@ -0,0 +1,17 @@ +{ lib, bundlerEnv, ruby }: + +bundlerEnv rec { + inherit ruby; + pname = "cocoapods"; + gemdir = ./.; + + meta = with lib; { + description = "CocoaPods manages dependencies for your Xcode projects."; + homepage = https://github.com/CocoaPods/CocoaPods; + license = licenses.mit; + platforms = platforms.darwin; + maintainers = with maintainers; [ + peterromfeldhk + ]; + }; +} diff --git a/pkgs/development/mobile/cocoapods/gemset.nix b/pkgs/development/mobile/cocoapods/gemset.nix new file mode 100644 index 000000000000..cd4156d141c5 --- /dev/null +++ b/pkgs/development/mobile/cocoapods/gemset.nix @@ -0,0 +1,242 @@ +{ + activesupport = { + dependencies = ["i18n" "minitest" "thread_safe" "tzinfo"]; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0s12j8vl8vrxfngkdlz9g8bpz9akq1z42d57mx5r537b2pji8nr7"; + type = "gem"; + }; + version = "4.2.10"; + }; + atomos = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "10z69hjv30r2w5q5wmlf0cq4jv3w744jrac8ylln8sf45ckqj7wk"; + type = "gem"; + }; + version = "0.1.2"; + }; + CFPropertyList = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0ykjag3k5msz3sf1j91rb55da2xh596y06m3a4yl79fiy2id0w9z"; + type = "gem"; + }; + version = "3.0.0"; + }; + claide = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0az54rp691hc42yl1xyix2cxv58byhaaf4gxbpghvvq29l476rzc"; + type = "gem"; + }; + version = "1.0.2"; + }; + cocoapods = { + dependencies = ["activesupport" "claide" "cocoapods-core" "cocoapods-deintegrate" "cocoapods-downloader" "cocoapods-plugins" "cocoapods-search" "cocoapods-stats" "cocoapods-trunk" "cocoapods-try" "colored2" "escape" "fourflusher" "gh_inspector" "molinillo" "nap" "ruby-macho" "xcodeproj"]; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0pg2rkw6rlqq0y2vpajw4946hmvcnrg6lhr1i5p7j7kj8y5az167"; + type = "gem"; + }; + version = "1.5.0"; + }; + cocoapods-core = { + dependencies = ["activesupport" "fuzzy_match" "nap"]; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0mqxgd22rj49pfasvinsn7z1bzm899m8cfw38yr38nspri10acad"; + type = "gem"; + }; + version = "1.5.0"; + }; + cocoapods-deintegrate = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "10b49glw3jd0r1vj36zb0vz2idwgziq8qgzf7yjkrsm41xm098zz"; + type = "gem"; + }; + version = "1.0.2"; + }; + cocoapods-downloader = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1azzwyxvcqk5g394ica80x7pj7bh9zysk2q7x1jh8zbwrp6c0x8c"; + type = "gem"; + }; + version = "1.2.0"; + }; + cocoapods-plugins = { + dependencies = ["nap"]; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "16na82sfyc8801qs1n22nwq486s4j7yj6rj7fcp8cbxmj371fpbj"; + type = "gem"; + }; + version = "1.0.0"; + }; + cocoapods-search = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "02wmy5rbjk29c65zn62bffxv30qs11slql23qx65snkm0vd93mn6"; + type = "gem"; + }; + version = "1.0.0"; + }; + cocoapods-stats = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0sfcwq2vq6cadj1811jdjys3d28pmk2r2a83px6w94rz6i19axid"; + type = "gem"; + }; + version = "1.0.0"; + }; + cocoapods-trunk = { + dependencies = ["nap" "netrc"]; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0shxr64j7f50yglp5l90vr1ba5p9pkk0a3b8apkbci2lmq5kq60b"; + type = "gem"; + }; + version = "1.3.0"; + }; + cocoapods-try = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1gf2zjmcjhh9psq15yfy82wz5jnlihf5bcw79f8hlv4cnqyspncj"; + type = "gem"; + }; + version = "1.1.0"; + }; + colored2 = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0jlbqa9q4mvrm73aw9mxh23ygzbjiqwisl32d8szfb5fxvbjng5i"; + type = "gem"; + }; + version = "3.1.2"; + }; + concurrent-ruby = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "183lszf5gx84kcpb779v6a2y0mx9sssy8dgppng1z9a505nj1qcf"; + type = "gem"; + }; + version = "1.0.5"; + }; + escape = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0sa1xkfc9jvkwyw1jbz3jhkq0ms1zrvswi6mmfiwcisg5fp497z4"; + type = "gem"; + }; + version = "0.0.4"; + }; + fourflusher = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1dzmkxyzrk475c1yk5zddwhhj28b6fnj4jkk1h5gr1c2mrar72d5"; + type = "gem"; + }; + version = "2.0.1"; + }; + fuzzy_match = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "19gw1ifsgfrv7xdi6n61658vffgm1867f4xdqfswb2b5h6alzpmm"; + type = "gem"; + }; + version = "2.0.4"; + }; + gh_inspector = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0f8r9byajj3bi2c7c5sqrc7m0zrv3nblfcd4782lw5l73cbsgk04"; + type = "gem"; + }; + version = "1.1.3"; + }; + i18n = { + dependencies = ["concurrent-ruby"]; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "038qvz7kd3cfxk8bvagqhakx68pfbnmghpdkx7573wbf0maqp9a3"; + type = "gem"; + }; + version = "0.9.5"; + }; + minitest = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0icglrhghgwdlnzzp4jf76b0mbc71s80njn5afyfjn4wqji8mqbq"; + type = "gem"; + }; + version = "5.11.3"; + }; + molinillo = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "19zlshd1ra15x0a4jzss6ilz2xsnq293p43kxsljiy7xxq7bipx7"; + type = "gem"; + }; + version = "0.6.5"; + }; + nanaimo = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "03x5f7hk0s21hlkj309w0qipjxz34kyd3c5yj25zq3s2yyn57idi"; + type = "gem"; + }; + version = "0.2.5"; + }; + nap = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0xm5xssxk5s03wjarpipfm39qmgxsalb46v1prsis14x1xk935ll"; + type = "gem"; + }; + version = "1.1.0"; + }; + netrc = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0gzfmcywp1da8nzfqsql2zqi648mfnx6qwkig3cv36n9m0yy676y"; + type = "gem"; + }; + version = "0.11.0"; + }; + ruby-macho = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1i9vkz3ki3yvps4z1hca2q2axniq95x4yypnc22p9pcfjdfrbrq6"; + type = "gem"; + }; + version = "1.1.0"; + }; + thread_safe = { + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0nmhcgq6cgz44srylra07bmaw99f5271l0dpsvl5f75m44l0gmwy"; + type = "gem"; + }; + version = "0.3.6"; + }; + tzinfo = { + dependencies = ["thread_safe"]; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1fjx9j327xpkkdlxwmkl3a8wqj7i4l4jwlrv3z13mg95z9wl253z"; + type = "gem"; + }; + version = "1.2.5"; + }; + xcodeproj = { + dependencies = ["CFPropertyList" "atomos" "claide" "colored2" "nanaimo"]; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "16743g16mrh47f1lxkbw28xn9mmlf1r0zicin4malalsxxkc7ykz"; + type = "gem"; + }; + version = "1.5.7"; + }; +} \ No newline at end of file diff --git a/pkgs/development/mobile/cocoapods/update b/pkgs/development/mobile/cocoapods/update new file mode 100755 index 000000000000..58a7bd4a4539 --- /dev/null +++ b/pkgs/development/mobile/cocoapods/update @@ -0,0 +1,10 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p bash ruby bundler bundix + +rm Gemfile.lock +bundler install +bundix + +if [ "clean" == "$1" ]; then + rm -rf ~/.gem +fi diff --git a/pkgs/development/mobile/flashtool/default.nix b/pkgs/development/mobile/flashtool/default.nix index be4fc0f7f545..601b0b319bc8 100644 --- a/pkgs/development/mobile/flashtool/default.nix +++ b/pkgs/development/mobile/flashtool/default.nix @@ -1,7 +1,5 @@ { stdenv, requireFile, p7zip, jre, libusb1, platformTools, gtk2, glib, libXtst }: -assert stdenv.system == "i686-linux"; - # TODO: # # The FlashTool and FlashToolConsole scripts are messy and should probably we @@ -57,7 +55,7 @@ stdenv.mkDerivation rec { homepage = http://www.flashtool.net/; description = "S1 flashing software for Sony phones from X10 to Xperia Z Ultra"; license = stdenv.lib.licenses.unfreeRedistributableFirmware; - platforms = stdenv.lib.platforms.linux; + platforms = [ "i686-linux" ]; hydraPlatforms = stdenv.lib.platforms.none; broken = true; }; diff --git a/pkgs/development/mobile/genymotion/default.nix b/pkgs/development/mobile/genymotion/default.nix index db3cb07765b9..37834eff9473 100644 --- a/pkgs/development/mobile/genymotion/default.nix +++ b/pkgs/development/mobile/genymotion/default.nix @@ -5,9 +5,9 @@ let packages = [ - stdenv.cc.cc zlib glib xorg.libX11 libxkbcommon libXmu libXi libXext + stdenv.cc.cc zlib glib xorg.libX11 libxkbcommon libXmu libXi libXext libGL ]; - libPath = "${stdenv.lib.makeLibraryPath packages}:${libGL.driverLink}/lib"; + libPath = "${stdenv.lib.makeLibraryPath packages}"; in stdenv.mkDerivation rec { name = "genymotion-${version}"; diff --git a/pkgs/development/mobile/titaniumenv/build-app.nix b/pkgs/development/mobile/titaniumenv/build-app.nix index 4079adaef518..83bd941e5ffa 100644 --- a/pkgs/development/mobile/titaniumenv/build-app.nix +++ b/pkgs/development/mobile/titaniumenv/build-app.nix @@ -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,19 +52,19 @@ 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'' + '' + ${stdenv.lib.optionalString stdenv.isDarwin '' + # Signing the app does not work with OpenJDK on macOS, use host SDK instead + export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)" + ''} + 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''} '' diff --git a/pkgs/development/mobile/titaniumenv/default.nix b/pkgs/development/mobile/titaniumenv/default.nix index 031fe3b18c6b..6765a9cc5c30 100644 --- a/pkgs/development/mobile/titaniumenv/default.nix +++ b/pkgs/development/mobile/titaniumenv/default.nix @@ -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 { diff --git a/pkgs/development/mobile/titaniumenv/examples/default.nix b/pkgs/development/mobile/titaniumenv/examples/default.nix index 5753c8d7da97..78f91dd39fb8 100644 --- a/pkgs/development/mobile/titaniumenv/examples/default.nix +++ b/pkgs/development/mobile/titaniumenv/examples/default.nix @@ -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 diff --git a/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix b/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix index 5849ee368c1b..70ab1b168c42 100644 --- a/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix +++ b/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix @@ -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 }: @@ -7,9 +7,9 @@ assert rename -> (stdenv != null && newBundleId != null && iosMobileProvisioning let src = fetchgit { - url = https://github.com/appcelerator/KitchenSink.git; - rev = "ec9edebf35030f61368000a8a9071dd7a0773884"; - sha256 = "3e020004b73c9c2386f2672fdf9203083295f1524f5e504a07842e062de181c8"; + url = https://github.com/appcelerator/kitchensink-v2.git; + rev = "94364df2ef60a80bd354a4273e3cb5f4c5185537"; + sha256 = "0q4gzidpsq401frkngy4yk5kqvm8dz00ls74bw3fnpvg4714d6gf"; }; # Rename the bundle id to something else @@ -18,7 +18,6 @@ let inherit src; buildPhase = '' sed -i -e "s|com.appcelerator.kitchensink|${newBundleId}|" tiapp.xml - sed -i -e "s|com.appcelerator.kitchensink|${newBundleId}|" manifest ''; installPhase = '' mkdir -p $out diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk-7.1.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-7.1.nix new file mode 100644 index 000000000000..61c23a6d0b37 --- /dev/null +++ b/pkgs/development/mobile/titaniumenv/titaniumsdk-7.1.nix @@ -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 ""} + ''; +} diff --git a/pkgs/development/mobile/xcodeenv/build-app.nix b/pkgs/development/mobile/xcodeenv/build-app.nix index d208f26ab670..a94f2745894b 100644 --- a/pkgs/development/mobile/xcodeenv/build-app.nix +++ b/pkgs/development/mobile/xcodeenv/build-app.nix @@ -12,6 +12,7 @@ , certificateFile ? null , certificatePassword ? null , provisioningProfile ? null +, signMethod ? null , generateIPA ? false , generateXCArchive ? false , enableWirelessDistribution ? false @@ -21,7 +22,7 @@ , title ? null }: -assert release -> codeSignIdentity != null && certificateFile != null && certificatePassword != null && provisioningProfile != null; +assert release -> codeSignIdentity != null && certificateFile != null && certificatePassword != null && provisioningProfile != null && signMethod != null; assert enableWirelessDistribution -> installURL != null && bundleId != null && version != null && title != null; let @@ -82,13 +83,34 @@ stdenv.mkDerivation { # Do the building export LD=clang # To avoid problem with -isysroot parameter that is unrecognized by the stock ld. Comparison with an impure build shows that it uses clang instead. Ugly, but it works - xcodebuild -target ${_target} -configuration ${_configuration} ${stdenv.lib.optionalString (scheme != null) "-scheme ${scheme}"} -sdk ${_sdk} TARGETED_DEVICE_FAMILY="1, 2" ONLY_ACTIVE_ARCH=NO CONFIGURATION_TEMP_DIR=$TMPDIR CONFIGURATION_BUILD_DIR=$out ${if generateXCArchive then "archive" else ""} ${xcodeFlags} ${if release then ''"CODE_SIGN_IDENTITY=${codeSignIdentity}" PROVISIONING_PROFILE=$PROVISIONING_PROFILE OTHER_CODE_SIGN_FLAGS="--keychain $HOME/Library/Keychains/$keychainName-db"'' else ""} + xcodebuild -target ${_target} -configuration ${_configuration} ${stdenv.lib.optionalString (scheme != null) "-scheme ${scheme}"} -sdk ${_sdk} TARGETED_DEVICE_FAMILY="1, 2" ONLY_ACTIVE_ARCH=NO CONFIGURATION_TEMP_DIR=$TMPDIR CONFIGURATION_BUILD_DIR=$out ${if generateIPA || generateXCArchive then "-archivePath \"${name}.xcarchive\" archive" else ""} ${if release then ''PROVISIONING_PROFILE=$PROVISIONING_PROFILE OTHER_CODE_SIGN_FLAGS="--keychain $HOME/Library/Keychains/$keychainName-db"'' else ""} ${xcodeFlags} ${stdenv.lib.optionalString release '' ${stdenv.lib.optionalString generateIPA '' + # Create export plist file + cat > "${name}.plist" <<EOF + <?xml version="1.0" encoding="UTF-8"?> + <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> + <plist version="1.0"> + <dict> + <key>provisioningProfiles</key> + <dict> + <key>${bundleId}</key> + <string>$PROVISIONING_PROFILE</string> + </dict> + <key>method</key> + <string>${signMethod}</string> + ${stdenv.lib.optionalString (signMethod == "enterprise" || signMethod == "ad-hoc") '' + <key>compileBitcode</key> + <false/> + ''} + </dict> + </plist> + EOF + # Produce an IPA file - xcrun -sdk iphoneos PackageApplication -v $out/*.app -o "$out/${name}.ipa" - + xcodebuild -exportArchive -archivePath "${name}.xcarchive" -exportOptionsPlist "${name}.plist" -exportPath $out + # Add IPA to Hydra build products mkdir -p $out/nix-support echo "file binary-dist \"$(echo $out/*.ipa)\"" > $out/nix-support/hydra-build-products @@ -99,6 +121,10 @@ stdenv.mkDerivation { echo "doc install \"$out/$appname.html\"" >> $out/nix-support/hydra-build-products ''} ''} + ${stdenv.lib.optionalString generateXCArchive '' + mkdir -p $out + mv "${name}.xcarchive" $out + ''} # Delete our temp keychain ${deleteKeychain} diff --git a/pkgs/development/mobile/xcodeenv/simulate-app.nix b/pkgs/development/mobile/xcodeenv/simulate-app.nix index 5f71b5994080..04b6f2cbc834 100644 --- a/pkgs/development/mobile/xcodeenv/simulate-app.nix +++ b/pkgs/development/mobile/xcodeenv/simulate-app.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation { echo "Please provide a UDID of a simulator:" read udid else - # If a parameter has been provided, consider that a device UDID an use that + # If a parameter has been provided, consider that a device UDID and use that udid="$1" fi |