diff --git a/data/macos/build-deps.sh b/data/macos/build-deps.sh index fc738b38e..f638e854a 100755 --- a/data/macos/build-deps.sh +++ b/data/macos/build-deps.sh @@ -405,7 +405,7 @@ if [ ! -f qtbase-opensource-src-${QT5_VERSION}/build-done ]; then -no-directfb -no-eglfs -no-kms -no-linuxfb -no-mtdev -no-xcb -no-xcb-xlib \ -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-mips_dsp -no-mips_dspr2 \ -no-cups -no-dbus -no-evdev -no-fontconfig -no-harfbuzz -no-gif -no-glib -no-nis -no-openssl -no-pch -no-sql-ibase -no-sql-odbc \ - -no-audio-backend -no-qml-debug -no-separate-debug-info \ + -no-audio-backend -no-qml-debug -no-separate-debug-info -no-use-gold-linker \ -no-compile-examples -nomake examples -nomake tests -make libs -make tools touch configured fi diff --git a/data/macos/build.sh b/data/macos/build.sh index adbddae30..e3cd888b3 100755 --- a/data/macos/build.sh +++ b/data/macos/build.sh @@ -18,7 +18,10 @@ fi source data/macos/common.env export MACOS="true" -export MACOS_OLD="true" + +if [ $(clang -v 2>&1 | sed -n 's/.*version \([0-9]\).*/\1/p') -lt 9 ]; then + export MACOS_OLD="true" +fi export CC=clang export CXX=clang++ diff --git a/data/macos/env.sh b/data/macos/env.sh index 1e4ffd026..07b7f3c48 100644 --- a/data/macos/env.sh +++ b/data/macos/env.sh @@ -5,13 +5,14 @@ source data/macos/common.env -export MACOS="true" -export MACOS_OLD="true" export CC=clang export CXX=clang++ export MACOS="true" -export MACOS_OLD="true" + +if [ $(clang -v 2>&1 | sed -n 's/.*version \([0-9]\).*/\1/p') -lt 9 ]; then + export MACOS_OLD="true" +fi export CC=clang export CXX=clang++ diff --git a/data/macos/patches/qt55-newosx-fix.patch b/data/macos/patches/qt55-newosx-fix.patch new file mode 100644 index 000000000..8c2a56d87 --- /dev/null +++ b/data/macos/patches/qt55-newosx-fix.patch @@ -0,0 +1,71 @@ +From 0707260a4f8e64dfadf1df5f935e74cabb7c7d27 Mon Sep 17 00:00:00 2001 +From: Jake Petroules +Date: Sun, 1 Oct 2017 21:48:17 -0700 +Subject: [PATCH] Fix build error with macOS 10.13 SDK +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf8 +Content-Transfer-Encoding: 8bit + +Several of these variables/macros are no longer defined. We didn't +validate the preconditions on iOS, tvOS, or watchOS, so no +need to bother validating them on macOS either. Nor did we check the +OSStatus result on any platform anyways. + +Task-number: QTBUG-63401 +Change-Id: Ife64dff767cf6d3f4b839fc53ec486181c176bf3 +(cherry-picked from 861544583511d4e6f7745d2339b26ff1cd44132b) +Reviewed-by: Timur Pocheptsov +Reviewed-by: Tor Arne Vestbø +--- + src/plugins/platforms/cocoa/qcocoahelpers.h | 2 +- + src/plugins/platforms/cocoa/qcocoahelpers.mm | 13 +------------ + 2 files changed, 2 insertions(+), 13 deletions(-) + +diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.h b/src/plugins/platforms/cocoa/qcocoahelpers.h +index bbb3793..74371d5 100644 +--- a/src/plugins/platforms/cocoa/qcocoahelpers.h ++++ b/src/plugins/platforms/cocoa/qcocoahelpers.h +@@ -80,7 +80,7 @@ QColor qt_mac_toQColor(CGColorRef color); + // Creates a mutable shape, it's the caller's responsibility to release. + HIMutableShapeRef qt_mac_QRegionToHIMutableShape(const QRegion ®ion); + +-OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage); ++void qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage); + + NSDragOperation qt_mac_mapDropAction(Qt::DropAction action); + NSDragOperation qt_mac_mapDropActions(Qt::DropActions actions); +diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm +index cd73148..3f8429e 100644 +--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm ++++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm +@@ -544,15 +544,8 @@ NSRect qt_mac_flipRect(const QRect &rect) + return NSMakeRect(rect.x(), flippedY, rect.width(), rect.height()); + } + +-OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage) ++void qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage) + { +- // Verbatim copy if HIViewDrawCGImage (as shown on Carbon-Dev) +- OSStatus err = noErr; +- +- require_action(inContext != NULL, InvalidContext, err = paramErr); +- require_action(inBounds != NULL, InvalidBounds, err = paramErr); +- require_action(inImage != NULL, InvalidImage, err = paramErr); +- + CGContextSaveGState( inContext ); + CGContextTranslateCTM (inContext, 0, inBounds->origin.y + CGRectGetMaxY(*inBounds)); + CGContextScaleCTM(inContext, 1, -1); +@@ -560,10 +553,6 @@ OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGIm + CGContextDrawImage(inContext, *inBounds, inImage); + + CGContextRestoreGState(inContext); +-InvalidImage: +-InvalidBounds: +-InvalidContext: +- return err; + } + + Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum) +-- +2.7.4 +