# HG changeset patch
# User John Donoghue
# Date 1528820513 14400
#      Tue Jun 12 12:21:53 2018 -0400
# Node ID 3a8c7305ae32032559fe31e4d1081fcf5ccfc27a
# Parent  ce586b66209fffd2342bfb64e25558a99c5fa7e1
qt5: update to v5.11.0, add support pcre2

* src/qtbase.mk: update version, checksum

* src/qtimageformats.mk: update checksum

* src/qtisvg.mk: update checksum

* src/qttools.mk: update checksum

* src/qtbase-1-fixes.patch, src/qttools-1.patch: update patch from mxe.cc

* src/pcre2.mk: new file

* index.html: add pcre2

* src/sqlite.mk: enable column metadata

diff -r ce586b66209f -r 3a8c7305ae32 index.html
--- a/index.html	Thu Jun 07 15:50:42 2018 -0400
+++ b/index.html	Tue Jun 12 12:21:53 2018 -0400
@@ -2186,6 +2186,10 @@
         <td class="website"><a href="http://www.pcre.org/">PCRE</a></td>
     </tr>
     <tr>
+        <td class="package">pcre2</td>
+        <td class="website"><a href="http://www.pcre.org/">PCRE2</a></td>
+    </tr>
+    <tr>
         <td class="package">pdcurses</td>
         <td class="website"><a href="http://pdcurses.sourceforge.net/">PDcurses</a></td>
     </tr>
diff -r ce586b66209f -r 3a8c7305ae32 src/pcre2.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pcre2.mk	Tue Jun 12 12:21:53 2018 -0400
@@ -0,0 +1,42 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := pcre2
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 10.30
+$(PKG)_CHECKSUM := 8296dda3476bbb4c90048ff47e3a71f3b2749566
+$(PKG)_SUBDIR   := pcre2-$($(PKG)_VERSION)
+$(PKG)_FILE     := pcre2-$($(PKG)_VERSION).tar.bz2
+$(PKG)_URL      := http://$(SOURCEFORGE_MIRROR)/project/pcre/pcre2/$($(PKG)_VERSION)/$($(PKG)_FILE)
+$(PKG)_DEPS     :=
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- 'http://sourceforge.net/projects/pcre/files/pcre2/' | \
+    $(SED) -n 's,.*tr title="\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    cd '$(1)' && ./configure \
+        $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
+        $(ENABLE_SHARED_OR_STATIC) \
+        --prefix='$(HOST_PREFIX)' \
+        --enable-pcre2-16 \
+        --enable-utf \
+        --enable-unicode-properties \
+        --enable-cpp \
+        --disable-pcregrep-libz \
+        --disable-pcregrep-libbz2 \
+        --disable-pcretest-libreadline && $(CONFIGURE_POST_HOOK)
+    rm -f '$(HOST_PREFIX)'/share/man/man3/pcre2-16*.3
+    $(MAKE) -C '$(1)' -j '$(JOBS)' $(MXE_DISABLE_PROGS) DESTDIR='$(3)'
+    $(MAKE) -C '$(1)' -j 1 install $(MXE_DISABLE_PROGS) DESTDIR='$(3)'
+    if [ "$(ENABLE_DEP_DOCS)" == "no" ]; then \
+       rm -rf "$(3)$(HOST_PREFIX)/share/doc/pcre2/html"; \
+       rm -rf "$(3)$(HOST_PREFIX)/share/man"; \
+    fi
+    if [ $(MXE_NATIVE_BUILD) = no ]; then \
+      $(INSTALL) -d '$(3)$(BUILD_TOOLS_PREFIX)/bin'; \
+      $(INSTALL) -m755 '$(3)$(HOST_BINDIR)/pcre2-config' '$(3)$(BUILD_TOOLS_PREFIX)/bin/pcre2-config'; \
+    fi
+endef
diff -r ce586b66209f -r 3a8c7305ae32 src/qtbase-1-fixes.patch
--- a/src/qtbase-1-fixes.patch	Thu Jun 07 15:50:42 2018 -0400
+++ b/src/qtbase-1-fixes.patch	Tue Jun 12 12:21:53 2018 -0400
@@ -1,132 +1,11 @@
 This file is part of MXE. See LICENSE.md for licensing information.
 
