buildserver: use standardized paths for the NDKs

This should help with reproducibility since some tools like Python still
include the build paths in the binaries.
https://gitlab.com/fdroid/fdroidserver/-/merge_requests/919#note_578180986

The default ANDROID_SDK_ROOT base dir of /opt/android-sdk is hard-coded in
buildserver/Vagrantfile.  The $ANDROID_HOME/ndk subdir is where Android
Studio will install the NDK into versioned subdirs.
https://developer.android.com/studio/projects/configure-agp-ndk#agp_version_41
This commit is contained in:
Hans-Christoph Steiner 2021-05-25 22:39:03 +02:00
parent bb77d7a6d2
commit 93145a43fb
4 changed files with 14 additions and 8 deletions

View file

@ -84,7 +84,7 @@ Vagrant.configure("2") do |config|
args: [configfile['debian_mirror']] args: [configfile['debian_mirror']]
config.vm.provision "shell", path: "provision-android-sdk" config.vm.provision "shell", path: "provision-android-sdk"
config.vm.provision "shell", path: "provision-android-ndk", config.vm.provision "shell", path: "provision-android-ndk",
args: ["/home/vagrant/android-ndk"] args: ["/opt/android-sdk/ndk"]
config.vm.provision "shell", path: "provision-gradle" config.vm.provision "shell", path: "provision-gradle"
end end

View file

@ -1,8 +1,8 @@
sdk_path: /opt/android-sdk sdk_path: /opt/android-sdk
ndk_paths: ndk_paths:
r10e: /home/vagrant/android-ndk/r10e r10e: /opt/android-sdk/ndk/r10e
r21e: /home/vagrant/android-ndk/r21e r21e: /opt/android-sdk/ndk/21.4.7075529
r22b: /home/vagrant/android-ndk/r22b r22b: /opt/android-sdk/ndk/22.0.7026061
java_paths: java_paths:
8: /usr/lib/jvm/java-8-openjdk-amd64 8: /usr/lib/jvm/java-8-openjdk-amd64

View file

@ -18,9 +18,15 @@ fi
for version in r21e r22b; do for version in r21e r22b; do
if [ ! -e ${NDK_BASE}/${version} ]; then if [ ! -e ${NDK_BASE}/${version} ]; then
unzip /vagrant/cache/android-ndk-${version}-linux-x86_64.zip > /dev/null unzip /vagrant/cache/android-ndk-${version}-linux-x86_64.zip > /dev/null
mv android-ndk-${version} ${version} mv android-ndk-${version} \
`sed -En 's,^Pkg.Revision *= *(.+),\1,p' android-ndk-${version}/source.properties`
fi fi
done done
# 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
chmod -R a+rX $NDK_BASE/ chmod -R a+rX $NDK_BASE/
find $NDK_BASE/ -type f -executable -print0 | xargs -0 chmod a+x find $NDK_BASE/ -type f -executable -print0 | xargs -0 chmod a+x

View file

@ -4006,9 +4006,9 @@ def auto_install_ndk(build):
--onserver` calls can run in a single session. The production --onserver` calls can run in a single session. The production
buildserver is reset between every build. buildserver is reset between every build.
The default ANDROID_HOME base dir of /home/vagrant/android-sdk is The default ANDROID_SDK_ROOT base dir of /opt/android-sdk is hard-coded in
hard-coded in buildserver/Vagrantfile. The "ndk" subdir is where buildserver/Vagrantfile. The $ANDROID_HOME/ndk subdir is where Android
Android Studio will install the NDK into versioned subdirs. Studio will install the NDK into versioned subdirs.
https://developer.android.com/studio/projects/configure-agp-ndk#agp_version_41 https://developer.android.com/studio/projects/configure-agp-ndk#agp_version_41
Also, r10e and older cannot be handled via this mechanism because Also, r10e and older cannot be handled via this mechanism because