Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | set -e |
| 3 | set -x |
| 4 | |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 5 | CRYSTAX_NDK_VERSION=10.3.1 |
Alexander Afanasyev | dbaae95 | 2015-02-07 16:29:31 -0800 | [diff] [blame] | 6 | |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 7 | URL=https://www.crystax.net/download/ |
| 8 | NDK=crystax-ndk-$CRYSTAX_NDK_VERSION |
| 9 | |
| 10 | NDK_FILE="$NDK-linux-x86_64.tar.xz" |
Alexander Afanasyev | dbaae95 | 2015-02-07 16:29:31 -0800 | [diff] [blame] | 11 | |
| 12 | if [ ! -f downloads/$NDK_FILE ]; then |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 13 | mkdir downloads || true |
| 14 | cd downloads |
Alexander Afanasyev | dbaae95 | 2015-02-07 16:29:31 -0800 | [diff] [blame] | 15 | wget --no-check-certificate $URL$NDK_FILE |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 16 | cd .. |
| 17 | fi |
| 18 | |
Alexander Afanasyev | dbaae95 | 2015-02-07 16:29:31 -0800 | [diff] [blame] | 19 | if [ ! -d $NDK ]; then |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 20 | export XZ_DEFAULTS=--memlimit=300MiB |
Alexander Afanasyev | dbaae95 | 2015-02-07 16:29:31 -0800 | [diff] [blame] | 21 | echo -en 'travis_fold:start:NDK\r' |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 22 | |
| 23 | # To save space |
| 24 | EXCLUDES="toolchains/*-clang3.6 toolchains/*-3.6 \ |
| 25 | toolchains/*-clang3.7 \ |
| 26 | toolchains/*-3.7 \ |
| 27 | toolchains/*-4.9 \ |
| 28 | sources/cxx-stl/gabi++ \ |
| 29 | sources/cxx-stl/llvm-libc++ \ |
| 30 | sources/cxx-stl/llvm-libc++abi \ |
| 31 | sources/cxx-stl/stlport \ |
| 32 | sources/cxx-stl/llvm-libc++ \ |
| 33 | sources/cxx-stl/gnu-libstdc++/4.9 \ |
| 34 | sources/icu \ |
| 35 | sources/boost/*/libs/*/gnu-4.9 \ |
| 36 | sources/boost/*/libs/*/llvm-3.6 \ |
| 37 | sources/boost/*/libs/*/llvm-3.7 \ |
| 38 | sources/objc \ |
| 39 | sources/python" |
| 40 | |
| 41 | pv -f downloads/$NDK_FILE | tar xJf - $(for i in $EXCLUDES; do echo "--exclude $i"; done | xargs) |
Alexander Afanasyev | dbaae95 | 2015-02-07 16:29:31 -0800 | [diff] [blame] | 42 | echo -en 'travis_fold:end:NDK\r' |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 43 | fi |
| 44 | |
Alexander Afanasyev | dbaae95 | 2015-02-07 16:29:31 -0800 | [diff] [blame] | 45 | echo ndk.dir=`pwd`/$NDK >> local.properties |
Alexander Afanasyev | e152d99 | 2016-11-08 15:20:13 -0800 | [diff] [blame] | 46 | |
| 47 | cd crystax-ndk-$CRYSTAX_NDK_VERSION/sources |
| 48 | curl -L -o openssl.tar.gz https://github.com/named-data-mobile/crystax-prebuilt-openssl/archive/crystax-$CRYSTAX_NDK_VERSION.tar.gz |
| 49 | tar zx --strip-components 1 -C openssl -f openssl.tar.gz |
| 50 | rm openssl.tar.gz |
| 51 | cd ../.. |