PKGBUILDs/qt5/android-armv7a-eabi/PKGBUILD

197 lines
6.3 KiB
Bash
Raw Normal View History

# PKGCONFIG for android-qt5
# Maintainer in the AUR: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
# Contributor: Jiaxi Hu <sftrytry _AT_ gmail _DOT_ com>
# Contributor: jimmy00784 <jimmy00784@gmail.com>
# Contributor: Ricardo (XenGi) Band <email@ricardo.band>
# Contributor: Martchus <martchus@gmx.net>
_pkg_arch=armv7a-eabi
_android_arch=armeabi-v7a
2020-09-16 18:35:50 +02:00
_android_min_platform=24
_android_api_platform=30
_android_ndk_platform=$_android_min_platform
2019-02-02 18:18:25 +01:00
pkgname=android-$_pkg_arch-qt5
2020-11-25 17:16:57 +01:00
pkgver=5.15.2
2019-09-06 23:45:08 +02:00
pkgrel=1
pkgdesc="Qt 5 for Android"
arch=('x86_64')
url='https://www.qt.io'
license=('GPL3' 'LGPL')
makedepends=('libgl'
'sqlite'
'zlib'
'python2'
'python' # Qt Qml requires Python 3
'ruby'
'gperf'
'libxslt'
'fontconfig'
2020-09-16 18:35:50 +02:00
'ninja'
'java-environment-openjdk<=8'
'android-environment'
2020-09-16 18:35:50 +02:00
'android-pkg-config')
2019-03-16 16:58:50 +01:00
depends=('java-runtime-headless-openjdk<=8'
'apache-ant'
'android-ndk'
'android-sdk'
'android-sdk-build-tools'
2019-09-06 23:45:08 +02:00
'android-sdk-platform-tools'
2020-09-16 18:35:50 +02:00
'android-platform'
"android-$_pkg_arch-libjpeg-turbo"
2019-09-06 23:45:08 +02:00
"android-$_pkg_arch-libpng"
2020-09-16 18:35:50 +02:00
"android-$_pkg_arch-libwebp"
"android-$_pkg_arch-libtiff"
"android-$_pkg_arch-openssl"
"android-$_pkg_arch-zlib")
groups=('android-qt5')
conflicts=("android-qt5-${_android_arch}")
replaces=("android-qt5-${_android_arch}")
case "$_pkg_arch" in
aarch64)
optdepends=('android-google-apis-aarch64: AVD support'
'android-aarch64-system-image: AVD support')
;;
armv7a-eabi)
optdepends=('android-google-apis-armv7a-eabi: AVD support'
'android-armv7a-eabi-system-image: AVD support')
;;
x86)
optdepends=('android-google-apis-x86: AVD support'
'android-x86-system-image: AVD support')
;;
x86-64)
optdepends=('android-google-apis-x86-64: AVD support'
'android-x86-64-system-image: AVD support')
;;
*)
;;
esac
optdepends+=("android-$_pkg_arch-openssl: SSL support for Qt Network")
options=(!strip !buildflags staticlibs !emptydirs)
_pkgfqn="qt-everywhere-src-${pkgver}"
source=("http://download.qt-project.org/official_releases/qt/${pkgver:0:4}/${pkgver}/single/${_pkgfqn}.tar.xz"
2020-09-16 18:35:50 +02:00
'0001-Support-pkg-config-under-Android.patch'
'0002-Force-64-bit-atomics-usage.patch')
sha256sums=('44da876057e21e1be42de31facd99be7d5f9f07893e1ea762359bcee0ef64ee9'
'435047d2f09baf2e706c86604c944686e71ab6d7678203b68e7d28af7beb5ce8'
'1f0aab5dcf7976285ffbb9069f127087f15d60a23485fadf17312090453d6784')
prepare() {
2020-09-16 18:35:50 +02:00
export ANDROID_MINIMUM_PLATFORM=$_android_min_platform
export ANDROID_API_VERSION=android-$_android_api_platform
export ANDROID_NDK_PLATFORM=android-$_android_ndk_platform
source android-env ${_pkg_arch}
2020-09-16 18:35:50 +02:00
check_ndk_version_ge_than 18.0
check_android_platform
2019-04-21 22:37:50 +02:00
cd ${_pkgfqn}
pushd qtbase
2020-09-16 18:35:50 +02:00
patch -Np1 -i "../../0001-Support-pkg-config-under-Android.patch"
case "$_android_arch" in
aarch64 | x86-64)
patch -Np1 -i "../../0002-Force-64-bit-atomics-usage.patch"
;;
*)
;;
esac
popd
2020-09-16 18:35:50 +02:00
sed -i "s/android-21/android-$ANDROID_MINIMUM_PLATFORM/g" qtbase/configure.pri
}
build() {
2020-09-16 18:35:50 +02:00
export ANDROID_MINIMUM_PLATFORM=$_android_min_platform
export ANDROID_API_VERSION=android-$_android_api_platform
export ANDROID_NDK_PLATFORM=android-$_android_ndk_platform
source android-env ${_pkg_arch}
unset CC CXX CFLAGS CXXFLAGS LDFLAGS CHOST QMAKESPEC QTDIR CARCH
export PKG_CONFIG=$ANDROID_PKGCONFIG
2020-09-16 18:35:50 +02:00
export ANDROID_TARGET_ARCH=${ANDROID_ABI}
export PYTHON=/usr/bin/python2
2019-04-21 22:37:50 +02:00
cd ${_pkgfqn}
configue_opts="
-confirm-license
-opensource
2019-09-06 23:45:08 +02:00
-prefix ${ANDROID_PREFIX}
-examplesdir ${ANDROID_PREFIX_SHARE}/qt5/examples
-testsdir ${ANDROID_PREFIX_SHARE}/qt5/tests
-xplatform android-clang
-nomake tests
-nomake examples
2019-04-21 22:37:50 +02:00
-android-sdk ${ANDROID_HOME}
2020-09-16 18:35:50 +02:00
-android-ndk ${ANDROID_NDK_HOME}
-android-ndk-host linux-x86_64
2020-09-16 18:35:50 +02:00
-android-ndk-platform ${ANDROID_NDK_PLATFORM}
-android-abis ${ANDROID_ABI}
-skip qtserialport
2020-09-16 18:35:50 +02:00
-skip qtwebengine
-no-warnings-are-errors
2019-09-06 23:45:08 +02:00
-pkg-config
-system-zlib
-system-libpng
-system-libjpeg
2020-09-16 18:35:50 +02:00
-system-webp
-system-tiff
-no-feature-geoservices_mapbox
-no-feature-geoservices_mapboxgl
-qt-freetype
-openssl-runtime
2020-09-16 18:35:50 +02:00
-verbose
2019-09-06 23:45:08 +02:00
-optimized-qmake
-I${ANDROID_PREFIX}/include"
2020-09-16 18:35:50 +02:00
# note: use -recheck-all and/or -redo to continue
[[ $ANDROID_DEBUG_BUILD ]] \
&& configue_opts+=' -debug-and-release' \
|| configue_opts+=' -release'
# add architecture specific options
case "$_pkg_arch" in
x86*)
configue_opts+="
-no-sql-mysql
-no-sql-psql"
;;
*)
;;
esac
./configure ${configue_opts}
make $MAKEFLAGS
}
package() {
2020-09-16 18:35:50 +02:00
export ANDROID_MINIMUM_PLATFORM=$_android_min_platform
export ANDROID_API_VERSION=android-$_android_api_platform
export ANDROID_NDK_PLATFORM=android-$_android_ndk_platform
source android-env ${_pkg_arch}
2019-04-21 22:37:50 +02:00
cd ${_pkgfqn}
make INSTALL_ROOT=${pkgdir} install
2019-04-21 22:37:50 +02:00
2019-09-06 23:45:08 +02:00
find ${pkgdir}/${ANDROID_PREFIX_BIN} -type f ! -name '*.pl' -exec strip {} \;
find ${pkgdir}/${ANDROID_PREFIX_LIB} -type f -name 'lib*.so' -exec ${ANDROID_STRIP} {} \;
find ${pkgdir}/${ANDROID_PREFIX_LIB} -type f \( -name 'lib*.a' ! -name 'libQt5Bootstrap.a' ! -name 'libQt5QmlDevTools.a' \) -exec ${ANDROID_STRIP} {} \;
find ${pkgdir}/${ANDROID_PREFIX}/plugins -type f -name 'lib*.so' -exec ${ANDROID_STRIP} {} \;
find ${pkgdir}/${ANDROID_PREFIX}/qml -type f -name 'lib*.so' -exec ${ANDROID_STRIP} {} \;
# fix plugin path in Android-specific dependency file
2019-09-06 23:45:08 +02:00
sed -i 's/\"plugins\//\"lib\/qt\/plugins\//g' ${pkgdir}/${ANDROID_PREFIX_LIB}/*-android-dependencies.xml
# drop QMAKE_PRL_BUILD_DIR because reference the build dir
find "${pkgdir}/" -type f -name '*.prl' \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
}