404 lines
18 KiB
Bash
404 lines
18 KiB
Bash
# Maintainer: Martchus <martchus@gmx.net>
|
|
# Contributor: ant32 <antreimer@gmail.com>
|
|
# Contributor: Filip Brcic <brcha@gna.org>
|
|
# Contributor: jellysheep <max.mail@dameweb.de>
|
|
|
|
# BEFORE COMMENTING OR REPORING ISSUES, PLEASE READ THE FILE `README.md` IN THIS REPOSITORY.
|
|
# ALSO HAVE A LOOK AT THE COMMENTS IN THE AUR.
|
|
|
|
# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where
|
|
# you also find the URL of a binary repository.
|
|
|
|
# All patches are managed at https://github.com/Martchus/qtbase
|
|
|
|
# Helper functions for the split builds
|
|
isDefault() {
|
|
[[ $pkgname = 'mingw-w64-qt5-base' ]] || [[ $pkgname = 'mingw-w64-qt5-base-static' ]]
|
|
}
|
|
isStatic() {
|
|
[ "${pkgname##*-}" = 'static' ]
|
|
}
|
|
isOpenGL() {
|
|
# Currently use native OpenGL by default
|
|
isDefault || \
|
|
[[ $pkgname = 'mingw-w64-qt5-base-opengl' ]] || [[ $pkgname = 'mingw-w64-qt5-base-opengl-static' ]]
|
|
}
|
|
isANGLE() {
|
|
[[ $pkgname = 'mingw-w64-qt5-base-angle' ]] || [[ $pkgname = 'mingw-w64-qt5-base-angle-static' ]] || \
|
|
[[ $pkgname = 'mingw-w64-qt5-base-dynamic' ]] || [[ $pkgname = 'mingw-w64-qt5-base-dynamic-static' ]]
|
|
# Treat dynamic version like ANGLE version, correct?
|
|
}
|
|
isDynamic() {
|
|
[[ $pkgname = 'mingw-w64-qt5-base-dynamic' ]] || [[ $pkgname = 'mingw-w64-qt5-base-dynamic-static' ]]
|
|
}
|
|
isNoOpenGL() {
|
|
[[ $pkgname = 'mingw-w64-qt5-base-noopengl' ]] || [[ $pkgname = 'mingw-w64-qt5-base-noopengl-static' ]]
|
|
}
|
|
|
|
pkgname=mingw-w64-qt5-base-angle
|
|
pkgver=5.12.3
|
|
pkgrel=1
|
|
pkgdesc='A cross-platform application and UI framework (mingw-w64)'
|
|
# The static variant doesn't contain any executables which need to be executed on the build machine
|
|
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'
|
|
'mingw-w64-libpng' 'mingw-w64-openssl' 'mingw-w64-dbus' 'mingw-w64-harfbuzz'
|
|
'mingw-w64-pcre2')
|
|
groups=('mingw-w64-qt5')
|
|
optdepends=('mingw-w64-postgresql: PostgreSQL support' 'mingw-w64-mariadb-connector-c: MySQL support')
|
|
makedepends=('mingw-w64-gcc' 'mingw-w64-postgresql' 'mingw-w64-mariadb-connector-c' 'mingw-w64-pkg-config')
|
|
options=('!strip' '!buildflags' 'staticlibs' '!emptydirs')
|
|
_pkgfqn="qtbase-everywhere-src-${pkgver}"
|
|
source=("https://download.qt.io/official_releases/qt/${pkgver%.*}/${pkgver}/submodules/${_pkgfqn}.tar.xz"
|
|
'0001-Adjust-win32-g-profile-for-cross-compilation-with-mi.patch'
|
|
'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'
|
|
'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'
|
|
'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'
|
|
'0033-Disable-hardware-randomizer-for-32-bit.patch'
|
|
'0034-Prevent-static-build-to-prefer-dynamic-libraries.patch')
|
|
sha256sums=('562c095a59c95f393762ec53bc05c0d80fad1758fd5ff7a5231967d1a98d56c1'
|
|
'813332969dbfd7fcc8af3d23457eea0ce3b3a54ed9b9eae62b431529b8f60b22'
|
|
'96b9e2fb177de9c8cfe8c8cd601705981d4c223eef9fc582ec0f45d26c6b6d7f'
|
|
'b1aa13e0e6e28718edb11520660954101c662f6b6945a83cb4e84ff7de5c0922'
|
|
'2be87f841ac2104f44114ec65dbd35f8bf8280176b9341015b99aa7dd6756967'
|
|
'c61a62a241b0d03354b523dd9d4ae811e55b12e6e2683c45a3bfd67574e2ad8a'
|
|
'1050833662659481606f94a2f4a95f764e7d1ae8b9d015a497b508884cd755d0'
|
|
'eea4870ab1394e9473fe1cee2d856bb5d0d31b68ec91b20d45c882893049a9f6'
|
|
'11a4267ae9fa3d49046945ba7e0867b400364f0475c2d36814af45fbc4c3f2f0'
|
|
'2b977aba78484cb01208300d02a9ce945edfa0ac73ad91c9331cb73851c9b85d'
|
|
'd9e8736c57f5f8841238fe131508d29d9de0fa3d0c0554e1a443aab33147b430'
|
|
'f30bd604cf3da044f38da38d873a988870d0413aafa5f437d11286d2d3dbb42b'
|
|
'00b84c1b66212797876b1793b36e3537dc866770f632b4d98b91d84e6766c2d8'
|
|
'2fdf313e492061c7a34b63b25129c253088714a632616437c7ab473b43eca5be'
|
|
'6cde53dd184b5aa79e3c471392eaa6e2ac9dc72e8394dab7248cb8a0ac3e856f'
|
|
'64b37f777b45bc1b134ea5723ccc6c430784ebbf53b428addeb73ba1108c9225'
|
|
'7b4398060dd40fcf8f23b5ca908a0f79be7adfe7f15ad9ec77f23913b5c6c3fc'
|
|
'bfb28bde40b37d74585174414a647af051a8da251107513d3c5e160c72fa7af5'
|
|
'9809aab5b4fadf65c2704654ac2c171877b634d5b874af6c96574159ba9f2002'
|
|
'374b0ed5fe0285389dda11a6fbccabd3094d2aaa7489d3e59d9b31ead444ce27'
|
|
'0961354456c56fa6041758ee35f26d563e60f4ed3bcae214abec2ffbd89f3e80'
|
|
'78681b7f7a6456cda9ca4bef34bf4caf3dfbeb36e7fc8b12a834b5e4da328926'
|
|
'a95252d2305437fe5ada214162b9952efbc6f3e97399e55cb003d1c394f1770a'
|
|
'b7b16afef904785a9681b2c03c98a54e8edb224568c63d155bd3f0f1b0508054'
|
|
'd883c7c1148e2177c7ff23a3fdbdc3956b9b963c82661f227e2c57829358c7f4'
|
|
'0b90abe95bbe585ba2b39b98b7e3cdb85d6827a2afdb8ed677e6a83e33a31009'
|
|
'bcbe378ec13c845939cf69899bdeb50a7711eef1e5e5127cdc1c9b020f1edd20'
|
|
'eaa58ae6a0fa740fbd376a39b1c2fab9d77c3eae1456ecef47caef9cc4587638'
|
|
'd183ee330c718b440c72ebd90cea389bf13cc99e6a34bf15d4818d663b06ec50'
|
|
'673b15ce54ff120d17e7ddc20bcc8c9467bee16935b7ab1ec45946307c8caf56'
|
|
'c1d67dfed8e9b43fe0e4ab20c5f9c918c83ecc8ba8930e9cf123beb90d11318b'
|
|
'9df19c8cb6017640944211186ce9a6e21715411e896938de2a6d48368372f23e'
|
|
'043ad519351be44de7d93f775abce8da2880e4eb698ff9444558f4795dab26cc'
|
|
'4180fbc2315ddfc1a7763333c1dc507661bd30689c9162f1e58bf01a6fc9f9f2'
|
|
'0d981d8a25039ff57e5375f34ea036021890fe7302f5f710beb1e5ca1e019e48')
|
|
|
|
_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'
|
|
'mingw-w64-qt5-base-dynamic-static' 'mingw-w64-qt5-base-openql-static')
|
|
else
|
|
provides+=('mingw-w64-qt5-base')
|
|
conflicts+=('mingw-w64-qt5-base' 'mingw-w64-qt5-base-angle' 'mingw-w64-qt5-base-noopengl'
|
|
'mingw-w64-qt5-base-dynamic' 'mingw-w64-qt5-base-openql')
|
|
fi
|
|
fi
|
|
|
|
prepare() {
|
|
cd "${srcdir}/${_pkgfqn}"
|
|
|
|
# apply patches; further descriptions can be found in patch files itself
|
|
for patch in "$srcdir/"*.patch; do
|
|
msg2 "Applying patch $patch"
|
|
patch -p1 -i "$patch"
|
|
done
|
|
|
|
# make sure the Qt 5 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 qmake using mingw-w64 {C,LD}FLAGS
|
|
# This also sets default {C,CXX,LD}FLAGS for projects built using qmake
|
|
CPPFLAGS="${MINGW_CPPFLAGS:--D_FORTIFY_SOURCE=2}"
|
|
CFLAGS="${MINGW_CFLAGS:-$CPPFLAGS -O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4}"
|
|
CXXFLAGS="${MINGW_CXXFLAGS:-$CPPFLAGS -O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4}"
|
|
LDFLAGS="${MINGW_LDFLAGS:--Wl,-O1,--sort-common,--as-needed}"
|
|
sed -i -e "s|^\(QMAKE_CFLAGS_RELEASE.*=\).*$|\1 ${CFLAGS}|" \
|
|
-e "s|^\(QMAKE_CXXFLAGS_RELEASE.*=\).*$|\1 ${CXXFLAGS}|" \
|
|
-e "s|^\(QMAKE_LFLAGS_RELEASE.*=\).*$|\1 ${LDFLAGS}|" \
|
|
mkspecs/common/gcc-base.conf
|
|
sed -i -e "s|^\(QMAKE_LFLAGS_RELEASE.*=\).*$|\1|" \
|
|
mkspecs/common/g++-unix.conf
|
|
}
|
|
|
|
build() {
|
|
cd "${srcdir}/${_pkgfqn}"
|
|
|
|
# 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.
|
|
# See prepare() function.)
|
|
unset CFLAGS
|
|
unset CXXFLAGS
|
|
unset LDFLAGS
|
|
unset PKG_CONFIG_PATH
|
|
|
|
for _arch in ${_architectures}; do
|
|
# define general configure arguments
|
|
local qt_configure_args="\
|
|
-xplatform win32-g++ \
|
|
-optimized-qmake \
|
|
-verbose \
|
|
-opensource \
|
|
-confirm-license \
|
|
-force-pkg-config \
|
|
-force-debug-info \
|
|
-system-zlib \
|
|
-system-libpng \
|
|
-system-libjpeg \
|
|
-system-sqlite \
|
|
-system-freetype \
|
|
-system-harfbuzz \
|
|
-system-pcre \
|
|
-no-fontconfig \
|
|
-sql-mysql \
|
|
-sql-psql \
|
|
-sql-sqlite \
|
|
-dbus-linked \
|
|
-no-glib \
|
|
-no-icu \
|
|
-iconv \
|
|
-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 \
|
|
-device-option CROSS_COMPILE=${_arch}- \
|
|
-device-option CROSS_COMPILE_PREFIX=/usr/${_arch}"
|
|
|
|
# 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'
|
|
qt_configure_args+=' -device-option CROSS_COMPILE_CXXFLAGS=-fpch-preprocess'
|
|
|
|
# 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)
|
|
[[ $MINGW_W64_QT_DEBUG_BUILD ]] \
|
|
&& qt_configure_args+=' -debug-and-release' \
|
|
|| qt_configure_args+=' -release'
|
|
|
|
# configure usage of ANGLE/OpenGL
|
|
if isOpenGL; then
|
|
msg2 'Using native OpenGL backend'
|
|
qt_configure_args+=' -opengl desktop'
|
|
elif isNoOpenGL; then
|
|
msg2 'Building without OpenGL support'
|
|
qt_configure_args+=' -no-opengl'
|
|
elif isANGLE; then
|
|
if isDynamic; then
|
|
msg2 'Using dynamic OpenGL backend'
|
|
qt_configure_args+=' -opengl dynamic'
|
|
else
|
|
msg2 'Using ANGLE as OpenGL backend'
|
|
qt_configure_args+=' -angle'
|
|
fi
|
|
# enable declarations of GLES functions
|
|
qt_configure_args+=' -DGL_GLEXT_PROTOTYPES'
|
|
fi
|
|
|
|
# add include directory of MariaDB
|
|
qt_configure_args+=" -I/usr/${_arch}/include/mariadb"
|
|
|
|
msg2 'Configure and build qmake'
|
|
mkdir -p ../build-${_arch} && pushd ../build-${_arch}
|
|
if isStatic; then
|
|
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"
|
|
|
|
else
|
|
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"
|
|
fi
|
|
|
|
msg2 'Build qmake and configure' && ../${_pkgfqn}/configure $qt_configure_args
|
|
msg2 'Build Qt libraries' && make
|
|
|
|
popd
|
|
done
|
|
}
|
|
|
|
package() {
|
|
for _arch in ${_architectures}; do
|
|
cd "$srcdir/${_pkgfqn}"
|
|
make install -C ../build-${_arch} INSTALL_ROOT="${pkgdir}"
|
|
|
|
# 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 '*.prl' -exec cp --target-directory "${pkgdir}/usr/${_arch}/lib" --parents {} +
|
|
popd
|
|
pushd "$srcdir/build-${_arch}/plugins"
|
|
find -iname '*.prl' -exec cp --target-directory "${pkgdir}/usr/${_arch}/lib/qt/plugins" --parents {} +
|
|
popd
|
|
|
|
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, ...).
|
|
|
|
# drop Qt5Bootstrap and libraries which are only provided as static lib
|
|
# and hence already present in shared build (such as Qt5OpenGLExtensions)
|
|
rm -f \
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}qt5main* \
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5AccessibilitySupport* \
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5DeviceDiscoverySupport* \
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5EdidSupport* \
|
|
"${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* \
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5OpenGLExtensions* \
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5PlatformSupport* \
|
|
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5WindowsUIAutomationSupport* \
|
|
"${pkgdir}/usr/${_arch}/lib/"libQt5Bootstrap* \
|
|
|
|
# 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"
|
|
|
|
# create links to static plugins in lib directory
|
|
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}"
|
|
|
|
# fix bad library order for static CMake builds caused by Qt5Gui.static.prl
|
|
sed -i -e "s|-lfreetype;|-lfreetype;-lharfbuzz;-lfreetype;-lbz2;|" \
|
|
-e "s| -lz;| |" \
|
|
"${pkgdir}/usr/${_arch}/lib/Qt5Gui.static.prl"
|
|
|
|
# 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 version
|
|
# remove DLLs from libdir (DLLs are installed in both bindir and libdir, one copy is sufficient)
|
|
find "${pkgdir}/usr/${_arch}/lib" -maxdepth 1 -name "*.dll" -exec rm {} \;
|
|
|
|
# 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
|
|
|
|
# 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' {} \;
|
|
|
|
# remove doc
|
|
rm -rf "${pkgdir}/usr/${_arch}/share/doc"
|
|
|
|
# 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
|
|
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
|
|
find "${pkgdir}/usr/${_arch}" -name '*.exe' -delete
|
|
else
|
|
find "${pkgdir}/usr/${_arch}" -name '*.exe' -exec ${_arch}-strip --strip-all {} \;
|
|
fi
|
|
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 {} \;
|
|
done
|
|
}
|