# PKGCONFIG for android-qt5 # Maintainer in the AUR: Gonzalo Exequiel Pedone # Contributor: Jiaxi Hu # Contributor: jimmy00784 # Contributor: Ricardo (XenGi) Band # Contributor: Martchus _pkg_arch=armv7a-eabi _android_arch=armeabi-v7a _android_min_platform=24 _android_api_platform=30 _android_ndk_platform=$_android_min_platform pkgname=android-$_pkg_arch-qt5 pkgver=5.15.2 pkgrel=1 pkgdesc="Qt 5 for Android" arch=('x86_64') url='https://www.qt.io' license=('GPL3' 'LGPL') makedepends=('libgl' 'sqlite' 'zlib' 'python2' 'python' # Qt Qml requires Python 3 'ruby' 'gperf' 'libxslt' 'fontconfig' 'ninja' 'java-environment-openjdk<=8' 'android-environment' 'android-pkg-config') depends=('java-runtime-headless-openjdk<=8' 'apache-ant' 'android-ndk' 'android-sdk' 'android-sdk-build-tools' 'android-sdk-platform-tools' 'android-platform' "android-$_pkg_arch-libjpeg-turbo" "android-$_pkg_arch-libpng" "android-$_pkg_arch-libwebp" "android-$_pkg_arch-libtiff" "android-$_pkg_arch-openssl" "android-$_pkg_arch-zlib") groups=('android-qt5') conflicts=("android-qt5-${_android_arch}") replaces=("android-qt5-${_android_arch}") case "$_pkg_arch" in aarch64) optdepends=('android-google-apis-aarch64: AVD support' 'android-aarch64-system-image: AVD support') ;; armv7a-eabi) optdepends=('android-google-apis-armv7a-eabi: AVD support' 'android-armv7a-eabi-system-image: AVD support') ;; x86) optdepends=('android-google-apis-x86: AVD support' 'android-x86-system-image: AVD support') ;; x86-64) optdepends=('android-google-apis-x86-64: AVD support' 'android-x86-64-system-image: AVD support') ;; *) ;; esac 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') prepare() { export ANDROID_MINIMUM_PLATFORM=$_android_min_platform export ANDROID_API_VERSION=android-$_android_api_platform export ANDROID_NDK_PLATFORM=android-$_android_ndk_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 popd sed -i "s/android-21/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 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} configue_opts=" -confirm-license -opensource -prefix ${ANDROID_PREFIX} -examplesdir ${ANDROID_PREFIX_SHARE}/qt5/examples -testsdir ${ANDROID_PREFIX_SHARE}/qt5/tests -xplatform android-clang -nomake tests -nomake examples -android-sdk ${ANDROID_HOME} -android-ndk ${ANDROID_NDK_HOME} -android-ndk-host linux-x86_64 -android-ndk-platform ${ANDROID_NDK_PLATFORM} -android-abis ${ANDROID_ABI} -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 -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' # add architecture specific options case "$_pkg_arch" in x86*) configue_opts+=" -no-sql-mysql -no-sql-psql" ;; *) ;; esac ./configure ${configue_opts} make $MAKEFLAGS } package() { export ANDROID_MINIMUM_PLATFORM=$_android_min_platform export ANDROID_API_VERSION=android-$_android_api_platform export ANDROID_NDK_PLATFORM=android-$_android_ndk_platform source android-env ${_pkg_arch} cd ${_pkgfqn} make INSTALL_ROOT=${pkgdir} install find ${pkgdir}/${ANDROID_PREFIX_BIN} -type f ! -name '*.pl' -exec strip {} \; find ${pkgdir}/${ANDROID_PREFIX_LIB} -type f -name 'lib*.so' -exec ${ANDROID_STRIP} {} \; find ${pkgdir}/${ANDROID_PREFIX_LIB} -type f \( -name 'lib*.a' ! -name 'libQt5Bootstrap.a' ! -name 'libQt5QmlDevTools.a' \) -exec ${ANDROID_STRIP} {} \; find ${pkgdir}/${ANDROID_PREFIX}/plugins -type f -name 'lib*.so' -exec ${ANDROID_STRIP} {} \; find ${pkgdir}/${ANDROID_PREFIX}/qml -type f -name 'lib*.so' -exec ${ANDROID_STRIP} {} \; # fix plugin path in Android-specific dependency file sed -i 's/\"plugins\//\"lib\/qt\/plugins\//g' ${pkgdir}/${ANDROID_PREFIX_LIB}/*-android-dependencies.xml # drop QMAKE_PRL_BUILD_DIR because reference the build dir find "${pkgdir}/" -type f -name '*.prl' \ -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \; }