PKGBUILDs/qt6-base/android-aarch64/PKGBUILD

116 lines
5.6 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.1
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')
sha256sums=('b7338da1bdccb4d861e714efffaa83f174dfe37e194916bfd7ec82279a6ace19'
'305745c1effeb20fd63411342cf308d7f518b63f8e14b2c55d1ba31c45ae068f'
'6113d9c8392f0e7a34e8220bbfb01d6af63543e260e7ed4f65029fd859212b0f'
'220f32dc67cd256f706a135b072f639d88440ad8d5943ec7b311510eb7531cb7'
'2b6e95199698bc1af539ea39c37620b1170ddf77fa45c9120c3f0a59f58d8af1'
'ccb04d5ca4b09cc8c19fab5427dcee8b4de6aaa4489f99e323830f66207318f6'
'a8c1636dbf1480cbb3c56227e8b53dfd309293576cacefe689894dd6aaa8b597'
'48f6b23b2f34ce6158132b7b7ee6e7e527d65b26ec950777592dc0b80d1b96b0'
'd2441d85329e70205532f8483a3e30b346861e44949b9803849677e61af496dd'
'3dd924f235a129e8c008d6fe4d92dbeb1875eed74db0add801538584438e6629'
'5721ddde57dc808f99183cfca29491a014ff29b0bd6ed1397d189c3af3c20198'
'bf658085615d03333bb44e30ba11760e27556844d5731b3f92a17bb6e5ff1c42'
'5c8b7919222b3df5c5ff92a4baebb2130100ddc11c0d6743816347cc2509597b'
'1b2dad7aaabdc9922be87e2e90e49a270690c5935818efa8a7bd15a54de7cd73'
'863b60f362f477a48a2be440563f0f547db7102d8c79961fd9fa2295d35f2b0a'
'29af07b430f2a416b8fd0a8241c07205232cb4eb31626c9444256d03ebdba92c'
'd1cbb46c443c64fe477fe5a6d9e0fd450e3f5c9f9423ce75c310659caef4d8db')
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
}