chiark / gitweb /
buildorder.py: Show package if lacking build.sh
[termux-packages] / scripts / setup-android-sdk.sh
1 #!/bin/sh
2 set -e -u
3
4 # Install desired parts of the Android SDK:
5 test -f $HOME/.termuxrc && . $HOME/.termuxrc
6 : ${ANDROID_HOME:="${HOME}/lib/android-sdk"}
7 : ${NDK:="${HOME}/lib/android-ndk"}
8
9 if [ ! -d $ANDROID_HOME ]; then
10         mkdir -p $ANDROID_HOME
11         cd $ANDROID_HOME/..
12         rm -Rf `basename $ANDROID_HOME`
13         curl -o android-sdk.tgz http://dl.google.com/android/android-sdk_r24.3.4-linux.tgz
14
15         rm -Rf android-sdk-linux
16         tar xzf android-sdk.tgz
17         mv android-sdk-linux `basename $ANDROID_HOME`
18         rm android-sdk.tgz
19 fi
20
21 if [ ! -d $NDK ]; then
22         mkdir -p $NDK
23         cd $NDK/..
24         rm -Rf `basename $NDK`
25         curl -o ndk.zip http://dl.google.com/android/repository/android-ndk-r11-linux-x86_64.zip
26
27         rm -Rf android-ndk-r11
28         unzip -q ndk.zip
29         mv android-ndk-r11 `basename $NDK`
30         rm ndk.zip
31 fi
32
33 echo y | $ANDROID_HOME/tools/android update sdk --no-ui --all --no-https -t "build-tools-23.0.3,android-23"