blob: c1cfe2441fe4b35b28b7a1acd109e36d5e61f62f [file] [log] [blame]
Alexander Afanasyev087c7c12015-02-02 00:21:21 -08001#!/usr/bin/env bash
2set -e
3set -x
4
Alexander Afanasyevf3812562016-01-21 16:28:33 -08005CRYSTAX_NDK_VERSION=10.3.1
Alexander Afanasyevdbaae952015-02-07 16:29:31 -08006
Alexander Afanasyevf3812562016-01-21 16:28:33 -08007URL=https://www.crystax.net/download/
8NDK=crystax-ndk-$CRYSTAX_NDK_VERSION
9
10NDK_FILE="$NDK-linux-x86_64.tar.xz"
Alexander Afanasyevdbaae952015-02-07 16:29:31 -080011
12if [ ! -f downloads/$NDK_FILE ]; then
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080013 mkdir downloads || true
14 cd downloads
Alexander Afanasyevdbaae952015-02-07 16:29:31 -080015 wget --no-check-certificate $URL$NDK_FILE
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080016 cd ..
17fi
18
Alexander Afanasyevdbaae952015-02-07 16:29:31 -080019if [ ! -d $NDK ]; then
Alexander Afanasyevf3812562016-01-21 16:28:33 -080020 export XZ_DEFAULTS=--memlimit=300MiB
Alexander Afanasyevdbaae952015-02-07 16:29:31 -080021 echo -en 'travis_fold:start:NDK\r'
Alexander Afanasyevf3812562016-01-21 16:28:33 -080022
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 Afanasyevdbaae952015-02-07 16:29:31 -080042 echo -en 'travis_fold:end:NDK\r'
Alexander Afanasyev087c7c12015-02-02 00:21:21 -080043fi
44
Alexander Afanasyevdbaae952015-02-07 16:29:31 -080045echo ndk.dir=`pwd`/$NDK >> local.properties
Alexander Afanasyeve152d992016-11-08 15:20:13 -080046
47cd crystax-ndk-$CRYSTAX_NDK_VERSION/sources
48curl -L -o openssl.tar.gz https://github.com/named-data-mobile/crystax-prebuilt-openssl/archive/crystax-$CRYSTAX_NDK_VERSION.tar.gz
49tar zx --strip-components 1 -C openssl -f openssl.tar.gz
50rm openssl.tar.gz
51cd ../..