2016-08-27 14:44:08 +02:00
|
|
|
# Maintainer: Martchus <martchus@gmx.net>
|
|
|
|
# Contributor: ant32 <antreimer@gmail.com>
|
|
|
|
# Contributor: Filip Brcic <brcha@gna.org>
|
|
|
|
# Contributor: jellysheep <max.mail@dameweb.de>
|
|
|
|
|
2018-03-17 17:08:22 +01:00
|
|
|
# BEFORE COMMENTING OR REPORING ISSUES, PLEASE READ THE FILE `README.md` IN THIS REPOSITORY.
|
|
|
|
# ALSO HAVE A LOOK AT THE COMMENTS IN THE AUR.
|
|
|
|
|
2016-08-27 14:44:08 +02:00
|
|
|
# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where
|
|
|
|
# you also find the URL of a binary repository.
|
|
|
|
|
2016-09-19 22:18:45 +02:00
|
|
|
# All patches are managed at https://github.com/Martchus/qtbase
|
|
|
|
|
2016-08-27 14:44:08 +02:00
|
|
|
# Helper functions for the split builds
|
|
|
|
isDefault() {
|
2016-09-03 18:31:00 +02:00
|
|
|
[[ $pkgname = 'mingw-w64-qt5-base' ]] || [[ $pkgname = 'mingw-w64-qt5-base-static' ]]
|
2016-08-27 14:44:08 +02:00
|
|
|
}
|
|
|
|
isStatic() {
|
2016-09-03 18:31:00 +02:00
|
|
|
[ "${pkgname##*-}" = 'static' ]
|
2016-08-27 14:44:08 +02:00
|
|
|
}
|
|
|
|
isOpenGL() {
|
2016-09-04 16:38:05 +02:00
|
|
|
# Currently use native OpenGL by default
|
|
|
|
isDefault || \
|
2016-09-03 18:31:00 +02:00
|
|
|
[[ $pkgname = 'mingw-w64-qt5-base-opengl' ]] || [[ $pkgname = 'mingw-w64-qt5-base-opengl-static' ]]
|
2016-08-27 14:44:08 +02:00
|
|
|
}
|
|
|
|
isANGLE() {
|
|
|
|
[[ $pkgname = 'mingw-w64-qt5-base-angle' ]] || [[ $pkgname = 'mingw-w64-qt5-base-angle-static' ]] || \
|
2016-09-04 16:38:05 +02:00
|
|
|
[[ $pkgname = 'mingw-w64-qt5-base-dynamic' ]] || [[ $pkgname = 'mingw-w64-qt5-base-dynamic-static' ]]
|
|
|
|
# Treat dynamic version like ANGLE version, correct?
|
2016-08-27 14:44:08 +02:00
|
|
|
}
|
|
|
|
isDynamic() {
|
2016-09-03 18:31:00 +02:00
|
|
|
[[ $pkgname = 'mingw-w64-qt5-base-dynamic' ]] || [[ $pkgname = 'mingw-w64-qt5-base-dynamic-static' ]]
|
2016-08-27 14:44:08 +02:00
|
|
|
}
|
|
|
|
isNoOpenGL() {
|
|
|
|
[[ $pkgname = 'mingw-w64-qt5-base-noopengl' ]] || [[ $pkgname = 'mingw-w64-qt5-base-noopengl-static' ]]
|
|
|
|
}
|
|
|
|
|
|
|
|
pkgname=mingw-w64-qt5-base-dynamic
|
2018-12-08 22:06:32 +01:00
|
|
|
pkgver=5.12.0
|
|
|
|
pkgrel=1
|
2016-09-19 22:18:45 +02:00
|
|
|
pkgdesc='A cross-platform application and UI framework (mingw-w64)'
|
2016-09-04 16:38:05 +02:00
|
|
|
# The static variant doesn't contain any executables which need to be executed on the build machine
|
2016-08-27 14:44:08 +02:00
|
|
|
isStatic && arch=('any') || arch=('i686' 'x86_64')
|
|
|
|
url='https://www.qt.io/'
|
|
|
|
license=('GPL3' 'LGPL3' 'FDL' 'custom')
|
|
|
|
depends=('mingw-w64-crt' 'mingw-w64-zlib' 'mingw-w64-libjpeg-turbo' 'mingw-w64-sqlite'
|
2017-12-08 19:49:53 +01:00
|
|
|
'mingw-w64-libpng' 'mingw-w64-openssl' 'mingw-w64-dbus' 'mingw-w64-harfbuzz'
|
2017-06-02 18:20:04 +02:00
|
|
|
'mingw-w64-pcre2')
|
2017-01-23 21:37:13 +01:00
|
|
|
groups=('mingw-w64-qt5')
|
2016-10-07 10:23:48 +02:00
|
|
|
optdepends=('mingw-w64-postgresql: PostgreSQL support' 'mingw-w64-mariadb-connector-c: MySQL support')
|
2016-09-12 19:43:08 +02:00
|
|
|
makedepends=('mingw-w64-gcc' 'mingw-w64-postgresql' 'mingw-w64-mariadb-connector-c' 'mingw-w64-pkg-config')
|
2017-01-23 21:37:13 +01:00
|
|
|
options=('!strip' '!buildflags' 'staticlibs' '!emptydirs')
|
2017-12-08 19:49:53 +01:00
|
|
|
_pkgfqn="qtbase-everywhere-src-${pkgver}"
|
|
|
|
source=("https://download.qt.io/official_releases/qt/${pkgver%.*}/${pkgver}/submodules/${_pkgfqn}.tar.xz"
|
2018-03-17 17:08:22 +01:00
|
|
|
'0001-Adjust-win32-g-profile-for-cross-compilation-with-mi.patch'
|
2017-01-23 21:37:13 +01:00
|
|
|
'0002-Ensure-GLdouble-is-defined-when-using-dynamic-OpenGL.patch'
|
|
|
|
'0003-Use-external-ANGLE-library.patch'
|
|
|
|
'0004-Fix-too-many-sections-assemler-error-in-OpenGL-facto.patch'
|
|
|
|
'0005-Make-sure-.pc-files-are-installed-correctly.patch'
|
|
|
|
'0006-Don-t-add-resource-files-to-LIBS-parameter.patch'
|
|
|
|
'0007-Prevent-debug-library-names-in-pkg-config-files.patch'
|
|
|
|
'0008-Fix-linking-against-shared-static-libpng.patch'
|
|
|
|
'0009-Fix-linking-against-static-D-Bus.patch'
|
2017-06-02 18:20:04 +02:00
|
|
|
'0010-Don-t-try-to-use-debug-version-of-D-Bus-library.patch'
|
|
|
|
'0011-Fix-linking-against-static-freetype2.patch'
|
|
|
|
'0012-Fix-linking-against-static-harfbuzz.patch'
|
|
|
|
'0013-Fix-linking-against-static-pcre.patch'
|
|
|
|
'0014-Fix-linking-against-shared-static-MariaDB.patch'
|
|
|
|
'0015-Fix-linking-against-shared-static-PostgreSQL.patch'
|
|
|
|
'0016-Rename-qtmain-to-qt5main.patch'
|
|
|
|
'0017-Build-dynamic-host-libraries.patch'
|
|
|
|
'0018-Enable-rpath-for-build-tools.patch'
|
|
|
|
'0019-Use-system-zlib-for-build-tools.patch'
|
2018-02-15 00:14:36 +01:00
|
|
|
'0020-Use-.dll.a-as-import-lib-extension.patch'
|
|
|
|
'0021-Merge-shared-and-static-library-trees.patch'
|
|
|
|
'0022-Pull-dependencies-of-static-libraries-in-CMake-modul.patch'
|
|
|
|
'0023-Allow-usage-of-static-version-with-CMake.patch'
|
|
|
|
'0024-Adjust-linker-flags-for-static-build-with-cmake-ming.patch'
|
|
|
|
'0025-Use-correct-pkg-config-static-flag.patch'
|
|
|
|
'0026-Fix-macro-invoking-moc-rcc-and-uic.patch'
|
|
|
|
'0027-Ignore-errors-about-missing-feature-static.patch'
|
|
|
|
'0028-Enable-and-fix-use-of-iconv.patch'
|
|
|
|
'0029-Ignore-failing-pkg-config-test.patch'
|
|
|
|
'0030-Prevent-qmake-from-messing-static-lib-dependencies.patch'
|
|
|
|
'0031-Hardcode-linker-flags-for-platform-plugins.patch'
|
2018-05-23 20:56:49 +02:00
|
|
|
'0032-Fix-linking-against-static-plugins-with-qmake.patch'
|
2018-09-19 20:39:07 +02:00
|
|
|
'0033-Disable-hardware-randomizer-for-32-bit.patch')
|
2018-12-08 22:06:32 +01:00
|
|
|
sha256sums=('5e03221d780e121aabd734896aab8f331e5d8c9d9b54f1eb04907d0818eaeecb'
|
|
|
|
'98aeb35835e44f0311bf40969ead841163f8650c869cacf9c455ad87bf9e7d0a'
|
|
|
|
'0290db9520f2c9255a01d3ee313ff8d1925f89c50d8b5fd4283882b62b299541'
|
|
|
|
'02db1e6a3ac0ea7ad8aa15275920aeac50389dc0e7355a2280e36aa957234167'
|
|
|
|
'a45fd65bd2c9f57361e1e68cab60132abf192b0508cc1d1559ee2abab2a91a86'
|
|
|
|
'c2f21de21481189f610a95ad2efaf6d1845ef640ad8aa3ffb1c8a138a46ed50d'
|
|
|
|
'df6975315f2f7a4a38d75baa6e4cf12d6e2759c8e16e57be81016cfe8a94de96'
|
|
|
|
'01e478ff9fa20d38372bc6b4907264ad838b5de366737d907c5986459aff0209'
|
|
|
|
'a52f036860850960e4af3adcc1e38cb708c28358e7de01decb20cc76b9d62d5d'
|
|
|
|
'374e8e4f6afff9a0f49f02faadd361cf3df947452f9a0fa450c24baff920fc5d'
|
|
|
|
'91b899ef0b2e4b716324ea1942fbd0d6c18c55ba21f37d65c253f893ec312990'
|
|
|
|
'2bf1b91ebaca6647908a00f639477803f5c432b06a1e9550826ccad0f6d4deb9'
|
|
|
|
'2aea9f55f77d93b041d102b82060c3625e59e4e6324ea83ffe0821ca5e082a1a'
|
|
|
|
'db93259fe8fea464b22f5c8ca550edc0eebb6df0572574a1246cc4b9926251ee'
|
|
|
|
'4304fa46b78615b912d8727a40fc39b836b2a4762442b29b7c8b2a8547ed4ea0'
|
|
|
|
'b59bd5c1d0572466e76222cd5fda2a160dcde55a8bd65eacaecbe334ea567e16'
|
|
|
|
'b339686494a3417a9263e93eb7623a544669861b57e4312d82d468062a9d3e6c'
|
|
|
|
'c96c61d974e50b35cffe8391966c9641cca4f3ddef2bab4b016239169ab484c4'
|
|
|
|
'295a965cfea15454e4f207afad47f02dac771f96a17a00867d3a7f0f0ee1ba20'
|
|
|
|
'f165f53ffa069b677238c75a020466fa3e170edfbbb5ca3c312e2a014fec5607'
|
|
|
|
'd45fed111601f21b6866b607925ae59c9842850f8d9531fc13808fc0de7f1e3a'
|
|
|
|
'795700751790b164fb2062263e6681073acc3ef4d71ea50bb0a70510b9ff2018'
|
|
|
|
'4b50d30b3b18aa6f397c2a7651aa58bca3fdf2234bed3a44c507939bc2edb00a'
|
|
|
|
'3485baf0fd0a1402119ec6bd16ba23e53731ea75e6d881f88aa15933cedc19c3'
|
|
|
|
'54c310eae3e5ca6bfbb2cb6d058fac81c523a2cf0123797d7a4d70b8272ab35f'
|
|
|
|
'2f6175cacbf4982e624d8f0233803ae471b08e14d0fa971607517b4120e75493'
|
|
|
|
'10d1712857531d277d314c95c0026b88df28f9b956dc5491e532858070e7f6da'
|
|
|
|
'de214043a544b89d60101b67142d586cd4d2d61b9c84cf54d0652ce5b6d34f7e'
|
|
|
|
'9cb1e05a00c0cf4486cc7bcc92a960f216694387b5098dad51584e9cfe882897'
|
|
|
|
'9ff94ccfcf951c970e39ecde11b21c298ea839785ab27db9abd9379963b82c23'
|
|
|
|
'6b0e3ed44996bf72230875767b3dde9bcabb1c2496badd95dc5ce8ea796ab5ba'
|
|
|
|
'17fd194dfc5f630d4b98afcafb78d4c89d16d5cea40c3c4096e32956a1e87104'
|
|
|
|
'c808a350cae7a7cc899ec3d496f5e3522a4dbefcd6adf41abcf46621be9468b7'
|
|
|
|
'2aeefe22f926d37c467324bfa015cc33df9a05fa8aee318132fd566e9b66eb09')
|
2016-08-27 14:44:08 +02:00
|
|
|
|
|
|
|
_architectures='i686-w64-mingw32 x86_64-w64-mingw32'
|
|
|
|
|
|
|
|
isStatic && depends+=(${pkgname%-static})
|
|
|
|
if isANGLE; then
|
|
|
|
if isDynamic; then
|
|
|
|
makedepends+=('mingw-w64-angleproject')
|
|
|
|
optdepends+=('mingw-w64-angleproject: use ANGLE instead of native OpenGL')
|
|
|
|
else
|
|
|
|
depends+=('mingw-w64-angleproject')
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if ! isDefault; then
|
|
|
|
if isStatic; then
|
|
|
|
provides+=('mingw-w64-qt5-base-static')
|
|
|
|
conflicts+=('mingw-w64-qt5-base-static' 'mingw-w64-qt5-base-angle-static' 'mingw-w64-qt5-base-noopengl-static'
|
2016-09-04 16:38:05 +02:00
|
|
|
'mingw-w64-qt5-base-dynamic-static' 'mingw-w64-qt5-base-openql-static')
|
2016-08-27 14:44:08 +02:00
|
|
|
else
|
|
|
|
provides+=('mingw-w64-qt5-base')
|
|
|
|
conflicts+=('mingw-w64-qt5-base' 'mingw-w64-qt5-base-angle' 'mingw-w64-qt5-base-noopengl'
|
2016-09-04 16:38:05 +02:00
|
|
|
'mingw-w64-qt5-base-dynamic' 'mingw-w64-qt5-base-openql')
|
2016-08-27 14:44:08 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cd "${srcdir}/${_pkgfqn}"
|
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# apply patches; further descriptions can be found in patch files itself
|
2016-09-19 22:18:45 +02:00
|
|
|
for patch in "$srcdir/"*.patch; do
|
2018-06-11 20:26:28 +02:00
|
|
|
msg2 "Applying patch $patch"
|
2018-01-14 00:41:10 +01:00
|
|
|
patch -p1 -i "$patch"
|
2016-09-19 22:18:45 +02:00
|
|
|
done
|
2016-08-27 14:44:08 +02:00
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# make sure the Qt 5 build system uses our external ANGLE library
|
2016-08-27 14:44:08 +02:00
|
|
|
rm -rf src/3rdparty/angle include/QtANGLE/{EGL,GLES2,GLES3,KHR}
|
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# as well as our external PCRE library and zlib
|
2016-08-27 14:44:08 +02:00
|
|
|
rm -rf src/3rdparty/{pcre,zlib}
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd "${srcdir}/${_pkgfqn}"
|
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# do not set any flags here, flags are configured via mkspec
|
|
|
|
# (Setting flags here is not appropriate as it does not allow to
|
|
|
|
# distinguish between flags for native compiler and cross compiler.)
|
2016-09-04 16:38:05 +02:00
|
|
|
unset CFLAGS
|
|
|
|
unset CXXFLAGS
|
2016-08-27 14:44:08 +02:00
|
|
|
unset LDFLAGS
|
2017-01-23 21:37:13 +01:00
|
|
|
unset PKG_CONFIG_PATH
|
2016-08-27 14:44:08 +02:00
|
|
|
|
|
|
|
for _arch in ${_architectures}; do
|
2018-05-23 20:56:49 +02:00
|
|
|
# define general configure arguments
|
2016-09-04 16:38:05 +02:00
|
|
|
local qt_configure_args="\
|
2018-05-23 20:56:49 +02:00
|
|
|
-xplatform win32-g++ \
|
2016-08-27 14:44:08 +02:00
|
|
|
-optimized-qmake \
|
|
|
|
-verbose \
|
|
|
|
-opensource \
|
|
|
|
-confirm-license \
|
|
|
|
-force-pkg-config \
|
|
|
|
-force-debug-info \
|
|
|
|
-system-zlib \
|
|
|
|
-system-libpng \
|
|
|
|
-system-libjpeg \
|
|
|
|
-system-sqlite \
|
2016-09-03 18:31:00 +02:00
|
|
|
-system-freetype \
|
2016-08-27 14:44:08 +02:00
|
|
|
-system-harfbuzz \
|
2016-09-03 18:31:00 +02:00
|
|
|
-system-pcre \
|
2016-08-27 14:44:08 +02:00
|
|
|
-no-fontconfig \
|
2017-01-23 21:37:13 +01:00
|
|
|
-sql-mysql \
|
|
|
|
-sql-psql \
|
|
|
|
-sql-sqlite \
|
2016-08-27 14:44:08 +02:00
|
|
|
-dbus-linked \
|
|
|
|
-no-glib \
|
|
|
|
-no-icu \
|
2017-01-23 21:37:13 +01:00
|
|
|
-iconv \
|
2016-08-27 14:44:08 +02:00
|
|
|
-nomake examples \
|
|
|
|
-make tools \
|
|
|
|
-hostprefix /usr/${_arch} \
|
|
|
|
-hostdatadir /usr/${_arch}/lib/qt \
|
|
|
|
-hostbindir /usr/${_arch}/lib/qt/bin \
|
|
|
|
-prefix /usr/${_arch} \
|
|
|
|
-bindir /usr/${_arch}/bin \
|
|
|
|
-archdatadir /usr/${_arch}/lib/qt \
|
|
|
|
-datadir /usr/${_arch}/share/qt \
|
|
|
|
-docdir /usr/${_arch}/share/doc/qt \
|
|
|
|
-examplesdir /usr/${_arch}/share/qt/examples \
|
|
|
|
-headerdir /usr/${_arch}/include/qt \
|
|
|
|
-libdir /usr/${_arch}/lib \
|
|
|
|
-plugindir /usr/${_arch}/lib/qt/plugins \
|
|
|
|
-sysconfdir /usr/${_arch}/etc \
|
|
|
|
-translationdir /usr/${_arch}/share/qt/translations \
|
2016-09-17 16:23:20 +02:00
|
|
|
-device-option CROSS_COMPILE=${_arch}- \
|
2018-05-23 20:56:49 +02:00
|
|
|
-device-option CROSS_COMPILE_PREFIX=/usr/${_arch}"
|
2016-08-27 14:44:08 +02:00
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# allows using ccache despite the use of pre-compile header (sloppiness must be set to pch_defines,time_macros in ccache config for this)
|
|
|
|
qt_configure_args+=' -device-option CROSS_COMPILE_CFLAGS=-fpch-preprocess'
|
2016-08-27 14:44:08 +02:00
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# add include directory of freetype2 and dbus manually (pkg-config detection in qmake doesn't work which is currently ignored via a patch)
|
|
|
|
qt_configure_args+=" $(${_arch}-pkg-config --cflags-only-I freetype2 dbus-1 | sed -e "s/-I\/usr\/${_arch}\/include //g")"
|
|
|
|
# note: The sed is required to prevent -isystem /usr/${_arch}/include (qmake will turn -I into -isystem) which would lead to
|
|
|
|
# the same issue as here: https://github.com/Martchus/tageditor/issues/22#issuecomment-330899141
|
|
|
|
|
|
|
|
# enable debug build if MINGW_W64_QT_DEBUG_BUILD is set (could be set in eg. /etc/makepkg.config if debug build is wanted)
|
2017-06-30 22:27:38 +02:00
|
|
|
[[ $MINGW_W64_QT_DEBUG_BUILD ]] \
|
|
|
|
&& qt_configure_args+=' -debug-and-release' \
|
|
|
|
|| qt_configure_args+=' -release'
|
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# configure usage of ANGLE/OpenGL
|
2016-08-27 14:44:08 +02:00
|
|
|
if isOpenGL; then
|
2016-09-04 16:38:05 +02:00
|
|
|
msg2 'Using native OpenGL backend'
|
2016-08-27 14:44:08 +02:00
|
|
|
qt_configure_args+=' -opengl desktop'
|
|
|
|
elif isNoOpenGL; then
|
2016-09-04 16:38:05 +02:00
|
|
|
msg2 'Building without OpenGL support'
|
2016-08-27 14:44:08 +02:00
|
|
|
qt_configure_args+=' -no-opengl'
|
|
|
|
elif isANGLE; then
|
|
|
|
if isDynamic; then
|
2016-09-04 16:38:05 +02:00
|
|
|
msg2 'Using dynamic OpenGL backend'
|
2016-08-27 14:44:08 +02:00
|
|
|
qt_configure_args+=' -opengl dynamic'
|
|
|
|
else
|
2016-09-04 16:38:05 +02:00
|
|
|
msg2 'Using ANGLE as OpenGL backend'
|
2017-01-23 21:37:13 +01:00
|
|
|
qt_configure_args+=' -angle'
|
2016-08-27 14:44:08 +02:00
|
|
|
fi
|
2018-05-23 20:56:49 +02:00
|
|
|
# enable declarations of GLES functions
|
2016-08-27 14:44:08 +02:00
|
|
|
qt_configure_args+=' -DGL_GLEXT_PROTOTYPES'
|
|
|
|
fi
|
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# add include directory of MariaDB
|
2017-01-23 21:37:13 +01:00
|
|
|
qt_configure_args+=" -I/usr/${_arch}/include/mariadb"
|
2016-08-27 14:44:08 +02:00
|
|
|
|
2017-12-08 19:49:53 +01:00
|
|
|
msg2 'Configure and build qmake'
|
2016-08-27 14:44:08 +02:00
|
|
|
mkdir -p ../build-${_arch} && pushd ../build-${_arch}
|
|
|
|
if isStatic; then
|
2018-05-23 20:56:49 +02:00
|
|
|
qt_configure_args+=' -static'
|
|
|
|
|
|
|
|
# configure static version to use linked OpenSSL
|
|
|
|
qt_configure_args+=' -openssl-linked'
|
|
|
|
export OPENSSL_LIBS="/usr/${_arch}/lib/libssl.a /usr/${_arch}/lib/libcrypto.a -lws2_32 -lgdi32 -lcrypt32 -ldnsapi -liphlpapi"
|
|
|
|
|
2016-08-27 14:44:08 +02:00
|
|
|
else
|
2018-05-23 20:56:49 +02:00
|
|
|
qt_configure_args+=' -shared'
|
|
|
|
|
|
|
|
# configure shared version to load OpenSSL dynamically
|
|
|
|
qt_configure_args+=' -openssl-runtime'
|
|
|
|
|
|
|
|
qt_configure_args+=' -device-option CROSS_COMPILE_CUSTOM_CONFIG=actually_a_shared_build'
|
|
|
|
|
|
|
|
# override LD_LIBRARY_PATH so libraries for native build tools like libQt5Bootstrap.so are found
|
|
|
|
export LD_LIBRARY_PATH="$PWD/lib"
|
|
|
|
export LDFLAGS="-L$PWD/lib"
|
2016-08-27 14:44:08 +02:00
|
|
|
fi
|
2018-05-23 20:56:49 +02:00
|
|
|
|
|
|
|
msg2 'Build qmake and configure' && ../${_pkgfqn}/configure $qt_configure_args
|
|
|
|
msg2 'Build Qt libraries' && make
|
|
|
|
|
2016-08-27 14:44:08 +02:00
|
|
|
popd
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
for _arch in ${_architectures}; do
|
|
|
|
cd "$srcdir/${_pkgfqn}"
|
|
|
|
make install -C ../build-${_arch} INSTALL_ROOT="${pkgdir}"
|
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# use prl files from build directory since installed prl files seem to have incorrect QMAKE_PRL_LIBS_FOR_CMAKE
|
2018-02-15 00:14:36 +01:00
|
|
|
pushd "$srcdir/build-${_arch}/lib"
|
2018-05-23 20:56:49 +02:00
|
|
|
find -iname '*.prl' -exec cp --target-directory "${pkgdir}/usr/${_arch}/lib" --parents {} +
|
2018-02-15 00:14:36 +01:00
|
|
|
popd
|
|
|
|
pushd "$srcdir/build-${_arch}/plugins"
|
2018-05-23 20:56:49 +02:00
|
|
|
find -iname '*.prl' -exec cp --target-directory "${pkgdir}/usr/${_arch}/lib/qt/plugins" --parents {} +
|
2018-02-15 00:14:36 +01:00
|
|
|
popd
|
|
|
|
|
2016-08-27 14:44:08 +02:00
|
|
|
if isStatic; then
|
|
|
|
# The static release contains only the static libs itself but relies on the
|
2018-05-23 20:56:49 +02:00
|
|
|
# shared release for Qt5Bootstrap library and tools (qmake, uic, ...).
|
2016-08-27 14:44:08 +02:00
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# drop Qt5Bootstrap and libraries which are only provided as static lib
|
|
|
|
# and hence already present in shared build (such as Qt5OpenGLExtensions)
|
2017-06-30 22:27:38 +02:00
|
|
|
rm -f \
|
|
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}qt5main* \
|
2017-01-23 21:37:13 +01:00
|
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5AccessibilitySupport* \
|
|
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5DeviceDiscoverySupport* \
|
2017-12-08 19:49:53 +01:00
|
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5EdidSupport* \
|
2017-01-23 21:37:13 +01:00
|
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5EventDispatcherSupport* \
|
|
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5FbSupport* \
|
|
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5FontDatabaseSupport* \
|
|
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5PlatformCompositorSupport* \
|
|
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5ThemeSupport* \
|
2016-08-27 14:44:08 +02:00
|
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5OpenGLExtensions* \
|
|
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5PlatformSupport* \
|
2018-05-23 20:56:49 +02:00
|
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5WindowsUIAutomationSupport* \
|
2016-12-20 23:05:26 +01:00
|
|
|
"${pkgdir}/usr/${_arch}/lib/"libQt5Bootstrap* \
|
2016-08-27 14:44:08 +02:00
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# ensure config files don't conflict with shared version
|
2016-10-27 23:14:58 +02:00
|
|
|
pushd "${pkgdir}/usr/${_arch}/lib/cmake"
|
|
|
|
for cmake_dir in $(find . ! -path . -type d ! -name 'Static*'); do
|
|
|
|
mkdir -p "./Static${cmake_dir:2}";
|
|
|
|
mv "${cmake_dir}/"* "./Static${cmake_dir:2}";
|
|
|
|
rm -r "${cmake_dir}"
|
|
|
|
done
|
|
|
|
rm -r "./StaticQt5OpenGLExtensions"
|
|
|
|
popd
|
|
|
|
rm "${pkgdir}/usr/${_arch}/lib/pkgconfig/StaticQt5OpenGLExtensions.pc"
|
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# create links to static plugins in lib directory
|
2016-08-27 14:44:08 +02:00
|
|
|
pushd "${pkgdir}/usr/${_arch}/lib/" && ln -s "./qt/plugins/"*/*.a . && popd
|
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# keep a couple pri files not found in base
|
2016-08-27 14:44:08 +02:00
|
|
|
mv "${pkgdir}/usr/${_arch}/lib/qt/mkspecs/modules/qt_plugin_"*.pri "${pkgdir}/usr/${_arch}"
|
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# delete duplicate files that are in the base package
|
2016-08-27 14:44:08 +02:00
|
|
|
rm -fR "${pkgdir}/usr/${_arch}/"{include,share}
|
|
|
|
rm -fR "${pkgdir}/usr/${_arch}/lib/"{qt/bin,qt/mkspecs}
|
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# move pri files back
|
2016-08-27 14:44:08 +02:00
|
|
|
mkdir -p "${pkgdir}/usr/${_arch}/lib/qt/mkspecs/modules"
|
|
|
|
mv "${pkgdir}/usr/${_arch}/"*.pri "${pkgdir}/usr/${_arch}/lib/qt/mkspecs/modules"
|
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
else # shared version
|
|
|
|
# remove DLLs from libdir (DLLs are installed in both bindir and libdir, one copy is sufficient)
|
2016-08-27 14:44:08 +02:00
|
|
|
find "${pkgdir}/usr/${_arch}/lib" -maxdepth 1 -name "*.dll" -exec rm {} \;
|
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# create symlinks for tools
|
2016-08-27 14:44:08 +02:00
|
|
|
mkdir -p "${pkgdir}/usr/bin"
|
|
|
|
for tool in qmake moc rcc uic qdbuscpp2xml qdbusxml2cpp qdoc syncqt.pl; do
|
|
|
|
ln -s "../${_arch}/lib/qt/bin/${tool}" "${pkgdir}/usr/bin/${_arch}-${tool}-qt5"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# drop QMAKE_PRL_BUILD_DIR because reference the build dir
|
2018-02-15 00:14:36 +01:00
|
|
|
find "${pkgdir}/usr/${_arch}/lib" -type f -name '*.prl' -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
|
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# remove doc
|
2016-08-27 14:44:08 +02:00
|
|
|
rm -rf "${pkgdir}/usr/${_arch}/share/doc"
|
|
|
|
|
2018-05-23 20:56:49 +02:00
|
|
|
# remove prl files for debug version
|
|
|
|
if ! [[ $MINGW_W64_QT_DEBUG_BUILD ]]; then
|
|
|
|
for file in $(find "${pkgdir}/usr/${_arch}" -name '*d.prl' -o -name '*d.static.prl'); do
|
|
|
|
[ -f "${file%d*}${file##*d}" ] && rm "${file}";
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
# replace library path in *.prl files so it points to the installed location and not the build directory
|
|
|
|
find "${pkgdir}/usr/${_arch}/lib" \( -type f -name '*.prl' -o -name '*.pc' \) -exec sed -i -e "s:${PWD%/*}/build-${_arch}/lib:/usr/${_arch}/lib:g" {} \;
|
|
|
|
|
|
|
|
# strip binaries, remove unuseful files
|
2016-08-27 14:44:08 +02:00
|
|
|
if ! isStatic; then
|
|
|
|
strip --strip-all "${pkgdir}/usr/${_arch}/lib/qt/bin/"*[!.pl]
|
|
|
|
strip --strip-unneeded "${pkgdir}/usr/${_arch}/lib/libQt5Bootstrap"{,DBus}.so.${pkgver}
|
|
|
|
fi
|
|
|
|
if isStatic || [[ $NO_EXECUTABLES ]]; then
|
2018-05-23 20:56:49 +02:00
|
|
|
find "${pkgdir}/usr/${_arch}" -name '*.exe' -delete
|
2016-08-27 14:44:08 +02:00
|
|
|
else
|
2018-05-23 20:56:49 +02:00
|
|
|
find "${pkgdir}/usr/${_arch}" -name '*.exe' -exec ${_arch}-strip --strip-all {} \;
|
2016-08-27 14:44:08 +02:00
|
|
|
fi
|
2018-05-23 20:56:49 +02:00
|
|
|
find "${pkgdir}/usr/${_arch}" \( -name '*.bat' -o -name '*.def' -o -name '*.exp' \) -delete
|
|
|
|
find "${pkgdir}/usr/${_arch}" -name '*.dll' -exec ${_arch}-strip --strip-unneeded {} \;
|
|
|
|
find "${pkgdir}/usr/${_arch}" \( -name '*.a' -not -name 'libQt5QmlDevTools.a' -not -name 'libQt5Bootstrap.a' \) -exec ${_arch}-strip -g {} \;
|
2016-08-27 14:44:08 +02:00
|
|
|
done
|
|
|
|
}
|