view src/qtbase-1-fixes.patch @ 5161:f0fb4aebfcd0

qt5: update to v5.13.1 * src/qtbase.mk: update version, checksum * src/qtbase-1-fixes.patch: update patch * src/qtimageformats.mk: update version, checksum * src/qtimageformats-1.patch: update patch * src/qtsvg.mk: update version, checksum * src/qttools.mk: update version, checksum * src/qttranslations.mk: update version, checksum
author John Donoghue
date Fri, 06 Sep 2019 09:57:32 -0400
parents 9d35f8eb1e76
children 8a2080f70075
line wrap: on
line source

This file is part of MXE. See LICENSE.md for licensing information.

From 2ff7d50d0f701915d810569d19e1413674aec79d Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Wed, 26 Aug 2015 12:45:43 +0100
Subject: [PATCH 1/4] cmake: Rearrange STATIC vs INTERFACE targets

Otherwise we attempt to add_library(Qt5::UiPlugin STATIC IMPORTED)
for header-only modules when building Qt5 statically.

Source: https://git.io/vzWJz
See also: https://github.com/mxe/mxe/issues/1185

diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
index d4fd057682..600c8273f1 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -323,6 +323,9 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
     list(APPEND _Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES \"$${CMAKE_INTERFACE_QT5_MODULE_DEPS}\")
 !!ENDIF
 
+!!IF equals(TEMPLATE, aux)
+    add_library(Qt5::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
+!!ELSE
 !!IF !isEmpty(CMAKE_STATIC_TYPE)
     if(NOT Qt5_EXCLUDE_STATIC_DEPENDENCIES)
 !!IF !isEmpty(CMAKE_DEBUG_TYPE)
@@ -360,9 +363,6 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
 
     add_library(Qt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED)
     set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES "CXX")
-!!ELSE
-!!IF equals(TEMPLATE, aux)
-    add_library(Qt5::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
 !!ELSE
     add_library(Qt5::$${CMAKE_MODULE_NAME} SHARED IMPORTED)
 !!ENDIF
-- 
2.20.1


From 7c3a397e8cc07ac4dad174dc6a0f4e02834b1f72 Mon Sep 17 00:00:00 2001
From: Tony Theodore <tonyt@logyst.com>
Date: Sat, 16 Jul 2016 20:31:07 +1000
Subject: [PATCH 2/4] Fix pkgconfig file and library naming

See: https://codereview.qt-project.org/#/c/165394/
     https://bugreports.qt.io/browse/QTBUG-30898

Currently, *.pc files are generated with debug suffix `d` in `-release`
mode and without the suffix in `-debug` or `-debug-and-release`. This
can be worked around by `CONIFG-=debug_and_release`, however, a more
predictable and consistent naming approach would be preferable.

This change mimics the *.prl file and lib conventions:

  -release: creates normal *.pc files and lib names
  -release -force-debug-info: normal as above
  -debug: creates *d.pc and *d lib names
  -debug-and-release: creates both
  -default: creates both (default link: debug)

and should be unsurprising to users of `pkg-config`. At very least,
it's deterministic and easily incorporated into build systems.

Task-number: 30898
Change-Id: If75336ec7d21a7ec0cb6d245fe87c64afcb5a644

diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index 46687f262e..4b2980a1a8 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -268,6 +268,10 @@ load(qt_installs)
 
 load(qt_targets)
 
+# Set TARGET towards the end but before pkgconfig setup to keep naming
+# conventions consistent with *prl files
+TARGET = $$qt5LibraryTarget($$TARGET$$QT_LIBINFIX)
+
 # this builds on top of qt_common
 !internal_module:if(unix|mingw) {
     CONFIG += create_pc
@@ -283,12 +287,12 @@ load(qt_targets)
         QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS/raw]
         QMAKE_PKGCONFIG_CFLAGS = -D$$MODULE_DEFINE -I${includedir}/$$MODULE_INCNAME
     }
-    QMAKE_PKGCONFIG_NAME = $$replace(TARGET, ^Qt, "Qt$$QT_MAJOR_VERSION ")
-    QMAKE_PKGCONFIG_FILE = $$replace(TARGET, ^Qt, Qt$$QT_MAJOR_VERSION)
+    QMAKE_PKGCONFIG_NAME = $$replace(TARGET, ^Qt$$QT_MAJOR_VERSION, "Qt$$QT_MAJOR_VERSION ")
+    QMAKE_PKGCONFIG_FILE = $$TARGET
     for(i, MODULE_DEPENDS): \
-        QMAKE_PKGCONFIG_REQUIRES += $$replace(QT.$${i}.name, ^Qt, Qt$$section(QT.$${i}.VERSION, ., 0, 0))
+        QMAKE_PKGCONFIG_REQUIRES += $$replace(QT.$${i}.name, ^Qt, Qt$$section(QT.$${i}.VERSION, ., 0, 0))$$qtPlatformTargetSuffix()
     isEmpty(QMAKE_PKGCONFIG_DESCRIPTION): \
-        QMAKE_PKGCONFIG_DESCRIPTION = $$replace(TARGET, ^Qt, "Qt ") module
+        QMAKE_PKGCONFIG_DESCRIPTION = $$replace(TARGET, ^Qt$$QT_MAJOR_VERSION, "Qt ") module
     !isEmpty(lib_replace0.match) {
         pclib_replace0.match = $$lib_replace0.match
         pclib_replace0.replace = $$QMAKE_PKGCONFIG_LIBDIR/
@@ -334,5 +338,3 @@ win32 {
     # On other platforms, Qt's own compilation goes needs to compile the Qt 5.0 API
     DEFINES *= QT_DISABLE_DEPRECATED_BEFORE=0x050000
 }
-
-TARGET = $$qt5LibraryTarget($$TARGET$$QT_LIBINFIX)  # Do this towards the end
-- 
2.20.1


From a4fe5af173b82d95c741df30d151576b2bc4e0b7 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Sun, 11 Jun 2017 00:27:41 +0200
Subject: [PATCH 3/4] use pkg-config for harfbuzz

Change-Id: Ia65cbb90fd180f1bc10ce077a9a8323a48e51421

diff --git a/src/gui/configure.json b/src/gui/configure.json
index 6280b4dfa2..e094ee12e6 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -303,7 +303,8 @@
             },
             "headers": "harfbuzz/hb.h",
             "sources": [
-                "-lharfbuzz"
+               { "type": "pkgConfig", "args": "harfbuzz" },
+               "-lharfbuzz"
             ]
         },
         "imf": {
-- 
2.20.1


From 033d4a71054d41f48d38027f091edc76526b8911 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Thu, 23 Nov 2017 11:28:47 +0200
Subject: [PATCH 4/4] disable qt_random_cpu for i686-w64-mingw32

Workaround for gcc internal error compiling for mingw32:
    global/qrandom.cpp: In function 'qsizetype qt_random_cpu(void*, qsizetype)':
    global/qrandom.cpp:123:1: internal compiler error: in
    ix86_compute_frame_layout, at config/i386/i386.c:10145
     }
     ^

    global/qrandom.cpp:123:1: internal compiler error: Segmentation fault
    i686-w64-mingw32.static-g++: internal compiler error: Segmentation fault
    (program cc1plus)

