# Maintainer: Martchus # All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where # you also find the URL of a binary repository. # This file is created from PKGBUILD.sh.ep contained by the mentioned repository. # Do not edit it manually! See README.md in the repository's root directory # for more information. # All patches are managed at https://github.com/Martchus/qtbase _android_arch=aarch64 pkgname=android-aarch64-qt6-base _qtver=6.2.2 pkgver=${_qtver/-/} pkgrel=1 arch=(any) url='https://www.qt.io' license=(GPL3 LGPL3 FDL custom) pkgdesc='A cross-platform application and UI framework (android)' depends=('java-runtime-headless-openjdk=8' 'ant' 'android-ndk' 'android-sdk' 'android-sdk-build-tools' 'android-sdk-platform-tools' 'android-platform' "android-${_android_arch}-libjpeg-turbo" "android-${_android_arch}-libpng" "android-${_android_arch}-openssl" "android-${_android_arch}-zlib") makedepends=('android-cmake' 'android-pkg-config' 'java-environment-openjdk=8' 'qt6-base' 'ninja') optdepends=('qt6-base: development tools') options=('!strip' '!buildflags' 'staticlibs' '!emptydirs') groups=(android-${_android_arch}-qt6) _pkgfqn="qtbase-everywhere-src-${_qtver}" source=("https://download.qt.io/official_releases/qt/${pkgver%.*}/${_qtver}/submodules/${_pkgfqn}.tar.xz" '0001-Use-CMake-s-default-import-library-suffix.patch' '0002-Fix-finding-D-Bus.patch' '0003-Fix-using-static-PCRE2-and-DBus-1.patch' '0004-Fix-transitive-dependencies-of-static-libraries.patch' '0005-Fix-libjpeg-workaround-for-conflict-with-rpcndr.h.patch' '0006-Support-finding-static-MariaDB-client-library.patch' '0007-Allow-overriding-CMAKE_FIND_LIBRARY_SUFFIXES-to-pref.patch' '0008-Fix-crashes-in-rasterization-code-using-setjmp.patch') sha256sums=('85ab9180180c2eaf84cd11ae4c6d5a6a69f2f8fd7260aaccfd91a3e7e7232c1a' '70abdd5f8bfafc46a833a3dc9ea3eea7050cc01ac7b54e0f4b9a25dc44ff4faa' '3651ea66d40665681cd64d9ec0e600d32ad65adb7922869bd4c02aeb3c1eb66c' 'e948083c12aa3c468b2845174ec3ee796bba7ddb2447f44f321b31b7e354152a' '0736df9ed395025851be441bb422128d046b82847d7e546abbdaf63391cddb43' 'd408dba9f000a69aa4a684ec94aba843b2c2f1462562b88f07846480da7e5a54' 'a7674e5475f2b3f64926ccf02fb0881e2861beed5643143a87cacd9e940bd699' '02818bb9ac13c14d18c3bf5a0729666c37b8b0248088e2237c66049c0ad62a10' '2353af5cfaf83090690d8cd933e349781b45328742fb1c4ad9bcbe51f03aa35a') prepare () { cd $_pkgfqn # apply patches; further descriptions can be found in patch files itself for patch in "$srcdir/"*.patch; do msg2 "Applying patch $patch" patch -p1 -i "$patch" done } build() { source android-env ${_android_arch} android-${_android_arch}-cmake -G Ninja -B build-$_android_arch -S $_pkgfqn \ -DCMAKE_FIND_ROOT_PATH="${ANDROID_PREFIX}" \ -DQT_BINARY_DIR=${ANDROID_PREFIX_BIN} \ -DQT_INCLUDE_DIRS_NO_SYSTEM=ON \ -DQT_HOST_PATH=/usr \ -DANDROID_SDK_ROOT=${ANDROID_HOME} \ -DANDROID_NDK_ROOT=${ANDROID_NDK_HOME} \ -DANDROID_STL="c++_shared" \ -DFEATURE_pkg_config=ON \ -DFEATURE_system_pcre2=OFF \ -DFEATURE_system_freetype=OFF \ -DFEATURE_system_harfbuzz=OFF \ -DFEATURE_system_sqlite=OFF \ -DFEATURE_system_libjpeg=ON \ -DFEATURE_system_libpng=ON \ -DFEATURE_system_zlib=ON \ -DINSTALL_DOCDIR=share/doc/qt6 \ -DINSTALL_EXAMPLESDIR=share/doc/qt6/examples \ -DINPUT_openssl=runtime VERBOSE=1 cmake --build build-$_android_arch # note: Avoid using `-DINSTALL_` options like in the regular package to avoid any problems with androiddeployqt. } package() { source android-env ${_android_arch} DESTDIR="$pkgdir" cmake --install build-$_android_arch install -Dm644 $_pkgfqn/LICENSE* -t "$pkgdir"/usr/share/licenses/$pkgname # Drop QMAKE_PRL_BUILD_DIR because reference the build dir find "$pkgdir/${ANDROID_PREFIX}/" -type f -name '*.prl' \ -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \; find ${pkgdir}/${ANDROID_PREFIX} -type f -name 'lib*.so' -exec ${ANDROID_STRIP} -g --strip-unneeded {} \; find ${pkgdir}/${ANDROID_PREFIX} -type f -name 'lib*.a' -exec ${ANDROID_STRIP} -g {} \; [[ -d "${pkgdir}/${ANDROID_PREFIX}/share/doc" ]] && rm -r "${pkgdir}/${ANDROID_PREFIX}/share/doc" || true }