PKGBUILDs/qt6-base/android-aarch64/PKGBUILD

107 lines
4.9 KiB
Bash

# Maintainer: Martchus <martchus@gmx.net>
# 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.3.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'
'0009-Find-fontconfig-via-pkg-config-for-correct-handling-.patch'
'0010-Fix-dependency-of-xcb-image-on-xcb-util.patch'
'0011-Allow-using-properties-of-PkgConfig-targets-for-glib.patch'
'0012-Allow-using-properties-of-PkgConfig-targets-for-Wayl.patch')
sha256sums=('0a64421d9c2469c2c48490a032ab91d547017c9cc171f3f8070bc31888f24e03'
'44447564d76f656f78dcebbd9015f87cc5ab89caf1984909f32c8a57168ebfc6'
'62efb1cbd52b852115df5887c4653c39dce9e695470c3577f58388a8493964dc'
'ac185df12dafaa5b2a35b05ae0fa5ff05b6e885525c6159c89589028081b1285'
'454f758469ed0dc03278e851cc6dc19424fc8147396b3a54640c284e7085277c'
'7ceaa7fa65a73d2ae60a93cce1cb68e85bd486ac5529e3456c696fc2a3098749'
'b493577b3b524383312d6f093c7d41b621daea7e82f6efb7d219b2796e217a81'
'fc29185f66f3b9a288bdd7e36a363d3f573d9602d7b01588f58c352a54dfed8f'
'7b00f18dc4ebd42194f853acd1bee4fb4fcb586086ce6c2be7996df058c6dbb6'
'4e29919b6692be949164f47a929178dcff0e0075f51f3aa54d617795291cd31f'
'37a0951bec45840157275c0e79fc1882143b6152069cde93be193128c22e5d2d'
'9969dd32b3f8e5f6f67396a98a676a1d50a7beaf9fb150aa3c3127c8835086cd'
'0d1b83a7ab41a6f4d52c48c215949b7204e880531df0f1dd395a08f615b43faa')
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
}