-From 62efa18a61560a7757acffbd4ac6ca7b153155cc Mon Sep 17 00:00:00 2001
-From: Mark Brand <mabrand@mabrand.nl>
-Date: Thu, 6 Aug 2015 23:35:08 +0200
-Subject: [PATCH 1/8] fix qwindows plugin linking with system-freetype (MXE
- specific)
-
-Change-Id: I8783e3ab2d19011b083dd3c471107298a17293c4
-
-diff --git a/src/3rdparty/freetype_dependency.pri b/src/3rdparty/freetype_dependency.pri
-index 39280de..e152b0d 100644
---- a/src/3rdparty/freetype_dependency.pri
-+++ b/src/3rdparty/freetype_dependency.pri
-@@ -4,4 +4,5 @@ contains(QT_CONFIG, freetype) {
- } else:contains(QT_CONFIG, system-freetype) {
-     # pull in the proper freetype2 include directory
-     include($$QT_SOURCE_TREE/config.tests/unix/freetype/freetype.pri)
-+    win32:shared:LIBS_PRIVATE += -lfreetype
- }
--- 
-2.9.3
-
-
-From 5a15e0374758b7786204d98b66f49b4fd3daea79 Mon Sep 17 00:00:00 2001
-From: Mark Brand <mabrand@mabrand.nl>
-Date: Sat, 21 Jun 2014 13:12:49 +0200
-Subject: [PATCH 2/8] use pkg-config for harfbuzz (MXE specific)
-
-Change-Id: Id4e4c37d68b63c9f480d72a561d95d4d2a5ded50
-
-diff --git a/config.tests/unix/harfbuzz/harfbuzz.pro b/config.tests/unix/harfbuzz/harfbuzz.pro
-index 32edd6e..a7f2c28 100644
---- a/config.tests/unix/harfbuzz/harfbuzz.pro
-+++ b/config.tests/unix/harfbuzz/harfbuzz.pro
-@@ -1,3 +1,4 @@
- SOURCES = harfbuzz.cpp
- CONFIG -= qt dylib
--LIBS += -lharfbuzz
-+CONFIG += link_pkgconfig
-+PKGCONFIG += harfbuzz
-diff --git a/src/3rdparty/harfbuzz_dependency.pri b/src/3rdparty/harfbuzz_dependency.pri
-index 7443368..c24e684 100644
---- a/src/3rdparty/harfbuzz_dependency.pri
-+++ b/src/3rdparty/harfbuzz_dependency.pri
-@@ -2,5 +2,6 @@ contains(QT_CONFIG, harfbuzz) {
-     INCLUDEPATH += $$PWD/harfbuzz-ng/include
-     LIBS_PRIVATE += -L$$QT_BUILD_TREE/lib -lqtharfbuzzng$$qtPlatformTargetSuffix()
- } else:contains(QT_CONFIG, system-harfbuzz) {
--    LIBS_PRIVATE += -lharfbuzz
-+    CONFIG += link_pkgconfig
-+    PKGCONFIG += harfbuzz
- }
--- 
-2.9.3
-
-
-From bc002ee2a8418c7afcba362d155ba1a591bc3d1a Mon Sep 17 00:00:00 2001
-From: Mark Brand <mabrand@mabrand.nl>
-Date: Mon, 8 Dec 2014 14:15:12 +0100
-Subject: [PATCH 3/8] fix oci config test on windows
-
-Change-Id: If1ce2241682259ca495b0ba68bf18410f8548922
+Contains ad hoc patches for cross building.
 
