From bc7db7bdadf141040ffa35fe6308b5039f74c7e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Mon, 4 Sep 2017 13:55:20 +0200 Subject: [PATCH] qt4-mac: support building on Tiger backport qt5 QSettings fix also an alternate fix for high Sierra is presented that can be enabled if the maintainer wishes All the tiger-specific patches are suffixed with -tiger, and don't break anything when compiling with more recent SDKs. Only one patch, patch-src_gui_dialogs_qfontdialog_mac.mm-tiger.diff, reintroduces in the Tiger version only a Qt bug (QTBUG-27415) which cannot be fixed with the Tiger SDK (the fix requires Leopard). Patch (19) seems wrong when building frameworks and breaks the build (older versions of qt4-mac allowed building with libraries only, I guess this patch is remnant from that time). I commented it out, and did not remove the patch file in case someone wants to take a closer look at it. Also, since qt4-mac only uses the JPEG 8 API, libjpeg-turbo can be used instead (see https://trac.macports.org/ticket/38907) Patches (31) (backport qt5 QSettings fix) and (30) (support High Sierra) were taken from homebrew. I did not test building on macOS High Sierra, and thus left the restriction. --- aqua/qt4-mac/Portfile | 42 +++++-- ...h-qmake_generators_unix_unixmakke.cpp.diff | 108 ++++++++++++++++++ aqua/qt4-mac/files/patch-qsettings-null.diff | 76 ++++++++++++ ...atch-qt4-versions-without-underscores.diff | 12 ++ ...b_io_qfilesystemengine_unix.cpp-tiger.diff | 41 +++++++ ..._gui_dialogs_qfontdialog_mac.mm-tiger.diff | 34 ++++++ ...rc_gui_kernel_qt_cocoa_helpers_mac.mm.diff | 15 +++ ...i_painting_qpaintengine_mac.cpp-tiger.diff | 19 +++ ...ui_painting_qprintengine_mac.mm-tiger.diff | 14 +++ ..._gui_text_qfontdatabase_mac.cpp-tiger.diff | 21 ++++ ...rk_kernel_qnetworkproxy_mac.cpp-tiger.diff | 18 +++ 11 files changed, 392 insertions(+), 8 deletions(-) create mode 100644 aqua/qt4-mac/files/patch-qmake_generators_unix_unixmakke.cpp.diff create mode 100644 aqua/qt4-mac/files/patch-qsettings-null.diff create mode 100644 aqua/qt4-mac/files/patch-qt4-versions-without-underscores.diff create mode 100644 aqua/qt4-mac/files/patch-src_corelib_io_qfilesystemengine_unix.cpp-tiger.diff create mode 100644 aqua/qt4-mac/files/patch-src_gui_dialogs_qfontdialog_mac.mm-tiger.diff create mode 100644 aqua/qt4-mac/files/patch-src_gui_kernel_qt_cocoa_helpers_mac.mm.diff create mode 100644 aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.cpp-tiger.diff create mode 100644 aqua/qt4-mac/files/patch-src_gui_painting_qprintengine_mac.mm-tiger.diff create mode 100644 aqua/qt4-mac/files/patch-src_gui_text_qfontdatabase_mac.cpp-tiger.diff create mode 100644 aqua/qt4-mac/files/patch-src_network_kernel_qnetworkproxy_mac.cpp-tiger.diff diff --git a/aqua/qt4-mac/Portfile b/aqua/qt4-mac/Portfile index da02bc8f9fb2c..41cc56ed86a4f 100644 --- a/aqua/qt4-mac/Portfile +++ b/aqua/qt4-mac/Portfile @@ -11,12 +11,12 @@ PortGroup compiler_blacklist_versions 1.0 name qt4-mac version 4.8.7 -revision 5 +revision 6 set branch [join [lrange [split ${version} .] 0 1] .] categories aqua platforms macosx -maintainers michaelld openmaintainer +maintainers {michaelld @michaelld} openmaintainer license {LGPL-2.1 GPL-3} homepage http://www.qt.io/ @@ -40,7 +40,7 @@ depends_lib-append port:zlib \ port:tiff \ port:libpng \ port:libmng \ - port:jpeg + path:lib/libjpeg.dylib:jpeg # find a way to specify the OS MINOR version. For OSX 10.X, this # value will be X. The type is this variable is integer, so we can @@ -217,7 +217,8 @@ patchfiles-append \ platform darwin { if {${MINOR} == 4} { - patchfiles-append patch-QtHelp_10.4_only.diff + # this breaks the framework build + #patchfiles-append patch-QtHelp_10.4_only.diff } } @@ -292,15 +293,40 @@ patchfiles-append patch-better-invalid-fonttable-handling.diff patchfiles-append patch-fix_pointer_comparison_to_0.diff +# (30) Fix build on 10.13; comment out assertions +# won't hurt current builds, but allows building on 10.13 / Xcode 9 + +patchfiles-append patch-src_gui_kernel_qt_cocoa_helpers_mac.mm.diff + +# (30) an alternate Patch to fix build on macOS High Sierra +# enable assertions without underscores +# patchfiles-append patch-qt4-versions-without-underscores.diff + +# (31) Backport of Qt5 patch to fix an issue with null bytes in QSetting strings (QTBUG-56124). +patchfiles-append patch-qsettings-null.diff + +# (32) Mac OS X 10.4 Tiger patches +platform darwin { + if {${MINOR} == 4} { + patchfiles-append patch-src_corelib_io_qfilesystemengine_unix.cpp-tiger.diff + patchfiles-append patch-src_network_kernel_qnetworkproxy_mac.cpp-tiger.diff + patchfiles-append patch-src_gui_painting_qprintengine_mac.mm-tiger.diff + patchfiles-append patch-src_gui_dialogs_qfontdialog_mac.mm-tiger.diff + patchfiles-append patch-src_gui_text_qfontdatabase_mac.cpp-tiger.diff + patchfiles-append patch-src_gui_painting_qpaintengine_mac.cpp-tiger.diff + } +} + + # error out if trying to build on a new OSX version (> 10.12). platform darwin { - if {${MINOR} > 12} { + if {${MINOR} > 13} { # 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 Mac OS X later than 10.12 'Sierra'." + ui_error "$name does not currently build on Mac OS X later than 10.13 'High Sierra'." error "unsupported platform" } } @@ -337,7 +363,7 @@ if {${SDK} eq ""} { post-patch { # set ARCHES in configure (per the third patchfile above), for # building QMake. join any 2 or more arch entries with the GCC - # arch flag (join does not effect a single entry). first "-arch" + # arch flag (join does not affect a single entry). first "-arch" # is already in place in the 'configure' script (since there has # to be at least 1 arch). @@ -985,7 +1011,7 @@ post-destroot { set dest_dir ${dr_qt_frameworks_dir}/${include_dir}.framework/Headers/private xinstall -m 755 -d ${dest_dir} set files [exec find ${worksrcpath}/src/${src_dir} -type f -name "*_p.h"] - eval xinstall -m 644 [split ${files}] ${dest_dir} + xinstall -m 644 {*}[split ${files}] ${dest_dir} } # Move .apps into the applications_dir, and link each .apps' diff --git a/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmakke.cpp.diff b/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmakke.cpp.diff new file mode 100644 index 0000000000000..1a93310061581 --- /dev/null +++ b/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmakke.cpp.diff @@ -0,0 +1,108 @@ +--- qmake/generators/unix/unixmake.cpp.orig 2013-02-24 21:46:23.000000000 -0500 ++++ qmake/generators/unix/unixmake.cpp 2013-02-25 11:40:24.000000000 -0500 +@@ -472,8 +472,9 @@ + UnixMakefileGenerator::findLibraries() + { + QList libdirs, frameworkdirs; ++ frameworkdirs.append(QMakeLocalFileName("@PREFIX@/Library/Frameworks")); + frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks")); +- frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks")); ++ libdirs.append(QMakeLocalFileName("@PREFIX@/lib")); + const QString lflags[] = { "QMAKE_LIBDIR_FLAGS", "QMAKE_FRAMEWORKPATH_FLAGS", "QMAKE_LFLAGS", "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", QString() }; + for(int i = 0; !lflags[i].isNull(); i++) { + QStringList &l = project->values(lflags[i]); +@@ -583,7 +584,9 @@ + UnixMakefileGenerator::processPrlFiles() + { + QList libdirs, frameworkdirs; ++ frameworkdirs.append(QMakeLocalFileName("@PREFIX@/Library/Frameworks")); + frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks")); ++ libdirs.append(QMakeLocalFileName("@PREFIX@/lib")); + const QString lflags[] = { "QMAKE_LIBDIR_FLAGS", "QMAKE_FRAMEWORKPATH_FLAGS", "QMAKE_LFLAGS", "QMAKE_LIBS", QString() }; + for(int i = 0; !lflags[i].isNull(); i++) { + QStringList &l = project->values(lflags[i]); +@@ -627,13 +630,78 @@ + else + opt = l.at(++lit); + opt = opt.trimmed(); +- const QList dirs = frameworkdirs + libdirs; +- for(int dep_i = 0; dep_i < dirs.size(); ++dep_i) { ++ ++ // See if this framework is specified as ++ // "foo,bar", which to Apple's LD means to look ++ // for "foo" with the addition "bar" first in all ++ // paths, then if not found do the same for just ++ // "foo". Tricky looking for "," but not "\," ++ ++#if 0 ++ warn_msg(WarnLogic, "out before: '%s'\n", opt.toLatin1().constData()); ++#endif ++ int num_cs = 0; ++ int loc_1 = -1; ++ int loc = opt.indexOf(","); ++ bool found = false; ++ while (!found && (loc != -1)) { ++ found = (loc == 0); ++ if (!found) { ++ found = (opt[loc-1] != '\\'); ++ } ++ if (found) { ++ if (loc_1 == -1) { ++ loc_1 = loc; ++ } ++ ++num_cs; ++ } else { ++ loc = opt.indexOf(",", loc); ++ } ++ } ++#if 0 ++ warn_msg(WarnLogic, "found == %s, loc == %d\n", ++ (found ? "true" : "false"), loc); ++#endif ++ if (found) { ++ // split into name and extension ++ if (num_cs > 1) { ++ warn_msg(WarnLogic, "When parsing -framework '%s', found more than one ',' in the name. Assuming the first ',' is used to delineate between the framework name and the optional extension.\n", opt.toLatin1().constData()); ++ } ++ QString ext = opt.mid(loc_1+1); ++ opt = opt.left(loc_1); ++ found = false; ++ const QList dirs = frameworkdirs + libdirs; ++ for(int dep_i = 0; dep_i < dirs.size(); ++dep_i) { ++ QString prl = dirs[dep_i].local() + "/" + opt + ".framework/" + opt + ext + Option::prl_ext; ++#if 0 ++ warn_msg(WarnLogic, "Looking for PRL '%s'\n", prl.toLatin1().constData()); ++#endif ++ if(processPrlFile(prl)) { ++#if 0 ++ warn_msg(WarnLogic, "Found PRL for framework '%s' with optional extension '%s': '%s'\n", opt.toLatin1().constData(), ext.toLatin1().constData(), prl.toLatin1().constData()); ++#endif ++ found = true; ++ break; ++ } ++ } ++ } ++ // if not found yet, try the primary name ++ if (!found) { ++ const QList dirs = frameworkdirs + libdirs; ++ for(int dep_i = 0; dep_i < dirs.size(); ++dep_i) { + QString prl = dirs[dep_i].local() + "/" + opt + ".framework/" + opt + Option::prl_ext; +- if(processPrlFile(prl)) +- break; +- } +- } ++#if 0 ++ warn_msg(WarnLogic, "Looking for PRL '%s'\n", prl.toLatin1().constData()); ++#endif ++ if(processPrlFile(prl)) { ++#if 0 ++ warn_msg(WarnLogic, "Found PRL for framework '%s': '%s'\n", opt.toLatin1().constData(), prl.toLatin1().constData()); ++#endif ++ break; ++ } ++ } ++ } ++ } + } else if(!opt.isNull()) { + QString lib = opt; + processPrlFile(lib); diff --git a/aqua/qt4-mac/files/patch-qsettings-null.diff b/aqua/qt4-mac/files/patch-qsettings-null.diff new file mode 100644 index 0000000000000..344dc46d000fe --- /dev/null +++ b/aqua/qt4-mac/files/patch-qsettings-null.diff @@ -0,0 +1,76 @@ +From 38ca587a64499707cb375738758430f8d105fc7d Mon Sep 17 00:00:00 2001 +From: Mikkel Krautz +Date: Fri, 2 Dec 2016 22:55:56 +0100 +Subject: [PATCH] Backport + qt5-macos-handle-qsetting-strings-with-embedded-zero-bytes-QTBUG-56124.patch + from mumble-releng to Qt 4. + +--- + src/corelib/io/qsettings.cpp | 6 +++++- + src/corelib/io/qsettings_mac.cpp | 22 +++++++++++++++++++--- + 2 files changed, 24 insertions(+), 4 deletions(-) + +diff --git src/corelib/io/qsettings.cpp.orig src/corelib/io/qsettings.cpp +index a4750c5..eb8ab5e 100644 +--- src/corelib/io/qsettings.cpp ++++ src/corelib/io/qsettings.cpp +@@ -487,7 +487,9 @@ QString QSettingsPrivate::variantToString(const QVariant &v) + case QVariant::Double: + case QVariant::KeySequence: { + result = v.toString(); +- if (result.startsWith(QLatin1Char('@'))) ++ if (result.contains(QChar::Null)) ++ result = QLatin1String("@String(") + result + QLatin1Char(')'); ++ else if (result.startsWith(QLatin1Char('@'))) + result.prepend(QLatin1Char('@')); + break; + } +@@ -554,6 +556,8 @@ QVariant QSettingsPrivate::stringToVariant(const QString &s) + if (s.endsWith(QLatin1Char(')'))) { + if (s.startsWith(QLatin1String("@ByteArray("))) { + return QVariant(s.toLatin1().mid(11, s.size() - 12)); ++ } else if (s.startsWith(QLatin1String("@String("))) { ++ return QVariant(s.midRef(8, s.size() - 9).toString()); + } else if (s.startsWith(QLatin1String("@Variant("))) { + #ifndef QT_NO_DATASTREAM + QByteArray a(s.toLatin1().mid(9)); +diff --git src/corelib/io/qsettings_mac.cpp.orig src/corelib/io/qsettings_mac.cpp +index 3504907..edbe103 100644 +--- src/corelib/io/qsettings_mac.cpp ++++ src/corelib/io/qsettings_mac.cpp +@@ -218,7 +218,14 @@ static QCFType macValue(const QVariant &value) + case QVariant::String: + string_case: + default: +- result = QCFString::toCFStringRef(QSettingsPrivate::variantToString(value)); ++ QString string = QSettingsPrivate::variantToString(value); ++ if (string.contains(QChar::Null)) { ++ QByteArray ba = string.toUtf8(); ++ result = CFDataCreate(kCFAllocatorDefault, reinterpret_cast(ba.data()), ++ CFIndex(ba.size())); ++ } else { ++ result = QCFString::toCFStringRef(string); ++ } + } + return result; + } +@@ -269,8 +276,17 @@ static QVariant qtValue(CFPropertyListRef cfvalue) + return (bool)CFBooleanGetValue(static_cast(cfvalue)); + } else if (typeId == CFDataGetTypeID()) { + CFDataRef cfdata = static_cast(cfvalue); +- return QByteArray(reinterpret_cast(CFDataGetBytePtr(cfdata)), +- CFDataGetLength(cfdata)); ++ QByteArray byteArray = QByteArray(reinterpret_cast(CFDataGetBytePtr(cfdata)), ++ CFDataGetLength(cfdata)); ++ ++ // Fast-path for QByteArray, so that we don't have to go ++ // though the expensive and lossy conversion via UTF-8. ++ if (!byteArray.startsWith('@')) ++ return byteArray; ++ ++ const QString str = QString::fromUtf8(byteArray.constData(), byteArray.size()); ++ return QSettingsPrivate::stringToVariant(str); ++ + } else if (typeId == CFDictionaryGetTypeID()) { + CFDictionaryRef cfdict = static_cast(cfvalue); + CFTypeID arrayTypeId = CFArrayGetTypeID(); diff --git a/aqua/qt4-mac/files/patch-qt4-versions-without-underscores.diff b/aqua/qt4-mac/files/patch-qt4-versions-without-underscores.diff new file mode 100644 index 0000000000000..45c9e86906a2a --- /dev/null +++ b/aqua/qt4-mac/files/patch-qt4-versions-without-underscores.diff @@ -0,0 +1,12 @@ +--- src/gui/kernel/qt_cocoa_helpers_mac.mm.orig 2017-08-01 09:43:40.000000000 -0400 ++++ src/gui/kernel/qt_cocoa_helpers_mac.mm 2017-08-01 09:47:33.000000000 -0400 +@@ -73,6 +73,9 @@ + ** + ****************************************************************************/ + ++// Workaround for macOS 10.13 and later ++#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 1 ++ + #include + #include + #include diff --git a/aqua/qt4-mac/files/patch-src_corelib_io_qfilesystemengine_unix.cpp-tiger.diff b/aqua/qt4-mac/files/patch-src_corelib_io_qfilesystemengine_unix.cpp-tiger.diff new file mode 100644 index 0000000000000..c716e32179dee --- /dev/null +++ b/aqua/qt4-mac/files/patch-src_corelib_io_qfilesystemengine_unix.cpp-tiger.diff @@ -0,0 +1,41 @@ +--- src/corelib/io/qfilesystemengine_unix.cpp.orig 2017-08-31 20:54:04.000000000 +0200 ++++ src/corelib/io/qfilesystemengine_unix.cpp 2017-08-31 20:58:13.000000000 +0200 +@@ -83,6 +83,7 @@ + return (fileInfo->finderFlags & kIsInvisible); + } + ++#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 + static bool isPackage(const QFileSystemMetaData &data, const QFileSystemEntry &entry) + { + if (!data.isDirectory()) +@@ -138,6 +139,7 @@ + FolderInfo *folderInfo = reinterpret_cast(catalogInfo.finderInfo); + return folderInfo->finderFlags & kHasBundle; + } ++#endif + + #else + static inline bool _q_isMacHidden(const char *nativePath) +@@ -529,8 +531,22 @@ + + #if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC) + if (what & QFileSystemMetaData::BundleType) { ++#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 + if (entryExists && isPackage(data, entry)) + data.entryFlags |= QFileSystemMetaData::BundleType; ++#else ++ if (entryExists && data.isDirectory()) { ++ QCFType path = CFStringCreateWithBytes(0, ++ (const UInt8*)nativeFilePath, nativeFilePathLength, ++ kCFStringEncodingUTF8, false); ++ QCFType url = CFURLCreateWithFileSystemPath(0, path, ++ kCFURLPOSIXPathStyle, true); ++ ++ UInt32 type, creator; ++ if (CFBundleGetPackageInfoInDirectory(url, &type, &creator)) ++ data.entryFlags |= QFileSystemMetaData::BundleType; ++ } ++#endif + data.knownFlagsMask |= QFileSystemMetaData::BundleType; + } + #endif diff --git a/aqua/qt4-mac/files/patch-src_gui_dialogs_qfontdialog_mac.mm-tiger.diff b/aqua/qt4-mac/files/patch-src_gui_dialogs_qfontdialog_mac.mm-tiger.diff new file mode 100644 index 0000000000000..1f8967614cf47 --- /dev/null +++ b/aqua/qt4-mac/files/patch-src_gui_dialogs_qfontdialog_mac.mm-tiger.diff @@ -0,0 +1,34 @@ +--- src/gui/dialogs/qfontdialog_mac.mm.orig 2017-08-31 21:41:56.000000000 +0200 ++++ src/gui/dialogs/qfontdialog_mac.mm 2017-08-31 21:55:51.000000000 +0200 +@@ -141,6 +141,7 @@ + QFont newFont; + if (cocoaFont) { + int pSize = qRound([cocoaFont pointSize]); ++#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) + CTFontDescriptorRef font = CTFontCopyFontDescriptor((CTFontRef)cocoaFont); + // QCoreTextFontDatabase::populateFontDatabase() is using localized names + QString family = QCFString::toQString((CFStringRef) CTFontDescriptorCopyLocalizedAttribute(font, kCTFontFamilyNameAttribute, NULL)); +@@ -151,6 +152,23 @@ + newFont.setStrikeOut(resolveFont.strikeOut()); + + CFRelease(font); ++#else ++ // This pre-Leopard version is buggy and was fixed in 717e36037cf246aa201c0aaf15a5dcbd7883f159 ++ // see QTBUG-27415 https://codereview.qt-project.org/#/c/42830/ ++ QString family(qt_mac_NSStringToQString([cocoaFont familyName])); ++ QString typeface(qt_mac_NSStringToQString([cocoaFont fontName])); ++ ++ int hyphenPos = typeface.indexOf(QLatin1Char('-')); ++ if (hyphenPos != -1) { ++ typeface.remove(0, hyphenPos + 1); ++ } else { ++ typeface = QLatin1String("Normal"); ++ } ++ ++ newFont = QFontDatabase().font(family, typeface, pSize); ++ newFont.setUnderline(resolveFont.underline()); ++ newFont.setStrikeOut(resolveFont.strikeOut()); ++#endif + } + return newFont; + } diff --git a/aqua/qt4-mac/files/patch-src_gui_kernel_qt_cocoa_helpers_mac.mm.diff b/aqua/qt4-mac/files/patch-src_gui_kernel_qt_cocoa_helpers_mac.mm.diff new file mode 100644 index 0000000000000..780a1cbd82315 --- /dev/null +++ b/aqua/qt4-mac/files/patch-src_gui_kernel_qt_cocoa_helpers_mac.mm.diff @@ -0,0 +1,15 @@ +--- src/gui/kernel/qt_cocoa_helpers_mac.mm.orig ++++ src/gui/kernel/qt_cocoa_helpers_mac.mm +@@ -351,9 +351,9 @@ + // 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); ++// 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)); diff --git a/aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.cpp-tiger.diff b/aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.cpp-tiger.diff new file mode 100644 index 0000000000000..bcdfa43633c55 --- /dev/null +++ b/aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.cpp-tiger.diff @@ -0,0 +1,19 @@ +--- src/gui/painting/qpaintengine_mac.cpp.orig 2017-08-31 22:56:01.000000000 +0200 ++++ src/gui/painting/qpaintengine_mac.cpp 2017-08-31 23:10:20.000000000 +0200 +@@ -334,7 +334,16 @@ + if ((colorSpace = m_displayColorSpaceHash.value(displayID))) + return colorSpace; + ++#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) + colorSpace = CGDisplayCopyColorSpace(displayID); ++#else ++ CMProfileRef displayProfile = 0; ++ CMError err = CMGetProfileByAVID((CMDisplayIDType)displayID, &displayProfile); ++ if (err == noErr) { ++ colorSpace = CGColorSpaceCreateWithPlatformColorSpace(displayProfile); ++ CMCloseProfile(displayProfile); ++ } ++#endif + if (colorSpace == 0) + colorSpace = CGColorSpaceCreateDeviceRGB(); + diff --git a/aqua/qt4-mac/files/patch-src_gui_painting_qprintengine_mac.mm-tiger.diff b/aqua/qt4-mac/files/patch-src_gui_painting_qprintengine_mac.mm-tiger.diff new file mode 100644 index 0000000000000..c84c14d72efc9 --- /dev/null +++ b/aqua/qt4-mac/files/patch-src_gui_painting_qprintengine_mac.mm-tiger.diff @@ -0,0 +1,14 @@ +--- src/gui/painting/qprintengine_mac.mm.orig 2017-08-31 21:35:19.000000000 +0200 ++++ src/gui/painting/qprintengine_mac.mm 2017-08-31 21:37:56.000000000 +0200 +@@ -187,7 +187,11 @@ + paperMargins.top = topMargin; + paperMargins.right = rightMargin; + paperMargins.bottom = bottomMargin; ++#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) + PMPaperCreateCustom(printer, paperId, QCFString("Custom size"), customSize.width(), customSize.height(), &paperMargins, &customPaper); ++#else ++ PMPaperCreate(printer, paperId, QCFString("Custom size"), customSize.width(), customSize.height(), &paperMargins, &customPaper); ++#endif + PMPageFormat tmp; + PMCreatePageFormatWithPMPaper(&tmp, customPaper); + PMCopyPageFormat(tmp, format); diff --git a/aqua/qt4-mac/files/patch-src_gui_text_qfontdatabase_mac.cpp-tiger.diff b/aqua/qt4-mac/files/patch-src_gui_text_qfontdatabase_mac.cpp-tiger.diff new file mode 100644 index 0000000000000..85f184edb7e76 --- /dev/null +++ b/aqua/qt4-mac/files/patch-src_gui_text_qfontdatabase_mac.cpp-tiger.diff @@ -0,0 +1,21 @@ +--- src/gui/text/qfontdatabase_mac.cpp.orig 2017-08-31 22:45:17.000000000 +0200 ++++ src/gui/text/qfontdatabase_mac.cpp 2017-08-31 23:10:46.000000000 +0200 +@@ -546,6 +546,7 @@ + + QString QFontDatabase::resolveFontFamilyAlias(const QString &family) + { ++#if defined(QT_MAC_USE_COCOA) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) + QCFString expectedFamily = QCFString(family); + + QCFType attributes = CFDictionaryCreateMutable(NULL, 0, +@@ -563,6 +564,10 @@ + + QCFString familyName = (CFStringRef) CTFontDescriptorCopyLocalizedAttribute(matched, kCTFontFamilyNameAttribute, NULL); + return familyName; ++#else ++ // https://bugreports.qt.io/browse/QTBUG-25417?focusedCommentId=185393&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-185393 ++ return family; ++#endif + } + + QT_END_NAMESPACE diff --git a/aqua/qt4-mac/files/patch-src_network_kernel_qnetworkproxy_mac.cpp-tiger.diff b/aqua/qt4-mac/files/patch-src_network_kernel_qnetworkproxy_mac.cpp-tiger.diff new file mode 100644 index 0000000000000..3ca4d4a260a9b --- /dev/null +++ b/aqua/qt4-mac/files/patch-src_network_kernel_qnetworkproxy_mac.cpp-tiger.diff @@ -0,0 +1,18 @@ +--- src/network/kernel/qnetworkproxy_mac.cpp.orig 2017-08-31 21:05:13.000000000 +0200 ++++ src/network/kernel/qnetworkproxy_mac.cpp 2017-08-31 21:05:44.000000000 +0200 +@@ -148,6 +148,7 @@ + } + + ++#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) + static QNetworkProxy proxyFromDictionary(CFDictionaryRef dict) + { + QNetworkProxy::ProxyType proxyType = QNetworkProxy::DefaultProxy; +@@ -180,6 +181,7 @@ + + return QNetworkProxy(proxyType, hostName, port, user, password); + } ++#endif + + const char * cfurlErrorDescription(SInt32 errorCode) + {