PKGBUILDs/qt6-httpserver/android-aarch64/PKGBUILD
Martchus 82f0166922 Add PKGBUILDs for additional Qt 6 modules
These haven't been tested yet and I'm not sure whether it makes sense to
add them by default to the build yet. However, they might be useful in the
future.
2023-08-17 15:44:05 +02:00

53 lines
2.0 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.
_android_arch=aarch64
pkgname=android-$_android_arch-qt6-httpserver
_qtver=6.5.2
pkgver=${_qtver/-/}
pkgrel=1
arch=(any)
url='https://www.qt.io'
license=(GPL3 LGPL3 FDL custom)
pkgdesc='Qt HTTP Server (android)'
depends=('android-aarch64-qt6-base')
optdepends=('android-aarch64-qt6-declarative: QML bindings')
makedepends=('android-cmake' 'android-aarch64-qt6-declarative' 'qt6-base' 'qt6-declarative' 'ninja' 'java-environment-openjdk>=11')
options=('!strip' '!buildflags' 'staticlibs' '!emptydirs')
groups=(android-${_android_arch}-qt6)
_pkgfqn="qthttpserver-everywhere-src-${_qtver}"
source=("https://download.qt.io/official_releases/qt/${pkgver%.*}/${_qtver}/submodules/${_pkgfqn}.tar.xz")
sha256sums=('qthttpserver-sha256.txt missing')
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
cmake --build build-$_android_arch
}
package() {
DESTDIR="$pkgdir" cmake --install build-$_android_arch
# 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
install -d "$pkgdir"/usr/share/licenses
ln -s /usr/share/licenses/android-$_android_arch-qt6-base "$pkgdir"/usr/share/licenses/$pkgname
}