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-02-15 00:14:36 +01:00
|
|
|
pkgver=5.10.1
|
2018-03-17 17:08:22 +01:00
|
|
|
pkgrel=2
|
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'
|
|
|
|
'0032-Fix-linking-against-static-plugins-with-qmake.patch')
|
|
|
|
sha256sums=('d8660e189caa5da5142d5894d328b61a4d3ee9750b76d61ad74e4eee8765a969'
|
2018-03-17 17:08:22 +01:00
|
|
|
'1c482310bbfef78733a2013f42e505657059e720cf139ddcf5ad692c4dbf06b1'
|
|
|
|
'45a1020a351931b7171e55ef8165d2cc4af3bf2473b142daa51f3b5b15c447f3'
|
|
|
|
'ceb05dabed9fa2fc781e5abcfb54285960267922bac753df4179831a240da9b7'
|
|
|
|
'c4138094696342f8f976c01c9ce66919ae38802f36d3280b47883446e8d74bf9'
|
|
|
|
'2f99ae05056636b434bf7a533db6de7561c6f6e3fe8e854b4e9a182e30c684b3'
|
|
|
|
'fa69c484d557f45b1929e0b4be6328837717337155477a8fab3f9ea59731c749'
|
|
|
|
'57de459c6af72293560afcf7a872b1a4b10badd986c1fc1b43d7aaf55caf52c5'
|
|
|
|
'58e6f6a0271e82be5b7560a247cb70809169148e6413c473e2c3fed97e5d1c45'
|
|
|
|
'ea39d2b90a848a4c36a7685688283b773ff2ed5e6912be52a943f31376eefc81'
|
|
|
|
'b8f5a6a707f20cce64d9e5f04c35c555d7d14cd20344510205babc9a5698a15a'
|
|
|
|
'b1eaea87c7d7b774657feb4745450ab4e423c158ff81c144d724dcd8ac950c6f'
|
|
|
|
'8092fe23e35906b9a967ec78e1892769f06f1699c4c177ea0814876fb7c423d2'
|
|
|
|
'4b73f19e254466e5e4d13459088f773a44c9f05033ad5d29995c5116f18f999d'
|
|
|
|
'6a1411e406efab5521af71b2b8cf122c8443157114799f23d3e2cd1dc59c8e14'
|
|
|
|
'52b0fc09f05d1ca2efbf3a046cf933e72dae4bfd63026298fd60360103106c5a'
|
|
|
|
'30b5bded4f2e3ac5e4c83412c92afe0ad604e3eb18a94a3357f220b5e0456d86'
|
|
|
|
'1a18636d6089fe49ae7e0592dad6d71a1466aa0fc2d033ca926c14e468aff0c9'
|
|
|
|
'9710090523aefca66211bd8b74bcdc650125299912b735ba4845408e9e860649'
|
|
|
|
'551f05ad17737fe8b9b00c24a3a5539988455cbb706458e44c3df2df56599f63'
|
|
|
|
'd2f5aaacd2be586cfab27a23120a9f21749c1ac96664071c399f91097274ec89'
|
|
|
|
'23878d79148e4db9e1c5ba2e6e6d2ced259b64aa1ba2f1503ab9938863b2104f'
|
|
|
|
'30f5b6c738609a8ac03f806b86a632c3cf6d85b56e038f812d46358b592cc427'
|
|
|
|
'2782b7eb4f55cb5905b5bcb8387ad3a7130727b036b0fc482b1294380862f5d1'
|
|
|
|
'156e720e4ad44f257019dbe2fe1eef7b7a27989307f8a9f53072f4cbe178c655'
|
|
|
|
'53088ce6f9a22ee1735fb8b7145ce569ac1914ac05fb947ca3afae39d3cb3199'
|
|
|
|
'e61f2fd0c91c72822c1074844897641ce1c9500423b4c646aa8ae1671f9f967b'
|
|
|
|
'cccad985154167818657d0561ec349cb75931a0a64a689ab51041337d73a88b8'
|
|
|
|
'ffbc7f20785904ba64f108498aafe8b5a4c1de76c44aa5353ee3d7202f186408'
|
|
|
|
'1572c30c43e9e6d23d0f42c99c9501f092eae5d2bad2b0bc0eb694b295c0c473'
|
|
|
|
'ef96dffc0dd3bb76b237c6e886d6d5cc154e25f5ed4d5f65643e272a58306327'
|
|
|
|
'73d9df72df2f55c19ddeb9241de818d39c8da3399eee55f306889dc3c11dc934'
|
|
|
|
'892bb35a340597c77da5310685cc47102cf2522fb01cbc6d1785016babc78727')
|
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
|
|
|
|
|
|
|
|
patch() {
|
|
|
|
local input_found=
|
|
|
|
local patch_file=
|
|
|
|
for arg in $@; do
|
|
|
|
if [[ $input_found ]]; then
|
|
|
|
patch_file="$arg"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
[[ $arg == -i ]] && input_found=1
|
|
|
|
done
|
|
|
|
msg2 "Applying patch $patch_file"
|
|
|
|
/usr/bin/patch $@
|
|
|
|
}
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cd "${srcdir}/${_pkgfqn}"
|
|
|
|
|
2016-09-19 22:18:45 +02:00
|
|
|
# Apply patches; further descriptions can be found in patch files itself
|
|
|
|
for patch in "$srcdir/"*.patch; do
|
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
|
|
|
|
|
|
|
# Make sure the Qt5 build system uses our external ANGLE library
|
|
|
|
rm -rf src/3rdparty/angle include/QtANGLE/{EGL,GLES2,GLES3,KHR}
|
|
|
|
|
|
|
|
# As well as our external PCRE library and zlib
|
|
|
|
rm -rf src/3rdparty/{pcre,zlib}
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd "${srcdir}/${_pkgfqn}"
|
|
|
|
|
2016-09-04 16:38:05 +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
|
|
|
|
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
|
|
|
|
# To prevent conflicts with the mingw-w64-qt4 package we have
|
2016-10-07 10:23:48 +02:00
|
|
|
# to put tools in a dedicated folder
|
2016-09-17 16:23:20 +02:00
|
|
|
|
2018-02-15 00:14:36 +01:00
|
|
|
# The last device option allows using ccache despite the use of
|
2016-09-17 16:23:20 +02:00
|
|
|
# pre-compile header
|
|
|
|
# (sloppiness must be set to pch_defines,time_macros in ccache config)
|
|
|
|
|
2016-09-04 16:38:05 +02:00
|
|
|
local qt_configure_args="\
|
2017-01-23 21:37:13 +01:00
|
|
|
-xplatform mingw-w64-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}- \
|
2017-06-30 22:27:38 +02:00
|
|
|
-device-option CROSS_COMPILE_PREFIX=/usr/${_arch} \
|
2016-09-17 16:23:20 +02:00
|
|
|
-device-option CROSS_COMPILE_CFLAGS=-fpch-preprocess"
|
2016-08-27 14:44:08 +02:00
|
|
|
|
2016-09-04 16:38:05 +02:00
|
|
|
# Fix include directory of freetype2 and dbus
|
|
|
|
qt_configure_args+=" $(${_arch}-pkg-config --cflags-only-I freetype2 dbus-1)"
|
2016-08-27 14:44:08 +02:00
|
|
|
|
2017-06-30 22:27:38 +02:00
|
|
|
# Enable debug build if MINGW_W64_QT_DEBUG_BUILD is set (in /etc/makepkg.config)
|
|
|
|
[[ $MINGW_W64_QT_DEBUG_BUILD ]] \
|
|
|
|
&& qt_configure_args+=' -debug-and-release' \
|
|
|
|
|| qt_configure_args+=' -release'
|
|
|
|
|
2016-08-27 14:44:08 +02:00
|
|
|
# Configure usage of ANGLE/OpenGL
|
|
|
|
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
|
|
|
|
# GL_GLEXT_PROTOTYPES must be defined to enable declarations of GLES functions
|
|
|
|
qt_configure_args+=' -DGL_GLEXT_PROTOTYPES'
|
|
|
|
fi
|
|
|
|
|
2017-01-23 21:37:13 +01:00
|
|
|
# Fix MariaDB
|
|
|
|
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
|
2017-12-08 19:49:53 +01:00
|
|
|
export OPENSSL_LIBS="/usr/${_arch}/lib/libssl.a /usr/${_arch}/lib/libcrypto.a -lws2_32 -lgdi32 -lcrypt32"
|
2017-06-30 22:27:38 +02:00
|
|
|
../${_pkgfqn}/configure \
|
|
|
|
$qt_configure_args \
|
|
|
|
-static \
|
|
|
|
-openssl-linked
|
2017-12-08 19:49:53 +01:00
|
|
|
msg2 'Build static Qt libraries'
|
2016-08-27 14:44:08 +02:00
|
|
|
make
|
|
|
|
else
|
|
|
|
# The LD_LIBRARY_PATH override is needed because libQt5Bootstrap* are shared
|
|
|
|
# libraries which various compiled tools (like moc) use. As the libQt5Bootstrap*
|
|
|
|
# libraries aren't installed at this point yet, we have to workaround this
|
2017-12-08 19:49:53 +01:00
|
|
|
../${_pkgfqn}/configure \
|
|
|
|
$qt_configure_args \
|
2017-06-30 22:27:38 +02:00
|
|
|
-shared \
|
|
|
|
-openssl-runtime \
|
|
|
|
-device-option 'CROSS_COMPILE_CUSTOM_CONFIG=actually_a_shared_build'
|
2017-12-08 19:49:53 +01:00
|
|
|
msg2 'Build shared Qt libraries'
|
2016-08-27 14:44:08 +02:00
|
|
|
LD_LIBRARY_PATH="$PWD/lib" LDFLAGS="-L$PWD/lib" make
|
|
|
|
fi
|
|
|
|
popd
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
for _arch in ${_architectures}; do
|
|
|
|
cd "$srcdir/${_pkgfqn}"
|
|
|
|
make install -C ../build-${_arch} INSTALL_ROOT="${pkgdir}"
|
|
|
|
|
2018-02-15 00:14:36 +01:00
|
|
|
# Use prl files from build directory since installed prl files seem to have incorrect QMAKE_PRL_LIBS_FOR_CMAKE
|
|
|
|
pushd "$srcdir/build-${_arch}/lib"
|
|
|
|
find -iname '*.static.prl' -exec cp --target-directory "${pkgdir}/usr/${_arch}/lib" --parents {} +
|
|
|
|
popd
|
|
|
|
pushd "$srcdir/build-${_arch}/plugins"
|
|
|
|
find -iname '*.static.prl' -exec cp --target-directory "${pkgdir}/usr/${_arch}/lib/qt/plugins" --parents {} +
|
|
|
|
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
|
|
|
|
# shared release for Qt5Bootstrap library and tools (qmake, uic, ...)
|
|
|
|
|
2016-09-04 16:38:05 +02:00
|
|
|
# Drop Qt5Bootstrap and libraries which are only provided as static lib
|
2016-10-27 23:14:58 +02:00
|
|
|
# and are 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* \
|
2016-12-20 23:05:26 +01:00
|
|
|
"${pkgdir}/usr/${_arch}/lib/"libQt5Bootstrap* \
|
2016-08-27 14:44:08 +02:00
|
|
|
|
2016-10-27 23:14:58 +02:00
|
|
|
# Also ensure config files don't conflict with shared version
|
|
|
|
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-02-15 00:14:36 +01: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
|
|
|
|
|
|
|
|
# Keep a couple pri files not found in base
|
|
|
|
mv "${pkgdir}/usr/${_arch}/lib/qt/mkspecs/modules/qt_plugin_"*.pri "${pkgdir}/usr/${_arch}"
|
|
|
|
|
|
|
|
# Delete duplicate files that are in the base package
|
|
|
|
rm -fR "${pkgdir}/usr/${_arch}/"{include,share}
|
|
|
|
rm -fR "${pkgdir}/usr/${_arch}/lib/"{qt/bin,qt/mkspecs}
|
|
|
|
|
|
|
|
# Move pri files back
|
|
|
|
mkdir -p "${pkgdir}/usr/${_arch}/lib/qt/mkspecs/modules"
|
|
|
|
mv "${pkgdir}/usr/${_arch}/"*.pri "${pkgdir}/usr/${_arch}/lib/qt/mkspecs/modules"
|
|
|
|
|
|
|
|
else # Shared release
|
|
|
|
# The .dll's are installed in both bindir and libdir, one copy of the .dll's is sufficient
|
|
|
|
find "${pkgdir}/usr/${_arch}/lib" -maxdepth 1 -name "*.dll" -exec rm {} \;
|
|
|
|
|
2016-10-27 23:14:58 +02:00
|
|
|
# The Qt5OpenGLExtensions module is only available as static library and hence part of the
|
|
|
|
# shared build
|
|
|
|
|
2016-08-27 14:44:08 +02:00
|
|
|
# Create symlinks for tools
|
|
|
|
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-02-15 00:14:36 +01:00
|
|
|
# Drop QMAKE_PRL_BUILD_DIR because reference the build dir
|
|
|
|
find "${pkgdir}/usr/${_arch}/lib" -type f -name '*.prl' -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
|
|
|
|
|
2016-08-27 14:44:08 +02:00
|
|
|
# Remove doc
|
|
|
|
rm -rf "${pkgdir}/usr/${_arch}/share/doc"
|
|
|
|
|
|
|
|
# Strip the binaries
|
|
|
|
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
|
|
|
|
|
|
|
|
# Applications might be useful as well; keeping them by default will not hurt anybody I suppose
|
|
|
|
if isStatic || [[ $NO_EXECUTABLES ]]; then
|
|
|
|
find "${pkgdir}/usr/${_arch}" -name "*.exe" -exec rm {} \;
|
|
|
|
else
|
|
|
|
find "${pkgdir}/usr/${_arch}" -name "*.exe" -exec ${_arch}-strip --strip-all {} \;
|
|
|
|
fi
|
|
|
|
# No use for these files though
|
|
|
|
find "${pkgdir}/usr/${_arch}" \( -name "*.bat" -o -name "*.def" -o -name "*.exp" \) -exec rm {} \;
|
|
|
|
# Strip binaries
|
|
|
|
find "${pkgdir}/usr/${_arch}" -name "*.dll" -exec ${_arch}-strip --strip-unneeded {} \;
|
|
|
|
find "${pkgdir}/usr/${_arch}" -name "*.a" -exec ${_arch}-strip -g {} \;
|
|
|
|
done
|
|
|
|
}
|