1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-09 08:50:11 +01:00
fdroidserver/buildserver/provision-android-ndk
Hans-Christoph Steiner 9a90a5071d buildserver: support any recent NDK version, with stable filenames
Now that the download file name and type seems to have stabilized, I
think we no longer need to manually specify each new added release in
this script to unpack.

closes #331
2017-07-06 12:25:48 +02:00

33 lines
851 B
Bash

#!/bin/bash
#
echo $0
set -e
NDK_BASE=$1
test -e $NDK_BASE || mkdir -p $NDK_BASE
cd $NDK_BASE
if [ ! -e $NDK_BASE/r9b ]; then
tar xjf /vagrant/cache/android-ndk-r9b-linux-x86_64.tar.bz2
tar xjf /vagrant/cache/android-ndk-r9b-linux-x86_64-legacy-toolchains.tar.bz2
mv android-ndk-r9b r9b
fi
if [ ! -e $NDK_BASE/r10e ]; then
7zr x /vagrant/cache/android-ndk-r10e-linux-x86_64.bin > /dev/null
mv android-ndk-r10e r10e
fi
for f in /vagrant/cache/android-ndk-r[1-9][0-9]*-linux-x86_64.zip; do
version=`echo $f |sed 's,.*\(r[1-9][0-9][a-z]\?\).*,\1,'`
if [ ! -e ${NDK_BASE}/${version} ]; then
unzip /vagrant/cache/android-ndk-${version}-linux-x86_64.zip > /dev/null
mv android-ndk-${version} ${version}
fi
done
chmod -R a+rX $NDK_BASE/
find $NDK_BASE/ -type f -executable -print0 | xargs -0 chmod a+x