Create mingw-w64-qt5-base variants via template

This commit is contained in:
Martchus 2020-04-17 22:23:16 +02:00
parent 7d5979ac12
commit f5bd9d2ae9
45 changed files with 574 additions and 4341 deletions

View File

@ -11,6 +11,11 @@ use warnings;
use strict;
use utf8;
my @vcs_0_variant_suffixes = (qw(git svn hg));
my @cfg_0_variant_suffixes = (qw(static));
my @cfg_1_variant_suffixes = (qw(doc test cli angle dynamic opengl noopengl));
my @variant_suffixes = (\@vcs_0_variant_suffixes, \@cfg_0_variant_suffixes, \@cfg_1_variant_suffixes);
sub is_outdated {
my ($source_path, $target_path) = @_;
@ -59,10 +64,11 @@ for my $top_level_dir (@$top_level_dirs) {
if (!-f $template_file) {
# print warning; all additional Qt repos for mingw-w64 should be converted to use templates now
$log->warn("No template $template_file_name present for Qt module $qt_module and variant $variant")
if defined $qt_module && $qt_module ne 'base' && index($variant, 'mingw-w64') == 0;
if defined $qt_module && index($variant, 'mingw-w64') == 0 && $variant !~ qr/.*-test$/;
next;
}
# determine files
my $files = $variant_dir->list;
my $patch_files = $files->grep(qr/.*\.patch/);
my $qt_module_sha256_file = defined $qt_module
@ -71,14 +77,33 @@ for my $top_level_dir (@$top_level_dirs) {
my $qt_module_sha256 = defined $qt_module_sha256_file && -f $qt_module_sha256_file
? Mojo::Util::trim($qt_module_sha256_file->slurp)
: "$qt_module_sha256_file missing";
# determine variant parts
my $variant_prefix_part = $variant;
my $variant_suffix_part = '';
if ($variant) {
for my $variant_suffixes (@variant_suffixes) {
for my $variant_suffix (@$variant_suffixes) {
next unless $variant =~ qr/.*-$variant_suffix$/;
$variant_prefix_part = substr($variant, 0, length($variant) - length($variant_suffix) - 1);
$variant_suffix_part = $variant_suffix_part ? "$variant_suffix-$variant_suffix_part" : $variant_suffix;
last;
}
}
}
my $package_name_prefix = $variant_prefix_part ? "$variant_prefix_part-" : "";
my $package_name_suffix = $variant_suffix_part ? "-$variant_suffix_part" : "";
push(@pages, {
install_path => "$default_package_name/$variant/PKGBUILD",
template_params => [
template => "$default_package_name/$variant/PKGBUILD",
stash_variables => {
variant => $variant,
variant_prefix_part => $variant_prefix_part,
variant_suffix_part => $variant_suffix_part,
default_package_name => $default_package_name,
package_name => "$variant-$default_package_name",
package_name => "$package_name_prefix$default_package_name$package_name_suffix",
files => $files,
patch_files => $patch_files,
qt_module => $qt_module,

View File

@ -0,0 +1,359 @@
% my $is_static = $variant_suffix_part =~ qr/static/;
% my $is_angle = $variant_suffix_part =~ qr/angle/;
% my $is_dynamic = $variant_suffix_part =~ qr/dynamic/;
% my $is_no_opengl = $variant_suffix_part =~ qr/noopengl/;
% my $is_default = !$is_angle && !$is_dynamic && !$is_no_opengl;
% my $is_opengl = $is_default || $variant_suffix_part =~ qr/(?<!no)opengl/;
% my $opengl_backend = $is_opengl ? 'native' : $is_angle ? 'ANGLE' : $is_dynamic ? 'dynamic' : 'no';
%
# Maintainer: Martchus <martchus@gmx.net>
<%== content_for 'additional_contributors' %>\
# 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.
% if ($is_angle || $is_dynamic) {
# DOES NOT WORK YET, see comment in build() function
% }
# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where
# you also find the URL of a binary repository.
% if ($patch_files->size) {
# All patches are managed at https://github.com/Martchus/qt<%== $qt_module %>
% }
_qt_module=qt<%== $qt_module %>
pkgname=<%= $package_name %>
pkgver=5.14.2
pkgrel=1
pkgdesc='A cross-platform application and UI framework, <%= $opengl_backend %> OpenGL backend (mingw-w64)'
% if ($is_static) {
arch=('any')
% } else {
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')
% if ($is_static) {
depends+=(${pkgname%-static}) # the static version relies on the shared version for build tools and headers
% }
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')
% if ($is_angle || $is_dynamic) {
# makedepends+=('mingw-w64-wine') # the dynamic/ANGLE version needs to run fxc.exe (not implemented yet)
% }
groups=('mingw-w64-qt5')
% unless ($is_default) {
% if ($is_static) {
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')
% }
% }
options=('!strip' '!buildflags' 'staticlibs' '!emptydirs')
_pkgfqn="${_qt_module}-everywhere-src-${pkgver}"
source=("https://download.qt.io/official_releases/qt/${pkgver%.*}/${pkgver}/submodules/${_pkgfqn}.tar.xz"\
<%== include 'fragments/source_file_list', relevant_files => $patch_files %>)
sha256sums=('<%== $qt_module_sha256 %>'\
<%== include 'fragments/sha256_list', relevant_files => $patch_files %>)
_architectures='i686-w64-mingw32 x86_64-w64-mingw32'
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 ($is_opengl) {
msg2 'Using native OpenGL backend'
qt_configure_args+=' -opengl desktop'
% } elsif ($is_no_opengl) {
msg2 'Building without OpenGL support'
qt_configure_args+=' -no-opengl'
% } elsif ($is_angle) {
# 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'
% } elsif ($is_dynamic) {
# FIXME: This is broken because is requires enabling the (bundled) ANGLE which is
# broken because we needed to invoke fxc.exe (Direct3D Shader Compiler)
# during the build. Maybe start it with WINE?
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'
% }
# 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 ($is_static) {
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"
% }
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 ($is_static) {
# The static release contains only the static libs itself but relies on the
# shared release for the bootstrap 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/StaticQt5OpenGLExtensions*" \\
"${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"
% }
# 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 ($is_static) {
find "${pkgdir}/usr/${_arch}" -name '*.exe' -delete
% } else {
strip --strip-all "${pkgdir}/usr/${_arch}/lib/qt/bin/"*[!.pl]
strip --strip-debug "${pkgdir}/usr/${_arch}/lib/libQt5Bootstrap"*.a
if [[ $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
}

View File

@ -1,2 +0,0 @@
#!/usr/bin/bash -e
"$(dirname "$0")/../sync-variants.sh" qt5-base mingw-w64 mingw-w64-{static,opengl,angle,dynamic}

View File

@ -6,54 +6,36 @@
# BEFORE COMMENTING OR REPORING ISSUES, PLEASE READ THE FILE `README.md` IN THIS REPOSITORY.
# ALSO HAVE A LOOK AT THE COMMENTS IN THE AUR.
# DOES NOT WORK YET, see comment in build() function
# 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' ]]
}
_qt_module=qtbase
pkgname=mingw-w64-qt5-base-angle
pkgver=5.14.2
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')
pkgdesc='A cross-platform application and UI framework, ANGLE OpenGL backend (mingw-w64)'
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
# makedepends+=('mingw-w64-wine') # the dynamic/ANGLE version needs to run fxc.exe (not implemented yet)
groups=('mingw-w64-qt5')
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')
options=('!strip' '!buildflags' 'staticlibs' '!emptydirs')
_pkgfqn="qtbase-everywhere-src-${pkgver}"
_pkgfqn="${_qt_module}-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'
@ -121,20 +103,6 @@ sha256sums=('48b9e79220941665a9dd827548c6428f7aa3052ccba8f4f7e039a94aa1d2b28a'
_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}"
@ -224,30 +192,13 @@ build() {
|| 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
# 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'
# add include directory of MariaDB
qt_configure_args+=" -I/usr/${_arch}/include/mariadb"
@ -257,25 +208,16 @@ build() {
msg2 'Configure and build qmake'
mkdir -p ../build-${_arch} && pushd ../build-${_arch}
if isStatic; then
qt_configure_args+=' -static'
qt_configure_args+=' -shared'
# 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"
# configure shared version to load OpenSSL dynamically
qt_configure_args+=' -openssl-runtime'
else
qt_configure_args+=' -shared'
qt_configure_args+=' -device-option CROSS_COMPILE_CUSTOM_CONFIG=actually_a_shared_build'
# 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
# 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"
msg2 'Build qmake and configure' && ../${_pkgfqn}/configure $qt_configure_args
msg2 'Build Qt libraries' && make
@ -297,91 +239,21 @@ package() {
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, ...).
# 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 {} \;
# 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/StaticQt5OpenGLExtensions*" \
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5WindowsUIAutomationSupport" \
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5VulkanSupport" \
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5Bootstrap" \
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5BootstrapDBus"
# install missing libQt5BootstrapDBus.a manually
cp --target-directory "${pkgdir}/usr/${_arch}/lib" "$srcdir/build-${_arch}/lib/libQt5BootstrapDBus.a"
# 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 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 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]
# 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' {} \;
@ -403,16 +275,14 @@ Plugins = /usr/${_arch}/lib/qt/plugins" > "${pkgdir}/usr/${_arch}/bin/qt.conf"
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
strip --strip-all "${pkgdir}/usr/${_arch}/lib/qt/bin/"*[!.pl]
strip --strip-debug "${pkgdir}/usr/${_arch}/lib/libQt5Bootstrap"*.a
if [[ $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 {} \;

View File

@ -0,0 +1 @@
% layout 'mingw-w64-qt5-base';

View File

@ -6,54 +6,36 @@
# BEFORE COMMENTING OR REPORING ISSUES, PLEASE READ THE FILE `README.md` IN THIS REPOSITORY.
# ALSO HAVE A LOOK AT THE COMMENTS IN THE AUR.
# DOES NOT WORK YET, see comment in build() function
# 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' ]]
}
_qt_module=qtbase
pkgname=mingw-w64-qt5-base-dynamic
pkgver=5.14.2
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')
pkgdesc='A cross-platform application and UI framework, dynamic OpenGL backend (mingw-w64)'
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
# makedepends+=('mingw-w64-wine') # the dynamic/ANGLE version needs to run fxc.exe (not implemented yet)
groups=('mingw-w64-qt5')
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')
options=('!strip' '!buildflags' 'staticlibs' '!emptydirs')
_pkgfqn="qtbase-everywhere-src-${pkgver}"
_pkgfqn="${_qt_module}-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'
@ -121,20 +103,6 @@ sha256sums=('48b9e79220941665a9dd827548c6428f7aa3052ccba8f4f7e039a94aa1d2b28a'
_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}"
@ -224,30 +192,15 @@ build() {
|| 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
# FIXME: This is broken because is requires enabling the (bundled) ANGLE which is
# broken because we needed to invoke fxc.exe (Direct3D Shader Compiler)
# during the build. Maybe start it with WINE?
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'
# add include directory of MariaDB
qt_configure_args+=" -I/usr/${_arch}/include/mariadb"
@ -257,25 +210,16 @@ build() {
msg2 'Configure and build qmake'
mkdir -p ../build-${_arch} && pushd ../build-${_arch}
if isStatic; then
qt_configure_args+=' -static'
qt_configure_args+=' -shared'
# 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"
# configure shared version to load OpenSSL dynamically
qt_configure_args+=' -openssl-runtime'
else
qt_configure_args+=' -shared'
qt_configure_args+=' -device-option CROSS_COMPILE_CUSTOM_CONFIG=actually_a_shared_build'
# 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
# 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"
msg2 'Build qmake and configure' && ../${_pkgfqn}/configure $qt_configure_args
msg2 'Build Qt libraries' && make
@ -297,91 +241,21 @@ package() {
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, ...).
# 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 {} \;
# 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/StaticQt5OpenGLExtensions*" \
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5WindowsUIAutomationSupport" \
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5VulkanSupport" \
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5Bootstrap" \
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5BootstrapDBus"
# install missing libQt5BootstrapDBus.a manually
cp --target-directory "${pkgdir}/usr/${_arch}/lib" "$srcdir/build-${_arch}/lib/libQt5BootstrapDBus.a"
# 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 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 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]
# 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' {} \;
@ -403,16 +277,14 @@ Plugins = /usr/${_arch}/lib/qt/plugins" > "${pkgdir}/usr/${_arch}/bin/qt.conf"
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
strip --strip-all "${pkgdir}/usr/${_arch}/lib/qt/bin/"*[!.pl]
strip --strip-debug "${pkgdir}/usr/${_arch}/lib/libQt5Bootstrap"*.a
if [[ $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 {} \;

View File

@ -0,0 +1 @@
% layout 'mingw-w64-qt5-base';

View File

@ -1,167 +0,0 @@
From c416378bd70ab26f9ce9e34fe72a364dd19bae73 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Fri, 3 Feb 2017 18:30:51 +0100
Subject: [PATCH 01/31] Adjust win32-g++ profile for cross compilation with
mingw-w64
Adding a new, separate mkspec instead of patching the existing one
might be the cleaner solution. However tools like windeployqt and
qbs do checks based on the hardcoded mkspec name to detect MinGW.
So for this to work, the mkspec must be called win32-g++.
Also see the following issues:
* https://github.com/Martchus/PKGBUILDs/issues/59
* https://github.com/Martchus/PKGBUILDs/issues/60
Change-Id: I4c9b3c170ed13943abe0d8b397a8cb9e360538b6
---
mkspecs/common/g++-win32.conf | 52 ++++++++++++++++++++----------
mkspecs/win32-clang-g++/qmake.conf | 4 +--
mkspecs/win32-g++/qmake.conf | 4 +--
3 files changed, 39 insertions(+), 21 deletions(-)
diff --git a/mkspecs/common/g++-win32.conf b/mkspecs/common/g++-win32.conf
index c3a1f3a373..5208d22bd6 100644
--- a/mkspecs/common/g++-win32.conf
+++ b/mkspecs/common/g++-win32.conf
@@ -8,18 +8,24 @@
# Compiler-specific settings go into win32-g++/qmake.conf and
# win32-clang-g++/qmake.conf
#
+# The device options CROSS_COMPILE_CUSTOM_CONFIG and CROSS_COMPILE_CFLAGS can be used
+# to specify custom config/flags for cross compilation.
+#
load(device_config)
include(gcc-base.conf)
include(g++-base.conf)
+include(angle.conf)
+include(windows-vulkan.conf)
+
# modifications to gcc-base.conf and g++-base.conf
MAKEFILE_GENERATOR = MINGW
QMAKE_PLATFORM = win32 mingw
-CONFIG += debug_and_release debug_and_release_target precompile_header
-DEFINES += UNICODE _UNICODE WIN32 MINGW_HAS_SECURE_API=1
-QMAKE_COMPILER_DEFINES += __GNUC__ _WIN32
+CONFIG += debug_and_release debug_and_release_target precompile_header $${CROSS_COMPILE_CUSTOM_CONFIG}
+DEFINES += UNICODE _UNICODE MINGW_HAS_SECURE_API=1
+QMAKE_COMPILER_DEFINES += __GNUC__ _WIN32 WIN32
# can't add 'DEFINES += WIN64' and 'QMAKE_COMPILER_DEFINES += _WIN64' defines for
# x86_64 platform similar to 'msvc-desktop.conf' toolchain, because, unlike for MSVC,
# 'QMAKE_TARGET.arch' is inherently unavailable.
@@ -32,6 +38,7 @@ QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS_SSE2 += -mstackrealign
QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions -mthreads
+QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -fno-exceptions
QMAKE_INCDIR =
@@ -41,40 +48,51 @@ QMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads
-QMAKE_LFLAGS_RELEASE = -Wl,-s
+QMAKE_LFLAGS_RELEASE =
+QMAKE_LFLAGS_DEBUG =
QMAKE_LFLAGS_CONSOLE = -Wl,-subsystem,console
QMAKE_LFLAGS_WINDOWS = -Wl,-subsystem,windows
QMAKE_LFLAGS_DLL = -shared
QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections
-equals(QMAKE_HOST.os, Windows) {
- QMAKE_LINK_OBJECT_MAX = 10
- QMAKE_LINK_OBJECT_SCRIPT = object_script
-}
+QMAKE_LINK_OBJECT_MAX = 10
+QMAKE_LINK_OBJECT_SCRIPT = object_script
QMAKE_EXT_OBJ = .o
QMAKE_EXT_RES = _res.o
QMAKE_PREFIX_SHLIB =
QMAKE_EXTENSION_SHLIB = dll
QMAKE_PREFIX_STATICLIB = lib
QMAKE_EXTENSION_STATICLIB = a
-QMAKE_LIB_EXTENSIONS = a dll.a
+QMAKE_EXTENSION_IMPORTLIB = dll.a
+
+PKG_CONFIG = $${CROSS_COMPILE}pkg-config
+QMAKE_PKG_CONFIG = $${CROSS_COMPILE}pkg-config
QMAKE_LIBS =
-QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lws2_32 -lole32 -luuid -luser32 -ladvapi32
-QMAKE_LIBS_NETWORK = -lws2_32
+QMAKE_LIBS_CORE = -lz -lpcre2-16 -liconv -lversion -lnetapi32 -luserenv -lole32 -luuid -lwinmm -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32
+QMAKE_LIBS_GUI = -lopengl32 -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lws2_32 -lole32 -luuid -luser32 -ladvapi32 -ljpeg -lpng \
+ $$system($${QMAKE_PKG_CONFIG} --libs harfbuzz) \
+ $$system($${QMAKE_PKG_CONFIG} --libs freetype2)
+QMAKE_LIBS_GUI_STATIC = -lopengl32 -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lws2_32 -lole32 -luuid -luser32 -ladvapi32 -ljpeg -lpng \
+ $$system($${QMAKE_PKG_CONFIG} --static --libs harfbuzz) \
+ $$system($${QMAKE_PKG_CONFIG} --static --libs freetype2)
+QMAKE_LIBS_NETWORK = -lws2_32 -lcrypt32 -ldnsapi -liphlpapi
+QMAKE_LIBS_NETWORK_STATIC = $$system($${QMAKE_PKG_CONFIG} --static --libs openssl) -lws2_32 -lcrypt32 -ldnsapi -liphlpapi
+QMAKE_LIBS_DBUS = $$system($${QMAKE_PKG_CONFIG} --libs dbus-1)
+QMAKE_LIBS_DBUS_STATIC = $$system($${QMAKE_PKG_CONFIG} --static --libs dbus-1)
+QMAKE_LIBS_WIDGETS_STATIC = -ldwmapi -luxtheme
QMAKE_LIBS_OPENGL = -lglu32 -lopengl32 -lgdi32 -luser32
-QMAKE_LIBS_OPENGL_ES2 = -lgdi32 -luser32
-QMAKE_LIBS_OPENGL_ES2_DEBUG = -lgdi32 -luser32
+QMAKE_LIBS_OPENGL_ES2 = -l$${LIBEGL_NAME} -l$${LIBGLESV2_NAME} -ld3d9 -ldxguid -lgdi32 -luser32
+QMAKE_LIBS_OPENGL_ES2_DEBUG = -l$${LIBEGL_NAME} -l$${LIBGLESV2_NAME} -ld3d9 -ldxguid -lgdi32 -luser32
QMAKE_LIBS_COMPAT = -ladvapi32 -lshell32 -lcomdlg32 -luser32 -lgdi32 -lws2_32
QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain
-QMAKE_IDL = midl
+QMAKE_IDL = $${CROSS_COMPILE}widl
QMAKE_LIB = $${CROSS_COMPILE}ar -rc
QMAKE_RC = $${CROSS_COMPILE}windres
+QMAKE_DLLTOOL = $${CROSS_COMPILE}dlltool
+QMAKE_LRELEASE = $${CROSS_COMPILE}lrelease-qt5
QMAKE_STRIP = $${CROSS_COMPILE}strip
QMAKE_STRIPFLAGS_LIB += --strip-unneeded
QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy
QMAKE_NM = $${CROSS_COMPILE}nm -P
-
-include(angle.conf)
-include(windows-vulkan.conf)
diff --git a/mkspecs/win32-clang-g++/qmake.conf b/mkspecs/win32-clang-g++/qmake.conf
index 59d42176f0..f8cb9859f2 100644
--- a/mkspecs/win32-clang-g++/qmake.conf
+++ b/mkspecs/win32-clang-g++/qmake.conf
@@ -14,11 +14,11 @@ include(../common/g++-win32.conf)
QMAKE_COMPILER += clang llvm # clang pretends to be gcc
QMAKE_CC = $${CROSS_COMPILE}clang
-QMAKE_CFLAGS +=
+QMAKE_CFLAGS += $${CROSS_COMPILE_CFLAGS}
QMAKE_CFLAGS_WARN_ON += -Wextra -Wno-ignored-attributes
QMAKE_CXX = $${CROSS_COMPILE}clang++
-QMAKE_CXXFLAGS +=
+QMAKE_CXXFLAGS += $${CROSS_COMPILE_CXXFLAGS}
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_LINK = $${CROSS_COMPILE}clang++
diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf
index 5de482f23b..3c3d22c699 100644
--- a/mkspecs/win32-g++/qmake.conf
+++ b/mkspecs/win32-g++/qmake.conf
@@ -13,11 +13,11 @@ include(../common/windows-desktop.conf)
# modifications to g++-win32.conf
QMAKE_CC = $${CROSS_COMPILE}gcc
-QMAKE_CFLAGS += -fno-keep-inline-dllexport
+QMAKE_CFLAGS += $${CROSS_COMPILE_CFLAGS}
QMAKE_CFLAGS_WARN_ON += -Wextra
QMAKE_CXX = $${CROSS_COMPILE}g++
-QMAKE_CXXFLAGS += -fno-keep-inline-dllexport
+QMAKE_CXXFLAGS += $${CROSS_COMPILE_CXXFLAGS}
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_LINK = $${CROSS_COMPILE}g++
--
2.26.0

View File

@ -1,27 +0,0 @@
From 06380a45c2cb2f6882e7102fdd46bcdd9e4aba48 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 18 Sep 2016 13:36:53 +0200
Subject: [PATCH 02/31] Ensure GLdouble is defined when using dynamic OpenGL
FIXME: Not sure whether this is still required
---
src/gui/opengl/qopenglfunctions.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/gui/opengl/qopenglfunctions.h b/src/gui/opengl/qopenglfunctions.h
index 4554291bbd..23d55bddeb 100644
--- a/src/gui/opengl/qopenglfunctions.h
+++ b/src/gui/opengl/qopenglfunctions.h
@@ -56,9 +56,7 @@
//#define Q_ENABLE_OPENGL_FUNCTIONS_DEBUG
-#ifdef QT_OPENGL_ES
typedef double GLdouble;
-#endif
#ifdef Q_ENABLE_OPENGL_FUNCTIONS_DEBUG
#include <stdio.h>
--
2.26.0

View File

@ -1,29 +0,0 @@
From 40b1ebaa7481c339b437e976e760bf099df5c594 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 18 Sep 2016 13:48:51 +0200
Subject: [PATCH 03/31] Fix too many sections assemler error in OpenGL factory
On x86_64 qopenglversionfunctionsfactory.o exceeds the
limit of 32768 sections.
Hence the assembler option -mbig-obj is required.
---
src/gui/opengl/opengl.pri | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/gui/opengl/opengl.pri b/src/gui/opengl/opengl.pri
index 24758afdeb..aa04b4a672 100644
--- a/src/gui/opengl/opengl.pri
+++ b/src/gui/opengl/opengl.pri
@@ -3,7 +3,8 @@
qtConfig(opengl): CONFIG += opengl
qtConfig(opengles2): CONFIG += opengles2
-qtConfig(opengl) {
+qtConfig(opengl)|qtConfig(opengles2) {
+ mingw:QMAKE_CXXFLAGS+="-Wa,-mbig-obj"
HEADERS += opengl/qopengl.h \
opengl/qopengl_p.h \
--
2.26.0

View File

@ -1,66 +0,0 @@
From f1122d1929e271162eb062aad43097ad69c7159e Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 18 Sep 2016 13:54:12 +0200
Subject: [PATCH 04/31] Make sure *.pc files are installed correctly
---
qmake/generators/makefile.cpp | 8 ++++++--
qmake/generators/makefile.h | 2 +-
qmake/generators/win32/winmakefile.cpp | 2 +-
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 7e471f126c..f9532e0db9 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -3215,7 +3215,7 @@ MakefileGenerator::openOutput(QFile &file, const QString &build) const
}
QString
-MakefileGenerator::pkgConfigFileName(bool fixify)
+MakefileGenerator::pkgConfigFileName(bool fixify, bool onlyPrependDestdir)
{
QString ret = project->first("QMAKE_PKGCONFIG_FILE").toQString();
if (ret.isEmpty()) {
@@ -3240,7 +3240,11 @@ MakefileGenerator::pkgConfigFileName(bool fixify)
if(fixify) {
if(QDir::isRelativePath(ret) && !project->isEmpty("DESTDIR"))
ret.prepend(project->first("DESTDIR").toQString());
- ret = fileFixify(ret, FileFixifyBackwards);
+ if (onlyPrependDestdir) {
+ ret = Option::fixPathToLocalOS(ret);
+ } else {
+ ret = fileFixify(ret, FileFixifyBackwards);
+ }
}
return ret;
}
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index ab970c966f..01f97c61d4 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -96,7 +96,7 @@ protected:
virtual void writeDefaultVariables(QTextStream &t);
QString pkgConfigPrefix() const;
- QString pkgConfigFileName(bool fixify=true);
+ QString pkgConfigFileName(bool fixify=true, bool onlyPrependDestdir = false);
QString pkgConfigFixPath(QString) const;
void writePkgConfigFile(); // for pkg-config
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 3ec2704625..f33edb5bd9 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -775,7 +775,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
}
if(!ret.isEmpty())
ret += "\n\t";
- ret += installMetaFile(ProKey("QMAKE_PKGCONFIG_INSTALL_REPLACE"), pkgConfigFileName(true), dst_pc);
+ ret += installMetaFile(ProKey("QMAKE_PKGCONFIG_INSTALL_REPLACE"), pkgConfigFileName(true, true), dst_pc);
if(!uninst.isEmpty())
uninst.append("\n\t");
uninst.append("-$(DEL_FILE) " + escapeFilePath(dst_pc));
--
2.26.0

View File

@ -1,28 +0,0 @@
From dc9860e99a09a4dc54cfe60959a34e06a288f7d6 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 18 Sep 2016 13:58:28 +0200
Subject: [PATCH 05/31] Don't add resource files to LIBS parameter
Solves an issue where the generated pkg-config
files contained invalid Libs.private references
like .obj/debug/Qt5Cored_resource_res.o
---
qmake/generators/win32/mingw_make.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp
index 096b041056..eb498b28e8 100644
--- a/qmake/generators/win32/mingw_make.cpp
+++ b/qmake/generators/win32/mingw_make.cpp
@@ -152,7 +152,7 @@ void MingwMakefileGenerator::init()
processVars();
- project->values("LIBS") += project->values("RES_FILE");
+ project->values("OBJECTS") += project->values("RES_FILE");
if (project->isActiveConfig("dll")) {
QString destDir = "";
--
2.26.0

View File

@ -1,33 +0,0 @@
From 2cfd0a32516ba85f0c608fb81341090c28209750 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 18 Sep 2016 14:01:14 +0200
Subject: [PATCH 06/31] Prevent debug library names in pkg-config files
qmake generates the pkgconfig .pc files two times, once for the
release build and once for the debug build (which we're not actually
building in this package). For both generations the exact same
pkgconfig file name is used. This causes references to the debug
build ending up in the .pc files which are unwanted
Prevent this from happening by giving the pkgconfig .pc
files for the debug build an unique file name.
---
qmake/generators/makefile.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index f9532e0db9..9c65f21ac0 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -3229,6 +3229,9 @@ MakefileGenerator::pkgConfigFileName(bool fixify, bool onlyPrependDestdir)
if (dot != -1)
ret = ret.left(dot);
}
+ if (project->isActiveConfig("debug")) {
+ ret += "d";
+ }
ret += Option::pkgcfg_ext;
QString subdir = project->first("QMAKE_PKGCONFIG_DESTDIR").toQString();
if(!subdir.isEmpty()) {
--
2.26.0

View File

@ -1,30 +0,0 @@
From 3e1b4e602c5a2569d9a337990a2e38e3ef82f251 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Thu, 26 Jan 2017 17:51:31 +0100
Subject: [PATCH 07/31] Fix linking against shared/static libpng
Change-Id: Ic7a0ec9544059b8e647a5d0186f1b88c00911dcf
---
src/gui/configure.json | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/gui/configure.json b/src/gui/configure.json
index 0202f17b21..099c11da95 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -400,8 +400,10 @@
{ "type": "pkgConfig", "args": "libpng" },
{ "libs": "-llibpng16", "condition": "config.msvc" },
{ "libs": "-llibpng", "condition": "config.msvc" },
- { "libs": "-lpng16", "condition": "!config.msvc" },
- { "libs": "-lpng", "condition": "!config.msvc" },
+ { "libs": "-lpng16 -lz", "condition": "!config.msvc && !features.shared" },
+ { "libs": "-lpng -lz", "condition": "!config.msvc && !features.shared" },
+ { "libs": "-lpng16", "condition": "!config.msvc && features.shared" },
+ { "libs": "-lpng", "condition": "!config.msvc && features.shared" },
{ "libs": "-s USE_LIBPNG=1", "condition": "config.wasm" }
],
"use": [
--
2.26.0

View File

@ -1,58 +0,0 @@
From d54fefe4a033a39ba628858c18ab0a95520069f2 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Fri, 3 Feb 2017 19:36:25 +0100
Subject: [PATCH 08/31] Fix linking against static D-Bus
---
configure.json | 9 +++++++--
src/dbus/qdbus_symbols_p.h | 4 ++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/configure.json b/configure.json
index 868f15db13..147cf9eb00 100644
--- a/configure.json
+++ b/configure.json
@@ -188,18 +188,23 @@
"dbus": {
"label": "D-Bus >= 1.2",
"test": {
- "main": "(void) dbus_bus_get_private(DBUS_BUS_SYSTEM, (DBusError *)NULL);"
+ "main": "(void) dbus_bus_get_private(DBUS_BUS_SYSTEM, (DBusError *)NULL);",
+ "qmake": "static: DEFINES += DBUS_STATIC_BUILD"
},
"headers": "dbus/dbus.h",
"sources": [
{ "type": "pkgConfig", "args": "dbus-1 >= 1.2" },
+ {
+ "libs": "-ldbus-1 -lws2_32 -liphlpapi",
+ "condition": "config.win32 && !features.shared"
+ },
{
"libs": "",
"builds": {
"debug": "-ldbus-1d",
"release": "-ldbus-1"
},
- "condition": "config.win32"
+ "condition": "config.win32 && features.shared"
},
{ "libs": "-ldbus-1", "condition": "!config.win32" }
]
diff --git a/src/dbus/qdbus_symbols_p.h b/src/dbus/qdbus_symbols_p.h
index 7cce0d71aa..4d3d774d45 100644
--- a/src/dbus/qdbus_symbols_p.h
+++ b/src/dbus/qdbus_symbols_p.h
@@ -57,6 +57,10 @@
#ifndef QT_NO_DBUS
+#ifdef QT_STATIC
+# define DBUS_STATIC_BUILD
+#endif
+
#ifdef QT_LINKED_LIBDBUS
# include <dbus/dbus.h>
#else
--
2.26.0

View File

@ -1,29 +0,0 @@
From 012e5b2dfbc5de85412bb450970d0320e369da30 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Fri, 2 Jun 2017 18:28:10 +0200
Subject: [PATCH 09/31] Don't try to use debug version of D-Bus library
Required for a debug build of Qt because mingw-w64-dbus
does not contain debug version
Change-Id: Ic34e1025fda55f9659e065f5bbe9d51f55420adb
---
configure.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.json b/configure.json
index 147cf9eb00..a481e54b8d 100644
--- a/configure.json
+++ b/configure.json
@@ -201,7 +201,7 @@
{
"libs": "",
"builds": {
- "debug": "-ldbus-1d",
+ "debug": "-ldbus-1",
"release": "-ldbus-1"
},
"condition": "config.win32 && features.shared"
--
2.26.0

View File

@ -1,30 +0,0 @@
From ca204fd0ed444fdf4e478540f8b5d88cb345be75 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Fri, 3 Feb 2017 20:51:19 +0100
Subject: [PATCH 10/31] Fix linking against static freetype2
---
src/gui/configure.json | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/gui/configure.json b/src/gui/configure.json
index 099c11da95..872deb3ad3 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -239,8 +239,11 @@
},
"headers": "ft2build.h",
"sources": [
- { "type": "pkgConfig", "args": "freetype2" },
- { "type": "freetype", "libs": "-lfreetype", "condition": "!config.wasm" },
+ { "type": "pkgConfig", "args": "--static --libs freetype2", "condition": "!features.shared" },
+ { "type": "pkgConfig", "args": "--libs freetype2", "condition": "features.shared" },
+ { "libs": "-lfreetype -lharfbuzz -lfreetype -lglib-2.0 -lintl -lws2_32 -lole32 -lwinmm -lshlwapi -lpcre -lintl -lpcre -lintl -liconv -lgraphite2 -lbz2", "condition": "!features.shared && !config.wasm" },
+ { "libs": "-Wl,-Bdynamic -lfreetype -Wl,-Bstatic", "condition": "!features.shared && !config.wasm" },
+ { "libs": "-lfreetype", "condition": "features.shared && !config.wasm" },
{ "libs": "-s USE_FREETYPE=1", "condition": "config.wasm" },
{ "libs": "-lfreetype" }
],
--
2.26.0

View File

@ -1,29 +0,0 @@
From 483ae9b6bfc1f40e3617d8b6cd58ef93985cf397 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 18 Sep 2016 14:22:56 +0200
Subject: [PATCH 11/31] Fix linking against static harfbuzz
---
src/gui/configure.json | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/gui/configure.json b/src/gui/configure.json
index 872deb3ad3..7daaaa5a11 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -307,7 +307,11 @@
},
"headers": "harfbuzz/hb.h",
"sources": [
- "-lharfbuzz"
+ { "type": "pkgConfig", "args": "--static --libs harfbuzz", "condition": "!features.shared" },
+ { "type": "pkgConfig", "args": "--libs harfbuzz", "condition": "features.shared" },
+ { "libs": "-lharfbuzz -lfreetype -lharfbuzz -lglib-2.0 -lintl -lws2_32 -lole32 -lwinmm -lshlwapi -lpcre -lintl -lpcre -lintl -liconv -lgraphite2 -lbz2", "condition": "!features.shared" },
+ { "libs": "-Wl,-Bdynamic -lharfbuzz -Wl,-Bstatic", "condition": "!features.shared" },
+ { "libs": "-lharfbuzz", "condition": "features.shared" }
]
},
"imf": {
--
2.26.0

View File

@ -1,28 +0,0 @@
From 0c26bfba6773298fd314fc38ec1be7cb58a5d752 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 18 Sep 2016 14:24:01 +0200
Subject: [PATCH 12/31] Fix linking against static pcre
Change-Id: I3225c6e82dc4d17aef37d4289c16eb7a5ea3c5a1
---
src/corelib/text/qregularexpression.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/corelib/text/qregularexpression.cpp b/src/corelib/text/qregularexpression.cpp
index 59d21e0a23..518f91d753 100644
--- a/src/corelib/text/qregularexpression.cpp
+++ b/src/corelib/text/qregularexpression.cpp
@@ -53,6 +53,10 @@
#include <QtCore/qdatastream.h>
#define PCRE2_CODE_UNIT_WIDTH 16
+#ifdef QT_STATIC
+#define PCRE_STATIC
+#define PCRE2_STATIC
+#endif
#include <pcre2.h>
--
2.26.0

View File

@ -1,26 +0,0 @@
From 2852ac7e9e087b8374daa044dba1885d5c2bbac5 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 18 Sep 2016 18:56:55 +0200
Subject: [PATCH 13/31] Fix linking against shared/static MariaDB
Change-Id: I9722c154d845f288a2d4d1ab14a014066b28819b
---
src/plugins/sqldrivers/configure.json | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/plugins/sqldrivers/configure.json b/src/plugins/sqldrivers/configure.json
index cd20eef1df..babd0465ce 100644
--- a/src/plugins/sqldrivers/configure.json
+++ b/src/plugins/sqldrivers/configure.json
@@ -67,6 +67,8 @@
},
"headers": "mysql.h",
"sources": [
+ { "libs": "-lmariadbclient -lssl -lcrypto -lgdi32 -lws2_32 -lpthread -lz -lm", "condition": "config.win32 && !features.shared" },
+ { "libs": "-lmariadb", "condition": "config.win32 && features.shared" },
{ "type": "mysqlConfig", "query": "--libs_r", "cleanlibs": true },
{ "type": "mysqlConfig", "query": "--libs", "cleanlibs": true },
{ "type": "mysqlConfig", "query": "--libs_r", "cleanlibs": false },
--
2.26.0

View File

@ -1,28 +0,0 @@
From 5f3fb54d36009c5eced4335e79437b5d8eecdf08 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 18 Sep 2016 18:58:25 +0200
Subject: [PATCH 14/31] Fix linking against shared/static PostgreSQL
---
src/plugins/sqldrivers/configure.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/plugins/sqldrivers/configure.json b/src/plugins/sqldrivers/configure.json
index babd0465ce..37e25881f0 100644
--- a/src/plugins/sqldrivers/configure.json
+++ b/src/plugins/sqldrivers/configure.json
@@ -88,9 +88,9 @@
},
"headers": "libpq-fe.h",
"sources": [
- { "type": "pkgConfig", "args": "libpq" },
{ "type": "psqlConfig" },
- { "type": "psqlEnv", "libs": "-llibpq -lws2_32 -ladvapi32", "condition": "config.win32" },
+ { "type": "psqlEnv", "libs": "-lpq -lpgcommon -lpgport -lintl -lssl -lcrypto -lshell32 -lws2_32 -lsecur32 -liconv", "condition": "config.win32 && !features.shared" },
+ { "type": "psqlEnv", "libs": "-lpq", "condition": "config.win32 && features.shared" },
{ "type": "psqlEnv", "libs": "-lpq", "condition": "!config.win32" }
]
},
--
2.26.0

View File

@ -1,80 +0,0 @@
From d61af2077d70356fc0f69aeb27e82bed66f8d52e Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 18 Sep 2016 14:25:40 +0200
Subject: [PATCH 15/31] Rename qtmain to qt5main
Prevents conflict with mingw-w64-qt4 package
---
mkspecs/common/g++-win32.conf | 2 +-
mkspecs/features/create_cmake.prf | 8 ++++----
mkspecs/features/win32/windows.prf | 4 ++--
src/winmain/winmain.pro | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/mkspecs/common/g++-win32.conf b/mkspecs/common/g++-win32.conf
index 5208d22bd6..1a058b787f 100644
--- a/mkspecs/common/g++-win32.conf
+++ b/mkspecs/common/g++-win32.conf
@@ -84,7 +84,7 @@ QMAKE_LIBS_OPENGL = -lglu32 -lopengl32 -lgdi32 -luser32
QMAKE_LIBS_OPENGL_ES2 = -l$${LIBEGL_NAME} -l$${LIBGLESV2_NAME} -ld3d9 -ldxguid -lgdi32 -luser32
QMAKE_LIBS_OPENGL_ES2_DEBUG = -l$${LIBEGL_NAME} -l$${LIBGLESV2_NAME} -ld3d9 -ldxguid -lgdi32 -luser32
QMAKE_LIBS_COMPAT = -ladvapi32 -lshell32 -lcomdlg32 -luser32 -lgdi32 -lws2_32
-QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain
+QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqt5main
QMAKE_IDL = $${CROSS_COMPILE}widl
QMAKE_LIB = $${CROSS_COMPILE}ar -rc
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
index 0e71fd0015..0e8d41c685 100644
--- a/mkspecs/features/create_cmake.prf
+++ b/mkspecs/features/create_cmake.prf
@@ -325,14 +325,14 @@ mac {
}
mingw {
- CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqtmain$${QT_LIBINFIX}$${debug_suffix}.a
- CMAKE_WINMAIN_FILE_LOCATION_RELEASE = libqtmain$${QT_LIBINFIX}.a
+ CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqt5main$${QT_LIBINFIX}$${debug_suffix}.a
+ CMAKE_WINMAIN_FILE_LOCATION_RELEASE = libqt5main$${QT_LIBINFIX}.a
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}$${debug_suffix}.a
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
} else {
- CMAKE_WINMAIN_FILE_LOCATION_DEBUG = qtmain$${QT_LIBINFIX}$${debug_suffix}.lib
- CMAKE_WINMAIN_FILE_LOCATION_RELEASE = qtmain$${QT_LIBINFIX}.lib
+ CMAKE_WINMAIN_FILE_LOCATION_DEBUG = qt5main$${QT_LIBINFIX}$${debug_suffix}.lib
+ CMAKE_WINMAIN_FILE_LOCATION_RELEASE = qt5main$${QT_LIBINFIX}.lib
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}$${debug_suffix}.lib
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib
diff --git a/mkspecs/features/win32/windows.prf b/mkspecs/features/win32/windows.prf
index 272170d428..17f3ef9c2d 100644
--- a/mkspecs/features/win32/windows.prf
+++ b/mkspecs/features/win32/windows.prf
@@ -5,8 +5,8 @@ contains(TEMPLATE, ".*app") {
mingw:DEFINES += QT_NEEDS_QMAIN
qt:for(entryLib, $$list($$unique(QMAKE_LIBS_QT_ENTRY))) {
- isEqual(entryLib, -lqtmain) {
- lib = $$QT.core.libs/$${QMAKE_PREFIX_STATICLIB}qtmain$$QT_LIBINFIX$$qtPlatformTargetSuffix().$$QMAKE_EXTENSION_STATICLIB
+ isEqual(entryLib, -lqt5main) {
+ lib = $$QT.core.libs/$${QMAKE_PREFIX_STATICLIB}qt5main$$QT_LIBINFIX$$qtPlatformTargetSuffix().$$QMAKE_EXTENSION_STATICLIB
PRE_TARGETDEPS += $$lib
QMAKE_LIBS += $$lib
} else {
diff --git a/src/winmain/winmain.pro b/src/winmain/winmain.pro
index 1f54c846ec..162e7a4b1b 100644
--- a/src/winmain/winmain.pro
+++ b/src/winmain/winmain.pro
@@ -2,7 +2,7 @@
!win32:error("$$_FILE_ is intended only for Windows!")
TEMPLATE = lib
-TARGET = qtmain
+TARGET = qt5main
DESTDIR = $$QT.core.libs
CONFIG += static
--
2.26.0

View File

@ -1,37 +0,0 @@
From f24d3dd8face31fb7b522ca383b8515ba2913911 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 18 Sep 2016 17:59:27 +0200
Subject: [PATCH 16/31] Enable rpath for build tools
- Required because various tools depend on libQt5Bootstrap.so which resides
in folder /usr/${_arch}/lib
- Can't use regular lib dir because it would conflict with the native package
Change-Id: I9808062a66406cdec7446a75150b40b2f30038c7
---
mkspecs/features/qt_app.prf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkspecs/features/qt_app.prf b/mkspecs/features/qt_app.prf
index 8354f30eea..30e8cf18c5 100644
--- a/mkspecs/features/qt_app.prf
+++ b/mkspecs/features/qt_app.prf
@@ -21,6 +21,7 @@ isEmpty(QMAKE_TARGET_DESCRIPTION): \
isEmpty(QMAKE_INFO_PLIST): CONFIG -= app_bundle
host_build: QT -= gui # no host tool will ever use gui
+host_build: QMAKE_RPATHDIR += $$[QT_INSTALL_LIBS/dev] # force rpath
host_build:force_bootstrap {
!build_pass:qtConfig(release_tools): CONFIG += release
contains(QT, core(-private)?|xml) {
@@ -31,7 +32,6 @@ host_build:force_bootstrap {
} else {
!build_pass:qtConfig(debug_and_release): CONFIG += release
target.path = $$[QT_INSTALL_BINS]
- CONFIG += relative_qt_rpath # Qt's tools and apps should be relocatable
}
INSTALLS += target
--
2.26.0

View File

@ -1,27 +0,0 @@
From 3b9033c42d77fba36734f8268f042e2c0154c2b5 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 18 Sep 2016 18:04:42 +0200
Subject: [PATCH 17/31] Use system zlib for build tools
---
src/tools/bootstrap/bootstrap.pro | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro
index 9863ff5e69..02329611bc 100644
--- a/src/tools/bootstrap/bootstrap.pro
+++ b/src/tools/bootstrap/bootstrap.pro
@@ -154,7 +154,9 @@ macx {
../../corelib/io/qstandardpaths_win.cpp
}
-!qtConfig(system-zlib)|cross_compile {
+cross_compile {
+ LIBS += -lz
+} else:!qtConfig(system-zlib) {
include(../../3rdparty/zlib.pri)
} else {
CONFIG += no_core_dep
--
2.26.0

View File

@ -1,208 +0,0 @@
From 5756d20ee409d114a355bd07051311757af46fa4 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 18 Sep 2016 18:45:08 +0200
Subject: [PATCH 18/31] Merge shared and static library trees
Allow installation of shared and static build in the same prefix
Change-Id: I1de08df42d83d411aae519691cd3cde1fd6f3d1d
---
configure.pri | 16 +++++++++++++++-
mkspecs/features/default_post.prf | 11 +++++++++++
mkspecs/features/device_config.prf | 9 ++++++++-
mkspecs/features/qt.prf | 17 +++++++++++++++++
mkspecs/features/spec_pre.prf | 11 ++++++++---
qmake/generators/makefile.cpp | 11 +++++++----
qtbase.pro | 10 ++++++++--
7 files changed, 74 insertions(+), 11 deletions(-)
diff --git a/configure.pri b/configure.pri
index 81c84b28ef..910e59188f 100644
--- a/configure.pri
+++ b/configure.pri
@@ -648,7 +648,12 @@ defineTest(qtConfOutput_machineTuple) {
defineTest(qtConfOutput_commitOptions) {
# qdevice.pri needs to be written early, because the compile tests require it.
- write_file($$QT_BUILD_TREE/mkspecs/qdevice.pri, $${currentConfig}.output.devicePro)|error()
+ shared|actually_a_shared_build {
+ DEVICE_PRI_SUFFIX = .pri
+ } else {
+ DEVICE_PRI_SUFFIX = .static.pri
+ }
+ write_file($$QT_BUILD_TREE/mkspecs/qdevice$$DEVICE_PRI_SUFFIX, $${currentConfig}.output.devicePro)|error()
}
# type (empty or 'host'), option name, default value
@@ -1387,3 +1392,12 @@ defineTest(createConfigStatus) {
QMAKE_POST_CONFIGURE += \
"createConfigStatus()"
+
+# merge shared and static library trees
+contains(CONFIG, static) {
+ CONFIG -= shared
+ QT_CONFIG += static jpeg gif
+ QT_CONFIG -= shared
+ # prevent smart library merge from messing cyclic dependency between freetype2 and harfbuzz
+ CONFIG += no_smart_library_merge
+}
diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf
index 1d79f5c958..48f6e710b6 100644
--- a/mkspecs/features/default_post.prf
+++ b/mkspecs/features/default_post.prf
@@ -1,5 +1,16 @@
# This file is loaded by qmake right after loading the actual project file.
+win32:contains(CONFIG, static) {
+ # Ensure defines are set correctly for static build
+ DEFINES -= QT_SHARED
+ DEFINES *= QT_STATIC QT_DESIGNER_STATIC
+ contains(QT_CONFIG, angle): DEFINES *= QT_OPENGL_ES_2_ANGLE_STATIC
+ # Ensure we link against all dependencies statically
+ QMAKE_LFLAGS += -static -static-libstdc++ -static-libgcc
+ # Prevent qmake from finding the prl file for shared libs
+ QMAKE_EXT_PRL = .static.prl
+}
+
contains(TEMPLATE, ".*(lib|app)"):CONFIG += have_target
!have_target:!force_qt: CONFIG -= qt
diff --git a/mkspecs/features/device_config.prf b/mkspecs/features/device_config.prf
index c15559e174..dd09ac749d 100644
--- a/mkspecs/features/device_config.prf
+++ b/mkspecs/features/device_config.prf
@@ -4,7 +4,14 @@
# supposed to be influenced by -device-option then.
host_build: return()
-DEVICE_PRI = $$[QT_HOST_DATA/get]/mkspecs/qdevice.pri
+shared|actually_a_shared_build {
+ DEVICE_PRI = $$[QT_HOST_DATA/get]/mkspecs/qdevice.pri
+} else {
+ DEVICE_PRI = $$[QT_HOST_DATA/get]/mkspecs/qdevice.static.pri
+ !exists($$DEVICE_PRI) {
+ DEVICE_PRI = $$[QT_HOST_DATA/get]/mkspecs/qdevice.pri
+ }
+}
exists($$DEVICE_PRI):include($$DEVICE_PRI)
unset(DEVICE_PRI)
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index 3a71376029..bbada46c29 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -232,6 +232,23 @@ for(ever) {
!isEmpty(MODULE_WINRT_CAPABILITIES_DEVICE): \
WINRT_MANIFEST.capabilities_device_default += $$MODULE_WINRT_CAPABILITIES_DEVICE
}
+
+ # Ensure linking against all required static libraries as defined in mingw-w64-g++ mkspec
+ win32:contains(CONFIG, static) {
+ isEqual(MODULE_NAME, QtCore) {
+ LIBS$$var_sfx += $$QMAKE_LIBS_CORE
+ } else:isEqual(MODULE_NAME, QtGui) {
+ LIBS$$var_sfx += $$QMAKE_LIBS_GUI_STATIC
+ } else:isEqual(MODULE_NAME, QtNetwork) {
+ LIBS$$var_sfx += $$QMAKE_LIBS_NETWORK_STATIC
+ } else:isEqual(MODULE_NAME, QtDBus) {
+ LIBS$$var_sfx += $$QMAKE_LIBS_DBUS_STATIC
+ } else:isEqual(MODULE_NAME, QtWidgets) {
+ LIBS$$var_sfx += $$QMAKE_LIBS_WIDGETS_STATIC
+ } else:isEqual(MODULE_NAME, QtOpenGL) {
+ LIBS$$var_sfx += $$QMAKE_LIBS_OPENGL
+ }
+ }
}
!isEmpty(BAD_QT):error("Unknown module(s) in QT$$var_sfx: $$replace(BAD_QT, _private$, -private)")
diff --git a/mkspecs/features/spec_pre.prf b/mkspecs/features/spec_pre.prf
index 51ea3a8321..275e080ae4 100644
--- a/mkspecs/features/spec_pre.prf
+++ b/mkspecs/features/spec_pre.prf
@@ -14,9 +14,14 @@ QMAKE_EXT_H = .h .hpp .hh .hxx
QMAKE_EXT_H_MOC = .cpp
QMAKE_EXT_JS = .js
QMAKE_EXT_LEX = .l
-QMAKE_EXT_LIBTOOL = .la
-QMAKE_EXT_PKGCONFIG = .pc
-QMAKE_EXT_PRL = .prl
+QMAKE_EXT_PKGCONFIG = .pc
+contains(CONFIG, static) {
+ QMAKE_EXT_LIBTOOL = .static.la
+ QMAKE_EXT_PRL = .static.prl
+} else {
+ QMAKE_EXT_LIBTOOL = .la
+ QMAKE_EXT_PRL = .prl
+}
QMAKE_EXT_UI = .ui
QMAKE_EXT_YACC = .y
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 9c65f21ac0..f79512ca60 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -3232,6 +3232,9 @@ MakefileGenerator::pkgConfigFileName(bool fixify, bool onlyPrependDestdir)
if (project->isActiveConfig("debug")) {
ret += "d";
}
+ if (project->isActiveConfig("staticlib")) {
+ ret.insert(0, QStringLiteral("Static"));
+ }
ret += Option::pkgcfg_ext;
QString subdir = project->first("QMAKE_PKGCONFIG_DESTDIR").toQString();
if(!subdir.isEmpty()) {
@@ -3408,11 +3411,11 @@ MakefileGenerator::writePkgConfigFile()
t << Qt::endl;
// requires
- const QString requiresString = project->values("QMAKE_PKGCONFIG_REQUIRES").join(' ');
- if (!requiresString.isEmpty()) {
- t << "Requires: " << requiresString << Qt::endl;
+ t << "Requires:";
+ const auto pkgconfigRequires = project->values("QMAKE_PKGCONFIG_REQUIRES");
+ for (const auto &required : pkgconfigRequires) {
+ t << (project->isActiveConfig("staticlib") ? QStringLiteral(" Static") : QStringLiteral(" ")) << required.toQString();
}
-
t << Qt::endl;
}
diff --git a/qtbase.pro b/qtbase.pro
index c0ce0972ef..5a2deaf31d 100644
--- a/qtbase.pro
+++ b/qtbase.pro
@@ -20,6 +20,12 @@ CLEAN_DEPS += qmake-clean
# recursive distclean proceeds, including beyond qtbase.
DISTCLEAN_DEPS += qmake-clean
+shared|actually_a_shared_build {
+ DEVICE_PRI_SUFFIX = .pri
+} else {
+ DEVICE_PRI_SUFFIX = .static.pri
+}
+
# Files created by configure.
# config.status (and configure.cache, which is the same for Windows)
# are omitted for convenience of rebuilds.
@@ -27,7 +33,7 @@ QMAKE_DISTCLEAN += \
config.summary \
config.tests/.qmake.cache \
mkspecs/qconfig.pri \
- mkspecs/qdevice.pri \
+ mkspecs/qdevice$$DEVICE_PRI_SUFFIX \
mkspecs/qmodule.pri \
src/corelib/global/qconfig.h \
src/corelib/global/qconfig_p.h \
@@ -78,7 +84,7 @@ prefix_build|!equals(PWD, $$OUT_PWD) {
mkspecs.path = $$[QT_HOST_DATA]/mkspecs
mkspecs.files = \
$$OUT_PWD/mkspecs/qconfig.pri $$OUT_PWD/mkspecs/qmodule.pri \
- $$OUT_PWD/mkspecs/qdevice.pri \
+ $$OUT_PWD/mkspecs/qdevice$$DEVICE_PRI_SUFFIX \
$$files($$PWD/mkspecs/*)
mkspecs.files -= $$PWD/mkspecs/modules $$PWD/mkspecs/modules-inst
INSTALLS += mkspecs
--
2.26.0

View File

@ -1,98 +0,0 @@
From e21df21893a3071ea5908c9cc19becda0287a231 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 18 Sep 2016 18:26:18 +0200
Subject: [PATCH 19/31] Use *.dll.a as import lib extension
The variables used here are provided by
g++-win32.conf
Change-Id: I40acb56685628ed52b3e6b89aab7f53f9a872b1a
---
mkspecs/features/create_cmake.prf | 5 +++--
mkspecs/features/qt.prf | 15 ++++++++++++---
qmake/generators/win32/winmakefile.cpp | 15 +++++++++++----
3 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
index 0e8d41c685..a94f443de6 100644
--- a/mkspecs/features/create_cmake.prf
+++ b/mkspecs/features/create_cmake.prf
@@ -328,8 +328,9 @@ mac {
CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqt5main$${QT_LIBINFIX}$${debug_suffix}.a
CMAKE_WINMAIN_FILE_LOCATION_RELEASE = libqt5main$${QT_LIBINFIX}.a
- CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}$${debug_suffix}.a
- CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
+ isEmpty(QMAKE_EXTENSION_IMPORTLIB): QMAKE_EXTENSION_IMPORTLIB = a
+ CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}$${debug_suffix}.$${QMAKE_EXTENSION_IMPORTLIB}
+ CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.$${QMAKE_EXTENSION_IMPORTLIB}
} else {
CMAKE_WINMAIN_FILE_LOCATION_DEBUG = qt5main$${QT_LIBINFIX}$${debug_suffix}.lib
CMAKE_WINMAIN_FILE_LOCATION_RELEASE = qt5main$${QT_LIBINFIX}.lib
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index bbada46c29..d6299d8eed 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -213,12 +213,21 @@ for(ever) {
LIBS$$var_sfx += -framework $$framework
} else {
lib = $$MODULE_MODULE$$qtPlatformTargetSuffix()
- win32|contains(MODULE_CONFIG, staticlib) {
+ contains(MODULE_CONFIG, staticlib) {
lib = $$MODULE_LIBS/$$QMAKE_PREFIX_STATICLIB$${lib}.$$QMAKE_EXTENSION_STATICLIB
PRE_TARGETDEPS += $$lib
} else {
- lib = $$MODULE_LIBS/$$QMAKE_PREFIX_SHLIB$${lib}.$$QMAKE_EXTENSION_SHLIB
- }
+ win32 {
+ shared|actually_a_shared_build {
+ lib = $$MODULE_LIBS/$$QMAKE_PREFIX_STATICLIB$${lib}.$$QMAKE_EXTENSION_IMPORTLIB
+ } else {
+ lib = $$MODULE_LIBS/$$QMAKE_PREFIX_STATICLIB$${lib}.$$QMAKE_EXTENSION_STATICLIB
+ }
+ PRE_TARGETDEPS += $$lib
+ } else {
+ lib = $$MODULE_LIBS/$$QMAKE_PREFIX_SHLIB$${lib}.$$QMAKE_EXTENSION_SHLIB
+ }
+ }
LIBS$$var_sfx += $$lib
}
}
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index f33edb5bd9..3a75986257 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -99,9 +99,13 @@ private:
bool
Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
{
- ProStringList impexts = project->values("QMAKE_LIB_EXTENSIONS");
- if (impexts.isEmpty())
- impexts = project->values("QMAKE_EXTENSION_STATICLIB");
+ ProStringList impexts;
+ if (project->isActiveConfig("staticlib")) {
+ impexts.append(project->values("QMAKE_EXTENSION_STATICLIB"));
+ } else {
+ impexts.append(project->values("QMAKE_EXTENSION_IMPORTLIB"));
+ impexts.append(project->values("QMAKE_EXTENSION_STATICLIB"));
+ }
QVector<LibrarySearchPath> dirs;
int libidx = 0;
for (const ProString &dlib : project->values("QMAKE_DEFAULT_LIBDIRS"))
@@ -283,9 +287,12 @@ void Win32MakefileGenerator::fixTargetExt()
if (!project->values("QMAKE_APP_FLAG").isEmpty()) {
project->values("TARGET_EXT").append(".exe");
} else if (project->isActiveConfig("shared")) {
+ ProString impext = project->first("QMAKE_EXTENSION_IMPORTLIB");
+ if (impext.isEmpty())
+ impext = project->first("QMAKE_PREFIX_STATICLIB");
project->values("LIB_TARGET").prepend(project->first("QMAKE_PREFIX_STATICLIB")
+ project->first("TARGET") + project->first("TARGET_VERSION_EXT")
- + '.' + project->first("QMAKE_EXTENSION_STATICLIB"));
+ + '.' + impext);
project->values("TARGET_EXT").append(project->first("TARGET_VERSION_EXT") + "."
+ project->first("QMAKE_EXTENSION_SHLIB"));
project->values("TARGET").first() = project->first("QMAKE_PREFIX_SHLIB") + project->first("TARGET");
--
2.26.0

View File

@ -1,488 +0,0 @@
From 181461364ddf790c194108c4d6130cdd117c3a0a Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 18 Sep 2016 18:32:00 +0200
Subject: [PATCH 20/31] Pull dependencies of static libraries in CMake modules
When doing a static build of Qt, the dependencies of the Qt
libraries and plugins itself must be specified when linking
the final application.
With Qt 5.13.0 the support for doing that has been re-added.
However, some pieces are still missing and that's what this
patch provides:
1. Take dependencies of static plugins into account as well
2. Create imported targets for the dependencies to prevent
problems with -Wl,-Bstatic and -Wl,-Bdynamic
Note that this patch has been harmonized with official changes,
e.g. to use QMAKE_PRL_LIBS instead of QMAKE_PRL_LIBS_FOR_CMAKE.
See https://github.com/Martchus/PKGBUILDs/issues/86#issuecomment-476840055
for further details on 2.
With Qt 5.14.0 the support for using static libraries seems
to be further improved. I had not time to test whether it
actually works so I keep using my own implemention for now.
That's why this patch now removes a lot of the 5.14.0 additions
in favour of 'how it used to work'.
Change-Id: I6566d42d7e27d4cd23d261a0eacca9efad9ce6df
---
.../data/cmake/Qt5BasicConfig.cmake.in | 241 ++++++++++--------
.../data/cmake/Qt5PluginTarget.cmake.in | 84 +-----
2 files changed, 135 insertions(+), 190 deletions(-)
diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
index 1099a761ce..a82e6a886f 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -53,6 +53,10 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura
set(_lib_deps)
set(_link_flags)
+ # prefer static libs
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .a .lib)
+ set(CMAKE_FIND_LIBRARY_PREFIXES lib \"\")
+
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
set(_qt5_install_libs \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}\")
!!ELSE
@@ -61,6 +65,10 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura
if(EXISTS \"${prl_file_location}\")
file(STRINGS \"${prl_file_location}\" _prl_strings REGEX \"QMAKE_PRL_LIBS_FOR_CMAKE[ \\t]*=\")
+ if(NOT _prl_strings)
+ message(WARNING \"Prl file for Qt 5 module $${CMAKE_MODULE_NAME} does not contain QMAKE_PRL_LIBS_FOR_CMAKE. Was looking at \\\"${prl_file_location}\\\".\")
+ return()
+ endif()
# file(STRINGS) replaces all semicolons read from the file with backslash semicolons.
# We need to do a reverse transformation in CMake. For that we replace all backslash
@@ -92,7 +100,7 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura
# Handle normal libraries passed as -lfoo
set(_lib \"${CMAKE_MATCH_1}\")
foreach(_standard_library ${_standard_libraries})
- if(_standard_library MATCHES \"^${_lib}(\\\\.lib)?$\")
+ if(_standard_library MATCHES \"^${_lib}(\\\\.lib|\\\\.a)?$\")
set(_lib_is_default_linked TRUE)
break()
endif()
@@ -139,6 +147,37 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura
set(${lib_deps} ${_lib_deps} PARENT_SCOPE)
set(${link_flags} \"SHELL:${_link_flags}\" PARENT_SCOPE)
endfunction()
+
+if(NOT COMMAND _qt5_add_dependencies)
+ # add dependencies via imported targets so CMake does not mess with their (absolute) file path
+ # which can be problematic with unwanted -Wl,-Bstatic or -Wl,-Bdynamic in the linker line
+ function(_qt5_add_dependencies IMPORTED_TARGET_NAME IMPORTED_TARGET_CONFIG STATIC_DEPENDENCIES)
+ set(DEPENDENCY_INDEX 0)
+ unset(EXTRA_PATHS)
+ unset(DEPENDENCY_TARGETS)
+
+ foreach(LIBRARY_LOCATION ${STATIC_DEPENDENCIES})
+ if (TARGET \"${LIBRARY_LOCATION}\")
+ list(APPEND DEPENDENCY_TARGETS \"${LIBRARY_LOCATION}\")
+ continue()
+ endif()
+ set(DEPENDENCY_NAME ${IMPORTED_TARGET_NAME}_DEPENDENCY_${DEPENDENCY_INDEX})
+ if (NOT TARGET \"${DEPENDENCY_NAME}\")
+ add_library(${DEPENDENCY_NAME} STATIC IMPORTED)
+ set_property(TARGET ${DEPENDENCY_NAME} PROPERTY IMPORTED_LOCATION ${LIBRARY_LOCATION})
+ endif()
+ list(APPEND DEPENDENCY_TARGETS ${DEPENDENCY_NAME})
+ math(EXPR DEPENDENCY_INDEX \"${DEPENDENCY_INDEX} + 1\")
+ endforeach()
+
+ if (\"${IMPORTED_TARGET_CONFIG}\" STREQUAL \"ALL\" OR \"${IMPORTED_TARGET_CONFIG}\" STREQUAL \"RELEASE\")
+ set_property(TARGET ${IMPORTED_TARGET_NAME} PROPERTY INTERFACE_LINK_LIBRARIES ${DEPENDENCY_TARGETS})
+ endif()
+ if (NOT \"${IMPORTED_TARGET_CONFIG}\" STREQUAL \"ALL\")
+ set_property(TARGET ${IMPORTED_TARGET_NAME} PROPERTY INTERFACE_LINK_LIBRARIES_${IMPORTED_TARGET_CONFIG} ${DEPENDENCY_TARGETS})
+ endif()
+ endfunction()
+endif()
!!ENDIF
!!IF !equals(TEMPLATE, aux)
@@ -152,61 +191,39 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI
set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
!!ENDIF
_qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
+
set(_deps
${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}
- )
- set(_static_deps
!!IF !isEmpty(CMAKE_STATIC_TYPE)
${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LIB_DEPENDENCIES}
!!ENDIF
)
+ # FIXME: handle IsDebugAndRelease like in official version
+
+!!IF !isEmpty(CMAKE_STATIC_TYPE)
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
\"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
!!IF !isEmpty(CMAKE_LIB_SONAME)
\"IMPORTED_SONAME_${Configuration}\" \"$${CMAKE_LIB_SONAME}\"
!!ENDIF
- # For backward compatibility with CMake < 2.8.12
- \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_deps};${_static_deps}\"
)
- set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
- \"${_deps}\"
- )
-
-!!IF !isEmpty(CMAKE_STATIC_TYPE)
- if(NOT "${IsDebugAndRelease}")
- set(_genex_condition \"1\")
- else()
- if("${Configuration}" STREQUAL "DEBUG")
- set(_genex_condition \"$<CONFIG:Debug>\")
- else()
- set(_genex_condition \"$<NOT:$<CONFIG:Debug>>\")
- endif()
- endif()
-
- if(_static_deps)
- set(_static_deps_genex \"$<${_genex_condition}:${_static_deps}>\")
- set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
- \"${_static_deps_genex}\"
+ _qt5_add_dependencies(Qt5::$${CMAKE_MODULE_NAME} \"${Configuration}\" \"${_deps}\")
+ if(NOT CMAKE_VERSION VERSION_LESS \"3.13\")
+ set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
+ \"INTERFACE_LINK_OPTIONS\" \"${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LINK_FLAGS}\"
)
endif()
-
- set(_static_link_flags \"${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LINK_FLAGS}\")
- if(_static_link_flags)
- set(_static_link_flags_genex \"$<${_genex_condition}:${_static_link_flags}>\")
- if(NOT CMAKE_VERSION VERSION_LESS \"3.13\")
- set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_OPTIONS
- \"${_static_link_flags_genex}\"
- )
- else()
- # Abuse INTERFACE_LINK_LIBRARIES to add link flags when CMake version is too low.
- # Strip out SHELL:, because it is not supported in this property. And hope for the best.
- string(REPLACE \"SHELL:\" \"\" _static_link_flags_genex \"${_static_link_flags_genex}\")
- set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
- \"${_static_link_flags_genex}\"
- )
- endif()
- endif()
+!!ELSE
+ set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
+ \"INTERFACE_LINK_LIBRARIES_${Configuration}\" \"${_deps}\"
+ \"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
+!!IF !isEmpty(CMAKE_LIB_SONAME)
+ \"IMPORTED_SONAME_${Configuration}\" \"$${CMAKE_LIB_SONAME}\"
+!!ENDIF
+ # For backward compatibility with CMake < 2.8.12
+ \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_deps}\"
+ )
!!ENDIF
!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
@@ -223,6 +240,15 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI
endif()
!!ENDIF
endmacro()
+
+macro(_populate_$${CMAKE_MODULE_NAME}_plugin_target_dependencies_from_prl_file PLUGIN_TARGET_NAME PRL_FILE_LOCATION CONFIGURATION LIB_DIRECTORY LIB_LOCATION)
+ _qt5_$${CMAKE_MODULE_NAME}_process_prl_file(
+ \"${PRL_FILE_LOCATION}\"
+ \"${CONFIGURATION}\"
+ _Qt5$${CMAKE_MODULE_NAME}_STATIC_PLUGIN_${CONFIGURATION}_LIB_DEPENDENCIES
+ _Qt5$${CMAKE_MODULE_NAME}_STATIC_PLUGIN_${CONFIGURATION}_LINK_FLAGS)
+ _qt5_add_dependencies(\"${PLUGIN_TARGET_NAME}\" ALL \"${_Qt5$${CMAKE_MODULE_NAME}_STATIC_PLUGIN_${CONFIGURATION}_LIB_DEPENDENCIES}\")
+endmacro()
!!ENDIF
if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
@@ -408,13 +434,15 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
add_library(Qt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES "CXX")
-!!ELSE
+
+!!ELSE // !isEmpty(CMAKE_STATIC_TYPE)
!!IF equals(TEMPLATE, aux)
add_library(Qt5::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
!!ELSE
add_library(Qt5::$${CMAKE_MODULE_NAME} SHARED IMPORTED)
!!ENDIF
-!!ENDIF
+!!ENDIF // !isEmpty(CMAKE_STATIC_TYPE)
+
!!IF !equals(TEMPLATE, aux)
!!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY FRAMEWORK 1)
@@ -431,6 +459,56 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY INTERFACE_QT_PLUGIN_TYPES \"$${CMAKE_MODULE_PLUGIN_TYPES}\")
+ # Find plugin targets
+ file(GLOB pluginTargetsMaybe \"${CMAKE_CURRENT_LIST_DIR}/*Qt5$${CMAKE_MODULE_NAME}_*.cmake\")
+ unset(pluginTargets)
+ if(pluginTargetsMaybe)
+ foreach(pluginTarget ${pluginTargetsMaybe})
+ file(STRINGS ${pluginTarget} matched REGEX Qt5$${CMAKE_MODULE_NAME}_PLUGINS)
+ if(matched)
+ list(APPEND pluginTargets ${pluginTarget})
+ endif()
+ endforeach()
+ endif()
+
+ macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties TARGET_NAME PLUGIN_TARGET_NAME PLUGIN_NAME CONFIG PLUGIN_LOCATION)
+ set_property(TARGET ${PLUGIN_TARGET_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${CONFIG})
+
+!!IF isEmpty(CMAKE_PLUGIN_DIR_IS_ABSOLUTE)
+ set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
+!!ELSE
+ set(imported_location \"$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
+!!ENDIF
+ _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
+ set_target_properties(${PLUGIN_TARGET_NAME} PROPERTIES
+ \"IMPORTED_LOCATION_${CONFIG}\" ${imported_location}
+ )
+!!IF !isEmpty(CMAKE_STATIC_TYPE)
+ set_property(TARGET ${TARGET_NAME} APPEND PROPERTY STATIC_PLUGINS ${PLUGIN_NAME})
+ get_filename_component(_PLUGIN_DIR ${PLUGIN_LOCATION} PATH)
+ get_filename_component(_PLUGIN_DIR_NAME ${_PLUGIN_DIR} NAME)
+ get_filename_component(_PLUGIN_NAME ${PLUGIN_LOCATION} NAME)
+ string(REGEX REPLACE \"^lib(.*)\\\\.a\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/lib/qt/plugins/${_PLUGIN_DIR_NAME}/\\\\1.static.prl\" PLUGIN_PRL_FILE_LOCATION ${_PLUGIN_NAME})
+ if(NOT EXISTS ${PLUGIN_PRL_FILE_LOCATION})
+ string(REGEX REPLACE \"^lib(.*)\\\\.a\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/lib/qt/plugins/${_PLUGIN_DIR_NAME}/\\\\1.prl\" PLUGIN_PRL_FILE_LOCATION ${_PLUGIN_NAME})
+ endif()
+ if(NOT EXISTS ${PLUGIN_PRL_FILE_LOCATION})
+ string(REGEX REPLACE \"^lib(.*)\\\\.a\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/lib/qt/plugins/${_PLUGIN_DIR_NAME}/lib\\\\1.prl\" PLUGIN_PRL_FILE_LOCATION ${_PLUGIN_NAME})
+ endif()
+ if(NOT EXISTS ${PLUGIN_PRL_FILE_LOCATION})
+ message(FATAL_ERROR "The prl file containing dependencies of static plugin ${PLUGIN_TARGET_NAME} of ${TARGET_NAME} could not be found.")
+ endif()
+ _populate_$${CMAKE_MODULE_NAME}_plugin_target_dependencies_from_prl_file(${PLUGIN_TARGET_NAME} ${PLUGIN_PRL_FILE_LOCATION} ${CONFIG} \"lib/qt/plugins\" ${PLUGIN_LOCATION})
+!!ENDIF
+
+ endmacro()
+
+ if(pluginTargets)
+ foreach(pluginTarget ${pluginTargets})
+ include(${pluginTarget})
+ endforeach()
+ endif()
+
set(_Qt5$${CMAKE_MODULE_NAME}_PRIVATE_DIRS_EXIST TRUE)
foreach (_Qt5$${CMAKE_MODULE_NAME}_PRIVATE_DIR ${Qt5$${CMAKE_MODULE_NAME}_OWN_PRIVATE_INCLUDE_DIRS})
if (NOT EXISTS ${_Qt5$${CMAKE_MODULE_NAME}_PRIVATE_DIR})
@@ -449,9 +527,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
list(APPEND _Qt5$${CMAKE_MODULE_NAME}_PRIVATEDEPS ${dep}Private)
endif()
endforeach()
+!!IF !isEmpty(CMAKE_STATIC_TYPE)
+ _qt5_add_dependencies(Qt5::$${CMAKE_MODULE_NAME}Private ALL \"Qt5::$${CMAKE_MODULE_NAME};${_Qt5$${CMAKE_MODULE_NAME}_PRIVATEDEPS}\")
+!!ELSE
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME}Private PROPERTY
INTERFACE_LINK_LIBRARIES Qt5::$${CMAKE_MODULE_NAME} ${_Qt5$${CMAKE_MODULE_NAME}_PRIVATEDEPS}
)
+!!ENDIF // CMAKE_STATIC_TYPE
endif()
!!IF !equals(TEMPLATE, aux)
@@ -521,9 +603,11 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
!!ELSE
\"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
!!ENDIF
- _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE})
-!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
+ _populate_$${CMAKE_MODULE_NAME}_target_properties(Qt5::$${CMAKE_MODULE_NAME} RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE})
endif()
+!!ENDIF // CMAKE_STATIC_TYPE
+
+
!!ENDIF // CMAKE_RELEASE_TYPE
!!ENDIF // CMAKE_FIND_OTHER_LIBRARY_BUILD
@@ -534,73 +618,6 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
)
!!ENDIF // TEMPLATE != aux
-!!IF isEmpty(CMAKE_INTERNAL_MODULE)
-
- file(GLOB pluginTargets \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*Plugin.cmake\")
-
- macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION
- IsDebugAndRelease)
- set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
-
-!!IF isEmpty(CMAKE_PLUGIN_DIR_IS_ABSOLUTE)
- set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
-!!ELSE
- set(imported_location \"$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
-!!ENDIF
- _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
- set_target_properties(Qt5::${Plugin} PROPERTIES
- \"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
- )
-
-!!IF !isEmpty(CMAKE_STATIC_TYPE)
- set(_static_deps
- ${_Qt5${Plugin}_STATIC_${Configuration}_LIB_DEPENDENCIES}
- )
-
- if(NOT "${IsDebugAndRelease}")
- set(_genex_condition \"1\")
- else()
- if("${Configuration}" STREQUAL "DEBUG")
- set(_genex_condition \"$<CONFIG:Debug>\")
- else()
- set(_genex_condition \"$<NOT:$<CONFIG:Debug>>\")
- endif()
- endif()
- if(_static_deps)
- set(_static_deps_genex \"$<${_genex_condition}:${_static_deps}>\")
- set_property(TARGET Qt5::${Plugin} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
- \"${_static_deps_genex}\"
- )
- endif()
-
- set(_static_link_flags \"${_Qt5${Plugin}_STATIC_${Configuration}_LINK_FLAGS}\")
- if(_static_link_flags)
- set(_static_link_flags_genex \"$<${_genex_condition}:${_static_link_flags}>\")
- if(NOT CMAKE_VERSION VERSION_LESS \"3.13\")
- set_property(TARGET Qt5::${Plugin} APPEND PROPERTY INTERFACE_LINK_OPTIONS
- \"${_static_link_flags_genex}\"
- )
- else()
- # Abuse INTERFACE_LINK_LIBRARIES to add link flags when CMake version is too low.
- # Strip out SHELL:, because it is not supported in this property. And hope for the best.
- string(REPLACE \"SHELL:\" \"\" _static_link_flags_genex \"${_static_link_flags_genex}\")
- set_property(TARGET Qt5::${Plugin} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
- \"${_static_link_flags_genex}\"
- )
- endif()
- endif()
-!!ENDIF
- endmacro()
-
- if (pluginTargets)
- foreach(pluginTarget ${pluginTargets})
- include(${pluginTarget})
- endforeach()
- endif()
-
-!!ENDIF // isEmpty(CMAKE_INTERNAL_MODULE)
-
-
!!IF !isEmpty(CMAKE_MODULE_EXTRAS)
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake\")
!!ENDIF
diff --git a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in b/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
index 7b70cfed09..25f2162fe6 100644
--- a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
@@ -1,5 +1,6 @@
-
-add_library(Qt5::$$CMAKE_PLUGIN_NAME MODULE IMPORTED)
+# Some Qt modules also load plugin target in extra config, so check whether the target already exists
+if(NOT TARGET Qt5::$$CMAKE_PLUGIN_NAME)
+ add_library(Qt5::$$CMAKE_PLUGIN_NAME MODULE IMPORTED)
!!IF !isEmpty(CMAKE_STATIC_TYPE)
set(_Qt5$${CMAKE_PLUGIN_NAME}_MODULE_DEPENDENCIES \"$${CMAKE_PLUGIN_MODULE_DEPS}\")
@@ -16,87 +17,14 @@ foreach(_module_dep ${_Qt5$${CMAKE_PLUGIN_NAME}_MODULE_DEPENDENCIES})
endforeach()
!!IF !isEmpty(CMAKE_RELEASE_TYPE)
-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
-_qt5_$${CMAKE_MODULE_NAME}_process_prl_file(
- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE}\" RELEASE
- _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_RELEASE_LIB_DEPENDENCIES
- _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_RELEASE_LINK_FLAGS
-)
-!!ELSE
-_qt5_$${CMAKE_MODULE_NAME}_process_prl_file(
- \"$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE}\" RELEASE
- _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_RELEASE_LIB_DEPENDENCIES
- _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_RELEASE_LINK_FLAGS
-)
-!!ENDIF
-!!ENDIF
-
-!!IF !isEmpty(CMAKE_DEBUG_TYPE)
-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
-_qt5_$${CMAKE_MODULE_NAME}_process_prl_file(
- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG}\" DEBUG
- _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_DEBUG_LIB_DEPENDENCIES
- _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_DEBUG_LINK_FLAGS
-)
-!!ELSE
-_qt5_$${CMAKE_MODULE_NAME}_process_prl_file(
- \"$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG}\" DEBUG
- _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_DEBUG_LIB_DEPENDENCIES
- _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_DEBUG_LINK_FLAGS
-)
-!!ENDIF
+ _populate_$${CMAKE_MODULE_NAME}_plugin_properties(Qt5::$$CMAKE_MODULE_NAME Qt5::$$CMAKE_PLUGIN_NAME $$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\")
!!ENDIF
-
-set_property(TARGET Qt5::$$CMAKE_PLUGIN_NAME PROPERTY INTERFACE_SOURCES
- \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_$${CMAKE_PLUGIN_NAME}_Import.cpp\"
-)
!!ENDIF
-!!IF !isEmpty(CMAKE_RELEASE_TYPE)
-_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE})
-!!ENDIF
!!IF !isEmpty(CMAKE_DEBUG_TYPE)
-_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE})
+ _populate_$${CMAKE_MODULE_NAME}_plugin_properties(Qt5::$$CMAKE_MODULE_NAME Qt5::$$CMAKE_PLUGIN_NAME $$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\")
!!ENDIF
list(APPEND Qt5$${CMAKE_MODULE_NAME}_PLUGINS Qt5::$$CMAKE_PLUGIN_NAME)
-set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY QT_ALL_PLUGINS_$${CMAKE_PLUGIN_TYPE_ESCAPED} Qt5::$${CMAKE_PLUGIN_NAME})
-!!IF !isEmpty(CMAKE_STATIC_TYPE)
-# $<GENEX_EVAL:...> wasn\'t added until CMake 3.12, so put a version guard around it
-if(CMAKE_VERSION VERSION_LESS \"3.12\")
- set(_manual_plugins_genex \"$<TARGET_PROPERTY:QT_PLUGINS>\")
- set(_plugin_type_genex \"$<TARGET_PROPERTY:QT_PLUGINS_$${CMAKE_PLUGIN_TYPE_ESCAPED}>\")
- set(_no_plugins_genex \"$<TARGET_PROPERTY:QT_NO_PLUGINS>\")
-else()
- set(_manual_plugins_genex \"$<GENEX_EVAL:$<TARGET_PROPERTY:QT_PLUGINS>>\")
- set(_plugin_type_genex \"$<GENEX_EVAL:$<TARGET_PROPERTY:QT_PLUGINS_$${CMAKE_PLUGIN_TYPE_ESCAPED}>>\")
- set(_no_plugins_genex \"$<GENEX_EVAL:$<TARGET_PROPERTY:QT_NO_PLUGINS>>\")
+
endif()
-set(_user_specified_genex
- \"$<IN_LIST:Qt5::$$CMAKE_PLUGIN_NAME,${_manual_plugins_genex};${_plugin_type_genex}>\"
-)
-string(CONCAT _plugin_genex
- \"$<$<OR:\"
- # Add this plugin if it\'s in the list of manual plugins or plugins for the type
- \"${_user_specified_genex},\"
- # Add this plugin if the list of plugins for the type is empty, the PLUGIN_EXTENDS
- # is either empty or equal to the module name, and the user hasn\'t blacklisted it
- \"$<AND:\"
- \"$<STREQUAL:${_plugin_type_genex},>,\"
- \"$<OR:\"
- \"$<STREQUAL:$<TARGET_PROPERTY:Qt5::$${CMAKE_PLUGIN_NAME},QT_PLUGIN_EXTENDS>,Qt5::$${CMAKE_MODULE_NAME}>,\"
- \"$<STREQUAL:$<TARGET_PROPERTY:Qt5::$${CMAKE_PLUGIN_NAME},QT_PLUGIN_EXTENDS>,>\"
- \">,\"
- \"$<NOT:$<IN_LIST:Qt5::$${CMAKE_PLUGIN_NAME},${_no_plugins_genex}>>\"
- \">\"
- \">:Qt5::$$CMAKE_PLUGIN_NAME>\"
-)
-set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
- ${_plugin_genex}
-)
-set_property(TARGET Qt5::$${CMAKE_PLUGIN_NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
- \"$${CMAKE_PLUGIN_QT5_MODULE_DEPS}\"
-)
-!!ENDIF
-set_property(TARGET Qt5::$${CMAKE_PLUGIN_NAME} PROPERTY QT_PLUGIN_TYPE \"$$CMAKE_PLUGIN_TYPE\")
-set_property(TARGET Qt5::$${CMAKE_PLUGIN_NAME} PROPERTY QT_PLUGIN_EXTENDS \"$$CMAKE_PLUGIN_EXTENDS\")
--
2.26.0

View File

@ -1,29 +0,0 @@
From d214392ab20e45037c817c0150c5086993358e9f Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Fri, 2 Jun 2017 16:42:07 +0200
Subject: [PATCH 22/31] Adjust linker flags for static build with
cmake/mingw-w64
Change-Id: I33b88976d8f5ce87ce431a6f422fe87785bf5b8d
---
src/corelib/Qt5CoreConfigExtras.cmake.in | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index 58d1d5b366..967dc64a19 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -179,3 +179,10 @@ if (ANDROID_PLATFORM)
endif()
_qt5_Core_check_file_exists(${_Qt5CTestMacros})
+
+!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
+set(_isExe $<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>)
+# INTERFACE_LINK_LIBRARIES is used to pass a linker flag '-static' and library ws2_32
+set_target_properties(${IMPORTED_TARGET_NAME} PROPERTIES \"INTERFACE_LINK_LIBRARIES\" \"$<${_isExe}:-static;ws2_32>\")
+unset(_isExe)
+!!ENDIF
--
2.26.0

View File

@ -1,26 +0,0 @@
From 58af82ed3fefd7b230341376c20dc8be84c913a3 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 18 Sep 2016 18:50:21 +0200
Subject: [PATCH 23/31] Use correct pkg-config --static flag
---
configure.pri | 3 +++
1 file changed, 3 insertions(+)
diff --git a/configure.pri b/configure.pri
index 910e59188f..aaa4123f4c 100644
--- a/configure.pri
+++ b/configure.pri
@@ -345,6 +345,9 @@ defineTest(qtConfTest_detectPkgConfig) {
qtLog("Found pkg-config from path: $$pkgConfig")
}
}
+ !isEmpty(pkgConfig):qtConfig(static) {
+ pkgConfig = "$$pkgConfig --static"
+ }
$$qtConfEvaluate("features.cross_compile") {
# cross compiling, check that pkg-config is set up sanely
--
2.26.0

View File

@ -1,74 +0,0 @@
From b14162daa442d61ba3747a68aff6b0a33677e606 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Sun, 4 Dec 2016 20:35:47 +0100
Subject: [PATCH 24/31] Fix macro invoking moc, rcc and uic
* Otherwise the arguments aren't passed correctly leading to errors like
```
[ 3%] Generating qca_core.moc
moc: Too many input files specified: 'Qt5::moc' '/build/qca-qt5/src/qca-2.1.3/include/QtCrypto/qca_safetimer.h'
```
* Just a workaround, not sure what is causing the issue (maybe a CMake bug?)
* See https://github.com/Martchus/PKGBUILDs/issues/11
Change-Id: I6fde86d0a3ade37b4376604a1eb6d5723eda8b4c
---
src/corelib/Qt5CoreMacros.cmake | 9 ++++++---
src/widgets/Qt5WidgetsMacros.cmake | 3 ++-
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake
index 02f49a4b1e..581dbeac50 100644
--- a/src/corelib/Qt5CoreMacros.cmake
+++ b/src/corelib/Qt5CoreMacros.cmake
@@ -139,8 +139,9 @@ function(QT5_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target
endif()
set(_moc_extra_parameters_file @${_moc_parameters_file})
+ get_target_property(MOC_LOC ${Qt5Core_MOC_EXECUTABLE} IMPORTED_LOCATION)
add_custom_command(OUTPUT ${outfile}
- COMMAND ${Qt5Core_MOC_EXECUTABLE} ${_moc_extra_parameters_file}
+ COMMAND ${MOC_LOC} ${_moc_extra_parameters_file}
DEPENDS ${infile} ${moc_depends}
${_moc_working_dir}
VERBATIM)
@@ -255,8 +256,9 @@ function(QT5_ADD_BINARY_RESOURCES target )
set(rc_depends ${rc_depends} ${_rc_depends})
endforeach()
+ get_target_property(RCC_LOC ${Qt5Core_RCC_EXECUTABLE} IMPORTED_LOCATION)
add_custom_command(OUTPUT ${rcc_destination}
- COMMAND ${Qt5Core_RCC_EXECUTABLE}
+ COMMAND ${RCC_LOC}
ARGS ${rcc_options} --binary --name ${target} --output ${rcc_destination} ${infiles}
DEPENDS ${rc_depends} ${out_depends} ${infiles} VERBATIM)
add_custom_target(${target} ALL DEPENDS ${rcc_destination})
@@ -288,8 +290,9 @@ function(QT5_ADD_RESOURCES outfiles )
_QT5_PARSE_QRC_FILE(${infile} _out_depends _rc_depends)
set_source_files_properties(${infile} PROPERTIES SKIP_AUTORCC ON)
+ get_target_property(MOC_LOC ${Qt5Core_RCC_EXECUTABLE} IMPORTED_LOCATION)
add_custom_command(OUTPUT ${outfile}
- COMMAND ${Qt5Core_RCC_EXECUTABLE}
+ COMMAND ${MOC_LOC}
ARGS ${rcc_options} --name ${outfilename} --output ${outfile} ${infile}
MAIN_DEPENDENCY ${infile}
DEPENDS ${_rc_depends} "${_out_depends}" VERBATIM)
diff --git a/src/widgets/Qt5WidgetsMacros.cmake b/src/widgets/Qt5WidgetsMacros.cmake
index 737371a5ad..d103278cdf 100644
--- a/src/widgets/Qt5WidgetsMacros.cmake
+++ b/src/widgets/Qt5WidgetsMacros.cmake
@@ -55,8 +55,9 @@ function(QT5_WRAP_UI outfiles )
get_filename_component(outfile ${it} NAME_WE)
get_filename_component(infile ${it} ABSOLUTE)
set(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
+ get_target_property(UIC_LOC ${Qt5Widgets_UIC_EXECUTABLE} IMPORTED_LOCATION)
add_custom_command(OUTPUT ${outfile}
- COMMAND ${Qt5Widgets_UIC_EXECUTABLE}
+ COMMAND ${UIC_LOC}
ARGS ${ui_options} -o ${outfile} ${infile}
MAIN_DEPENDENCY ${infile} VERBATIM)
set_source_files_properties(${infile} PROPERTIES SKIP_AUTOUIC ON)
--
2.26.0

View File

@ -1,36 +0,0 @@
From b01de5ed0031d69b552b980214d4bfe6ce8ee52d Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Wed, 25 Jan 2017 20:59:54 +0100
Subject: [PATCH 25/31] Ignore errors about missing feature static
Not sure why this error occurs, let's hope for the best
---
mkspecs/features/qt_build_config.prf | 2 +-
mkspecs/features/qt_functions.prf | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/mkspecs/features/qt_build_config.prf b/mkspecs/features/qt_build_config.prf
index 511b158b91..39760d5ce4 100644
--- a/mkspecs/features/qt_build_config.prf
+++ b/mkspecs/features/qt_build_config.prf
@@ -153,5 +153,5 @@ defineTest(qtConfig) {
contains(QT.$${module}.disabled_features, $$1): \
return(false)
}
- error("Could not find feature $${1}.")
+ !equals($$1, "static"): error("Could not find feature $${1}.")
}
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index 7777e615bd..5f30366660 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -370,5 +370,5 @@ defineTest(qtConfig) {
contains(QT.$${module}.disabled_features, $$1): \
return(false)
}
- error("Could not find feature $${1}.")
+ !equals($$1, "static"): error("Could not find feature $${1}.")
}
--
2.26.0

View File

@ -1,78 +0,0 @@
From e2636a2a9b11a10ba86ce55a11d29623feca0c28 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Wed, 25 Jan 2017 21:08:20 +0100
Subject: [PATCH 26/31] Enable and fix use of iconv
Change-Id: I5f0ab27afca0800dec11c7af74d196190820ae5c
---
src/corelib/codecs/qiconvcodec.cpp | 7 +++----
src/corelib/configure.json | 6 +++---
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/corelib/codecs/qiconvcodec.cpp b/src/corelib/codecs/qiconvcodec.cpp
index 9c39727946..cc14036b25 100644
--- a/src/corelib/codecs/qiconvcodec.cpp
+++ b/src/corelib/codecs/qiconvcodec.cpp
@@ -47,7 +47,6 @@
#include <errno.h>
#include <locale.h>
#include <stdio.h>
-#include <dlfcn.h>
// unistd.h is needed for the _XOPEN_UNIX macro
#include <unistd.h>
@@ -180,7 +179,7 @@ QString QIconvCodec::convertToUnicode(const char* chars, int len, ConverterState
IconvState *state = *pstate;
size_t inBytesLeft = len;
// best case assumption, each byte is converted into one UTF-16 character, plus 2 bytes for the BOM
-#if !QT_CONFIG(posix_libiconv)
+#if !QT_CONFIG(posix_libiconv) && !defined(Q_OS_WIN)
// GNU doesn't disagree with POSIX :/
const char *inBytes = chars;
#else
@@ -279,7 +278,7 @@ static bool setByteOrder(iconv_t cd)
size_t outBytesLeft = sizeof buf;
size_t inBytesLeft = sizeof bom;
-#if !QT_CONFIG(posix_libiconv)
+#if !QT_CONFIG(posix_libiconv) && !defined(Q_OS_WIN)
const char **inBytesPtr = const_cast<const char **>(&inBytes);
#else
char **inBytesPtr = &inBytes;
@@ -301,7 +300,7 @@ QByteArray QIconvCodec::convertFromUnicode(const QChar *uc, int len, ConverterSt
char *outBytes;
size_t inBytesLeft;
-#if !QT_CONFIG(posix_libiconv)
+#if !QT_CONFIG(posix_libiconv) && !defined(Q_OS_WIN)
const char **inBytesPtr = const_cast<const char **>(&inBytes);
#else
char **inBytesPtr = &inBytes;
diff --git a/src/corelib/configure.json b/src/corelib/configure.json
index ae360239c6..5fd57a1a66 100644
--- a/src/corelib/configure.json
+++ b/src/corelib/configure.json
@@ -72,7 +72,7 @@
"test": {
"main": [
"iconv_t x = iconv_open(\"\", \"\");",
- "const char *inp;",
+ "char *inp;",
"char *outp;",
"size_t inbytes, outbytes;",
"iconv(x, &inp, &inbytes, &outp, &outbytes);",
@@ -672,9 +672,9 @@
},
"gnu-libiconv": {
"label": "GNU iconv",
- "enable": "input.iconv == 'gnu'",
+ "enable": "'enabling via -gnu-iconv fails' == 'enabling via -gnu-iconv fails'",
"disable": "input.iconv == 'posix' || input.iconv == 'sun' || input.iconv == 'no'",
- "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && !features.sun-libiconv && libs.gnu_iconv",
+ "condition": "!config.qnx && !config.android && !config.darwin && !features.posix-libiconv && !features.sun-libiconv && libs.gnu_iconv",
"output": [ "privateFeature" ]
},
"icu": {
--
2.26.0

View File

@ -1,25 +0,0 @@
From 8aad5efe320b053525a8cdcf5dd498c349cd5050 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Wed, 25 Jan 2017 21:08:48 +0100
Subject: [PATCH 27/31] Ignore failing pkg-config test
Didn't investigate why it fails, let's hope for the best
---
configure.json | 1 -
1 file changed, 1 deletion(-)
diff --git a/configure.json b/configure.json
index a481e54b8d..34cac288a7 100644
--- a/configure.json
+++ b/configure.json
@@ -755,7 +755,6 @@
"pkg-config": {
"label": "Using pkg-config",
"autoDetect": "!config.darwin && !config.win32",
- "condition": "tests.pkg-config",
"output": [
"publicFeature",
{ "type": "publicQtConfig", "negative": true },
--
2.26.0

View File

@ -1,45 +0,0 @@
From 90787e1baa580ced40a79a20c8624ecdeee3aad4 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Tue, 7 Feb 2017 18:25:28 +0100
Subject: [PATCH 28/31] Prevent qmake from messing static lib dependencies
In particular, it messes resolving cyclic dependency between
static freetype2 and harfbuzz
Change-Id: Ie5a4e2ad96bd613ae4c26486edb30c74929459b0
---
qmake/generators/unix/unixmake.cpp | 3 +++
qmake/generators/win32/winmakefile.cpp | 3 +++
2 files changed, 6 insertions(+)
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index f7bd6dc663..b76c444012 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -391,6 +391,9 @@ UnixMakefileGenerator::fixLibFlag(const ProString &lib)
bool
UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
{
+ if(project->isActiveConfig("staticlib")) {
+ return false; // prevent qmake from messing static lib dependencies
+ }
QVector<QMakeLocalFileName> libdirs, frameworkdirs;
int libidx = 0, fwidx = 0;
for (const ProString &dlib : project->values("QMAKE_DEFAULT_LIBDIRS"))
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 3a75986257..34e7776e44 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -106,6 +106,9 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
impexts.append(project->values("QMAKE_EXTENSION_IMPORTLIB"));
impexts.append(project->values("QMAKE_EXTENSION_STATICLIB"));
}
+ if(project->isActiveConfig("staticlib")) {
+ return false; // prevent qmake from messing static lib dependencies
+ }
QVector<LibrarySearchPath> dirs;
int libidx = 0;
for (const ProString &dlib : project->values("QMAKE_DEFAULT_LIBDIRS"))
--
2.26.0

View File

@ -1,156 +0,0 @@
From 437223bd0628fc9f1081dc332412007df267e3fd Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Wed, 25 Jan 2017 23:42:30 +0100
Subject: [PATCH 29/31] Hardcode linker flags for platform plugins
Otherwise incorrect order of libs leads to errors
when building libqminimal.dll, libqoffscreen.dll,
libqwindows.dll and libqdirect2d.dll
Change-Id: Ibff901ecce864ae8d5ca2adbe37bcec28e5912f3
---
src/plugins/platforms/direct2d/direct2d.pro | 30 ++++++++++++++---
src/plugins/platforms/minimal/minimal.pro | 15 +++++++--
src/plugins/platforms/offscreen/offscreen.pro | 14 ++++++--
src/plugins/platforms/windows/windows.pro | 33 +++++++++++++------
4 files changed, 73 insertions(+), 19 deletions(-)
diff --git a/src/plugins/platforms/direct2d/direct2d.pro b/src/plugins/platforms/direct2d/direct2d.pro
index 6e73bd14f9..e009a5387a 100644
--- a/src/plugins/platforms/direct2d/direct2d.pro
+++ b/src/plugins/platforms/direct2d/direct2d.pro
@@ -1,12 +1,32 @@
TARGET = qdirect2d
QT += \
- core-private gui-private \
- eventdispatcher_support-private \
- fontdatabase_support-private theme_support-private
+ core-private gui-private
-qtConfig(accessibility): QT += accessibility_support-private
-qtConfig(vulkan): QT += vulkan_support-private
+# Fix linker error when building libqdirect2d.dll by specifying linker flags for
+# required modules manually (otherwise order is messed)
+LIBS += \
+ $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5EventDispatcherSupport.$${QMAKE_EXTENSION_STATICLIB} \
+ $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5FontDatabaseSupport.$${QMAKE_EXTENSION_STATICLIB} \
+ $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5ThemeSupport.$${QMAKE_EXTENSION_STATICLIB} \
+ -lfreetype -lole32 -lgdi32 -luuid
+# However, this workaround leads to the necessity of specifying include dirs manually
+INCLUDEPATH += \
+ $$QT_SOURCE_TREE/include/QtEventDispatcherSupport/$${QT_VERSION} \
+ $$QT_SOURCE_TREE/include/QtFontDatabaseSupport/$${QT_VERSION} \
+ $$QT_SOURCE_TREE/include/QtThemeSupport/$${QT_VERSION}
+# Same for private support libs for accessibility and vulkan, if those are enabled
+qtConfig(accessibility) {
+ LIBS += $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5AccessibilitySupport.$${QMAKE_EXTENSION_STATICLIB}
+ INCLUDEPATH += $$QT_SOURCE_TREE/include/QtAccessibilitySupport/$${QT_VERSION}
+}
+qtConfig(vulkan) {
+ LIBS += $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5VulkanSupport.$${QMAKE_EXTENSION_STATICLIB}
+ INCLUDEPATH += $$QT_SOURCE_TREE/include/QtVulkanSupport/$${QT_VERSION}
+}
+# Also add Qt5WindowsUIAutomationSupport - it seems to link against it
+LIBS += $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5WindowsUIAutomationSupport.$${QMAKE_EXTENSION_STATICLIB}
+INCLUDEPATH += $$QT_SOURCE_TREE/include/Qt5WindowsUIAutomationSupport/$${QT_VERSION}
LIBS += -ldwmapi -lversion
QMAKE_USE_PRIVATE += gdi32 dwrite_1 d2d1_1 d3d11_1 dxgi1_2
diff --git a/src/plugins/platforms/minimal/minimal.pro b/src/plugins/platforms/minimal/minimal.pro
index a1a2da547b..e32225d9b9 100644
--- a/src/plugins/platforms/minimal/minimal.pro
+++ b/src/plugins/platforms/minimal/minimal.pro
@@ -1,8 +1,19 @@
TARGET = qminimal
QT += \
- core-private gui-private \
- eventdispatcher_support-private fontdatabase_support-private
+ core-private gui-private
+
+# Fix linker error when building libqminimal.dll by specifying linker flags for
+# required modules manually (otherwise order is messed)
+LIBS += \
+ $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5EventDispatcherSupport.$${QMAKE_EXTENSION_STATICLIB} \
+ $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5FontDatabaseSupport.$${QMAKE_EXTENSION_STATICLIB} \
+ -lfreetype -lole32 -lgdi32 -luuid
+# However, this workaround leads to the necessity of specifying include dirs manually
+INCLUDEPATH += \
+ $$QT_SOURCE_TREE/include/QtEventDispatcherSupport/$${QT_VERSION} \
+ $$QT_SOURCE_TREE/include/QtFontDatabaseSupport/$${QT_VERSION}
+
DEFINES += QT_NO_FOREACH
diff --git a/src/plugins/platforms/offscreen/offscreen.pro b/src/plugins/platforms/offscreen/offscreen.pro
index f226132592..d8ab86b322 100644
--- a/src/plugins/platforms/offscreen/offscreen.pro
+++ b/src/plugins/platforms/offscreen/offscreen.pro
@@ -1,8 +1,18 @@
TARGET = qoffscreen
QT += \
- core-private gui-private \
- eventdispatcher_support-private fontdatabase_support-private
+ core-private gui-private
+
+# Fix linker error when building libqoffscreen.dll by specifying linker flags for
+# required modules manually (otherwise order is messed)
+LIBS += \
+ $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5EventDispatcherSupport.$${QMAKE_EXTENSION_STATICLIB} \
+ $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5FontDatabaseSupport.$${QMAKE_EXTENSION_STATICLIB} \
+ -lfreetype -lole32 -lgdi32 -luuid
+# However, this workaround leads to the necessity of specifying include dirs manually
+INCLUDEPATH += \
+ $$QT_SOURCE_TREE/include/QtEventDispatcherSupport/$${QT_VERSION} \
+ $$QT_SOURCE_TREE/include/QtFontDatabaseSupport/$${QT_VERSION}
DEFINES += QT_NO_FOREACH
diff --git a/src/plugins/platforms/windows/windows.pro b/src/plugins/platforms/windows/windows.pro
index 50a3bb41a9..285d90c6d3 100644
--- a/src/plugins/platforms/windows/windows.pro
+++ b/src/plugins/platforms/windows/windows.pro
@@ -1,15 +1,28 @@
TARGET = qwindows
-QT += \
- core-private gui-private \
- eventdispatcher_support-private \
- fontdatabase_support-private theme_support-private
-
-qtConfig(accessibility): QT += accessibility_support-private
-qtConfig(vulkan): QT += vulkan_support-private
-
-LIBS += -ldwmapi
-QMAKE_USE_PRIVATE += gdi32
+QT += core-private gui-private
+
+# Fix linker error when building libqwindows.dll by specifying linker flags for
+# required modules manually (otherwise order is messed)
+LIBS += \
+ $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5EventDispatcherSupport.$${QMAKE_EXTENSION_STATICLIB} \
+ $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5FontDatabaseSupport.$${QMAKE_EXTENSION_STATICLIB} \
+ $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5ThemeSupport.$${QMAKE_EXTENSION_STATICLIB} \
+ -lfreetype -lole32 -lgdi32 -ldwmapi
+# However, this workaround leads to the necessity of specifying include dirs manually
+INCLUDEPATH += \
+ $$QT_SOURCE_TREE/include/QtEventDispatcherSupport/$${QT_VERSION} \
+ $$QT_SOURCE_TREE/include/QtFontDatabaseSupport/$${QT_VERSION} \
+ $$QT_SOURCE_TREE/include/QtThemeSupport/$${QT_VERSION}
+# Same for private support libs for accessibility and vulkan, if those are enabled
+qtConfig(accessibility) {
+ LIBS += $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5AccessibilitySupport.$${QMAKE_EXTENSION_STATICLIB}
+ INCLUDEPATH += $$QT_SOURCE_TREE/include/QtAccessibilitySupport/$${QT_VERSION}
+}
+qtConfig(vulkan) {
+ LIBS += $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}Qt5VulkanSupport.$${QMAKE_EXTENSION_STATICLIB}
+ INCLUDEPATH += $$QT_SOURCE_TREE/include/QtVulkanSupport/$${QT_VERSION}
+}
include(windows.pri)
--
2.26.0

View File

@ -1,37 +0,0 @@
From 3888a84625dae5abbf387498fe5f39166eab17e4 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Fri, 25 Aug 2017 17:07:17 +0200
Subject: [PATCH 30/31] Fix linking against static plugins with qmake
Required because qtConfig(static) does not work
with 'Merge shared and static library trees'
approach
---
mkspecs/features/qt.prf | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index d6299d8eed..5311748953 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -69,7 +69,7 @@ all_qt_module_deps = $$resolve_depends(qt_module_deps, "QT.", ".depends" ".run_d
QTPLUGIN = $$unique($$list($$lower($$QTPLUGIN)))
-import_plugins:qtConfig(static) {
+import_plugins:static {
manualplugs = $$QTPLUGIN # User may specify plugins. Mostly legacy.
autoplugs = # Auto-added plugins.
# First round: explicitly specified modules.
@@ -139,7 +139,7 @@ import_plugins:qtConfig(static) {
}
# Only link against plugins in static builds
-!isEmpty(QTPLUGIN):qtConfig(static) {
+!isEmpty(QTPLUGIN):static {
for (plug, QTPLUGIN) {
# Check if the plugin is known to Qt. We can use this to determine
# the plugin path. Unknown plugins must rely on the default link path.
--
2.26.0

View File

@ -1,37 +0,0 @@
From 68a2b716616ba060e856840cebb5601c61d60773 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Mon, 24 Jun 2019 13:51:02 +0200
Subject: [PATCH 31/31] Prevent 'Cannot find feature windows_vulkan_sdk'
See https://bugreports.qt.io/browse/QTBUG-76660
---
mkspecs/common/windows-vulkan.conf | 2 +-
mkspecs/features/qmake_use.prf | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/mkspecs/common/windows-vulkan.conf b/mkspecs/common/windows-vulkan.conf
index da061422dc..a5a8ec68d2 100644
--- a/mkspecs/common/windows-vulkan.conf
+++ b/mkspecs/common/windows-vulkan.conf
@@ -1,2 +1,2 @@
-load(windows_vulkan_sdk)
+load(win32/windows_vulkan_sdk)
QMAKE_LIBS_VULKAN =
diff --git a/mkspecs/features/qmake_use.prf b/mkspecs/features/qmake_use.prf
index 8475e4111a..c0eb8faa17 100644
--- a/mkspecs/features/qmake_use.prf
+++ b/mkspecs/features/qmake_use.prf
@@ -15,7 +15,9 @@ for(ever) {
error("Library '$$lower($$replace(nu, _, -))' is not defined.")
DEFINES += $$eval(QMAKE_DEFINES_$${nu})
- INCLUDEPATH += $$eval(QMAKE_INCDIR_$${nu})
+ incdir = $$eval(QMAKE_INCDIR_$${nu})
+ !contains(QMAKE_DEFAULT_INCDIRS, $$incdir): \
+ INCLUDEPATH += $$incdir
}
LD_USES = $$resolve_depends(LD_USES, QMAKE_DEPENDS_, _LD)
for (nu, LD_USES) {
--
2.26.0

View File

@ -1,420 +0,0 @@
# 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.2
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=('48b9e79220941665a9dd827548c6428f7aa3052ccba8f4f7e039a94aa1d2b28a'
'c758e9ec290052a3ea029f40e5d5cfaadd2135ad7841366393449a4c71d84a88'
'a0280ed9dd31b2cdffa1c7ae25f9a6cb3a4164c76b7fa07c4e2eaa8cc01e6762'
'9a3c591e2645997a94d30687adfc08f1ea7f64597fef78c777ed7137071de02f'
'1d7fe2ef6be292e9ec84f313e4ba543f1b368a1ee0915f858d54615be93cf794'
'3099b7210a873ee12374d452fb98204d046a2d5c6b1a330d32d45ae59c95cd86'
'c2a8f4a7536ad0293bdab882d01e0055bc7d4a3e97794f7c304d01d1daa24bf7'
'3b7e90637b3a0671fac0f8607d613bf0f3f9a73cc62e43848049125c7a925a52'
'2e08efe5160c91899ac549303f888c5872e1d198068c5a00c3a34d7040f5410f'
'82764b7047b65a262f7c49305dee6579171a5e179fa85f8801d121e03937576e'
'27dd7df0721e8d4d3f4f4c30c8e9ca8793f50a04f983b3489ff1227aae996f43'
'4f0754277a14bdd8682b5d3701871f8901d2dd9f00ef8318bf6d62e9d4a26171'
'd4b3fb742c973119d1c98a34063fcc29861fa6325481a8baf5dfac13c32db597'
'd70ce95ddaa3dac7bdf273c3a8926df6b41771d75f17c68e205a1b9bb80a77e1'
'0366353ce1e4da4e800be55b457d649b0c3e6ba83a2d53dc8c6e3e08dd82637f'
'4632228567fd25ffb75de6750120c0ceea1d2c4ce2e91ef214a39b54ee7b56fc'
'ab79617e34dbc8bcefb63f0ff59a3efc5da2d313284aa3e690f8c6025a9cb090'
'b4f68710feda5c11dc2c3b4fdc755bb2186599046a8443c6f61ff9d369357193'
'a4656c1d3ec12ad50b2c92382775619d435e49a392bb08be5cbc8a654248f3dd'
'36e3520481ef8d58e7595195c0eb230df80034590c27622836a38199abf7721c'
'640ac515c0453def45cdaf2d5813d1ae95ce953014aeacb78cb1747fa2c0da3e'
'612b95a477b9956e61ac1557c0e885a7dd2ae0aa56ef69e29116cafcbc7b0d50'
'2bfb7e8400b0e14b5e8c14413d67b9fa437fe920fa9ffc458f769ea22b2bed29'
'26473b4a55ce4b764354ff54b40a6dcc6d93aea41b7175afeb1a030cb118f3a8'
'98058d1696ff05af14d10017062d697839736cf8cfef94ac77d6cefb6c46f311'
'30d2cf6c309c4922ebc4a5822aab76161950f7036666dc18489da22315ef214d'
'692c3e1679aa82c6aa395d75a06f02f0d1a0b05230197ef19fe4ef7c7b3b888e'
'c285e9900a63d67a01accd6d7a798c5f2476e90f3d8ea8ffb0f272d90d942141'
'fbd28eeed43e451240c52582f675e5f5ba069450ee20488bf993b33e76e8275c'
'1709f452c4986f6b7366412bc906b52e4a01d412e20d3fda561b7fa090ed8890'
'245af9755b5637200ea1d678e0ac1a493ed0fbcb9c25dc2a79c0a5e3c007a19a'
'810255e443f940b57e90f4934e4317c050d3edf3593cd0a30c1e2b5a35cf7f68')
_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/StaticQt5OpenGLExtensions*" \
"${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
}

View File

@ -1,91 +0,0 @@
# README for Qt 5 mingw-w64 packages
## Development, building, issues
* All PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where you also find the URL of a binary repository.
* Issues are tracks there as well.
* All patches are managed at https://github.com/Martchus/qtbase, https://github.com/Martchus/qttools, ...
### Build order
Qt packages can be built in the following order (for example):
```
qt5-base qt5-base-static qt5-svg qt5-declarative qt5-tools qt5-xmlpatterns qt5-script qt5-imageformats qt5-location qt5-multimedia qt5-sensors qt5-webchannel qt5-3d qt5-quickcontrols qt5-quickcontrols2 qt5-translations qt5-websockets qt5-winextras qt5-serialport qt5-canvas3d qt5-connectivity qt5-charts qt5-graphicaleffects qt5-gamepad qt5-scxml qt5-datavis3d qt5-virtualkeyboard qt5-activeqt qt5-speech qt5-remoteobjects qt5-networkauth qt5-webkit
```
### Executables
By default, executables will be present in the package because I find them useful for testing. To remove executables,
set NO_EXECUTABLES (or NO_STATIC_EXECUTABLES to remove statically linked executables only) when building the package.
If Qt modules containing tools are built as static and as dynamic library only the dynamically linked tools will be present
in the package.
## Variants
There are different variants of the package which can be selected by simply adjusting pkgname:
| Package name | Customization |
| ------------------------------------------------------- | -----------------------------------------------------------------------|
| mingw-w64-qt5-base-dynamic, mingw-w64-qt5-base-dynamic | allows choosing between ANGLE and native OpenGL dynamically at runtime |
| mingw-w64-qt5-base-opengl | using native OpenGL |
| mingw-w64-qt5-base-angle | using ANGLE rather than native OpenGL |
| mingw-w64-qt5-base-noopenql | no OpenGL support |
* The variants are conflicting (and hence can not be installed at the same time).
* It is also possible to use the software rasterizer provided by mingw-w64-mesa as a drop-in replacement for the regular OpenGL libraries.
* See also: http://doc.qt.io/qt-5/windows-requirements.html#dynamically-loading-graphics-drivers
## Static libraries
The variants listed above only contain dynamic libraries. For building static libraries
just append `-static` to the package name, eg. `mingw-w64-qt5-base-static` or `mingw-w64-qt5-base-angle-static`.
The static variants rely on the corresponding dynamic variant for headers and tools.
I only tested the static variant using native OpenGL so far (`mingw-w64-qt5-base-static`).
Note that ANGLE will still be loaded as dynamic library in `mingw-w64-qt5-base-dynamic-static`.
Further Qt modules (those not found in the base repository) include by default static and dynamic libraries; if only one
version is requried, just set `NO_STATIC_LIBS` or `NO_SHARED_LIBS` when building the package, eg. by adding `NO_STATIC_LIBS=1`
to `/etc/makepkg.conf`.
### Using static libraries
By default, CMake and qmake will link against the dynamic Qt libraries.
#### CMake
To use the static Qt libraries with CMake prepend the Qt module name with Static, eg.:
```
find_package(Qt5Core) becomes find_package(StaticQt5Core)
```
To use a static module, add the corresponding imported target, eg.:
```
target_link_libraries(target ... StaticQt5::Core)
```
This approach allows installing dynamic and static Qt in the same prefix
and using both variants in the same CMake project.
To use a static plugin, add the corresponding imported target, eg.:
```
target_link_libraries(target ... StaticQt5::QWindowsIntegrationPlugin)
```
Automatically importing static plugins is currently not possible, though.
Hence it is required to use Q_IMPORT_PLUGIN, eg.:
```
#include<QtPlugin>
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
```
It is also possible to use static Qt libraries with CMake by setting the
variable `USE_STATIC_QT_BY_DEFAULT`: `set(USE_STATIC_QT_BY_DEFAULT ON)`
In this case the regular imported targets (eg. `Qt5::Core`) will be static.
This approach does *not* allow to use dynamic and static Qt in the same
CMake project.
#### qmake
To use the static Qt libraries with qmake add 'static' to the project config (either inside the *.pro file or as qmake argument):
```
CONFIG+=static
```
Currently qmake is messing with linker flags for cyclic dependencies and static MariaDB is unavailable due to clashing symbols.
To workaround these issues, use the following arguments:
```
CONFIG+=no_smart_library_merge QTPLUGIN.sqldrivers=qsqlite QTPLUGIN.sqldrivers+=qsqlpsql QTPLUGIN.sqldrivers+=qsqlodbc
```

View File

@ -1 +0,0 @@
48b9e79220941665a9dd827548c6428f7aa3052ccba8f4f7e039a94aa1d2b28a

View File

@ -11,49 +11,26 @@
# 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' ]]
}
_qt_module=qtbase
pkgname=mingw-w64-qt5-base-static
pkgver=5.14.2
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')
pkgdesc='A cross-platform application and UI framework, native OpenGL backend (mingw-w64)'
arch=('any')
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')
depends+=(${pkgname%-static}) # the static version relies on the shared version for build tools and headers
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
groups=('mingw-w64-qt5')
options=('!strip' '!buildflags' 'staticlibs' '!emptydirs')
_pkgfqn="qtbase-everywhere-src-${pkgver}"
_pkgfqn="${_qt_module}-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'
@ -121,20 +98,6 @@ sha256sums=('48b9e79220941665a9dd827548c6428f7aa3052ccba8f4f7e039a94aa1d2b28a'
_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}"
@ -224,30 +187,8 @@ build() {
|| 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
msg2 'Using native OpenGL backend'
qt_configure_args+=' -opengl desktop'
# add include directory of MariaDB
qt_configure_args+=" -I/usr/${_arch}/include/mariadb"
@ -257,25 +198,11 @@ build() {
msg2 'Configure and build qmake'
mkdir -p ../build-${_arch} && pushd ../build-${_arch}
if isStatic; then
qt_configure_args+=' -static'
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
# 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"
msg2 'Build qmake and configure' && ../${_pkgfqn}/configure $qt_configure_args
msg2 'Build Qt libraries' && make
@ -297,91 +224,72 @@ package() {
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, ...).
# The static release contains only the static libs itself but relies on the
# shared release for the bootstrap 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/StaticQt5OpenGLExtensions*" \
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5WindowsUIAutomationSupport" \
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5VulkanSupport" \
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5Bootstrap" \
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5BootstrapDBus"
# 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/StaticQt5OpenGLExtensions*" \
"${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"
# 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
# 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}"
# 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"
# 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}
# 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
# 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"
# 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' {} \;
@ -403,16 +311,8 @@ Plugins = /usr/${_arch}/lib/qt/plugins" > "${pkgdir}/usr/${_arch}/bin/qt.conf"
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 '*.exe' -delete
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 {} \;

View File

@ -0,0 +1 @@
% layout 'mingw-w64-qt5-base';

View File

@ -11,49 +11,25 @@
# 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' ]]
}
_qt_module=qtbase
pkgname=mingw-w64-qt5-base
pkgver=5.14.2
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')
pkgdesc='A cross-platform application and UI framework, native OpenGL backend (mingw-w64)'
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
groups=('mingw-w64-qt5')
options=('!strip' '!buildflags' 'staticlibs' '!emptydirs')
_pkgfqn="qtbase-everywhere-src-${pkgver}"
_pkgfqn="${_qt_module}-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'
@ -121,20 +97,6 @@ sha256sums=('48b9e79220941665a9dd827548c6428f7aa3052ccba8f4f7e039a94aa1d2b28a'
_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}"
@ -224,30 +186,8 @@ build() {
|| 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
msg2 'Using native OpenGL backend'
qt_configure_args+=' -opengl desktop'
# add include directory of MariaDB
qt_configure_args+=" -I/usr/${_arch}/include/mariadb"
@ -257,25 +197,16 @@ build() {
msg2 'Configure and build qmake'
mkdir -p ../build-${_arch} && pushd ../build-${_arch}
if isStatic; then
qt_configure_args+=' -static'
qt_configure_args+=' -shared'
# 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"
# configure shared version to load OpenSSL dynamically
qt_configure_args+=' -openssl-runtime'
else
qt_configure_args+=' -shared'
qt_configure_args+=' -device-option CROSS_COMPILE_CUSTOM_CONFIG=actually_a_shared_build'
# 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
# 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"
msg2 'Build qmake and configure' && ../${_pkgfqn}/configure $qt_configure_args
msg2 'Build Qt libraries' && make
@ -297,91 +228,21 @@ package() {
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, ...).
# 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 {} \;
# 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/StaticQt5OpenGLExtensions*" \
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5WindowsUIAutomationSupport" \
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5VulkanSupport" \
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5Bootstrap" \
"${pkgdir}/usr/${_arch}/lib/cmake/StaticQt5BootstrapDBus"
# install missing libQt5BootstrapDBus.a manually
cp --target-directory "${pkgdir}/usr/${_arch}/lib" "$srcdir/build-${_arch}/lib/libQt5BootstrapDBus.a"
# 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 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 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]
# 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' {} \;
@ -403,16 +264,14 @@ Plugins = /usr/${_arch}/lib/qt/plugins" > "${pkgdir}/usr/${_arch}/bin/qt.conf"
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
strip --strip-all "${pkgdir}/usr/${_arch}/lib/qt/bin/"*[!.pl]
strip --strip-debug "${pkgdir}/usr/${_arch}/lib/libQt5Bootstrap"*.a
if [[ $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 {} \;

View File

@ -0,0 +1 @@
% layout 'mingw-w64-qt5-base';