From 8bcbcdde529c4f5cc9f57091d91ad4927cb3f912 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 5 Dec 2020 21:42:56 +0100 Subject: [PATCH] Revert android-*-qt5 packages to 5.13.1 Further versions broke the build system, see 18443d861e950940c4305b241d86da498eea446d. With 5.15.1 it basically works again but deployment with androiddeployqt does not produce runnable APKs. Qt now has gained support for invoking androiddeployqt within CMake. Using their official support instead of my own helper might have worked but it could not cope with the fact that I had multiple targets in my CMake project and was therefore useless in my case. So let's ditch Qt 5 on Android and give Qt 6 another chance at some point. --- .../0001-Disable-mapboxgl.patch | 29 ++++++ ...1-Fix-clang-libc-build-under-Android.patch | 40 ++++++++ ...002-Fix-androiddeployqt-search-paths.patch | 34 +++++++ ...003-Support-pkg-config-under-Android.patch | 24 +++++ .../0004-Use-pkg-config-to-find-libjpeg.patch | 24 +++++ qt5/android-aarch64/PKGBUILD | 91 +++++++++---------- .../0001-Disable-mapboxgl.patch | 29 ++++++ ...1-Fix-clang-libc-build-under-Android.patch | 40 ++++++++ ...002-Fix-androiddeployqt-search-paths.patch | 34 +++++++ ...003-Support-pkg-config-under-Android.patch | 24 +++++ .../0004-Use-pkg-config-to-find-libjpeg.patch | 24 +++++ qt5/android-armv7a-eabi/PKGBUILD | 91 +++++++++---------- .../0001-Disable-mapboxgl.patch | 29 ++++++ ...1-Fix-clang-libc-build-under-Android.patch | 40 ++++++++ ...002-Fix-androiddeployqt-search-paths.patch | 34 +++++++ ...003-Support-pkg-config-under-Android.patch | 24 +++++ .../0004-Use-pkg-config-to-find-libjpeg.patch | 24 +++++ qt5/android-x86-64/PKGBUILD | 91 +++++++++---------- 18 files changed, 576 insertions(+), 150 deletions(-) create mode 100644 qt5/android-aarch64/0001-Disable-mapboxgl.patch create mode 100644 qt5/android-aarch64/0001-Fix-clang-libc-build-under-Android.patch create mode 100644 qt5/android-aarch64/0002-Fix-androiddeployqt-search-paths.patch create mode 100644 qt5/android-aarch64/0003-Support-pkg-config-under-Android.patch create mode 100644 qt5/android-aarch64/0004-Use-pkg-config-to-find-libjpeg.patch create mode 100644 qt5/android-armv7a-eabi/0001-Disable-mapboxgl.patch create mode 100644 qt5/android-armv7a-eabi/0001-Fix-clang-libc-build-under-Android.patch create mode 100644 qt5/android-armv7a-eabi/0002-Fix-androiddeployqt-search-paths.patch create mode 100644 qt5/android-armv7a-eabi/0003-Support-pkg-config-under-Android.patch create mode 100644 qt5/android-armv7a-eabi/0004-Use-pkg-config-to-find-libjpeg.patch create mode 100644 qt5/android-x86-64/0001-Disable-mapboxgl.patch create mode 100644 qt5/android-x86-64/0001-Fix-clang-libc-build-under-Android.patch create mode 100644 qt5/android-x86-64/0002-Fix-androiddeployqt-search-paths.patch create mode 100644 qt5/android-x86-64/0003-Support-pkg-config-under-Android.patch create mode 100644 qt5/android-x86-64/0004-Use-pkg-config-to-find-libjpeg.patch diff --git a/qt5/android-aarch64/0001-Disable-mapboxgl.patch b/qt5/android-aarch64/0001-Disable-mapboxgl.patch new file mode 100644 index 00000000..45b9c353 --- /dev/null +++ b/qt5/android-aarch64/0001-Disable-mapboxgl.patch @@ -0,0 +1,29 @@ +From dbe68d96e7da8ba5e5484e6ad0bbd78c9b0a8eec Mon Sep 17 00:00:00 2001 +From: Martchus +Date: Sun, 9 Dec 2018 14:29:59 +0100 +Subject: [PATCH] Disable mapboxgl + +--- + src/plugins/geoservices/geoservices.pro | 9 --------- + 1 file changed, 9 deletions(-) + +diff --git a/src/plugins/geoservices/geoservices.pro b/src/plugins/geoservices/geoservices.pro +index b81ad34a..98308c97 100644 +--- a/src/plugins/geoservices/geoservices.pro ++++ b/src/plugins/geoservices/geoservices.pro +@@ -7,12 +7,3 @@ qtConfig(geoservices_mapbox): SUBDIRS += mapbox + qtConfig(geoservices_esri): SUBDIRS += esri + qtConfig(geoservices_itemsoverlay): SUBDIRS += itemsoverlay + qtConfig(geoservices_osm): SUBDIRS += osm +- +-qtConfig(geoservices_mapboxgl) { +- !exists(../../3rdparty/mapbox-gl-native/mapbox-gl-native.pro) { +- warning("Submodule mapbox-gl-native does not exist. Run 'git submodule update --init' on qtlocation.") +- } else { +- SUBDIRS += mapboxgl ../../3rdparty/mapbox-gl-native +- mapboxgl.depends = ../../3rdparty/mapbox-gl-native +- } +-} +-- +2.23.0 + diff --git a/qt5/android-aarch64/0001-Fix-clang-libc-build-under-Android.patch b/qt5/android-aarch64/0001-Fix-clang-libc-build-under-Android.patch new file mode 100644 index 00000000..05e4091c --- /dev/null +++ b/qt5/android-aarch64/0001-Fix-clang-libc-build-under-Android.patch @@ -0,0 +1,40 @@ +From 2c8ca36b5f87ccfc039c0b669c80f21205769758 Mon Sep 17 00:00:00 2001 +From: Martchus +Date: Sun, 9 Dec 2018 14:28:07 +0100 +Subject: [PATCH 1/4] Fix clang/libc++ build under Android + +--- + mkspecs/android-clang/qmake.conf | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/mkspecs/android-clang/qmake.conf b/mkspecs/android-clang/qmake.conf +index 05b7979142..83d030793b 100644 +--- a/mkspecs/android-clang/qmake.conf ++++ b/mkspecs/android-clang/qmake.conf +@@ -30,11 +30,12 @@ QMAKE_CFLAGS += -gcc-toolchain $$NDK_TOOLCHAIN_PATH -fno-limit-debug-info + QMAKE_LINK = $$QMAKE_CXX $$QMAKE_CFLAGS -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ + equals(ANDROID_TARGET_ARCH, armeabi-v7a): QMAKE_LINK += -Wl,--exclude-libs,libunwind.a + +-QMAKE_CFLAGS += -DANDROID_HAS_WSTRING --sysroot=$$NDK_ROOT/sysroot \ ++QMAKE_CFLAGS += -DANDROID_HAS_WSTRING --sysroot=$$ANDROID_PLATFORM_ROOT_PATH \ + -isystem $$NDK_ROOT/sysroot/usr/include/$$NDK_TOOLS_PREFIX \ + -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++/include \ + -isystem $$NDK_ROOT/sources/android/support/include \ +- -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++abi/include ++ -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++abi/include \ ++ -isystem $$NDK_ROOT/sysroot/usr/include + + ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/$$ANDROID_TARGET_ARCH + +@@ -44,6 +45,8 @@ ANDROID_USE_LLVM = true + + exists($$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++.so): \ + ANDROID_CXX_STL_LIBS = -lc++ ++else: exists($$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++_shared.so): \ ++ ANDROID_CXX_STL_LIBS = -lc++_shared + else: \ + ANDROID_CXX_STL_LIBS = $$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++.so.$$replace(ANDROID_PLATFORM, "android-", "") + +-- +2.23.0 + diff --git a/qt5/android-aarch64/0002-Fix-androiddeployqt-search-paths.patch b/qt5/android-aarch64/0002-Fix-androiddeployqt-search-paths.patch new file mode 100644 index 00000000..f01167eb --- /dev/null +++ b/qt5/android-aarch64/0002-Fix-androiddeployqt-search-paths.patch @@ -0,0 +1,34 @@ +From 996c53a388705a0bbf778faaf7660efad98e1eff Mon Sep 17 00:00:00 2001 +From: Martchus +Date: Sun, 9 Dec 2018 14:31:30 +0100 +Subject: [PATCH 2/4] Fix androiddeployqt search paths + +--- + src/tools/androiddeployqt/main.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp +index 01c392f8f9..9600d657cb 100644 +--- a/src/tools/androiddeployqt/main.cpp ++++ b/src/tools/androiddeployqt/main.cpp +@@ -1721,7 +1721,7 @@ bool scanImports(Options *options, QSet *usedDependencies) + rootPath += QLatin1Char('/'); + + QStringList importPaths; +- importPaths += shellQuote(options->qtInstallDirectory + QLatin1String("/qml")); ++ importPaths += shellQuote(options->qtInstallDirectory + QLatin1String("/lib/qt/qml")); + importPaths += shellQuote(rootPath); + for (const QString &qmlImportPath : qAsConst(options->qmlImportPaths)) + importPaths += shellQuote(qmlImportPath); +@@ -1857,7 +1857,7 @@ bool readDependencies(Options *options) + return false; + + // Jam in the dependencies of the platform plugin, since the application will crash without it +- if (!readDependenciesFromElf(options, options->qtInstallDirectory + QLatin1String("/plugins/platforms/android/libqtforandroid.so"), &usedDependencies, &remainingDependencies)) ++ if (!readDependenciesFromElf(options, options->qtInstallDirectory + QLatin1String("/lib/qt/plugins/platforms/android/libqtforandroid.so"), &usedDependencies, &remainingDependencies)) + return false; + + while (!remainingDependencies.isEmpty()) { +-- +2.23.0 + diff --git a/qt5/android-aarch64/0003-Support-pkg-config-under-Android.patch b/qt5/android-aarch64/0003-Support-pkg-config-under-Android.patch new file mode 100644 index 00000000..66a21a05 --- /dev/null +++ b/qt5/android-aarch64/0003-Support-pkg-config-under-Android.patch @@ -0,0 +1,24 @@ +From a71a1223328539ee403884a24d1dbc5a685d40dd Mon Sep 17 00:00:00 2001 +From: Martchus +Date: Sun, 7 Apr 2019 09:54:49 +0200 +Subject: [PATCH 3/4] Support pkg-config under Android + +from https://aur.archlinux.org/cgit/aur.git/commit/?h=android-aarch64-qt5&id=d901da324b2ceea2ac99b48137cb82b2bd920c77 +--- + mkspecs/android-clang/qmake.conf | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/mkspecs/android-clang/qmake.conf b/mkspecs/android-clang/qmake.conf +index 83d030793b..8f145a2bb7 100644 +--- a/mkspecs/android-clang/qmake.conf ++++ b/mkspecs/android-clang/qmake.conf +@@ -53,3 +53,6 @@ else: \ + QMAKE_CFLAGS_OPTIMIZE_SIZE = -Oz + + include(../common/android-base-tail.conf) ++ ++QMAKE_PKG_CONFIG = $$[QT_INSTALL_PREFIX] ++QMAKE_PKG_CONFIG = android-$$section(QMAKE_PKG_CONFIG, /, 3, 3)-pkg-config +-- +2.23.0 + diff --git a/qt5/android-aarch64/0004-Use-pkg-config-to-find-libjpeg.patch b/qt5/android-aarch64/0004-Use-pkg-config-to-find-libjpeg.patch new file mode 100644 index 00000000..25f5b8db --- /dev/null +++ b/qt5/android-aarch64/0004-Use-pkg-config-to-find-libjpeg.patch @@ -0,0 +1,24 @@ +From 9cd435c730949e29104bbfa2bdd82ed2c662ca3d Mon Sep 17 00:00:00 2001 +From: Martchus +Date: Sat, 7 Sep 2019 13:21:37 +0200 +Subject: [PATCH 4/4] Use pkg-config to find libjpeg + +--- + src/gui/configure.json | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/gui/configure.json b/src/gui/configure.json +index 6280b4dfa2..206f83984a 100644 +--- a/src/gui/configure.json ++++ b/src/gui/configure.json +@@ -373,6 +373,7 @@ + }, + "headers": "jpeglib.h", + "sources": [ ++ { "type": "pkgConfig", "args": "libjpeg" }, + { "libs": "-llibjpeg", "condition": "config.msvc" }, + "-ljpeg" + ] +-- +2.23.0 + diff --git a/qt5/android-aarch64/PKGBUILD b/qt5/android-aarch64/PKGBUILD index 35355945..ed23394e 100644 --- a/qt5/android-aarch64/PKGBUILD +++ b/qt5/android-aarch64/PKGBUILD @@ -7,12 +7,10 @@ _pkg_arch=aarch64 _android_arch=arm64-v8a -_android_min_platform=24 -_android_api_platform=30 -_android_ndk_platform=$_android_min_platform +_android_platform=22 pkgname=android-$_pkg_arch-qt5 -pkgver=5.15.2 +pkgver=5.13.1 pkgrel=1 pkgdesc="Qt 5 for Android" arch=('x86_64') @@ -27,23 +25,20 @@ makedepends=('libgl' 'gperf' 'libxslt' 'fontconfig' - 'ninja' 'java-environment-openjdk<=8' 'android-environment' - 'android-pkg-config') + 'android-pkg-config' + "android-$_pkg_arch-openssl") depends=('java-runtime-headless-openjdk<=8' 'apache-ant' 'android-ndk' + "android-platform-$_android_platform" 'android-sdk' 'android-sdk-build-tools' 'android-sdk-platform-tools' - 'android-platform' - "android-$_pkg_arch-libjpeg-turbo" + "android-$_pkg_arch-zlib" "android-$_pkg_arch-libpng" - "android-$_pkg_arch-libwebp" - "android-$_pkg_arch-libtiff" - "android-$_pkg_arch-openssl" - "android-$_pkg_arch-zlib") + "android-$_pkg_arch-libjpeg-turbo") groups=('android-qt5') conflicts=("android-qt5-${_android_arch}") replaces=("android-qt5-${_android_arch}") @@ -73,47 +68,51 @@ optdepends+=("android-$_pkg_arch-openssl: SSL support for Qt Network") options=(!strip !buildflags staticlibs !emptydirs) _pkgfqn="qt-everywhere-src-${pkgver}" source=("http://download.qt-project.org/official_releases/qt/${pkgver:0:4}/${pkgver}/single/${_pkgfqn}.tar.xz" - '0001-Support-pkg-config-under-Android.patch' - '0002-Force-64-bit-atomics-usage.patch') -sha256sums=('44da876057e21e1be42de31facd99be7d5f9f07893e1ea762359bcee0ef64ee9' - '435047d2f09baf2e706c86604c944686e71ab6d7678203b68e7d28af7beb5ce8' - '1f0aab5dcf7976285ffbb9069f127087f15d60a23485fadf17312090453d6784') + '0001-Fix-clang-libc-build-under-Android.patch' + '0002-Fix-androiddeployqt-search-paths.patch' + '0003-Support-pkg-config-under-Android.patch' + '0004-Use-pkg-config-to-find-libjpeg.patch' + '0001-Disable-mapboxgl.patch') +sha256sums=('adf00266dc38352a166a9739f1a24a1e36f1be9c04bf72e16e142a256436974e' + '29bcb93f9c79ad4b0709efa42694ed917b6e4cfce69a805e79a7dc3144be7765' + '7a5520311ba2edee2ffcd546cd6e08248c8f73deed33bd8075649577f8cb1446' + '5c3f0725f3c27263661ff5ebb4b279e4483de8ed70dee4fe42a84d31b3f2e4a9' + '4f3ba22616040a2979bfdf840b44bf105374ea2fac866c42977ad7ec6e87ddcc' + '6151b784050f9d4ef3eec22dd33360d3f566d4834592f1171df91a10c95fab77') prepare() { - export ANDROID_MINIMUM_PLATFORM=$_android_min_platform - export ANDROID_API_VERSION=android-$_android_api_platform - export ANDROID_NDK_PLATFORM=android-$_android_ndk_platform + export ANDROID_MINIMUM_PLATFORM=${_android_platform} source android-env ${_pkg_arch} - check_ndk_version_ge_than 18.0 - check_android_platform - cd ${_pkgfqn} pushd qtbase - patch -Np1 -i "../../0001-Support-pkg-config-under-Android.patch" - case "$_android_arch" in - aarch64 | x86-64) - patch -Np1 -i "../../0002-Force-64-bit-atomics-usage.patch" - ;; - *) - ;; - esac + patch -Np1 -i "../../0001-Fix-clang-libc-build-under-Android.patch" + #patch -Np1 -i "../../0002-Fix-androiddeployqt-search-paths.patch" + patch -Np1 -i "../../0003-Support-pkg-config-under-Android.patch" + patch -Np1 -i "../../0004-Use-pkg-config-to-find-libjpeg.patch" popd - sed -i "s/android-21/android-$ANDROID_MINIMUM_PLATFORM/g" qtbase/configure.pri + pushd qtlocation + # skip building mapboxgl as it increases compile time significantly and + # likely not a lot of people actually using it; if you need it, just remove the + # following line: + patch -Np1 -i "../../0001-Disable-mapboxgl.patch" + popd + + sed -i "s/android-16/android-$ANDROID_MINIMUM_PLATFORM/g" qtbase/mkspecs/features/android/sdk.prf + sed -i "s/android-16/android-$ANDROID_MINIMUM_PLATFORM/g" qtbase/src/android/jar/jar.pro + sed -i "s/android-16/android-$ANDROID_MINIMUM_PLATFORM/g" qtgamepad/src/plugins/gamepads/android/jar/jar.pro + sed -i "s/android-16/android-$ANDROID_MINIMUM_PLATFORM/g" qtbase/configure.pri } build() { - export ANDROID_MINIMUM_PLATFORM=$_android_min_platform - export ANDROID_API_VERSION=android-$_android_api_platform - export ANDROID_NDK_PLATFORM=android-$_android_ndk_platform + export ANDROID_MINIMUM_PLATFORM=${_android_platform} source android-env ${_pkg_arch} unset CC CXX CFLAGS CXXFLAGS LDFLAGS CHOST QMAKESPEC QTDIR CARCH export PKG_CONFIG=$ANDROID_PKGCONFIG - export ANDROID_TARGET_ARCH=${ANDROID_ABI} export PYTHON=/usr/bin/python2 cd ${_pkgfqn} @@ -127,30 +126,24 @@ build() { -xplatform android-clang -nomake tests -nomake examples - -android-sdk ${ANDROID_HOME} -android-ndk ${ANDROID_NDK_HOME} + -android-sdk ${ANDROID_HOME} -android-ndk-host linux-x86_64 - -android-ndk-platform ${ANDROID_NDK_PLATFORM} - -android-abis ${ANDROID_ABI} + -android-toolchain-version 4.9 -skip qtserialport - -skip qtwebengine -no-warnings-are-errors -pkg-config -system-zlib -system-libpng -system-libjpeg - -system-webp - -system-tiff - -no-feature-geoservices_mapbox - -no-feature-geoservices_mapboxgl -qt-freetype -openssl-runtime - -verbose + -android-arch ${ANDROID_ABI} + -android-ndk-platform ${ANDROID_NDK_PLATFORM} + -recheck-all -optimized-qmake -I${ANDROID_PREFIX}/include" - # note: use -recheck-all and/or -redo to continue - [[ $ANDROID_DEBUG_BUILD ]] \ && configue_opts+=' -debug-and-release' \ || configue_opts+=' -release' @@ -172,9 +165,7 @@ build() { } package() { - export ANDROID_MINIMUM_PLATFORM=$_android_min_platform - export ANDROID_API_VERSION=android-$_android_api_platform - export ANDROID_NDK_PLATFORM=android-$_android_ndk_platform + export ANDROID_MINIMUM_PLATFORM=${_android_platform} source android-env ${_pkg_arch} cd ${_pkgfqn} diff --git a/qt5/android-armv7a-eabi/0001-Disable-mapboxgl.patch b/qt5/android-armv7a-eabi/0001-Disable-mapboxgl.patch new file mode 100644 index 00000000..45b9c353 --- /dev/null +++ b/qt5/android-armv7a-eabi/0001-Disable-mapboxgl.patch @@ -0,0 +1,29 @@ +From dbe68d96e7da8ba5e5484e6ad0bbd78c9b0a8eec Mon Sep 17 00:00:00 2001 +From: Martchus +Date: Sun, 9 Dec 2018 14:29:59 +0100 +Subject: [PATCH] Disable mapboxgl + +--- + src/plugins/geoservices/geoservices.pro | 9 --------- + 1 file changed, 9 deletions(-) + +diff --git a/src/plugins/geoservices/geoservices.pro b/src/plugins/geoservices/geoservices.pro +index b81ad34a..98308c97 100644 +--- a/src/plugins/geoservices/geoservices.pro ++++ b/src/plugins/geoservices/geoservices.pro +@@ -7,12 +7,3 @@ qtConfig(geoservices_mapbox): SUBDIRS += mapbox + qtConfig(geoservices_esri): SUBDIRS += esri + qtConfig(geoservices_itemsoverlay): SUBDIRS += itemsoverlay + qtConfig(geoservices_osm): SUBDIRS += osm +- +-qtConfig(geoservices_mapboxgl) { +- !exists(../../3rdparty/mapbox-gl-native/mapbox-gl-native.pro) { +- warning("Submodule mapbox-gl-native does not exist. Run 'git submodule update --init' on qtlocation.") +- } else { +- SUBDIRS += mapboxgl ../../3rdparty/mapbox-gl-native +- mapboxgl.depends = ../../3rdparty/mapbox-gl-native +- } +-} +-- +2.23.0 + diff --git a/qt5/android-armv7a-eabi/0001-Fix-clang-libc-build-under-Android.patch b/qt5/android-armv7a-eabi/0001-Fix-clang-libc-build-under-Android.patch new file mode 100644 index 00000000..05e4091c --- /dev/null +++ b/qt5/android-armv7a-eabi/0001-Fix-clang-libc-build-under-Android.patch @@ -0,0 +1,40 @@ +From 2c8ca36b5f87ccfc039c0b669c80f21205769758 Mon Sep 17 00:00:00 2001 +From: Martchus +Date: Sun, 9 Dec 2018 14:28:07 +0100 +Subject: [PATCH 1/4] Fix clang/libc++ build under Android + +--- + mkspecs/android-clang/qmake.conf | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/mkspecs/android-clang/qmake.conf b/mkspecs/android-clang/qmake.conf +index 05b7979142..83d030793b 100644 +--- a/mkspecs/android-clang/qmake.conf ++++ b/mkspecs/android-clang/qmake.conf +@@ -30,11 +30,12 @@ QMAKE_CFLAGS += -gcc-toolchain $$NDK_TOOLCHAIN_PATH -fno-limit-debug-info + QMAKE_LINK = $$QMAKE_CXX $$QMAKE_CFLAGS -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ + equals(ANDROID_TARGET_ARCH, armeabi-v7a): QMAKE_LINK += -Wl,--exclude-libs,libunwind.a + +-QMAKE_CFLAGS += -DANDROID_HAS_WSTRING --sysroot=$$NDK_ROOT/sysroot \ ++QMAKE_CFLAGS += -DANDROID_HAS_WSTRING --sysroot=$$ANDROID_PLATFORM_ROOT_PATH \ + -isystem $$NDK_ROOT/sysroot/usr/include/$$NDK_TOOLS_PREFIX \ + -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++/include \ + -isystem $$NDK_ROOT/sources/android/support/include \ +- -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++abi/include ++ -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++abi/include \ ++ -isystem $$NDK_ROOT/sysroot/usr/include + + ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/$$ANDROID_TARGET_ARCH + +@@ -44,6 +45,8 @@ ANDROID_USE_LLVM = true + + exists($$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++.so): \ + ANDROID_CXX_STL_LIBS = -lc++ ++else: exists($$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++_shared.so): \ ++ ANDROID_CXX_STL_LIBS = -lc++_shared + else: \ + ANDROID_CXX_STL_LIBS = $$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++.so.$$replace(ANDROID_PLATFORM, "android-", "") + +-- +2.23.0 + diff --git a/qt5/android-armv7a-eabi/0002-Fix-androiddeployqt-search-paths.patch b/qt5/android-armv7a-eabi/0002-Fix-androiddeployqt-search-paths.patch new file mode 100644 index 00000000..f01167eb --- /dev/null +++ b/qt5/android-armv7a-eabi/0002-Fix-androiddeployqt-search-paths.patch @@ -0,0 +1,34 @@ +From 996c53a388705a0bbf778faaf7660efad98e1eff Mon Sep 17 00:00:00 2001 +From: Martchus +Date: Sun, 9 Dec 2018 14:31:30 +0100 +Subject: [PATCH 2/4] Fix androiddeployqt search paths + +--- + src/tools/androiddeployqt/main.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp +index 01c392f8f9..9600d657cb 100644 +--- a/src/tools/androiddeployqt/main.cpp ++++ b/src/tools/androiddeployqt/main.cpp +@@ -1721,7 +1721,7 @@ bool scanImports(Options *options, QSet *usedDependencies) + rootPath += QLatin1Char('/'); + + QStringList importPaths; +- importPaths += shellQuote(options->qtInstallDirectory + QLatin1String("/qml")); ++ importPaths += shellQuote(options->qtInstallDirectory + QLatin1String("/lib/qt/qml")); + importPaths += shellQuote(rootPath); + for (const QString &qmlImportPath : qAsConst(options->qmlImportPaths)) + importPaths += shellQuote(qmlImportPath); +@@ -1857,7 +1857,7 @@ bool readDependencies(Options *options) + return false; + + // Jam in the dependencies of the platform plugin, since the application will crash without it +- if (!readDependenciesFromElf(options, options->qtInstallDirectory + QLatin1String("/plugins/platforms/android/libqtforandroid.so"), &usedDependencies, &remainingDependencies)) ++ if (!readDependenciesFromElf(options, options->qtInstallDirectory + QLatin1String("/lib/qt/plugins/platforms/android/libqtforandroid.so"), &usedDependencies, &remainingDependencies)) + return false; + + while (!remainingDependencies.isEmpty()) { +-- +2.23.0 + diff --git a/qt5/android-armv7a-eabi/0003-Support-pkg-config-under-Android.patch b/qt5/android-armv7a-eabi/0003-Support-pkg-config-under-Android.patch new file mode 100644 index 00000000..66a21a05 --- /dev/null +++ b/qt5/android-armv7a-eabi/0003-Support-pkg-config-under-Android.patch @@ -0,0 +1,24 @@ +From a71a1223328539ee403884a24d1dbc5a685d40dd Mon Sep 17 00:00:00 2001 +From: Martchus +Date: Sun, 7 Apr 2019 09:54:49 +0200 +Subject: [PATCH 3/4] Support pkg-config under Android + +from https://aur.archlinux.org/cgit/aur.git/commit/?h=android-aarch64-qt5&id=d901da324b2ceea2ac99b48137cb82b2bd920c77 +--- + mkspecs/android-clang/qmake.conf | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/mkspecs/android-clang/qmake.conf b/mkspecs/android-clang/qmake.conf +index 83d030793b..8f145a2bb7 100644 +--- a/mkspecs/android-clang/qmake.conf ++++ b/mkspecs/android-clang/qmake.conf +@@ -53,3 +53,6 @@ else: \ + QMAKE_CFLAGS_OPTIMIZE_SIZE = -Oz + + include(../common/android-base-tail.conf) ++ ++QMAKE_PKG_CONFIG = $$[QT_INSTALL_PREFIX] ++QMAKE_PKG_CONFIG = android-$$section(QMAKE_PKG_CONFIG, /, 3, 3)-pkg-config +-- +2.23.0 + diff --git a/qt5/android-armv7a-eabi/0004-Use-pkg-config-to-find-libjpeg.patch b/qt5/android-armv7a-eabi/0004-Use-pkg-config-to-find-libjpeg.patch new file mode 100644 index 00000000..25f5b8db --- /dev/null +++ b/qt5/android-armv7a-eabi/0004-Use-pkg-config-to-find-libjpeg.patch @@ -0,0 +1,24 @@ +From 9cd435c730949e29104bbfa2bdd82ed2c662ca3d Mon Sep 17 00:00:00 2001 +From: Martchus +Date: Sat, 7 Sep 2019 13:21:37 +0200 +Subject: [PATCH 4/4] Use pkg-config to find libjpeg + +--- + src/gui/configure.json | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/gui/configure.json b/src/gui/configure.json +index 6280b4dfa2..206f83984a 100644 +--- a/src/gui/configure.json ++++ b/src/gui/configure.json +@@ -373,6 +373,7 @@ + }, + "headers": "jpeglib.h", + "sources": [ ++ { "type": "pkgConfig", "args": "libjpeg" }, + { "libs": "-llibjpeg", "condition": "config.msvc" }, + "-ljpeg" + ] +-- +2.23.0 + diff --git a/qt5/android-armv7a-eabi/PKGBUILD b/qt5/android-armv7a-eabi/PKGBUILD index 4a23a896..3485e5c8 100644 --- a/qt5/android-armv7a-eabi/PKGBUILD +++ b/qt5/android-armv7a-eabi/PKGBUILD @@ -7,12 +7,10 @@ _pkg_arch=armv7a-eabi _android_arch=armeabi-v7a -_android_min_platform=24 -_android_api_platform=30 -_android_ndk_platform=$_android_min_platform +_android_platform=21 pkgname=android-$_pkg_arch-qt5 -pkgver=5.15.2 +pkgver=5.13.1 pkgrel=1 pkgdesc="Qt 5 for Android" arch=('x86_64') @@ -27,23 +25,20 @@ makedepends=('libgl' 'gperf' 'libxslt' 'fontconfig' - 'ninja' 'java-environment-openjdk<=8' 'android-environment' - 'android-pkg-config') + 'android-pkg-config' + "android-$_pkg_arch-openssl") depends=('java-runtime-headless-openjdk<=8' 'apache-ant' 'android-ndk' + "android-platform-$_android_platform" 'android-sdk' 'android-sdk-build-tools' 'android-sdk-platform-tools' - 'android-platform' - "android-$_pkg_arch-libjpeg-turbo" + "android-$_pkg_arch-zlib" "android-$_pkg_arch-libpng" - "android-$_pkg_arch-libwebp" - "android-$_pkg_arch-libtiff" - "android-$_pkg_arch-openssl" - "android-$_pkg_arch-zlib") + "android-$_pkg_arch-libjpeg-turbo") groups=('android-qt5') conflicts=("android-qt5-${_android_arch}") replaces=("android-qt5-${_android_arch}") @@ -73,47 +68,51 @@ optdepends+=("android-$_pkg_arch-openssl: SSL support for Qt Network") options=(!strip !buildflags staticlibs !emptydirs) _pkgfqn="qt-everywhere-src-${pkgver}" source=("http://download.qt-project.org/official_releases/qt/${pkgver:0:4}/${pkgver}/single/${_pkgfqn}.tar.xz" - '0001-Support-pkg-config-under-Android.patch' - '0002-Force-64-bit-atomics-usage.patch') -sha256sums=('44da876057e21e1be42de31facd99be7d5f9f07893e1ea762359bcee0ef64ee9' - '435047d2f09baf2e706c86604c944686e71ab6d7678203b68e7d28af7beb5ce8' - '1f0aab5dcf7976285ffbb9069f127087f15d60a23485fadf17312090453d6784') + '0001-Fix-clang-libc-build-under-Android.patch' + '0002-Fix-androiddeployqt-search-paths.patch' + '0003-Support-pkg-config-under-Android.patch' + '0004-Use-pkg-config-to-find-libjpeg.patch' + '0001-Disable-mapboxgl.patch') +sha256sums=('adf00266dc38352a166a9739f1a24a1e36f1be9c04bf72e16e142a256436974e' + '29bcb93f9c79ad4b0709efa42694ed917b6e4cfce69a805e79a7dc3144be7765' + '7a5520311ba2edee2ffcd546cd6e08248c8f73deed33bd8075649577f8cb1446' + '5c3f0725f3c27263661ff5ebb4b279e4483de8ed70dee4fe42a84d31b3f2e4a9' + '4f3ba22616040a2979bfdf840b44bf105374ea2fac866c42977ad7ec6e87ddcc' + '6151b784050f9d4ef3eec22dd33360d3f566d4834592f1171df91a10c95fab77') prepare() { - export ANDROID_MINIMUM_PLATFORM=$_android_min_platform - export ANDROID_API_VERSION=android-$_android_api_platform - export ANDROID_NDK_PLATFORM=android-$_android_ndk_platform + export ANDROID_MINIMUM_PLATFORM=${_android_platform} source android-env ${_pkg_arch} - check_ndk_version_ge_than 18.0 - check_android_platform - cd ${_pkgfqn} pushd qtbase - patch -Np1 -i "../../0001-Support-pkg-config-under-Android.patch" - case "$_android_arch" in - aarch64 | x86-64) - patch -Np1 -i "../../0002-Force-64-bit-atomics-usage.patch" - ;; - *) - ;; - esac + patch -Np1 -i "../../0001-Fix-clang-libc-build-under-Android.patch" + #patch -Np1 -i "../../0002-Fix-androiddeployqt-search-paths.patch" + patch -Np1 -i "../../0003-Support-pkg-config-under-Android.patch" + patch -Np1 -i "../../0004-Use-pkg-config-to-find-libjpeg.patch" popd - sed -i "s/android-21/android-$ANDROID_MINIMUM_PLATFORM/g" qtbase/configure.pri + pushd qtlocation + # skip building mapboxgl as it increases compile time significantly and + # likely not a lot of people actually using it; if you need it, just remove the + # following line: + patch -Np1 -i "../../0001-Disable-mapboxgl.patch" + popd + + sed -i "s/android-16/android-$ANDROID_MINIMUM_PLATFORM/g" qtbase/mkspecs/features/android/sdk.prf + sed -i "s/android-16/android-$ANDROID_MINIMUM_PLATFORM/g" qtbase/src/android/jar/jar.pro + sed -i "s/android-16/android-$ANDROID_MINIMUM_PLATFORM/g" qtgamepad/src/plugins/gamepads/android/jar/jar.pro + sed -i "s/android-16/android-$ANDROID_MINIMUM_PLATFORM/g" qtbase/configure.pri } build() { - export ANDROID_MINIMUM_PLATFORM=$_android_min_platform - export ANDROID_API_VERSION=android-$_android_api_platform - export ANDROID_NDK_PLATFORM=android-$_android_ndk_platform + export ANDROID_MINIMUM_PLATFORM=${_android_platform} source android-env ${_pkg_arch} unset CC CXX CFLAGS CXXFLAGS LDFLAGS CHOST QMAKESPEC QTDIR CARCH export PKG_CONFIG=$ANDROID_PKGCONFIG - export ANDROID_TARGET_ARCH=${ANDROID_ABI} export PYTHON=/usr/bin/python2 cd ${_pkgfqn} @@ -127,30 +126,24 @@ build() { -xplatform android-clang -nomake tests -nomake examples - -android-sdk ${ANDROID_HOME} -android-ndk ${ANDROID_NDK_HOME} + -android-sdk ${ANDROID_HOME} -android-ndk-host linux-x86_64 - -android-ndk-platform ${ANDROID_NDK_PLATFORM} - -android-abis ${ANDROID_ABI} + -android-toolchain-version 4.9 -skip qtserialport - -skip qtwebengine -no-warnings-are-errors -pkg-config -system-zlib -system-libpng -system-libjpeg - -system-webp - -system-tiff - -no-feature-geoservices_mapbox - -no-feature-geoservices_mapboxgl -qt-freetype -openssl-runtime - -verbose + -android-arch ${ANDROID_ABI} + -android-ndk-platform ${ANDROID_NDK_PLATFORM} + -recheck-all -optimized-qmake -I${ANDROID_PREFIX}/include" - # note: use -recheck-all and/or -redo to continue - [[ $ANDROID_DEBUG_BUILD ]] \ && configue_opts+=' -debug-and-release' \ || configue_opts+=' -release' @@ -172,9 +165,7 @@ build() { } package() { - export ANDROID_MINIMUM_PLATFORM=$_android_min_platform - export ANDROID_API_VERSION=android-$_android_api_platform - export ANDROID_NDK_PLATFORM=android-$_android_ndk_platform + export ANDROID_MINIMUM_PLATFORM=${_android_platform} source android-env ${_pkg_arch} cd ${_pkgfqn} diff --git a/qt5/android-x86-64/0001-Disable-mapboxgl.patch b/qt5/android-x86-64/0001-Disable-mapboxgl.patch new file mode 100644 index 00000000..45b9c353 --- /dev/null +++ b/qt5/android-x86-64/0001-Disable-mapboxgl.patch @@ -0,0 +1,29 @@ +From dbe68d96e7da8ba5e5484e6ad0bbd78c9b0a8eec Mon Sep 17 00:00:00 2001 +From: Martchus +Date: Sun, 9 Dec 2018 14:29:59 +0100 +Subject: [PATCH] Disable mapboxgl + +--- + src/plugins/geoservices/geoservices.pro | 9 --------- + 1 file changed, 9 deletions(-) + +diff --git a/src/plugins/geoservices/geoservices.pro b/src/plugins/geoservices/geoservices.pro +index b81ad34a..98308c97 100644 +--- a/src/plugins/geoservices/geoservices.pro ++++ b/src/plugins/geoservices/geoservices.pro +@@ -7,12 +7,3 @@ qtConfig(geoservices_mapbox): SUBDIRS += mapbox + qtConfig(geoservices_esri): SUBDIRS += esri + qtConfig(geoservices_itemsoverlay): SUBDIRS += itemsoverlay + qtConfig(geoservices_osm): SUBDIRS += osm +- +-qtConfig(geoservices_mapboxgl) { +- !exists(../../3rdparty/mapbox-gl-native/mapbox-gl-native.pro) { +- warning("Submodule mapbox-gl-native does not exist. Run 'git submodule update --init' on qtlocation.") +- } else { +- SUBDIRS += mapboxgl ../../3rdparty/mapbox-gl-native +- mapboxgl.depends = ../../3rdparty/mapbox-gl-native +- } +-} +-- +2.23.0 + diff --git a/qt5/android-x86-64/0001-Fix-clang-libc-build-under-Android.patch b/qt5/android-x86-64/0001-Fix-clang-libc-build-under-Android.patch new file mode 100644 index 00000000..05e4091c --- /dev/null +++ b/qt5/android-x86-64/0001-Fix-clang-libc-build-under-Android.patch @@ -0,0 +1,40 @@ +From 2c8ca36b5f87ccfc039c0b669c80f21205769758 Mon Sep 17 00:00:00 2001 +From: Martchus +Date: Sun, 9 Dec 2018 14:28:07 +0100 +Subject: [PATCH 1/4] Fix clang/libc++ build under Android + +--- + mkspecs/android-clang/qmake.conf | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/mkspecs/android-clang/qmake.conf b/mkspecs/android-clang/qmake.conf +index 05b7979142..83d030793b 100644 +--- a/mkspecs/android-clang/qmake.conf ++++ b/mkspecs/android-clang/qmake.conf +@@ -30,11 +30,12 @@ QMAKE_CFLAGS += -gcc-toolchain $$NDK_TOOLCHAIN_PATH -fno-limit-debug-info + QMAKE_LINK = $$QMAKE_CXX $$QMAKE_CFLAGS -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ + equals(ANDROID_TARGET_ARCH, armeabi-v7a): QMAKE_LINK += -Wl,--exclude-libs,libunwind.a + +-QMAKE_CFLAGS += -DANDROID_HAS_WSTRING --sysroot=$$NDK_ROOT/sysroot \ ++QMAKE_CFLAGS += -DANDROID_HAS_WSTRING --sysroot=$$ANDROID_PLATFORM_ROOT_PATH \ + -isystem $$NDK_ROOT/sysroot/usr/include/$$NDK_TOOLS_PREFIX \ + -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++/include \ + -isystem $$NDK_ROOT/sources/android/support/include \ +- -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++abi/include ++ -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++abi/include \ ++ -isystem $$NDK_ROOT/sysroot/usr/include + + ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/$$ANDROID_TARGET_ARCH + +@@ -44,6 +45,8 @@ ANDROID_USE_LLVM = true + + exists($$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++.so): \ + ANDROID_CXX_STL_LIBS = -lc++ ++else: exists($$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++_shared.so): \ ++ ANDROID_CXX_STL_LIBS = -lc++_shared + else: \ + ANDROID_CXX_STL_LIBS = $$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++.so.$$replace(ANDROID_PLATFORM, "android-", "") + +-- +2.23.0 + diff --git a/qt5/android-x86-64/0002-Fix-androiddeployqt-search-paths.patch b/qt5/android-x86-64/0002-Fix-androiddeployqt-search-paths.patch new file mode 100644 index 00000000..f01167eb --- /dev/null +++ b/qt5/android-x86-64/0002-Fix-androiddeployqt-search-paths.patch @@ -0,0 +1,34 @@ +From 996c53a388705a0bbf778faaf7660efad98e1eff Mon Sep 17 00:00:00 2001 +From: Martchus +Date: Sun, 9 Dec 2018 14:31:30 +0100 +Subject: [PATCH 2/4] Fix androiddeployqt search paths + +--- + src/tools/androiddeployqt/main.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp +index 01c392f8f9..9600d657cb 100644 +--- a/src/tools/androiddeployqt/main.cpp ++++ b/src/tools/androiddeployqt/main.cpp +@@ -1721,7 +1721,7 @@ bool scanImports(Options *options, QSet *usedDependencies) + rootPath += QLatin1Char('/'); + + QStringList importPaths; +- importPaths += shellQuote(options->qtInstallDirectory + QLatin1String("/qml")); ++ importPaths += shellQuote(options->qtInstallDirectory + QLatin1String("/lib/qt/qml")); + importPaths += shellQuote(rootPath); + for (const QString &qmlImportPath : qAsConst(options->qmlImportPaths)) + importPaths += shellQuote(qmlImportPath); +@@ -1857,7 +1857,7 @@ bool readDependencies(Options *options) + return false; + + // Jam in the dependencies of the platform plugin, since the application will crash without it +- if (!readDependenciesFromElf(options, options->qtInstallDirectory + QLatin1String("/plugins/platforms/android/libqtforandroid.so"), &usedDependencies, &remainingDependencies)) ++ if (!readDependenciesFromElf(options, options->qtInstallDirectory + QLatin1String("/lib/qt/plugins/platforms/android/libqtforandroid.so"), &usedDependencies, &remainingDependencies)) + return false; + + while (!remainingDependencies.isEmpty()) { +-- +2.23.0 + diff --git a/qt5/android-x86-64/0003-Support-pkg-config-under-Android.patch b/qt5/android-x86-64/0003-Support-pkg-config-under-Android.patch new file mode 100644 index 00000000..66a21a05 --- /dev/null +++ b/qt5/android-x86-64/0003-Support-pkg-config-under-Android.patch @@ -0,0 +1,24 @@ +From a71a1223328539ee403884a24d1dbc5a685d40dd Mon Sep 17 00:00:00 2001 +From: Martchus +Date: Sun, 7 Apr 2019 09:54:49 +0200 +Subject: [PATCH 3/4] Support pkg-config under Android + +from https://aur.archlinux.org/cgit/aur.git/commit/?h=android-aarch64-qt5&id=d901da324b2ceea2ac99b48137cb82b2bd920c77 +--- + mkspecs/android-clang/qmake.conf | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/mkspecs/android-clang/qmake.conf b/mkspecs/android-clang/qmake.conf +index 83d030793b..8f145a2bb7 100644 +--- a/mkspecs/android-clang/qmake.conf ++++ b/mkspecs/android-clang/qmake.conf +@@ -53,3 +53,6 @@ else: \ + QMAKE_CFLAGS_OPTIMIZE_SIZE = -Oz + + include(../common/android-base-tail.conf) ++ ++QMAKE_PKG_CONFIG = $$[QT_INSTALL_PREFIX] ++QMAKE_PKG_CONFIG = android-$$section(QMAKE_PKG_CONFIG, /, 3, 3)-pkg-config +-- +2.23.0 + diff --git a/qt5/android-x86-64/0004-Use-pkg-config-to-find-libjpeg.patch b/qt5/android-x86-64/0004-Use-pkg-config-to-find-libjpeg.patch new file mode 100644 index 00000000..25f5b8db --- /dev/null +++ b/qt5/android-x86-64/0004-Use-pkg-config-to-find-libjpeg.patch @@ -0,0 +1,24 @@ +From 9cd435c730949e29104bbfa2bdd82ed2c662ca3d Mon Sep 17 00:00:00 2001 +From: Martchus +Date: Sat, 7 Sep 2019 13:21:37 +0200 +Subject: [PATCH 4/4] Use pkg-config to find libjpeg + +--- + src/gui/configure.json | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/gui/configure.json b/src/gui/configure.json +index 6280b4dfa2..206f83984a 100644 +--- a/src/gui/configure.json ++++ b/src/gui/configure.json +@@ -373,6 +373,7 @@ + }, + "headers": "jpeglib.h", + "sources": [ ++ { "type": "pkgConfig", "args": "libjpeg" }, + { "libs": "-llibjpeg", "condition": "config.msvc" }, + "-ljpeg" + ] +-- +2.23.0 + diff --git a/qt5/android-x86-64/PKGBUILD b/qt5/android-x86-64/PKGBUILD index 13f90a1f..77dc8d1f 100644 --- a/qt5/android-x86-64/PKGBUILD +++ b/qt5/android-x86-64/PKGBUILD @@ -7,12 +7,10 @@ _pkg_arch=x86-64 _android_arch=x86_64 -_android_min_platform=24 -_android_api_platform=30 -_android_ndk_platform=$_android_min_platform +_android_platform=22 pkgname=android-$_pkg_arch-qt5 -pkgver=5.15.2 +pkgver=5.13.1 pkgrel=1 pkgdesc="Qt 5 for Android" arch=('x86_64') @@ -27,23 +25,20 @@ makedepends=('libgl' 'gperf' 'libxslt' 'fontconfig' - 'ninja' 'java-environment-openjdk<=8' 'android-environment' - 'android-pkg-config') + 'android-pkg-config' + "android-$_pkg_arch-openssl") depends=('java-runtime-headless-openjdk<=8' 'apache-ant' 'android-ndk' + "android-platform-$_android_platform" 'android-sdk' 'android-sdk-build-tools' 'android-sdk-platform-tools' - 'android-platform' - "android-$_pkg_arch-libjpeg-turbo" + "android-$_pkg_arch-zlib" "android-$_pkg_arch-libpng" - "android-$_pkg_arch-libwebp" - "android-$_pkg_arch-libtiff" - "android-$_pkg_arch-openssl" - "android-$_pkg_arch-zlib") + "android-$_pkg_arch-libjpeg-turbo") groups=('android-qt5') conflicts=("android-qt5-${_android_arch}") replaces=("android-qt5-${_android_arch}") @@ -73,47 +68,51 @@ optdepends+=("android-$_pkg_arch-openssl: SSL support for Qt Network") options=(!strip !buildflags staticlibs !emptydirs) _pkgfqn="qt-everywhere-src-${pkgver}" source=("http://download.qt-project.org/official_releases/qt/${pkgver:0:4}/${pkgver}/single/${_pkgfqn}.tar.xz" - '0001-Support-pkg-config-under-Android.patch' - '0002-Force-64-bit-atomics-usage.patch') -sha256sums=('44da876057e21e1be42de31facd99be7d5f9f07893e1ea762359bcee0ef64ee9' - '435047d2f09baf2e706c86604c944686e71ab6d7678203b68e7d28af7beb5ce8' - '1f0aab5dcf7976285ffbb9069f127087f15d60a23485fadf17312090453d6784') + '0001-Fix-clang-libc-build-under-Android.patch' + '0002-Fix-androiddeployqt-search-paths.patch' + '0003-Support-pkg-config-under-Android.patch' + '0004-Use-pkg-config-to-find-libjpeg.patch' + '0001-Disable-mapboxgl.patch') +sha256sums=('adf00266dc38352a166a9739f1a24a1e36f1be9c04bf72e16e142a256436974e' + '29bcb93f9c79ad4b0709efa42694ed917b6e4cfce69a805e79a7dc3144be7765' + '7a5520311ba2edee2ffcd546cd6e08248c8f73deed33bd8075649577f8cb1446' + '5c3f0725f3c27263661ff5ebb4b279e4483de8ed70dee4fe42a84d31b3f2e4a9' + '4f3ba22616040a2979bfdf840b44bf105374ea2fac866c42977ad7ec6e87ddcc' + '6151b784050f9d4ef3eec22dd33360d3f566d4834592f1171df91a10c95fab77') prepare() { - export ANDROID_MINIMUM_PLATFORM=$_android_min_platform - export ANDROID_API_VERSION=android-$_android_api_platform - export ANDROID_NDK_PLATFORM=android-$_android_ndk_platform + export ANDROID_MINIMUM_PLATFORM=${_android_platform} source android-env ${_pkg_arch} - check_ndk_version_ge_than 18.0 - check_android_platform - cd ${_pkgfqn} pushd qtbase - patch -Np1 -i "../../0001-Support-pkg-config-under-Android.patch" - case "$_android_arch" in - aarch64 | x86-64) - patch -Np1 -i "../../0002-Force-64-bit-atomics-usage.patch" - ;; - *) - ;; - esac + patch -Np1 -i "../../0001-Fix-clang-libc-build-under-Android.patch" + #patch -Np1 -i "../../0002-Fix-androiddeployqt-search-paths.patch" + patch -Np1 -i "../../0003-Support-pkg-config-under-Android.patch" + patch -Np1 -i "../../0004-Use-pkg-config-to-find-libjpeg.patch" popd - sed -i "s/android-21/android-$ANDROID_MINIMUM_PLATFORM/g" qtbase/configure.pri + pushd qtlocation + # skip building mapboxgl as it increases compile time significantly and + # likely not a lot of people actually using it; if you need it, just remove the + # following line: + patch -Np1 -i "../../0001-Disable-mapboxgl.patch" + popd + + sed -i "s/android-16/android-$ANDROID_MINIMUM_PLATFORM/g" qtbase/mkspecs/features/android/sdk.prf + sed -i "s/android-16/android-$ANDROID_MINIMUM_PLATFORM/g" qtbase/src/android/jar/jar.pro + sed -i "s/android-16/android-$ANDROID_MINIMUM_PLATFORM/g" qtgamepad/src/plugins/gamepads/android/jar/jar.pro + sed -i "s/android-16/android-$ANDROID_MINIMUM_PLATFORM/g" qtbase/configure.pri } build() { - export ANDROID_MINIMUM_PLATFORM=$_android_min_platform - export ANDROID_API_VERSION=android-$_android_api_platform - export ANDROID_NDK_PLATFORM=android-$_android_ndk_platform + export ANDROID_MINIMUM_PLATFORM=${_android_platform} source android-env ${_pkg_arch} unset CC CXX CFLAGS CXXFLAGS LDFLAGS CHOST QMAKESPEC QTDIR CARCH export PKG_CONFIG=$ANDROID_PKGCONFIG - export ANDROID_TARGET_ARCH=${ANDROID_ABI} export PYTHON=/usr/bin/python2 cd ${_pkgfqn} @@ -127,30 +126,24 @@ build() { -xplatform android-clang -nomake tests -nomake examples - -android-sdk ${ANDROID_HOME} -android-ndk ${ANDROID_NDK_HOME} + -android-sdk ${ANDROID_HOME} -android-ndk-host linux-x86_64 - -android-ndk-platform ${ANDROID_NDK_PLATFORM} - -android-abis ${ANDROID_ABI} + -android-toolchain-version 4.9 -skip qtserialport - -skip qtwebengine -no-warnings-are-errors -pkg-config -system-zlib -system-libpng -system-libjpeg - -system-webp - -system-tiff - -no-feature-geoservices_mapbox - -no-feature-geoservices_mapboxgl -qt-freetype -openssl-runtime - -verbose + -android-arch ${ANDROID_ABI} + -android-ndk-platform ${ANDROID_NDK_PLATFORM} + -recheck-all -optimized-qmake -I${ANDROID_PREFIX}/include" - # note: use -recheck-all and/or -redo to continue - [[ $ANDROID_DEBUG_BUILD ]] \ && configue_opts+=' -debug-and-release' \ || configue_opts+=' -release' @@ -172,9 +165,7 @@ build() { } package() { - export ANDROID_MINIMUM_PLATFORM=$_android_min_platform - export ANDROID_API_VERSION=android-$_android_api_platform - export ANDROID_NDK_PLATFORM=android-$_android_ndk_platform + export ANDROID_MINIMUM_PLATFORM=${_android_platform} source android-env ${_pkg_arch} cd ${_pkgfqn}