Based on https://codereview.qt-project.org/#/c/212360/

Change-Id: Ia1c902e7b147bdda2b8d7904b40a3b968b8d0369

diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp
index bf01b7ae2a..26bcaf0326 100644
--- a/src/corelib/global/qrandom.cpp
+++ b/src/corelib/global/qrandom.cpp
@@ -90,7 +90,7 @@ DECLSPEC_IMPORT BOOLEAN WINAPI SystemFunction036(PVOID RandomBuffer, ULONG Rando
 
 QT_BEGIN_NAMESPACE
 
-#if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND)
+#if defined(Q_PROCESSOR_X86) && !defined(Q_PROCESSOR_X86_32) && QT_COMPILER_SUPPORTS_HERE(RDRND)
 static qsizetype qt_random_cpu(void *buffer, qsizetype count) Q_DECL_NOTHROW;
 
 #  ifdef Q_PROCESSOR_X86_64
-- 
2.20.1

diff -ur qtbase-everywhere-src-5.11.0.orig/mkspecs/common/gcc-base.conf qtbase-everywhere-src-5.11.0/mkspecs/common/gcc-base.conf
--- qtbase-everywhere-src-5.11.0.orig/mkspecs/common/gcc-base.conf     2018-06-12 07:47:54.488874295 -0400
+++ qtbase-everywhere-src-5.11.0/mkspecs/common/gcc-base.conf  2018-06-12 07:48:46.550096817 -0400
@@ -46,7 +46,7 @@
 QMAKE_CFLAGS_SHLIB         += $$QMAKE_CFLAGS_PIC
 QMAKE_CFLAGS_STATIC_LIB    += $$QMAKE_CFLAGS_PIC
 QMAKE_CFLAGS_APP           += $$QMAKE_CFLAGS_PIC
-QMAKE_CFLAGS_ISYSTEM        = -isystem
+QMAKE_CFLAGS_ISYSTEM        = -I
 QMAKE_CFLAGS_YACC          += -Wno-unused -Wno-parentheses
 QMAKE_CFLAGS_HIDESYMS      += -fvisibility=hidden
 QMAKE_CFLAGS_EXCEPTIONS_OFF += -fno-exceptions
diff -ur qtbase-everywhere-src-5.13.0.orig/src/plugins/platforms/minimal/qminimalintegration.cpp qtbase-everywhere-src-5.13.0/src/plugins/platforms/minimal/qminimalintegration.cpp
--- qtbase-everywhere-src-5.13.0.orig/src/plugins/platforms/minimal/qminimalintegration.cpp	2019-06-21 13:24:11.167038403 -0400
+++ qtbase-everywhere-src-5.13.0/src/plugins/platforms/minimal/qminimalintegration.cpp	2019-06-21 13:31:33.734199370 -0400
@@ -162,7 +162,11 @@
 
         if (!m_fontDatabase) {
 #if QT_CONFIG(fontconfig)
+#  ifdef Q_OS_WIN
+            m_fontDatabase = new QFreeTypeFontDatabase;
+#  else
             m_fontDatabase = new QGenericUnixFontDatabase;
+#  endif
 #else
             m_fontDatabase = QPlatformIntegration::fontDatabase();
 #endif