PKGBUILDs/qt6-base/android-aarch64/PKGBUILD

120 lines
5.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.7.0
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>=11' '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=17' '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-Find-fontconfig-via-pkg-config-for-correct-handling-.patch'
'0009-Fix-dependency-of-xcb-image-on-xcb-util.patch'
'0010-Allow-using-properties-of-PkgConfig-targets-for-glib.patch'
'0011-Allow-using-properties-of-PkgConfig-targets-for-Wayl.patch'
'0012-Allow-overriding-preference-for-shared-libzstd-libra.patch'
'0013-Fix-errors-due-to-disabled-exceptions-with-cpp_winrt.patch'
'0014-Fix-setting-exception-flags-of-plugin-targets.patch'
'0015-Link-corelib-correctly-against-runtimeobject-when-co.patch'
'0016-Workaround-linker-error-about-missing-symbol-__sync_.patch'
'0017-Fix-wrong-cpp-conditional-in-qspan.h.patch'
'0018-Fix-crashes-in-rasterization-code-using-setjmp.patch')
sha256sums=('11b2e29e2e52fb0e3b453ea13bbe51a10fdff36e1c192d8868c5a40233b8b254'
'2bcfcdfe0fabdb7e7600eb6e1b85d9cda8f86af558a8c09658bc1867cc273ca0'
'a053880e1bd15d1eb4ee8fb27a2f1345af88235fb7cf1515461c3525f0be4daf'
'779093bfe4fafebf278d39de4f4f3f9b7dc6dd6871c3e86de7af51639290fe69'
'4e694cc40009b1a0cb62aa03b6d3d2b692ddca156e776c52f9babdc6e0cb2c32'
'3953be3b3cb029f47994779824c7b7875aa7b5c1c21156dbf76bccce68244d28'
'b359923aae5cddb7f52d9fc803ed2945a5644d0ae637728a401899ccc09c73af'
'ed14103ac853bd72e203ce93c13586dc40bb4d1194e390e5cc631afa29eb920f'
'76d49fe063b197b68f9a5c3e09047e4aad581639682c985762341d16e08c95bb'
'cbd5f1777ecb380fe6444eb3eb04b8abdc5988c3f97ae1f58da422d214448bd1'
'40e287b41d3e09b7fa09804ce1feca87eea1b0a4d662cfb5d7e938c6a43bf155'
'818f0a500a37ff2b5a1fe0502ce2321468482423714f4ca4d9ee02a1c8a85120'
'7de9a5e4adf4afa4d4a4ba6a90c58df810748d97631e8ee2d7051cb64d312069'
'a29667637bbd0949200d6dbb18f8b9b75e55164c6e8dd049296f7dcbe4910a21'
'167921dd76e072857413538fbdbd56b4fab19cb53c739a70fe8aa613ca8c5651'
'9177a5c59465953777faca9f0651106f0b6e98e6f825e276f81f2dd9e4ce5426'
'b5eeae582ddba1b96c600f1cb2b73083cf8ae619af7ade2b45dfc17214497b5e'
'80b2cc652b087ac950a398b554842ce66d1b0703d890d52bfffb2af0ea6ab1a7'
'bfca3b0894ce1b6764217905835db50b9251ad19084c7f89967f37bfb1366cf4')
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() {
export PATH=/usr/lib/jvm/java-17-openjdk/bin:$PATH
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/LICENSES/* -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
}