420 lines
19 KiB
Bash
420 lines
19 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
|
|
|
|
# define helper functions for the split builds
|
|
isDefault() {
|
|
[[ $pkgname = 'mingw-w64-qt5-base' ]] || [[ $pkgname = 'mingw-w64-qt5-base-static' ]]
|
|
}
|
|
isStatic() {
|
|
[ "${pkgname##*-}" = 'static' ]
|
|
}
|
|
isOpenGL() {
|
|
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' ]]
|
|
}
|
|
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-opengl
|
|
pkgver=5.14.1
|
|
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-mesa: use LLVMpipe software rasterizer for Qt Quick'
|
|
'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-vulkan-headers' 'mingw-w64-pkg-config' 'mingw-w64-environment')
|
|
# For running fxc.exe WINE coulde be used:
|
|
#if isANGLE || isDynamic; then
|
|
# makedepends+=('mingw-w64-wine')
|
|
#fi
|
|
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-Fix-too-many-sections-assemler-error-in-OpenGL-facto.patch'
|
|
'0004-Make-sure-.pc-files-are-installed-correctly.patch'
|
|
'0005-Don-t-add-resource-files-to-LIBS-parameter.patch'
|
|
'0006-Prevent-debug-library-names-in-pkg-config-files.patch'
|
|
'0007-Fix-linking-against-shared-static-libpng.patch'
|
|
'0008-Fix-linking-against-static-D-Bus.patch'
|
|
'0009-Don-t-try-to-use-debug-version-of-D-Bus-library.patch'
|
|
'0010-Fix-linking-against-static-freetype2.patch'
|
|
'0011-Fix-linking-against-static-harfbuzz.patch'
|
|
'0012-Fix-linking-against-static-pcre.patch'
|
|
'0013-Fix-linking-against-shared-static-MariaDB.patch'
|
|
'0014-Fix-linking-against-shared-static-PostgreSQL.patch'
|
|
'0015-Rename-qtmain-to-qt5main.patch'
|
|
'0016-Enable-rpath-for-build-tools.patch'
|
|
'0017-Use-system-zlib-for-build-tools.patch'
|
|
'0018-Merge-shared-and-static-library-trees.patch'
|
|
'0019-Use-.dll.a-as-import-lib-extension.patch'
|
|
'0020-Pull-dependencies-of-static-libraries-in-CMake-modul.patch'
|
|
'0021-Allow-usage-of-static-version-with-CMake.patch'
|
|
'0022-Adjust-linker-flags-for-static-build-with-cmake-ming.patch'
|
|
'0023-Use-correct-pkg-config-static-flag.patch'
|
|
'0024-Fix-macro-invoking-moc-rcc-and-uic.patch'
|
|
'0025-Ignore-errors-about-missing-feature-static.patch'
|
|
'0026-Enable-and-fix-use-of-iconv.patch'
|
|
'0027-Ignore-failing-pkg-config-test.patch'
|
|
'0028-Prevent-qmake-from-messing-static-lib-dependencies.patch'
|
|
'0029-Hardcode-linker-flags-for-platform-plugins.patch'
|
|
'0030-Fix-linking-against-static-plugins-with-qmake.patch'
|
|
'0031-Prevent-Cannot-find-feature-windows_vulkan_sdk.patch')
|
|
sha256sums=('d9d423a6e7bcf1055c0372fc029f14a6fe67dd62c67b83095cde68b60b762cf7'
|
|
'4a57615e58ba06eb42d3723fd18e834cb8e5bd75e43bc855d17b553844490f4b'
|
|
'41bb9278778ea4b8115ce4aa0472435d5499c537fd9dc7d1faf99fed3c25ac07'
|
|
'91bc8d8e8eac2dddec9cac471f058f451d44bb0b8d45b6228b86d6e9de97f0a6'
|
|
'350321acfb5bc2c5e6cc78672728be35f223cbc7b632b389d799bdba9160eab7'
|
|
'5b8287a017d9397ffd1f60865bd8ba758ef340945f62c87ad2aafc9fbeb3b4b2'
|
|
'cf2a2b1e9c685592d059009aa8ffa3c834019213575ce7afed57037ea45dda3c'
|
|
'd9a11c90f9b0bbf82d1b9f7733b9fab1b33f3ddb4ffd7edf721c692538aa2649'
|
|
'd0965fa68ef531dea7e92328912e210cbe678a84b0447ecc86f2c259bd819615'
|
|
'9a23154796e229b0f25994a191cf0eca916d2b2cafd9a1e77915a1157ef02ad2'
|
|
'146648c3dcff2537661b2cef9d092e0c9105deb185cf3d7f367c45c0e46df566'
|
|
'ba29f00bec8bfb3467168b824efd729bd942d34c8da6ac3e428bd11f889da646'
|
|
'934998c9cb40896d41ce4e15b50d5705183da6aaca3ad65750b43984ccf12c10'
|
|
'ad3f2deb37b057a85a3897a283515c8e2a9336cd3a1d9dbca463b9a74806c4f9'
|
|
'e1662059f05f4caa744224fb8cbc02671983dd333227c9499307720e24be9ba1'
|
|
'4fd714fea42b27b763c7af8e1135b6e54b2b46b7d2cc8c71d2798c9c4fafd407'
|
|
'dce71cf64d40481a16b08395a5e01aa80938a08e358da18d010add9606da29a8'
|
|
'e787db710bd5e3ab77f173d5160fe879b971d3586bc88ed9f94d36d537e805db'
|
|
'c75152ebecdeb94e59c9471944fe800805086f98ae6c54392542686aae9ed7c4'
|
|
'1910adf8ddba8b81a6dab9231752bbf0d391419241611ad903441f9d1f968340'
|
|
'6c9d9164b24222ea63e2bb98254dd66a9eb1ad377589a91437f8bccbb149e757'
|
|
'1e587e871fc6b8fbc5e47e73eaa4b8b484823c771d5d2ebc67396730d7deffe7'
|
|
'4f45f035d0c12e30cabcf57058d206458999f09582486f79c485d00f3b57f53b'
|
|
'bd659e9867b1ec6c96c9602d9bb022b78a29e87f9690e9190c44a25967ede298'
|
|
'3204a14c839c2e37a46688e93ba0e3f00f32995a6b8fbf53dbff6d7e48040775'
|
|
'6745e3e157d6fb9db2f7147b5ab6cd40eb7ef4654cf0f9e0b59d2f90fc0abbbc'
|
|
'214fa36eccef5a3a1b448ac9c8a2ddc230e3ef21638e424cfeff25d705e45cb9'
|
|
'4d1ab6a03b65dddc2028177699e0cb5278d4a481a10a28690ec2347b3e7fa46e'
|
|
'85c32d151741f2fa42ab5ed16c2c85dd9e2f373dad2c8d09f7a22fbd1e1e3d72'
|
|
'6c163ddc1912544930d9984adcb54b6d50deb7c4a6d5bd26f6dad252748e5b92'
|
|
'73fa679c14c9976923cd9605ab3b838a5bce4f23d3d61f47266915296346a771'
|
|
'd006ec483d8d7ab0e42e086f3827e4074b78dad8a098aa98aa90dcfe0e6d300c')
|
|
|
|
_architectures='i686-w64-mingw32 x86_64-w64-mingw32'
|
|
|
|
isStatic && depends+=(${pkgname%-static})
|
|
|
|
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 PCRE library and zlib
|
|
rm -rf src/3rdparty/{pcre,zlib}
|
|
|
|
# clear buildflags ('!buildflags' only effects build() but not prepare())
|
|
unset CPPFLAGS CFLAGS CXXFLAGS LDFLAGS PKG_CONFIG_PATH
|
|
|
|
# build qmake using mingw-w64 {C,CXX,LD}FLAGS
|
|
# * This also sets default {C,CXX,LD}FLAGS for projects built using qmake.
|
|
source mingw-env
|
|
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 \
|
|
mkspecs/common/g++-win32.conf
|
|
sed -i -e "s|^\(QMAKE_LFLAGS_RELEASE.*=\).*$|\1|" \
|
|
mkspecs/common/g++-unix.conf
|
|
}
|
|
|
|
build() {
|
|
cd "${srcdir}/${_pkgfqn}"
|
|
|
|
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
|
|
# FIXME: This is broken because we needed to invoke fxc.exe (Direct3D Shader Compiler)
|
|
# during the build. Maybe start it with WINE?
|
|
msg2 'Using ANGLE as OpenGL backend'
|
|
qt_configure_args+=' -angle'
|
|
# enable declarations of GLES functions
|
|
# FIXME: Still required?
|
|
qt_configure_args+=' -DGL_GLEXT_PROTOTYPES'
|
|
elif isDynamic; then
|
|
# FIXME: This is broken because is requires enabling the (bundled) ANGLE which is
|
|
# broken (see comment under isANGLE).
|
|
msg2 'Using dynamic OpenGL backend'
|
|
qt_configure_args+=' -opengl dynamic'
|
|
qt_configure_args+=' -angle'
|
|
# enable declarations of GLES functions
|
|
# FIXME: Still required?
|
|
qt_configure_args+=' -DGL_GLEXT_PROTOTYPES'
|
|
fi
|
|
|
|
# add include directory of MariaDB
|
|
qt_configure_args+=" -I/usr/${_arch}/include/mariadb"
|
|
|
|
# add include directory for Vulkan
|
|
export VULKAN_SDK=/usr/${_arch}
|
|
|
|
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/"{lib,}Qt5VulkanSupport* \
|
|
"${pkgdir}/usr/${_arch}/lib/"libQt5Bootstrap* \
|
|
rm -r \
|
|
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5AccessibilitySupport" \
|
|
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5DeviceDiscoverySupport" \
|
|
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5EdidSupport" \
|
|
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5EventDispatcherSupport" \
|
|
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5FbSupport" \
|
|
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5FontDatabaseSupport" \
|
|
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5PlatformCompositorSupport" \
|
|
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5ThemeSupport" \
|
|
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5WindowsUIAutomationSupport" \
|
|
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5VulkanSupport" \
|
|
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5Bootstrap" \
|
|
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5BootstrapDBus"
|
|
|
|
# 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/qdevice.static.pri" "${pkgdir}/usr/${_arch}"
|
|
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}/qdevice.static.pri" "${pkgdir}/usr/${_arch}/lib/qt/mkspecs"
|
|
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 {} \;
|
|
|
|
# install missing libQt5BootstrapDBus.a manually
|
|
cp --target-directory "${pkgdir}/usr/${_arch}/lib" "$srcdir/build-${_arch}/lib/libQt5BootstrapDBus.a"
|
|
|
|
# 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
|
|
|
|
# create qt.conf containing plugin path, see https://github.com/Martchus/PKGBUILDs/issues/109
|
|
echo "[Paths]
|
|
Plugins = /usr/${_arch}/lib/qt/plugins" > "${pkgdir}/usr/${_arch}/bin/qt.conf"
|
|
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
|
|
|
|
# remove '.static.prl' files
|
|
find "${pkgdir}/usr/${_arch}" -name '.static.prl' -delete
|
|
|
|
# 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-debug "${pkgdir}/usr/${_arch}/lib/libQt5Bootstrap"*.a
|
|
#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
|
|
}
|