# HG changeset patch
# User John D
# Date 1475162571 14400
# Node ID 44b1a9b2193ef812b4192d939fc79c73d73be790
# Parent 1cac126043143a7ca35e5babccd1e03b980e1913
qt5: add initial qt5 to mxe-octave, based on mxe.cc
* src/qt5.mk: new file
* src/qtbase-1-fixes.patch: new file
* src/qtbase.mk: new file
* src/qtimageformats-1.patch: new file
* src/qtimageformats.mk: new file
* src/qtsvg.mk: new file
* src/qttools-1.patch: new file
* added src/qttools.mk: new file
* changed Makefile.in: added ENABLE_QT5 option
* configure.ac: added enable-qt5 option
* index.html: added new files to packages
* installer-files/octave-firsttime.vbs: added setup of qt5 bin, plugin path
* installer-files/octave.vbs: added setup of qt5 bin, plugin path
* installer-files/octave.bat: added setup of qt5 bin path
* src/default-octave.mk: added settig fot qt5 usage
* src/qscintilla.mk: added qt5 path
diff -r 1cac12604314 -r 44b1a9b2193e Makefile.in
--- a/Makefile.in Tue Sep 27 16:00:44 2016 -0400
+++ b/Makefile.in Thu Sep 29 11:22:51 2016 -0400
@@ -62,6 +62,9 @@
# create and install devel tools (default no)
ENABLE_DEVEL_TOOLS := @ENABLE_DEVEL_TOOLS@
+# use qt5 instead of qt4
+ENABLE_QT5 := @ENABLE_QT5@
+
# Should match what config.guess prints for your system.
# If cross compiling, you must set it manually (defaults are set by configure).
ifeq ($(MXE_NATIVE_BUILD),yes)
@@ -357,7 +360,12 @@
MXE_WINDRES := true
endif
MXE_PKG_CONFIG := '$(BUILD_TOOLS_PREFIX)/bin/pkg-config'
- MXE_QMAKE := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)qmake'
+ ifeq ($(ENABLE_QT5),yes)
+ MXE_QMAKE := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)qmake-qt5'
+ else
+ MXE_QMAKE := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)qmake'
+ endif
+
MXE_MOC := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)moc'
MXE_UIC := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)uic'
MXE_LRELEASE := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)lrelease'
diff -r 1cac12604314 -r 44b1a9b2193e configure.ac
--- a/configure.ac Tue Sep 27 16:00:44 2016 -0400
+++ b/configure.ac Thu Sep 29 11:22:51 2016 -0400
@@ -231,6 +231,14 @@
[if test "$enableval" = yes; then ENABLE_DEVEL_TOOLS=yes; fi], [])
AC_SUBST(ENABLE_DEVEL_TOOLS)
+ENABLE_QT5=no
+AC_ARG_ENABLE([qt5],
+ [AS_HELP_STRING([--enable-qt5],
+ [Enable compile of GNU octave using Qt5 (Experimental)])],
+ [if test "$enableval" = yes; then ENABLE_QT5=yes; fi], [])
+AC_SUBST(ENABLE_QT5)
+
+
### Default is to cross compile for mingw.
echo $host_alias
diff -r 1cac12604314 -r 44b1a9b2193e index.html
--- a/index.html Tue Sep 27 16:00:44 2016 -0400
+++ b/index.html Thu Sep 29 11:22:51 2016 -0400
@@ -2202,6 +2202,26 @@
Qt |
+ qt5 |
+ Qt5 |
+
+
+ qtbase |
+ Qt5 base |
+
+
+ qttools |
+ Qt5 tools |
+
+
+ qtsvg |
+ Qt5 svg |
+
+
+ qtimageformats |
+ Qt5 imageformats |
+
+
qwt |
Qwt |
diff -r 1cac12604314 -r 44b1a9b2193e installer-files/octave-firsttime.vbs
--- a/installer-files/octave-firsttime.vbs Tue Sep 27 16:00:44 2016 -0400
+++ b/installer-files/octave-firsttime.vbs Thu Sep 29 11:22:51 2016 -0400
@@ -17,8 +17,14 @@
wshSystemEnv("GS") = "gs.exe"
-' set Qt plugin directory
-wshSystemEnv("QT_PLUGIN_PATH") = OctavePath & "\plugins"
+' set Qt plugin directory and path
+Set objFSO = CreateObject("Scripting.FileSystemObject")
+If objFSO.FolderExists(OctavePath & "\qt5\bin") Then
+ wshSystemEnv("PATH") = OctavePath & "\qt5\bin;" & wshSystemEnv("PATH")
+ wshSystemEnv("QT_PLUGIN_PATH") = OctavePath & "\qt5\plugins"
+Else
+ wshSystemEnv("QT_PLUGIN_PATH") = OctavePath & "\plugins"
+End If
' set directory to users
startpath = wshShell.ExpandEnvironmentStrings("%UserProfile%")
diff -r 1cac12604314 -r 44b1a9b2193e installer-files/octave.bat
--- a/installer-files/octave.bat Tue Sep 27 16:00:44 2016 -0400
+++ b/installer-files/octave.bat Thu Sep 29 11:22:51 2016 -0400
@@ -9,7 +9,7 @@
Rem Set up PATH. Make sure the octave bin dir
Rem comes first.
-set PATH=%OCT_HOME%bin;%PATH%
+set PATH=%OCT_HOME%qt5\bin;%OCT_HOME%bin;%PATH%
Rem Set up any environment vars we may need
diff -r 1cac12604314 -r 44b1a9b2193e installer-files/octave.vbs
--- a/installer-files/octave.vbs Tue Sep 27 16:00:44 2016 -0400
+++ b/installer-files/octave.vbs Thu Sep 29 11:22:51 2016 -0400
@@ -17,8 +17,14 @@
wshSystemEnv("GS") = "gs.exe"
-' set Qt plugin directory
-wshSystemEnv("QT_PLUGIN_PATH") = OctavePath & "\plugins"
+' set Qt plugin directory and path
+Set objFSO = CreateObject("Scripting.FileSystemObject")
+If objFSO.FolderExists(OctavePath & "\qt5\bin") Then
+ wshSystemEnv("PATH") = OctavePath & "\qt5\bin;" & wshSystemEnv("PATH")
+ wshSystemEnv("QT_PLUGIN_PATH") = OctavePath & "\qt5\plugins"
+Else
+ wshSystemEnv("QT_PLUGIN_PATH") = OctavePath & "\plugins"
+End If
' check args to see if told to run gui or command line
' and build other args to use
diff -r 1cac12604314 -r 44b1a9b2193e src/default-octave.mk
--- a/src/default-octave.mk Tue Sep 27 16:00:44 2016 -0400
+++ b/src/default-octave.mk Thu Sep 29 11:22:51 2016 -0400
@@ -14,7 +14,14 @@
ifeq ($(USE_SYSTEM_FONTCONFIG),no)
$(PKG)_FONTCONFIG := fontconfig
endif
-$(PKG)_DEPS := blas arpack curl epstool fftw fltk $($(PKG)_FONTCONFIG) ghostscript gl2ps glpk gnuplot graphicsmagick hdf5 lapack libsndfile osmesa pcre portaudio pstoedit qrupdate qscintilla qt readline suitesparse texinfo zlib
+$(PKG)_DEPS := blas arpack curl epstool fftw fltk $($(PKG)_FONTCONFIG) ghostscript gl2ps glpk gnuplot graphicsmagick hdf5 lapack libsndfile osmesa pcre portaudio pstoedit qrupdate qscintilla readline suitesparse texinfo zlib
+
+ifeq ($(ENABLE_QT5),yes)
+ $(PKG)_DEPS += qt5
+else
+ $(PKG)_DEPS += qt
+endif
+
ifeq ($(MXE_WINDOWS_BUILD),no)
ifeq ($(USE_SYSTEM_X11_LIBS),no)
$(PKG)_DEPS += x11 xext
@@ -56,6 +63,16 @@
RCC=$(MXE_RCC) \
LRELEASE=$(MXE_LRELEASE)
+ifeq ($(ENABLE_QT5),yes)
+ #$(PKG)_PKG_CONFIG_PATH := "$(HOST_LIBDIR)/pkgconfig"
+ $(PKG)_PKG_CONFIG_PATH := "$(HOST_PREFIX)/qt5/lib/pkgconfig:$(HOST_LIBDIR)/pkgconfig"
+ $(PKG)_QTDIR := $(HOST_PREFIX)/qt5
+else
+ $(PKG)_PKG_CONFIG_PATH := "$(HOST_LIBDIR)/pkgconfig"
+ $(PKG)_QTDIR := $(HOST_PREFIX)
+endif
+
+
ifneq ($(ENABLE_DOCS),yes)
$(PKG)_ENABLE_DOCS_CONFIGURE_OPTIONS := --disable-docs
endif
@@ -91,7 +108,7 @@
else
$(PKG)_PREFIX := '$(HOST_PREFIX)'
$(PKG)_EXTRA_CONFIGURE_OPTIONS := \
- LDFLAGS='-Wl,-rpath-link,$(HOST_LIBDIR) -L$(HOST_LIBDIR)'
+ LDFLAGS='-Wl,-rpath-link,$(HOST_LIBDIR) -L$(HOST_LIBDIR) -L$($(PKG)_QTDIR)/lib'
endif
ifeq ($(MXE_SYSTEM),mingw)
@@ -146,7 +163,7 @@
$($(PKG)_QT_CONFIGURE_OPTIONS) \
$($(PKG)_EXTRA_CONFIGURE_OPTIONS) \
PKG_CONFIG='$(MXE_PKG_CONFIG)' \
- PKG_CONFIG_PATH='$(HOST_LIBDIR)/pkgconfig' \
+ PKG_CONFIG_PATH=$($(PKG)_PKG_CONFIG_PATH) \
&& $(CONFIGURE_POST_HOOK)
$(MAKE) -C '$(1)/.build/libgnu'
diff -r 1cac12604314 -r 44b1a9b2193e src/qscintilla.mk
--- a/src/qscintilla.mk Tue Sep 27 16:00:44 2016 -0400
+++ b/src/qscintilla.mk Thu Sep 29 11:22:51 2016 -0400
@@ -8,7 +8,13 @@
$(PKG)_SUBDIR := QScintilla_gpl-$($(PKG)_VERSION)
$(PKG)_FILE := QScintilla_gpl-$($(PKG)_VERSION).tar.gz
$(PKG)_URL := http://sourceforge.net/projects/pyqt/files/QScintilla2/QScintilla-$($(PKG)_VERSION)/$($(PKG)_FILE)
-$(PKG)_DEPS := qt
+
+
+ifeq ($(ENABLE_QT5),yes)
+ $(PKG)_DEPS := qt5
+else
+ $(PKG)_DEPS := qt
+endif
ifeq ($(MXE_NATIVE_MINGW_BUILD),yes)
$(PKG)_INSTALL_ROOT :=
@@ -25,7 +31,11 @@
ifneq ($(MXE_NATIVE_BUILD),yes)
ifeq ($(MXE_SYSTEM),mingw)
- $(PKG)_QMAKE_SPEC_OPTION := -spec '$(HOST_PREFIX)/mkspecs/win32-g++'
+ ifeq ($(ENABLE_QT5),yes)
+ $(PKG)_QMAKE_SPEC_OPTION := -spec '$(BUILD_TOOLS_PREFIX)/mkspecs/win32-g++'
+ else
+ $(PKG)_QMAKE_SPEC_OPTION := -spec '$(HOST_PREFIX)/mkspecs/win32-g++'
+ endif
endif
ifeq ($(MXE_SYSTEM),msvc)
# FIXME: compute "2010" suffix dynamically
@@ -47,12 +57,19 @@
$(MAKE) -C '$(1)/Qt4Qt5' -j 1 install INSTALL_ROOT='$($(PKG)_INSTALL_ROOT)'; \
fi
- if [ $(MXE_SYSTEM) = mingw ]; then \
+ if [ $(MXE_SYSTEM)$(ENABLE_QT5) = mingwyes ]; then \
+ $(INSTALL) -d '$($(PKG)_INSTALL_ROOT)$(HOST_PREFIX)/qt5/lib'; \
+ $(INSTALL) -m755 '$($(PKG)_INSTALL_ROOT)$(HOST_PREFIX)/qt5/lib/$(LIBRARY_PREFIX)qscintilla2$(LIBRARY_SUFFIX).dll' '$($(PKG)_INSTALL_ROOT)$(HOST_PREFIX)/qt5/bin/'; \
+ rm -f '$($(PKG)_INSTALL_ROOT)$(HOST_PREFIX)/qt5/lib/$(LIBRARY_PREFIX)qscintilla2$(LIBRARY_SUFFIX).dll'; \
+ $(INSTALL) -m755 '$($(PKG)_INSTALL_ROOT)$(HOST_PREFIX)/qt5/lib/libqscintilla2.a' '$($(PKG)_INSTALL_ROOT)$(HOST_PREFIX)/qt5/lib/libqscintilla2-qt5.a'; \
+ fi
+ if [ $(MXE_SYSTEM)$(ENABLE_QT5) = mingwno ]; then \
$(INSTALL) -d '$($(PKG)_INSTALL_ROOT)$(HOST_BINDIR)'; \
$(INSTALL) -m755 '$($(PKG)_INSTALL_ROOT)$(HOST_LIBDIR)/$(LIBRARY_PREFIX)qscintilla2$(LIBRARY_SUFFIX).dll' '$($(PKG)_INSTALL_ROOT)$(HOST_BINDIR)/'; \
rm -f '$($(PKG)_INSTALL_ROOT)$(HOST_LIBDIR)/$(LIBRARY_PREFIX)qscintilla2$(LIBRARY_SUFFIX).dll'; \
fi
+
# Qmake under MSVC uses Win32 paths. When combining this with
# DESTDIR usage (or equivalent), the real Win32 directory hierarchy
# is recreated under DESTDIR, not the MSYS hierarchy.
@@ -61,4 +78,5 @@
$(INSTALL) -m755 '$($(PKG)_INSTALL_ROOT)$(CMAKE_HOST_PREFIX)/lib/$(LIBRARY_PREFIX)qscintilla2$(LIBRARY_SUFFIX).dll' '$($(PKG)_INSTALL_ROOT)$(CMAKE_HOST_PREFIX)/bin/'; \
rm -f '$($(PKG)_INSTALL_ROOT)$(CMAKE_HOST_PREFIX)/lib/$(LIBRARY_PREFIX)qscintilla2$(LIBRARY_SUFFIX).dll'; \
fi
+
endef
diff -r 1cac12604314 -r 44b1a9b2193e src/qt5.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/qt5.mk Thu Sep 29 11:22:51 2016 -0400
@@ -0,0 +1,12 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG := qt5
+$(PKG)_VERSION = $(qtbase_VERSION)
+$(PKG)_DEPS := $(patsubst $(TOP_DIR)/src/%.mk,%,\
+ $(shell grep -l 'qtbase_VERSION' \
+ $(TOP_DIR)/src/qt*.mk \
+ --exclude '$(TOP_DIR)/src/qt5.mk'))
+$(PKG)_FILE = $(subst qtbase,qtimageformats,$(qtbase_FILE))
+$(PKG)_URL = $(subst qtbase,qtimageformats,$(qtbase_URL))
+$(PKG)_CHECKSUM := #No checksum
diff -r 1cac12604314 -r 44b1a9b2193e src/qtbase-1-fixes.patch
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/qtbase-1-fixes.patch Thu Sep 29 11:22:51 2016 -0400
@@ -0,0 +1,267 @@
+This file is part of MXE.
+See index.html for further information.
+
+Contains ad hoc patches for cross building.
+
+From 9e13228f4af09b93f6cd123635784e4988694ac2 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.7.4
+
+
+From 2d7638835de6b5f16cf64e6cf4eede1f8a9ccedb Mon Sep 17 00:00:00 2001
+From: Mark Brand
+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.7.4
+
+
+From 172b7bf1f113b1ea443a64ad4f9a2ecda6ee06e2 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.7.4
+
+
+From 7756e4e14ae5b33fea04416bd4f238ca1dfe4d30 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 43b55f0..de2c3ec 100755
+--- a/configure
++++ b/configure
+@@ -4656,7 +4656,7 @@ fi
+ [ "$XPLATFORM_ANDROID" = "yes" ] && QMakeVar add styles "android"
+
+ # check IPC support
+-if ! compileTest unix/ipc_sysv "ipc_sysv" ; then
++if [ "$XPLATFORM_MINGW" = "no" ] && ! compileTest unix/ipc_sysv "ipc_sysv" ; then
+ # SYSV IPC is not supported - check POSIX IPC
+ if compileTest unix/ipc_posix "ipc_posix" ; then
+ QCONFIG_FLAGS="$QCONFIG_FLAGS QT_POSIX_IPC"
+--
+2.7.4
+
+
+From 236aecbd657f06d0b18bc25b93d5390ac644daaf Mon Sep 17 00:00:00 2001
+From: Ray Donnelly
+Date: Wed, 26 Aug 2015 12:45:43 +0100
+Subject: [PATCH 6/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.
+
+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 d2358ca..6b1dc95 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()
+ !!ENDIF
+
++!!IF equals(TEMPLATE, aux)
++ add_library(Qt5::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
++!!ELSE
+ !!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)
+ !!ENDIF
+ !!ENDIF
+--
+2.7.4
+
+
+From 0d1b11391894345be8a1fe084afb3799fc828488 Mon Sep 17 00:00:00 2001
+From: Thiago Macieira
+Date: Wed, 18 May 2016 14:40:20 -0700
+Subject: [PATCH 7/8] Fix linking of the minimal platform plugin on OS X
+
+platformsupport/fontdatabases/fontdatabases.pri disables all font
+databases except CoreText on OS X, so this is required for
+linking. Otherwise, we get undefined reference linker errors:
+
+Undefined symbols for architecture x86_64:
+ "vtable for QBasicFontDatabase", referenced from:
+ QMinimalIntegration::fontDatabase() const in
+ qminimalintegration.o
+
+Change-Id: I31298e973803b4d6eedbf61607056114d1556584
+Reviewed-by: Jake Petroules
+(cherry picked from commit 16864c42d6bc0ee6b3e3fa03123ef5884557ceea)
+
+diff --git a/src/plugins/platforms/minimal/minimal.pro b/src/plugins/platforms/minimal/minimal.pro
+index 0d31d66..bd6f2d8 100644
+--- a/src/plugins/platforms/minimal/minimal.pro
++++ b/src/plugins/platforms/minimal/minimal.pro
+@@ -11,6 +11,7 @@ HEADERS = qminimalintegration.h \
+ OTHER_FILES += minimal.json
+
+ CONFIG += qpa/genericunixfontdatabase
++darwin: DEFINES += QT_NO_FONTCONFIG
+
+ PLUGIN_TYPE = platforms
+ PLUGIN_CLASS_NAME = QMinimalIntegrationPlugin
+--
+2.7.4
+
+
+From f504f5805be3cc27e19632e15b29eaaaac0e92e8 Mon Sep 17 00:00:00 2001
+From: Boris Pek
+Date: Sun, 19 Jun 2016 03:15:43 +0300
+Subject: [PATCH 8/8] Fix build of the minimal platform plugin for MS Windows
+
+when qtbase is configured with -fontconfig and -system-freetype.
+
+This fix is necessary after 060e0f6628fd185994911307c59f5355acaaf18f.
+Used the same approach as in 16864c42d6bc0ee6b3e3fa03123ef5884557ceea.
+
+Change-Id: Idece0dc11d89e38266c95de1769be751c06324ef
+(cherry picked from commit 02d2969fafe5088bb1c80eb58b2736df447326cd)
+
+diff --git a/src/plugins/platforms/minimal/minimal.pro b/src/plugins/platforms/minimal/minimal.pro
+index bd6f2d8..4b63461 100644
+--- a/src/plugins/platforms/minimal/minimal.pro
++++ b/src/plugins/platforms/minimal/minimal.pro
+@@ -12,6 +12,7 @@ OTHER_FILES += minimal.json
+
+ CONFIG += qpa/genericunixfontdatabase
+ darwin: DEFINES += QT_NO_FONTCONFIG
++win32: DEFINES += QT_NO_FONTCONFIG
+
+ PLUGIN_TYPE = platforms
+ PLUGIN_CLASS_NAME = QMinimalIntegrationPlugin
+--
+2.7.4
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Tony Theodore
+Date: Sat, 16 Jul 2016 20:31:07 +1000
+Subject: [PATCH] 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 1111111..2222222 100644
+--- a/mkspecs/features/qt_module.prf
++++ b/mkspecs/features/qt_module.prf
+@@ -244,6 +244,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:!lib_bundle:if(unix|mingw) {
+ CONFIG += create_pc
+@@ -254,12 +258,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_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()
+ 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 {
+ # 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
diff -r 1cac12604314 -r 44b1a9b2193e src/qtbase.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/qtbase.mk Thu Sep 29 11:22:51 2016 -0400
@@ -0,0 +1,81 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG := qtbase
+$(PKG)_IGNORE :=
+$(PKG)_VERSION := 5.7.0
+$(PKG)_CHECKSUM := ba835ff158932eebbf1ed9f678414923dfd7cce4
+$(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 freetds freetype fontconfig jpeg libpng pcre postgresql sqlite zlib
+
+define $(PKG)_UPDATE
+ $(WGET) -q -O- http://download.qt-project.org/official_releases/qt/5.5/ | \
+ $(SED) -n 's,.*href="\(5\.[0-9]\.[^/]*\)/".*,\1,p' | \
+ grep -iv -- '-rc' | \
+ sort |
+ tail -1
+endef
+
+define $(PKG)_BUILD
+ # ICU is buggy. See #653. TODO: reenable it some time in the future.
+ cd '$(1)' && \
+ PSQL_LIBS="-lpq -lsecur32 -lws2_32" \
+ ./configure \
+ -opensource \
+ -c++std c++11 \
+ -confirm-license \
+ -xplatform win32-g++ \
+ -device-option CROSS_COMPILE=$(MXE_TOOL_PREFIX) \
+ -device-option PKG_CONFIG='$(MXE_PKG_CONFIG)' \
+ -force-pkg-config \
+ -no-use-gold-linker \
+ -release \
+ -shared \
+ -prefix '$(HOST_PREFIX)/qt5' \
+ -hostprefix '$(BUILD_TOOLS_PREFIX)' \
+ -no-icu \
+ -opengl desktop \
+ -no-glib \
+ -accessibility \
+ -nomake examples \
+ -nomake tests \
+ -plugin-sql-sqlite \
+ -plugin-sql-odbc \
+ -plugin-sql-psql \
+ -system-zlib \
+ -system-libpng \
+ -system-libjpeg \
+ -system-sqlite \
+ -fontconfig \
+ -system-freetype \
+ -system-pcre \
+ -no-openssl \
+ -dbus-linked \
+ -v \
+ $($(PKG)_CONFIGURE_OPTS)
+
+ $(MAKE) -C '$(1)' -j '$(JOBS)'
+ rm -rf '$(HOST_PREFIX)/qt5'
+ $(MAKE) -C '$(1)' -j 1 install
+
+# remove this
+ if [ "$(MXE_NATIVE_BUILD)" = "xxno" ]; then \
+ for f in moc qdbuscpp2xml qdbusxml2cpp qlalr qmake rcc uic; do \
+ mv "$(HOST_PREFIX)/qt5/bin/$$f" "$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)$$f-qt5"; \
+ done; \
+ fi
+
+ #ln -sf '$(HOST_PREFIX)/qt5/bin/qmake' '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)'qmake-qt5
+ ln -sf '$(BUILD_TOOLS_PREFIX)/bin/qmake' '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)'qmake-qt5
+ ln -sf '$(BUILD_TOOLS_PREFIX)/bin/moc' '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)'moc
+ ln -sf '$(BUILD_TOOLS_PREFIX)/bin/uic' '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)'uic
+ ln -sf '$(BUILD_TOOLS_PREFIX)/bin/rcc' '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)'rcc
+ ln -sf '$(BUILD_TOOLS_PREFIX)/bin/lrelease' '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)'lrelease
+
+ # setup cmake toolchain
+ #echo 'set(CMAKE_SYSTEM_PREFIX_PATH "$(PREFIX)/$(TARGET)/qt5" ${CMAKE_SYSTEM_PREFIX_PATH})' > '$(CMAKE_TOOLCHAIN_DIR)/$(PKG).cmake'
+
+endef
+
diff -r 1cac12604314 -r 44b1a9b2193e src/qtimageformats-1.patch
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/qtimageformats-1.patch Thu Sep 29 11:22:51 2016 -0400
@@ -0,0 +1,80 @@
+This file is part of MXE.
+See index.html for further information.
+
+From 30f968c6f65c5668a9760ccfd48312b786ab318b Mon Sep 17 00:00:00 2001
+From: Mark Brand
+Date: Thu, 3 Nov 2011 14:11:02 +0100
+Subject: [PATCH 1/2] add pkg-config support for libtiff-4
+
+Change-Id: I387517e04fed7729e5acf28bacdfc289fb2d17bd
+
+diff --git a/config.tests/libtiff/libtiff.pro b/config.tests/libtiff/libtiff.pro
+index f7ac4c1..bd2c6b0 100644
+--- a/config.tests/libtiff/libtiff.pro
++++ b/config.tests/libtiff/libtiff.pro
+@@ -2,5 +2,7 @@ SOURCES = libtiff.cpp
+ CONFIG -= qt dylib
+ mac:CONFIG -= app_bundle
+ win32:CONFIG += console
+-unix|mingw: LIBS += -ltiff
++CONFIG += link_pkgconfig
++packagesExist(libtiff-4):PKGCONFIG += libtiff-4
++else:if(unix|win32-g++*): LIBS += -ltiff
+ else:win32: LIBS += libtiff.lib
+diff --git a/src/plugins/imageformats/tiff/tiff.pro b/src/plugins/imageformats/tiff/tiff.pro
+index 0f841ab..fa22141 100644
+--- a/src/plugins/imageformats/tiff/tiff.pro
++++ b/src/plugins/imageformats/tiff/tiff.pro
+@@ -10,7 +10,9 @@ wince*: SOURCES += qfunctions_wince.cpp
+ OTHER_FILES += tiff.json
+
+ config_libtiff {
+- unix|mingw: LIBS += -ltiff
++ CONFIG += link_pkgconfig
++ packagesExist(libtiff-4):PKGCONFIG += libtiff-4
++ else:if(unix|win32-g++*): LIBS += -ltiff
+ else:win32: LIBS += libtiff.lib
+ } else {
+ include($$PWD/../../../3rdparty/libtiff.pri)
+--
+1.8.4.5
+
+
+From c791e0599f640cf637d5f925b111dbd7a5569244 Mon Sep 17 00:00:00 2001
+From: Mark Brand
+Date: Wed, 19 Dec 2012 23:29:52 +0100
+Subject: [PATCH 2/2] add pkg-config support for libmng (mxe-specific)
+
+Change-Id: I1216f35a01a974321efa2463b687c121baa22667
+
+diff --git a/config.tests/libmng/libmng.pro b/config.tests/libmng/libmng.pro
+index adc096e..a20a0a0 100644
+--- a/config.tests/libmng/libmng.pro
++++ b/config.tests/libmng/libmng.pro
+@@ -2,5 +2,7 @@ SOURCES = libmng.cpp
+ CONFIG -= qt dylib
+ mac:CONFIG -= app_bundle
+ win32:CONFIG += console
+-unix|mingw: LIBS += -lmng
++CONFIG += link_pkgconfig
++packagesExist(libmng):PKGCONFIG += libmng
++else:if(unix|win32-g++*): LIBS += -lmng
+ else:win32: LIBS += libmng.lib
+diff --git a/src/plugins/imageformats/mng/qmnghandler.pri b/src/plugins/imageformats/mng/qmnghandler.pri
+index 5c0fff1..00cd0b3 100644
+--- a/src/plugins/imageformats/mng/qmnghandler.pri
++++ b/src/plugins/imageformats/mng/qmnghandler.pri
+@@ -3,7 +3,9 @@ INCLUDEPATH *= $$PWD
+ HEADERS += $$PWD/qmnghandler_p.h
+ SOURCES += $$PWD/qmnghandler.cpp
+ config_libmng {
+- unix|mingw: LIBS += -lmng
++ CONFIG += link_pkgconfig
++ packagesExist(libmng):PKGCONFIG += libmng
++ else:if(unix|win32-g++*): LIBS += -lmng
+ else:win32: LIBS += libmng.lib
+ } else {
+ include($$PWD/../../../3rdparty/libmng.pri)
+--
+1.8.4.5
+
diff -r 1cac12604314 -r 44b1a9b2193e src/qtimageformats.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/qtimageformats.mk Thu Sep 29 11:22:51 2016 -0400
@@ -0,0 +1,21 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG := qtimageformats
+$(PKG)_IGNORE :=
+$(PKG)_VERSION = $(qtbase_VERSION)
+$(PKG)_CHECKSUM := 09e93423d69e660951d75b136bbed6d7e441c438
+$(PKG)_SUBDIR = $(subst qtbase,qtimageformats,$(qtbase_SUBDIR))
+$(PKG)_FILE = $(subst qtbase,qtimageformats,$(qtbase_FILE))
+$(PKG)_URL = $(subst qtbase,qtimageformats,$(qtbase_URL))
+$(PKG)_DEPS := jasper libmng qtbase tiff
+
+define $(PKG)_UPDATE
+ echo $(qtbase_VERSION)
+endef
+
+define $(PKG)_BUILD
+ cd '$(1)' && '$(MXE_QMAKE)'
+ $(MAKE) -C '$(1)' -j '$(JOBS)'
+ $(MAKE) -C '$(1)' -j 1 install
+endef
diff -r 1cac12604314 -r 44b1a9b2193e src/qtsvg.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/qtsvg.mk Thu Sep 29 11:22:51 2016 -0400
@@ -0,0 +1,21 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG := qtsvg
+$(PKG)_IGNORE :=
+$(PKG)_VERSION = $(qtbase_VERSION)
+$(PKG)_CHECKSUM := abc54beebba305a13dd8578c2e8524d4eb7a9d02
+$(PKG)_SUBDIR = $(subst qtbase,qtsvg,$(qtbase_SUBDIR))
+$(PKG)_FILE = $(subst qtbase,qtsvg,$(qtbase_FILE))
+$(PKG)_URL = $(subst qtbase,qtsvg,$(qtbase_URL))
+$(PKG)_DEPS := qtbase
+
+define $(PKG)_UPDATE
+ echo $(qtbase_VERSION)
+endef
+
+define $(PKG)_BUILD
+ cd '$(1)' && '$(MXE_QMAKE)'
+ $(MAKE) -C '$(1)' -j '$(JOBS)'
+ $(MAKE) -C '$(1)' -j 1 install
+endef
diff -r 1cac12604314 -r 44b1a9b2193e src/qttools-1.patch
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/qttools-1.patch Thu Sep 29 11:22:51 2016 -0400
@@ -0,0 +1,37 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+From 3dc7b77a86b4d399836472484a5b3448a27f1a1e Mon Sep 17 00:00:00 2001
+From: Mark Brand
+Date: Wed, 21 May 2014 11:31:45 +0200
+Subject: [PATCH] disable windeployqt (MXE specific)
+
+
+diff --git a/src/src.pro b/src/src.pro
+index 722b32e..66ce5bf 100644
+--- a/src/src.pro
++++ b/src/src.pro
+@@ -27,7 +27,7 @@ android {
+
+ qtHaveModule(dbus): SUBDIRS += qdbus
+
+-win32|winrt:SUBDIRS += windeployqt
++#win32|winrt:SUBDIRS += windeployqt
+ winrt:SUBDIRS += winrtrunner
+ qtHaveModule(gui):!android:!ios:!qnx:!wince*:!winrt*:SUBDIRS += qtdiag
+
+--
+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 1cac12604314 -r 44b1a9b2193e src/qttools.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/qttools.mk Thu Sep 29 11:22:51 2016 -0400
@@ -0,0 +1,22 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG := qttools
+$(PKG)_IGNORE :=
+$(PKG)_VERSION = $(qtbase_VERSION)
+$(PKG)_CHECKSUM := 235287cc39426e99e6870e63951f7db9a285ad0c
+$(PKG)_SUBDIR = $(subst qtbase,qttools,$(qtbase_SUBDIR))
+$(PKG)_FILE = $(subst qtbase,qttools,$(qtbase_FILE))
+$(PKG)_URL = $(subst qtbase,qttools,$(qtbase_URL))
+$(PKG)_DEPS := qtbase
+
+define $(PKG)_UPDATE
+ echo $(qtbase_VERSION)
+endef
+
+define $(PKG)_BUILD
+ cd '$(1)' && '$(MXE_QMAKE)'
+ $(MAKE) -C '$(1)' -j '$(JOBS)'
+ $(MAKE) -C '$(1)' -j 1 install
+endef
+