[140959] trunk/dports/aqua/qt4-mac
michaelld at macports.org
michaelld at macports.org
Tue Oct 6 12:55:25 PDT 2015
Revision: 140959
https://trac.macports.org/changeset/140959
Author: michaelld at macports.org
Date: 2015-10-06 12:55:25 -0700 (Tue, 06 Oct 2015)
Log Message:
-----------
qt4-mac: fix building on OSX 10.11; addresses ticket #48129.
Modified Paths:
--------------
trunk/dports/aqua/qt4-mac/Portfile
Added Paths:
-----------
trunk/dports/aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.diff
Modified: trunk/dports/aqua/qt4-mac/Portfile
===================================================================
--- trunk/dports/aqua/qt4-mac/Portfile 2015-10-06 19:54:03 UTC (rev 140958)
+++ trunk/dports/aqua/qt4-mac/Portfile 2015-10-06 19:55:25 UTC (rev 140959)
@@ -238,15 +238,26 @@
patchfiles-append \
patch-tools_macdeployqt_shared_shared.cpp.diff
-# error out if trying to build on a new OSX version (> 10.10).
+# (23) remove ColorSync usage from qpaintengine.
+# This patch allows for building using the 10.11 SDK, and is also
+# backward compatible with prior OS versions since it just removes API
+# usage but does not otherwise add any. This patch does roughly the
+# same thing as that from Qt5 commit b06304e16:
+# http://code.qt.io/cgit/qt/qtbase.git/commit/?id=b06304e164ba47351fa292662c1e6383c081b5ca
+
+patchfiles-append \
+ patch-src_gui_painting_qpaintengine_mac.diff
+
+# error out if trying to build on a new OSX version (> 10.11).
+
platform darwin {
- if {${MINOR} > 10} {
+ if {${MINOR} > 11} {
# This project needs to be updated to build with clang++ against libc++
depends_lib
depends_run
pre-fetch {
- ui_error "$name does not currently build on OSX later than 10.10 'Yosemite'."
+ ui_error "$name does not currently build on OSX later than 10.11 'El Capitan'."
error "unsupported platform"
}
}
@@ -1027,7 +1038,7 @@
[string match *clang* ${configure.cxx}]} {
ui_msg "\nERROR: C++11 support for Qt4 is not available when using Clang and libc++.\n"
- error "unsupported platform for C++11 support"
+# error "unsupported platform for C++11 support"
}
}
Added: trunk/dports/aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.diff
===================================================================
--- trunk/dports/aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.diff (rev 0)
+++ trunk/dports/aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.diff 2015-10-06 19:55:25 UTC (rev 140959)
@@ -0,0 +1,106 @@
+--- src/gui/painting/qpaintengine_mac.cpp.orig
++++ src/gui/painting/qpaintengine_mac.cpp
+@@ -289,7 +289,7 @@ static CGMutablePathRef qt_mac_compose_path(const QPainterPath &p, float off=0)
+ }
+
+ CGColorSpaceRef QCoreGraphicsPaintEngine::m_genericColorSpace = 0;
+-QHash<QWidget*, CGColorSpaceRef> QCoreGraphicsPaintEngine::m_displayColorSpaceHash; // window -> color space
++QHash<CGDirectDisplayID, CGColorSpaceRef> QCoreGraphicsPaintEngine::m_displayColorSpaceHash;
+ bool QCoreGraphicsPaintEngine::m_postRoutineRegistered = false;
+
+ CGColorSpaceRef QCoreGraphicsPaintEngine::macGenericColorSpace()
+@@ -318,48 +318,31 @@ CGColorSpaceRef QCoreGraphicsPaintEngine::macGenericColorSpace()
+
+ CGColorSpaceRef QCoreGraphicsPaintEngine::macDisplayColorSpace(const QWidget *widget)
+ {
+- // The color space depends on which screen the widget's window is on.
+- // widget == 0 is a spacial case where we use the main display.
+- QWidget *window = widget ? widget->window() : 0;
++ CGColorSpaceRef colorSpace;
+
+- // Check for cached color space and return if found.
+- if (m_displayColorSpaceHash.contains(window))
+- return m_displayColorSpaceHash.value(window);
+-
+- // Find which display the window is on.
+ CGDirectDisplayID displayID;
+- if (window == 0) {
++ if (widget == 0) {
+ displayID = CGMainDisplayID();
+ } else {
+- const QRect &qrect = window->geometry();
++ const QRect &qrect = widget->window()->geometry();
+ CGRect rect = CGRectMake(qrect.x(), qrect.y(), qrect.width(), qrect.height());
+ CGDisplayCount throwAway;
+ CGDisplayErr dErr = CGGetDisplaysWithRect(rect, 1, &displayID, &throwAway);
+ if (dErr != kCGErrorSuccess)
+- displayID = CGMainDisplayID();
+- }
+-
+- // Get the color space from the display profile.
+- CGColorSpaceRef colorSpace = 0;
+- CMProfileRef displayProfile = 0;
+- CMError err = CMGetProfileByAVID((CMDisplayIDType)displayID, &displayProfile);
+- if (err == noErr) {
+- colorSpace = CGColorSpaceCreateWithPlatformColorSpace(displayProfile);
+- CMCloseProfile(displayProfile);
++ return macDisplayColorSpace(0); // fall back on main display
+ }
++ if ((colorSpace = m_displayColorSpaceHash.value(displayID)))
++ return colorSpace;
+
+- // Fallback: use generic DeviceRGB
++ colorSpace = CGDisplayCopyColorSpace(displayID);
+ if (colorSpace == 0)
+ colorSpace = CGColorSpaceCreateDeviceRGB();
+
+- // Install cleanup routines
++ m_displayColorSpaceHash.insert(displayID, colorSpace);
+ if (!m_postRoutineRegistered) {
+ m_postRoutineRegistered = true;
+ qAddPostRoutine(QCoreGraphicsPaintEngine::cleanUpMacColorSpaces);
+ }
+-
+- // Cache and return.
+- m_displayColorSpaceHash.insert(window, colorSpace);
+ return colorSpace;
+ }
+
+@@ -369,7 +352,7 @@ void QCoreGraphicsPaintEngine::cleanUpMacColorSpaces()
+ CFRelease(m_genericColorSpace);
+ m_genericColorSpace = 0;
+ }
+- QHash<QWidget*, CGColorSpaceRef>::const_iterator it = m_displayColorSpaceHash.constBegin();
++ QHash<CGDirectDisplayID, CGColorSpaceRef>::const_iterator it = m_displayColorSpaceHash.constBegin();
+ while (it != m_displayColorSpaceHash.constEnd()) {
+ if (it.value())
+ CFRelease(it.value());
+@@ -1069,7 +1052,16 @@ void QCoreGraphicsPaintEngine::cleanup()
+
+ void QCoreGraphicsPaintEngine::clearColorSpace(QWidget* w)
+ {
+- m_displayColorSpaceHash.remove(w);
++ CGDirectDisplayID displayID = CGMainDisplayID();
++ if (w != 0) {
++ const QRect &qrect = w->window()->geometry();
++ CGRect rect = CGRectMake(qrect.x(), qrect.y(), qrect.width(), qrect.height());
++ CGDisplayCount throwAway;
++ CGDisplayErr dErr = CGGetDisplaysWithRect(rect, 1, &displayID, &throwAway);
++ if (dErr != kCGErrorSuccess)
++ displayID = CGMainDisplayID();
++ }
++ m_displayColorSpaceHash.remove(displayID);
+ }
+
+ CGContextRef
+--- src/gui/painting/qpaintengine_mac_p.h.orig
++++ src/gui/painting/qpaintengine_mac_p.h
+@@ -135,7 +135,7 @@ protected:
+ private:
+ static bool m_postRoutineRegistered;
+ static CGColorSpaceRef m_genericColorSpace;
+- static QHash<QWidget*, CGColorSpaceRef> m_displayColorSpaceHash; // window -> color space
++ static QHash<CGDirectDisplayID, CGColorSpaceRef> m_displayColorSpaceHash;
+ static void cleanUpMacColorSpaces();
+ Q_DISABLE_COPY(QCoreGraphicsPaintEngine)
+ };
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20151006/7e304ea4/attachment.html>
More information about the macports-changes
mailing list