-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.9.3
-
-
-From 92d2ae7b6eb175b4f15e5f0f231a9c29824d6f57 Mon Sep 17 00:00:00 2001
-From: Mark Brand <mabrand@mabrand.nl>
-Date: Thu, 6 Aug 2015 13:24:56 +0200
-Subject: [PATCH 4/8] configure: don't set QT_NO_SYSTEMSEMAPHORE for Windows
-
-Change-Id: I53c110ef40e3d14cc49fa23aa5d294611cac2ffa
-
-diff --git a/configure b/configure
-index ba94d08..50e6dfb 100755
---- a/configure
-+++ b/configure
-@@ -4677,7 +4677,7 @@ fi
- [ "$XPLATFORM_ANDROID" != "no" ] && 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.9.3
-
-
-From f0054e940467a64dffc0c3cc070233fdf2848d43 Mon Sep 17 00:00:00 2001
-From: Mark Brand <mabrand@mabrand.nl>
-Date: Tue, 6 Oct 2015 09:53:20 +0200
-Subject: [PATCH 5/8] fix building mysql driver under mingw
-
-Change-Id: I9c4e821d5b3a6919566c6b684cb4916827feb6a9
-
-diff --git a/src/sql/drivers/mysql/qsql_mysql.pri b/src/sql/drivers/mysql/qsql_mysql.pri
-index 3cfb614..8b7063f 100644
---- a/src/sql/drivers/mysql/qsql_mysql.pri
-+++ b/src/sql/drivers/mysql/qsql_mysql.pri
-@@ -4,7 +4,7 @@ SOURCES += $$PWD/qsql_mysql.cpp
- QMAKE_CXXFLAGS *= $$QT_CFLAGS_MYSQL
- LIBS += $$QT_LFLAGS_MYSQL
- 
--unix {
-+if (unix|mingw) {
-     isEmpty(QT_LFLAGS_MYSQL) {
-         !contains(LIBS, .*mysqlclient.*):!contains(LIBS, .*mysqld.*) {
-             use_libmysqlclient_r:LIBS += -lmysqlclient_r
--- 
-2.9.3
-
-
-From 26229596fbb711bc222c831eca3a9e5b62c7acc6 Mon Sep 17 00:00:00 2001
+From ec06a0993dd7ceae8002852646dc1826111a1882 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 6/8] cmake: Rearrange STATIC vs INTERFACE targets
+Subject: [PATCH 1/8] cmake: Rearrange STATIC vs INTERFACE targets
 
 Otherwise we attempt to add_library(Qt5::UiPlugin STATIC IMPORTED)
 for header-only modules when building Qt5 statically.
@@ -135,11 +14,11 @@
 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 d2358ca..6b1dc95 100644
+index 27f4c277d6..84ff9ae0ef 100644
 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
 +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
-@@ -222,13 +222,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
-     endif()
+@@ -214,12 +214,12 @@ 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)
@@ -148,21 +27,20 @@
  !!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
+-!!ELSE
 -!!IF equals(TEMPLATE, aux)
 -    add_library(Qt5::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
--!!ELSE
+ !!ELSE
      add_library(Qt5::$${CMAKE_MODULE_NAME} SHARED IMPORTED)
  !!ENDIF
- !!ENDIF
 -- 
-2.9.3
+2.17.0
 
 
-From 59fd7fdff5bf0cda3c7a11982ee96f50d8eddec1 Mon Sep 17 00:00:00 2001
+From dad81660aaf6e7bd011b3541e9ab9a0a27120973 Mon Sep 17 00:00:00 2001
 From: Tony Theodore <tonyt@logyst.com>
 Date: Sat, 16 Jul 2016 20:31:07 +1000
-Subject: [PATCH 7/8] Fix pkgconfig file and library naming
+Subject: [PATCH 2/8] Fix pkgconfig file and library naming
 
 See: https://codereview.qt-project.org/#/c/165394/
      https://bugreports.qt.io/browse/QTBUG-30898
@@ -187,10 +65,10 @@
 Change-Id: If75336ec7d21a7ec0cb6d245fe87c64afcb5a644
 
 diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
-index d9011f5..1993a7f 100644
+index f8729de947..e7f6e3651d 100644
 --- a/mkspecs/features/qt_module.prf
 +++ b/mkspecs/features/qt_module.prf
-@@ -244,6 +244,10 @@ load(qt_installs)
+@@ -264,6 +264,10 @@ load(qt_installs)
  
  load(qt_targets)
  
@@ -201,53 +79,295 @@
  # this builds on top of qt_common
  !internal_module:!lib_bundle:if(unix|mingw) {
      CONFIG += create_pc
-@@ -254,12 +258,12 @@ load(qt_targets)
+@@ -274,12 +278,12 @@ load(qt_targets)
          QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS/raw]
      QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS/raw]
-     QMAKE_PKGCONFIG_CFLAGS = -I${includedir}/$$MODULE_INCNAME
+     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$$eval(QT.$${i}.MAJOR_VERSION))
-+        QMAKE_PKGCONFIG_REQUIRES += $$replace(QT.$${i}.name, ^Qt, Qt$$eval(QT.$${i}.MAJOR_VERSION))$$qtPlatformTargetSuffix()
+-        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
      pclib_replace.match = $$lib_replace.match
      !isEmpty(lib_replace.replace): \
          pclib_replace.replace = $$QMAKE_PKGCONFIG_LIBDIR
-@@ -293,5 +297,3 @@ win32 {
+@@ -313,5 +317,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.9.3
+2.17.0
+
+
+From 69740750f7905baa5c66e48bad22e39b5e07ca72 Mon Sep 17 00:00:00 2001
+From: Mark Brand <mabrand@mabrand.nl>
+Date: Sun, 29 Jan 2017 13:02:16 +0100
+Subject: [PATCH 3/8] reenable fontconfig for win32 (MXE-specific)
+
+Change-Id: I05b036366bd402e43309742412bcf8ca91fe125f
+
+diff --git a/src/gui/configure.json b/src/gui/configure.json
+index 219385a108..eee90b5b20 100644
+--- a/src/gui/configure.json
++++ b/src/gui/configure.json
+@@ -973,7 +973,7 @@
+         "fontconfig": {
+             "label": "Fontconfig",
+             "autoDetect": "!config.darwin",
+-            "condition": "!config.win32 && features.system-freetype && libs.fontconfig",
++            "condition": "features.system-freetype && libs.fontconfig",
+             "output": [ "privateFeature", "feature" ]
+         },
+         "gbm": {
+diff --git a/src/plugins/platforms/minimal/qminimalintegration.cpp b/src/plugins/platforms/minimal/qminimalintegration.cpp
+index 0c04608fca..a26e02fbf3 100644
+--- a/src/plugins/platforms/minimal/qminimalintegration.cpp
++++ b/src/plugins/platforms/minimal/qminimalintegration.cpp
+@@ -161,7 +161,11 @@ QPlatformFontDatabase *QMinimalIntegration::fontDatabase() const
+ 
+         if (!m_fontDatabase) {
+ #if QT_CONFIG(fontconfig)
+-            m_fontDatabase = new QGenericUnixFontDatabase;
++#ifdef Q_OS_WIN
++        m_fontDatabase = new QFreeTypeFontDatabase;
++#else
++        m_fontDatabase = new QGenericUnixFontDatabase;
++#endif
+ #else
+             m_fontDatabase = QPlatformIntegration::fontDatabase();
+ #endif
+-- 
+2.17.0
+
+
+From e28fcb374385d6dfb29a6c99bea283a4fbc894a7 Mon Sep 17 00:00:00 2001
+From: Mark Brand <mabrand@mabrand.nl>
+Date: Sun, 29 Jan 2017 16:22:03 +0100
+Subject: [PATCH 4/8] fix treatment of SYBASE_LIBS
+
+Change-Id: I4c9914cf7ef9d91feb0718a57f2551c1eeed47e0
+
+diff --git a/src/plugins/sqldrivers/configure.pri b/src/plugins/sqldrivers/configure.pri
+index b69b51b679..d37423adbd 100644
+--- a/src/plugins/sqldrivers/configure.pri
++++ b/src/plugins/sqldrivers/configure.pri
+@@ -92,7 +92,7 @@ defineTest(qtConfLibrary_sybaseEnv) {
+         libs += "-L$${sybase}/lib"
+     libs += $$getenv(SYBASE_LIBS)
+     !isEmpty(libs) {
+-        $${1}.libs = "$$val_escape(libs)"
++        $${1}.libs = $$libs
+         export($${1}.libs)
+     }
+     return(true)
+-- 
+2.17.0
+
+
+From ef350f7199772d5846a1f6f9214e8d562183f393 Mon Sep 17 00:00:00 2001
+From: Mark Brand <mabrand@mabrand.nl>
+Date: Sun, 11 Jun 2017 00:27:41 +0200
+Subject: [PATCH 5/8] use pkg-config for harfbuzz
+
+Change-Id: Ia65cbb90fd180f1bc10ce077a9a8323a48e51421
+
+diff --git a/src/gui/configure.json b/src/gui/configure.json
+index eee90b5b20..6c6745b1dd 100644
+--- a/src/gui/configure.json
++++ b/src/gui/configure.json
+@@ -215,7 +215,8 @@
+                 ]
+             },
+             "sources": [
+-                "-lharfbuzz"
++               { "type": "pkgConfig", "args": "harfbuzz" },
++               "-lharfbuzz"
+             ]
+         },
+         "imf": {
+-- 
+2.17.0
+
+
+From 65353949d9a7f6bbdcd5ddabf09ac3e5357eac1d Mon Sep 17 00:00:00 2001
+From: Mark Brand <mabrand@mabrand.nl>
+Date: Thu, 23 Nov 2017 11:28:47 +0200
+Subject: [PATCH 6/8] 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 ebf9864b15..9a31933975 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.17.0
 
 
-From a2ed2c9fe74b549cb163f89a56df6eec3af553fa Mon Sep 17 00:00:00 2001
-From: Mark Brand <mabrand@mabrand.nl>
-Date: Thu, 15 Dec 2016 17:20:56 +0100
-Subject: [PATCH 8/8] fix mysql config test
+From 84cf457b4bc814fb82b08e0917b09397bbf9ec1a Mon Sep 17 00:00:00 2001
+From: Thiago Macieira <thiago.macieira@intel.com>
+Date: Tue, 8 May 2018 21:57:07 -0700
+Subject: [PATCH 7/8] Fix build with GCC 8: memset/memcpy/memmove of
+ non-trivials
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+qarraydataops.h:73:17: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type
+‘struct TCBPoint’; use assignment or value-initialization instead [-Werror=class-memaccess]
+
+Change-Id: I5d0ee9389a794d80983efffd152ce10eb557341f
+Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
 
-The config test already gets link flags which should include
-the library. Blindly adding it to the end of the list can break
-static linking.
+diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h
+index d0f83d2b6a..7e1b43f9b1 100644
+--- a/src/corelib/tools/qarraydataops.h
++++ b/src/corelib/tools/qarraydataops.h
+@@ -65,7 +65,7 @@ struct QPodArrayOps
+         Q_ASSERT(newSize > uint(this->size));
+         Q_ASSERT(newSize <= this->alloc);
+ 
+-        ::memset(this->end(), 0, (newSize - this->size) * sizeof(T));
++        ::memset(static_cast<void *>(this->end()), 0, (newSize - this->size) * sizeof(T));
+         this->size = int(newSize);
+     }
+ 
+@@ -121,8 +121,9 @@ struct QPodArrayOps
+         Q_ASSERT(e <= where || b > this->end()); // No overlap
+         Q_ASSERT(size_t(e - b) <= this->alloc - uint(this->size));
+ 
+-        ::memmove(where + (e - b), where, (static_cast<const T*>(this->end()) - where) * sizeof(T));
+-        ::memcpy(where, b, (e - b) * sizeof(T));
++        ::memmove(static_cast<void *>(where + (e - b)), static_cast<void *>(where),
++                  (static_cast<const T*>(this->end()) - where) * sizeof(T));
++        ::memcpy(static_cast<void *>(where), static_cast<const void *>(b), (e - b) * sizeof(T));
+         this->size += (e - b);
+     }
+ 
+@@ -133,7 +134,8 @@ struct QPodArrayOps
+         Q_ASSERT(b >= this->begin() && b < this->end());
+         Q_ASSERT(e > this->begin() && e < this->end());
+ 
+-        ::memmove(b, e, (static_cast<T *>(this->end()) - e) * sizeof(T));
++        ::memmove(static_cast<void *>(b), static_cast<void *>(e),
++                  (static_cast<T *>(this->end()) - e) * sizeof(T));
+         this->size -= (e - b);
+     }
+ };
+-- 
+2.17.0
 
