forked from GLEECBTC/komodo-defi-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathandroid-ndk.sh
More file actions
45 lines (35 loc) · 796 Bytes
/
android-ndk.sh
File metadata and controls
45 lines (35 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
set -ex
NDK_URL=https://dl.google.com/android/repository/android-ndk-r21b-linux-x86_64.zip
main() {
local arch=$1 \
api=$2
local dependencies=(
unzip
python
curl
)
apt-get update
local purge_list=()
for dep in ${dependencies[@]}; do
if ! dpkg -L $dep; then
apt-get install --no-install-recommends -y $dep
purge_list+=( $dep )
fi
done
td=$(mktemp -d)
pushd $td
curl -O $NDK_URL
unzip -q android-ndk-*.zip
pushd android-ndk-*/
./build/tools/make_standalone_toolchain.py \
--install-dir /android-ndk \
--arch $arch \
--api $api
# clean up
apt-get purge --auto-remove -y ${purge_list[@]}
popd
popd
rm -rf $td
rm $0
}
main "${@}"