From b1de856595b72a9c1f5fa2b5a86d13a3eb4e48a3 Mon Sep 17 00:00:00 2001 From: Joakim Bygdell Date: Thu, 28 Jun 2018 12:13:35 +0200 Subject: Update android build env. Update the scripts used to build subsurface-mobile for andriod to use the variables file. Removed checks for obsolete Qt versions. Signed-off-by: Joakim Bygdell --- packaging/android/android-build-wrapper.sh | 42 ++++++++++++++++-------------- packaging/android/build.sh | 21 +++++---------- 2 files changed, 28 insertions(+), 35 deletions(-) (limited to 'packaging') diff --git a/packaging/android/android-build-wrapper.sh b/packaging/android/android-build-wrapper.sh index d88eebe7a..3e7a7b046 100755 --- a/packaging/android/android-build-wrapper.sh +++ b/packaging/android/android-build-wrapper.sh @@ -26,14 +26,7 @@ exec 1> >(tee ./build.log) 2>&1 USE_X=$(case $- in *x*) echo "-x" ;; esac) # these are the current versions for Qt, Android SDK & NDK: - -QT_VERSION=5.10 -LATEST_QT=5.10.1 -NDK_VERSION=r14b -SDK_VERSION=3859397 # if you change this version, you'll likely have to change the android-sdk-license key fallback below - -ANDROID_NDK=android-ndk-${NDK_VERSION} -ANDROID_SDK=android-sdk-linux +source subsurface/packaging/android/variables.sh PLATFORM=$(uname) @@ -76,24 +69,33 @@ if [ ! -d $ANDROID_NDK ] ; then unzip -q $NDK_BINARIES fi -if [ ! -d $ANDROID_SDK ] ; then - if [ ! -f $SDK_TOOLS ] ; then - $SLOW_PROG wget -q https://dl.google.com/android/repository/$SDK_TOOLS +if [ ! -d $ANDROID_SDK/build-tools/${ANDROID_BUILDTOOLS_REVISION} ] ; then + if [ ! -d $ANDROID_SDK ] ; then + if [ ! -f $SDK_TOOLS ] ; then + $SLOW_PROG wget -q https://dl.google.com/android/repository/$SDK_TOOLS + fi + mkdir $ANDROID_SDK + pushd $ANDROID_SDK + unzip -q ../$SDK_TOOLS + yes | tools/bin/sdkmanager --licenses > /dev/null 2>&1 || echo "d56f5187479451eabf01fb78af6dfcb131a6481e" > licenses/android-sdk-license + cat licenses/android-sdk-license + echo "" + else + pushd $ANDROID_SDK + tools/bin/sdkmanager tools platform-tools 'platforms;'${ANDROID_PLATFORMS} 'build-tools;'${ANDROID_BUILDTOOLS_REVISION} fi - mkdir $ANDROID_SDK - pushd $ANDROID_SDK - unzip -q ../$SDK_TOOLS - yes | tools/bin/sdkmanager --licenses > /dev/null 2>&1 || echo "d56f5187479451eabf01fb78af6dfcb131a6481e" > licenses/android-sdk-license - cat licenses/android-sdk-license - echo "" - # FIXME: Read these from build.sh varables, or install them there. - tools/bin/sdkmanager tools platform-tools 'platforms;android-27' 'build-tools;25.0.3' popd fi # download the Qt installer including Android bits and unpack / install QT_DOWNLOAD_URL=https://download.qt.io/archive/qt/${QT_VERSION}/${LATEST_QT}/${QT_BINARIES} -if [ ! -d Qt ] ; then +if [ ! -d Qt/${LATEST_QT}/android_armv7 ] ; then + if [ -d Qt ] ; then + # Over writing an exsisting installation stalls the installation script, + # rename the exsisting Qt folder and notify then user. + mv Qt Qt_OLD + echo "Qt installation found, backing it up to Qt_OLD." + fi if [ ! -f ${QT_BINARIES} ] ; then $SLOW_PROG wget -q ${QT_DOWNLOAD_URL} fi diff --git a/packaging/android/build.sh b/packaging/android/build.sh index c2b902037..e7674bf84 100755 --- a/packaging/android/build.sh +++ b/packaging/android/build.sh @@ -38,8 +38,8 @@ BUILD_NR=0 SUBSURFACE_DESKTOP=OFF # Which arch should we build for? ARCH=arm -# Which SDK buildtools revision is used? -ANDROID_BUILDTOOLS_REVISION=25.0.3 +# Read build variables +source subsurface/packaging/android/variables.sh while [ "$#" -gt 0 ] ; do case "$1" in @@ -76,12 +76,12 @@ done export ARCH # Configure where we can find things here -export ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT-$SUBSURFACE_SOURCE/../android-ndk-r14b} +export ANDROID_NDK_ROOT=${ANDROID_NDK_ROOT-$SUBSURFACE_SOURCE/../${ANDROID_NDK}} if [ -n "${QT5_ANDROID+X}" ] ; then echo "Using Qt5 in $QT5_ANDROID" -elif [ -d "$SUBSURFACE_SOURCE/../Qt/5.10.1" ] ; then - export QT5_ANDROID=$SUBSURFACE_SOURCE/../Qt/5.10.1 +elif [ -d "$SUBSURFACE_SOURCE/../Qt/${LATEST_QT}" ] ; then + export QT5_ANDROID=$SUBSURFACE_SOURCE/../Qt/${LATEST_QT} elif [ -d "$SUBSURFACE_SOURCE/../Qt/5.9.3" ] ; then export QT5_ANDROID=$SUBSURFACE_SOURCE/../Qt/5.9.3 elif [ -d "$SUBSURFACE_SOURCE/../Qt/5.9.1" ] ; then @@ -90,14 +90,8 @@ elif [ -d "$SUBSURFACE_SOURCE/../Qt/5.9" ] ; then export QT5_ANDROID=$SUBSURFACE_SOURCE/../Qt/5.9 elif [ -d "$SUBSURFACE_SOURCE/../Qt/5.8" ] ; then export QT5_ANDROID=$SUBSURFACE_SOURCE/../Qt/5.8 -elif [ -d "$SUBSURFACE_SOURCE/../Qt/5.7" ] ; then - export QT5_ANDROID=$SUBSURFACE_SOURCE/../Qt/5.7 -elif [ -d "$SUBSURFACE_SOURCE/../Qt/5.6" ] ; then - export QT5_ANDROID=$SUBSURFACE_SOURCE/../Qt/5.6 -elif [ -d "$SUBSURFACE_SOURCE/../Qt/5.5" ] ; then - export QT5_ANDROID=$SUBSURFACE_SOURCE/../Qt/5.5 else - echo "Cannot find Qt 5.5 or newer under $SUBSURFACE_SOURCE/../Qt" + echo "Cannot find Qt 5.8 or newer under $SUBSURFACE_SOURCE/../Qt" exit 1 fi @@ -109,9 +103,6 @@ else export ANDROID_NDK_HOST=linux-x86_64 fi -# Which versions are we building against? -OPENSSL_VERSION=1.0.2l - if [ "$ARCH" = "arm" ] ; then QT_ARCH=armv7 BUILDCHAIN=arm-linux-androideabi -- cgit v1.2.3-70-g09d2