- New upstream 5.8.0 version - initial boostrap

This commit is contained in:
Helio Chissini de Castro 2017-01-26 17:05:32 +01:00
parent aeca857561
commit cc493ddebb
9 changed files with 72 additions and 455 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@
/qtbase-opensource-src-5.6.1.tar.xz
/qtbase-opensource-src-5.7.0.tar.xz
/qtbase-opensource-src-5.7.1.tar.xz
/qtbase-opensource-src-5.8.0.tar.xz

View File

@ -1,33 +0,0 @@
--- qtbase-opensource-src-5.7.1/src/src.pro.orig 2016-10-05 19:33:26.000000000 +0200
+++ qtbase-opensource-src-5.7.1/src/src.pro 2016-11-09 12:31:35.781935319 +0100
@@ -135,8 +135,10 @@
contains(QT_CONFIG, zlib)|cross_compile {
SUBDIRS += src_qtzlib
contains(QT_CONFIG, zlib) {
- src_3rdparty_libpng.depends += src_corelib
- src_3rdparty_freetype.depends += src_corelib
+ !contains(QT_CONFIG, system-png) {
+ src_3rdparty_libpng.depends += src_corelib
+ src_3rdparty_freetype.depends += src_corelib
+ }
}
}
SUBDIRS += src_tools_bootstrap src_tools_moc src_tools_rcc
@@ -167,10 +169,13 @@
SUBDIRS += src_angle
src_gui.depends += src_angle
}
- contains(QT_CONFIG, png) {
- SUBDIRS += src_3rdparty_libpng
- src_3rdparty_freetype.depends += src_3rdparty_libpng
- src_gui.depends += src_3rdparty_libpng
+
+ !contains(QT_CONFIG, system-png) {
+ contains(QT_CONFIG, png) {
+ SUBDIRS += src_3rdparty_libpng
+ src_3rdparty_freetype.depends += src_3rdparty_libpng
+ src_gui.depends += src_3rdparty_libpng
+ }
}
contains(QT_CONFIG, freetype) {
SUBDIRS += src_3rdparty_freetype

View File

@ -1,38 +0,0 @@
From 84ea00d47049d882f2fabf1446ec6c6eb5fe3038 Mon Sep 17 00:00:00 2001
From: J-P Nurmi <jpnurmi@qt.io>
Date: Tue, 6 Dec 2016 16:30:31 +0100
Subject: [PATCH] QGtk3Dialog: don't crash on Wayland
Check if it's an X11 window before calling XSetTransientForHint().
No transient parent will be set for GTK+ dialogs on Wayland. That
has to be implemented separately.
Task-number: QTBUG-55583
Change-Id: Iabc2a72681c8157bb2f2fe500892853aa397106b
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
---
src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp b/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp
index ba5089a..699b058 100644
--- a/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp
+++ b/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp
@@ -135,10 +135,12 @@ bool QGtk3Dialog::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWind
GdkWindow *gdkWindow = gtk_widget_get_window(gtkWidget);
if (parent) {
- GdkDisplay *gdkDisplay = gdk_window_get_display(gdkWindow);
- XSetTransientForHint(gdk_x11_display_get_xdisplay(gdkDisplay),
- gdk_x11_window_get_xid(gdkWindow),
- parent->winId());
+ if (GDK_IS_X11_WINDOW(gdkWindow)) {
+ GdkDisplay *gdkDisplay = gdk_window_get_display(gdkWindow);
+ XSetTransientForHint(gdk_x11_display_get_xdisplay(gdkDisplay),
+ gdk_x11_window_get_xid(gdkWindow),
+ parent->winId());
+ }
}
if (modality != Qt::NonModal) {

View File

@ -22,7 +22,7 @@
%global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
# set to 1 to enable bootstrap
%global bootstrap 0
%global bootstrap 1
%if 0%{?fedora} > 25 || 0%{?rhel} > 7
# set to 1 for openssl-1.1.x support
@ -65,13 +65,13 @@ BuildRequires: pkgconfig(libsystemd)
Name: qt5-qtbase
Summary: Qt5 - QtBase components
Version: 5.7.1
Release: 13%{?dist}
Version: 5.8.0
Release: 1%{?dist}
# See LGPL_EXCEPTIONS.txt, for exception details
License: LGPLv2 with exceptions or GPLv3 with exceptions
Url: http://qt-project.org/
Source0: http://download.qt.io/official_releases/qt/5.7/%{version}/submodules/%{qt_module}-opensource-src-%{version}.tar.xz
Source0: http://download.qt.io/official_releases/qt/5.8/%{version}/submodules/%{qt_module}-opensource-src-%{version}.tar.xz
# https://bugzilla.redhat.com/show_bug.cgi?id=1227295
Source1: qtlogging.ini
@ -95,7 +95,7 @@ Patch4: qtbase-opensource-src-5.3.2-QTBUG-35459.patch
# upstreamable patches
# namespace QT_VERSION_CHECK to workaround major/minor being pre-defined (#1396755)
Patch50: qtbase-opensource-src-5.7.1-QT_VERSION_CHECK.patch
Patch50: qtbase-opensource-src-5.8.0-QT_VERSION_CHECK.patch
# 1381828 - Broken window scaling for some QT5 applications (#1381828)
# This patch moves the threshold for 2x scaling from the DPI of 144 to 192,
@ -108,31 +108,15 @@ Patch51: qtbase-hidpi_scale_at_192.patch
# 2. Workaround sysmacros.h (pre)defining major/minor a breaking stuff
Patch52: qtbase-opensource-src-5.7.1-moc_macros.patch
# arm patch
Patch54: qtbase-opensource-src-5.6.0-arm.patch
# recently passed code review, now integrated into 5.8 branch
# https://codereview.qt-project.org/126102/
Patch60: qtbase-opensource-src-5.7.1-moc_system_defines.patch
# drop -O3 and make -O2 by default
Patch61: qt5-qtbase-cxxflag.patch
# Fix png system compilation
Patch62: qt5-qtbase-5.7.1-libpng.patch
# adapted from berolinux for fedora
# https://github.com/patch-exchange/openssl-1.1-transition/blob/master/qt5-qtbase/qtbase-5.7.0-openssl-1.1.patch
Patch63: qt5-qtbase-5.7.1-openssl11.patch
# support firebird version 3.x
Patch64: qt5-qtbase-5.7.1-firebird.patch
## upstream patches
# 5.8 branch
# https://bugzilla.redhat.com/show_bug.cgi?id=1403500
# https://bugreports.qt.io/browse/QTBUG-55583
Patch100: qt5-qtbase-5.8-QTBUG-55583.patch
Patch64: qt5-qtbase-5.8.0-firebird.patch
# Do not check any files in %%{_qt5_plugindir}/platformthemes/ for requires.
# Those themes are there for platform integration. If the required libraries are
@ -216,7 +200,7 @@ BuildRequires: libicu-devel
BuildRequires: pkgconfig(xcb) pkgconfig(xcb-glx) pkgconfig(xcb-icccm) pkgconfig(xcb-image) pkgconfig(xcb-keysyms) pkgconfig(xcb-renderutil)
BuildRequires: pkgconfig(zlib)
BuildRequires: perl-generators
BuildRequires: qt5-rpm-macros >= %{version}
BuildRequires: qt5-rpm-macros >= 5.7.1
%if 0%{?tests}
BuildRequires: dbus-x11
@ -265,7 +249,7 @@ Requires: %{name}-gui%{?_isa}
Requires: pkgconfig(egl)
%endif
Requires: pkgconfig(gl)
Requires: qt5-rpm-macros >= %{version}
Requires: qt5-rpm-macros >= 5.7.1
%if 0%{?use_clang}
Requires: clang >= 3.7.0
%endif
@ -365,15 +349,11 @@ Qt5 libraries used for drawing widgets and OpenGL items.
%setup -q -n %{qt_module}-opensource-src-%{version}
%patch4 -p1 -b .QTBUG-35459
%patch100 -p1 -b .QTBUG-55583
%patch50 -p1 -b .QT_VERSION_CHECK
%patch51 -p1 -b .hidpi_scale_at_192
%patch52 -p1 -b .moc_macros
%patch54 -p1 -b .arm
%patch60 -p1 -b .moc_system_defines
%patch61 -p1 -b .qt5-qtbase-cxxflag
%patch62 -p1 -b .libpng
%if 0%{?openssl11}
%patch63 -p1 -b .openssl11
%endif
@ -446,7 +426,8 @@ export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -DOPENSSL_API_COMPAT=0x10100000L"
export CXXFLAGS="$CXXFLAGS $RPM_OPT_FLAGS -DOPENSSL_API_COMPAT=0x10100000L"
%endif
./configure -v \
./configure \
-verbose \
-confirm-license \
-opensource \
-prefix %{_qt5_prefix} \
@ -471,18 +452,15 @@ export CXXFLAGS="$CXXFLAGS $RPM_OPT_FLAGS -DOPENSSL_API_COMPAT=0x10100000L"
-glib \
-gtk \
%{?ibase} \
-iconv \
-icu \
%{?journald} \
%{?openssl} \
-optimized-qmake \
%{!?examples:-nomake examples} \
%{!?tests:-nomake tests} \
-no-pch \
-no-rpath \
-no-separate-debug-info \
%ifarch %{ix86}
-no-sse2 \
-no-sse2 -no-pch \
%endif
-no-strip \
-system-libjpeg \
@ -693,6 +671,7 @@ fi
%{_qt5_libdir}/libQt5Sql.so.5*
%{_qt5_libdir}/libQt5Test.so.5*
%{_qt5_libdir}/libQt5Xml.so.5*
%{_qt5_libdir}/libQt5EglFSDeviceIntegration.so.5*
%dir %{_qt5_libdir}/cmake/
%dir %{_qt5_libdir}/cmake/Qt5/
%dir %{_qt5_libdir}/cmake/Qt5Concurrent/
@ -803,6 +782,8 @@ fi
%{_qt5_headerdir}/QtTest/
%{_qt5_headerdir}/QtWidgets/
%{_qt5_headerdir}/QtXml/
%{_qt5_headerdir}/QtEglFSDeviceIntegration
%{_qt5_headerdir}/QtInputSupport
%{_qt5_archdatadir}/mkspecs/
%{_qt5_libdir}/libQt5Concurrent.prl
%{_qt5_libdir}/libQt5Concurrent.so
@ -828,6 +809,8 @@ fi
%{_qt5_libdir}/libQt5XcbQpa.so
%{_qt5_libdir}/libQt5Xml.prl
%{_qt5_libdir}/libQt5Xml.so
%{_qt5_libdir}/libQt5EglFSDeviceIntegration.prl
%{_qt5_libdir}/libQt5EglFSDeviceIntegration.so
%{_qt5_libdir}/cmake/Qt5/Qt5Config*.cmake
%{_qt5_libdir}/cmake/Qt5Concurrent/Qt5ConcurrentConfig*.cmake
%{_qt5_libdir}/cmake/Qt5Core/Qt5CoreConfig*.cmake
@ -844,6 +827,7 @@ fi
%{_qt5_libdir}/cmake/Qt5Widgets/Qt5WidgetsConfig*.cmake
%{_qt5_libdir}/cmake/Qt5Widgets/Qt5WidgetsMacros.cmake
%{_qt5_libdir}/cmake/Qt5Xml/Qt5XmlConfig*.cmake
%{_qt5_libdir}/cmake/Qt5/Qt5ModuleLocation.cmake
%{_qt5_libdir}/pkgconfig/Qt5.pc
%{_qt5_libdir}/pkgconfig/Qt5Concurrent.pc
%{_qt5_libdir}/pkgconfig/Qt5Core.pc
@ -857,8 +841,9 @@ fi
%{_qt5_libdir}/pkgconfig/Qt5Widgets.pc
%{_qt5_libdir}/pkgconfig/Qt5Xml.pc
%if 0%{?egl}
%{_qt5_libdir}/libQt5EglDeviceIntegration.prl
%{_qt5_libdir}/libQt5EglDeviceIntegration.so
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QEglFSKmsEglDeviceIntegrationPlugin.cmake
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QVncIntegrationPlugin.cmake
%{_qt5_libdir}/libQt5EglFsKmsSupport.prl
%{_qt5_libdir}/libQt5EglFsKmsSupport.so
%endif
@ -872,9 +857,41 @@ fi
%{_qt5_libdir}/libQt5OpenGLExtensions.prl
%{_qt5_libdir}/cmake/Qt5OpenGLExtensions/
%{_qt5_libdir}/pkgconfig/Qt5OpenGLExtensions.pc
%{_qt5_headerdir}/QtPlatformSupport/
%{_qt5_libdir}/libQt5PlatformSupport.*a
%{_qt5_libdir}/libQt5PlatformSupport.prl
%{_qt5_libdir}/libQt5AccessibilitySupport.*a
%{_qt5_libdir}/libQt5AccessibilitySupport.prl
%{_qt5_headerdir}/QtAccessibilitySupport
%{_qt5_libdir}/libQt5DeviceDiscoverySupport.*a
%{_qt5_libdir}/libQt5DeviceDiscoverySupport.prl
%{_qt5_headerdir}/QtDeviceDiscoverySupport
%{_qt5_libdir}/libQt5EglSupport.*a
%{_qt5_libdir}/libQt5EglSupport.prl
%{_qt5_headerdir}/QtEglSupport
%{_qt5_libdir}/libQt5EventDispatcherSupport.*a
%{_qt5_libdir}/libQt5EventDispatcherSupport.prl
%{_qt5_headerdir}/QtEventDispatcherSupport
%{_qt5_libdir}/libQt5FbSupport.*a
%{_qt5_libdir}/libQt5FbSupport.prl
%{_qt5_headerdir}/QtFbSupport
%{_qt5_libdir}/libQt5FontDatabaseSupport.*a
%{_qt5_libdir}/libQt5FontDatabaseSupport.prl
%{_qt5_headerdir}/QtFontDatabaseSupport
%{_qt5_libdir}/libQt5GlxSupport.*a
%{_qt5_libdir}/libQt5GlxSupport.prl
%{_qt5_headerdir}/QtGlxSupport
%{_qt5_libdir}/libQt5InputSupport.*a
%{_qt5_libdir}/libQt5InputSupport.prl
%{_qt5_libdir}/libQt5LinuxAccessibilitySupport.*a
%{_qt5_libdir}/libQt5LinuxAccessibilitySupport.prl
%{_qt5_headerdir}/QtLinuxAccessibilitySupport
%{_qt5_libdir}/libQt5PlatformCompositorSupport.*a
%{_qt5_libdir}/libQt5PlatformCompositorSupport.prl
%{_qt5_headerdir}/QtPlatformCompositorSupport
%{_qt5_libdir}/libQt5ServiceSupport.*a
%{_qt5_libdir}/libQt5ServiceSupport.prl
%{_qt5_headerdir}/QtServiceSupport
%{_qt5_libdir}/libQt5ThemeSupport.*a
%{_qt5_libdir}/libQt5ThemeSupport.prl
%{_qt5_headerdir}/QtThemeSupport
%if 0%{?examples}
%files examples
@ -945,7 +962,6 @@ fi
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QComposePlatformInputContextPlugin.cmake
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QIbusPlatformInputContextPlugin.cmake
%if 0%{?egl}
%{_qt5_libdir}/libQt5EglDeviceIntegration.so.5*
%{_qt5_libdir}/libQt5EglFsKmsSupport.so.5*
%{_qt5_plugindir}/platforms/libqeglfs.so
%{_qt5_plugindir}/platforms/libqminimalegl.so
@ -959,12 +975,12 @@ fi
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QEglFSX11IntegrationPlugin.cmake
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QEglFSKmsGbmIntegrationPlugin.cmake
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QXcbEglIntegrationPlugin.cmake
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QEglFSKmsEglDeviceIntegrationPlugin.cmake
%endif
%{_qt5_plugindir}/platforms/libqlinuxfb.so
%{_qt5_plugindir}/platforms/libqminimal.so
%{_qt5_plugindir}/platforms/libqoffscreen.so
%{_qt5_plugindir}/platforms/libqxcb.so
%{_qt5_plugindir}/platforms/libqvnc.so
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QLinuxFbIntegrationPlugin.cmake
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QMinimalIntegrationPlugin.cmake
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QOffscreenIntegrationPlugin.cmake
@ -978,6 +994,9 @@ fi
%changelog
* Thu Jan 26 2017 Helio Chissini de Castro <helio@kde.org> - 5.8.0-1
- Initial update for 5.8.0
* Tue Jan 24 2017 Rex Dieter <rdieter@fedoraproject.org> - 5.7.1-13
- Broken window scaling (#1381828)

View File

@ -1,12 +0,0 @@
diff -up qtbase-opensource-src-5.7.1/src/corelib/global/qglobal.h.QT_VERSION_CHECK qtbase-opensource-src-5.7.1/src/corelib/global/qglobal.h
--- qtbase-opensource-src-5.7.1/src/corelib/global/qglobal.h.QT_VERSION_CHECK 2016-12-01 02:17:04.000000000 -0600
+++ qtbase-opensource-src-5.7.1/src/corelib/global/qglobal.h 2016-12-08 12:19:41.165310158 -0600
@@ -54,7 +54,7 @@
/*
can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
*/
-#define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
+#define QT_VERSION_CHECK(qt_version_check_major, qt_version_check_minor, qt_version_check_patch) ((qt_version_check_major<<16)|(qt_version_check_minor<<8)|(qt_version_check_patch))
#if !defined(QT_BUILD_QMAKE) && !defined(QT_BUILD_CONFIGURE)
#include <QtCore/qconfig.h>

View File

@ -1,331 +0,0 @@
diff -up qtbase-opensource-src-5.7.1/mkspecs/features/moc.prf.moc_system_defines qtbase-opensource-src-5.7.1/mkspecs/features/moc.prf
--- qtbase-opensource-src-5.7.1/mkspecs/features/moc.prf.moc_system_defines 2016-12-01 02:17:04.000000000 -0600
+++ qtbase-opensource-src-5.7.1/mkspecs/features/moc.prf 2016-12-09 10:24:12.463205987 -0600
@@ -24,8 +24,25 @@ win32:count(MOC_INCLUDEPATH, 40, >) {
write_file($$absolute_path($$WIN_INCLUDETEMP, $$OUT_PWD), WIN_INCLUDETEMP_CONT)|error("Aborting.")
}
+# QNX's compiler sets "gcc" config, but does not support the -dM option;
+# iOS builds are multi-arch, so this feature cannot possibly work.
+if(gcc|intel_icl|msvc):!rim_qcc:!ios {
+ moc_predefs.CONFIG = no_link
+ gcc: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -dM -E -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
+ else:intel_icl: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -QdM -P -Fi${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
+ else:msvc {
+ # make sure that our bin dir is first in path, so qmake is found
+ moc_predefs.commands = PATH $$shell_path($$[QT_INSTALL_BINS/src]);%PATH%&
+ moc_predefs.commands += $$QMAKE_CXX -Bxqmake $$QMAKE_CXXFLAGS -E ${QMAKE_FILE_IN} 2>NUL >${QMAKE_FILE_OUT}
+ } else: error("Oops, I messed up")
+ moc_predefs.output = $$MOC_DIR/moc_predefs.h
+ moc_predefs.input = MOC_PREDEF_FILE
+ silent: moc_predefs.commands = @echo generating $$moc_predefs.output$$escape_expand(\n\t)@$$moc_predefs.commands
+ QMAKE_EXTRA_COMPILERS += moc_predefs
+ MOC_PREDEF_FILE = $$[QT_HOST_DATA/src]/mkspecs/features/data/dummy.cpp
+}
+
defineReplace(mocCmdBase) {
- RET =
!isEmpty(WIN_INCLUDETEMP) {
incvar = @$$WIN_INCLUDETEMP
} else {
@@ -34,7 +51,13 @@ defineReplace(mocCmdBase) {
incvar += -I$$shell_quote($$inc)
incvar += $$QMAKE_FRAMEWORKPATH_FLAGS
}
- RET += $$QMAKE_MOC $(DEFINES) $$join(QMAKE_COMPILER_DEFINES, " -D", -D) $$incvar $$QMAKE_MOC_OPTIONS
+
+ RET = $$QMAKE_MOC $(DEFINES)
+
+ isEmpty(MOC_PREDEF_FILE): RET += $$join(QMAKE_COMPILER_DEFINES, " -D", -D)
+ else: RET += --include $$moc_predefs.output
+
+ RET += $$incvar $$QMAKE_MOC_OPTIONS
return($$RET)
}
@@ -46,7 +69,7 @@ moc_header.output = $$MOC_DIR/$${QMAKE_H
moc_header.input = HEADERS
moc_header.variable_out = SOURCES
moc_header.name = MOC ${QMAKE_FILE_IN}
-moc_header.depends += $$WIN_INCLUDETEMP
+moc_header.depends += $$WIN_INCLUDETEMP $$moc_predefs.output
silent:moc_header.commands = @echo moc ${QMAKE_FILE_IN} && $$moc_header.commands
QMAKE_EXTRA_COMPILERS += moc_header
INCREDIBUILD_XGE += moc_header
@@ -58,7 +81,7 @@ moc_source.commands = ${QMAKE_FUNC_mocCm
moc_source.output = $$MOC_DIR/$${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_EXT_CPP_MOC}
moc_source.input = SOURCES OBJECTIVE_SOURCES
moc_source.name = MOC ${QMAKE_FILE_IN}
-moc_source.depends += $$WIN_INCLUDETEMP
+moc_source.depends += $$WIN_INCLUDETEMP $$moc_predefs.output
silent:moc_source.commands = @echo moc ${QMAKE_FILE_IN} && $$moc_source.commands
QMAKE_EXTRA_COMPILERS += moc_source
INCREDIBUILD_XGE += moc_source
diff -up qtbase-opensource-src-5.7.1/qmake/main.cpp.moc_system_defines qtbase-opensource-src-5.7.1/qmake/main.cpp
--- qtbase-opensource-src-5.7.1/qmake/main.cpp.moc_system_defines 2016-12-01 02:17:04.000000000 -0600
+++ qtbase-opensource-src-5.7.1/qmake/main.cpp 2016-12-09 10:24:12.463205987 -0600
@@ -42,6 +42,10 @@
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef Q_OS_WIN
+# include <qt_windows.h>
+#endif
+
QT_BEGIN_NAMESPACE
#ifdef Q_OS_WIN
@@ -241,6 +245,30 @@ static int doInstall(int argc, char **ar
return 3;
}
+static int dumpMacros(const wchar_t *cmdline)
+{
+ // from http://stackoverflow.com/questions/3665537/how-to-find-out-cl-exes-built-in-macros
+ int argc;
+ wchar_t **argv = CommandLineToArgvW(cmdline, &argc);
+ if (!argv)
+ return 2;
+ for (int i = 0; i < argc; ++i) {
+ if (argv[i][0] != L'-' || argv[i][1] != 'D')
+ continue;
+
+ wchar_t *value = wcschr(argv[i], L'=');
+ if (value) {
+ *value = 0;
+ ++value;
+ } else {
+ // point to the NUL at the end, so we don't print anything
+ value = argv[i] + wcslen(argv[i]);
+ }
+ wprintf(L"#define %Ls %Ls\n", argv[i] + 2, value);
+ }
+ return 0;
+}
+
#endif // Q_OS_WIN
/* This is to work around lame implementation on Darwin. It has been noted that the getpwd(3) function
@@ -275,6 +303,15 @@ int runQMake(int argc, char **argv)
// Workaround for inferior/missing command line tools on Windows: make our own!
if (argc >= 2 && !strcmp(argv[1], "-install"))
return doInstall(argc - 2, argv + 2);
+
+ {
+ // Support running as Visual C++'s compiler
+ const wchar_t *cmdline = _wgetenv(L"MSC_CMD_FLAGS");
+ if (!cmdline || !*cmdline)
+ cmdline = _wgetenv(L"MSC_IDE_FLAGS");
+ if (cmdline && *cmdline)
+ return dumpMacros(cmdline);
+ }
#endif
QMakeVfs vfs;
diff -up qtbase-opensource-src-5.7.1/src/tools/moc/main.cpp.moc_system_defines qtbase-opensource-src-5.7.1/src/tools/moc/main.cpp
--- qtbase-opensource-src-5.7.1/src/tools/moc/main.cpp.moc_system_defines 2016-12-09 10:24:12.458205887 -0600
+++ qtbase-opensource-src-5.7.1/src/tools/moc/main.cpp 2016-12-09 10:53:10.285347282 -0600
@@ -259,6 +259,11 @@ int runMoc(int argc, char **argv)
prependIncludeOption.setValueName(QStringLiteral("file"));
parser.addOption(prependIncludeOption);
+ QCommandLineOption includeOption(QStringLiteral("include"));
+ includeOption.setDescription(QStringLiteral("Parse <file> as an #include before the main source(s)."));
+ includeOption.setValueName(QStringLiteral("file"));
+ parser.addOption(includeOption);
+
QCommandLineOption noNotesWarningsCompatOption(QStringLiteral("n"));
noNotesWarningsCompatOption.setDescription(QStringLiteral("Do not display notes (-nn) or warnings (-nw). Compatibility option."));
noNotesWarningsCompatOption.setValueName(QStringLiteral("which"));
@@ -415,7 +420,31 @@ int runMoc(int argc, char **argv)
moc.includes = pp.includes;
// 1. preprocess
- moc.symbols = pp.preprocessed(moc.filename, &in);
+ const auto includeFiles = parser.values(includeOption);
+ for (const QString &includeName : includeFiles) {
+ QByteArray rawName = pp.resolveInclude(QFile::encodeName(includeName), moc.filename);
+ if (rawName.isEmpty()) {
+ fprintf(stderr, "Warning: Failed to resolve include \"%s\" for moc file %s\n",
+ includeName.toLocal8Bit().constData(),
+ moc.filename.isEmpty() ? "<standard input>" : moc.filename.constData());
+ } else {
+ QFile f(QFile::decodeName(rawName));
+ if (f.open(QIODevice::ReadOnly)) {
+ moc.symbols += Symbol(0, MOC_INCLUDE_BEGIN, rawName);
+ moc.symbols += pp.preprocessed(rawName, &f);
+ moc.symbols += Symbol(0, MOC_INCLUDE_END, rawName);
+ } else {
+ fprintf(stderr, "Warning: Cannot open %s included by moc file %s: %s\n",
+ rawName.constData(),
+ moc.filename.isEmpty() ? "<standard input>" : moc.filename.constData(),
+ f.errorString().toLocal8Bit().constData());
+ }
+ }
+ }
+ moc.symbols += pp.preprocessed(moc.filename, &in);
+
+ // We obviously do not support MS extensions
+ pp.macros.remove("_MSC_EXTENSIONS");
if (!pp.preprocessOnly) {
// 2. parse
diff -up qtbase-opensource-src-5.7.1/src/tools/moc/preprocessor.cpp.moc_system_defines qtbase-opensource-src-5.7.1/src/tools/moc/preprocessor.cpp
--- qtbase-opensource-src-5.7.1/src/tools/moc/preprocessor.cpp.moc_system_defines 2016-12-01 02:17:04.000000000 -0600
+++ qtbase-opensource-src-5.7.1/src/tools/moc/preprocessor.cpp 2016-12-09 10:24:12.464206007 -0600
@@ -1008,6 +1008,37 @@ static void mergeStringLiterals(Symbols
}
}
+QByteArray Preprocessor::resolveInclude(const QByteArray &include, const QByteArray &relativeTo)
+{
+ // #### stringery
+ QFileInfo fi;
+ if (!relativeTo.isEmpty())
+ fi.setFile(QFileInfo(QString::fromLocal8Bit(relativeTo.constData())).dir(), QString::fromLocal8Bit(include.constData()));
+ for (int j = 0; j < Preprocessor::includes.size() && !fi.exists(); ++j) {
+ const IncludePath &p = Preprocessor::includes.at(j);
+ if (p.isFrameworkPath) {
+ const int slashPos = include.indexOf('/');
+ if (slashPos == -1)
+ continue;
+ QByteArray frameworkCandidate = include.left(slashPos);
+ frameworkCandidate.append(".framework/Headers/");
+ fi.setFile(QString::fromLocal8Bit(QByteArray(p.path + '/' + frameworkCandidate).constData()), QString::fromLocal8Bit(include.mid(slashPos + 1).constData()));
+ } else {
+ fi.setFile(QString::fromLocal8Bit(p.path.constData()), QString::fromLocal8Bit(include.constData()));
+ }
+ // try again, maybe there's a file later in the include paths with the same name
+ // (186067)
+ if (fi.isDir()) {
+ fi = QFileInfo();
+ continue;
+ }
+ }
+
+ if (!fi.exists() || fi.isDir())
+ return QByteArray();
+ return fi.canonicalFilePath().toLocal8Bit();
+}
+
void Preprocessor::preprocess(const QByteArray &filename, Symbols &preprocessed)
{
currentFilenames.push(filename);
@@ -1028,32 +1059,9 @@ void Preprocessor::preprocess(const QByt
continue;
until(PP_NEWLINE);
- // #### stringery
- QFileInfo fi;
- if (local)
- fi.setFile(QFileInfo(QString::fromLocal8Bit(filename.constData())).dir(), QString::fromLocal8Bit(include.constData()));
- for (int j = 0; j < Preprocessor::includes.size() && !fi.exists(); ++j) {
- const IncludePath &p = Preprocessor::includes.at(j);
- if (p.isFrameworkPath) {
- const int slashPos = include.indexOf('/');
- if (slashPos == -1)
- continue;
- fi.setFile(QString::fromLocal8Bit(p.path + '/' + include.left(slashPos) + ".framework/Headers/"),
- QString::fromLocal8Bit(include.mid(slashPos + 1).constData()));
- } else {
- fi.setFile(QString::fromLocal8Bit(p.path.constData()), QString::fromLocal8Bit(include.constData()));
- }
- // try again, maybe there's a file later in the include paths with the same name
- // (186067)
- if (fi.isDir()) {
- fi = QFileInfo();
- continue;
- }
- }
-
- if (!fi.exists() || fi.isDir())
+ include = resolveInclude(include, local ? filename : QByteArray());
+ if (include.isNull())
continue;
- include = fi.canonicalFilePath().toLocal8Bit();
if (Preprocessor::preprocessedIncludes.contains(include))
continue;
@@ -1208,6 +1216,7 @@ Symbols Preprocessor::preprocessed(const
input = cleaned(input);
// phase 2: tokenize for the preprocessor
+ index = 0;
symbols = tokenize(input);
#if 0
diff -up qtbase-opensource-src-5.7.1/src/tools/moc/preprocessor.h.moc_system_defines qtbase-opensource-src-5.7.1/src/tools/moc/preprocessor.h
--- qtbase-opensource-src-5.7.1/src/tools/moc/preprocessor.h.moc_system_defines 2016-12-01 02:17:04.000000000 -0600
+++ qtbase-opensource-src-5.7.1/src/tools/moc/preprocessor.h 2016-12-09 10:24:12.464206007 -0600
@@ -62,6 +62,7 @@ public:
QList<QByteArray> frameworks;
QSet<QByteArray> preprocessedIncludes;
Macros macros;
+ QByteArray resolveInclude(const QByteArray &filename, const QByteArray &relativeTo);
Symbols preprocessed(const QByteArray &filename, QFile *device);
void parseDefineArguments(Macro *m);
diff -up qtbase-opensource-src-5.7.1/tests/auto/tools/moc/subdir/extradefines.h.moc_system_defines qtbase-opensource-src-5.7.1/tests/auto/tools/moc/subdir/extradefines.h
--- qtbase-opensource-src-5.7.1/tests/auto/tools/moc/subdir/extradefines.h.moc_system_defines 2016-12-09 10:24:12.464206007 -0600
+++ qtbase-opensource-src-5.7.1/tests/auto/tools/moc/subdir/extradefines.h 2016-12-09 10:24:12.464206007 -0600
@@ -0,0 +1 @@
+#define FOO 1
diff -up qtbase-opensource-src-5.7.1/tests/auto/tools/moc/tst_moc.cpp.moc_system_defines qtbase-opensource-src-5.7.1/tests/auto/tools/moc/tst_moc.cpp
--- qtbase-opensource-src-5.7.1/tests/auto/tools/moc/tst_moc.cpp.moc_system_defines 2016-12-01 02:17:04.000000000 -0600
+++ qtbase-opensource-src-5.7.1/tests/auto/tools/moc/tst_moc.cpp 2016-12-09 10:24:12.465206027 -0600
@@ -576,6 +576,8 @@ private slots:
void frameworkSearchPath();
void cstyleEnums();
void defineMacroViaCmdline();
+ void defineMacroViaForcedInclude();
+ void defineMacroViaForcedIncludeRelative();
void specifyMetaTagsFromCmdline();
void invokable();
void singleFunctionKeywordSignalAndSlot();
@@ -1244,6 +1246,46 @@ void tst_Moc::defineMacroViaCmdline()
args << m_sourceDirectory + QStringLiteral("/macro-on-cmdline.h");
proc.start(m_moc, args);
+ QVERIFY(proc.waitForFinished());
+ QCOMPARE(proc.exitCode(), 0);
+ QCOMPARE(proc.readAllStandardError(), QByteArray());
+ QByteArray mocOut = proc.readAllStandardOutput();
+ QVERIFY(!mocOut.isEmpty());
+#else
+ QSKIP("Only tested on linux/gcc");
+#endif
+}
+
+void tst_Moc::defineMacroViaForcedInclude()
+{
+#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
+ QProcess proc;
+
+ QStringList args;
+ args << "--include" << m_sourceDirectory + QLatin1String("/subdir/extradefines.h");
+ args << m_sourceDirectory + QStringLiteral("/macro-on-cmdline.h");
+
+ proc.start(m_moc, args);
+ QVERIFY(proc.waitForFinished());
+ QCOMPARE(proc.exitCode(), 0);
+ QCOMPARE(proc.readAllStandardError(), QByteArray());
+ QByteArray mocOut = proc.readAllStandardOutput();
+ QVERIFY(!mocOut.isEmpty());
+#else
+ QSKIP("Only tested on linux/gcc");
+#endif
+}
+
+void tst_Moc::defineMacroViaForcedIncludeRelative()
+{
+#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
+ QProcess proc;
+
+ QStringList args;
+ args << "--include" << QStringLiteral("extradefines.h") << "-I" + m_sourceDirectory + "/subdir";
+ args << m_sourceDirectory + QStringLiteral("/macro-on-cmdline.h");
+
+ proc.start(m_moc, args);
QVERIFY(proc.waitForFinished());
QCOMPARE(proc.exitCode(), 0);
QCOMPARE(proc.readAllStandardError(), QByteArray());

View File

@ -0,0 +1,11 @@
--- qtbase-opensource-src-5.8.0/src/corelib/global/qglobal.h.orig 2017-01-26 10:45:40.905010896 +0100
+++ qtbase-opensource-src-5.8.0/src/corelib/global/qglobal.h 2017-01-26 10:46:50.299858887 +0100
@@ -55,7 +55,7 @@
/*
can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
*/
-#define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
+#define QT_VERSION_CHECK(qt_version_check_major, qt_version_check_minor, qt_version_check_patch) ((qt_version_check_major<<16)|(qt_version_check_minor<<8)|(qt_version_check_patch))
#ifdef QT_BOOTSTRAPPED
#include <QtCore/qconfig-bootstrapped.h>

View File

@ -1 +1 @@
f0809befe04160fbb73bbf38a06a2073 qtbase-opensource-src-5.7.1.tar.xz
SHA512 (qtbase-opensource-src-5.8.0.tar.xz) = 36a1ba4b0dba02ae65c3b2b0aa3fb3767cbee4dbdf204c9ded7d1700e70144ce85a3a66167f86cc716a1fdd38d832962b2a752e803b0647d03032b2685da5ced