summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO153
-rw-r--r--0001-Fix-qwindows-plugin-linking-with-system-freetype.patch22
-rw-r--r--0002-Fix-oci-config-test-on-windows.patch21
-rw-r--r--0003-Don-t-set-QT_NO_SYSTEMSEMAPHORE-for-Windows.patch25
-rw-r--r--0004-Fix-building-mysql-driver-under-mingw.patch25
-rw-r--r--0005-Support-ANGLE-switches-via-configure-shell-script.patch (renamed from qt5-add-angle-and-dynamic-support.patch)37
-rw-r--r--0006-Use-external-ANGLE-library.patch98
-rw-r--r--0007-Fix-too-many-sections-assemler-error-in-OpenGL-facto.patch27
-rw-r--r--0008-Make-sure-.pc-files-are-installed-correctly.patch (renamed from qt5-workaround-pkgconfig-install-issue.patch)40
-rw-r--r--0009-Don-t-add-resource-files-to-LIBS-parameter.patch28
-rw-r--r--0010-Prevent-debug-library-names-in-pkg-config-files.patch33
-rw-r--r--0011-Fix-linking-against-static-D-Bus.patch43
-rw-r--r--0012-Adjust-win32-g-mkspecs-profile.patch (renamed from qt5-use-win32-g++-mkspecs-profile.patch)39
-rw-r--r--0013-Fix-linking-against-external-harfbuzz.patch36
-rw-r--r--0014-Fix-linking-against-static-pcre.patch27
-rw-r--r--0015-Rename-qtmain-to-qt5main.patch56
-rw-r--r--0016-Build-dynamic-host-libraries.patch38
-rw-r--r--0017-Enable-rpath-for-build-tools.patch35
-rw-r--r--0018-Use-system-zlib-for-build-tools.patch25
-rw-r--r--0019-Disable-determing-default-include-and-lib-dirs-at-qm.patch26
-rw-r--r--0020-Use-.dll.a-as-import-lib-extension.patch (renamed from qt5-fix-implib-ext.patch)44
-rw-r--r--0021-Merge-shared-and-static-library-trees.patch122
-rw-r--r--0022-Allow-usage-of-static-version-with-CMake.patch972
-rw-r--r--0023-Use-correct-pkg-config-static-flag.patch28
-rw-r--r--0024-Use-shared-static-version-of-MariaDB.patch25
-rw-r--r--0025-Use-shared-static-version-of-PostgreSQL.patch25
-rw-r--r--0026-Fix-qt5_wrap_ui-macro.patch28
-rw-r--r--PKGBUILD301
-rw-r--r--qt5-add-angle-support.patch46
-rw-r--r--qt5-allow-usage-of-static-qt-with-cmake.patch453
-rw-r--r--qt5-customize-extensions-for-static-build.patch15
-rw-r--r--qt5-disable-default-lib-include-detection.patch11
-rw-r--r--qt5-dont-add-resource-files-to-qmake-libs.patch11
-rw-r--r--qt5-dont-build-host-libs-static.patch19
-rw-r--r--qt5-enable-rpath-for-host-tools.patch18
-rw-r--r--qt5-fix-linking-against-static-dbus.patch26
-rw-r--r--qt5-fix-linking-against-static-pcre.patch13
-rw-r--r--qt5-fix-opengl-to-many-sections.patch10
-rw-r--r--qt5-fix-static-psql-mysql.patch15
-rw-r--r--qt5-fixes-from-mxe.patch91
-rw-r--r--qt5-merge-static-and-shared-library-trees.patch50
-rw-r--r--qt5-pkgconfig-static-library-name-workaround.patch19
-rw-r--r--qt5-prevent-debug-library-names-in-pkgconfig-files.patch12
-rw-r--r--qt5-rename-qtmain-to-qt5main.patch35
-rw-r--r--qt5-use-correct-pkg-config-static-flags.patch14
-rw-r--r--qt5-use-external-angle-library.patch77
-rw-r--r--qt5-use-pkgconfig-for-harfbuzz.patch31
-rw-r--r--qt5-use-system-zlib-in-host-libs.patch11
-rw-r--r--qt5-win32-static-cmake-link-ws2_32-and--static.patch15
49 files changed, 2114 insertions, 1257 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9b5f21063dc..79ac231be15 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
# Generated by mksrcinfo v8
-# Sun Sep 18 17:29:02 UTC 2016
+# Thu Dec 8 20:20:14 UTC 2016
pkgbase = mingw-w64-qt5-base-angle
pkgdesc = A cross-platform application and UI framework (mingw-w64)
pkgver = 5.7.0
- pkgrel = 8
+ pkgrel = 10
url = https://www.qt.io/
arch = i686
arch = x86_64
@@ -29,7 +29,6 @@ pkgbase = mingw-w64-qt5-base-angle
depends = mingw-w64-angleproject
optdepends = mingw-w64-postgresql: PostgreSQL support
optdepends = mingw-w64-mariadb-connector-c: MySQL support
- optdepends = qtchooser
provides = mingw-w64-qt5-base
conflicts = mingw-w64-qt5-base
conflicts = mingw-w64-qt5-base-angle
@@ -41,53 +40,109 @@ pkgbase = mingw-w64-qt5-base-angle
options = staticlibs
options = !emptydirs
source = https://download.qt.io/official_releases/qt/5.7/5.7.0/submodules/qtbase-opensource-src-5.7.0.tar.xz
- source = qt5-add-angle-and-dynamic-support.patch
- source = qt5-use-external-angle-library.patch
- source = qt5-workaround-pkgconfig-install-issue.patch
- source = qt5-merge-static-and-shared-library-trees.patch
- source = qt5-fix-linking-against-static-pcre.patch
- source = qt5-rename-qtmain-to-qt5main.patch
- source = qt5-dont-build-host-libs-static.patch
- source = qt5-enable-rpath-for-host-tools.patch
- source = qt5-dont-add-resource-files-to-qmake-libs.patch
- source = qt5-prevent-debug-library-names-in-pkgconfig-files.patch
- source = qt5-fix-linking-against-static-dbus.patch
- source = qt5-use-win32-g++-mkspecs-profile.patch
- source = qt5-use-system-zlib-in-host-libs.patch
- source = qt5-fix-opengl-to-many-sections.patch
- source = qt5-fix-static-psql-mysql.patch
- source = qt5-fixes-from-mxe.patch
- source = qt5-fix-implib-ext.patch
- source = qt5-disable-default-lib-include-detection.patch
- source = qt5-win32-static-cmake-link-ws2_32-and--static.patch
- source = qt5-allow-usage-of-static-qt-with-cmake.patch
- source = qt5-customize-extensions-for-static-build.patch
- source = qt5-use-correct-pkg-config-static-flags.patch
- source = qt5-use-pkgconfig-for-harfbuzz.patch
+ source = 0001-Fix-qwindows-plugin-linking-with-system-freetype.patch
+ source = 0002-Fix-oci-config-test-on-windows.patch
+ source = 0003-Don-t-set-QT_NO_SYSTEMSEMAPHORE-for-Windows.patch
+ source = 0004-Fix-building-mysql-driver-under-mingw.patch
+ source = 0005-Support-ANGLE-switches-via-configure-shell-script.patch
+ source = 0006-Use-external-ANGLE-library.patch
+ source = 0007-Fix-too-many-sections-assemler-error-in-OpenGL-facto.patch
+ source = 0008-Make-sure-.pc-files-are-installed-correctly.patch
+ source = 0009-Don-t-add-resource-files-to-LIBS-parameter.patch
+ source = 0010-Prevent-debug-library-names-in-pkg-config-files.patch
+ source = 0011-Fix-linking-against-static-D-Bus.patch
+ source = 0012-Adjust-win32-g-mkspecs-profile.patch
+ source = 0013-Fix-linking-against-external-harfbuzz.patch
+ source = 0014-Fix-linking-against-static-pcre.patch
+ source = 0015-Rename-qtmain-to-qt5main.patch
+ source = 0016-Build-dynamic-host-libraries.patch
+ source = 0017-Enable-rpath-for-build-tools.patch
+ source = 0018-Use-system-zlib-for-build-tools.patch
+ source = 0019-Disable-determing-default-include-and-lib-dirs-at-qm.patch
+ source = 0020-Use-.dll.a-as-import-lib-extension.patch
+ source = 0021-Merge-shared-and-static-library-trees.patch
+ source = 0022-Allow-usage-of-static-version-with-CMake.patch
+ source = 0023-Use-correct-pkg-config-static-flag.patch
+ source = 0024-Use-shared-static-version-of-MariaDB.patch
+ source = 0025-Use-shared-static-version-of-PostgreSQL.patch
+ source = 0001-Fix-qwindows-plugin-linking-with-system-freetype.patch
+ source = 0002-Fix-oci-config-test-on-windows.patch
+ source = 0003-Don-t-set-QT_NO_SYSTEMSEMAPHORE-for-Windows.patch
+ source = 0004-Fix-building-mysql-driver-under-mingw.patch
+ source = 0005-Support-ANGLE-switches-via-configure-shell-script.patch
+ source = 0006-Use-external-ANGLE-library.patch
+ source = 0007-Fix-too-many-sections-assemler-error-in-OpenGL-facto.patch
+ source = 0008-Make-sure-.pc-files-are-installed-correctly.patch
+ source = 0009-Don-t-add-resource-files-to-LIBS-parameter.patch
+ source = 0010-Prevent-debug-library-names-in-pkg-config-files.patch
+ source = 0011-Fix-linking-against-static-D-Bus.patch
+ source = 0012-Adjust-win32-g-mkspecs-profile.patch
+ source = 0013-Fix-linking-against-external-harfbuzz.patch
+ source = 0014-Fix-linking-against-static-pcre.patch
+ source = 0015-Rename-qtmain-to-qt5main.patch
+ source = 0016-Build-dynamic-host-libraries.patch
+ source = 0017-Enable-rpath-for-build-tools.patch
+ source = 0018-Use-system-zlib-for-build-tools.patch
+ source = 0019-Disable-determing-default-include-and-lib-dirs-at-qm.patch
+ source = 0020-Use-.dll.a-as-import-lib-extension.patch
+ source = 0021-Merge-shared-and-static-library-trees.patch
+ source = 0022-Allow-usage-of-static-version-with-CMake.patch
+ source = 0023-Use-correct-pkg-config-static-flag.patch
+ source = 0024-Use-shared-static-version-of-MariaDB.patch
+ source = 0025-Use-shared-static-version-of-PostgreSQL.patch
+ source = 0026-Fix-qt5_wrap_ui-macro.patch
md5sums = 184f9460b40752d71b15b827260580c2
- md5sums = 55a11d8ea5db9ca0cced06b06655b417
- md5sums = 1f7aea5e8bed840b3efc9172081ddb45
- md5sums = bc99c4cc6998295d76f37ed681c20d47
- md5sums = e2ffff39673b37c4d9974e92fcf7213c
- md5sums = 4fe6523dd1c34398df3aa5a8763530cc
- md5sums = f32a768e1acb9785c79c8e93aa266db2
- md5sums = 3bd322551924543553a2bf81b4419a09
- md5sums = 30fa9ddf8d842b1392e8d63868940657
- md5sums = 99bb9f51ec684803768f36e407baf486
- md5sums = 6a6bc88f35ac8080869de39bc128ce5b
- md5sums = 261d9071a6af3f1d5c3f955da3781573
- md5sums = 0524dc5427a6c5338ebd45ab08c6ce80
- md5sums = c15d9f480d0248648fa52aeacb46e3c7
- md5sums = 612a4dfb9f1a3898a1920c28bb999159
- md5sums = d0eb81aef1a21c65813fe4ddabbc4206
- md5sums = 1e8c03872062fe8499ed7786475ed4e0
- md5sums = 83139869355c2d46921adb25e47cf0fa
- md5sums = b9565219e9252a17fc1b8fb9ee30662c
- md5sums = 20de722808e8a3fb684b0212bef8de46
- md5sums = a60bd6bb231acfe9132f391a26b37e71
- md5sums = 41ec67d9e5e70e0d6d93b42aebd0e12a
- md5sums = 61c0f9d0095c5a6dec8d14e9ec35a608
- md5sums = 16a7d505b503bb1087fc00fad819f64b
+ md5sums = bd3a336834d1dc22bacf38688b30fab0
+ md5sums = 390cd5b394fe2a84054c4c34f9f016d6
+ md5sums = ec43bd375737a578bf7494e14e5726e9
+ md5sums = 358dd9465914f52d8988228c656c508a
+ md5sums = 455134d76b818a994084dd45b11ce51e
+ md5sums = 84fd7ed12061aba4bf8648a5cbd72095
+ md5sums = dcd5889407bc6fd8637bbb04a033ae6a
+ md5sums = 9de955e67e3f0f35d955021ced9dd544
+ md5sums = aa9e36e721864e24c5c632b2fa463dac
+ md5sums = 4642ae1ab8ec5c864b1fa2cc8bf43a8a
+ md5sums = a01ce4e39f309ffc10857c7c1e4a2ae8
+ md5sums = a3fa433801b8c11f83e069fe9c80ea8b
+ md5sums = 64c41f016b9583277ec8403824ff81b7
+ md5sums = b13a0b9c610ff071eac36331c938aba1
+ md5sums = b0da19aa67c3305bd611c9f104efaa74
+ md5sums = 423142ec2a76ee031725587f9c299420
+ md5sums = f5efb8153fa3d0b0fd71fe8604c7d626
+ md5sums = 670fbd9766654969db82363378608c0a
+ md5sums = 424b23ae0de84f4027e375223d945fe4
+ md5sums = 77a50b5fe0cc2f431f0124db402056c1
+ md5sums = 2491ad84a2065cd1477f1a6b34c2a46c
+ md5sums = c646461b4341ed83b1a83426fc627a70
+ md5sums = 0e4e4f1d9a16eb6038709d82cf31227d
+ md5sums = 88b8eb6d0b7cec85cfbc54f2d6716f2d
+ md5sums = 179ae7c4217e062df0d8bd5171792e11
+ md5sums = bd3a336834d1dc22bacf38688b30fab0
+ md5sums = 390cd5b394fe2a84054c4c34f9f016d6
+ md5sums = ec43bd375737a578bf7494e14e5726e9
+ md5sums = 358dd9465914f52d8988228c656c508a
+ md5sums = 455134d76b818a994084dd45b11ce51e
+ md5sums = 84fd7ed12061aba4bf8648a5cbd72095
+ md5sums = dcd5889407bc6fd8637bbb04a033ae6a
+ md5sums = 9de955e67e3f0f35d955021ced9dd544
+ md5sums = aa9e36e721864e24c5c632b2fa463dac
+ md5sums = 4642ae1ab8ec5c864b1fa2cc8bf43a8a
+ md5sums = a01ce4e39f309ffc10857c7c1e4a2ae8
+ md5sums = a3fa433801b8c11f83e069fe9c80ea8b
+ md5sums = 64c41f016b9583277ec8403824ff81b7
+ md5sums = b13a0b9c610ff071eac36331c938aba1
+ md5sums = b0da19aa67c3305bd611c9f104efaa74
+ md5sums = 423142ec2a76ee031725587f9c299420
+ md5sums = f5efb8153fa3d0b0fd71fe8604c7d626
+ md5sums = 670fbd9766654969db82363378608c0a
+ md5sums = 424b23ae0de84f4027e375223d945fe4
+ md5sums = 77a50b5fe0cc2f431f0124db402056c1
+ md5sums = 2491ad84a2065cd1477f1a6b34c2a46c
+ md5sums = c646461b4341ed83b1a83426fc627a70
+ md5sums = 0e4e4f1d9a16eb6038709d82cf31227d
+ md5sums = 88b8eb6d0b7cec85cfbc54f2d6716f2d
+ md5sums = 179ae7c4217e062df0d8bd5171792e11
+ md5sums = 645037becd8fdd266ac8e7cacdde85ab
pkgname = mingw-w64-qt5-base-angle
diff --git a/0001-Fix-qwindows-plugin-linking-with-system-freetype.patch b/0001-Fix-qwindows-plugin-linking-with-system-freetype.patch
new file mode 100644
index 00000000000..4ada02a10ca
--- /dev/null
+++ b/0001-Fix-qwindows-plugin-linking-with-system-freetype.patch
@@ -0,0 +1,22 @@
+From ce1268a5bce5652761fc2a54e4e361bc003befec Mon Sep 17 00:00:00 2001
+From: Mark Brand <mabrand@mabrand.nl>
+Date: Thu, 6 Aug 2015 23:35:08 +0200
+Subject: [PATCH 01/26] Fix qwindows plugin linking with system-freetype
+
+---
+ src/3rdparty/freetype_dependency.pri | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/3rdparty/freetype_dependency.pri b/src/3rdparty/freetype_dependency.pri
+index 39280de..e152b0d 100644
+--- a/src/3rdparty/freetype_dependency.pri
++++ b/src/3rdparty/freetype_dependency.pri
+@@ -4,4 +4,5 @@ contains(QT_CONFIG, freetype) {
+ } else:contains(QT_CONFIG, system-freetype) {
+ # pull in the proper freetype2 include directory
+ include($$QT_SOURCE_TREE/config.tests/unix/freetype/freetype.pri)
++ win32:shared:LIBS_PRIVATE += -lfreetype
+ }
+--
+2.10.2
+
diff --git a/0002-Fix-oci-config-test-on-windows.patch b/0002-Fix-oci-config-test-on-windows.patch
new file mode 100644
index 00000000000..f3fae17233c
--- /dev/null
+++ b/0002-Fix-oci-config-test-on-windows.patch
@@ -0,0 +1,21 @@
+From 3c7458eaa2d7fb3bb9ca379eec96418e1c6ba482 Mon Sep 17 00:00:00 2001
+From: Mark Brand <mabrand@mabrand.nl>
+Date: Mon, 8 Dec 2014 14:15:12 +0100
+Subject: [PATCH 02/26] Fix oci config test on windows
+
+---
+ config.tests/unix/oci/oci.pro | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/config.tests/unix/oci/oci.pro b/config.tests/unix/oci/oci.pro
+index 3ffda1d..39b6f3759 100644
+--- a/config.tests/unix/oci/oci.pro
++++ b/config.tests/unix/oci/oci.pro
+@@ -1,3 +1,3 @@
+ SOURCES = oci.cpp
+ CONFIG -= qt dylib
+-LIBS += -lclntsh
++!win32:LIBS += -lclntsh
+--
+2.10.2
+
diff --git a/0003-Don-t-set-QT_NO_SYSTEMSEMAPHORE-for-Windows.patch b/0003-Don-t-set-QT_NO_SYSTEMSEMAPHORE-for-Windows.patch
new file mode 100644
index 00000000000..611b83149d4
--- /dev/null
+++ b/0003-Don-t-set-QT_NO_SYSTEMSEMAPHORE-for-Windows.patch
@@ -0,0 +1,25 @@
+From 93f3b6c5d93a539bcebd3087b6209a9dd81104fd Mon Sep 17 00:00:00 2001
+From: Mark Brand <mabrand@mabrand.nl>
+Date: Thu, 6 Aug 2015 13:24:56 +0200
+Subject: [PATCH 03/26] Don't set QT_NO_SYSTEMSEMAPHORE for Windows
+
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index 43b55f0..de2c3ec 100755
+--- a/configure
++++ b/configure
+@@ -4656,7 +4656,7 @@ fi
+ [ "$XPLATFORM_ANDROID" = "yes" ] && QMakeVar add styles "android"
+
+ # check IPC support
+-if ! compileTest unix/ipc_sysv "ipc_sysv" ; then
++if [ "$XPLATFORM_MINGW" = "no" ] && ! compileTest unix/ipc_sysv "ipc_sysv" ; then
+ # SYSV IPC is not supported - check POSIX IPC
+ if compileTest unix/ipc_posix "ipc_posix" ; then
+ QCONFIG_FLAGS="$QCONFIG_FLAGS QT_POSIX_IPC"
+--
+2.10.2
+
diff --git a/0004-Fix-building-mysql-driver-under-mingw.patch b/0004-Fix-building-mysql-driver-under-mingw.patch
new file mode 100644
index 00000000000..2038c4edb75
--- /dev/null
+++ b/0004-Fix-building-mysql-driver-under-mingw.patch
@@ -0,0 +1,25 @@
+From f30b82c0605e3a2c1dfe8f0ac7da11182ebcd19f Mon Sep 17 00:00:00 2001
+From: Mark Brand <mabrand@mabrand.nl>
+Date: Tue, 6 Oct 2015 09:53:20 +0200
+Subject: [PATCH 04/26] Fix building mysql driver under mingw
+
+---
+ src/sql/drivers/mysql/qsql_mysql.pri | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/sql/drivers/mysql/qsql_mysql.pri b/src/sql/drivers/mysql/qsql_mysql.pri
+index 3cfb614..8b7063f 100644
+--- a/src/sql/drivers/mysql/qsql_mysql.pri
++++ b/src/sql/drivers/mysql/qsql_mysql.pri
+@@ -4,7 +4,7 @@ SOURCES += $$PWD/qsql_mysql.cpp
+ QMAKE_CXXFLAGS *= $$QT_CFLAGS_MYSQL
+ LIBS += $$QT_LFLAGS_MYSQL
+
+-unix {
++if (unix|mingw) {
+ isEmpty(QT_LFLAGS_MYSQL) {
+ !contains(LIBS, .*mysqlclient.*):!contains(LIBS, .*mysqld.*) {
+ use_libmysqlclient_r:LIBS += -lmysqlclient_r
+--
+2.10.2
+
diff --git a/qt5-add-angle-and-dynamic-support.patch b/0005-Support-ANGLE-switches-via-configure-shell-script.patch
index f9b88685a00..558fa825bc4 100644
--- a/qt5-add-angle-and-dynamic-support.patch
+++ b/0005-Support-ANGLE-switches-via-configure-shell-script.patch
@@ -1,6 +1,20 @@
---- configure.orig 2016-06-10 08:48:56.000000000 +0200
-+++ configure 2016-09-04 20:38:55.345362982 +0200
-@@ -1287,6 +1287,7 @@
+From 443ebf3f1644a5111fae06cfa248c641d96e1ffb Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 13:36:53 +0200
+Subject: [PATCH 05/26] Support ANGLE switches via configure shell script
+
+Required when cross-compiling with mingw-w64 because in
+this case executing configure.bat is not appropriate
+---
+ configure | 26 ++++++++++++++++++++++++--
+ src/gui/opengl/qopenglfunctions.h | 2 --
+ 2 files changed, 24 insertions(+), 4 deletions(-)
+
+diff --git a/configure b/configure
+index de2c3ec..cf879ff 100755
+--- a/configure
++++ b/configure
+@@ -1287,6 +1287,7 @@ while [ "$#" -gt 0 ]; do
;;
opengl)
if [ "$VAL" = "auto" ] || [ "$VAL" = "desktop" ] ||
@@ -8,7 +22,7 @@
[ "$VAL" = "yes" ] || [ "$VAL" = "no" ] ||
[ "$VAL" = "es2" ]; then
CFG_OPENGL="$VAL"
-@@ -5312,7 +5313,7 @@
+@@ -5312,7 +5313,7 @@ if [ "$XPLATFORM_MINGW" = "yes" ]; then
fi
if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
if compileTest x11/opengl "OpenGL"; then
@@ -17,7 +31,7 @@
elif compileTest unix/opengles2 "OpenGL ES 2.0"; then
CFG_OPENGL=es2
else
-@@ -5348,6 +5349,17 @@
+@@ -5348,6 +5349,17 @@ if [ "$XPLATFORM_MINGW" = "yes" ]; then
echo " ${XQMAKESPEC}."
exit 1
fi
@@ -35,7 +49,7 @@
elif [ "$CFG_OPENGL" = "desktop" ]; then
# Desktop OpenGL support
compileTest x11/opengl "OpenGL"
-@@ -6423,6 +6435,16 @@
+@@ -6423,6 +6435,16 @@ if [ "$CFG_OPENGL" = "es2" ]; then
QT_CONFIG="$QT_CONFIG opengles2"
fi
@@ -52,7 +66,7 @@
if [ "$CFG_SHARED" = "yes" ]; then
QT_CONFIG="$QT_CONFIG shared"
QTCONFIG_CONFIG="$QTCONFIG_CONFIG shared"
-@@ -7474,7 +7496,7 @@
+@@ -7474,7 +7496,7 @@ report_support " OpenSSL .............." "$CFG_OPENSSL" yes "loading librarie
report_support " NIS ...................." "$CFG_NIS"
report_support " OpenGL / OpenVG:"
report_support " EGL .................." "$CFG_EGL"
@@ -61,8 +75,10 @@
report_support " OpenVG ..............." "$CFG_OPENVG-$CFG_OPENVG_SHIVA" yes-yes "ShivaVG" yes-no "native"
report_support " PCRE ..................." "$CFG_PCRE" yes "system library" qt "bundled copy"
if [ -n "$PKG_CONFIG" ]; then
---- src/gui/opengl/qopenglfunctions.h.orig 2016-06-10 08:48:56.000000000 +0200
-+++ src/gui/opengl/qopenglfunctions.h 2016-09-04 20:36:07.801522904 +0200
+diff --git a/src/gui/opengl/qopenglfunctions.h b/src/gui/opengl/qopenglfunctions.h
+index f6cd0e5..17214a0 100644
+--- a/src/gui/opengl/qopenglfunctions.h
++++ b/src/gui/opengl/qopenglfunctions.h
@@ -56,9 +56,7 @@
//#define Q_ENABLE_OPENGL_FUNCTIONS_DEBUG
@@ -73,3 +89,6 @@
#ifdef Q_ENABLE_OPENGL_FUNCTIONS_DEBUG
#include <stdio.h>
+--
+2.10.2
+
diff --git a/0006-Use-external-ANGLE-library.patch b/0006-Use-external-ANGLE-library.patch
new file mode 100644
index 00000000000..68744f2fc5c
--- /dev/null
+++ b/0006-Use-external-ANGLE-library.patch
@@ -0,0 +1,98 @@
+From 6d05281c9dbdcbc60ecbcf596db1c06a86f4d19d Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 13:41:38 +0200
+Subject: [PATCH 06/26] Use external ANGLE library
+
+---
+ src/gui/Qt5GuiConfigExtras.cmake.in | 4 ++--
+ src/gui/gui.pro | 9 ++++-----
+ src/opengl/opengl.pro | 1 +
+ src/plugins/platforms/windows/windows.pri | 1 +
+ src/src.pro | 4 ----
+ 5 files changed, 8 insertions(+), 11 deletions(-)
+
+diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
+index 07869ef..2e32911 100644
+--- a/src/gui/Qt5GuiConfigExtras.cmake.in
++++ b/src/gui/Qt5GuiConfigExtras.cmake.in
+@@ -2,9 +2,9 @@
+ !!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE)
+
+ !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
+-set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR/QtANGLE\")
++set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\")
+ !!ELSE
+-set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR/QtANGLE\")
++set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\")
+ !!ENDIF
+
+ _qt5_Gui_check_file_exists(${Qt5Gui_EGL_INCLUDE_DIRS})
+diff --git a/src/gui/gui.pro b/src/gui/gui.pro
+index 462f133..db30dd3 100644
+--- a/src/gui/gui.pro
++++ b/src/gui/gui.pro
+@@ -17,11 +17,6 @@ MODULE_PLUGIN_TYPES = \
+ imageformats \
+ egldeviceintegrations
+
+-# This is here only because the platform plugin is no module, obviously.
+-win32:contains(QT_CONFIG, angle)|contains(QT_CONFIG, dynamicgl) {
+- MODULE_AUX_INCLUDES = \
+- \$\$QT_MODULE_INCLUDE_BASE/QtANGLE
+-}
+
+ # Code coverage with TestCocoon
+ # The following is required as extra compilers use $$QMAKE_CXX instead of $(CXX).
+@@ -33,6 +28,10 @@ testcocoon {
+
+ osx: LIBS_PRIVATE += -framework AppKit
+
++win32:contains(QT_CONFIG, angle) {
++ LIBS_PRIVATE += -lGLESv2
++}
++
+ CONFIG += simd optimize_full
+
+ include(accessible/accessible.pri)
+diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
+index 2386ef5..fe3b327 100644
+--- a/src/opengl/opengl.pro
++++ b/src/opengl/opengl.pro
+@@ -11,6 +11,7 @@ QMAKE_DOCS = $$PWD/doc/qtopengl.qdocconf
+
+ contains(QT_CONFIG, opengl):CONFIG += opengl
+ contains(QT_CONFIG, opengles2):CONFIG += opengles2
++win32:contains(QT_CONFIG, angle): LIBS_PRIVATE += -lGLESv2
+
+ HEADERS += qgl.h \
+ qgl_p.h \
+diff --git a/src/plugins/platforms/windows/windows.pri b/src/plugins/platforms/windows/windows.pri
+index 48c5359..3498dbe 100644
+--- a/src/plugins/platforms/windows/windows.pri
++++ b/src/plugins/platforms/windows/windows.pri
+@@ -3,6 +3,7 @@ LIBS *= -lole32
+ !wince: LIBS *= -luser32 -lwinspool -limm32 -lwinmm -loleaut32
+
+ contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles2):!contains(QT_CONFIG, dynamicgl): LIBS *= -lopengl32
++contains(QT_CONFIG, angle):LIBS += -lGLESv2 -lEGL
+
+ mingw: LIBS *= -luuid
+ # For the dialog helpers:
+diff --git a/src/src.pro b/src/src.pro
+index 71347dc..921c4d8 100644
+--- a/src/src.pro
++++ b/src/src.pro
+@@ -159,10 +159,6 @@ contains(QT_CONFIG, concurrent):SUBDIRS += src_concurrent
+ SUBDIRS += src_3rdparty_harfbuzzng
+ src_gui.depends += src_3rdparty_harfbuzzng
+ }
+- win32:contains(QT_CONFIG, angle)|contains(QT_CONFIG, dynamicgl) {
+- SUBDIRS += src_angle
+- src_gui.depends += src_angle
+- }
+ contains(QT_CONFIG, freetype) {
+ SUBDIRS += src_3rdparty_freetype
+ src_platformsupport.depends += src_3rdparty_freetype
+--
+2.10.2
+
diff --git a/0007-Fix-too-many-sections-assemler-error-in-OpenGL-facto.patch b/0007-Fix-too-many-sections-assemler-error-in-OpenGL-facto.patch
new file mode 100644
index 00000000000..2ee0771ba2a
--- /dev/null
+++ b/0007-Fix-too-many-sections-assemler-error-in-OpenGL-facto.patch
@@ -0,0 +1,27 @@
+From 20e2f7b8353a9828ca2dc2d8d0d93357ddfefbc7 Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 13:48:51 +0200
+Subject: [PATCH 07/26] 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 | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/gui/opengl/opengl.pri b/src/gui/opengl/opengl.pri
+index b13f258..8a9093f 100644
+--- a/src/gui/opengl/opengl.pri
++++ b/src/gui/opengl/opengl.pri
+@@ -4,6 +4,7 @@ contains(QT_CONFIG, opengl):CONFIG += opengl
+ contains(QT_CONFIG, opengles2):CONFIG += opengles2
+
+ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
++ mingw:QMAKE_CXXFLAGS+="-Wa,-mbig-obj"
+
+ HEADERS += opengl/qopengl.h \
+ opengl/qopengl_p.h \
+--
+2.10.2
+
diff --git a/qt5-workaround-pkgconfig-install-issue.patch b/0008-Make-sure-.pc-files-are-installed-correctly.patch
index 46e561aac04..ae773eb47c0 100644
--- a/qt5-workaround-pkgconfig-install-issue.patch
+++ b/0008-Make-sure-.pc-files-are-installed-correctly.patch
@@ -1,6 +1,19 @@
---- qmake/generators/makefile.cpp.pkgconfig 2013-01-29 20:03:12.000000000 +0100
-+++ qmake/generators/makefile.cpp 2013-03-26 19:18:07.480722316 +0100
-@@ -3102,7 +3102,7 @@
+From 2f08b378abc94becbecfdf3833084320cbb6a936 Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 13:54:12 +0200
+Subject: [PATCH 08/26] 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 12004c6..a3f71ba 100644
+--- a/qmake/generators/makefile.cpp
++++ b/qmake/generators/makefile.cpp
+@@ -3149,7 +3149,7 @@ MakefileGenerator::openOutput(QFile &file, const QString &build) const
}
QString
@@ -9,7 +22,7 @@
{
QString ret = project->first("QMAKE_PKGCONFIG_FILE").toQString();
if (ret.isEmpty()) {
-@@ -3134,7 +3134,11 @@
+@@ -3174,7 +3174,11 @@ MakefileGenerator::pkgConfigFileName(bool fixify)
if(fixify) {
if(QDir::isRelativePath(ret) && !project->isEmpty("DESTDIR"))
ret.prepend(project->first("DESTDIR").toQString());
@@ -22,9 +35,11 @@
}
return ret;
}
---- qmake/generators/makefile.h.orig 2013-03-26 19:17:37.624199870 +0100
-+++ qmake/generators/makefile.h 2013-03-26 19:17:56.327527157 +0100
-@@ -102,7 +102,7 @@
+diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
+index 41b90eb..cf67b3e 100644
+--- a/qmake/generators/makefile.h
++++ b/qmake/generators/makefile.h
+@@ -87,7 +87,7 @@ protected:
virtual void writeDefaultVariables(QTextStream &t);
QString pkgConfigPrefix() const;
@@ -33,9 +48,11 @@
QString pkgConfigFixPath(QString) const;
void writePkgConfigFile(); // for pkg-config
---- qmake/generators/win32/winmakefile.cpp.orig 2013-03-26 19:05:13.398183953 +0100
-+++ qmake/generators/win32/winmakefile.cpp 2013-03-26 19:15:02.800490466 +0100
-@@ -822,7 +822,7 @@
+diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
+index 0846cb2..543e905 100644
+--- a/qmake/generators/win32/winmakefile.cpp
++++ b/qmake/generators/win32/winmakefile.cpp
+@@ -718,7 +718,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
}
if(!ret.isEmpty())
ret += "\n\t";
@@ -44,3 +61,6 @@
if(!uninst.isEmpty())
uninst.append("\n\t");
uninst.append("-$(DEL_FILE) " + escapeFilePath(dst_pc));
+--
+2.10.2
+
diff --git a/0009-Don-t-add-resource-files-to-LIBS-parameter.patch b/0009-Don-t-add-resource-files-to-LIBS-parameter.patch
new file mode 100644
index 00000000000..3069b8b6c95
--- /dev/null
+++ b/0009-Don-t-add-resource-files-to-LIBS-parameter.patch
@@ -0,0 +1,28 @@
+From bdac1b16ee425b00cc9e55727164a7583fb63948 Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 13:58:28 +0200
+Subject: [PATCH 09/26] 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 382b10c..3caad90 100644
+--- a/qmake/generators/win32/mingw_make.cpp
++++ b/qmake/generators/win32/mingw_make.cpp
+@@ -196,7 +196,7 @@ void MingwMakefileGenerator::init()
+
+ processVars();
+
+- project->values("QMAKE_LIBS") += project->values("RES_FILE");
++ project->values("OBJECTS") += project->values("RES_FILE");
+
+ if (project->isActiveConfig("dll")) {
+ QString destDir = "";
+--
+2.10.2
+
diff --git a/0010-Prevent-debug-library-names-in-pkg-config-files.patch b/0010-Prevent-debug-library-names-in-pkg-config-files.patch
new file mode 100644
index 00000000000..e7b867f008c
--- /dev/null
+++ b/0010-Prevent-debug-library-names-in-pkg-config-files.patch
@@ -0,0 +1,33 @@
+From 24392ab66af0cc0ed385a793921d641ef53d7afb Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 14:01:14 +0200
+Subject: [PATCH 10/26] 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 a3f71ba..b4792fe 100644
+--- a/qmake/generators/makefile.cpp
++++ b/qmake/generators/makefile.cpp
+@@ -3163,6 +3163,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.10.2
+
diff --git a/0011-Fix-linking-against-static-D-Bus.patch b/0011-Fix-linking-against-static-D-Bus.patch
new file mode 100644
index 00000000000..0d07083f23f
--- /dev/null
+++ b/0011-Fix-linking-against-static-D-Bus.patch
@@ -0,0 +1,43 @@
+From f46f51482f05364b021d24352f7618f26d2d3794 Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 14:07:02 +0200
+Subject: [PATCH 11/26] Fix linking against static D-Bus
+
+---
+ config.tests/unix/dbus/dbus.cpp | 4 ++++
+ src/dbus/qdbus_symbols_p.h | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/config.tests/unix/dbus/dbus.cpp b/config.tests/unix/dbus/dbus.cpp
+index 295c904..80d3e9c 100644
+--- a/config.tests/unix/dbus/dbus.cpp
++++ b/config.tests/unix/dbus/dbus.cpp
+@@ -37,6 +37,10 @@
+ **
+ ****************************************************************************/
+
++#ifdef QT_STATIC
++# define DBUS_STATIC_BUILD
++#endif
++
+ #define DBUS_API_SUBJECT_TO_CHANGE
+ #include <dbus/dbus.h>
+
+diff --git a/src/dbus/qdbus_symbols_p.h b/src/dbus/qdbus_symbols_p.h
+index fbeea61..8e73e9e 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.10.2
+
diff --git a/qt5-use-win32-g++-mkspecs-profile.patch b/0012-Adjust-win32-g-mkspecs-profile.patch
index 5fc41308adf..98fa91865a0 100644
--- a/qt5-use-win32-g++-mkspecs-profile.patch
+++ b/0012-Adjust-win32-g-mkspecs-profile.patch
@@ -1,16 +1,30 @@
---- mkspecs/win32-g++/qmake.conf.orig 2016-06-14 16:22:02.779947341 +0200
-+++ mkspecs/win32-g++/qmake.conf 2016-06-14 16:38:56.298752668 +0200
-@@ -25,7 +25,7 @@
+From c92196a9e56f233e4db9256496361a98764d6bcf Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 14:15:08 +0200
+Subject: [PATCH 12/26] Adjust win32-g++ mkspecs profile
+
+- Use default compile flags for mingw-w64 packages
+ under Arch Linux
+- Adjust libraries and tools
+---
+ mkspecs/win32-g++/qmake.conf | 25 +++++++++++++++----------
+ 1 file changed, 15 insertions(+), 10 deletions(-)
+
+diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf
+index c5f6353..db92487 100644
+--- a/mkspecs/win32-g++/qmake.conf
++++ b/mkspecs/win32-g++/qmake.conf
+@@ -26,7 +26,7 @@ QMAKE_LEX = flex
QMAKE_LEXFLAGS =
- QMAKE_YACC = byacc
+ QMAKE_YACC = bison -y
QMAKE_YACCFLAGS = -d
-QMAKE_CFLAGS = -pipe -fno-keep-inline-dllexport
+QMAKE_CFLAGS = -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -fno-keep-inline-dllexport $${CROSS_COMPILE_CFLAGS}
QMAKE_CFLAGS_DEPS = -M
QMAKE_CFLAGS_WARN_ON = -Wall -Wextra
QMAKE_CFLAGS_WARN_OFF = -w
-@@ -67,10 +67,10 @@
-
+@@ -74,10 +74,10 @@ QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+
QMAKE_LINK = $${CROSS_COMPILE}g++
QMAKE_LINK_C = $${CROSS_COMPILE}gcc
-QMAKE_LFLAGS =
@@ -22,15 +36,15 @@
QMAKE_LFLAGS_DEBUG =
QMAKE_LFLAGS_CONSOLE = -Wl,-subsystem,console
QMAKE_LFLAGS_WINDOWS = -Wl,-subsystem,windows
-@@ -95,21 +95,26 @@
+@@ -95,21 +95,26 @@ QMAKE_EXTENSION_STATICLIB = a
QMAKE_LIB_EXTENSIONS = a dll.a
-
+
QMAKE_LIBS =
-QMAKE_LIBS_CORE = -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32
-QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lws2_32 -lole32 -luuid -luser32 -ladvapi32
-QMAKE_LIBS_NETWORK = -lws2_32
+QMAKE_LIBS_CORE = -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 -lz -lpcre16
-+QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lws2_32 -lole32 -luuid -luser32 -ladvapi32 -ljpeg -lpng -lharfbuzz -lglib-2.0 -lintl -lwinmm
++QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lws2_32 -lole32 -luuid -luser32 -ladvapi32 -ljpeg -lpng $$system($${CROSS_COMPILE}pkg-config --static --libs harfbuzz) $$system($${CROSS_COMPILE}pkg-config --static --libs freetype2)
+QMAKE_LIBS_NETWORK = -lws2_32 -lcrypt32 -ldnsapi
QMAKE_LIBS_OPENGL = -lglu32 -lopengl32 -lgdi32 -luser32
-QMAKE_LIBS_OPENGL_ES2 = -l$${LIBEGL_NAME} -l$${LIBGLESV2_NAME} -lgdi32 -luser32
@@ -40,14 +54,14 @@
QMAKE_LIBS_COMPAT = -ladvapi32 -lshell32 -lcomdlg32 -luser32 -lgdi32 -lws2_32
-QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain
+QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqt5main
-
+
-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
@@ -56,3 +70,6 @@
+PKG_CONFIG = $${CROSS_COMPILE}pkg-config
+
load(qt_config)
+--
+2.10.2
+
diff --git a/0013-Fix-linking-against-external-harfbuzz.patch b/0013-Fix-linking-against-external-harfbuzz.patch
new file mode 100644
index 00000000000..789fb3f92db
--- /dev/null
+++ b/0013-Fix-linking-against-external-harfbuzz.patch
@@ -0,0 +1,36 @@
+From 3bbcdf8e7657d5112e3d35e372786949424b5a37 Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 14:22:56 +0200
+Subject: [PATCH 13/26] Fix linking against external harfbuzz
+
+---
+ config.tests/unix/harfbuzz/harfbuzz.pro | 3 ++-
+ src/3rdparty/harfbuzz_dependency.pri | 4 +++-
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/config.tests/unix/harfbuzz/harfbuzz.pro b/config.tests/unix/harfbuzz/harfbuzz.pro
+index 32edd6e..cc40fc1 100644
+--- a/config.tests/unix/harfbuzz/harfbuzz.pro
++++ b/config.tests/unix/harfbuzz/harfbuzz.pro
+@@ -1,3 +1,4 @@
+ SOURCES = harfbuzz.cpp
+ CONFIG -= qt dylib
+-LIBS += -lharfbuzz
++contains(CONFIG, static): LIBS += $$system($$PKG_CONFIG --static --libs harfbuzz)
++else: LIBS += $$system($$PKG_CONFIG --libs harfbuzz)
+diff --git a/src/3rdparty/harfbuzz_dependency.pri b/src/3rdparty/harfbuzz_dependency.pri
+index 7443368..2932f05 100644
+--- a/src/3rdparty/harfbuzz_dependency.pri
++++ b/src/3rdparty/harfbuzz_dependency.pri
+@@ -2,5 +2,7 @@ contains(QT_CONFIG, harfbuzz) {
+ INCLUDEPATH += $$PWD/harfbuzz-ng/include
+ LIBS_PRIVATE += -L$$QT_BUILD_TREE/lib -lqtharfbuzzng$$qtPlatformTargetSuffix()
+ } else:contains(QT_CONFIG, system-harfbuzz) {
+- LIBS_PRIVATE += -lharfbuzz
++ # can't use 'feature' link_pkgconfig here because it would add harfbuzz to LIBS rather than LIBS_PRIVATE
++ contains(QT_CONFIG, static): LIBS_PRIVATE += $$system($$PKG_CONFIG --static --libs harfbuzz)
++ else: LIBS_PRIVATE += $$system($$PKG_CONFIG --libs harfbuzz)
+ }
+--
+2.10.2
+
diff --git a/0014-Fix-linking-against-static-pcre.patch b/0014-Fix-linking-against-static-pcre.patch
new file mode 100644
index 00000000000..1bd0be47dec
--- /dev/null
+++ b/0014-Fix-linking-against-static-pcre.patch
@@ -0,0 +1,27 @@
+From 41f31abf629018e7e937aca6edbec022a01a1522 Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 14:24:01 +0200
+Subject: [PATCH 14/26] Fix linking against static pcre
+
+---
+ src/corelib/tools/qregularexpression.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp
+index e7f86dd..63fc683 100644
+--- a/src/corelib/tools/qregularexpression.cpp
++++ b/src/corelib/tools/qregularexpression.cpp
+@@ -54,6 +54,10 @@
+ #include <QtCore/qatomic.h>
+ #include <QtCore/qdatastream.h>
+
++#ifdef QT_STATIC
++#define PCRE_STATIC
++#endif
++
+ #include <pcre.h>
+
+ QT_BEGIN_NAMESPACE
+--
+2.10.2
+
diff --git a/0015-Rename-qtmain-to-qt5main.patch b/0015-Rename-qtmain-to-qt5main.patch
new file mode 100644
index 00000000000..119cb61a9df
--- /dev/null
+++ b/0015-Rename-qtmain-to-qt5main.patch
@@ -0,0 +1,56 @@
+From bf08fb6aa45fd8492ff17db5c5ea8f2a6b861ad8 Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 14:25:40 +0200
+Subject: [PATCH 15/26] Rename qtmain to qt5main
+
+Prevents conflict with mingw-w64-qt4 package
+---
+ mkspecs/features/create_cmake.prf | 4 ++--
+ mkspecs/features/win32/windows.prf | 2 +-
+ src/winmain/winmain.pro | 2 +-
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
+index 11fb52a..4adacf6 100644
+--- a/mkspecs/features/create_cmake.prf
++++ b/mkspecs/features/create_cmake.prf
+@@ -225,8 +225,8 @@ mac {
+ CMAKE_LIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.dll
+
+ mingw {
+- CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqtmain$${QT_LIBINFIX}d.a
+- CMAKE_WINMAIN_FILE_LOCATION_RELEASE = libqtmain$${QT_LIBINFIX}.a
++ CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqt5main$${QT_LIBINFIX}.a
++ CMAKE_WINMAIN_FILE_LOCATION_RELEASE = libqt5main$${QT_LIBINFIX}.a
+
+ !isEmpty(CMAKE_STATIC_TYPE) {
+ CMAKE_STATIC_WINDOWS_BUILD = "true"
+diff --git a/mkspecs/features/win32/windows.prf b/mkspecs/features/win32/windows.prf
+index 986067f..339ac15 100644
+--- a/mkspecs/features/win32/windows.prf
++++ b/mkspecs/features/win32/windows.prf
+@@ -5,7 +5,7 @@ contains(TEMPLATE, ".*app") {
+ mingw:DEFINES += QT_NEEDS_QMAIN
+
+ qt:for(entryLib, $$list($$unique(QMAKE_LIBS_QT_ENTRY))) {
+- isEqual(entryLib, -lqtmain) {
++ isEqual(entryLib, -lqt5main): {
+ !contains(QMAKE_DEFAULT_LIBDIRS, $$QT.core.libs): \
+ QMAKE_LIBS += -L$$QT.core.libs
+ CONFIG(debug, debug|release): QMAKE_LIBS += $${entryLib}$${QT_LIBINFIX}d
+diff --git a/src/winmain/winmain.pro b/src/winmain/winmain.pro
+index b497765..d63a684 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.10.2
+
diff --git a/0016-Build-dynamic-host-libraries.patch b/0016-Build-dynamic-host-libraries.patch
new file mode 100644
index 00000000000..1c1b71422c9
--- /dev/null
+++ b/0016-Build-dynamic-host-libraries.patch
@@ -0,0 +1,38 @@
+From 61bdeeb1fd3b4eabc204fd65dd9049ddaeb5583f Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 14:27:28 +0200
+Subject: [PATCH 16/26] Build dynamic host libraries
+
+For better accordance with Arch Linux packaging
+standards
+---
+ mkspecs/features/qt_module.prf | 2 +-
+ src/tools/bootstrap-dbus/bootstrap-dbus.pro | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
+index 5bd5101..30a325b 100644
+--- a/mkspecs/features/qt_module.prf
++++ b/mkspecs/features/qt_module.prf
+@@ -25,7 +25,7 @@ isEmpty(VERSION): error("Module does not define version.")
+
+ # Compile as shared/DLL or static according to the option given to configure
+ # unless overridden. Host builds are always static
+-host_build|staticlib: CONFIG += static
++staticlib: CONFIG += static
+
+ host_build {
+ QT -= gui # no host module will ever use gui
+diff --git a/src/tools/bootstrap-dbus/bootstrap-dbus.pro b/src/tools/bootstrap-dbus/bootstrap-dbus.pro
+index c3ed27d..30d2114 100644
+--- a/src/tools/bootstrap-dbus/bootstrap-dbus.pro
++++ b/src/tools/bootstrap-dbus/bootstrap-dbus.pro
+@@ -27,4 +27,4 @@ SOURCES = \
+ load(qt_module)
+
+ lib.CONFIG = dummy_install
+-INSTALLS = lib
++INSTALLS += lib
+--
+2.10.2
+
diff --git a/0017-Enable-rpath-for-build-tools.patch b/0017-Enable-rpath-for-build-tools.patch
new file mode 100644
index 00000000000..cecd335bba2
--- /dev/null
+++ b/0017-Enable-rpath-for-build-tools.patch
@@ -0,0 +1,35 @@
+From 42cab8b3eec8eb5c8078ef8360a05b7835a533ba Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 17:59:27 +0200
+Subject: [PATCH 17/26] Enable rpath for build tools
+
+- Required because library various tools depend on (libQt5Bootstrap.so) resides
+ in folder /usr/${_arch}/lib
+- Can't use regular lib dir because it would conflict with the native package
+---
+ 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 46aca50..e763602 100644
+--- a/mkspecs/features/qt_app.prf
++++ b/mkspecs/features/qt_app.prf
+@@ -20,6 +20,7 @@ isEmpty(QMAKE_INFO_PLIST): CONFIG -= app_bundle
+ QMAKE_LFLAGS += $$QMAKE_LFLAGS_GCSECTIONS
+
+ 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:contains(QT_CONFIG, release_tools): CONFIG += release
+ contains(QT, core(-private)?|xml) {
+@@ -30,7 +31,6 @@ host_build:force_bootstrap {
+ } else {
+ !build_pass:contains(QT_CONFIG, 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.10.2
+
diff --git a/0018-Use-system-zlib-for-build-tools.patch b/0018-Use-system-zlib-for-build-tools.patch
new file mode 100644
index 00000000000..b20a0d6d25e
--- /dev/null
+++ b/0018-Use-system-zlib-for-build-tools.patch
@@ -0,0 +1,25 @@
+From 2e7791965e771e6d4a544a6b81e86cba8ad6b181 Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 18:04:42 +0200
+Subject: [PATCH 18/26] Use system zlib for build tools
+
+---
+ src/tools/bootstrap/bootstrap.pro | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro
+index a431052..b97ff0a 100644
+--- a/src/tools/bootstrap/bootstrap.pro
++++ b/src/tools/bootstrap/bootstrap.pro
+@@ -134,7 +134,7 @@ macx {
+ ../../corelib/io/qstandardpaths_win.cpp
+ }
+
+-contains(QT_CONFIG, zlib)|cross_compile {
++contains(QT_CONFIG, zlib) {
+ include(../../3rdparty/zlib.pri)
+ } else {
+ CONFIG += no_core_dep
+--
+2.10.2
+
diff --git a/0019-Disable-determing-default-include-and-lib-dirs-at-qm.patch b/0019-Disable-determing-default-include-and-lib-dirs-at-qm.patch
new file mode 100644
index 00000000000..3d4e8d8f3a1
--- /dev/null
+++ b/0019-Disable-determing-default-include-and-lib-dirs-at-qm.patch
@@ -0,0 +1,26 @@
+From 63595b743f993ab734821f7f415cc63bf1dba9ca Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 18:20:25 +0200
+Subject: [PATCH 19/26] Disable determing default include and lib dirs at qmake
+ time when building with mingw-w64
+
+---
+ mkspecs/features/default_pre.prf | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mkspecs/features/default_pre.prf b/mkspecs/features/default_pre.prf
+index cffffdc..6445481 100644
+--- a/mkspecs/features/default_pre.prf
++++ b/mkspecs/features/default_pre.prf
+@@ -29,7 +29,7 @@ isEmpty(QMAKE_DEFAULT_INCDIRS):!host_build {
+ #
+ # Get default include and library paths from compiler
+ #
+- gcc {
++ !win32:gcc {
+ equals(QMAKE_DIR_SEP, /) {
+ cmd_prefix = "LC_ALL=C"
+ cmd_suffix = "</dev/null >/dev/null"
+--
+2.10.2
+
diff --git a/qt5-fix-implib-ext.patch b/0020-Use-.dll.a-as-import-lib-extension.patch
index 65612d721fe..1b5d26ab6ff 100644
--- a/qt5-fix-implib-ext.patch
+++ b/0020-Use-.dll.a-as-import-lib-extension.patch
@@ -1,26 +1,19 @@
-From f09d23b9cd22771e04f49b386e3b67df8ad108c3 Mon Sep 17 00:00:00 2001
-From: Ray Donnelly <mingw.android@gmail.com>
-Date: Mon, 10 Mar 2014 22:59:39 +0000
-Subject: [PATCH] win32-g++: Add QMAKE_EXTENSION_IMPORTLIB defaulting to 'a'
+From e0f3940f8a6df9e347a29d37671fa1bae7d84735 Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 18:26:18 +0200
+Subject: [PATCH 20/26] Use *.dll.a as import lib extension
-This is to allow the MSYS2 project to set it to 'dll.a' so
-that static and shared Qt libraries can be installed into
-the same prefix without conflicting.
-
-To change it, you should pass -device-option to configure.
-
-Change-Id: I9ee49d2aef46e21f31b97611de2fc6d3070e288a
---
- mkspecs/features/create_cmake.prf | 5 +++--
- qmake/generators/win32/mingw_make.cpp | 15 +++++++++++++--
- qmake/generators/win32/mingw_make.h | 1 +
- 3 files changed, 17 insertions(+), 4 deletions(-)
+ mkspecs/features/create_cmake.prf | 5 +++--
+ mkspecs/win32-g++/qmake.conf | 2 +-
+ qmake/generators/win32/winmakefile.cpp | 17 ++++++++++++-----
+ 3 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
-index 82e2812..2d8a043 100644
+index 4adacf6..0ff1c6d 100644
--- a/mkspecs/features/create_cmake.prf
+++ b/mkspecs/features/create_cmake.prf
-@@ -214,8 +214,9 @@ mac {
+@@ -236,8 +236,9 @@ mac {
CMAKE_PRL_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.prl
CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl
} else {
@@ -33,23 +26,23 @@ index 82e2812..2d8a043 100644
} else {
CMAKE_WINMAIN_FILE_LOCATION_DEBUG = qtmain$${QT_LIBINFIX}d.lib
diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf
-index 6d5764f..77e910b 100644
+index db92487..607bd3e 100644
--- a/mkspecs/win32-g++/qmake.conf
+++ b/mkspecs/win32-g++/qmake.conf
-@@ -92,7 +92,7 @@
+@@ -92,7 +92,7 @@ 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
-
+
QMAKE_LIBS =
- QMAKE_LIBS_CORE = -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32
+ QMAKE_LIBS_CORE = -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 -lz -lpcre16
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
-index 6d5764f..77e910b 100644
+index 543e905..456f21c 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
-@@ -85,10 +85,14 @@
+@@ -80,10 +80,14 @@ Win32MakefileGenerator::parseLibFlag(const ProString &flag, ProString *arg)
bool
Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
{
@@ -68,7 +61,7 @@ index 6d5764f..77e910b 100644
static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
for (int i = 0; lflags[i]; i++) {
ProStringList &l = project->values(lflags[i]);
-@@ -233,9 +237,12 @@
+@@ -228,9 +232,12 @@ void Win32MakefileGenerator::fixTargetExt()
if (!project->values("QMAKE_APP_FLAG").isEmpty()) {
project->values("TARGET_EXT").append(".exe");
} else if (project->isActiveConfig("shared")) {
@@ -82,3 +75,6 @@ index 6d5764f..77e910b 100644
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.10.2
+
diff --git a/0021-Merge-shared-and-static-library-trees.patch b/0021-Merge-shared-and-static-library-trees.patch
new file mode 100644
index 00000000000..d5a943ab617
--- /dev/null
+++ b/0021-Merge-shared-and-static-library-trees.patch
@@ -0,0 +1,122 @@
+From 9aec74947e4726660486236f083ca485f05625c7 Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 18:45:08 +0200
+Subject: [PATCH 21/26] Merge shared and static library trees
+
+Allow installation of shared and static build in the same prefix
+---
+ configure | 6 ++++++
+ mkspecs/features/default_post.prf | 8 ++++++++
+ mkspecs/features/qt.prf | 12 ++++++++++++
+ mkspecs/features/spec_pre.prf | 11 ++++++++---
+ qmake/generators/makefile.cpp | 9 ++++++---
+ 5 files changed, 40 insertions(+), 6 deletions(-)
+
+diff --git a/configure b/configure
+index cf879ff..b4c75c6 100755
+--- a/configure
++++ b/configure
+@@ -7181,6 +7181,12 @@ host_build {
+ }
+ QT_CONFIG += $QT_CONFIG
+
++contains(CONFIG, static) {
++ CONFIG -= shared
++ QT_CONFIG += static jpeg gif
++ QT_CONFIG -= shared
++}
++
+ #versioning
+ QT_VERSION = $QT_VERSION
+ QT_MAJOR_VERSION = $QT_MAJOR_VERSION
+diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf
+index e7e9a5b..799278d 100644
+--- a/mkspecs/features/default_post.prf
++++ b/mkspecs/features/default_post.prf
+@@ -120,3 +120,11 @@ c++11|c++14|c++1z {
+
+ QMAKE_INCDIR += $$QMAKE_INCDIR_POST
+ QMAKE_LIBDIR += $$QMAKE_LIBDIR_POST
++
++win32:contains(CONFIG, static) {
++ DEFINES += QT_STATIC QT_DESIGNER_STATIC
++ DEFINES -= QT_SHARED
++ contains(QT_CONFIG, angle): DEFINES += QT_OPENGL_ES_2_ANGLE_STATIC
++ QMAKE_LFLAGS += -static -static-libstdc++ -static-libgcc
++ QMAKE_EXT_PRL=.static.prl # prevents qmake from finding the prl file for shared libs
++}
+diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
+index 03ec36a..c4d7beb 100644
+--- a/mkspecs/features/qt.prf
++++ b/mkspecs/features/qt.prf
+@@ -150,6 +150,18 @@ for(ever) {
+ !isEmpty(MODULE_WINRT_CAPABILITIES_DEVICE): \
+ WINRT_MANIFEST.capabilities_device_default += $$MODULE_WINRT_CAPABILITIES_DEVICE
+ }
++
++ win32:CONFIG(static) {
++ isEqual(MODULE_NAME, QtCore) {
++ LIBS$$var_sfx += $$QMAKE_LIBS_CORE
++ } else:isEqual(MODULE_NAME, QtGui) {
++ LIBS$$var_sfx += $$QMAKE_LIBS_GUI
++ } else:isEqual(MODULE_NAME, QtNetwork) {
++ LIBS$$var_sfx += $$QMAKE_LIBS_NETWORK
++ } 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 090f348..05d2863 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 b4792fe..edd7918 100644
+--- a/qmake/generators/makefile.cpp
++++ b/qmake/generators/makefile.cpp
+@@ -3166,6 +3166,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()) {
+@@ -3339,9 +3342,9 @@ MakefileGenerator::writePkgConfigFile()
+ t << endl;
+
+ // requires
+- const QString requires = project->values("QMAKE_PKGCONFIG_REQUIRES").join(' ');
+- if (!requires.isEmpty()) {
+- t << "Requires: " << requires << endl;
++ t << "Requires:";
++ for (const auto &required : project->values("QMAKE_PKGCONFIG_REQUIRES")) {
++ t << (project->isActiveConfig("staticlib") ? QStringLiteral(" Static") : QStringLiteral(" ")) << required.toQString();
+ }
+
+ t << endl;
+--
+2.10.2
+
diff --git a/0022-Allow-usage-of-static-version-with-CMake.patch b/0022-Allow-usage-of-static-version-with-CMake.patch
new file mode 100644
index 00000000000..45eba6c1e34
--- /dev/null
+++ b/0022-Allow-usage-of-static-version-with-CMake.patch
@@ -0,0 +1,972 @@
+From baadc36def778c99b33f68d2c840c176bb873d66 Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 18:32:00 +0200
+Subject: [PATCH 22/26] Allow usage of static version with CMake
+
+- Fix plugin detection and various details
+- Allow selecting between dynamic and static Qt versions
+ installed in the same prefix
+ - Use eg. find_package(Qt5Core) for dynamic version
+ - and eg. find_package(StaticQt5Core) for static version
+---
+ mkspecs/features/create_cmake.prf | 85 ++++--
+ .../features/data/cmake/Qt5BasicConfig.cmake.in | 338 +++++++++++++++------
+ .../features/data/cmake/Qt5PluginTarget.cmake.in | 30 +-
+ qmake/generators/makefile.cpp | 7 +
+ src/corelib/Qt5CoreConfigExtras.cmake.in | 37 ++-
+ src/gui/Qt5GuiConfigExtras.cmake.in | 12 +-
+ 6 files changed, 358 insertions(+), 151 deletions(-)
+
+diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
+index 0ff1c6d..d0d4a7f 100644
+--- a/mkspecs/features/create_cmake.prf
++++ b/mkspecs/features/create_cmake.prf
+@@ -38,7 +38,8 @@ split_incpath {
+ $$QT_MODULE_INCLUDE_BASE/Qt$${CMAKE_MODULE_NAME}/$$eval(QT.$${MODULE}.VERSION)/Qt$${CMAKE_MODULE_NAME})
+
+ cmake_extra_source_includes.input = $$PWD/data/cmake/ExtraSourceIncludes.cmake.in
+- cmake_extra_source_includes.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/ExtraSourceIncludes.cmake
++ isEmpty(CMAKE_STATIC_TYPE): cmake_extra_source_includes.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/ExtraSourceIncludes.cmake
++ else: cmake_extra_source_includes.output = $$CMAKE_OUT_DIR/StaticQt5$${CMAKE_MODULE_NAME}/ExtraSourceIncludes.cmake
+
+ !build_pass:QMAKE_SUBSTITUTES += \
+ cmake_extra_source_includes
+@@ -90,6 +91,8 @@ win32:!wince:!static:!staticlib {
+ }
+
+ static|staticlib:CMAKE_STATIC_TYPE = true
++static|staticlib:VAR_PREFIX = "Static"
++else:VAR_PREFIX = ""
+
+ CMAKE_DEBUG_TYPE =
+ CMAKE_RELEASE_TYPE =
+@@ -135,17 +138,19 @@ contains(CONFIG, plugin) {
+ CMAKE_PLUGIN_NAME = $$PLUGIN_CLASS_NAME
+
+ win32 {
+- isEmpty(CMAKE_STATIC_TYPE) {
++ mingw {
+ CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${TARGET}.dll
+ CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${TARGET}d.dll
+- } else:mingw {
+- CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${TARGET}.a
+- CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${TARGET}d.a
++ CMAKE_PLUGIN_LOCATION_RELEASE_STATIC = $$PLUGIN_TYPE/lib$${TARGET}.a
++ CMAKE_PLUGIN_LOCATION_DEBUG_STATIC = $$PLUGIN_TYPE/lib$${TARGET}d.a
+ } else { # MSVC static
+ CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${TARGET}.lib
+ CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${TARGET}d.lib
++ CMAKE_PLUGIN_LOCATION_RELEASE_STATIC = $$PLUGIN_TYPE/$${TARGET}.lib
++ CMAKE_PLUGIN_LOCATION_DEBUG_STATIC = $$PLUGIN_TYPE/$${TARGET}d.lib
+ }
+ } else {
++ # this branch is broken by the patch, only apply when building for Windows
+ mac {
+ isEmpty(CMAKE_STATIC_TYPE): CMAKE_PlUGIN_EXT = .dylib
+ else: CMAKE_PlUGIN_EXT = .a
+@@ -161,13 +166,15 @@ contains(CONFIG, plugin) {
+ }
+ }
+ cmake_target_file.input = $$PWD/data/cmake/Qt5PluginTarget.cmake.in
+- cmake_target_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}_$${PLUGIN_CLASS_NAME}.cmake
++ isEmpty(CMAKE_STATIC_TYPE): cmake_target_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}_$${PLUGIN_CLASS_NAME}.cmake
++ else: cmake_target_file.output = $$CMAKE_OUT_DIR/StaticQt5$${CMAKE_MODULE_NAME}/StaticQt5$${CMAKE_MODULE_NAME}_$${PLUGIN_CLASS_NAME}.cmake
+
+ !build_pass:QMAKE_SUBSTITUTES += \
+ cmake_target_file
+
+ cmake_qt5_plugin_file.files = $$cmake_target_file.output
+- cmake_qt5_plugin_file.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME}
++ isEmpty(CMAKE_STATIC_TYPE): cmake_qt5_plugin_file.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME}
++ else: cmake_qt5_plugin_file.path = $$[QT_INSTALL_LIBS]/cmake/StaticQt5$${CMAKE_MODULE_NAME}
+ INSTALLS += cmake_qt5_plugin_file
+
+ return()
+@@ -180,6 +187,8 @@ mod_deps =
+ lib_deps =
+ aux_mod_deps =
+ aux_lib_deps =
++aux_compile_defs_static = QT_STATIC QT_DESIGNER_STATIC
++contains(QT_CONFIG, angle): aux_compile_defs += QT_OPENGL_ES_2_ANGLE_STATIC
+ # Until CMake 3.0 is the minimum requirement of Qt 5, we need to filter
+ # out header-only modules from dependencies. CMake 3.0 provides INTERFACE
+ # libraries which are equivalent to header-only modules.
+@@ -188,19 +197,26 @@ for (dep, sorted_deps) {
+ !contains(QT.$${dep}.module_config, no_link) {
+ mod_deps += $$cdep
+ lib_deps += Qt5::$$cdep
++ lib_deps_static += StaticQt5::$$cdep
+ } else {
+ aux_mod_deps += $$cdep
+ aux_lib_deps += Qt5::$$cdep
++ aux_lib_deps_static += StaticQt5::$$cdep
+ }
+ }
+ CMAKE_MODULE_DEPS = $$join(mod_deps, ";")
+ CMAKE_QT5_MODULE_DEPS = $$join(lib_deps, ";")
++CMAKE_QT5_MODULE_DEPS_STATIC = $$join(lib_deps_static, ";")
+ CMAKE_INTERFACE_MODULE_DEPS = $$join(aux_mod_deps, ";")
+ CMAKE_INTERFACE_QT5_MODULE_DEPS = $$join(aux_lib_deps, ";")
++CMAKE_INTERFACE_QT5_MODULE_DEPS_STATIC = $$join(aux_lib_deps_static, ";")
++CMAKE_INTERFACE_COMPILE_DEFINITIONS_STATIC = $$join(aux_compile_defs_static, ";")
++
+
+ CMAKE_QT_STEM = Qt$$QT_MAJOR_VERSION$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}
+
+ mac {
++ # this branch is broken by the patch, only apply when building for Windows
+ !isEmpty(CMAKE_STATIC_TYPE) {
+ CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}_debug.a
+ CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
+@@ -228,35 +244,33 @@ mac {
+ CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqt5main$${QT_LIBINFIX}.a
+ CMAKE_WINMAIN_FILE_LOCATION_RELEASE = libqt5main$${QT_LIBINFIX}.a
+
+- !isEmpty(CMAKE_STATIC_TYPE) {
+- CMAKE_STATIC_WINDOWS_BUILD = "true"
+- CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.a
+- CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
++ isEmpty(QMAKE_EXTENSION_IMPORTLIB): QMAKE_EXTENSION_IMPORTLIB = dll.a
++ CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.$${QMAKE_EXTENSION_IMPORTLIB}
++ CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.$${QMAKE_EXTENSION_IMPORTLIB}
++ CMAKE_PRL_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.prl
++ CMAKE_PRL_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.prl
++
++ CMAKE_IMPLIB_FILE_LOCATION_DEBUG_STATIC = lib$${CMAKE_QT_STEM}d.a
++ CMAKE_IMPLIB_FILE_LOCATION_RELEASE_STATIC = lib$${CMAKE_QT_STEM}.a
++ CMAKE_PRL_FILE_LOCATION_DEBUG_STATIC = $${CMAKE_QT_STEM}d.static.prl
++ CMAKE_PRL_FILE_LOCATION_RELEASE_STATIC = $${CMAKE_QT_STEM}.static.prl
+
+- CMAKE_PRL_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.prl
+- CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl
+- } else {
+- isEmpty(QMAKE_EXTENSION_IMPORTLIB): QMAKE_EXTENSION_IMPORTLIB = a
+- CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.$${QMAKE_EXTENSION_IMPORTLIB}
+- CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.$${QMAKE_EXTENSION_IMPORTLIB}
+- }
+ } else {
+ CMAKE_WINMAIN_FILE_LOCATION_DEBUG = qtmain$${QT_LIBINFIX}d.lib
+ CMAKE_WINMAIN_FILE_LOCATION_RELEASE = qtmain$${QT_LIBINFIX}.lib
+
+- !isEmpty(CMAKE_STATIC_TYPE) {
+- CMAKE_STATIC_WINDOWS_BUILD = "true"
+- CMAKE_IMPLIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.lib
+- CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib
++ CMAKE_IMPLIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.lib
++ CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib
++ CMAKE_PRL_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.prl
++ CMAKE_PRL_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.prl
+
+- CMAKE_PRL_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.prl
+- CMAKE_PRL_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.prl
+- } else {
+- CMAKE_IMPLIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.lib
+- CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib
+- }
++ CMAKE_IMPLIB_FILE_LOCATION_DEBUG_STATIC = $${CMAKE_QT_STEM}d.lib
++ CMAKE_IMPLIB_FILE_LOCATION_RELEASE_STATIC = $${CMAKE_QT_STEM}.lib
++ CMAKE_PRL_FILE_LOCATION_DEBUG_STATIC = $${CMAKE_QT_STEM}d.static.prl
++ CMAKE_PRL_FILE_LOCATION_RELEASE_STATIC = $${CMAKE_QT_STEM}.static.prl
+ }
+ } else {
++ # this branch is broken by the patch, only apply when building for Windows
+ !isEmpty(CMAKE_STATIC_TYPE) {
+ CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.a
+ CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
+@@ -276,12 +290,14 @@ mac {
+ INSTALLS += cmake_qt5_module_files
+
+ cmake_config_file.input = $$PWD/data/cmake/Qt5BasicConfig.cmake.in
+-cmake_config_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}Config.cmake
++isEmpty(CMAKE_STATIC_TYPE): cmake_config_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}Config.cmake
++else: cmake_config_file.output = $$CMAKE_OUT_DIR/StaticQt5$${CMAKE_MODULE_NAME}/StaticQt5$${CMAKE_MODULE_NAME}Config.cmake
+
+ CMAKE_PACKAGE_VERSION = $$eval(QT.$${MODULE}.VERSION)
+
+ cmake_config_version_file.input = $$PWD/data/cmake/Qt5ConfigVersion.cmake.in
+-cmake_config_version_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}ConfigVersion.cmake
++isEmpty(CMAKE_STATIC_TYPE): cmake_config_version_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}ConfigVersion.cmake
++else: cmake_config_version_file.output = $$CMAKE_OUT_DIR/StaticQt5$${CMAKE_MODULE_NAME}/StaticQt5$${CMAKE_MODULE_NAME}ConfigVersion.cmake
+
+ !build_pass:QMAKE_SUBSTITUTES += \
+ cmake_config_file \
+@@ -295,7 +311,8 @@ cmake_extras_file.input = $$_PRO_FILE_PWD_/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.
+ exists($$cmake_extras_file.input) {
+
+ CMAKE_MODULE_EXTRAS = "true"
+- cmake_extras_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake
++ isEmpty(CMAKE_STATIC_TYPE): cmake_extras_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake
++ else: cmake_extras_file.output = $$CMAKE_OUT_DIR/StaticQt5$${CMAKE_MODULE_NAME}/StaticQt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake
+
+ !build_pass:QMAKE_SUBSTITUTES += cmake_extras_file
+
+@@ -307,7 +324,8 @@ cmake_macros_file.input = $$_PRO_FILE_PWD_/Qt5$${CMAKE_MODULE_NAME}Macros.cmake
+ exists($$cmake_macros_file.input) {
+ CMAKE_MODULE_MACROS = "true"
+
+- cmake_macros_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}Macros.cmake
++ isEmpty(CMAKE_STATIC_TYPE): cmake_macros_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}Macros.cmake
++ else: cmake_macros_file.output = $$CMAKE_OUT_DIR/StaticQt5$${CMAKE_MODULE_NAME}/StaticQt5$${CMAKE_MODULE_NAME}Macros.cmake
+ cmake_macros_file.CONFIG = verbatim
+
+ !build_pass:QMAKE_SUBSTITUTES += cmake_macros_file
+@@ -315,7 +333,8 @@ exists($$cmake_macros_file.input) {
+ cmake_qt5_module_files.files += $$cmake_macros_file.output
+ }
+
+-cmake_qt5_module_files.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME}
++isEmpty(CMAKE_STATIC_TYPE): cmake_qt5_module_files.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME}
++else: cmake_qt5_module_files.path = $$[QT_INSTALL_LIBS]/cmake/StaticQt5$${CMAKE_MODULE_NAME}
+
+ # We are generating cmake files. Most developers of Qt are not aware of cmake,
+ # so we require automatic tests to be available. The only module which should
+diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+index d2358ca..89575ef 100644
+--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
++++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+@@ -35,15 +35,18 @@ set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")
+
+ !!IF !equals(TEMPLATE, aux)
+ # For backwards compatibility only. Use Qt5$${CMAKE_MODULE_NAME}_VERSION instead.
+-set(Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING "$$eval(QT.$${MODULE}.MAJOR_VERSION).$$eval(QT.$${MODULE}.MINOR_VERSION).$$eval(QT.$${MODULE}.PATCH_VERSION)")
+-
+-set(Qt5$${CMAKE_MODULE_NAME}_LIBRARIES Qt5::$${CMAKE_MODULE_NAME})
++set($${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING "$$eval(QT.$${MODULE}.MAJOR_VERSION).$$eval(QT.$${MODULE}.MINOR_VERSION).$$eval(QT.$${MODULE}.PATCH_VERSION)")
++set($${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_LIBRARIES $${VAR_PREFIX}Qt5::$${CMAKE_MODULE_NAME})
+ !!ENDIF // TEMPLATE != aux
+
+-macro(_qt5_$${CMAKE_MODULE_NAME}_check_file_exists file)
+- if(NOT EXISTS \"${file}\" )
+- message(FATAL_ERROR \"The imported target \\\"Qt5::$${CMAKE_MODULE_NAME}\\\" references the file
+- \\\"${file}\\\"
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++macro(_qt5_$${CMAKE_MODULE_NAME}_check_file_exists_static FILE)
++!!ELSE
++macro(_qt5_$${CMAKE_MODULE_NAME}_check_file_exists FILE)
++!!ENDIF
++ if(NOT EXISTS \"${FILE}\")
++ message(FATAL_ERROR \"The imported target \\\"$${VAR_PREFIX}Qt5::$${CMAKE_MODULE_NAME}\\\" references the file
++ \\\"${FILE}\\\"
+ but this file does not exist. Possible reasons include:
+ * The file was deleted, renamed, or moved to another location.
+ * An install or uninstall procedure did not complete successfully.
+@@ -54,44 +57,91 @@ but not all the files it references.
+ endif()
+ endmacro()
+
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++# ensure also regular/dynamic macro exists because it might be used in some extra config
++if(NOT COMMAND _qt5_$${CMAKE_MODULE_NAME}_check_file_exists)
++ macro(_qt5_$${CMAKE_MODULE_NAME}_check_file_exists FILE)
++ _qt5_$${CMAKE_MODULE_NAME}_check_file_exists_static("${FILE}")
++ endmacro()
++endif()
++!!ENDIF
++
+ !!IF !equals(TEMPLATE, aux)
+-macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATION IMPLIB_LOCATION)
+- set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++macro(_populate_$${CMAKE_MODULE_NAME}_target_properties_static TARGET_NAME TARGET_CONFIG LIB_LOCATION IMPLIB_LOCATION)
++!!ELSE
++macro(_populate_$${CMAKE_MODULE_NAME}_target_properties TARGET_NAME TARGET_CONFIG LIB_LOCATION IMPLIB_LOCATION)
++!!ENDIF
++ set_property(TARGET ${TARGET_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${TARGET_CONFIG})
+
+ !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
++
++!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++ set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/lib/${LIB_LOCATION}\")
++!!ELSE
++ set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/bin/${LIB_LOCATION}\")
++!!ENDIF
++!!ELSE
+ set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
++!!ENDIF
++
++!!ELSE
++
++!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++ set(imported_location \"lib/${LIB_LOCATION}\")
++!!ELSE
++ set(imported_location \"bin/${LIB_LOCATION}\")
++!!ENDIF
+ !!ELSE
+ set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
+ !!ENDIF
++
++!!ENDIF
++
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++ _qt5_$${CMAKE_MODULE_NAME}_check_file_exists_static(${imported_location})
++!!ELSE
+ _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
+- set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
+- \"INTERFACE_LINK_LIBRARIES\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\"
+- \"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
++!!ENDIF
++
++ if (_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES)
++ set(_list_sep \";\")
++ endif()
++ set_target_properties(${TARGET_NAME} PROPERTIES
++ \"INTERFACE_LINK_LIBRARIES_${TARGET_CONFIG}\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}${_list_sep}${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${TARGET_CONFIG}_LIB_DEPENDENCIES}\"
++ \"IMPORTED_LOCATION_${TARGET_CONFIG}\" ${imported_location}
+ !!IF !isEmpty(CMAKE_LIB_SONAME)
+- \"IMPORTED_SONAME_${Configuration}\" \"$${CMAKE_LIB_SONAME}\"
++ \"IMPORTED_SONAME_${TARGET_CONFIG}\" \"$${CMAKE_LIB_SONAME}\"
+ !!ENDIF
+ # For backward compatibility with CMake < 2.8.12
+- \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\"
++ \"IMPORTED_LINK_INTERFACE_LIBRARIES_${TARGET_CONFIG}\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}${_list_sep}${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${TARGET_CONFIG}_LIB_DEPENDENCIES}\"
+ )
+
+ !!IF !isEmpty(CMAKE_WINDOWS_BUILD)
+ !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+ set(imported_implib \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
+ !!ELSE
+- set(imported_implib \"IMPORTED_IMPLIB_${Configuration}\" \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
++ set(imported_implib \"IMPORTED_IMPLIB_${TARGET_CONFIG}\" \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
+ !!ENDIF
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++ _qt5_$${CMAKE_MODULE_NAME}_check_file_exists_static(${imported_implib})
++!!ELSE
+ _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_implib})
++!!ENDIF
+ if(NOT \"${IMPLIB_LOCATION}\" STREQUAL \"\")
+- set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
+- \"IMPORTED_IMPLIB_${Configuration}\" ${imported_implib}
++ set_target_properties($${VAR_PREFIX}Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
++ \"IMPORTED_IMPLIB_${TARGET_CONFIG}\" ${imported_implib}
+ )
+ endif()
+ !!ENDIF
+ endmacro()
+ !!ENDIF
+
+-if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
++set(TARGET_NAME $${VAR_PREFIX}Qt5::$${CMAKE_MODULE_NAME})
+
++if(NOT TARGET ${TARGET_NAME})
+ !!IF !no_module_headers
+ !!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
+ set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS
+@@ -99,33 +149,33 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+ \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Headers\"
+ )
+ !!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
+- set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
++ set($${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
+ \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/\"
+ \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\"
+ )
+ !!ELSE
+- set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
++ set($${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
+ !!ENDIF
+ !!ELSE
+ !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
+ set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}\")
+ !!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
+- set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
++ set($${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
+ \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION\"
+ \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION/$${MODULE_INCNAME}\"
+ )
+ !!ELSE
+- set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
++ set($${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
+ !!ENDIF
+ !!ELSE
+ set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\" \"$${CMAKE_INCLUDE_DIR}Qt$${CMAKE_MODULE_NAME}\")
+ !!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
+- set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
++ set($${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
+ \"$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION\"
+ \"$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION/$${MODULE_INCNAME}\"
+ )
+ !!ELSE
+- set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
++ set($${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
+ !!ENDIF
+ !!ENDIF
+ !!ENDIF
+@@ -134,11 +184,15 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+ !!ENDIF
+ !!ELSE
+ set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"\")
+- set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
++ set($${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
+ !!ENDIF
+
+ foreach(_dir ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS})
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++ _qt5_$${CMAKE_MODULE_NAME}_check_file_exists_static(${_dir})
++!!ELSE
+ _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${_dir})
++!!ENDIF
+ endforeach()
+
+ !!IF isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
+@@ -147,16 +201,20 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+ list(FIND Qt5$${CMAKE_MODULE_NAME}_FIND_COMPONENTS Private _check_private)
+ if (NOT _check_private STREQUAL -1)
+ foreach(_dir ${Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS})
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++ _qt5_$${CMAKE_MODULE_NAME}_check_file_exists_static(${_dir})
++!!ELSE
+ _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${_dir})
++!!ENDIF
+ endforeach()
+ endif()
+ !!ENDIF
+
+ !!IF !equals(TEMPLATE, aux)
+- set(Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS})
++ set($${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS})
+
+- set(Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS -D$${MODULE_DEFINE})
+- set(Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS $${MODULE_DEFINE})
++ set($${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS -D$${MODULE_DEFINE})
++ set($${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS $${MODULE_DEFINE})
+ !!ENDIF // TEMPLATE != aux
+ set(_Qt5$${CMAKE_MODULE_NAME}_MODULE_DEPENDENCIES \"$${CMAKE_MODULE_DEPS}\")
+
+@@ -167,7 +225,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+ !!ENDIF
+
+ set(_Qt5$${CMAKE_MODULE_NAME}_FIND_DEPENDENCIES_REQUIRED)
+- if (Qt5$${CMAKE_MODULE_NAME}_FIND_REQUIRED)
++ if ($${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_FIND_REQUIRED)
+ set(_Qt5$${CMAKE_MODULE_NAME}_FIND_DEPENDENCIES_REQUIRED REQUIRED)
+ endif()
+ set(_Qt5$${CMAKE_MODULE_NAME}_FIND_DEPENDENCIES_QUIET)
+@@ -175,17 +233,17 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+ set(_Qt5$${CMAKE_MODULE_NAME}_DEPENDENCIES_FIND_QUIET QUIET)
+ endif()
+ set(_Qt5$${CMAKE_MODULE_NAME}_FIND_VERSION_EXACT)
+- if (Qt5$${CMAKE_MODULE_NAME}_FIND_VERSION_EXACT)
++ if ($${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_FIND_VERSION_EXACT)
+ set(_Qt5$${CMAKE_MODULE_NAME}_FIND_VERSION_EXACT EXACT)
+ endif()
+
+ !!IF !equals(TEMPLATE, aux)
+- set(Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS \"\")
++ set($${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS \"\")
+ !!ENDIF // TEMPLATE != aux
+
+ foreach(_module_dep ${_Qt5$${CMAKE_MODULE_NAME}_MODULE_DEPENDENCIES})
+- if (NOT Qt5${_module_dep}_FOUND)
+- find_package(Qt5${_module_dep}
++ if (NOT $${VAR_PREFIX}Qt5${_module_dep}_FOUND)
++ find_package($${VAR_PREFIX}Qt5${_module_dep}
+ $$VERSION ${_Qt5$${CMAKE_MODULE_NAME}_FIND_VERSION_EXACT}
+ ${_Qt5$${CMAKE_MODULE_NAME}_DEPENDENCIES_FIND_QUIET}
+ ${_Qt5$${CMAKE_MODULE_NAME}_FIND_DEPENDENCIES_REQUIRED}
+@@ -193,28 +251,32 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+ )
+ endif()
+
+- if (NOT Qt5${_module_dep}_FOUND)
+- set(Qt5$${CMAKE_MODULE_NAME}_FOUND False)
++ if (NOT $${VAR_PREFIX}Qt5${_module_dep}_FOUND)
++ set($${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_FOUND False)
+ return()
+ endif()
+
+ !!IF !equals(TEMPLATE, aux)
+- list(APPEND Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS \"${Qt5${_module_dep}_INCLUDE_DIRS}\")
+- list(APPEND Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"${Qt5${_module_dep}_PRIVATE_INCLUDE_DIRS}\")
+- list(APPEND Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS ${Qt5${_module_dep}_DEFINITIONS})
+- list(APPEND Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS ${Qt5${_module_dep}_COMPILE_DEFINITIONS})
+- list(APPEND Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS ${Qt5${_module_dep}_EXECUTABLE_COMPILE_FLAGS})
++ list(APPEND $${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS \"${Qt5${_module_dep}_INCLUDE_DIRS}\")
++ list(APPEND $${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"${Qt5${_module_dep}_PRIVATE_INCLUDE_DIRS}\")
++ list(APPEND $${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS ${Qt5${_module_dep}_DEFINITIONS})
++ list(APPEND $${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS ${Qt5${_module_dep}_COMPILE_DEFINITIONS})
++ list(APPEND $${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS ${Qt5${_module_dep}_EXECUTABLE_COMPILE_FLAGS})
+ !!ENDIF // TEMPLATE != aux
+ endforeach()
+ !!IF !equals(TEMPLATE, aux)
+- list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS)
+- list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS)
+- list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS)
+- list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS)
+- list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS)
++ list(REMOVE_DUPLICATES $${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS)
++ list(REMOVE_DUPLICATES $${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS)
++ list(REMOVE_DUPLICATES $${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS)
++ list(REMOVE_DUPLICATES $${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS)
++ list(REMOVE_DUPLICATES $${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS)
+ !!ENDIF // TEMPLATE != aux
+
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++ set(_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES \"$${CMAKE_QT5_MODULE_DEPS_STATIC}\")
++!!ELSE
+ set(_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES \"$${CMAKE_QT5_MODULE_DEPS}\")
++!!ENDIF
+
+ !!IF !isEmpty(CMAKE_INTERFACE_QT5_MODULE_DEPS)
+ if (NOT CMAKE_VERSION VERSION_LESS 3.0.0)
+@@ -223,81 +285,179 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+ !!ENDIF
+
+ !!IF !isEmpty(CMAKE_STATIC_TYPE)
+- add_library(Qt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED)
+- set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES "CXX")
++ add_library(StaticQt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED)
++ set_property(TARGET StaticQt5::$${CMAKE_MODULE_NAME} PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES "CXX")
++
++ macro(_process_prl_file PRL_FILE_LOCATION CONFIGURATION)
++ if (EXISTS \"${PRL_FILE_LOCATION}\")
++ file(STRINGS \"${PRL_FILE_LOCATION}\" prl_strings REGEX \"QMAKE_PRL_LIBS_FOR_CMAKE\")
++ string(REGEX REPLACE \"QMAKE_PRL_LIBS_FOR_CMAKE *= *([^\\n]*)\" \"\\\\1\" static_depends ${prl_strings})
++ string(REGEX REPLACE \"\\\\$\\\\$\\\\[QT_INSTALL_LIBS\\\\]\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/lib\" static_depends \"${static_depends}\")
++ if (_Qt5$${CMAKE_MODULE_NAME}_STATIC_${CONFIGURATION}_LIB_DEPENDENCIES)
++ set(_list_sep \";\")
++ endif()
++ set(_Qt5$${CMAKE_MODULE_NAME}_STATIC_${CONFIGURATION}_LIB_DEPENDENCIES \"${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${CONFIGURATION}_LIB_DEPENDENCIES}${_list_sep}${static_depends}\")
++ endif()
++ endmacro()
++
++ macro(_process_plugin_prl_file PRL_FILE_LOCATION CONFIGURATION LIB_DIRECTORY LIB_LOCATION)
++ # First add the (static) plugin itself ...
++ if (_Qt5$${CMAKE_MODULE_NAME}_STATIC_${CONFIGURATION}_LIB_DEPENDENCIES)
++ set(_list_sep \";\")
++ endif()
++ set(_Qt5$${CMAKE_MODULE_NAME}_STATIC_${CONFIGURATION}_LIB_DEPENDENCIES \"${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${CONFIGURATION}_LIB_DEPENDENCIES}${_list_sep}${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/${LIB_DIRECTORY}/${LIB_LOCATION}\")
++ # .. then its dependencies.
++ _process_prl_file(${PRL_FILE_LOCATION} ${CONFIGURATION})
++ endmacro()
++
++!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
++ _process_prl_file(\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG_STATIC}\" DEBUG)
++!!ELSE
++ _process_prl_file(\"$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG_STATIC}\" DEBUG)
++!!ENDIF
++!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
++ _process_prl_file(\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE_STATIC}\" RELEASE)
+ !!ELSE
++ _process_prl_file(\"$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE_STATIC}\" RELEASE)
++!!ENDIF
++
++!!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
++
+ !!IF !equals(TEMPLATE, aux)
+ !!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
+- set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY FRAMEWORK 1)
++ set_property(TARGET $${VAR_PREFIX}Qt5::$${CMAKE_MODULE_NAME} PROPERTY FRAMEWORK 1)
+ !!ENDIF
+ !!ENDIF // TEMPLATE != aux
+
+- set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY
++!!IF !equals(TEMPLATE, aux)
++!!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
++ set_property(TARGET $${VAR_PREFIX}Qt5::$${CMAKE_MODULE_NAME} PROPERTY FRAMEWORK 1)
++!!ENDIF
++!!ENDIF // TEMPLATE != aux
++
++ set_property(TARGET $${VAR_PREFIX}Qt5::$${CMAKE_MODULE_NAME} PROPERTY
+ INTERFACE_INCLUDE_DIRECTORIES ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS})
++ set(interface_compile_definitions $${MODULE_DEFINE})
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++ set_property(TARGET StaticQt5::$${CMAKE_MODULE_NAME} PROPERTY
++ INTERFACE_COMPILE_DEFINITIONS $${CMAKE_INTERFACE_COMPILE_DEFINITIONS_STATIC} $${MODULE_DEFINE})
++ file(GLOB pluginTargetsMaybe \"${CMAKE_CURRENT_LIST_DIR}/StaticQt5$${CMAKE_MODULE_NAME}_*.cmake\")
++!!ELSE
+ set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY
+- INTERFACE_COMPILE_DEFINITIONS $${MODULE_DEFINE})
++ INTERFACE_COMPILE_DEFINITIONS $${MODULE_DEFINE})
++ file(GLOB pluginTargetsMaybe \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*.cmake\")
++!!ENDIF
++
++ unset(pluginTargets)
++ if(pluginTargetsMaybe)
++ foreach(pluginTarget ${pluginTargetsMaybe})
++ file(STRINGS ${pluginTarget} matched REGEX $${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}_PLUGINS)
++ if(matched)
++ list(APPEND pluginTargets ${pluginTarget})
++ endif()
++ endforeach()
++ endif()
++
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++ macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties_static TARGET_NAME PLUGIN_TARGET_NAME PLUGIN_NAME CONFIG PLUGIN_LOCATION)
++!!ELSE
++ macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties TARGET_NAME PLUGIN_TARGET_NAME PLUGIN_NAME CONFIG PLUGIN_LOCATION)
++!!ENDIF
++ 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
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++ _qt5_$${CMAKE_MODULE_NAME}_check_file_exists_static(${imported_location})
++!!ELSE
++ _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
++!!ENDIF
++ 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})
++ _process_plugin_prl_file(${PLUGIN_PRL_FILE_LOCATION} ${CONFIG} \"lib/qt/plugins\" ${PLUGIN_LOCATION})
++!!ENDIF
++
++ endmacro()
++
++ if(pluginTargets)
++ foreach(pluginTarget ${pluginTargets})
++ include(${pluginTarget})
++ endforeach()
++ endif()
+
+ !!IF !equals(TEMPLATE, aux)
+ !!IF !isEmpty(CMAKE_RELEASE_TYPE)
+-!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
+- _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" )
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++ _populate_$${CMAKE_MODULE_NAME}_target_properties_static(StaticQt5::$${CMAKE_MODULE_NAME} RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE_STATIC}\" \"\" )
+ !!ELSE
+- _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_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}\" )
++!!ENDIF // CMAKE_STATIC_TYPE
++
+
+ !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
+ !!IF isEmpty(CMAKE_DEBUG_TYPE)
+-!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
+ !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+- if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
++ if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG_STATIC}\" )
+ !!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
+ if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
+ !!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
+- _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" )
+-!!ELSE // CMAKE_STATIC_WINDOWS_BUILD
++ _populate_$${CMAKE_MODULE_NAME}_target_properties_static(StaticQt5::$${CMAKE_MODULE_NAME} DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG_STATIC}\" \"\" )
++ endif()
++!!ELSE // CMAKE_STATIC_TYPE
+ if (EXISTS
+ !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
+ \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
+ !!ELSE
+ \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
+ !!ENDIF
+- AND EXISTS
++ AND EXISTS
+ !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+ \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
+ !!ELSE
+ \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
+ !!ENDIF
+- _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
+-!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
++ _populate_$${CMAKE_MODULE_NAME}_target_properties(Qt5::$${CMAKE_MODULE_NAME} DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
+ endif()
++!!ENDIF // CMAKE_STATIC_TYPE
+ !!ENDIF // CMAKE_DEBUG_TYPE
+ !!ENDIF // CMAKE_FIND_OTHER_LIBRARY_BUILD
+-
+ !!ENDIF // CMAKE_RELEASE_TYPE
+
+ !!IF !isEmpty(CMAKE_DEBUG_TYPE)
+-!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
+- _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" )
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++ _populate_$${CMAKE_MODULE_NAME}_target_properties_static(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" )
+ !!ELSE
+ _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
+-!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
++!!ENDIF // CMAKE_STATIC_TYPE
+
+ !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
+ !!IF isEmpty(CMAKE_RELEASE_TYPE)
+-!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
++
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
+ !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+- if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
++ if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE_STATIC}\" )
+ !!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
+- if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
++ if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE_STATIC}\" )
+ !!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
+- _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" )
+-!!ELSE // CMAKE_STATIC_WINDOWS_BUILD
++ _populate_$${CMAKE_MODULE_NAME}_target_properties_static(StaticQt5::$${CMAKE_MODULE_NAME} RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE_STATIC}\" \"\" )
++!!ELSE
+ if (EXISTS
+ !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
+ \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
+@@ -310,9 +470,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}\" )
+-!!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}\" )
+ endif()
++!!ENDIF // CMAKE_STATIC_TYPE
++
++
+ !!ENDIF // CMAKE_RELEASE_TYPE
+ !!ENDIF // CMAKE_FIND_OTHER_LIBRARY_BUILD
+
+@@ -323,37 +485,17 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+ )
+ !!ENDIF // TEMPLATE != aux
+
+- file(GLOB pluginTargets \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*Plugin.cmake\")
+-
+- macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION)
+- 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}
+- )
+- endmacro()
+-
+- if (pluginTargets)
+- foreach(pluginTarget ${pluginTargets})
+- include(${pluginTarget})
+- endforeach()
+- endif()
+-
+-
+ !!IF !isEmpty(CMAKE_MODULE_EXTRAS)
+- include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake\")
++ include(\"${CMAKE_CURRENT_LIST_DIR}/$${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake\")
+ !!ENDIF
+-
+ !!IF !isEmpty(CMAKE_MODULE_MACROS)
+- include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}Macros.cmake\")
++ include(\"${CMAKE_CURRENT_LIST_DIR}/$${VAR_PREFIX}Qt5$${CMAKE_MODULE_NAME}Macros.cmake\")
+ !!ENDIF
+
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++_qt5_$${CMAKE_MODULE_NAME}_check_file_exists_static(\"${CMAKE_CURRENT_LIST_DIR}/StaticQt5$${CMAKE_MODULE_NAME}ConfigVersion.cmake\")
++!!ELSE
+ _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigVersion.cmake\")
++!!ENDIF
+
+ endif()
+diff --git a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in b/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
+index 5baf0fd..54345e4 100644
+--- a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
++++ b/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
+@@ -1,11 +1,31 @@
+-
+-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 !isEmpty(CMAKE_STATIC_TYPE)
++if(NOT TARGET StaticQt5::$$CMAKE_PLUGIN_NAME)
++ add_library(StaticQt5::$$CMAKE_PLUGIN_NAME MODULE IMPORTED)
++!!ELSE
++if(NOT TARGET Qt5::$$CMAKE_PLUGIN_NAME)
++ add_library(Qt5::$$CMAKE_PLUGIN_NAME MODULE IMPORTED)
++!!ENDIF
+
+ !!IF !isEmpty(CMAKE_RELEASE_TYPE)
+-_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\")
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++ _populate_$${CMAKE_MODULE_NAME}_plugin_properties_static(StaticQt5::$$CMAKE_MODULE_NAME StaticQt5::$$CMAKE_PLUGIN_NAME $$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE_STATIC}\")
++!!ELSE
++ _populate_$${CMAKE_MODULE_NAME}_plugin_properties(Qt5::$$CMAKE_MODULE_NAME Qt5::$$CMAKE_PLUGIN_NAME $$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\")
++!!ENDIF
+ !!ENDIF
+ !!IF !isEmpty(CMAKE_DEBUG_TYPE)
+-_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\")
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++ _populate_$${CMAKE_MODULE_NAME}_plugin_properties_static(StaticQt5::$$CMAKE_MODULE_NAME StaticQt5::$$CMAKE_PLUGIN_NAME $$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG_STATIC}\")
++!!ELSE
++ _populate_$${CMAKE_MODULE_NAME}_plugin_properties(Qt5::$$CMAKE_MODULE_NAME Qt5::$$CMAKE_PLUGIN_NAME $$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\")
++!!ENDIF
++!!ENDIF
++
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++ list(APPEND StaticQt5$${CMAKE_MODULE_NAME}_PLUGINS StaticQt5::$$CMAKE_PLUGIN_NAME)
++!!ELSE
++ list(APPEND Qt5$${CMAKE_MODULE_NAME}_PLUGINS Qt5::$$CMAKE_PLUGIN_NAME)
+ !!ENDIF
+
+-list(APPEND Qt5$${CMAKE_MODULE_NAME}_PLUGINS Qt5::$$CMAKE_PLUGIN_NAME)
++endif()
+diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
+index edd7918..9f860da 100644
+--- a/qmake/generators/makefile.cpp
++++ b/qmake/generators/makefile.cpp
+@@ -997,6 +997,13 @@ MakefileGenerator::writePrlFile(QTextStream &t)
+ for (ProStringList::Iterator it = libs.begin(); it != libs.end(); ++it)
+ t << qv(project->values((*it).toKey()));
+ t << endl;
++ t << "QMAKE_PRL_LIBS_FOR_CMAKE = ";
++ QString sep;
++ for (ProStringList::Iterator it = libs.begin(); it != libs.end(); ++it) {
++ t << sep << project->values((*it).toKey()).join(';').replace('\\', "\\\\");
++ sep = ';';
++ }
++ t << endl;
+ }
+ }
+
+diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
+index a5ed8b2..3375e1e 100644
+--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
++++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
+@@ -1,4 +1,10 @@
+
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++set(IMPORTED_TARGET_NAME StaticQt5::$${CMAKE_MODULE_NAME})
++!!ELSE
++set(IMPORTED_TARGET_NAME Qt5::$${CMAKE_MODULE_NAME})
++!!ENDIF
++
+ if (NOT TARGET Qt5::qmake)
+ add_executable(Qt5::qmake IMPORTED)
+
+@@ -50,9 +56,9 @@ set(Qt5Core_QMAKE_EXECUTABLE Qt5::qmake)
+ set(Qt5Core_MOC_EXECUTABLE Qt5::moc)
+ set(Qt5Core_RCC_EXECUTABLE Qt5::rcc)
+
+-set_property(TARGET Qt5::Core PROPERTY INTERFACE_QT_MAJOR_VERSION 5)
+-set_property(TARGET Qt5::Core PROPERTY INTERFACE_QT_COORD_TYPE $$QT_COORD_TYPE)
+-set_property(TARGET Qt5::Core APPEND PROPERTY
++set_property(TARGET ${IMPORTED_TARGET_NAME} PROPERTY INTERFACE_QT_MAJOR_VERSION 5)
++set_property(TARGET ${IMPORTED_TARGET_NAME} PROPERTY INTERFACE_QT_COORD_TYPE $$QT_COORD_TYPE)
++set_property(TARGET ${IMPORTED_TARGET_NAME} APPEND PROPERTY
+ COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION QT_COORD_TYPE
+ )
+
+@@ -63,7 +69,7 @@ foreach(_dir ${_qt5_corelib_extra_includes})
+ endforeach()
+
+ list(APPEND Qt5Core_INCLUDE_DIRS ${_qt5_corelib_extra_includes})
+-set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_qt5_corelib_extra_includes})
++set_property(TARGET ${IMPORTED_TARGET_NAME} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_qt5_corelib_extra_includes})
+ set(_qt5_corelib_extra_includes)
+
+ # Targets using Qt need to use the POSITION_INDEPENDENT_CODE property. The
+@@ -81,9 +87,9 @@ set(Qt5_POSITION_INDEPENDENT_CODE True)
+ if (CMAKE_VERSION VERSION_LESS 2.8.12
+ AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\"
+ OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0))
+- set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE \"ON\")
++ set_property(TARGET ${IMPORTED_TARGET_NAME} APPEND PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE \"ON\")
+ else()
+- set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_OPTIONS $$QMAKE_CXXFLAGS_APP)
++ set_property(TARGET ${IMPORTED_TARGET_NAME} APPEND PROPERTY INTERFACE_COMPILE_OPTIONS $$QMAKE_CXXFLAGS_APP)
+ endif()
+
+ # Applications using qmake or cmake >= 2.8.12 as their build system will
+@@ -103,7 +109,7 @@ endif()
+ !!IF !isEmpty(QT_NAMESPACE)
+ list(APPEND Qt5Core_DEFINITIONS -DQT_NAMESPACE=$$QT_NAMESPACE)
+ list(APPEND Qt5Core_COMPILE_DEFINITIONS QT_NAMESPACE=$$QT_NAMESPACE)
+-set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS QT_NAMESPACE=$$QT_NAMESPACE)
++set_property(TARGET ${IMPORTED_TARGET_NAME} APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS QT_NAMESPACE=$$QT_NAMESPACE)
+ !!ENDIF
+
+ !!IF !isEmpty(CMAKE_DISABLED_FEATURES)
+@@ -112,9 +118,9 @@ set(Qt5_DISABLED_FEATURES
+ )
+ !!ENDIF
+
+-set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>)
++set_property(TARGET ${IMPORTED_TARGET_NAME} APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>)
+
+-set_property(TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_FEATURES cxx_decltype)
++set_property(TARGET ${IMPORTED_TARGET_NAME} PROPERTY INTERFACE_COMPILE_FEATURES cxx_decltype)
+
+ !!IF contains(QT_CONFIG, reduce_exports)
+ set(QT_VISIBILITY_AVAILABLE \"True\")
+@@ -162,14 +168,14 @@ if (NOT TARGET Qt5::WinMain)
+ set(_isWin32 $<BOOL:$<TARGET_PROPERTY:WIN32_EXECUTABLE>>)
+ set(_isNotExcluded $<NOT:$<BOOL:$<TARGET_PROPERTY:Qt5_NO_LINK_QTMAIN>>>)
+ set(_isPolicyNEW $<TARGET_POLICY:CMP0020>)
+- get_target_property(_configs Qt5::Core IMPORTED_CONFIGURATIONS)
+- set_property(TARGET Qt5::Core APPEND PROPERTY
++ get_target_property(_configs ${IMPORTED_TARGET_NAME} IMPORTED_CONFIGURATIONS)
++ set_property(TARGET ${IMPORTED_TARGET_NAME} APPEND PROPERTY
+ INTERFACE_LINK_LIBRARIES
+ $<$<AND:${_isExe},${_isWin32},${_isNotExcluded},${_isPolicyNEW}>:Qt5::WinMain>
+ )
+ # For backward compatibility with CMake < 2.8.12
+ foreach(_config ${_configs})
+- set_property(TARGET Qt5::Core APPEND PROPERTY
++ set_property(TARGET ${IMPORTED_TARGET_NAME} APPEND PROPERTY
+ IMPORTED_LINK_INTERFACE_LIBRARIES_${_config}
+ $<$<AND:${_isExe},${_isWin32},${_isNotExcluded},${_isPolicyNEW}>:Qt5::WinMain>
+ )
+@@ -188,3 +194,10 @@ get_filename_component(_Qt5CoreConfigDir ${CMAKE_CURRENT_LIST_FILE} PATH)
+ set(_Qt5CTestMacros \"${_Qt5CoreConfigDir}/Qt5CTestMacros.cmake\")
+
+ _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
+diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
+index 2e32911..31567d7 100644
+--- a/src/gui/Qt5GuiConfigExtras.cmake.in
++++ b/src/gui/Qt5GuiConfigExtras.cmake.in
+@@ -1,4 +1,10 @@
+
++!!IF !isEmpty(CMAKE_STATIC_TYPE)
++set(IMPORTED_TARGET_NAME StaticQt5::$${CMAKE_MODULE_NAME})
++!!ELSE
++set(IMPORTED_TARGET_NAME Qt5::$${CMAKE_MODULE_NAME})
++!!ENDIF
++
+ !!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE)
+
+ !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
+@@ -67,7 +73,7 @@ unset(_GL_INCDIRS)
+ # optional.
+
+ list(APPEND Qt5Gui_INCLUDE_DIRS ${_qt5gui_OPENGL_INCLUDE_DIR})
+-set_property(TARGET Qt5::Gui APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_qt5gui_OPENGL_INCLUDE_DIR})
++set_property(TARGET ${IMPORTED_TARGET_NAME} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_qt5gui_OPENGL_INCLUDE_DIR})
+
+ unset(_qt5gui_OPENGL_INCLUDE_DIR CACHE)
+
+@@ -170,9 +176,9 @@ _qt5gui_find_extra_libs(OPENGL \"$$CMAKE_OPENGL_LIBS\" \"$$CMAKE_OPENGL_LIBDIR\"
+
+ set(Qt5Gui_OPENGL_IMPLEMENTATION $$CMAKE_QT_OPENGL_IMPLEMENTATION)
+
+-get_target_property(_configs Qt5::Gui IMPORTED_CONFIGURATIONS)
++get_target_property(_configs ${IMPORTED_TARGET_NAME} IMPORTED_CONFIGURATIONS)
+ foreach(_config ${_configs})
+- set_property(TARGET Qt5::Gui APPEND PROPERTY
++ set_property(TARGET ${IMPORTED_TARGET_NAME} APPEND PROPERTY
+ IMPORTED_LINK_DEPENDENT_LIBRARIES_${_config}
+ ${Qt5Gui_EGL_LIBRARIES} ${Qt5Gui_OPENGL_LIBRARIES}
+ )
+--
+2.10.2
+
diff --git a/0023-Use-correct-pkg-config-static-flag.patch b/0023-Use-correct-pkg-config-static-flag.patch
new file mode 100644
index 00000000000..4dd8e73e1b4
--- /dev/null
+++ b/0023-Use-correct-pkg-config-static-flag.patch
@@ -0,0 +1,28 @@
+From aeec21b7d2c0185499531c55282d8738c19770f2 Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 18:50:21 +0200
+Subject: [PATCH 23/26] Use correct pkg-config --static flag
+
+---
+ configure | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/configure b/configure
+index b4c75c6..eea15f0 100755
+--- a/configure
++++ b/configure
+@@ -4153,6 +4153,11 @@ if [ -z "$PKG_CONFIG" ]; then
+ # See if PKG_CONFIG is set in the mkspec:
+ PKG_CONFIG="`"$CFG_QMAKE_PATH" -qtconf "$QTCONFFILE" -E -nocache -spec "$XQMAKESPEC" "CONFIG=" $DEV_NULL 2>&1 | sed -n -e 's,^PKG_CONFIG = \(.*\),\1,p'`"
+ [ -n "$PKG_CONFIG" ] && [ "$OPT_VERBOSE" = "yes" ] && echo "Found pkg-config from mkspec: $PKG_CONFIG"
++
++ if [ "$CFG_SHARED" = "no" ] ; then
++ PKG_CONFIG="$PKG_CONFIG --static"
++ [ "$OPT_VERBOSE" = "yes" ] && echo "Using '$PKG_CONFIG' because we're doing a static build"
++ fi
+ fi
+ if [ -z "$PKG_CONFIG" ]; then
+ PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null`
+--
+2.10.2
+
diff --git a/0024-Use-shared-static-version-of-MariaDB.patch b/0024-Use-shared-static-version-of-MariaDB.patch
new file mode 100644
index 00000000000..d8e8adf190c
--- /dev/null
+++ b/0024-Use-shared-static-version-of-MariaDB.patch
@@ -0,0 +1,25 @@
+From c49745c7dd018086e2566fed2a7a393fe21460d6 Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 18:56:55 +0200
+Subject: [PATCH 24/26] Use shared/static version of MariaDB
+
+---
+ config.tests/unix/mysql/mysql.pro | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/config.tests/unix/mysql/mysql.pro b/config.tests/unix/mysql/mysql.pro
+index 06d1880..5dadbfb 100644
+--- a/config.tests/unix/mysql/mysql.pro
++++ b/config.tests/unix/mysql/mysql.pro
+@@ -1,3 +1,7 @@
+ SOURCES = mysql.cpp
+ CONFIG -= qt dylib
+-LIBS += -lmysqlclient
++contains(CONFIG, static) {
++ LIBS += -lmariadbclient -lws2_32 -lpthread -lz -lm -lssl -lcrypto
++} else {
++ LIBS += -lmariadbclient
++}
+--
+2.10.2
+
diff --git a/0025-Use-shared-static-version-of-PostgreSQL.patch b/0025-Use-shared-static-version-of-PostgreSQL.patch
new file mode 100644
index 00000000000..e133b300ff3
--- /dev/null
+++ b/0025-Use-shared-static-version-of-PostgreSQL.patch
@@ -0,0 +1,25 @@
+From 96cc0debf89c8c17413cc0d28a57f962ce20653e Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 18 Sep 2016 18:58:25 +0200
+Subject: [PATCH 25/26] Use shared/static version of PostgreSQL
+
+---
+ config.tests/unix/psql/psql.pro | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/config.tests/unix/psql/psql.pro b/config.tests/unix/psql/psql.pro
+index d0f3761..58f1638 100644
+--- a/config.tests/unix/psql/psql.pro
++++ b/config.tests/unix/psql/psql.pro
+@@ -1,3 +1,7 @@
+ SOURCES = psql.cpp
+ CONFIG -= qt dylib
+-LIBS *= -lpq
++contains(CONFIG, static) {
++ LIBS *= -lpq -lintl -liconv -lssl -lcrypto -lwldap32 -lshfolder -lwsock32 -lws2_32 -lsecur32 -lgdi32
++} else {
++ LIBS *= -lpq
++}
+--
+2.10.2
+
diff --git a/0026-Fix-qt5_wrap_ui-macro.patch b/0026-Fix-qt5_wrap_ui-macro.patch
new file mode 100644
index 00000000000..2773f0a3308
--- /dev/null
+++ b/0026-Fix-qt5_wrap_ui-macro.patch
@@ -0,0 +1,28 @@
+From 7e20d462a43054bc5ff6776454277344436df710 Mon Sep 17 00:00:00 2001
+From: Martchus <martchus@gmx.net>
+Date: Sun, 4 Dec 2016 20:35:47 +0100
+Subject: [PATCH 26/26] Fix qt5_wrap_ui() macro
+
+See https://github.com/Martchus/PKGBUILDs/issues/11
+---
+ src/widgets/Qt5WidgetsMacros.cmake | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/widgets/Qt5WidgetsMacros.cmake b/src/widgets/Qt5WidgetsMacros.cmake
+index f5e7b7f..18d120f 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)
+ list(APPEND ${outfiles} ${outfile})
+--
+2.10.2
+
diff --git a/PKGBUILD b/PKGBUILD
index 93b3778d524..eede644c5d7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,6 +6,8 @@
# 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
+
# There are different variants of the package which can be selected by simply adjusting pkgname:
# - mingw-w64-qt5-base or mingw-w64-qt5-base-opengl: using native OpenGL
# - mingw-w64-qt5-base-angle: using ANGLE rather than native OpenGL
@@ -22,10 +24,15 @@
# By default CMake and qmake will link against the dynamic Qt libraries.
-# To use the static Qt libraries with CMake set the following variable before calling find_package for finding a Qt module:
-# set(USE_STATIC_QT_BUILD ON)
+# To use the static Qt libraries with CMake prefix the Qt module 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 ... Qt5::static::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 ... Qt5::QWindowsIntegrationPlugin)
+# target_link_libraries(target ... Qt5::static::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)
@@ -34,12 +41,13 @@
# CONFIG+=static
# Further Qt modules (those not found in the base repository and hence not included in this package) include by default
-# static and dynamic libraries; if only one version is requried, just set $NO_STATIC_LIBS or $NO_SHARED_LIBS.
+# static and dynamic libraries; if only one version is requried, just set $NO_STATIC_LIBS or $NO_SHARED_LIBS when building
+# the package.
# By default, executables will not be removed because I find them useful when testing. To remove executables
-# set $NO_EXECUTABLES (or $NO_STATIC_EXECUTABLES to remove statically linked executables only).
-# However, if Qt modules containing tools are built as static and as dynamic library only the dynamically linked
-# tools will be present in the package.
+# 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.
# Qt packages can be built in the following order (for example):
# qt5-base qt5-base-static qt5-declarative qt5-tools qt5-xmlpatterns qt5-script qt5-location qt5-multimedia qt5-sensors qt5-webchannel qt5-3d qt5-imageformats qt5-quickcontrols qt5-quickcontrols2 qt5-translations qt5-svg qt5-websockets qt5-winextras qt5-serialport qt5-canvas3d qt5-connectivity qt5-charts qt5-gamepad qt5-scxml qt5-datavis3s qt5-virtualkeyboard qt5-activeqt qt5-webkit
@@ -70,8 +78,8 @@ isNoOpenGL() {
pkgname=mingw-w64-qt5-base-angle
pkgver=5.7.0
-pkgrel=8
-pkgdesc="A cross-platform application and UI framework (mingw-w64)"
+pkgrel=10
+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/'
@@ -80,59 +88,114 @@ depends=('mingw-w64-crt' 'mingw-w64-zlib' 'mingw-w64-libjpeg-turbo' 'mingw-w64-s
'mingw-w64-libpng' 'mingw-w64-openssl' 'mingw-w64-dbus' 'mingw-w64-harfbuzz'
'mingw-w64-pcre')
groups=('mingw-w64-qt' 'mingw-w64-qt5')
-optdepends=('mingw-w64-postgresql: PostgreSQL support' 'mingw-w64-mariadb-connector-c: MySQL support'
- 'qtchooser')
+optdepends=('mingw-w64-postgresql: PostgreSQL support' 'mingw-w64-mariadb-connector-c: MySQL support')
makedepends=('mingw-w64-gcc' 'mingw-w64-postgresql' 'mingw-w64-mariadb-connector-c' 'mingw-w64-pkg-config')
options=(!strip !buildflags staticlibs !emptydirs)
_pkgfqn="qtbase-opensource-src-${pkgver}"
source=("https://download.qt.io/official_releases/qt/${pkgver:0:3}/${pkgver}/submodules/${_pkgfqn}.tar.xz"
- "qt5-add-angle-and-dynamic-support.patch"
- "qt5-use-external-angle-library.patch"
- "qt5-workaround-pkgconfig-install-issue.patch"
- "qt5-merge-static-and-shared-library-trees.patch"
- "qt5-fix-linking-against-static-pcre.patch"
- "qt5-rename-qtmain-to-qt5main.patch"
- "qt5-dont-build-host-libs-static.patch"
- "qt5-enable-rpath-for-host-tools.patch"
- "qt5-dont-add-resource-files-to-qmake-libs.patch"
- "qt5-prevent-debug-library-names-in-pkgconfig-files.patch"
- "qt5-fix-linking-against-static-dbus.patch"
- "qt5-use-win32-g++-mkspecs-profile.patch"
- "qt5-use-system-zlib-in-host-libs.patch"
- "qt5-fix-opengl-to-many-sections.patch"
- "qt5-fix-static-psql-mysql.patch"
- "qt5-fixes-from-mxe.patch"
- "qt5-fix-implib-ext.patch"
- "qt5-disable-default-lib-include-detection.patch"
- "qt5-win32-static-cmake-link-ws2_32-and--static.patch"
- "qt5-allow-usage-of-static-qt-with-cmake.patch"
- "qt5-customize-extensions-for-static-build.patch"
- "qt5-use-correct-pkg-config-static-flags.patch"
- "qt5-use-pkgconfig-for-harfbuzz.patch")
+ '0001-Fix-qwindows-plugin-linking-with-system-freetype.patch'
+ '0002-Fix-oci-config-test-on-windows.patch'
+ '0003-Don-t-set-QT_NO_SYSTEMSEMAPHORE-for-Windows.patch'
+ '0004-Fix-building-mysql-driver-under-mingw.patch'
+ '0005-Support-ANGLE-switches-via-configure-shell-script.patch'
+ '0006-Use-external-ANGLE-library.patch'
+ '0007-Fix-too-many-sections-assemler-error-in-OpenGL-facto.patch'
+ '0008-Make-sure-.pc-files-are-installed-correctly.patch'
+ '0009-Don-t-add-resource-files-to-LIBS-parameter.patch'
+ '0010-Prevent-debug-library-names-in-pkg-config-files.patch'
+ '0011-Fix-linking-against-static-D-Bus.patch'
+ '0012-Adjust-win32-g-mkspecs-profile.patch'
+ '0013-Fix-linking-against-external-harfbuzz.patch'
+ '0014-Fix-linking-against-static-pcre.patch'
+ '0015-Rename-qtmain-to-qt5main.patch'
+ '0016-Build-dynamic-host-libraries.patch'
+ '0017-Enable-rpath-for-build-tools.patch'
+ '0018-Use-system-zlib-for-build-tools.patch'
+ '0019-Disable-determing-default-include-and-lib-dirs-at-qm.patch'
+ '0020-Use-.dll.a-as-import-lib-extension.patch'
+ '0021-Merge-shared-and-static-library-trees.patch'
+ '0022-Allow-usage-of-static-version-with-CMake.patch'
+ '0023-Use-correct-pkg-config-static-flag.patch'
+ '0024-Use-shared-static-version-of-MariaDB.patch'
+ '0025-Use-shared-static-version-of-PostgreSQL.patch'
+ '0001-Fix-qwindows-plugin-linking-with-system-freetype.patch'
+ '0002-Fix-oci-config-test-on-windows.patch'
+ '0003-Don-t-set-QT_NO_SYSTEMSEMAPHORE-for-Windows.patch'
+ '0004-Fix-building-mysql-driver-under-mingw.patch'
+ '0005-Support-ANGLE-switches-via-configure-shell-script.patch'
+ '0006-Use-external-ANGLE-library.patch'
+ '0007-Fix-too-many-sections-assemler-error-in-OpenGL-facto.patch'
+ '0008-Make-sure-.pc-files-are-installed-correctly.patch'
+ '0009-Don-t-add-resource-files-to-LIBS-parameter.patch'
+ '0010-Prevent-debug-library-names-in-pkg-config-files.patch'
+ '0011-Fix-linking-against-static-D-Bus.patch'
+ '0012-Adjust-win32-g-mkspecs-profile.patch'
+ '0013-Fix-linking-against-external-harfbuzz.patch'
+ '0014-Fix-linking-against-static-pcre.patch'
+ '0015-Rename-qtmain-to-qt5main.patch'
+ '0016-Build-dynamic-host-libraries.patch'
+ '0017-Enable-rpath-for-build-tools.patch'
+ '0018-Use-system-zlib-for-build-tools.patch'
+ '0019-Disable-determing-default-include-and-lib-dirs-at-qm.patch'
+ '0020-Use-.dll.a-as-import-lib-extension.patch'
+ '0021-Merge-shared-and-static-library-trees.patch'
+ '0022-Allow-usage-of-static-version-with-CMake.patch'
+ '0023-Use-correct-pkg-config-static-flag.patch'
+ '0024-Use-shared-static-version-of-MariaDB.patch'
+ '0025-Use-shared-static-version-of-PostgreSQL.patch'
+ '0026-Fix-qt5_wrap_ui-macro.patch')
md5sums=('184f9460b40752d71b15b827260580c2'
- '55a11d8ea5db9ca0cced06b06655b417'
- '1f7aea5e8bed840b3efc9172081ddb45'
- 'bc99c4cc6998295d76f37ed681c20d47'
- 'e2ffff39673b37c4d9974e92fcf7213c'
- '4fe6523dd1c34398df3aa5a8763530cc'
- 'f32a768e1acb9785c79c8e93aa266db2'
- '3bd322551924543553a2bf81b4419a09'
- '30fa9ddf8d842b1392e8d63868940657'
- '99bb9f51ec684803768f36e407baf486'
- '6a6bc88f35ac8080869de39bc128ce5b'
- '261d9071a6af3f1d5c3f955da3781573'
- '0524dc5427a6c5338ebd45ab08c6ce80'
- 'c15d9f480d0248648fa52aeacb46e3c7'
- '612a4dfb9f1a3898a1920c28bb999159'
- 'd0eb81aef1a21c65813fe4ddabbc4206'
- '1e8c03872062fe8499ed7786475ed4e0'
- '83139869355c2d46921adb25e47cf0fa'
- 'b9565219e9252a17fc1b8fb9ee30662c'
- '20de722808e8a3fb684b0212bef8de46'
- 'a60bd6bb231acfe9132f391a26b37e71'
- '41ec67d9e5e70e0d6d93b42aebd0e12a'
- '61c0f9d0095c5a6dec8d14e9ec35a608'
- '16a7d505b503bb1087fc00fad819f64b')
+ 'bd3a336834d1dc22bacf38688b30fab0'
+ '390cd5b394fe2a84054c4c34f9f016d6'
+ 'ec43bd375737a578bf7494e14e5726e9'
+ '358dd9465914f52d8988228c656c508a'
+ '455134d76b818a994084dd45b11ce51e'
+ '84fd7ed12061aba4bf8648a5cbd72095'
+ 'dcd5889407bc6fd8637bbb04a033ae6a'
+ '9de955e67e3f0f35d955021ced9dd544'
+ 'aa9e36e721864e24c5c632b2fa463dac'
+ '4642ae1ab8ec5c864b1fa2cc8bf43a8a'
+ 'a01ce4e39f309ffc10857c7c1e4a2ae8'
+ 'a3fa433801b8c11f83e069fe9c80ea8b'
+ '64c41f016b9583277ec8403824ff81b7'
+ 'b13a0b9c610ff071eac36331c938aba1'
+ 'b0da19aa67c3305bd611c9f104efaa74'
+ '423142ec2a76ee031725587f9c299420'
+ 'f5efb8153fa3d0b0fd71fe8604c7d626'
+ '670fbd9766654969db82363378608c0a'
+ '424b23ae0de84f4027e375223d945fe4'
+ '77a50b5fe0cc2f431f0124db402056c1'
+ '2491ad84a2065cd1477f1a6b34c2a46c'
+ 'c646461b4341ed83b1a83426fc627a70'
+ '0e4e4f1d9a16eb6038709d82cf31227d'
+ '88b8eb6d0b7cec85cfbc54f2d6716f2d'
+ '179ae7c4217e062df0d8bd5171792e11'
+ 'bd3a336834d1dc22bacf38688b30fab0'
+ '390cd5b394fe2a84054c4c34f9f016d6'
+ 'ec43bd375737a578bf7494e14e5726e9'
+ '358dd9465914f52d8988228c656c508a'
+ '455134d76b818a994084dd45b11ce51e'
+ '84fd7ed12061aba4bf8648a5cbd72095'
+ 'dcd5889407bc6fd8637bbb04a033ae6a'
+ '9de955e67e3f0f35d955021ced9dd544'
+ 'aa9e36e721864e24c5c632b2fa463dac'
+ '4642ae1ab8ec5c864b1fa2cc8bf43a8a'
+ 'a01ce4e39f309ffc10857c7c1e4a2ae8'
+ 'a3fa433801b8c11f83e069fe9c80ea8b'
+ '64c41f016b9583277ec8403824ff81b7'
+ 'b13a0b9c610ff071eac36331c938aba1'
+ 'b0da19aa67c3305bd611c9f104efaa74'
+ '423142ec2a76ee031725587f9c299420'
+ 'f5efb8153fa3d0b0fd71fe8604c7d626'
+ '670fbd9766654969db82363378608c0a'
+ '424b23ae0de84f4027e375223d945fe4'
+ '77a50b5fe0cc2f431f0124db402056c1'
+ '2491ad84a2065cd1477f1a6b34c2a46c'
+ 'c646461b4341ed83b1a83426fc627a70'
+ '0e4e4f1d9a16eb6038709d82cf31227d'
+ '88b8eb6d0b7cec85cfbc54f2d6716f2d'
+ '179ae7c4217e062df0d8bd5171792e11'
+ '645037becd8fdd266ac8e7cacdde85ab')
_architectures='i686-w64-mingw32 x86_64-w64-mingw32'
#_architectures='x86_64-w64-mingw32 i686-w64-mingw32'
@@ -175,98 +238,10 @@ patch() {
prepare() {
cd "${srcdir}/${_pkgfqn}"
- # Include fixes from MXE
- patch -p1 -b -i ../qt5-fixes-from-mxe.patch
-
- if isANGLE; then
- # Add support for configure options '-opengl angle' and '-opengl dynamic'
- # to the configure shell script
- patch -p0 -i ../qt5-add-angle-and-dynamic-support.patch
- # Make sure our external Angle package is used instead of the bundled one
- patch -p1 -i ../qt5-use-external-angle-library.patch
- fi
-
- # Prevent too many sections / File too big assembler error
- # (On x86_64 qopenglversionfunctionsfactory.o exceeds limit of 32768 sections
- # otherwise.)
- patch -p0 -i ../qt5-fix-opengl-to-many-sections.patch
-
- # Make sure the .pc files of the Qt5 modules are installed correctly
- patch -p0 -i ../qt5-workaround-pkgconfig-install-issue.patch
-
- # Prevents resource files from being added to the LIBS parameter
- # This solves an issue where the generated pkg-config files contained
- # invalid Libs.private references like .obj/debug/Qt5Cored_resource_res.o
- patch -p1 -i ../qt5-dont-add-resource-files-to-qmake-libs.patch
-
- # 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
- patch -p1 -i ../qt5-prevent-debug-library-names-in-pkgconfig-files.patch
-
- # Fix linking against static DBus
- patch -p0 -i ../qt5-fix-linking-against-static-dbus.patch
-
- # Patch the win32-g++ mkspecs profile to match our environment
- patch -p0 -i ../qt5-use-win32-g++-mkspecs-profile.patch
-
- # Use pkgconfig for harfbzz dependency
- # (must be applied after qt5-use-win32-g++-mkspecs-profile.patch)
- patch -p0 -i ../qt5-use-pkgconfig-for-harfbuzz.patch
-
- # The bundled pcre is built as static library by default
- # As we're not using the bundled copy but our own copy
- # we need to do some fiddling to fix compilation issues
- # when trying to build static qmake projects
- patch -p1 -i ../qt5-fix-linking-against-static-pcre.patch
-
- # Make sure the qtmain (static) library doesn't conflict with the one
- # provided by the mingw-qt (qt4) package. The mkspecs profile is already
- # updated by patch100 to reflect this change
- # https://bugzilla.redhat.com/show_bug.cgi?id=1092465
- patch -p1 -i ../qt5-rename-qtmain-to-qt5main.patch
-
- # Upstream always wants the host libraries to be static instead of
- # shared libraries. This causes issues and is against the Fedora
- # packaging guidelines so disable this 'feature'
- patch -p0 -i ../qt5-dont-build-host-libs-static.patch
-
- # Build host tools with rpath enabled
- # We have to use rpath here as the library which the
- # various tools depend on (libQt5Bootstrap.so) resides
- # in the folder /usr/${_arch}/lib
- # We can't use the regular lib dir for this as we
- # want to avoid conflicts with the native qt5 packages
- patch -p1 -i ../qt5-enable-rpath-for-host-tools.patch
-
- # Build host libs with system zlib. This patch cannot be upstreamed as-is
- # due to the other host-libs patches.
- patch -p0 -i ../qt5-use-system-zlib-in-host-libs.patch
-
- # Determine the compiler's default include and lib directories at qmake time
- # see https://codereview.qt-project.org/#/c/157817
- patch -p1 -i ../qt5-disable-default-lib-include-detection.patch
-
- # Fix qmake to append .dll.a extension to import libs
- patch -p1 -i ../qt5-fix-implib-ext.patch
-
- # Allow use of static version via CMake
- patch -p0 -i ../qt5-win32-static-cmake-link-ws2_32-and--static.patch
- patch -p0 -i ../qt5-allow-usage-of-static-qt-with-cmake.patch
-
- # Allow installation of static Qt in the same prefix as the shared version
- patch -p0 -i ../qt5-merge-static-and-shared-library-trees.patch
- isStatic && patch -p0 -i ../qt5-customize-extensions-for-static-build.patch
-
- # Use correct pkg-config --static flag
- isStatic && patch -p1 -i ../qt5-use-correct-pkg-config-static-flags.patch
-
- # Fix detection of static mariadb client
- isStatic && patch -p0 -i ../qt5-fix-static-psql-mysql.patch
+ # Apply patches; further descriptions can be found in patch files itself
+ for patch in "$srcdir/"*.patch; do
+ patch -p1 -i "$patch"
+ done
# Make sure the Qt5 build system uses our external ANGLE library
rm -rf src/3rdparty/angle include/QtANGLE/{EGL,GLES2,GLES3,KHR}
@@ -289,11 +264,8 @@ build() {
# Phonon is disabled for now because we lack the directx headers
# FIXME: check whether this is still the case
- # The odd paths for the -hostbindir argument are on purpose
- # The qtchooser tool assumes that the tools 'qmake', 'moc' and others
- # are all available in the same folder with these exact file names
# To prevent conflicts with the mingw-w64-qt4 package we have
- # to put these tools in a dedicated folder
+ # to put tools in a dedicated folder
# The last device option allows using ccache though the use of
# pre-compile header
@@ -404,21 +376,29 @@ package() {
# shared release for Qt5Bootstrap library and tools (qmake, uic, ...)
# Drop Qt5Bootstrap and libraries which are only provided as static lib
- # and are hence already present in static form in the shared version
+ # and are hence already present in shared build (such as Qt5OpenGLExtensions)
rm -f "${pkgdir}/usr/${_arch}/lib/"{lib,}qt5main* \
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5OpenGLExtensions* \
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5PlatformSupport* \
"${pkgdir}/usr/${_arch}/lib/"libQt5Bootstrap*
+ # Also ensure config files don't conflict with shared version
+ pushd "${pkgdir}/usr/${_arch}/lib/cmake"
+ for cmake_dir in $(find . ! -path . -type d ! -name 'Static*'); do
+ mkdir -p "./Static${cmake_dir:2}";
+ mv "${cmake_dir}/"* "./Static${cmake_dir:2}";
+ rm -r "${cmake_dir}"
+ done
+ rm -r "./StaticQt5OpenGLExtensions"
+ popd
+ rm "${pkgdir}/usr/${_arch}/lib/pkgconfig/StaticQt5OpenGLExtensions.pc"
+
# Keep various Qt 5 plugins to be used in static builds
pushd "${pkgdir}/usr/${_arch}/lib/" && ln -s "./qt/plugins/"*/*.a . && popd
# Keep a couple pri files not found in base
mv "${pkgdir}/usr/${_arch}/lib/qt/mkspecs/modules/qt_plugin_"*.pri "${pkgdir}/usr/${_arch}"
- # remove CMake which are also in base
- find "${pkgdir}/usr/${_arch}/lib/cmake" -not -name "Static*.cmake" -exec rm {} \;
-
# 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}
@@ -431,11 +411,8 @@ package() {
# The .dll's are installed in both bindir and libdir, one copy of the .dll's is sufficient
find "${pkgdir}/usr/${_arch}/lib" -maxdepth 1 -name "*.dll" -exec rm {} \;
- # Add qtchooser support
- [[ ${_arch} == i686-w64-mingw32 ]] && mingwn='mingw32' || mingwn='mingw64'
- mkdir -p "${pkgdir}/etc/xdg/qtchooser"
- echo "/usr/${_arch}/lib/qt/bin" > "${pkgdir}/etc/xdg/qtchooser/$mingwn-qt5.conf"
- echo "/usr/${_arch}/lib" >> "${pkgdir}/etc/xdg/qtchooser/$mingwn-qt5.conf"
+ # The Qt5OpenGLExtensions module is only available as static library and hence part of the
+ # shared build
# Create symlinks for tools
mkdir -p "${pkgdir}/usr/bin"
diff --git a/qt5-add-angle-support.patch b/qt5-add-angle-support.patch
deleted file mode 100644
index 8b9af40ac2a..00000000000
--- a/qt5-add-angle-support.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-diff -U 3 -r a/configure b/configure
---- a/configure 2015-06-29 14:03:05.000000000 -0600
-+++ b/configure 2015-07-18 11:14:30.312317765 -0600
-@@ -5081,7 +5081,7 @@
- fi
- if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then
- if compileTest x11/opengl "OpenGL"; then
-- CFG_OPENGL=desktop
-+ CFG_OPENGL=angle
- elif compileTest unix/opengles2 "OpenGL ES 2.0"; then
- CFG_OPENGL=es2
- else
-@@ -6072,6 +6072,11 @@
- QT_CONFIG="$QT_CONFIG opengles2"
- fi
-
-+if [ "$CFG_OPENGL" = "angle" ]; then
-+ QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES QT_OPENGL_ES_2"
-+ QT_CONFIG="$QT_CONFIG opengles2 egl angle"
-+fi
-+
- if [ "$CFG_SHARED" = "yes" ]; then
- QT_CONFIG="$QT_CONFIG shared"
- QTCONFIG_CONFIG="$QTCONFIG_CONFIG shared"
-@@ -7077,7 +7082,7 @@
- report_support " NIS ...................." "$CFG_NIS"
- report_support " OpenGL / OpenVG:"
- report_support " EGL .................." "$CFG_EGL"
--report_support " OpenGL ..............." "$CFG_OPENGL" yes "Desktop OpenGL" es2 "OpenGL ES 2.0+"
-+report_support " OpenGL ..............." "$CFG_OPENGL" yes "Desktop OpenGL" es2 "OpenGL ES 2.0+" angle "ANGLE"
- report_support " OpenVG ..............." "$CFG_OPENVG-$CFG_OPENVG_SHIVA" yes-yes "ShivaVG" yes-no "native"
- report_support " PCRE ..................." "$CFG_PCRE" yes "system library" qt "bundled copy"
- if [ -n "$PKG_CONFIG" ]; then
-diff -U 3 -r a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
---- a/src/plugins/platforms/windows/qwindowsglcontext.cpp 2015-06-29 14:04:40.000000000 -0600
-+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp 2015-07-18 11:16:05.767172673 -0600
-@@ -45,7 +45,9 @@
- #include <algorithm>
-
- #include <wingdi.h>
-+#ifndef QT_OPENGL_ES_2
- #include <GL/gl.h>
-+#endif
-
- // #define DEBUG_GL
-
diff --git a/qt5-allow-usage-of-static-qt-with-cmake.patch b/qt5-allow-usage-of-static-qt-with-cmake.patch
deleted file mode 100644
index dd81611626d..00000000000
--- a/qt5-allow-usage-of-static-qt-with-cmake.patch
+++ /dev/null
@@ -1,453 +0,0 @@
---- mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in.orig 2016-08-14 20:44:32.515151700 +0200
-+++ mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in 2016-08-19 16:04:30.074766100 +0200
-@@ -59,19 +59,30 @@
- set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
-
- !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
-- set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
-+ if(USE_STATIC_QT_BUILD)
-+ set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/lib/${LIB_LOCATION}\")
-+ else()
-+ set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/bin/${LIB_LOCATION}\")
-+ endif()
- !!ELSE
-- set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
-+ if(USE_STATIC_QT_BUILD)
-+ set(imported_location \"lib/${LIB_LOCATION}\")
-+ else()
-+ set(imported_location \"bin/${LIB_LOCATION}\")
-+ endif()
- !!ENDIF
- _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
-+ if (_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES)
-+ set(_list_sep \";\")
-+ endif()
- set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
-- \"INTERFACE_LINK_LIBRARIES\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\"
-+ \"INTERFACE_LINK_LIBRARIES_${Configuration}\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}${_list_sep}${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LIB_DEPENDENCIES}\"
- \"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}\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\"
-+ \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}${_list_sep}${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LIB_DEPENDENCIES}\"
- )
-
- !!IF !isEmpty(CMAKE_WINDOWS_BUILD)
-@@ -222,16 +233,50 @@
- endif()
- !!ENDIF
-
--!!IF !isEmpty(CMAKE_STATIC_TYPE)
-- add_library(Qt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED)
-- set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES "CXX")
--!!ELSE
- !!IF equals(TEMPLATE, aux)
- add_library(Qt5::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
- !!ELSE
-- add_library(Qt5::$${CMAKE_MODULE_NAME} SHARED IMPORTED)
-+ if(USE_STATIC_QT_BUILD)
-+ add_library(Qt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED)
-+ set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES "CXX")
-+
-+ macro(macro_process_prl_file prl_file_location Configuration)
-+ if (EXISTS \"${prl_file_location}\")
-+ file(STRINGS \"${prl_file_location}\" prl_strings REGEX \"QMAKE_PRL_LIBS_FOR_CMAKE\")
-+ string(REGEX REPLACE \"QMAKE_PRL_LIBS_FOR_CMAKE *= *([^\\n]*)\" \"\\\\1\" static_depends ${prl_strings})
-+ string(REGEX REPLACE \"\\\\$\\\\$\\\\[QT_INSTALL_LIBS\\\\]\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/lib\" static_depends \"${static_depends}\")
-+ if (_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LIB_DEPENDENCIES)
-+ set(_list_sep \";\")
-+ endif()
-+ set(_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LIB_DEPENDENCIES \"${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LIB_DEPENDENCIES}${_list_sep}${static_depends}\")
-+ endif()
-+ endmacro()
-+
-+ macro(macro_process_plugin_prl_file prl_file_location Configuration LIB_DIRECTORY LIB_LOCATION)
-+ # First add the (static) plugin itself ...
-+ if (_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LIB_DEPENDENCIES)
-+ set(_list_sep \";\")
-+ endif()
-+ set(_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LIB_DEPENDENCIES \"${_Qt5$${CMAKE_MODULE_NAME}_STATIC_${Configuration}_LIB_DEPENDENCIES}${_list_sep}${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/${LIB_DIRECTORY}/${LIB_LOCATION}\")
-+ # .. then its dependencies.
-+ macro_process_prl_file(${prl_file_location} ${Configuration})
-+ endmacro()
-+
-+!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
-+ macro_process_prl_file(\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG_STATIC}\" DEBUG)
-+!!ELSE
-+ macro_process_prl_file(\"$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG_STATIC}\" DEBUG)
- !!ENDIF
-+!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
-+ macro_process_prl_file(\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE_STATIC}\" RELEASE)
-+!!ELSE
-+ macro_process_prl_file(\"$${CMAKE_LIB_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE_STATIC}\" RELEASE)
-+!!ENDIF
-+ else()
-+ add_library(Qt5::$${CMAKE_MODULE_NAME} SHARED IMPORTED)
-+ endif()
- !!ENDIF
-+
- !!IF !equals(TEMPLATE, aux)
- !!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
- set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY FRAMEWORK 1)
-@@ -240,67 +285,132 @@
-
- set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY
- INTERFACE_INCLUDE_DIRECTORIES ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS})
-- set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY
-- INTERFACE_COMPILE_DEFINITIONS $${MODULE_DEFINE})
-+ set(interface_compile_definitions $${MODULE_DEFINE})
-+ if(USE_STATIC_QT_BUILD)
-+ set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY
-+ INTERFACE_COMPILE_DEFINITIONS $${CMAKE_INTERFACE_COMPILE_DEFINITIONS_STATIC} $${MODULE_DEFINE})
-+ else()
-+ set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY
-+ INTERFACE_COMPILE_DEFINITIONS $${MODULE_DEFINE})
-+ endif()
-+ if(USE_STATIC_QT_BUILD)
-+ file(GLOB pluginTargetsMaybe \"${CMAKE_CURRENT_LIST_DIR}/StaticQt5$${CMAKE_MODULE_NAME}_*.cmake\")
-+ else()
-+ file(GLOB pluginTargetsMaybe \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*.cmake\")
-+ endif()
-+ 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 Plugin Configuration PLUGIN_LOCATION)
-+ 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(USE_STATIC_QT_BUILD)
-+ set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY STATIC_PLUGINS ${Plugin})
-+ get_filename_component(_plugindir ${PLUGIN_LOCATION} PATH)
-+ get_filename_component(_plugindirname ${_plugindir} NAME)
-+ get_filename_component(_pluginname ${PLUGIN_LOCATION} NAME)
-+ string(REGEX REPLACE \"^lib(.*)\\\\.a\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/lib/qt/plugins/${_plugindirname}/\\\\1-static.prl\" plugin_prl_file_location ${_pluginname})
-+ macro_process_plugin_prl_file(${plugin_prl_file_location} ${Configuration} \"lib/qt/plugins\" ${PLUGIN_LOCATION})
-+ endif()
-+
-+ endmacro()
-+
-+ if (pluginTargets)
-+ foreach(pluginTarget ${pluginTargets})
-+ include(${pluginTarget})
-+ endforeach()
-+ endif()
-
- !!IF !equals(TEMPLATE, aux)
- !!IF !isEmpty(CMAKE_RELEASE_TYPE)
--!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
-- _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" )
--!!ELSE
-+!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
-+ if(USE_STATIC_QT_BUILD)
-+ _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE_STATIC}\" \"\" )
-+ else()
-+!!ENDIF // CMAKE_WINDOWS_BUILD
- _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
--!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
-+!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
-+ endif()
-+!!ENDIF // CMAKE_WINDOWS_BUILD
-+
-
- !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
- !!IF isEmpty(CMAKE_DEBUG_TYPE)
--!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
-+!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
-+ if(USE_STATIC_QT_BUILD)
- !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
-- if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
-+ if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG_STATIC}\" )
- !!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
-- if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
-+ if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
- !!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
-- _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" )
--!!ELSE // CMAKE_STATIC_WINDOWS_BUILD
-+ _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG_STATIC}\" \"\" )
-+ endif()
-+ else()
-+!!ENDIF // CMAKE_WINDOWS_BUILD
- if (EXISTS
- !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
- !!ELSE
- \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
- !!ENDIF
-- AND EXISTS
-+ AND EXISTS
- !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
- !!ELSE
- \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
- !!ENDIF
- _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
--!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
- endif()
-+!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
-+ endif()
-+!!ENDIF // CMAKE_WINDOWS_BUILD
- !!ENDIF // CMAKE_DEBUG_TYPE
- !!ENDIF // CMAKE_FIND_OTHER_LIBRARY_BUILD
--
- !!ENDIF // CMAKE_RELEASE_TYPE
-
- !!IF !isEmpty(CMAKE_DEBUG_TYPE)
--!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
-- _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" )
--!!ELSE
-+!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
-+ if(USE_STATIC_QT_BUILD)
-+ _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" )
-+ else()
-+!!ENDIF // CMAKE_WINDOWS_BUILD
- _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
--!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
-+!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
-+ endif()
-+!!ENDIF // CMAKE_WINDOWS_BUILD
-
- !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
- !!IF isEmpty(CMAKE_RELEASE_TYPE)
--!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
-+
-+!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
-+ if(USE_STATIC_QT_BUILD)
- !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
-- if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
-+ if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE_STATIC}\" )
- !!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
-- if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
-+ if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE_STATIC}\" )
- !!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
-- _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" )
--!!ELSE // CMAKE_STATIC_WINDOWS_BUILD
-+ _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE_STATIC}\" \"\" )
-+ else()
-+!!ENDIF // CMAKE_WINDOWS_BUILD
- if (EXISTS
- !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
-- \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
-+ \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE_STATIC}\"
- !!ELSE
- \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
- !!ENDIF
-@@ -311,8 +421,12 @@
- \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
- !!ENDIF
- _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
--!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
- endif()
-+!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
-+ endif()
-+!!ENDIF // CMAKE_WINDOWS_BUILD
-+
-+
- !!ENDIF // CMAKE_RELEASE_TYPE
- !!ENDIF // CMAKE_FIND_OTHER_LIBRARY_BUILD
-
-@@ -323,28 +437,6 @@
- )
- !!ENDIF // TEMPLATE != aux
-
-- file(GLOB pluginTargets \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*Plugin.cmake\")
--
-- macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION)
-- 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}
-- )
-- endmacro()
--
-- if (pluginTargets)
-- foreach(pluginTarget ${pluginTargets})
-- include(${pluginTarget})
-- endforeach()
-- endif()
--
-
- !!IF !isEmpty(CMAKE_MODULE_EXTRAS)
- include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake\")
---- mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in.orig 2016-08-19 16:04:30.075761600 +0200
-+++ mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in 2016-09-17 16:00:01.818295000 +0200
-@@ -1,11 +1,22 @@
--
--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_RELEASE_TYPE)
--_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\")
-+!!IF !isEmpty(CMAKE_STATIC_TYPE)
-+ _populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE_STATIC}\")
-+!!ELSE
-+ _populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\")
-+!!ENDIF
- !!ENDIF
- !!IF !isEmpty(CMAKE_DEBUG_TYPE)
--_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\")
-+!!IF !isEmpty(CMAKE_STATIC_TYPE)
-+ _populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG_STATIC}\")
-+!!ELSE
-+ _populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\")
-+!!ENDIF
- !!ENDIF
-
--list(APPEND Qt5$${CMAKE_MODULE_NAME}_PLUGINS Qt5::$$CMAKE_PLUGIN_NAME)
-+ list(APPEND Qt5$${CMAKE_MODULE_NAME}_PLUGINS Qt5::$$CMAKE_PLUGIN_NAME)
-+endif()
---- mkspecs/features/create_cmake.prf.orig 2016-08-14 20:44:32.513342200 +0200
-+++ mkspecs/features/create_cmake.prf 2016-08-19 16:04:30.073546600 +0200
-@@ -135,17 +135,19 @@
- CMAKE_PLUGIN_NAME = $$PLUGIN_CLASS_NAME
-
- win32 {
-- isEmpty(CMAKE_STATIC_TYPE) {
-+ mingw {
- CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${TARGET}.dll
- CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${TARGET}d.dll
-- } else:mingw {
-- CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${TARGET}.a
-- CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${TARGET}d.a
-+ CMAKE_PLUGIN_LOCATION_RELEASE_STATIC = $$PLUGIN_TYPE/lib$${TARGET}.a
-+ CMAKE_PLUGIN_LOCATION_DEBUG_STATIC = $$PLUGIN_TYPE/lib$${TARGET}d.a
- } else { # MSVC static
- CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${TARGET}.lib
- CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${TARGET}d.lib
-+ CMAKE_PLUGIN_LOCATION_RELEASE_STATIC = $$PLUGIN_TYPE/$${TARGET}.lib
-+ CMAKE_PLUGIN_LOCATION_DEBUG_STATIC = $$PLUGIN_TYPE/$${TARGET}d.lib
- }
- } else {
-+ # this branch is broken by the patch, only apply when building for Windows
- mac {
- isEmpty(CMAKE_STATIC_TYPE): CMAKE_PlUGIN_EXT = .dylib
- else: CMAKE_PlUGIN_EXT = .a
-@@ -161,7 +163,8 @@
- }
- }
- cmake_target_file.input = $$PWD/data/cmake/Qt5PluginTarget.cmake.in
-- cmake_target_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}_$${PLUGIN_CLASS_NAME}.cmake
-+ isEmpty(CMAKE_STATIC_TYPE): cmake_target_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}_$${PLUGIN_CLASS_NAME}.cmake
-+ else: cmake_target_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/StaticQt5$${CMAKE_MODULE_NAME}_$${PLUGIN_CLASS_NAME}.cmake
-
- !build_pass:QMAKE_SUBSTITUTES += \
- cmake_target_file
-@@ -180,6 +183,8 @@
- lib_deps =
- aux_mod_deps =
- aux_lib_deps =
-+aux_compile_defs_static = QT_STATIC QT_DESIGNER_STATIC
-+contains(QT_CONFIG, angle): aux_compile_defs += QT_OPENGL_ES_2_ANGLE_STATIC
- # Until CMake 3.0 is the minimum requirement of Qt 5, we need to filter
- # out header-only modules from dependencies. CMake 3.0 provides INTERFACE
- # libraries which are equivalent to header-only modules.
-@@ -197,10 +202,13 @@
- CMAKE_QT5_MODULE_DEPS = $$join(lib_deps, ";")
- CMAKE_INTERFACE_MODULE_DEPS = $$join(aux_mod_deps, ";")
- CMAKE_INTERFACE_QT5_MODULE_DEPS = $$join(aux_lib_deps, ";")
-+CMAKE_INTERFACE_COMPILE_DEFINITIONS_STATIC = $$join(aux_compile_defs_static, ";")
-+
-
- CMAKE_QT_STEM = Qt$$QT_MAJOR_VERSION$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}
-
- mac {
-+ # this branch is broken by the patch, only apply when building for Windows
- !isEmpty(CMAKE_STATIC_TYPE) {
- CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}_debug.a
- CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
-@@ -228,35 +236,33 @@
- CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqt5main$${QT_LIBINFIX}.a
- CMAKE_WINMAIN_FILE_LOCATION_RELEASE = libqt5main$${QT_LIBINFIX}.a
-
-- !isEmpty(CMAKE_STATIC_TYPE) {
-- CMAKE_STATIC_WINDOWS_BUILD = "true"
-- CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.a
-- CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
-+ isEmpty(QMAKE_EXTENSION_IMPORTLIB): QMAKE_EXTENSION_IMPORTLIB = dll.a
-+ CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.$${QMAKE_EXTENSION_IMPORTLIB}
-+ CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.$${QMAKE_EXTENSION_IMPORTLIB}
-+ CMAKE_PRL_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.prl
-+ CMAKE_PRL_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.prl
-+
-+ CMAKE_IMPLIB_FILE_LOCATION_DEBUG_STATIC = lib$${CMAKE_QT_STEM}d.a
-+ CMAKE_IMPLIB_FILE_LOCATION_RELEASE_STATIC = lib$${CMAKE_QT_STEM}.a
-+ CMAKE_PRL_FILE_LOCATION_DEBUG_STATIC = $${CMAKE_QT_STEM}d-static.prl
-+ CMAKE_PRL_FILE_LOCATION_RELEASE_STATIC = $${CMAKE_QT_STEM}-static.prl
-
-- CMAKE_PRL_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.prl
-- CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl
-- } else {
-- isEmpty(QMAKE_EXTENSION_IMPORTLIB): QMAKE_EXTENSION_IMPORTLIB = a
-- CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.$${QMAKE_EXTENSION_IMPORTLIB}
-- CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.$${QMAKE_EXTENSION_IMPORTLIB}
-- }
- } else {
- CMAKE_WINMAIN_FILE_LOCATION_DEBUG = qtmain$${QT_LIBINFIX}d.lib
- CMAKE_WINMAIN_FILE_LOCATION_RELEASE = qtmain$${QT_LIBINFIX}.lib
-
-- !isEmpty(CMAKE_STATIC_TYPE) {
-- CMAKE_STATIC_WINDOWS_BUILD = "true"
-- CMAKE_IMPLIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.lib
-- CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib
--
-- CMAKE_PRL_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.prl
-- CMAKE_PRL_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.prl
-- } else {
-- CMAKE_IMPLIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.lib
-- CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib
-- }
-+ CMAKE_IMPLIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.lib
-+ CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib
-+ CMAKE_PRL_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.prl
-+ CMAKE_PRL_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.prl
-+
-+ CMAKE_IMPLIB_FILE_LOCATION_DEBUG_STATIC = $${CMAKE_QT_STEM}d.lib
-+ CMAKE_IMPLIB_FILE_LOCATION_RELEASE_STATIC = $${CMAKE_QT_STEM}.lib
-+ CMAKE_PRL_FILE_LOCATION_DEBUG_STATIC = $${CMAKE_QT_STEM}d-static.prl
-+ CMAKE_PRL_FILE_LOCATION_RELEASE_STATIC = $${CMAKE_QT_STEM}-static.prl
- }
- } else {
-+ # this branch is broken by the patch, only apply when building for Windows
- !isEmpty(CMAKE_STATIC_TYPE) {
- CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.a
- CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
---- qmake/generators/makefile.cpp 2015-08-26 14:29:10.131124600 +0100
-+++ qmake/generators/makefile.cpp 2015-08-26 15:06:33.375635900 +0100
-@@ -1006,6 +1006,13 @@
- for (ProStringList::Iterator it = libs.begin(); it != libs.end(); ++it)
- t << qv(project->values((*it).toKey()));
- t << endl;
-+ t << "QMAKE_PRL_LIBS_FOR_CMAKE = ";
-+ QString sep;
-+ for (ProStringList::Iterator it = libs.begin(); it != libs.end(); ++it) {
-+ t << sep << project->values((*it).toKey()).join(';').replace('\\', "\\\\");
-+ sep = ';';
-+ }
-+ t << endl;
- }
- }
diff --git a/qt5-customize-extensions-for-static-build.patch b/qt5-customize-extensions-for-static-build.patch
deleted file mode 100644
index d9398200ddc..00000000000
--- a/qt5-customize-extensions-for-static-build.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- mkspecs/features/spec_pre.prf.orig 2016-06-10 08:48:56.000000000 +0200
-+++ mkspecs/features/spec_pre.prf 2016-08-09 16:42:35.000000000 +0200
-@@ -14,9 +14,9 @@
- 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_LIBTOOL = -static.la
-+QMAKE_EXT_PKGCONFIG = -static.pc
-+QMAKE_EXT_PRL = -static.prl
- QMAKE_EXT_UI = .ui
- QMAKE_EXT_YACC = .y
-
diff --git a/qt5-disable-default-lib-include-detection.patch b/qt5-disable-default-lib-include-detection.patch
deleted file mode 100644
index 64475b7e7a0..00000000000
--- a/qt5-disable-default-lib-include-detection.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/mkspecs/features/default_pre.prf 2016-06-25 18:44:50.952774100 +0200
-+++ b/mkspecs/features/default_pre.prf 2016-06-25 18:42:00.416181500 +0200
-@@ -29,7 +29,7 @@
- #
- # Get default include and library paths from compiler
- #
-- gcc {
-+ !win32:gcc {
- equals(QMAKE_DIR_SEP, /) {
- cmd_prefix = "LC_ALL=C"
- cmd_suffix = "</dev/null >/dev/null"
diff --git a/qt5-dont-add-resource-files-to-qmake-libs.patch b/qt5-dont-add-resource-files-to-qmake-libs.patch
deleted file mode 100644
index 838f2467e54..00000000000
--- a/qt5-dont-add-resource-files-to-qmake-libs.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- qtbase-opensource-src-5.2.0/qmake/generators/win32/mingw_make.cpp.orig 2014-01-04 21:18:07.413328813 +0100
-+++ qtbase-opensource-src-5.2.0/qmake/generators/win32/mingw_make.cpp 2014-01-04 21:18:55.740126515 +0100
-@@ -243,7 +243,7 @@
-
- processVars();
-
-- project->values("QMAKE_LIBS") += project->values("RES_FILE");
-+ project->values("OBJECTS") += project->values("RES_FILE");
-
- if (project->isActiveConfig("dll")) {
- QString destDir = "";
diff --git a/qt5-dont-build-host-libs-static.patch b/qt5-dont-build-host-libs-static.patch
deleted file mode 100644
index 9e430e4ff71..00000000000
--- a/qt5-dont-build-host-libs-static.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- mkspecs/features/qt_module.prf.orig 2013-07-31 20:37:56.789883201 +0200
-+++ mkspecs/features/qt_module.prf 2013-07-31 20:38:06.013034478 +0200
-@@ -25,7 +25,7 @@
-
- # Compile as shared/DLL or static according to the option given to configure
- # unless overridden. Host builds are always static
--host_build|staticlib: CONFIG += static
-+staticlib: CONFIG += static
-
- host_build {
- QT -= gui # no host module will ever use gui
---- src/tools/bootstrap-dbus/bootstrap-dbus.pro.orig 2013-12-08 11:09:47.000000000 -0600
-+++ src/tools/bootstrap-dbus/bootstrap-dbus.pro 2014-01-05 23:06:13.575543400 -0600
-@@ -30,4 +30,4 @@
- ../../dbus/qdbusunixfiledescriptor.cpp
-
- lib.CONFIG = dummy_install
--INSTALLS = lib
-+INSTALLS += lib
diff --git a/qt5-enable-rpath-for-host-tools.patch b/qt5-enable-rpath-for-host-tools.patch
deleted file mode 100644
index 2f2e96c7571..00000000000
--- a/qt5-enable-rpath-for-host-tools.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- qtbase-opensource-src-5.1.0/mkspecs/features/qt_app.prf.orig
-+++ qtbase-opensource-src-5.1.0/mkspecs/features/qt_app.prf
-@@ -20,6 +20,7 @@
- QMAKE_LFLAGS += $$QMAKE_LFLAGS_GCSECTIONS
-
- 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: CONFIG += release
- contains(QT, core(-private)?|xml) {
-@@ -30,7 +30,6 @@
- } else {
- !build_pass:contains(QT_CONFIG, debug_and_release):contains(QT_CONFIG, build_all): CONFIG += release
- target.path = $$[QT_INSTALL_BINS]
-- CONFIG += relative_qt_rpath # Qt's tools and apps should be relocatable
- }
- INSTALLS += target
-
diff --git a/qt5-fix-linking-against-static-dbus.patch b/qt5-fix-linking-against-static-dbus.patch
deleted file mode 100644
index b17ac71cff4..00000000000
--- a/qt5-fix-linking-against-static-dbus.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- config.tests/unix/dbus/dbus.cpp.orig 2015-03-08 17:05:21.216593135 +0100
-+++ config.tests/unix/dbus/dbus.cpp 2015-03-08 17:06:35.276826201 +0100
-@@ -31,6 +31,10 @@
- **
- ****************************************************************************/
-
-+#ifdef QT_STATIC
-+# define DBUS_STATIC_BUILD
-+#endif
-+
- #define DBUS_API_SUBJECT_TO_CHANGE
- #include <dbus/dbus.h>
-
- --- src/dbus/qdbus_symbols_p.h.orig 2016-06-10 08:48:56.000000000 +0200
- +++ src/dbus/qdbus_symbols_p.h 2016-08-14 00:23:15.325768622 +0200
- @@ -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
diff --git a/qt5-fix-linking-against-static-pcre.patch b/qt5-fix-linking-against-static-pcre.patch
deleted file mode 100644
index 3dd77468ed3..00000000000
--- a/qt5-fix-linking-against-static-pcre.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- qtbase-opensource-src-5.1.0/src/corelib/tools/qregularexpression.cpp.orig 2013-07-11 08:23:02.687691337 +0200
-+++ qtbase-opensource-src-5.1.0/src/corelib/tools/qregularexpression.cpp 2013-07-11 08:23:27.231900674 +0200
-@@ -47,6 +47,10 @@
- #include <QtCore/qatomic.h>
- #include <QtCore/qdatastream.h>
-
-+#ifdef QT_STATIC
-+#define PCRE_STATIC
-+#endif
-+
- #include <pcre.h>
-
- QT_BEGIN_NAMESPACE
diff --git a/qt5-fix-opengl-to-many-sections.patch b/qt5-fix-opengl-to-many-sections.patch
deleted file mode 100644
index f83fc54368c..00000000000
--- a/qt5-fix-opengl-to-many-sections.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- src/gui/opengl/opengl.pri.orig 2014-12-05 09:24:35.000000000 -0700
-+++ src/gui/opengl/opengl.pri 2015-02-09 10:48:48.484071754 -0700
-@@ -4,6 +4,7 @@
- contains(QT_CONFIG, opengles2):CONFIG += opengles2
-
- contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
-+ QMAKE_CXXFLAGS+="-Wa,-mbig-obj"
-
- HEADERS += opengl/qopengl.h \
- opengl/qopengl_p.h \
diff --git a/qt5-fix-static-psql-mysql.patch b/qt5-fix-static-psql-mysql.patch
deleted file mode 100644
index 3c308c57805..00000000000
--- a/qt5-fix-static-psql-mysql.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- config.tests/unix/psql/psql.pro.orig 2015-02-16 21:56:55.000000000 -0700
-+++ config.tests/unix/psql/psql.pro 2015-03-09 21:45:44.746755052 -0600
-@@ -1,3 +1,3 @@
- SOURCES = psql.cpp
- CONFIG -= qt dylib
--LIBS *= -lpq
-+LIBS *= -lpq -lintl -liconv -lssl -lcrypto -lwldap32 -lshfolder -lwsock32 -lws2_32 -lsecur32 -lgdi32
-
---- config.tests/unix/mysql/mysql.pro.orig 2015-02-16 21:56:55.000000000 -0700
-+++ config.tests/unix/mysql/mysql.pro 2015-03-09 21:38:59.930405876 -0600
-@@ -1,3 +1,3 @@
- SOURCES = mysql.cpp
- CONFIG -= qt dylib
--LIBS += -lmysqlclient
-+LIBS += -lmariadbclient -lws2_32 -lpthread -lz -lm -lssl -lcrypto
diff --git a/qt5-fixes-from-mxe.patch b/qt5-fixes-from-mxe.patch
deleted file mode 100644
index c40231a639d..00000000000
--- a/qt5-fixes-from-mxe.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-This file is part of MXE.
-See index.html for further information.
-
-Contains ad hoc patches for cross building.
-
-From 54b168c305f54e60de0e32501b166faa7f5913e0 Mon Sep 17 00:00:00 2001
-From: Mark Brand <mabrand@mabrand.nl>
-Date: Thu, 6 Aug 2015 23:35:08 +0200
-Subject: [PATCH 1/8] fix qwindows plugin linking with system-freetype (MXE
- specific)
-
-Change-Id: I8783e3ab2d19011b083dd3c471107298a17293c4
-
-diff --git a/src/3rdparty/freetype_dependency.pri b/src/3rdparty/freetype_dependency.pri
-index 39280de..e152b0d 100644
---- a/src/3rdparty/freetype_dependency.pri
-+++ b/src/3rdparty/freetype_dependency.pri
-@@ -4,4 +4,5 @@ contains(QT_CONFIG, freetype) {
- } else:contains(QT_CONFIG, system-freetype) {
- # pull in the proper freetype2 include directory
- include($$QT_SOURCE_TREE/config.tests/unix/freetype/freetype.pri)
-+ win32:shared:LIBS_PRIVATE += -lfreetype
- }
---
-2.5.0
-
-
-From fa5ca49b4ffc1911a597b294ef2d4b5ecb983cad Mon Sep 17 00:00:00 2001
-From: Mark Brand <mabrand@mabrand.nl>
-Date: Mon, 8 Dec 2014 14:15:12 +0100
-Subject: [PATCH 3/8] fix oci config test on windows
-
-Change-Id: If1ce2241682259ca495b0ba68bf18410f8548922
-
-diff --git a/config.tests/unix/oci/oci.pro b/config.tests/unix/oci/oci.pro
-index 3ffda1d..39b6f3759 100644
---- a/config.tests/unix/oci/oci.pro
-+++ b/config.tests/unix/oci/oci.pro
-@@ -1,3 +1,3 @@
- SOURCES = oci.cpp
- CONFIG -= qt dylib
--LIBS += -lclntsh
-+!win32:LIBS += -lclntsh
---
-2.5.0
-
-
-From 7fd641a032c7b4ce1b14d7ca02da646b0a0c34d5 Mon Sep 17 00:00:00 2001
-From: Mark Brand <mabrand@mabrand.nl>
-Date: Thu, 6 Aug 2015 13:24:56 +0200
-Subject: [PATCH 4/8] configure: don't set QT_NO_SYSTEMSEMAPHORE for Windows
-
-Change-Id: I53c110ef40e3d14cc49fa23aa5d294611cac2ffa
-
-diff --git a/configure b/configure
-index 7651e29..4a4b478 100755
---- a/configure
-+++ b/configure
-@@ -4575,7 +4575,7 @@ fi
- [ "$XPLATFORM_ANDROID" = "yes" ] && QMakeVar add styles "android"
-
- # check IPC support
--if ! compileTest unix/ipc_sysv "ipc_sysv" ; then
-+if [ "$XPLATFORM_MINGW" = "no" ] && ! compileTest unix/ipc_sysv "ipc_sysv" ; then
- # SYSV IPC is not supported - check POSIX IPC
- if compileTest unix/ipc_posix "ipc_posix" ; then
- QCONFIG_FLAGS="$QCONFIG_FLAGS QT_POSIX_IPC"
---
-2.5.0
-
-
-From 959d3a71bced8c00967a16f23c6f9305e56fafcd Mon Sep 17 00:00:00 2001
-From: Mark Brand <mabrand@mabrand.nl>
-Date: Tue, 6 Oct 2015 09:53:20 +0200
-Subject: [PATCH 5/8] fix building mysql driver under mingw
-
-Change-Id: I9c4e821d5b3a6919566c6b684cb4916827feb6a9
-
-diff --git a/src/sql/drivers/mysql/qsql_mysql.pri b/src/sql/drivers/mysql/qsql_mysql.pri
-index 3cfb614..8b7063f 100644
---- a/src/sql/drivers/mysql/qsql_mysql.pri
-+++ b/src/sql/drivers/mysql/qsql_mysql.pri
-@@ -4,7 +4,7 @@ SOURCES += $$PWD/qsql_mysql.cpp
- QMAKE_CXXFLAGS *= $$QT_CFLAGS_MYSQL
- LIBS += $$QT_LFLAGS_MYSQL
-
--unix {
-+if (unix|mingw) {
- isEmpty(QT_LFLAGS_MYSQL) {
- !contains(LIBS, .*mysqlclient.*):!contains(LIBS, .*mysqld.*) {
- use_libmysqlclient_r:LIBS += -lmysqlclient_r
diff --git a/qt5-merge-static-and-shared-library-trees.patch b/qt5-merge-static-and-shared-library-trees.patch
deleted file mode 100644
index 9e6271a6ea6..00000000000
--- a/qt5-merge-static-and-shared-library-trees.patch
+++ /dev/null
@@ -1,50 +0,0 @@
---- mkspecs/features/qt.prf.orig 2016-03-27 17:38:28.396736835 +0200
-+++ mkspecs/features/qt.prf 2016-03-27 18:09:17.061088857 +0200
-@@ -141,6 +141,18 @@
- }
- }
- }
-+
-+ win32:CONFIG(static) {
-+ isEqual(MODULE_NAME, QtCore) {
-+ LIBS$$var_sfx += $$QMAKE_LIBS_CORE
-+ } else:isEqual(MODULE_NAME, QtGui) {
-+ LIBS$$var_sfx += $$QMAKE_LIBS_GUI
-+ } else:isEqual(MODULE_NAME, QtNetwork) {
-+ LIBS$$var_sfx += $$QMAKE_LIBS_NETWORK
-+ } 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)")
-
---- mkspecs/features/default_post.prf.orig 2012-09-05 23:28:56.827501401 +0200
-+++ mkspecs/features/default_post.prf 2012-09-05 23:29:31.617923080 +0200
-@@ -47,3 +50,11 @@
-
- QMAKE_INCDIR += $$QMAKE_INCDIR_POST
- QMAKE_LIBDIR += $$QMAKE_LIBDIR_POST
-+
-+win32:contains(CONFIG, static) {
-+ DEFINES += QT_STATIC QT_DESIGNER_STATIC
-+ DEFINES -= QT_SHARED
-+ contains(QT_CONFIG, angle): DEFINES += QT_OPENGL_ES_2_ANGLE_STATIC
-+ QMAKE_LFLAGS += -static -static-libstdc++ -static-libgcc
-+ QMAKE_EXT_PRL=-static.prl # prevents qmake from finding the prl file for shared libs
-+}
---- configure.orig 2012-12-10 23:51:02.920255366 +0100
-+++ configure 2012-12-10 23:55:58.101753703 +0100
-@@ -6193,6 +6193,12 @@
- }
- QT_CONFIG += $QT_CONFIG
-
-+contains(CONFIG, static) {
-+ CONFIG -= shared
-+ QT_CONFIG += static jpeg gif
-+ QT_CONFIG -= shared
-+}
-+
- #versioning
- QT_VERSION = $QT_VERSION
- QT_MAJOR_VERSION = $QT_MAJOR_VERSION
diff --git a/qt5-pkgconfig-static-library-name-workaround.patch b/qt5-pkgconfig-static-library-name-workaround.patch
deleted file mode 100644
index 7065940164b..00000000000
--- a/qt5-pkgconfig-static-library-name-workaround.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- qtbase-opensource-src-5.6.0/mkspecs/features/qt_module.prf.orig 2016-04-09 13:13:38.374286031 +0200
-+++ qtbase-opensource-src-5.6.0/mkspecs/features/qt_module.prf 2016-04-09 13:24:04.292077922 +0200
-@@ -265,6 +265,16 @@
- pclib_replace.replace = $$QMAKE_PKGCONFIG_LIBDIR
- pclib_replace.CONFIG = path
- QMAKE_PKGCONFIG_INSTALL_REPLACE += pclib_replace
-+
-+ pclib_replace2.CONFIG = path
-+ pclib_replace2.match = " /lib"
-+ pclib_replace2.replace = "-l"
-+ QMAKE_PKGCONFIG_INSTALL_REPLACE += pclib_replace2
-+
-+ pclib_replace3.CONFIG = path
-+ pclib_replace3.match = "\.dll\.a"
-+ pclib_replace3.replace = ""
-+ QMAKE_PKGCONFIG_INSTALL_REPLACE += pclib_replace3
- }
- !lib_bundle:unix {
- CONFIG += create_libtool
diff --git a/qt5-prevent-debug-library-names-in-pkgconfig-files.patch b/qt5-prevent-debug-library-names-in-pkgconfig-files.patch
deleted file mode 100644
index 7d6836d5ab0..00000000000
--- a/qt5-prevent-debug-library-names-in-pkgconfig-files.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- qtbase-opensource-src-5.2.0/qmake/generators/makefile.cpp.orig 2014-01-03 01:30:23.631353708 +0100
-+++ qtbase-opensource-src-5.2.0/qmake/generators/makefile.cpp 2014-01-03 01:32:37.888625966 +0100
-@@ -3168,6 +3168,9 @@
- 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()) {
diff --git a/qt5-rename-qtmain-to-qt5main.patch b/qt5-rename-qtmain-to-qt5main.patch
deleted file mode 100644
index e81082f21ab..00000000000
--- a/qt5-rename-qtmain-to-qt5main.patch
+++ /dev/null
@@ -1,35 +0,0 @@
---- qtbase-opensource-src-5.2.1/src/winmain/winmain.pro.orig 2014-04-29 18:51:05.206296152 +0200
-+++ qtbase-opensource-src-5.2.1/src/winmain/winmain.pro 2014-04-29 18:51:18.737512221 +0200
-@@ -2,7 +2,7 @@
- !win32:error("$$_FILE_ is intended only for Windows!")
-
- TEMPLATE = lib
--TARGET = qtmain
-+TARGET = qt5main
- DESTDIR = $$QT.core.libs
-
- CONFIG += static
- --- qtbase-opensource-src-5.2.1/mkspecs/features/create_cmake.prf.orig 2014-04-29 18:53:49.511932034 +0200
- +++ qtbase-opensource-src-5.2.1/mkspecs/features/create_cmake.prf 2014-04-29 18:54:44.515819011 +0200
- @@ -203,8 +203,8 @@
- CMAKE_LIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.dll
-
- mingw {
- - CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqtmain$${QT_LIBINFIX}d.a
- - CMAKE_WINMAIN_FILE_LOCATION_RELEASE = libqtmain$${QT_LIBINFIX}.a
- + CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqt5main$${QT_LIBINFIX}.a
- + CMAKE_WINMAIN_FILE_LOCATION_RELEASE = libqt5main$${QT_LIBINFIX}.a
-
- !isEmpty(CMAKE_STATIC_TYPE) {
- CMAKE_STATIC_WINDOWS_BUILD = "true"
---- qtbase-opensource-src-5.3.1/mkspecs/features/win32/windows.prf.orig 2014-07-05 14:18:23.211155781 +0200
-+++ qtbase-opensource-src-5.3.1/mkspecs/features/win32/windows.prf 2014-07-05 14:18:46.045390147 +0200
-@@ -5,7 +5,7 @@
- mingw:DEFINES += QT_NEEDS_QMAIN
-
- qt:for(entryLib, $$list($$unique(QMAKE_LIBS_QT_ENTRY))) {
-- isEqual(entryLib, -lqtmain) {
-+ isEqual(entryLib, -lqt5main): {
- !contains(QMAKE_DEFAULT_LIBDIRS, $$QT.core.libs): \
- QMAKE_LIBS += -L$$QT.core.libs
- CONFIG(debug, debug|release): QMAKE_LIBS += $${entryLib}$${QT_LIBINFIX}d
diff --git a/qt5-use-correct-pkg-config-static-flags.patch b/qt5-use-correct-pkg-config-static-flags.patch
deleted file mode 100644
index 67b6a8e8dc3..00000000000
--- a/qt5-use-correct-pkg-config-static-flags.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- qtbase-opensource-src-5.4.1/configure.orig 2015-02-17 05:56:22.000000000 +0100
-+++ qtbase-opensource-src-5.4.1/configure 2015-03-21 17:08:54.138635641 +0100
-@@ -3884,6 +3884,11 @@
- # See if PKG_CONFIG is set in the mkspec:
- PKG_CONFIG="`"$outpath/bin/qmake" -E -nocache -spec "$XQMAKESPEC" "CONFIG=" $DEV_NULL 2>&1 | sed -n -e 's,^PKG_CONFIG = \(.*\),\1,p'`"
- [ -n "$PKG_CONFIG" ] && [ "$OPT_VERBOSE" = "yes" ] && echo "Found pkg-config from mkspec: $PKG_CONFIG"
-+
-+ if [ "$CFG_SHARED" = "no" ] ; then
-+ PKG_CONFIG="$PKG_CONFIG --static"
-+ [ "$OPT_VERBOSE" = "yes" ] && echo "Using '$PKG_CONFIG' because we're doing a static build"
-+ fi
- fi
- if [ -z "$PKG_CONFIG" ]; then
- PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null`
diff --git a/qt5-use-external-angle-library.patch b/qt5-use-external-angle-library.patch
deleted file mode 100644
index 383bb8c6f0d..00000000000
--- a/qt5-use-external-angle-library.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-diff -U 3 -r a/src/gui/gui.pro b/src/gui/gui.pro
---- a/src/gui/gui.pro 2015-06-29 14:04:55.000000000 -0600
-+++ b/src/gui/gui.pro 2015-07-18 10:50:02.228227482 -0600
-@@ -17,10 +17,5 @@
- imageformats \
- egldeviceintegrations
-
--# This is here only because the platform plugin is no module, obviously.
--win32:contains(QT_CONFIG, angle)|contains(QT_CONFIG, dynamicgl) {
-- MODULE_AUX_INCLUDES = \
-- \$\$QT_MODULE_INCLUDE_BASE/QtANGLE
--}
-
- # Code coverage with TestCocoon
-@@ -35,6 +29,10 @@
-
- mac:!ios: LIBS_PRIVATE += -framework Cocoa
-
-+win32:contains(QT_CONFIG, angle) {
-+ LIBS_PRIVATE += -lGLESv2
-+}
-+
- CONFIG += simd optimize_full
-
- include(accessible/accessible.pri)
-diff -U 3 -r a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
---- a/src/gui/Qt5GuiConfigExtras.cmake.in 2015-06-29 14:04:51.000000000 -0600
-+++ b/src/gui/Qt5GuiConfigExtras.cmake.in 2015-07-18 10:51:09.666053970 -0600
-@@ -2,9 +2,9 @@
- !!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE)
-
- !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
--set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR/QtANGLE\")
-+set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\")
- !!ELSE
--set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR/QtANGLE\")
-+set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\")
- !!ENDIF
-
- _qt5_Gui_check_file_exists(${Qt5Gui_EGL_INCLUDE_DIRS})
-diff -U 3 -r a/src/opengl/opengl.pro b/src/opengl/opengl.pro
---- a/src/opengl/opengl.pro 2015-06-29 14:04:05.000000000 -0600
-+++ b/src/opengl/opengl.pro 2015-07-18 10:46:46.588388411 -0600
-@@ -12,6 +12,7 @@
-
- contains(QT_CONFIG, opengl):CONFIG += opengl
- contains(QT_CONFIG, opengles2):CONFIG += opengles2
-+win32:contains(QT_CONFIG, angle): LIBS_PRIVATE += -lGLESv2
-
- HEADERS += qgl.h \
- qgl_p.h \
-
-diff -U 3 -r a/src/plugins/platforms/windows/windows.pri b/src/plugins/platforms/windows/windows.pri
---- a/src/plugins/platforms/windows/windows.pri 2015-06-29 14:04:40.000000000 -0600
-+++ b/src/plugins/platforms/windows/windows.pri 2015-07-18 10:53:45.585348009 -0600
-@@ -3,6 +3,7 @@
- !wince*:LIBS *= -luser32 -lwinspool -limm32 -lwinmm -loleaut32
-
- contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles2):!contains(QT_CONFIG, dynamicgl): LIBS *= -lopengl32
-+contains(QT_CONFIG, angle):LIBS += -lGLESv2 -lEGL
-
- mingw: LIBS *= -luuid
- # For the dialog helpers:
-diff -U 3 -r a/src/src.pro b/src/src.pro
---- a/src/src.pro 2015-06-29 14:05:06.000000000 -0600
-+++ b/src/src.pro 2015-07-18 10:43:01.698195194 -0600
-@@ -155,10 +155,6 @@
- SUBDIRS += src_3rdparty_harfbuzzng
- src_gui.depends += src_3rdparty_harfbuzzng
- }
-- win32:contains(QT_CONFIG, angle)|contains(QT_CONFIG, dynamicgl) {
-- SUBDIRS += src_angle
-- src_gui.depends += src_angle
-- }
- contains(QT_CONFIG, freetype) {
- SUBDIRS += src_3rdparty_freetype
- src_platformsupport.depends += src_3rdparty_freetype
diff --git a/qt5-use-pkgconfig-for-harfbuzz.patch b/qt5-use-pkgconfig-for-harfbuzz.patch
deleted file mode 100644
index 078538a008f..00000000000
--- a/qt5-use-pkgconfig-for-harfbuzz.patch
+++ /dev/null
@@ -1,31 +0,0 @@
---- src/3rdparty/harfbuzz_dependency.pri.orig 2016-08-12 22:07:40.467953900 +0200
-+++ src/3rdparty/harfbuzz_dependency.pri 2016-08-12 22:08:06.583981900 +0200
-@@ -2,5 +2,7 @@
- INCLUDEPATH += $$PWD/harfbuzz-ng/include
- LIBS_PRIVATE += -L$$QT_BUILD_TREE/lib -lqtharfbuzzng$$qtPlatformTargetSuffix()
- } else:contains(QT_CONFIG, system-harfbuzz) {
-- LIBS_PRIVATE += -lharfbuzz
-+ # can't use 'feature' link_pkgconfig here because it would add harfbuzz to LIBS rather than LIBS_PRIVATE
-+ contains(QT_CONFIG, static): LIBS_PRIVATE += $$system($$PKG_CONFIG --static --libs harfbuzz)
-+ else: LIBS_PRIVATE += $$system($$PKG_CONFIG --libs harfbuzz)
- }
-
---- config.tests/unix/harfbuzz/harfbuzz.pro.orig
-+++ config.tests/unix/harfbuzz/harfbuzz.pro
-@@ -1,3 +1,4 @@
- SOURCES = harfbuzz.cpp
- CONFIG -= qt dylib
--LIBS += -lharfbuzz
-+contains(CONFIG, static): LIBS += $$system($$PKG_CONFIG --static --libs harfbuzz)
-+else: LIBS += $$system($$PKG_CONFIG --libs harfbuzz)
-
---- mkspecs/win32-g++/qmake.conf.orig 2016-08-11 22:48:02.000000000 +0200
-+++ mkspecs/win32-g++/qmake.conf 2016-08-13 02:15:32.791706438 +0200
-@@ -97,6 +97,6 @@
- QMAKE_LIBS =
- QMAKE_LIBS_CORE = -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 -lz -lpcre16
--QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lws2_32 -lole32 -luuid -luser32 -ladvapi32 -ljpeg -lpng -lharfbuzz -lglib-2.0 -lintl -lwinmm
-+QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lws2_32 -lole32 -luuid -luser32 -ladvapi32 -ljpeg -lpng $$system($${CROSS_COMPILE}pkg-config --static --libs harfbuzz) $$system($${CROSS_COMPILE}pkg-config --static --libs freetype2)
- QMAKE_LIBS_NETWORK = -lws2_32 -lcrypt32 -ldnsapi
- QMAKE_LIBS_OPENGL = -lglu32 -lopengl32 -lgdi32 -luser32
- QMAKE_LIBS_OPENGL_ES2 = -l$${LIBEGL_NAME} -l$${LIBGLESV2_NAME} -ld3d9 -ldxguid -lgdi32 -luser32
diff --git a/qt5-use-system-zlib-in-host-libs.patch b/qt5-use-system-zlib-in-host-libs.patch
deleted file mode 100644
index 311e5a981d4..00000000000
--- a/qt5-use-system-zlib-in-host-libs.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/tools/bootstrap/bootstrap.pro.orig 2016-06-14 17:01:24.972134372 +0200
-+++ src/tools/bootstrap/bootstrap.pro 2016-05-25 17:46:17.000000000 +0200
-@@ -132,7 +132,7 @@
- ../../corelib/io/qstandardpaths_win.cpp
- }
-
--contains(QT_CONFIG, zlib)|cross_compile {
-+contains(QT_CONFIG, zlib) {
- include(../../3rdparty/zlib.pri)
- } else {
- CONFIG += no_core_dep
diff --git a/qt5-win32-static-cmake-link-ws2_32-and--static.patch b/qt5-win32-static-cmake-link-ws2_32-and--static.patch
deleted file mode 100644
index be20044903f..00000000000
--- a/qt5-win32-static-cmake-link-ws2_32-and--static.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- src/corelib/Qt5CoreConfigExtras.cmake.in.orig 2014-11-09 00:54:20.852201500 +0000
-+++ src/corelib/Qt5CoreConfigExtras.cmake.in 2014-11-09 00:55:52.437439900 +0000
-@@ -165,3 +165,12 @@
- set(_Qt5CTestMacros \"${_Qt5CoreConfigDir}/Qt5CTestMacros.cmake\")
-
- _qt5_Core_check_file_exists(${_Qt5CTestMacros})
-+
-+get_target_property(_libType Qt5::Core TYPE)
-+if(_libType STREQUAL \"STATIC_LIBRARY\" AND WIN32)
-+ set(_isExe $<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>)
-+ # INTERFACE_LINK_LIBRARIES is used to pass a linker flag (-static)
-+ # and a library (ws2_32)
-+ set_target_properties(Qt5::Core PROPERTIES \"INTERFACE_LINK_LIBRARIES\" \"$<${_isExe}:-static;ws2_32>\")
-+ unset(_isExe)
-+endif()