chiark / gitweb /
buildserver: do not set NDK env vars, they are handled by `fdroid build`
authorHans-Christoph Steiner <hans@eds.org>
Fri, 17 Jun 2016 09:29:00 +0000 (11:29 +0200)
committerHans-Christoph Steiner <hans@eds.org>
Tue, 21 Jun 2016 08:29:56 +0000 (10:29 +0200)
`fdroid build` handles setting the NDK env vars since the NDK version can
change depending on the app being build.  Unlike ANDROID_HOME, there is no
single global NDK location.  The NDK installs are all versioned.

buildserver/provision-android-ndk
buildserver/setup-env-vars
makebuildserver

index 80411b3498f83cabfeef2c6eff318fb91a5c95ec..9d4a54c0ba2fb32ee75ccb577f3f9e5e74598cdc 100644 (file)
@@ -3,15 +3,12 @@
 
 set -e
 
-if [ -z $ANDROID_NDK_HOME ]; then
-    echo "ANDROID_NDK_HOME env var must be set!"
-    exit 1
-fi
+NDK_BASE=$1
 
-test -e $ANDROID_NDK_HOME || mkdir -p $ANDROID_NDK_HOME
-cd $ANDROID_NDK_HOME
+test -e $NDK_BASE || mkdir -p $NDK_BASE
+cd $NDK_BASE
 
-if [ ! -e $ANDROID_NDK_HOME/r9b ]; then
+if [ ! -e $NDK_BASE/r9b ]; then
     if [ `uname -m` == 'x86_64' ] ; then
         SUFFIX='_64'
     else
@@ -22,7 +19,7 @@ if [ ! -e $ANDROID_NDK_HOME/r9b ]; then
     mv android-ndk-r9b r9b
 fi
 
-if [ ! -e $ANDROID_NDK_HOME/r10e ]; then
+if [ ! -e $NDK_BASE/r10e ]; then
     if [ `uname -m` == 'x86_64' ] ; then
        SUFFIX='_64'
     else
@@ -32,5 +29,5 @@ if [ ! -e $ANDROID_NDK_HOME/r10e ]; then
     mv android-ndk-r10e r10e
 fi
 
-chmod -R a+rX $ANDROID_NDK_HOME/
-find $ANDROID_NDK_HOME/ -type f -executable -print0 | xargs -0 chmod a+x
+chmod -R a+rX $NDK_BASE/
+find $NDK_BASE/ -type f -executable -print0 | xargs -0 chmod a+x
index 83d433eb0f958783d52db70795afdc0014741a2b..00220a234ccca6f5aa00b7bcf45966266d178ae2 100644 (file)
@@ -10,7 +10,6 @@ bsenv=/etc/profile.d/bsenv.sh
 echo "# generated on "`date` > $bsenv
 
 echo export ANDROID_HOME=$1 >> $bsenv
-echo export ANDROID_NDK_HOME=$2 >> $bsenv
 echo 'export PATH=$PATH:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:/opt/gradle/bin' >> $bsenv
 
 chmod 0644 $bsenv
index 0561645263e20855735ebf0e40f4768b78bb19a1..44c432569c029548b1b232757453f1e6f0627872 100755 (executable)
@@ -377,10 +377,8 @@ if config['apt_package_cache']:
 
 vagrantfile += """
 
-  config.vm.provision "shell" do |shell|
-    shell.path = "setup-env-vars"
-    shell.args = ["/home/vagrant/android-sdk", "/home/vagrant/android-ndk"]
-  end
+  config.vm.provision "shell", path: "setup-env-vars",
+    args: ["/home/vagrant/android-sdk"]
 
   config.vm.provision :chef_solo do |chef|
     chef.cookbooks_path = "cookbooks"
@@ -397,7 +395,8 @@ vagrantfile += """
   end
 
   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"]
   config.vm.provision "shell", path: "provision-gradle"
   config.vm.provision "file", source: "gradle",
     destination: "/opt/gradle/bin/gradle"