2018-07-11 10:58:40 +02:00
|
|
|
# PKGCONFIG for android-qt5
|
2018-11-24 02:41:08 +01:00
|
|
|
# Maintainer in the AUR: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
|
2018-07-11 10:58:40 +02:00
|
|
|
# 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>
|
|
|
|
|
2018-11-24 02:41:08 +01:00
|
|
|
_pkg_arch=aarch64
|
2018-12-29 20:08:48 +01:00
|
|
|
_android_arch=arm64-v8a
|
2020-09-16 18:35:50 +02:00
|
|
|
_android_min_platform=24
|
|
|
|
_android_api_platform=30
|
|
|
|
_android_ndk_platform=$_android_min_platform
|
2018-07-11 10:58:40 +02:00
|
|
|
|
2018-11-24 02:41:08 +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
|
2018-07-11 10:58:40 +02:00
|
|
|
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'
|
2019-04-05 17:30:10 +02:00
|
|
|
'java-environment-openjdk<=8'
|
2019-07-23 17:54:38 +02:00
|
|
|
'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'
|
2018-07-11 10:58:40 +02:00
|
|
|
'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")
|
2018-07-11 10:58:40 +02:00
|
|
|
groups=('android-qt5')
|
2018-12-08 22:06:32 +01:00
|
|
|
conflicts=("android-qt5-${_android_arch}")
|
|
|
|
replaces=("android-qt5-${_android_arch}")
|
2018-11-24 02:41:08 +01:00
|
|
|
|
|
|
|
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")
|
2018-07-11 10:58:40 +02:00
|
|
|
|
2019-04-05 17:30:10 +02:00
|
|
|
options=(!strip !buildflags staticlibs !emptydirs)
|
2018-07-11 10:58:40 +02:00
|
|
|
_pkgfqn="qt-everywhere-src-${pkgver}"
|
2018-10-07 22:26:11 +02:00
|
|
|
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')
|
2018-07-11 10:58:40 +02:00
|
|
|
|
|
|
|
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
|
2019-07-23 17:54:38 +02:00
|
|
|
source android-env ${_pkg_arch}
|
2019-04-05 17:30:10 +02:00
|
|
|
|
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}
|
|
|
|
|
2018-12-08 22:06:32 +01:00
|
|
|
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
|
2018-12-08 22:06:32 +01:00
|
|
|
popd
|
2018-11-30 12:54:18 +01:00
|
|
|
|
2020-09-16 18:35:50 +02:00
|
|
|
sed -i "s/android-21/android-$ANDROID_MINIMUM_PLATFORM/g" qtbase/configure.pri
|
2018-07-11 10:58:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2019-07-23 17:54:38 +02:00
|
|
|
source android-env ${_pkg_arch}
|
2018-07-11 10:58:40 +02:00
|
|
|
|
2018-10-07 22:26:11 +02:00
|
|
|
unset CC CXX CFLAGS CXXFLAGS LDFLAGS CHOST QMAKESPEC QTDIR CARCH
|
2018-07-11 10:58:40 +02:00
|
|
|
|
2019-04-05 17:30:10 +02:00
|
|
|
export PKG_CONFIG=$ANDROID_PKGCONFIG
|
2020-09-16 18:35:50 +02:00
|
|
|
export ANDROID_TARGET_ARCH=${ANDROID_ABI}
|
2018-07-11 10:58:40 +02:00
|
|
|
export PYTHON=/usr/bin/python2
|
|
|
|
|
2019-04-21 22:37:50 +02:00
|
|
|
cd ${_pkgfqn}
|
2019-04-05 17:30:10 +02:00
|
|
|
|
2018-07-11 10:58:40 +02:00
|
|
|
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
|
2018-10-07 22:26:11 +02:00
|
|
|
-xplatform android-clang
|
2018-07-11 10:58:40 +02:00
|
|
|
-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}
|
2018-07-11 10:58:40 +02:00
|
|
|
-android-ndk-host linux-x86_64
|
2020-09-16 18:35:50 +02:00
|
|
|
-android-ndk-platform ${ANDROID_NDK_PLATFORM}
|
|
|
|
-android-abis ${ANDROID_ABI}
|
2018-07-11 10:58:40 +02:00
|
|
|
-skip qtserialport
|
2020-09-16 18:35:50 +02:00
|
|
|
-skip qtwebengine
|
2018-07-11 10:58:40 +02:00
|
|
|
-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
|
2018-07-11 10:58:40 +02:00
|
|
|
-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"
|
2018-11-24 02:41:08 +01:00
|
|
|
|
2020-09-16 18:35:50 +02:00
|
|
|
# note: use -recheck-all and/or -redo to continue
|
|
|
|
|
2018-11-24 02:41:08 +01:00
|
|
|
[[ $ANDROID_DEBUG_BUILD ]] \
|
|
|
|
&& configue_opts+=' -debug-and-release' \
|
|
|
|
|| configue_opts+=' -release'
|
2018-07-11 10:58:40 +02:00
|
|
|
|
2018-10-07 22:26:11 +02:00
|
|
|
# add architecture specific options
|
2018-11-24 02:41:08 +01:00
|
|
|
case "$_pkg_arch" in
|
2018-07-11 10:58:40 +02:00
|
|
|
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
|
2019-07-23 17:54:38 +02:00
|
|
|
source android-env ${_pkg_arch}
|
2019-04-05 17:30:10 +02:00
|
|
|
|
2019-04-21 22:37:50 +02:00
|
|
|
cd ${_pkgfqn}
|
2018-07-11 10:58:40 +02:00
|
|
|
|
2019-04-05 17:30:10 +02:00
|
|
|
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} {} \;
|
2018-11-30 12:54:18 +01:00
|
|
|
|
|
|
|
# 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
|
2018-07-11 10:58:40 +02:00
|
|
|
|
2018-10-07 22:26:11 +02:00
|
|
|
# drop QMAKE_PRL_BUILD_DIR because reference the build dir
|
2018-07-11 10:58:40 +02:00
|
|
|
find "${pkgdir}/" -type f -name '*.prl' \
|
|
|
|
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
|
|
|
|
}
|