2016-06-15 15:02:37 +02:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2021-06-01 13:53:29 +02:00
|
|
|
# $1 is the root dir to install the NDKs into
|
|
|
|
# $2 and after are the NDK releases to install
|
2016-06-15 15:02:37 +02:00
|
|
|
|
2016-07-04 14:20:42 +02:00
|
|
|
echo $0
|
2016-06-15 15:02:37 +02:00
|
|
|
set -e
|
2018-11-28 20:46:44 +01:00
|
|
|
set -x
|
2016-06-15 15:02:37 +02:00
|
|
|
|
2016-06-17 11:29:00 +02:00
|
|
|
NDK_BASE=$1
|
2021-06-01 13:53:29 +02:00
|
|
|
shift
|
2016-06-15 15:02:37 +02:00
|
|
|
|
2016-06-17 11:29:00 +02:00
|
|
|
test -e $NDK_BASE || mkdir -p $NDK_BASE
|
|
|
|
cd $NDK_BASE
|
2016-06-15 15:02:37 +02:00
|
|
|
|
2021-06-01 13:53:29 +02:00
|
|
|
for version in $@; do
|
2017-06-28 16:55:34 +02:00
|
|
|
if [ ! -e ${NDK_BASE}/${version} ]; then
|
2022-02-10 09:47:03 +01:00
|
|
|
unzip /vagrant/cache/android-ndk-${version}-linux*.zip > /dev/null
|
2021-05-25 22:39:03 +02:00
|
|
|
mv android-ndk-${version} \
|
|
|
|
`sed -En 's,^Pkg.Revision *= *(.+),\1,p' android-ndk-${version}/source.properties`
|
2017-06-28 16:55:34 +02:00
|
|
|
fi
|
|
|
|
done
|
2017-07-04 10:44:25 +02:00
|
|
|
|
2021-05-25 22:39:03 +02:00
|
|
|
# allow gradle/etc to install missing NDK versions
|
|
|
|
chgrp vagrant $NDK_BASE
|
|
|
|
chmod g+w $NDK_BASE
|
|
|
|
|
|
|
|
# ensure all users can read and execute the NDK
|
2016-06-17 11:29:00 +02:00
|
|
|
chmod -R a+rX $NDK_BASE/
|
2022-01-10 22:49:30 +01:00
|
|
|
find $NDK_BASE/ -type f -executable -exec chmod a+x -- {} +
|