diff options
-rwxr-xr-x | packaging/android/android-build-setup.sh | 62 | ||||
-rwxr-xr-x | packaging/android/android-build-wrapper.sh | 5 | ||||
-rw-r--r-- | packaging/android/variables.sh | 16 | ||||
-rwxr-xr-x | scripts/get-dep-lib.sh | 4 |
4 files changed, 76 insertions, 11 deletions
diff --git a/packaging/android/android-build-setup.sh b/packaging/android/android-build-setup.sh new file mode 100755 index 000000000..88f2d99be --- /dev/null +++ b/packaging/android/android-build-setup.sh @@ -0,0 +1,62 @@ +#!/bin/bash -eu + +# run this in the top level folder you want to create Android binaries in +# +# the script requires the Android Command Line Tools to be in cmdline-tools/bin +# + +exec 1> >(tee ./build.log) 2>&1 + +if [ "$(uname)" != Linux ] ; then + echo "only on Linux so far" + exit 1 +fi + +SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )" +export SUBSURFACE_SOURCE="$SCRIPTDIR"/../.. + +# these are the current versions for Qt, Android SDK & NDK: +source "$SCRIPTDIR"/variables.sh + +# make sure we were started from the right directory +if [ ! -d cmdline-tools ] ; then + echo "Start from within your Android build directory which needs to already include the Android Cmdline Tools" + exit 1 +fi + +# make sure we have the required commands installed +MISSING= +for i in git cmake autoconf libtool java wget unzip; do + command -v $i >/dev/null || + if [ $i = libtool ] ; then + MISSING="${MISSING}libtool-bin " + elif [ $i = java ] ; then + MISSING="${MISSING}openjdk-8-jdk " + else + MISSING="${MISSING}${i} " + fi +done +if [ "$MISSING" ] ; then + echo "The following packages are missing: $MISSING" + echo "Please install via your package manager." + exit 1 +fi + +# first we need to get the Android SDK and NDK +export JAVA_HOME=/usr +export ANDROID_HOME=$(pwd) +export PATH=$ANDROID_HOME/cmdline-tools/bin:/usr/local/bin:/bin +rm -rf cmdline-tools/latest +sdkmanager --sdk_root="$ANDROID_HOME" "ndk;$NDK_VERSION" "cmdline-tools;latest" "platform-tools" "platforms;$ANDROID_PLATFORMS" "build-tools;$ANDROID_BUILDTOOLS_REVISION" +echo "yyyyyyyy" | sdkmanager --sdk_root=/android --licenses + +# next check that Qt is installed +if [ ! -d "$LATEST_QT" ] ; then + aqt install -O /android "$LATEST_QT" linux android -m qtcharts +fi + +# now that we have an NDK, copy the font that we need for OnePlus phones +# due to https://bugreports.qt.io/browse/QTBUG-69494 +cp "$ANDROID_HOME"/platforms/"$ANDROID_PLATFORMS"/data/fonts/Roboto-Regular.ttf "$SUBSURFACE_SOURCE"/android-mobile || exit 1 + +echo "things are set up for the Android build" diff --git a/packaging/android/android-build-wrapper.sh b/packaging/android/android-build-wrapper.sh index 53b5e7e6f..86df1aa68 100755 --- a/packaging/android/android-build-wrapper.sh +++ b/packaging/android/android-build-wrapper.sh @@ -1,5 +1,10 @@ #!/bin/bash -eu +# THIS IS OBSOLETE AN ONLY WORKS UP TO Qt 5.13 +# for now keeping it around for reference + + + # run this in the top level folder you want to create Android binaries in # # it seems that with Qt5.7 (and later) and current cmake there is an odd bug where diff --git a/packaging/android/variables.sh b/packaging/android/variables.sh index 88d105756..f2c940a77 100644 --- a/packaging/android/variables.sh +++ b/packaging/android/variables.sh @@ -1,16 +1,14 @@ #!/bin/bash # When changing Qt version remember to update the # qt-installer-noninteractive file as well. -QT_VERSION=5.13 -LATEST_QT=5.13.2 -NDK_VERSION=r18b -SDK_VERSION=4333796 -ANDROID_BUILDTOOLS_REVISION=28.0.3 +QT_VERSION=5.15 +LATEST_QT=5.15.1 +NDK_VERSION=21.3.6528147 +ANDROID_BUILDTOOLS_REVISION=29.0.3 ANDROID_PLATFORM_LEVEL=21 ANDROID_PLATFORM=android-21 -ANDROID_PLATFORMS=android-27 -ANDROID_NDK=android-ndk-${NDK_VERSION} -ANDROID_SDK=android-sdk-linux +ANDROID_PLATFORMS=android-29 +ANDROID_NDK=ndk/${NDK_VERSION} # OpenSSL also has an entry in get-dep-lib.sh line 103 # that needs to be updated as well. -OPENSSL_VERSION=1.1.1d +OPENSSL_VERSION=1.1.1h diff --git a/scripts/get-dep-lib.sh b/scripts/get-dep-lib.sh index fb0b351b8..3a0bb5901 100755 --- a/scripts/get-dep-lib.sh +++ b/scripts/get-dep-lib.sh @@ -7,7 +7,7 @@ CURRENT_LIBZIP="rel-1-5-1" CURRENT_LIBGIT2="v1.0.1" CURRENT_LIBCURL="curl-7_54_1" CURRENT_LIBUSB="v1.0.21" -CURRENT_OPENSSL="OpenSSL_1_1_0h" +CURRENT_OPENSSL="OpenSSL_1_1_1h" CURRENT_LIBSSH2="libssh2-1.8.0" CURRENT_XSLT="v1.1.34" CURRENT_SQLITE="3190200" @@ -103,7 +103,7 @@ fi # FIX FOR ANDROID, if [ "$PLATFORM" == "singleAndroid" ] ; then - CURRENT_OPENSSL="OpenSSL_1_1_1d" + CURRENT_OPENSSL="OpenSSL_1_1_1h" # If changing the openSSL version here, make sure to change it in packaging/android/variables.sh also. fi # no curl and old libs (never version breaks) |