-Change-Id: Ief71c4ad64cbbb1b141b0ef5549f42a36bbd125b
+
+From 77082d00f719fc72daa85ad2a59f3f395201ba6a Mon Sep 17 00:00:00 2001
+From: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
+Date: Mon, 9 Apr 2018 18:34:18 +0200
+Subject: [PATCH 8/8] qmake: fix look-up of relative files from .depend_command
+ in shadow builds
+
+the dependency paths are fixified against the output directory, so we
+must resolve them accordingly.
+
+Change-Id: Id92750aad358153bd2db5daca3194c54eda58dbb
+Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
+(cherry picked from commit 75587c8030ff8057b90200cb20cff1e4549c00b5)
 
-diff --git a/config.tests/unix/mysql/mysql.pro b/config.tests/unix/mysql/mysql.pro
-index 06d1880..ca6d6aa 100644
---- a/config.tests/unix/mysql/mysql.pro
-+++ b/config.tests/unix/mysql/mysql.pro
-@@ -1,3 +1,3 @@
- SOURCES = mysql.cpp
- CONFIG -= qt dylib
--LIBS += -lmysqlclient
-+LIBS *= -lmysqlclient
+diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
+index 82573347b6..99aecdd8ce 100644
+--- a/qmake/generators/makefile.cpp
++++ b/qmake/generators/makefile.cpp
+@@ -1953,11 +1953,12 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
+                         }
+                         QT_PCLOSE(proc);
+                         if(!indeps.isEmpty()) {
++                            QDir outDir(Option::output_dir);
+                             // ### This is basically fubar. Add 'lines' flag to CONFIG?
+                             QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' ');
+                             for(int i = 0; i < dep_cmd_deps.count(); ++i) {
+                                 QString &file = dep_cmd_deps[i];
+-                                QString absFile = QDir(Option::output_dir).absoluteFilePath(file);
++                                QString absFile = outDir.absoluteFilePath(file);
+                                 if (exists(absFile)) {
+                                     file = absFile;
+                                 } else {
+@@ -1965,8 +1966,9 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
+                                     QList<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths();
+                                     for (QList<QMakeLocalFileName>::Iterator dit = depdirs.begin();
+                                         dit != depdirs.end(); ++dit) {
+-                                        if (exists((*dit).local() + '/' + file)) {
+-                                            localFile = (*dit).local() + '/' + file;
++                                        QString lf = outDir.absoluteFilePath((*dit).local() + '/' + file);
++                                        if (exists(lf)) {
++                                            localFile = lf;
+                                             break;
+                                         }
+                                     }
+@@ -2045,11 +2047,12 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
+                     }
+                     QT_PCLOSE(proc);
+                     if(!indeps.isEmpty()) {
++                        QDir outDir(Option::output_dir);
+                         // ### This is basically fubar. Add 'lines' flag to CONFIG?
+                         QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' ');
+                         for(int i = 0; i < dep_cmd_deps.count(); ++i) {
+                             QString &file = dep_cmd_deps[i];
+-                            QString absFile = QDir(Option::output_dir).absoluteFilePath(file);
++                            QString absFile = outDir.absoluteFilePath(file);
+                             if (exists(absFile)) {
+                                 file = absFile;
+                             } else {
+@@ -2057,8 +2060,9 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
+                                 QList<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths();
+                                 for (QList<QMakeLocalFileName>::Iterator dit = depdirs.begin();
+                                     dit != depdirs.end(); ++dit) {
+-                                    if (exists((*dit).local() + '/' + file)) {
+-                                        localFile = (*dit).local() + '/' + file;
++                                    QString lf = outDir.absoluteFilePath((*dit).local() + '/' + file);
++                                    if (exists(lf)) {
++                                        localFile = lf;
+                                         break;
+                                     }
+                                 }
 -- 
-2.9.3
+2.17.0
 
+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 -r ce586b66209f -r 3a8c7305ae32 src/qtbase.mk
--- a/src/qtbase.mk	Thu Jun 07 15:50:42 2018 -0400
+++ b/src/qtbase.mk	Tue Jun 12 12:21:53 2018 -0400
@@ -3,12 +3,12 @@
 
 PKG             := qtbase
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 5.7.1
-$(PKG)_CHECKSUM := a3ddcde8978d3a05bb4342fce364a792472a16e6
-$(PKG)_SUBDIR   := $(PKG)-opensource-src-$($(PKG)_VERSION)
-$(PKG)_FILE     := $(PKG)-opensource-src-$($(PKG)_VERSION).tar.xz
-$(PKG)_URL      := http://download.qt.io/official_releases/qt/5.7/$($(PKG)_VERSION)/submodules/$($(PKG)_FILE)
-$(PKG)_DEPS     := dbus double-conversion freetds freetype fontconfig jpeg libjbig libpng libproxy pcre postgresql sqlite zlib
+$(PKG)_VERSION  := 5.11.0
+$(PKG)_CHECKSUM := 277bfe3ebbead8096f6a16416db522179404d41e
+$(PKG)_SUBDIR   := $(PKG)-everywhere-src-$($(PKG)_VERSION)
+$(PKG)_FILE     := $(PKG)-everywhere-src-$($(PKG)_VERSION).tar.xz
+$(PKG)_URL      := http://download.qt.io/official_releases/qt/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_VERSION)/submodules/$($(PKG)_FILE)
+$(PKG)_DEPS     := dbus double-conversion freetds freetype fontconfig jpeg libjbig libpng libproxy pcre2 postgresql sqlite zlib
 
 $(PKG)_CONFIGURE_CROSS_COMPILE_OPTION :=
 $(PKG)_CONFIGURE_DATABASE_OPTION :=
@@ -88,6 +88,11 @@
   endif
 endif
 
+$(PKG)_CONFIGURE_ENV += \
+    PKG_CONFIG="$(MXE_PKG_CONFIG)" \
+    PKG_CONFIG_SYSROOT_DIR="/" \
+    PKG_CONFIG_LIBDIR="$(PKG_CONFIG_PATH)"
+
 define $(PKG)_BUILD
     cd '$(1)' && \
         $($(PKG)_CONFIGURE_ENV) \
@@ -101,6 +106,7 @@
             $($(PKG)_CONFIGURE_PLATFORM_OPTION) \
             $($(PKG)_CONFIGURE_CROSS_COMPILE_OPTION) \
             -device-option PKG_CONFIG='$(MXE_PKG_CONFIG)' \
+            -pkg-config \
             -force-pkg-config \
             -no-use-gold-linker \
             -shared \
diff -r ce586b66209f -r 3a8c7305ae32 src/qtimageformats.mk
--- a/src/qtimageformats.mk	Thu Jun 07 15:50:42 2018 -0400
+++ b/src/qtimageformats.mk	Tue Jun 12 12:21:53 2018 -0400
@@ -4,7 +4,7 @@
 PKG             := qtimageformats
 $(PKG)_IGNORE   :=
 $(PKG)_VERSION   = $(qtbase_VERSION)
-$(PKG)_CHECKSUM := 4cf8e6183e8280adcd6765c5ae1d2ea27a868a1f
+$(PKG)_CHECKSUM := d1382ddb54d0e95d226815c051b4a02c4d935bc7
 $(PKG)_SUBDIR    = $(subst qtbase,qtimageformats,$(qtbase_SUBDIR))
 $(PKG)_FILE      = $(subst qtbase,qtimageformats,$(qtbase_FILE))
 $(PKG)_URL       = $(subst qtbase,qtimageformats,$(qtbase_URL))
diff -r ce586b66209f -r 3a8c7305ae32 src/qtsvg.mk
--- a/src/qtsvg.mk	Thu Jun 07 15:50:42 2018 -0400
+++ b/src/qtsvg.mk	Tue Jun 12 12:21:53 2018 -0400
@@ -4,7 +4,7 @@
 PKG             := qtsvg
 $(PKG)_IGNORE   :=
 $(PKG)_VERSION   = $(qtbase_VERSION)
-$(PKG)_CHECKSUM := 1915053a55152502440b7ba856333138854843d9
+$(PKG)_CHECKSUM := 2c09995b9ea5d3a77fc7f8b0d6f4921fb497eaa0
 $(PKG)_SUBDIR    = $(subst qtbase,qtsvg,$(qtbase_SUBDIR))
 $(PKG)_FILE      = $(subst qtbase,qtsvg,$(qtbase_FILE))
 $(PKG)_URL       = $(subst qtbase,qtsvg,$(qtbase_URL))
diff -r ce586b66209f -r 3a8c7305ae32 src/qttools-1.patch
--- a/src/qttools-1.patch	Thu Jun 07 15:50:42 2018 -0400
+++ b/src/qttools-1.patch	Tue Jun 12 12:21:53 2018 -0400
@@ -1,5 +1,4 @@
-# This file is part of MXE.
-# See index.html for further information.
+# This file is part of MXE. See LICENSE.md for licensing information.
 
 From 3dc7b77a86b4d399836472484a5b3448a27f1a1e Mon Sep 17 00:00:00 2001
 From: Mark Brand <mabrand@mabrand.nl>
@@ -23,15 +22,3 @@
 -- 
 2.1.2
 
-diff -ur qttools-opensource-src-5.7.0.orig/src/linguist/lrelease/lrelease.pro qttools-opensource-src-5.7.0/src/linguist/lrelease/lrelease.pro
---- qttools-opensource-src-5.7.0.orig/src/linguist/lrelease/lrelease.pro	2016-08-25 16:36:01.797626791 -0400
-+++ qttools-opensource-src-5.7.0/src/linguist/lrelease/lrelease.pro	2016-08-25 17:46:21.465008465 -0400
-@@ -4,6 +4,8 @@
- 
- SOURCES += main.cpp
- 
-+INCLUDEPATH += XXX
-+
- include(../shared/formats.pri)
- include(../shared/proparser.pri)
- 
diff -r ce586b66209f -r 3a8c7305ae32 src/qttools.mk
--- a/src/qttools.mk	Thu Jun 07 15:50:42 2018 -0400
+++ b/src/qttools.mk	Tue Jun 12 12:21:53 2018 -0400
@@ -4,7 +4,7 @@
 PKG             := qttools
 $(PKG)_IGNORE   :=
 $(PKG)_VERSION   = $(qtbase_VERSION)
-$(PKG)_CHECKSUM := cd658a77a14dc503781b717259f3de0281d48d79
+$(PKG)_CHECKSUM := 996b9394d9e6460457fddff69213ef771992fdda
 $(PKG)_SUBDIR    = $(subst qtbase,qttools,$(qtbase_SUBDIR))
 $(PKG)_FILE      = $(subst qtbase,qttools,$(qtbase_FILE))
 $(PKG)_URL       = $(subst qtbase,qttools,$(qtbase_URL))
diff -r ce586b66209f -r 3a8c7305ae32 src/sqlite.mk
--- a/src/sqlite.mk	Thu Jun 07 15:50:42 2018 -0400
+++ b/src/sqlite.mk	Tue Jun 12 12:21:53 2018 -0400
@@ -22,6 +22,7 @@
         $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
         $(ENABLE_SHARED_OR_STATIC) \
         --prefix='$(HOST_PREFIX)' \
+        CFLAGS="-Os -DSQLITE_ENABLE_COLUMN_METADATA" \
         --disable-readline \
         --disable-threadsafe
     $(MAKE) -C '$(1)' -j 1
