lol

Add option to build old androidndk r8e.

This version is the one required to build mobile Firefox. See build
documentation here:

https://wiki.mozilla.org/Mobile/Fennec/Android/Detailed_build_instructions#Install_Android_NDK

+42 -9
+21 -9
pkgs/development/mobile/androidenv/androidndk.nix
··· 1 1 { stdenv, fetchurl, zlib, ncurses, p7zip, lib, makeWrapper 2 2 , coreutils, file, findutils, gawk, gnugrep, gnused, jdk, which 3 - , platformTools 3 + , platformTools , pinToVersion8 ? false 4 4 }: 5 5 6 6 assert stdenv.isLinux; 7 7 8 8 stdenv.mkDerivation rec { 9 - name = "android-ndk-r10c"; 9 + name = if pinToVersion8 then 10 + "android-ndk-r8e" 11 + else 12 + "android-ndk-r10c"; 10 13 11 14 src = if stdenv.system == "i686-linux" 12 15 then fetchurl { 13 - url = "http://dl.google.com/android/ndk/${name}-linux-x86.bin"; 14 - sha256 = "0gyq68zrpzj3gkh81czs6r0jmikg5rwzh1bqg4rk16g2nxm4lll3"; 16 + url = if pinToVersion8 then "http://dl.google.com/android/ndk/${name}-linux-x86.tar.bz2" 17 + else "http://dl.google.com/android/ndk/${name}-linux-x86.bin"; 18 + sha256 = if pinToVersion8 then "c2c4e0c8b3037149a0f5dbb08d72f814a52af4da9fff9d80328c675457e95a98" 19 + else "0gyq68zrpzj3gkh81czs6r0jmikg5rwzh1bqg4rk16g2nxm4lll3"; 15 20 } 16 21 else if stdenv.system == "x86_64-linux" then fetchurl { 17 - url = "http://dl.google.com/android/ndk/${name}-linux-x86_64.bin"; 18 - sha256 = "126rqzkmf8xz1hqdziwx81yln17hpivs2j45rxhzdr45iw9b758c"; 22 + url = if pinToVersion8 then "http://dl.google.com/android/ndk/${name}-linux-x86_64.tar.bz2" 23 + else "http://dl.google.com/android/ndk/${name}-linux-x86_64.bin"; 24 + sha256 = if pinToVersion8 then "093gf55zbh38p2gk5bdykj1vg9p5l774wjdzw5mhk4144jm1wdq7" 25 + else "126rqzkmf8xz1hqdziwx81yln17hpivs2j45rxhzdr45iw9b758c"; 19 26 } 20 27 else throw "platform ${stdenv.system} not supported!"; 21 28 22 29 phases = "buildPhase"; 23 30 24 - buildInputs = [ p7zip makeWrapper ]; 31 + buildInputs = if pinToVersion8 then [ makeWrapper ] 32 + else [ p7zip makeWrapper ]; 25 33 26 34 buildCommand = let 27 35 bin_path = "$out/bin"; ··· 42 50 set -x 43 51 mkdir -pv $out/libexec 44 52 cd $out/libexec 45 - 7z x $src 53 + 54 + ${if pinToVersion8 then "tar -xjf $src" 55 + else "7z x $src"} 46 56 47 57 # so that it doesn't fail because of read-only permissions set 48 58 cd - 49 59 patch -p1 \ 50 60 --no-backup-if-mismatch \ 51 - -d $out/libexec/${name} < ${ ./make-standalone-toolchain.patch } 61 + ${if pinToVersion8 then 62 + "-d $out/libexec/${name} < ${ ./make-standalone-toolchain_r8e.patch }" 63 + else "-d $out/libexec/${name} < ${ ./make-standalone-toolchain.patch }"} 52 64 cd ${pkg_path} 53 65 54 66 find $out \( \
+8
pkgs/development/mobile/androidenv/default.nix
··· 147 147 inherit (pkgs) coreutils file findutils gawk gnugrep gnused jdk which; 148 148 inherit platformTools; 149 149 }; 150 + 151 + androidndk_r8e = import ./androidndk.nix { 152 + inherit (pkgs) stdenv fetchurl zlib ncurses p7zip lib makeWrapper; 153 + inherit (pkgs) coreutils file findutils gawk gnugrep gnused jdk which; 154 + inherit platformTools; 155 + pinToVersion8 = true; 156 + }; 157 + 150 158 151 159 buildApp = import ./build-app.nix { 152 160 inherit (pkgs) stdenv jdk ant gnumake gawk file which;
+13
pkgs/development/mobile/androidenv/make-standalone-toolchain_r8e.patch
··· 1 + diff -ru android-ndk-r8e.old/build/tools/make-standalone-toolchain.sh android-ndk-r8e/build/tools/make-standalone-toolchain.sh 2 + --- android-ndk-r8e.old/build/tools/make-standalone-toolchain.sh 2014-10-16 03:46:32.000000000 +0200 3 + +++ android-ndk-r8e/build/tools/make-standalone-toolchain.sh 2014-10-24 23:46:22.544928306 +0200 4 + @@ -194,6 +194,9 @@ 5 + # Now copy the GCC toolchain prebuilt binaries 6 + run copy_directory "$TOOLCHAIN_PATH" "$TMPDIR" 7 + 8 + +# Making it writable again 9 + +chmod -R +w "$TMPDIR" 10 + + 11 + if [ -n "$LLVM_VERSION" ]; then 12 + # Copy the clang/llvm toolchain prebuilt binaries 13 + run copy_directory "$LLVM_TOOLCHAIN_PATH" "$TMPDIR"