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

From 4fe0644890b8d105ac46094a913b292386c1a67a 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/7] 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 db18dbece6..6b4457569d 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -370,6 +370,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)
@@ -411,9 +414,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")
 !!ENDIF
-!!ELSE
-!!IF equals(TEMPLATE, aux)
-    add_library(Qt5::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
 !!ELSE
     add_library(Qt5::$${CMAKE_MODULE_NAME} SHARED IMPORTED)
 !!ENDIF
-- 
2.30.2


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

Change-Id: Ia65cbb90fd180f1bc10ce077a9a8323a48e51421

diff --git a/src/gui/configure.json b/src/gui/configure.json
index c8c4864eca..f56b2b94f7 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.30.2


From e257e2e1b4fd7907dac0d4d56d05379eb973ce51 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Mon, 18 Jan 2021 07:40:54 -0800
Subject: [PATCH 3/7] Fix build with GCC 11: include <limits>

Fixes: QTBUG-90395
Change-Id: Iecc74d2000eb40dfbe7bfffd165b5dd3708b7a40
(cherry picked from commit 9c56d4da2ff631a8c1c30475bd792f6c86bda53c)
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit b2af6332ea37e45ab230a7a5d2d278f86d961b83)

diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h
index 257efbbdbe..339f53abb6 100644
--- a/src/corelib/global/qendian.h
+++ b/src/corelib/global/qendian.h
@@ -1,7 +1,7 @@
 /****************************************************************************
 **
-** Copyright (C) 2016 The Qt Company Ltd.
-** Copyright (C) 2016 Intel Corporation.
+** Copyright (C) 2021 The Qt Company Ltd.
+** Copyright (C) 2021 Intel Corporation.
 ** Contact: https://www.qt.io/licensing/
 **
 ** This file is part of the QtCore module of the Qt Toolkit.
@@ -44,6 +44,8 @@
 #include <QtCore/qfloat16.h>
 #include <QtCore/qglobal.h>
 
+#include <limits>
+
 // include stdlib.h and hope that it defines __GLIBC__ for glibc-based systems
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h
index c7a9c87af3..5302be072e 100644
--- a/src/corelib/global/qfloat16.h
+++ b/src/corelib/global/qfloat16.h
@@ -43,6 +43,7 @@
 
 #include <QtCore/qglobal.h>
 #include <QtCore/qmetatype.h>
+#include <limits>
 #include <string.h>
 
 #if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__AVX2__) && !defined(__F16C__)
-- 
2.30.2


From f681fc781277f35499008b99e94cc6049885e01c Mon Sep 17 00:00:00 2001
From: Ville Voutilainen <ville.voutilainen@qt.io>
Date: Mon, 18 Jan 2021 09:58:17 +0200
Subject: [PATCH 4/7] Build fixes for GCC 11

Task-number: QTBUG-89977
Change-Id: Ic1b7ddbffb8a0a00f8c621d09a868f1d94a52c21
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 813a928c7c3cf98670b6043149880ed5c955efb9)

diff --git a/src/corelib/text/qbytearraymatcher.h b/src/corelib/text/qbytearraymatcher.h
index 0eedfc1d20..f5f9bef7b8 100644
--- a/src/corelib/text/qbytearraymatcher.h
+++ b/src/corelib/text/qbytearraymatcher.h
@@ -42,6 +42,8 @@
 
 #include <QtCore/qbytearray.h>
 
+#include <limits>
+
 QT_BEGIN_NAMESPACE
 
 
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index 790c187cb9..4aee98af53 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -155,9 +155,6 @@ namespace QtSharedPointer {
 #endif
         inline void checkQObjectShared(...) { }
         inline void setQObjectShared(...) { }
-
-        inline void operator delete(void *ptr) { ::operator delete(ptr); }
-        inline void operator delete(void *, void *) { }
     };
     // sizeof(ExternalRefCountData) = 12 (32-bit) / 16 (64-bit)
 
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 9e7e1a5572..f0866a90ac 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -698,7 +698,7 @@ void QXcbWindow::show()
         if (isTransient(window())) {
             const QWindow *tp = window()->transientParent();
             if (tp && tp->handle())
-                transientXcbParent = static_cast<const QXcbWindow *>(tp->handle())->winId();
+                transientXcbParent = tp->handle()->winId();
             // Default to client leader if there is no transient parent, else modal dialogs can
             // be hidden by their parents.
             if (!transientXcbParent)
-- 
2.30.2


From dbedf2727d85fa97b2a287a7192f3b1eabec4589 Mon Sep 17 00:00:00 2001
From: Ulf Hermann <ulf.hermann@qt.io>
Date: Wed, 20 Jan 2021 10:42:36 +0100
Subject: [PATCH 5/7] Partially revert 813a928c7c3cf98670b6043149880ed5c955efb9

Otherwise ASAN complains about mismatched new/delete.

Change-Id: I76ddcc388309e20055c93c68b9b6fa8a11b884e1
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 606b03d0a35e71565c3a91588ef2db45b9262e27)

diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index 4aee98af53..790c187cb9 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -155,6 +155,9 @@ namespace QtSharedPointer {
 #endif
         inline void checkQObjectShared(...) { }
         inline void setQObjectShared(...) { }
+
+        inline void operator delete(void *ptr) { ::operator delete(ptr); }
+        inline void operator delete(void *, void *) { }
     };
     // sizeof(ExternalRefCountData) = 12 (32-bit) / 16 (64-bit)
 
-- 
2.30.2


From befb5324e3e00d0b533f4df61483d0d0ccf5db08 Mon Sep 17 00:00:00 2001
From: Jonas Kvinge <jonas@jkvinge.net>
Date: Wed, 5 May 2021 14:57:25 +0200
Subject: [PATCH 6/7] Add missing limits include

Change-Id: I927b26d4537478f9130a1ff16d23941c723291fe

diff --git a/src/corelib/tools/qoffsetstringarray_p.h b/src/corelib/tools/qoffsetstringarray_p.h
index 4dd9e9603b..c94d64d9aa 100644
--- a/src/corelib/tools/qoffsetstringarray_p.h
+++ b/src/corelib/tools/qoffsetstringarray_p.h
@@ -55,6 +55,7 @@
 
 #include <tuple>
 #include <array>
+#include <limits>
 
 QT_BEGIN_NAMESPACE
 
-- 
2.30.2

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tony Theodore <tonyt@logyst.com>
Date: Thu, 11 Nov 2021 18:18:25 +1100
Subject: [PATCH 7/7] Add missing macOS header file that was indirectly
 included before

based on:
https://code.qt.io/cgit/qt/qtbase.git/commit/src/plugins/platforms/cocoa?id=dece6f5840463ae2ddf927d65eb1b3680e34a547

diff --git a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h
index 1111111..2222222 100644
--- a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h
+++ b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h
@@ -42,6 +42,7 @@
 
 #include <qpa/qplatformgraphicsbuffer.h>
 #include <private/qcore_mac_p.h>
+#include <CoreGraphics/CGColorSpace.h>
 
 QT_BEGIN_NAMESPACE
 
