Skip to content

Commit 9a75902

Browse files
committed
Merge #11995: [depends] Fix Qt build with Xcode 9
2b1f794 [Depends] Fix Qt build with Xcode 9.2 (fanquake) Pull request description: Building Qt in depends is currently broken with versions of Xcode > 9.0 (on both 10.12.x and 10.13.x). We'll bump our Clang/Qt/SDK again soon, however this fixes building in the interim. Fixes #11461 Related upstream issues: https://bugreports.qt.io/browse/QTBUG-63401, https://bugreports.qt.io/browse/QTBUG-62266. Tree-SHA512: b1aaa50580c5180bbae2d79f5618c145667edd824b66c20851c7346674a1700267d6df249ba559d781941def312f7867bc3950f673e9128ffd4beda2965ca639
2 parents d59b8d6 + 2b1f794 commit 9a75902

File tree

2 files changed

+72
-1
lines changed

2 files changed

+72
-1
lines changed

depends/packages/qt.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ $(package)_dependencies=openssl zlib
88
$(package)_linux_dependencies=freetype fontconfig libxcb libX11 xproto libXext
99
$(package)_build_subdir=qtbase
1010
$(package)_qt_libs=corelib network widgets gui plugins testlib
11-
$(package)_patches=mac-qmake.conf mingw-uuidof.patch pidlist_absolute.patch fix-xcb-include-order.patch fix_qt_pkgconfig.patch
11+
$(package)_patches=mac-qmake.conf mingw-uuidof.patch pidlist_absolute.patch fix-xcb-include-order.patch fix_qt_pkgconfig.patch fix-cocoahelpers-macos.patch
1212

1313
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
1414
$(package)_qttranslations_sha256_hash=3a15aebd523c6d89fb97b2d3df866c94149653a26d27a00aac9b6d3020bc5a1d
@@ -140,6 +140,7 @@ define $(package)_preprocess_cmds
140140
patch -p1 < $($(package)_patch_dir)/pidlist_absolute.patch && \
141141
patch -p1 < $($(package)_patch_dir)/fix-xcb-include-order.patch && \
142142
patch -p1 < $($(package)_patch_dir)/fix_qt_pkgconfig.patch && \
143+
patch -p1 < $($(package)_patch_dir)/fix-cocoahelpers-macos.patch && \
143144
echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
144145
echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
145146
echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
From 0707260a4f8e64dfadf1df5f935e74cabb7c7d27 Mon Sep 17 00:00:00 2001
2+
From: Jake Petroules <[email protected]>
3+
Date: Sun, 1 Oct 2017 21:48:17 -0700
4+
Subject: [PATCH] Fix build error with macOS 10.13 SDK
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=utf8
7+
Content-Transfer-Encoding: 8bit
8+
9+
Several of these variables/macros are no longer defined. We didn't
10+
validate the preconditions on iOS, tvOS, or watchOS, so no
11+
need to bother validating them on macOS either. Nor did we check the
12+
OSStatus result on any platform anyways.
13+
14+
Task-number: QTBUG-63401
15+
Change-Id: Ife64dff767cf6d3f4b839fc53ec486181c176bf3
16+
(cherry-picked from 861544583511d4e6f7745d2339b26ff1cd44132b)
17+
Reviewed-by: Timur Pocheptsov <[email protected]>
18+
Reviewed-by: Tor Arne Vestbø <[email protected]>
19+
---
20+
src/plugins/platforms/cocoa/qcocoahelpers.h | 2 +-
21+
src/plugins/platforms/cocoa/qcocoahelpers.mm | 13 +------------
22+
2 files changed, 2 insertions(+), 13 deletions(-)
23+
24+
diff --git old/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.h new/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.h
25+
index bbb3793..74371d5 100644
26+
--- old/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.h
27+
+++ new/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.h
28+
@@ -80,7 +80,7 @@ QColor qt_mac_toQColor(CGColorRef color);
29+
// Creates a mutable shape, it's the caller's responsibility to release.
30+
HIMutableShapeRef qt_mac_QRegionToHIMutableShape(const QRegion &region);
31+
32+
-OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage);
33+
+void qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage);
34+
35+
NSDragOperation qt_mac_mapDropAction(Qt::DropAction action);
36+
NSDragOperation qt_mac_mapDropActions(Qt::DropActions actions);
37+
diff --git old/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.mm new/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.mm
38+
index cd73148..3f8429e 100644
39+
--- old/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.mm
40+
+++ new/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.mm
41+
@@ -544,15 +544,8 @@ NSRect qt_mac_flipRect(const QRect &rect)
42+
return NSMakeRect(rect.x(), flippedY, rect.width(), rect.height());
43+
}
44+
45+
-OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage)
46+
+void qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage)
47+
{
48+
- // Verbatim copy if HIViewDrawCGImage (as shown on Carbon-Dev)
49+
- OSStatus err = noErr;
50+
-
51+
- require_action(inContext != NULL, InvalidContext, err = paramErr);
52+
- require_action(inBounds != NULL, InvalidBounds, err = paramErr);
53+
- require_action(inImage != NULL, InvalidImage, err = paramErr);
54+
-
55+
CGContextSaveGState( inContext );
56+
CGContextTranslateCTM (inContext, 0, inBounds->origin.y + CGRectGetMaxY(*inBounds));
57+
CGContextScaleCTM(inContext, 1, -1);
58+
@@ -560,10 +553,6 @@ OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGIm
59+
CGContextDrawImage(inContext, *inBounds, inImage);
60+
61+
CGContextRestoreGState(inContext);
62+
-InvalidImage:
63+
-InvalidBounds:
64+
-InvalidContext:
65+
- return err;
66+
}
67+
68+
Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum)
69+
--
70+
2.7.4

0 commit comments

Comments
 (0)