From 5c69d4978aa5bb7e9b14df96ec2c804f0c2cb752 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 27 Aug 2016 14:44:08 +0200 Subject: [PATCH] Add Qt 5 variant with dynamic ANGLE support --- qt5-base/mingw-w64-angle/PKGBUILD | 87 ++-- qt5-base/mingw-w64-dynamic/PKGBUILD | 449 ++++++++++++++++++ .../qt5-add-angle-support.patch | 46 ++ ...-allow-usage-of-static-qt-with-cmake.patch | 444 +++++++++++++++++ ...ustomize-extensions-for-static-build.patch | 15 + ...isable-default-lib-include-detection.patch | 11 + ...ont-add-resource-files-to-qmake-libs.patch | 11 + .../qt5-dont-build-host-libs-static.patch | 19 + .../qt5-enable-rpath-for-host-tools.patch | 18 + .../qt5-fix-implib-ext.patch | 84 ++++ .../qt5-fix-linking-against-static-dbus.patch | 26 + .../qt5-fix-linking-against-static-pcre.patch | 13 + .../qt5-fix-opengl-to-many-sections.patch | 10 + .../qt5-fix-static-psql-mysql.patch | 15 + .../qt5-fixes-from-mxe.patch | 91 ++++ ...erge-static-and-shared-library-trees.patch | 50 ++ ...onfig-static-library-name-workaround.patch | 19 + ...bug-library-names-in-pkgconfig-files.patch | 12 + .../qt5-rename-qtmain-to-qt5main.patch | 35 ++ ...-use-correct-pkg-config-static-flags.patch | 14 + .../qt5-use-external-angle-library.patch | 79 +++ .../qt5-use-pkgconfig-for-harfbuzz.patch | 31 ++ .../qt5-use-system-zlib-in-host-libs.patch | 11 + .../qt5-use-win32-g++-mkspecs-profile.patch | 58 +++ ...static-cmake-link-ws2_32-and--static.patch | 15 + ...5-workaround-pkgconfig-install-issue.patch | 46 ++ qt5-base/mingw-w64-static/PKGBUILD | 87 ++-- qt5-base/mingw-w64/PKGBUILD | 87 ++-- 28 files changed, 1799 insertions(+), 84 deletions(-) create mode 100644 qt5-base/mingw-w64-dynamic/PKGBUILD create mode 100644 qt5-base/mingw-w64-dynamic/qt5-add-angle-support.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-allow-usage-of-static-qt-with-cmake.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-customize-extensions-for-static-build.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-disable-default-lib-include-detection.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-dont-add-resource-files-to-qmake-libs.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-dont-build-host-libs-static.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-enable-rpath-for-host-tools.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-fix-implib-ext.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-fix-linking-against-static-dbus.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-fix-linking-against-static-pcre.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-fix-opengl-to-many-sections.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-fix-static-psql-mysql.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-fixes-from-mxe.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-merge-static-and-shared-library-trees.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-pkgconfig-static-library-name-workaround.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-prevent-debug-library-names-in-pkgconfig-files.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-rename-qtmain-to-qt5main.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-use-correct-pkg-config-static-flags.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-use-external-angle-library.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-use-pkgconfig-for-harfbuzz.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-use-system-zlib-in-host-libs.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-use-win32-g++-mkspecs-profile.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-win32-static-cmake-link-ws2_32-and--static.patch create mode 100644 qt5-base/mingw-w64-dynamic/qt5-workaround-pkgconfig-install-issue.patch diff --git a/qt5-base/mingw-w64-angle/PKGBUILD b/qt5-base/mingw-w64-angle/PKGBUILD index 4fd71d71..9a7d1ce2 100644 --- a/qt5-base/mingw-w64-angle/PKGBUILD +++ b/qt5-base/mingw-w64-angle/PKGBUILD @@ -6,14 +6,21 @@ # All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where # you also find the URL of a binary repository. -# There currently three variants of the package: -# - mingw-w64-qt5-base: includes dynamic libs only, using native OpenGL -# - mingw-w64-qt5-base-angle: includes dynamic libs only, using ANGLE, conflicts with OpenGL version -# - mingw-w64-qt5-base-static: includes static libs only, relies on mingw-w64-qt5-base for headers and tools +# 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 then native OpenGL +# - mingw-w64-qt5-base-dynamic: allows choosing between ANGLE and OpenGL dynamically at runtime +# - mingw-w64-qt5-base-noopenql: no OpenGL support +# The variants are conflicting (and hence can not be installed at the same time). +# See also: http://doc.qt.io/qt-5/windows-requirements.html#dynamically-loading-graphics-drivers -# By default CMake and qmake will link against the dynamic libary. +# The variants listed above only contain dynamic libraries. For building static libraries +# just append '-static' to the package name, eg. mingw-w64-qt5-base-static or mingw-w64-qt5-base-angle-static. +# The static variants rely on the corresponding dynamic variant for headers and tools. -# To use the static variant with CMake set the following variable before calling find_package for finding a Qt module: +# 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 a static plugin, add the corresponding imported target, eg. # target_link_libraries(target ... Qt5::QWindowsIntegrationPlugin) @@ -21,40 +28,49 @@ # #include # Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) -# To use the static variant with qmake set the following variables (either inside the *.pro file or as qmake argument): +# To use the static Qt libraries with qmake set the following variables (either inside the *.pro file or as qmake argument): # 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. # 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. +# 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. # Qt packages can be built in the following order (for example): -# qt5-base 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 +# 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 # Helper functions for the split builds -isStatic() { - [[ $pkgname = "mingw-w64-qt5-base-static" ]] || \ - [[ $pkgname == 'mingw-w64-qt5-base-angle-static' ]] || \ - [[ $pkgname == 'mingw-w64-qt5-base-noopengl-static' ]] -} -isOpenGL() { +isDefault() { [[ $pkgname = "mingw-w64-qt5-base" ]] || [[ $pkgname = "mingw-w64-qt5-base-static" ]] } +isStatic() { + [[ $pkgname = "mingw-w64-qt5-base-static" ]] || \ + [[ $pkgname = 'mingw-w64-qt5-base-angle-static' ]] || \ + [[ $pkgname = 'mingw-w64-qt5-base-opengl-static' ]] || \ + [[ $pkgname = 'mingw-w64-qt5-base-dynamic-static' ]] || \ + [[ $pkgname = 'mingw-w64-qt5-base-noopengl-static' ]] +} +isOpenGL() { + isDefault || \ # currently use native OpenGL by default + [[ $pkgname = "mingw-w64-qt5-base-opengl" ]] || [[ $pkgname = "mingw-w64-qt5-base-opengl-static" ]] \ +} isANGLE() { - [[ $pkgname == 'mingw-w64-qt5-base-angle' ]] || [[ $pkgname == 'mingw-w64-qt5-base-angle-static' ]] + [[ $pkgname = 'mingw-w64-qt5-base-angle' ]] || [[ $pkgname = 'mingw-w64-qt5-base-angle-static' ]] || \ + [[ $pkgname = "mingw-w64-qt5-base-dynamic" ]] || [[ $pkgname = "mingw-w64-qt5-base-dynamic-static" ]] # treat dynamic version like ANGLE version, correct? +} +isDynamic() { + [[ $pkgname = "mingw-w64-qt5-base-dynamic" ]] || [[ $pkgname = "mingw-w64-qt5-base-dynamic-static" ]] } isNoOpenGL() { - [[ $pkgname == 'mingw-w64-qt5-base-noopengl' ]] || [[ $pkgname == 'mingw-w64-qt5-base-noopengl-static' ]] + [[ $pkgname = 'mingw-w64-qt5-base-noopengl' ]] || [[ $pkgname = 'mingw-w64-qt5-base-noopengl-static' ]] } pkgname=mingw-w64-qt5-base-angle pkgver=5.7.0 -pkgrel=4 +pkgrel=5 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') @@ -120,13 +136,23 @@ md5sums=('184f9460b40752d71b15b827260580c2' _architectures='i686-w64-mingw32 x86_64-w64-mingw32' isStatic && depends+=(${pkgname%-static}) -isANGLE && depends+=('mingw-w64-angleproject') -if ! isOpenGL; then - provides+=('mingw-w64-qt5-base') - if isStatic; then - conflicts+=('mingw-w64-qt5-base-static' 'mingw-w64-qt5-base-angle-static' 'mingw-w64-qt5-base-noopengl-static') +if isANGLE; then + if isDynamic; then + makedepends+=('mingw-w64-angleproject') + optdepends+=('mingw-w64-angleproject: use ANGLE instead of native OpenGL') else - conflicts+=('mingw-w64-qt5-base' 'mingw-w64-qt5-base-angle' 'mingw-w64-qt5-base-noopengl') + depends+=('mingw-w64-angleproject') + fi +fi +if ! isDefault; then + if isStatic; then + provides+=('mingw-w64-qt5-base-static') + conflicts+=('mingw-w64-qt5-base-static' 'mingw-w64-qt5-base-angle-static' 'mingw-w64-qt5-base-noopengl-static' + 'mingw-w64-qt5-base-angle-dynamic-static' 'mingw-w64-qt5-base-angle-openql-static') + else + provides+=('mingw-w64-qt5-base') + conflicts+=('mingw-w64-qt5-base' 'mingw-w64-qt5-base-angle' 'mingw-w64-qt5-base-noopengl' + 'mingw-w64-qt5-base-angle-dynamic' 'mingw-w64-qt5-base-angle-openql') fi fi @@ -307,8 +333,13 @@ build() { qt_configure_args+=' -opengl desktop' elif isNoOpenGL; then qt_configure_args+=' -no-opengl' - else - # GL_GLEXT_PROTOTYPES must be defined to enable declarations GLES functions + elif isANGLE; then + if isDynamic; then + qt_configure_args+=' -opengl dynamic' + else + qt_configure_args+=' -opengl angle' + fi + # GL_GLEXT_PROTOTYPES must be defined to enable declarations of GLES functions qt_configure_args+=' -DGL_GLEXT_PROTOTYPES' fi # TODO: allow dynamic OpenGL configuration diff --git a/qt5-base/mingw-w64-dynamic/PKGBUILD b/qt5-base/mingw-w64-dynamic/PKGBUILD new file mode 100644 index 00000000..1ec4e399 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/PKGBUILD @@ -0,0 +1,449 @@ +# Maintainer: Martchus +# Contributor: ant32 +# Contributor: Filip Brcic +# Contributor: jellysheep + +# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where +# you also find the URL of a binary repository. + +# 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 then native OpenGL +# - mingw-w64-qt5-base-dynamic: allows choosing between ANGLE and OpenGL dynamically at runtime +# - mingw-w64-qt5-base-noopenql: no OpenGL support +# The variants are conflicting (and hence can not be installed at the same time). +# See also: http://doc.qt.io/qt-5/windows-requirements.html#dynamically-loading-graphics-drivers + +# The variants listed above only contain dynamic libraries. For building static libraries +# just append '-static' to the package name, eg. mingw-w64-qt5-base-static or mingw-w64-qt5-base-angle-static. +# The static variants rely on the corresponding dynamic variant for headers and tools. + +# 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 a static plugin, add the corresponding imported target, eg. +# target_link_libraries(target ... Qt5::QWindowsIntegrationPlugin) +# Automatically importing static plugins is currently not possible, though. Hence it is required to use Q_IMPORT_PLUGIN, eg. +# #include +# Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) + +# To use the static Qt libraries with qmake set the following variables (either inside the *.pro file or as qmake argument): +# 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. + +# 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. + +# 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 + +# Helper functions for the split builds +isDefault() { + [[ $pkgname = "mingw-w64-qt5-base" ]] || [[ $pkgname = "mingw-w64-qt5-base-static" ]] +} +isStatic() { + [[ $pkgname = "mingw-w64-qt5-base-static" ]] || \ + [[ $pkgname = 'mingw-w64-qt5-base-angle-static' ]] || \ + [[ $pkgname = 'mingw-w64-qt5-base-opengl-static' ]] || \ + [[ $pkgname = 'mingw-w64-qt5-base-dynamic-static' ]] || \ + [[ $pkgname = 'mingw-w64-qt5-base-noopengl-static' ]] +} +isOpenGL() { + isDefault || \ # currently use native OpenGL by default + [[ $pkgname = "mingw-w64-qt5-base-opengl" ]] || [[ $pkgname = "mingw-w64-qt5-base-opengl-static" ]] \ +} +isANGLE() { + [[ $pkgname = 'mingw-w64-qt5-base-angle' ]] || [[ $pkgname = 'mingw-w64-qt5-base-angle-static' ]] || \ + [[ $pkgname = "mingw-w64-qt5-base-dynamic" ]] || [[ $pkgname = "mingw-w64-qt5-base-dynamic-static" ]] # treat dynamic version like ANGLE version, correct? +} +isDynamic() { + [[ $pkgname = "mingw-w64-qt5-base-dynamic" ]] || [[ $pkgname = "mingw-w64-qt5-base-dynamic-static" ]] +} +isNoOpenGL() { + [[ $pkgname = 'mingw-w64-qt5-base-noopengl' ]] || [[ $pkgname = 'mingw-w64-qt5-base-noopengl-static' ]] +} + +pkgname=mingw-w64-qt5-base-dynamic +pkgver=5.7.0 +pkgrel=5 +pkgdesc="A cross-platform application and UI framework (mingw-w64)" +# the static variant doesn't contain any executables which need to be executed on the build machine +isStatic && arch=('any') || arch=('i686' 'x86_64') +url='https://www.qt.io/' +license=('GPL3' 'LGPL3' 'FDL' 'custom') +depends=('mingw-w64-crt' 'mingw-w64-zlib' 'mingw-w64-libjpeg-turbo' 'mingw-w64-sqlite' + 'mingw-w64-libpng' 'mingw-w64-openssl' 'mingw-w64-libdbus' 'mingw-w64-harfbuzz') +groups=('mingw-w64-qt' 'mingw-w64-qt5') +optdepends=('mingw-w64-postgresql-libs: PostgreSQL support' 'mingw-w64-mariadb-connector-c: MySQL support' + 'qtchooser') +makedepends=('mingw-w64-gcc' 'mingw-w64-postgresql-libs' '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-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") +md5sums=('184f9460b40752d71b15b827260580c2' + 'bab00ccc19d888997f323c80354a7c3f' + 'f7e1487de6e85116d9c6bde2eac4fb73' + 'bc99c4cc6998295d76f37ed681c20d47' + '370218fd439f25ab3f35bd1f14652988' + '4fe6523dd1c34398df3aa5a8763530cc' + 'f32a768e1acb9785c79c8e93aa266db2' + '3bd322551924543553a2bf81b4419a09' + '30fa9ddf8d842b1392e8d63868940657' + '99bb9f51ec684803768f36e407baf486' + '6a6bc88f35ac8080869de39bc128ce5b' + '261d9071a6af3f1d5c3f955da3781573' + 'f28edb1fe61c575522d3df814e680f9a' + 'c15d9f480d0248648fa52aeacb46e3c7' + '612a4dfb9f1a3898a1920c28bb999159' + 'd0eb81aef1a21c65813fe4ddabbc4206' + '1e8c03872062fe8499ed7786475ed4e0' + '83139869355c2d46921adb25e47cf0fa' + 'b9565219e9252a17fc1b8fb9ee30662c' + '20de722808e8a3fb684b0212bef8de46' + '1dc792faa7761d8d7d2f17170da04d6b' + '41ec67d9e5e70e0d6d93b42aebd0e12a' + '61c0f9d0095c5a6dec8d14e9ec35a608' + 'bba65d27704cf36e148d8f18ad02ad15') + +_architectures='i686-w64-mingw32 x86_64-w64-mingw32' + +isStatic && depends+=(${pkgname%-static}) +if isANGLE; then + if isDynamic; then + makedepends+=('mingw-w64-angleproject') + optdepends+=('mingw-w64-angleproject: use ANGLE instead of native OpenGL') + else + depends+=('mingw-w64-angleproject') + fi +fi +if ! isDefault; then + if isStatic; then + provides+=('mingw-w64-qt5-base-static') + conflicts+=('mingw-w64-qt5-base-static' 'mingw-w64-qt5-base-angle-static' 'mingw-w64-qt5-base-noopengl-static' + 'mingw-w64-qt5-base-angle-dynamic-static' 'mingw-w64-qt5-base-angle-openql-static') + else + provides+=('mingw-w64-qt5-base') + conflicts+=('mingw-w64-qt5-base' 'mingw-w64-qt5-base-angle' 'mingw-w64-qt5-base-noopengl' + 'mingw-w64-qt5-base-angle-dynamic' 'mingw-w64-qt5-base-angle-openql') + fi +fi + +patch() { + local input_found= + local patch_file= + for arg in $@; do + if [[ $input_found ]]; then + patch_file="$arg" + break + fi + [[ $arg == -i ]] && input_found=1 + done + msg2 "Applying patch $patch_file" + /usr/bin/patch $@ +} + +prepare() { + cd "${srcdir}/${_pkgfqn}" + + # include fixes from MXE + patch -p1 -b -i ../qt5-fixes-from-mxe.patch + + if isANGLE; then + # Add support for Angle + patch -p1 -i ../qt5-add-angle-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 + + # Fix opengl to many sections error + isOpenGL && 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 %%_libdir 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 + + # Make sure the Qt5 build system uses our external ANGLE library + rm -rf src/3rdparty/angle include/QtANGLE/{EGL,GLES2,GLES3,KHR} + + # As well as our external PCRE library and zlib + rm -rf src/3rdparty/{pcre,zlib} +} + +build() { + cd "${srcdir}/${_pkgfqn}" + + # Setup flags + local mingw_flags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4' + export CFLAGS="$mingw_flags" + export CXXFLAGS="$mingw_flags" + unset LDFLAGS + + for _arch in ${_architectures}; do + # Phonon is disabled for now because we lack the directx headers + # 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 + qt_configure_args="\ + -xplatform win32-g++ \ + -optimized-qmake \ + -verbose \ + -opensource \ + -confirm-license \ + -force-pkg-config \ + -force-debug-info \ + -audio-backend \ + -system-zlib \ + -system-libpng \ + -system-libjpeg \ + -system-sqlite \ + -system-harfbuzz \ + -no-fontconfig \ + -iconv \ + -openssl \ + -dbus-linked \ + -no-glib \ + -no-icu \ + -release \ + -nomake examples \ + -make tools \ + -hostprefix /usr/${_arch} \ + -hostdatadir /usr/${_arch}/lib/qt \ + -hostbindir /usr/${_arch}/lib/qt/bin \ + -prefix /usr/${_arch} \ + -bindir /usr/${_arch}/bin \ + -archdatadir /usr/${_arch}/lib/qt \ + -datadir /usr/${_arch}/share/qt \ + -docdir /usr/${_arch}/share/doc/qt \ + -examplesdir /usr/${_arch}/share/qt/examples \ + -headerdir /usr/${_arch}/include/qt \ + -libdir /usr/${_arch}/lib \ + -plugindir /usr/${_arch}/lib/qt/plugins \ + -sysconfdir /usr/${_arch}/etc \ + -translationdir /usr/${_arch}/share/qt/translations \ + -device-option CROSS_COMPILE=${_arch}-" + + # Fix include directory of dbus + qt_configure_args+=" $(${_arch}-pkg-config --cflags-only-I dbus-1 --cflags)" + + # Configure usage of ANGLE/OpenGL + if isOpenGL; then + qt_configure_args+=' -opengl desktop' + elif isNoOpenGL; then + qt_configure_args+=' -no-opengl' + elif isANGLE; then + if isDynamic; then + qt_configure_args+=' -opengl dynamic' + else + qt_configure_args+=' -opengl angle' + fi + # GL_GLEXT_PROTOTYPES must be defined to enable declarations of GLES functions + qt_configure_args+=' -DGL_GLEXT_PROTOTYPES' + fi + # TODO: allow dynamic OpenGL configuration + + unset PKG_CONFIG_PATH + + # Fix MySQL + if ! isStatic; then + export QT_LFLAGS_MYSQL="-L/usr/${_arch}/lib -lmysql" + fi + # Qt doesn't detect mysql correctly, so use this: + export QT_CFLAGS_MYSQL="-I/usr/${_arch}/include/mariadb" + # Hardcode MySQL flags into configure (really nice solution :( ) + sed -e "s|^QT_CFLAGS_MYSQL=.*$|QT_CFLAGS_MYSQL=\"${QT_CFLAGS_MYSQL}\"|g" -i "${srcdir}/${_pkgfqn}/configure" + sed -e "s|^QT_LFLAGS_MYSQL=.*$|QT_LFLAGS_MYSQL=\"${QT_LFLAGS_MYSQL}\"|g" -i "${srcdir}/${_pkgfqn}/configure" + #sed -e "s|^QT_LFLAGS_MYSQL_R=.*$|QT_LFLAGS_MYSQL_R=\"${QT_LFLAGS_MYSQL_R}\"|g" -i "${srcdir}/${_pkgfqn}/configure" + qt_configure_args_mysql="-mysql_config /this/file/should/not/exist" + # TODO: test whether this workaround is still requried + + mkdir -p ../build-${_arch} && pushd ../build-${_arch} + + if isStatic; then + ../${_pkgfqn}/configure -static $qt_configure_args $qt_configure_args_mysql + make + else + # The LD_LIBRARY_PATH override is needed because libQt5Bootstrap* are shared + # libraries which various compiled tools (like moc) use. As the libQt5Bootstrap* + # libraries aren't installed at this point yet, we have to workaround this + ../${_pkgfqn}/configure -shared $qt_configure_args $qt_configure_args_mysql + LD_LIBRARY_PATH="$PWD/lib" LDFLAGS="-L$PWD/lib" make + fi + popd + done +} + +package() { + for _arch in ${_architectures}; do + cd "$srcdir/${_pkgfqn}" + make install -C ../build-${_arch} INSTALL_ROOT="${pkgdir}" + + if isStatic; then + # The static release contains only the static libs itself but relies on the + # shared release for Qt5Bootstrap library and tools (qmake, uic, ...) + + # Drop Qt5Bootstrap and libraries which are only provided as statically + # and are hence already present in the shared version + 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* + + # 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} + + # Move pri files back + mkdir -p "${pkgdir}/usr/${_arch}/lib/qt/mkspecs/modules" + mv "${pkgdir}/usr/${_arch}/"*.pri "${pkgdir}/usr/${_arch}/lib/qt/mkspecs/modules" + + else # Shared release + # The .dll's are installed in both bindir and libdir, one copy of the .dll's is sufficient + find "${pkgdir}/usr/${_arch}/lib" -maxdepth 1 -name "*.dll" -exec rm {} \; + + # 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" + + # Create symlinks for tools + mkdir -p "${pkgdir}/usr/bin" + for tool in qmake moc rcc uic qdbuscpp2xml qdbusxml2cpp qdoc syncqt.pl; do + ln -s "../${_arch}/lib/qt/bin/${tool}" "${pkgdir}/usr/bin/${_arch}-${tool}-qt5" + done + fi + + # Remove doc + rm -rf "${pkgdir}/usr/${_arch}/share/doc" + + # Strip the binaries + if ! isStatic; then + strip --strip-all "${pkgdir}/usr/${_arch}/lib/qt/bin/"*[!.pl] + strip --strip-unneeded "${pkgdir}/usr/${_arch}/lib/libQt5Bootstrap"{,DBus}.so.${pkgver} + fi + + # Applications might be useful as well; keeping them by default will not hurt anybody I suppose + if isStatic || [[ $NO_EXECUTABLES ]]; then + find "${pkgdir}/usr/${_arch}" -name "*.exe" -exec rm {} \; + else + find "${pkgdir}/usr/${_arch}" -name "*.exe" -exec ${_arch}-strip --strip-all {} \; + fi + # No use for these files though + find "${pkgdir}/usr/${_arch}" \( -name "*.bat" -o -name "*.def" -o -name "*.exp" \) -exec rm {} \; + # Strip binaries + find "${pkgdir}/usr/${_arch}" -name "*.dll" -exec ${_arch}-strip --strip-unneeded {} \; + find "${pkgdir}/usr/${_arch}" -name "*.a" -exec ${_arch}-strip -g {} \; + done +} diff --git a/qt5-base/mingw-w64-dynamic/qt5-add-angle-support.patch b/qt5-base/mingw-w64-dynamic/qt5-add-angle-support.patch new file mode 100644 index 00000000..8b9af40a --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-add-angle-support.patch @@ -0,0 +1,46 @@ +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 + + #include ++#ifndef QT_OPENGL_ES_2 + #include ++#endif + + // #define DEBUG_GL + diff --git a/qt5-base/mingw-w64-dynamic/qt5-allow-usage-of-static-qt-with-cmake.patch b/qt5-base/mingw-w64-dynamic/qt5-allow-usage-of-static-qt-with-cmake.patch new file mode 100644 index 00000000..844db1e7 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-allow-usage-of-static-qt-with-cmake.patch @@ -0,0 +1,444 @@ +--- 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-18 23:22:00.447257800 +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-06-10 08:48:56.000000000 +0200 ++++ mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in 2016-08-18 23:22:41.994211700 +0200 +@@ -2,10 +2,18 @@ + add_library(Qt5::$$CMAKE_PLUGIN_NAME MODULE IMPORTED) + + !!IF !isEmpty(CMAKE_RELEASE_TYPE) ++!!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) ++!!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) +--- mkspecs/features/create_cmake.prf.orig 2016-08-14 20:44:32.513342200 +0200 ++++ mkspecs/features/create_cmake.prf 2016-08-18 22:47:39.606635000 +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-base/mingw-w64-dynamic/qt5-customize-extensions-for-static-build.patch b/qt5-base/mingw-w64-dynamic/qt5-customize-extensions-for-static-build.patch new file mode 100644 index 00000000..d9398200 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-customize-extensions-for-static-build.patch @@ -0,0 +1,15 @@ +--- 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-base/mingw-w64-dynamic/qt5-disable-default-lib-include-detection.patch b/qt5-base/mingw-w64-dynamic/qt5-disable-default-lib-include-detection.patch new file mode 100644 index 00000000..64475b7e --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-disable-default-lib-include-detection.patch @@ -0,0 +1,11 @@ +--- 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" diff --git a/qt5-base/mingw-w64-dynamic/qt5-dont-add-resource-files-to-qmake-libs.patch b/qt5-base/mingw-w64-dynamic/qt5-dont-add-resource-files-to-qmake-libs.patch new file mode 100644 index 00000000..838f2467 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-dont-add-resource-files-to-qmake-libs.patch @@ -0,0 +1,11 @@ +--- 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-base/mingw-w64-dynamic/qt5-dont-build-host-libs-static.patch b/qt5-base/mingw-w64-dynamic/qt5-dont-build-host-libs-static.patch new file mode 100644 index 00000000..9e430e4f --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-dont-build-host-libs-static.patch @@ -0,0 +1,19 @@ +--- 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-base/mingw-w64-dynamic/qt5-enable-rpath-for-host-tools.patch b/qt5-base/mingw-w64-dynamic/qt5-enable-rpath-for-host-tools.patch new file mode 100644 index 00000000..2f2e96c7 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-enable-rpath-for-host-tools.patch @@ -0,0 +1,18 @@ +--- 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-base/mingw-w64-dynamic/qt5-fix-implib-ext.patch b/qt5-base/mingw-w64-dynamic/qt5-fix-implib-ext.patch new file mode 100644 index 00000000..65612d72 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-fix-implib-ext.patch @@ -0,0 +1,84 @@ +From f09d23b9cd22771e04f49b386e3b67df8ad108c3 Mon Sep 17 00:00:00 2001 +From: Ray Donnelly +Date: Mon, 10 Mar 2014 22:59:39 +0000 +Subject: [PATCH] win32-g++: Add QMAKE_EXTENSION_IMPORTLIB defaulting to 'a' + +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(-) + +diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf +index 82e2812..2d8a043 100644 +--- a/mkspecs/features/create_cmake.prf ++++ b/mkspecs/features/create_cmake.prf +@@ -214,8 +214,9 @@ mac { + CMAKE_PRL_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.prl + CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl + } else { +- 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 = 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 +diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf +index 6d5764f..77e910b 100644 +--- a/mkspecs/win32-g++/qmake.conf ++++ b/mkspecs/win32-g++/qmake.conf +@@ -92,7 +92,7 @@ + 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 +diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp +index 6d5764f..77e910b 100644 +--- a/qmake/generators/win32/winmakefile.cpp ++++ b/qmake/generators/win32/winmakefile.cpp +@@ -85,10 +85,14 @@ + bool + Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) + { +- ProStringList impexts = project->values("QMAKE_LIB_EXTENSIONS"); +- if (impexts.isEmpty()) +- impexts = project->values("QMAKE_EXTENSION_STATICLIB"); +- QList dirs; ++ ProStringList impexts; ++ if (project->isActiveConfig("staticlib")) { ++ impexts.append(project->values("QMAKE_EXTENSION_STATICLIB")); ++ } else { ++ impexts.append(project->values("QMAKE_EXTENSION_IMPORTLIB")); ++ impexts.append(project->values("QMAKE_EXTENSION_STATICLIB")); ++ } ++ QList dirs; + 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 @@ + if (!project->values("QMAKE_APP_FLAG").isEmpty()) { + project->values("TARGET_EXT").append(".exe"); + } else if (project->isActiveConfig("shared")) { ++ ProString impext = project->first("QMAKE_EXTENSION_IMPORTLIB"); ++ if (impext.isEmpty()) ++ impext = project->first("QMAKE_PREFIX_STATICLIB"); + project->values("LIB_TARGET").prepend(project->first("QMAKE_PREFIX_STATICLIB") + + project->first("TARGET") + project->first("TARGET_VERSION_EXT") +- + '.' + project->first("QMAKE_EXTENSION_STATICLIB")); ++ + '.' + impext); + project->values("TARGET_EXT").append(project->first("TARGET_VERSION_EXT") + "." + + project->first("QMAKE_EXTENSION_SHLIB")); + project->values("TARGET").first() = project->first("QMAKE_PREFIX_SHLIB") + project->first("TARGET"); diff --git a/qt5-base/mingw-w64-dynamic/qt5-fix-linking-against-static-dbus.patch b/qt5-base/mingw-w64-dynamic/qt5-fix-linking-against-static-dbus.patch new file mode 100644 index 00000000..b17ac71c --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-fix-linking-against-static-dbus.patch @@ -0,0 +1,26 @@ +--- 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 + + --- 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 + #else diff --git a/qt5-base/mingw-w64-dynamic/qt5-fix-linking-against-static-pcre.patch b/qt5-base/mingw-w64-dynamic/qt5-fix-linking-against-static-pcre.patch new file mode 100644 index 00000000..3dd77468 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-fix-linking-against-static-pcre.patch @@ -0,0 +1,13 @@ +--- 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 + #include + ++#ifdef QT_STATIC ++#define PCRE_STATIC ++#endif ++ + #include + + QT_BEGIN_NAMESPACE diff --git a/qt5-base/mingw-w64-dynamic/qt5-fix-opengl-to-many-sections.patch b/qt5-base/mingw-w64-dynamic/qt5-fix-opengl-to-many-sections.patch new file mode 100644 index 00000000..f83fc543 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-fix-opengl-to-many-sections.patch @@ -0,0 +1,10 @@ +--- 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-base/mingw-w64-dynamic/qt5-fix-static-psql-mysql.patch b/qt5-base/mingw-w64-dynamic/qt5-fix-static-psql-mysql.patch new file mode 100644 index 00000000..3c308c57 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-fix-static-psql-mysql.patch @@ -0,0 +1,15 @@ +--- 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-base/mingw-w64-dynamic/qt5-fixes-from-mxe.patch b/qt5-base/mingw-w64-dynamic/qt5-fixes-from-mxe.patch new file mode 100644 index 00000000..c40231a6 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-fixes-from-mxe.patch @@ -0,0 +1,91 @@ +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 +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 +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 +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 +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-base/mingw-w64-dynamic/qt5-merge-static-and-shared-library-trees.patch b/qt5-base/mingw-w64-dynamic/qt5-merge-static-and-shared-library-trees.patch new file mode 100644 index 00000000..9e6271a6 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-merge-static-and-shared-library-trees.patch @@ -0,0 +1,50 @@ +--- 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-base/mingw-w64-dynamic/qt5-pkgconfig-static-library-name-workaround.patch b/qt5-base/mingw-w64-dynamic/qt5-pkgconfig-static-library-name-workaround.patch new file mode 100644 index 00000000..70659401 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-pkgconfig-static-library-name-workaround.patch @@ -0,0 +1,19 @@ +--- 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-base/mingw-w64-dynamic/qt5-prevent-debug-library-names-in-pkgconfig-files.patch b/qt5-base/mingw-w64-dynamic/qt5-prevent-debug-library-names-in-pkgconfig-files.patch new file mode 100644 index 00000000..7d6836d5 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-prevent-debug-library-names-in-pkgconfig-files.patch @@ -0,0 +1,12 @@ +--- 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-base/mingw-w64-dynamic/qt5-rename-qtmain-to-qt5main.patch b/qt5-base/mingw-w64-dynamic/qt5-rename-qtmain-to-qt5main.patch new file mode 100644 index 00000000..e81082f2 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-rename-qtmain-to-qt5main.patch @@ -0,0 +1,35 @@ +--- 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-base/mingw-w64-dynamic/qt5-use-correct-pkg-config-static-flags.patch b/qt5-base/mingw-w64-dynamic/qt5-use-correct-pkg-config-static-flags.patch new file mode 100644 index 00000000..67b6a8e8 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-use-correct-pkg-config-static-flags.patch @@ -0,0 +1,14 @@ +--- 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-base/mingw-w64-dynamic/qt5-use-external-angle-library.patch b/qt5-base/mingw-w64-dynamic/qt5-use-external-angle-library.patch new file mode 100644 index 00000000..bbdda149 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-use-external-angle-library.patch @@ -0,0 +1,79 @@ +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,9 @@ + + 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-base/mingw-w64-dynamic/qt5-use-pkgconfig-for-harfbuzz.patch b/qt5-base/mingw-w64-dynamic/qt5-use-pkgconfig-for-harfbuzz.patch new file mode 100644 index 00000000..82c684e1 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-use-pkgconfig-for-harfbuzz.patch @@ -0,0 +1,31 @@ +--- 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) + 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-base/mingw-w64-dynamic/qt5-use-system-zlib-in-host-libs.patch b/qt5-base/mingw-w64-dynamic/qt5-use-system-zlib-in-host-libs.patch new file mode 100644 index 00000000..311e5a98 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-use-system-zlib-in-host-libs.patch @@ -0,0 +1,11 @@ +--- 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-base/mingw-w64-dynamic/qt5-use-win32-g++-mkspecs-profile.patch b/qt5-base/mingw-w64-dynamic/qt5-use-win32-g++-mkspecs-profile.patch new file mode 100644 index 00000000..004eacdc --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-use-win32-g++-mkspecs-profile.patch @@ -0,0 +1,58 @@ +--- 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 @@ + QMAKE_LEXFLAGS = + QMAKE_YACC = byacc + 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 + QMAKE_CFLAGS_DEPS = -M + QMAKE_CFLAGS_WARN_ON = -Wall -Wextra + QMAKE_CFLAGS_WARN_OFF = -w +@@ -67,10 +67,10 @@ + + QMAKE_LINK = $${CROSS_COMPILE}g++ + QMAKE_LINK_C = $${CROSS_COMPILE}gcc +-QMAKE_LFLAGS = ++QMAKE_LFLAGS = -g + QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads + QMAKE_LFLAGS_EXCEPTIONS_OFF = +-QMAKE_LFLAGS_RELEASE = -Wl,-s ++QMAKE_LFLAGS_RELEASE = + QMAKE_LFLAGS_DEBUG = + QMAKE_LFLAGS_CONSOLE = -Wl,-subsystem,console + QMAKE_LFLAGS_WINDOWS = -Wl,-subsystem,windows +@@ -95,21 +95,26 @@ + 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_NETWORK = -lws2_32 -lcrypt32 -ldnsapi + QMAKE_LIBS_OPENGL = -lglu32 -lopengl32 -lgdi32 -luser32 +-QMAKE_LIBS_OPENGL_ES2 = -l$${LIBEGL_NAME} -l$${LIBGLESV2_NAME} -lgdi32 -luser32 +-QMAKE_LIBS_OPENGL_ES2_DEBUG = -l$${LIBEGL_NAME}d -l$${LIBGLESV2_NAME}d -lgdi32 -luser32 ++QMAKE_LIBS_OPENGL_ES2 = -l$${LIBEGL_NAME} -l$${LIBGLESV2_NAME} -ld3d9 -ldxguid -lgdi32 -luser32 ++QMAKE_LIBS_OPENGL_ES2_DEBUG = -l$${LIBEGL_NAME} -l$${LIBGLESV2_NAME} -ld3d9 -ldxguid -lgdi32 -luser32 + QMAKE_LIBS_COMPAT = -ladvapi32 -lshell32 -lcomdlg32 -luser32 -lgdi32 -lws2_32 +-QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain ++QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqt5main + +-QMAKE_IDL = midl ++QMAKE_IDL = $${CROSS_COMPILE}widl + QMAKE_LIB = $${CROSS_COMPILE}ar -rc + QMAKE_RC = $${CROSS_COMPILE}windres ++QMAKE_DLLTOOL = $${CROSS_COMPILE}dlltool ++QMAKE_LRELEASE = $${CROSS_COMPILE}lrelease-qt5 + + QMAKE_STRIP = $${CROSS_COMPILE}strip + QMAKE_STRIPFLAGS_LIB += --strip-unneeded + QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy + QMAKE_NM = $${CROSS_COMPILE}nm -P ++ ++PKG_CONFIG = $${CROSS_COMPILE}pkg-config ++ + load(qt_config) diff --git a/qt5-base/mingw-w64-dynamic/qt5-win32-static-cmake-link-ws2_32-and--static.patch b/qt5-base/mingw-w64-dynamic/qt5-win32-static-cmake-link-ws2_32-and--static.patch new file mode 100644 index 00000000..be200449 --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-win32-static-cmake-link-ws2_32-and--static.patch @@ -0,0 +1,15 @@ +--- 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 $,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() diff --git a/qt5-base/mingw-w64-dynamic/qt5-workaround-pkgconfig-install-issue.patch b/qt5-base/mingw-w64-dynamic/qt5-workaround-pkgconfig-install-issue.patch new file mode 100644 index 00000000..46e561aa --- /dev/null +++ b/qt5-base/mingw-w64-dynamic/qt5-workaround-pkgconfig-install-issue.patch @@ -0,0 +1,46 @@ +--- 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 @@ + } + + QString +-MakefileGenerator::pkgConfigFileName(bool fixify) ++MakefileGenerator::pkgConfigFileName(bool fixify, bool onlyPrependDestdir) + { + QString ret = project->first("QMAKE_PKGCONFIG_FILE").toQString(); + if (ret.isEmpty()) { +@@ -3134,7 +3134,11 @@ + if(fixify) { + if(QDir::isRelativePath(ret) && !project->isEmpty("DESTDIR")) + ret.prepend(project->first("DESTDIR").toQString()); +- ret = fileFixify(ret, FileFixifyBackwards); ++ if (onlyPrependDestdir) { ++ ret = Option::fixPathToLocalOS(ret); ++ } else { ++ ret = fileFixify(ret, FileFixifyBackwards); ++ } + } + return ret; + } +--- 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 @@ + virtual void writeDefaultVariables(QTextStream &t); + + QString pkgConfigPrefix() const; +- QString pkgConfigFileName(bool fixify=true); ++ QString pkgConfigFileName(bool fixify=true, bool onlyPrependDestdir = false); + QString pkgConfigFixPath(QString) const; + void writePkgConfigFile(); // for pkg-config + +--- 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 @@ + } + if(!ret.isEmpty()) + ret += "\n\t"; +- ret += installMetaFile(ProKey("QMAKE_PKGCONFIG_INSTALL_REPLACE"), pkgConfigFileName(true), dst_pc); ++ ret += installMetaFile(ProKey("QMAKE_PKGCONFIG_INSTALL_REPLACE"), pkgConfigFileName(true, true), dst_pc); + if(!uninst.isEmpty()) + uninst.append("\n\t"); + uninst.append("-$(DEL_FILE) " + escapeFilePath(dst_pc)); diff --git a/qt5-base/mingw-w64-static/PKGBUILD b/qt5-base/mingw-w64-static/PKGBUILD index b16d3ec5..2c03a4c1 100644 --- a/qt5-base/mingw-w64-static/PKGBUILD +++ b/qt5-base/mingw-w64-static/PKGBUILD @@ -6,14 +6,21 @@ # All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where # you also find the URL of a binary repository. -# There currently three variants of the package: -# - mingw-w64-qt5-base: includes dynamic libs only, using native OpenGL -# - mingw-w64-qt5-base-angle: includes dynamic libs only, using ANGLE, conflicts with OpenGL version -# - mingw-w64-qt5-base-static: includes static libs only, relies on mingw-w64-qt5-base for headers and tools +# 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 then native OpenGL +# - mingw-w64-qt5-base-dynamic: allows choosing between ANGLE and OpenGL dynamically at runtime +# - mingw-w64-qt5-base-noopenql: no OpenGL support +# The variants are conflicting (and hence can not be installed at the same time). +# See also: http://doc.qt.io/qt-5/windows-requirements.html#dynamically-loading-graphics-drivers -# By default CMake and qmake will link against the dynamic libary. +# The variants listed above only contain dynamic libraries. For building static libraries +# just append '-static' to the package name, eg. mingw-w64-qt5-base-static or mingw-w64-qt5-base-angle-static. +# The static variants rely on the corresponding dynamic variant for headers and tools. -# To use the static variant with CMake set the following variable before calling find_package for finding a Qt module: +# 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 a static plugin, add the corresponding imported target, eg. # target_link_libraries(target ... Qt5::QWindowsIntegrationPlugin) @@ -21,40 +28,49 @@ # #include # Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) -# To use the static variant with qmake set the following variables (either inside the *.pro file or as qmake argument): +# To use the static Qt libraries with qmake set the following variables (either inside the *.pro file or as qmake argument): # 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. # 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. +# 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. # Qt packages can be built in the following order (for example): -# qt5-base 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 +# 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 # Helper functions for the split builds -isStatic() { - [[ $pkgname = "mingw-w64-qt5-base-static" ]] || \ - [[ $pkgname == 'mingw-w64-qt5-base-angle-static' ]] || \ - [[ $pkgname == 'mingw-w64-qt5-base-noopengl-static' ]] -} -isOpenGL() { +isDefault() { [[ $pkgname = "mingw-w64-qt5-base" ]] || [[ $pkgname = "mingw-w64-qt5-base-static" ]] } +isStatic() { + [[ $pkgname = "mingw-w64-qt5-base-static" ]] || \ + [[ $pkgname = 'mingw-w64-qt5-base-angle-static' ]] || \ + [[ $pkgname = 'mingw-w64-qt5-base-opengl-static' ]] || \ + [[ $pkgname = 'mingw-w64-qt5-base-dynamic-static' ]] || \ + [[ $pkgname = 'mingw-w64-qt5-base-noopengl-static' ]] +} +isOpenGL() { + isDefault || \ # currently use native OpenGL by default + [[ $pkgname = "mingw-w64-qt5-base-opengl" ]] || [[ $pkgname = "mingw-w64-qt5-base-opengl-static" ]] \ +} isANGLE() { - [[ $pkgname == 'mingw-w64-qt5-base-angle' ]] || [[ $pkgname == 'mingw-w64-qt5-base-angle-static' ]] + [[ $pkgname = 'mingw-w64-qt5-base-angle' ]] || [[ $pkgname = 'mingw-w64-qt5-base-angle-static' ]] || \ + [[ $pkgname = "mingw-w64-qt5-base-dynamic" ]] || [[ $pkgname = "mingw-w64-qt5-base-dynamic-static" ]] # treat dynamic version like ANGLE version, correct? +} +isDynamic() { + [[ $pkgname = "mingw-w64-qt5-base-dynamic" ]] || [[ $pkgname = "mingw-w64-qt5-base-dynamic-static" ]] } isNoOpenGL() { - [[ $pkgname == 'mingw-w64-qt5-base-noopengl' ]] || [[ $pkgname == 'mingw-w64-qt5-base-noopengl-static' ]] + [[ $pkgname = 'mingw-w64-qt5-base-noopengl' ]] || [[ $pkgname = 'mingw-w64-qt5-base-noopengl-static' ]] } pkgname=mingw-w64-qt5-base-static pkgver=5.7.0 -pkgrel=4 +pkgrel=5 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') @@ -120,13 +136,23 @@ md5sums=('184f9460b40752d71b15b827260580c2' _architectures='i686-w64-mingw32 x86_64-w64-mingw32' isStatic && depends+=(${pkgname%-static}) -isANGLE && depends+=('mingw-w64-angleproject') -if ! isOpenGL; then - provides+=('mingw-w64-qt5-base') - if isStatic; then - conflicts+=('mingw-w64-qt5-base-static' 'mingw-w64-qt5-base-angle-static' 'mingw-w64-qt5-base-noopengl-static') +if isANGLE; then + if isDynamic; then + makedepends+=('mingw-w64-angleproject') + optdepends+=('mingw-w64-angleproject: use ANGLE instead of native OpenGL') else - conflicts+=('mingw-w64-qt5-base' 'mingw-w64-qt5-base-angle' 'mingw-w64-qt5-base-noopengl') + depends+=('mingw-w64-angleproject') + fi +fi +if ! isDefault; then + if isStatic; then + provides+=('mingw-w64-qt5-base-static') + conflicts+=('mingw-w64-qt5-base-static' 'mingw-w64-qt5-base-angle-static' 'mingw-w64-qt5-base-noopengl-static' + 'mingw-w64-qt5-base-angle-dynamic-static' 'mingw-w64-qt5-base-angle-openql-static') + else + provides+=('mingw-w64-qt5-base') + conflicts+=('mingw-w64-qt5-base' 'mingw-w64-qt5-base-angle' 'mingw-w64-qt5-base-noopengl' + 'mingw-w64-qt5-base-angle-dynamic' 'mingw-w64-qt5-base-angle-openql') fi fi @@ -307,8 +333,13 @@ build() { qt_configure_args+=' -opengl desktop' elif isNoOpenGL; then qt_configure_args+=' -no-opengl' - else - # GL_GLEXT_PROTOTYPES must be defined to enable declarations GLES functions + elif isANGLE; then + if isDynamic; then + qt_configure_args+=' -opengl dynamic' + else + qt_configure_args+=' -opengl angle' + fi + # GL_GLEXT_PROTOTYPES must be defined to enable declarations of GLES functions qt_configure_args+=' -DGL_GLEXT_PROTOTYPES' fi # TODO: allow dynamic OpenGL configuration diff --git a/qt5-base/mingw-w64/PKGBUILD b/qt5-base/mingw-w64/PKGBUILD index 4241a0c9..9f9dc28d 100644 --- a/qt5-base/mingw-w64/PKGBUILD +++ b/qt5-base/mingw-w64/PKGBUILD @@ -6,14 +6,21 @@ # All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where # you also find the URL of a binary repository. -# There currently three variants of the package: -# - mingw-w64-qt5-base: includes dynamic libs only, using native OpenGL -# - mingw-w64-qt5-base-angle: includes dynamic libs only, using ANGLE, conflicts with OpenGL version -# - mingw-w64-qt5-base-static: includes static libs only, relies on mingw-w64-qt5-base for headers and tools +# 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 then native OpenGL +# - mingw-w64-qt5-base-dynamic: allows choosing between ANGLE and OpenGL dynamically at runtime +# - mingw-w64-qt5-base-noopenql: no OpenGL support +# The variants are conflicting (and hence can not be installed at the same time). +# See also: http://doc.qt.io/qt-5/windows-requirements.html#dynamically-loading-graphics-drivers -# By default CMake and qmake will link against the dynamic libary. +# The variants listed above only contain dynamic libraries. For building static libraries +# just append '-static' to the package name, eg. mingw-w64-qt5-base-static or mingw-w64-qt5-base-angle-static. +# The static variants rely on the corresponding dynamic variant for headers and tools. -# To use the static variant with CMake set the following variable before calling find_package for finding a Qt module: +# 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 a static plugin, add the corresponding imported target, eg. # target_link_libraries(target ... Qt5::QWindowsIntegrationPlugin) @@ -21,40 +28,49 @@ # #include # Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) -# To use the static variant with qmake set the following variables (either inside the *.pro file or as qmake argument): +# To use the static Qt libraries with qmake set the following variables (either inside the *.pro file or as qmake argument): # 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. # 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. +# 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. # Qt packages can be built in the following order (for example): -# qt5-base 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 +# 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 # Helper functions for the split builds -isStatic() { - [[ $pkgname = "mingw-w64-qt5-base-static" ]] || \ - [[ $pkgname == 'mingw-w64-qt5-base-angle-static' ]] || \ - [[ $pkgname == 'mingw-w64-qt5-base-noopengl-static' ]] -} -isOpenGL() { +isDefault() { [[ $pkgname = "mingw-w64-qt5-base" ]] || [[ $pkgname = "mingw-w64-qt5-base-static" ]] } +isStatic() { + [[ $pkgname = "mingw-w64-qt5-base-static" ]] || \ + [[ $pkgname = 'mingw-w64-qt5-base-angle-static' ]] || \ + [[ $pkgname = 'mingw-w64-qt5-base-opengl-static' ]] || \ + [[ $pkgname = 'mingw-w64-qt5-base-dynamic-static' ]] || \ + [[ $pkgname = 'mingw-w64-qt5-base-noopengl-static' ]] +} +isOpenGL() { + isDefault || \ # currently use native OpenGL by default + [[ $pkgname = "mingw-w64-qt5-base-opengl" ]] || [[ $pkgname = "mingw-w64-qt5-base-opengl-static" ]] \ +} isANGLE() { - [[ $pkgname == 'mingw-w64-qt5-base-angle' ]] || [[ $pkgname == 'mingw-w64-qt5-base-angle-static' ]] + [[ $pkgname = 'mingw-w64-qt5-base-angle' ]] || [[ $pkgname = 'mingw-w64-qt5-base-angle-static' ]] || \ + [[ $pkgname = "mingw-w64-qt5-base-dynamic" ]] || [[ $pkgname = "mingw-w64-qt5-base-dynamic-static" ]] # treat dynamic version like ANGLE version, correct? +} +isDynamic() { + [[ $pkgname = "mingw-w64-qt5-base-dynamic" ]] || [[ $pkgname = "mingw-w64-qt5-base-dynamic-static" ]] } isNoOpenGL() { - [[ $pkgname == 'mingw-w64-qt5-base-noopengl' ]] || [[ $pkgname == 'mingw-w64-qt5-base-noopengl-static' ]] + [[ $pkgname = 'mingw-w64-qt5-base-noopengl' ]] || [[ $pkgname = 'mingw-w64-qt5-base-noopengl-static' ]] } pkgname=mingw-w64-qt5-base pkgver=5.7.0 -pkgrel=4 +pkgrel=5 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') @@ -120,13 +136,23 @@ md5sums=('184f9460b40752d71b15b827260580c2' _architectures='i686-w64-mingw32 x86_64-w64-mingw32' isStatic && depends+=(${pkgname%-static}) -isANGLE && depends+=('mingw-w64-angleproject') -if ! isOpenGL; then - provides+=('mingw-w64-qt5-base') - if isStatic; then - conflicts+=('mingw-w64-qt5-base-static' 'mingw-w64-qt5-base-angle-static' 'mingw-w64-qt5-base-noopengl-static') +if isANGLE; then + if isDynamic; then + makedepends+=('mingw-w64-angleproject') + optdepends+=('mingw-w64-angleproject: use ANGLE instead of native OpenGL') else - conflicts+=('mingw-w64-qt5-base' 'mingw-w64-qt5-base-angle' 'mingw-w64-qt5-base-noopengl') + depends+=('mingw-w64-angleproject') + fi +fi +if ! isDefault; then + if isStatic; then + provides+=('mingw-w64-qt5-base-static') + conflicts+=('mingw-w64-qt5-base-static' 'mingw-w64-qt5-base-angle-static' 'mingw-w64-qt5-base-noopengl-static' + 'mingw-w64-qt5-base-angle-dynamic-static' 'mingw-w64-qt5-base-angle-openql-static') + else + provides+=('mingw-w64-qt5-base') + conflicts+=('mingw-w64-qt5-base' 'mingw-w64-qt5-base-angle' 'mingw-w64-qt5-base-noopengl' + 'mingw-w64-qt5-base-angle-dynamic' 'mingw-w64-qt5-base-angle-openql') fi fi @@ -307,8 +333,13 @@ build() { qt_configure_args+=' -opengl desktop' elif isNoOpenGL; then qt_configure_args+=' -no-opengl' - else - # GL_GLEXT_PROTOTYPES must be defined to enable declarations GLES functions + elif isANGLE; then + if isDynamic; then + qt_configure_args+=' -opengl dynamic' + else + qt_configure_args+=' -opengl angle' + fi + # GL_GLEXT_PROTOTYPES must be defined to enable declarations of GLES functions qt_configure_args+=' -DGL_GLEXT_PROTOTYPES' fi # TODO: allow dynamic OpenGL configuration