qt5: build with SDK 11.0 on all Darwins (hopefully)

This commit is contained in:
K900 2023-01-10 19:22:15 +03:00
parent 2b06f2a986
commit 5802c30687
15 changed files with 46 additions and 587 deletions

View file

@ -30,16 +30,6 @@ let
qtbase = lib.optionals stdenv.isDarwin [
./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
# Downgrade minimal required SDK to 10.12
./qtbase.patch.d/0013-define-kiosurfacesuccess.patch
./qtbase.patch.d/macos-sdk-10.12/0001-Revert-QCocoaDrag-set-image-only-on-the-first-drag-i.patch
./qtbase.patch.d/macos-sdk-10.12/0002-Revert-QCocoaDrag-drag-make-sure-clipboard-is-ours-a.patch
./qtbase.patch.d/macos-sdk-10.12/0003-Revert-QCocoaDrag-maybeDragMultipleItems-fix-erroneo.patch
./qtbase.patch.d/macos-sdk-10.12/0004-Revert-QCocoaDrag-avoid-using-the-deprecated-API-if-.patch
./qtbase.patch.d/macos-sdk-10.12/0005-Revert-macOS-Fix-use-of-deprecated-NSOffState.patch
./qtbase.patch.d/macos-sdk-10.12/0006-git-checkout-v5.15.0-src-plugins-platforms-cocoa-qco.patch
./qtbase.patch.d/qtbase-sdk-10.12-mac.patch
# Patch framework detection to support X.framework/X.tbd,
# extending the current support for X.framework/X.
./qtbase.patch.d/0012-qtbase-tbd-frameworks.patch
@ -136,9 +126,10 @@ let
inherit bison cups harfbuzz libGL;
withGtk3 = !stdenv.isDarwin; inherit dconf gtk3;
inherit developerBuild decryptSslTraffic;
inherit (darwin.apple_sdk.frameworks) AGL AppKit ApplicationServices AVFoundation Carbon Cocoa CoreAudio CoreBluetooth
inherit (darwin.apple_sdk_11_0.frameworks) AGL AppKit ApplicationServices AVFoundation Carbon Cocoa CoreAudio CoreBluetooth
CoreLocation CoreServices DiskArbitration Foundation OpenGL MetalKit IOKit;
inherit (darwin) libobjc;
libobjc = darwin.apple_sdk_11_0.objc4;
xcbuild = darwin.apple_sdk_11_0.xcodebuild;
};
qt3d = callPackage ../modules/qt3d.nix {};
@ -147,7 +138,7 @@ let
qtdeclarative = callPackage ../modules/qtdeclarative.nix {};
qtdoc = callPackage ../modules/qtdoc.nix {};
qtgamepad = callPackage ../modules/qtgamepad.nix {
inherit (darwin.apple_sdk.frameworks) GameController;
inherit (darwin.apple_sdk_11_0.frameworks) GameController;
};
qtgraphicaleffects = callPackage ../modules/qtgraphicaleffects.nix {};
qtimageformats = callPackage ../modules/qtimageformats.nix {};
@ -181,19 +172,21 @@ let
rm -r src/3rdparty/chromium/third_party/catapult
cp -r ${srcs.catapult} src/3rdparty/chromium/third_party/catapult
'';
inherit (darwin) cctools libobjc libunwind xnu;
inherit (darwin.apple_sdk.libs) sandbox;
inherit (darwin.apple_sdk.frameworks) ApplicationServices AVFoundation Foundation ForceFeedback GameController AppKit
inherit (darwin) cctools xnu;
inherit (darwin.apple_sdk_11_0) libunwind;
inherit (darwin.apple_sdk_11_0.libs) sandbox;
inherit (darwin.apple_sdk_11_0.frameworks) ApplicationServices AVFoundation Foundation ForceFeedback GameController AppKit
ImageCaptureCore CoreBluetooth IOBluetooth CoreWLAN Quartz Cocoa LocalAuthentication;
libobjc = darwin.apple_sdk_11_0.objc4;
};
qtwebglplugin = callPackage ../modules/qtwebglplugin.nix {};
qtwebkit = callPackage ../modules/qtwebkit.nix {
inherit (darwin) ICU;
inherit (darwin.apple_sdk.frameworks) OpenGL;
inherit (darwin.apple_sdk_11_0.frameworks) OpenGL;
};
qtwebsockets = callPackage ../modules/qtwebsockets.nix {};
qtwebview = callPackage ../modules/qtwebview.nix {
inherit (darwin.apple_sdk.frameworks) CoreFoundation WebKit;
inherit (darwin.apple_sdk_11_0.frameworks) CoreFoundation WebKit;
};
qtx11extras = callPackage ../modules/qtx11extras.nix {};
qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {};

View file

@ -27,7 +27,7 @@ index 61bea952b2..9909dae726 100644
QMAKE_LFLAGS_REL_RPATH =
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index 92a9112bca..b80ec1e801 100644
index abc6d82ade..59b94fe5b6 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -1,9 +1,5 @@
@ -62,7 +62,7 @@ index 92a9112bca..b80ec1e801 100644
-
- !sdk_no_version_check:!versionAtMost(QMAKE_MAC_SDK_MAJOR_VERSION, $$QT_MAC_SDK_VERSION_MAX) {
- warning("Qt has only been tested with version $$QT_MAC_SDK_VERSION_MAX"\
- "of the platform SDK, you're using $${QMAKE_MAC_SDK_MAJOR_MINOR_VERSION}.")
- "of the platform SDK, you're using $${QMAKE_MAC_SDK_MAJOR_VERSION}.")
- warning("This is an unsupported configuration. You may experience build issues," \
- "and by using")
- warning("the $$QMAKE_MAC_SDK_VERSION SDK you are opting in to new features" \
@ -77,7 +77,7 @@ index 92a9112bca..b80ec1e801 100644
}
!no_objective_c:CONFIG += objective_c
@@ -73,212 +39,6 @@ qt {
@@ -73,230 +39,6 @@ qt {
}
}
@ -103,6 +103,19 @@ index 92a9112bca..b80ec1e801 100644
- QMAKE_LFLAGS += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
-}
-
-macos {
- !isEmpty(QMAKE_APPLE_DEVICE_ARCHS) {
- # If the user has requested a specific set of architectures,
- # build all of those by default, but limited to only those.
- CONFIG -= only_active_arch
- } else {
- # Otherwise allow building all of the architectures available
- # in Qt, but only build the active arch (unless the user has
- # manually overridden this via CONFIG -= only_active_arch).
- QMAKE_APPLE_DEVICE_ARCHS = $$QT_ARCHS
- }
-}
-
-macx-xcode {
- qmake_pkginfo_typeinfo.name = QMAKE_PKGINFO_TYPEINFO
- !isEmpty(QMAKE_PKGINFO_TYPEINFO): \
@ -158,15 +171,20 @@ index 92a9112bca..b80ec1e801 100644
- simulator: VALID_SIMULATOR_ARCHS = $$QMAKE_APPLE_SIMULATOR_ARCHS
- VALID_ARCHS = $$VALID_DEVICE_ARCHS $$VALID_SIMULATOR_ARCHS
-
- isEmpty(VALID_ARCHS): \
- error("QMAKE_APPLE_DEVICE_ARCHS or QMAKE_APPLE_SIMULATOR_ARCHS must contain at least one architecture")
-
- single_arch: VALID_ARCHS = $$first(VALID_ARCHS)
-
- ACTIVE_ARCHS = $(filter $(EXPORT_VALID_ARCHS), $(ARCHS))
- ARCH_ARGS = $(foreach arch, $(if $(EXPORT_ACTIVE_ARCHS), $(EXPORT_ACTIVE_ARCHS), $(EXPORT_VALID_ARCHS)), -arch $(arch))
- macos {
- only_active_arch: DEFAULT_ARCHS = $$system("uname -m")
- else: DEFAULT_ARCHS = $$VALID_ARCHS
- }
-
- QMAKE_EXTRA_VARIABLES += VALID_ARCHS ACTIVE_ARCHS ARCH_ARGS
- ARCHS = $(filter $(EXPORT_VALID_ARCHS), \
- $(if $(ARCHS), $(ARCHS), \
- $(if $(EXPORT_DEFAULT_ARCHS), $(EXPORT_DEFAULT_ARCHS), \
- $(EXPORT_VALID_ARCHS))))
- ARCH_ARGS = $(foreach arch, $(if $(EXPORT_ARCHS), $(EXPORT_ARCHS), $(EXPORT_VALID_ARCHS)), -arch $(arch))
-
- QMAKE_EXTRA_VARIABLES += VALID_ARCHS DEFAULT_ARCHS ARCHS ARCH_ARGS
-
- arch_flags = $(EXPORT_ARCH_ARGS)
-
@ -291,11 +309,12 @@ index 92a9112bca..b80ec1e801 100644
generate_xcode_project.commands = @$(QMAKE) -spec macx-xcode \"$(EXPORT__PRO_FILE_)\" $$QMAKE_ARGS
generate_xcode_project.target = xcodeproj
diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
index e3534561a5..3b01424e67 100644
index 2c91ba6679..a6ab233825 100644
--- a/mkspecs/features/mac/default_pre.prf
+++ b/mkspecs/features/mac/default_pre.prf
@@ -1,60 +1,2 @@
CONFIG = asset_catalogs rez $$CONFIG
@@ -21,61 +21,3 @@ macos {
}
load(default_pre)
-
-isEmpty(QMAKE_XCODE_DEVELOPER_PATH) {

View file

@ -8,11 +8,11 @@ Subject: [PATCH 11/11] fix header_module
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index b9e5d35026..9924271042 100644
index 0b2a30d159..37271e09d9 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -84,7 +84,7 @@ header_module {
CONFIG += qt_no_install_library
qt_no_install_library
# Allow creation of .prl, .la and .pc files.
- target.path = $$[QT_INSTALL_LIBS]
@ -20,6 +20,3 @@ index b9e5d35026..9924271042 100644
target.CONFIG += dummy_install
INSTALLS += target
} else {
--
2.25.4

View file

@ -1,16 +0,0 @@
diff --git a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.mm b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.mm
index a367487e..c3aeca1d 100644
--- a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.mm
+++ b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.mm
@@ -49,6 +49,11 @@
// but was only added in the 10.14 SDK, so declare it just in case.
extern "C" CFPropertyListRef CGColorSpaceCopyPropertyList(CGColorSpaceRef space);
+// Introduced in 10.13: http://codeworkshop.net/objc-diff/sdkdiffs/macos/10.13/IOSurface.html
+#if !defined(kIOSurfaceSuccess)
+#define kIOSurfaceSuccess KERN_SUCCESS
+#endif
+
QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcQpaIOSurface, "qt.qpa.backingstore.iosurface");

View file

@ -86,18 +86,6 @@ index 0cf1f31b60d..042319a2aa3 100644
+include(clang-mac.conf)
load(qt_config)
diff --git a/mkspecs/common/macx.conf b/mkspecs/common/macx.conf
index d16b77acb8e..4ba0a8eaa36 100644
--- a/mkspecs/common/macx.conf
+++ b/mkspecs/common/macx.conf
@@ -6,7 +6,6 @@ QMAKE_PLATFORM += macos osx macx
QMAKE_MAC_SDK = macosx
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13
-QMAKE_APPLE_DEVICE_ARCHS = x86_64
# Should be 10.15, but as long as the CI builds with
# older SDKs we have to keep this.
diff --git a/mkspecs/macx-clang/Info.plist.app b/mkspecs/macx-clang-arm64/Info.plist.app
similarity index 100%
rename from mkspecs/macx-clang/Info.plist.app

View file

@ -1,47 +0,0 @@
From f156c35975e7844d2369ec5a6633ee40ec56f17a Mon Sep 17 00:00:00 2001
From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Date: Mon, 7 Dec 2020 12:32:29 -0500
Subject: [PATCH 1/6] Revert "QCocoaDrag - set image only on the first drag
item"
This reverts commit 7ee9bfc158a290776f622f62d0202220c6d159bc.
---
src/plugins/platforms/cocoa/qcocoadrag.mm | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
index 4bd1b129bd..a506126c72 100644
--- a/src/plugins/platforms/cocoa/qcocoadrag.mm
+++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
@@ -217,18 +217,13 @@ bool QCocoaDrag::maybeDragMultipleItems()
// 0. We start from URLs, which can be actually in a list (thus technically
// only ONE item in the pasteboard. The fact it's only one does not help, we are
// still getting an exception because of the number of items/images mismatch ...
- // We only set the image for the first item and nil for the rest, the image already
- // contains a combined picture for all urls we drag.
- auto imageOrNil = dragImage;
for (const auto &qtUrl : qtUrls) {
NSURL *nsUrl = qtUrl.toNSURL();
auto *newItem = [[[NSDraggingItem alloc] initWithPasteboardWriter:nsUrl] autorelease];
const NSRect itemFrame = NSMakeRect(itemLocation.x, itemLocation.y,
dragImage.size.width,
dragImage.size.height);
-
- [newItem setDraggingFrame:itemFrame contents:imageOrNil];
- imageOrNil = nil;
+ [newItem setDraggingFrame:itemFrame contents:dragImage];
[dragItems addObject:newItem];
}
// 1. Repeat for non-url items, if any:
@@ -237,7 +232,7 @@ bool QCocoaDrag::maybeDragMultipleItems()
const NSRect itemFrame = NSMakeRect(itemLocation.x, itemLocation.y,
dragImage.size.width,
dragImage.size.height);
- [newItem setDraggingFrame:itemFrame contents:imageOrNil];
+ [newItem setDraggingFrame:itemFrame contents:dragImage];
[dragItems addObject:newItem];
}
--
2.21.0

View file

@ -1,40 +0,0 @@
From 9aaac67e3c3bf40ef3efc3b07b1655f72c8c54aa Mon Sep 17 00:00:00 2001
From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Date: Mon, 7 Dec 2020 12:32:31 -0500
Subject: [PATCH 2/6] Revert "QCocoaDrag::drag - make sure clipboard is ours
and populated"
This reverts commit 720e2e0c92ca6635c5f05f318770a70cf653c1c7.
---
src/plugins/platforms/cocoa/qcocoadrag.mm | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
index a506126c72..c6ee4323ce 100644
--- a/src/plugins/platforms/cocoa/qcocoadrag.mm
+++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
@@ -131,10 +131,6 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o)
m_drag = o;
m_executed_drop_action = Qt::IgnoreAction;
- QMacPasteboard dragBoard(CFStringRef(NSPasteboardNameDrag), QMacInternalPasteboardMime::MIME_DND);
- m_drag->mimeData()->setData(QLatin1String("application/x-qt-mime-type-name"), QByteArray("dummy"));
- dragBoard.setMimeData(m_drag->mimeData(), QMacPasteboard::LazyRequest);
-
if (maybeDragMultipleItems())
return m_executed_drop_action;
@@ -143,6 +139,10 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o)
NSImage *dragImage = [NSImage imageFromQImage:pm.toImage()];
Q_ASSERT(dragImage);
+ QMacPasteboard dragBoard(CFStringRef(NSPasteboardNameDrag), QMacInternalPasteboardMime::MIME_DND);
+ m_drag->mimeData()->setData(QLatin1String("application/x-qt-mime-type-name"), QByteArray("dummy"));
+ dragBoard.setMimeData(m_drag->mimeData(), QMacPasteboard::LazyRequest);
+
NSPoint event_location = [m_lastEvent locationInWindow];
NSWindow *theWindow = [m_lastEvent window];
Q_ASSERT(theWindow);
--
2.21.0

View file

@ -1,27 +0,0 @@
From d1626c55d10537274c6f365855342a1c619a4c3a Mon Sep 17 00:00:00 2001
From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Date: Mon, 7 Dec 2020 12:32:32 -0500
Subject: [PATCH 3/6] Revert "QCocoaDrag::maybeDragMultipleItems - fix
erroneous size check"
This reverts commit b8a03411784803c07ecc1f769860756d6fdc04cd.
---
src/plugins/platforms/cocoa/qcocoadrag.mm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
index c6ee4323ce..ab6863a432 100644
--- a/src/plugins/platforms/cocoa/qcocoadrag.mm
+++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
@@ -187,7 +187,7 @@ bool QCocoaDrag::maybeDragMultipleItems()
const auto &qtUrls = m_drag->mimeData()->urls();
NSPasteboard *dragBoard = [NSPasteboard pasteboardWithName:NSPasteboardNameDrag];
- if (qtUrls.size() <= 1) {
+ if (int(dragBoard.pasteboardItems.count) == 1 && qtUrls.size() <= 1) {
// Good old -dragImage: works perfectly for this ...
return false;
}
--
2.21.0

View file

@ -1,194 +0,0 @@
From d5c155a9f3ff38e28ac073f6df43175724ebc290 Mon Sep 17 00:00:00 2001
From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Date: Mon, 7 Dec 2020 12:32:34 -0500
Subject: [PATCH 4/6] Revert "QCocoaDrag - avoid using the deprecated API if
possible"
This reverts commit 8481a9fc974a1f1dd44a9f82decb18fe2290689f.
---
src/plugins/platforms/cocoa/qcocoadrag.h | 6 --
src/plugins/platforms/cocoa/qcocoadrag.mm | 90 -------------------
.../platforms/cocoa/qnsview_dragging.mm | 9 +-
3 files changed, 1 insertion(+), 104 deletions(-)
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.h b/src/plugins/platforms/cocoa/qcocoadrag.h
index 975741c270..5a5b985c6e 100644
--- a/src/plugins/platforms/cocoa/qcocoadrag.h
+++ b/src/plugins/platforms/cocoa/qcocoadrag.h
@@ -48,8 +48,6 @@
#include <QtGui/private/qdnd_p.h>
#include <QtGui/private/qinternalmimedata_p.h>
-#include <QtCore/qeventloop.h>
-
QT_BEGIN_NAMESPACE
class QCocoaDrag : public QPlatformDrag
@@ -71,15 +69,11 @@ public:
void setLastMouseEvent(NSEvent *event, NSView *view);
void setAcceptedAction(Qt::DropAction act);
- void exitDragLoop();
private:
QDrag *m_drag;
NSEvent *m_lastEvent;
NSView *m_lastView;
Qt::DropAction m_executed_drop_action;
- QEventLoop internalDragLoop;
-
- bool maybeDragMultipleItems();
QPixmap dragPixmap(QDrag *drag, QPoint &hotSpot) const;
};
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
index ab6863a432..b4a16ab912 100644
--- a/src/plugins/platforms/cocoa/qcocoadrag.mm
+++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
@@ -44,9 +44,6 @@
#include <QtWidgets/qwidget.h>
#endif
#include <QtGui/private/qcoregraphics_p.h>
-#include <QtCore/qsysinfo.h>
-
-#include <vector>
QT_BEGIN_NAMESPACE
@@ -131,9 +128,6 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o)
m_drag = o;
m_executed_drop_action = Qt::IgnoreAction;
- if (maybeDragMultipleItems())
- return m_executed_drop_action;
-
QPoint hotSpot = m_drag->hotSpot();
QPixmap pm = dragPixmap(m_drag, hotSpot);
NSImage *dragImage = [NSImage imageFromQImage:pm.toImage()];
@@ -164,95 +158,11 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o)
return m_executed_drop_action;
}
-bool QCocoaDrag::maybeDragMultipleItems()
-{
- Q_ASSERT(m_drag && m_drag->mimeData());
- Q_ASSERT(m_executed_drop_action == Qt::IgnoreAction);
-
- if (QOperatingSystemVersion::current() < QOperatingSystemVersion::MacOSMojave) {
- // -dragImage: stopped working in 10.14 first.
- return false;
- }
-
- const QMacAutoReleasePool pool;
-
- NSWindow *theWindow = [m_lastEvent window];
- Q_ASSERT(theWindow);
-
- if (![theWindow.contentView respondsToSelector:@selector(draggingSession:sourceOperationMaskForDraggingContext:)])
- return false;
-
- auto *sourceView = static_cast<NSView<NSDraggingSource>*>(theWindow.contentView);
-
- const auto &qtUrls = m_drag->mimeData()->urls();
- NSPasteboard *dragBoard = [NSPasteboard pasteboardWithName:NSPasteboardNameDrag];
-
- if (int(dragBoard.pasteboardItems.count) == 1 && qtUrls.size() <= 1) {
- // Good old -dragImage: works perfectly for this ...
- return false;
- }
-
- std::vector<NSPasteboardItem *> nonUrls;
- for (NSPasteboardItem *item in dragBoard.pasteboardItems) {
- bool isUrl = false;
- for (NSPasteboardType type in item.types) {
- using NSStringRef = NSString *;
- if ([type isEqualToString:NSStringRef(kUTTypeFileURL)]) {
- isUrl = true;
- break;
- }
- }
-
- if (!isUrl)
- nonUrls.push_back(item);
- }
-
- QPoint hotSpot = m_drag->hotSpot();
- const auto pixmap = dragPixmap(m_drag, hotSpot);
- NSImage *dragImage = [NSImage imageFromQImage:pixmap.toImage()];
- Q_ASSERT(dragImage);
-
- NSMutableArray<NSDraggingItem *> *dragItems = [[[NSMutableArray alloc] init] autorelease];
- const NSPoint itemLocation = m_drag->hotSpot().toCGPoint();
- // 0. We start from URLs, which can be actually in a list (thus technically
- // only ONE item in the pasteboard. The fact it's only one does not help, we are
- // still getting an exception because of the number of items/images mismatch ...
- for (const auto &qtUrl : qtUrls) {
- NSURL *nsUrl = qtUrl.toNSURL();
- auto *newItem = [[[NSDraggingItem alloc] initWithPasteboardWriter:nsUrl] autorelease];
- const NSRect itemFrame = NSMakeRect(itemLocation.x, itemLocation.y,
- dragImage.size.width,
- dragImage.size.height);
- [newItem setDraggingFrame:itemFrame contents:dragImage];
- [dragItems addObject:newItem];
- }
- // 1. Repeat for non-url items, if any:
- for (auto *pbItem : nonUrls) {
- auto *newItem = [[[NSDraggingItem alloc] initWithPasteboardWriter:pbItem] autorelease];
- const NSRect itemFrame = NSMakeRect(itemLocation.x, itemLocation.y,
- dragImage.size.width,
- dragImage.size.height);
- [newItem setDraggingFrame:itemFrame contents:dragImage];
- [dragItems addObject:newItem];
- }
-
- [sourceView beginDraggingSessionWithItems:dragItems event:m_lastEvent source:sourceView];
- internalDragLoop.exec();
- return true;
-}
-
void QCocoaDrag::setAcceptedAction(Qt::DropAction act)
{
m_executed_drop_action = act;
}
-void QCocoaDrag::exitDragLoop()
-{
- if (internalDragLoop.isRunning())
- internalDragLoop.exit();
-}
-
-
QPixmap QCocoaDrag::dragPixmap(QDrag *drag, QPoint &hotSpot) const
{
const QMimeData* data = drag->mimeData();
diff --git a/src/plugins/platforms/cocoa/qnsview_dragging.mm b/src/plugins/platforms/cocoa/qnsview_dragging.mm
index 978d73f7d9..463e3c5579 100644
--- a/src/plugins/platforms/cocoa/qnsview_dragging.mm
+++ b/src/plugins/platforms/cocoa/qnsview_dragging.mm
@@ -232,10 +232,6 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
if (!target)
return;
- auto *nativeDrag = QCocoaIntegration::instance()->drag();
- Q_ASSERT(nativeDrag);
- nativeDrag->exitDragLoop();
-
QPoint windowPoint = QPointF::fromCGPoint([self convertPoint:sender.draggingLocation fromView:nil]).toPoint();
qCDebug(lcQpaMouse) << QEvent::DragLeave << self << "at" << windowPoint;
@@ -294,12 +294,7 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
if (!target)
return;
- QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag();
- Q_ASSERT(nativeDrag);
- nativeDrag->exitDragLoop();
- // for internal drag'n'drop, don't override the action the drop event accepted
- if (!nativeDrag->currentDrag())
- nativeDrag->setAcceptedAction(qt_mac_mapNSDragOperation(operation));
+ QCocoaIntegration::instance()->drag();
// Qt starts drag-and-drop on a mouse button press event. Cococa in
// this case won't send the matching release event, so we have to
--
2.21.0

View file

@ -1,26 +0,0 @@
From e55ca5d08b29e67b699dc217abcb65e4a7655f72 Mon Sep 17 00:00:00 2001
From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Date: Mon, 7 Dec 2020 12:32:37 -0500
Subject: [PATCH 5/6] Revert "macOS: Fix use of deprecated NSOffState"
This reverts commit 6a0995525d306a1fa224adcbcb9f0ae1fc7d01bd.
---
src/plugins/styles/mac/qmacstyle_mac.mm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index d1febd81d4..b5e6e60ec0 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -3955,7 +3955,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
pbCell = static_cast<NSPopUpButtonCell *>(pb.cell);
oldPosition = pbCell.arrowPosition;
pbCell.arrowPosition = NSPopUpNoArrow;
- if (pb.state == NSControlStateValueOff) {
+ if (pb.state == NSOffState) {
// NSPopUpButton in this state is smaller.
rAdjusted.origin.x -= 3;
rAdjusted.size.width += 6;
--
2.21.0

View file

@ -1,77 +0,0 @@
From 3ce5e752c66307f905fdf732b102a396d9248fbb Mon Sep 17 00:00:00 2001
From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Date: Mon, 7 Dec 2020 13:22:02 -0500
Subject: [PATCH 6/6] git checkout v5.15.0 --
src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
---
.../cocoa/qcocoacolordialoghelper.mm | 50 +++++++++----------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
index 5ad1f9d7bb..c9fa035d87 100644
--- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
@@ -180,34 +180,34 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
- (void)updateQtColor
{
- // Discard the color space and pass the color components to QColor. This
- // is a good option as long as QColor is color-unmanaged: we preserve the
- // exact RGB value from the color picker, which is predictable. Further,
- // painting with the color will reproduce the same color on-screen, as
- // long as the the same screen is used for selecting the color.
- NSColor *componentColor = [[mColorPanel color] colorUsingType:NSColorTypeComponentBased];
- switch (componentColor.colorSpace.colorSpaceModel)
- {
- case NSColorSpaceModelGray: {
- CGFloat white = 0, alpha = 0;
- [componentColor getWhite:&white alpha:&alpha];
- mQtColor.setRgbF(white, white, white, alpha);
- } break;
- case NSColorSpaceModelRGB: {
- CGFloat red = 0, green = 0, blue = 0, alpha = 0;
- [componentColor getRed:&red green:&green blue:&blue alpha:&alpha];
- mQtColor.setRgbF(red, green, blue, alpha);
- } break;
- case NSColorSpaceModelCMYK: {
+ NSColor *color = [mColorPanel color];
+ NSString *colorSpaceName = [color colorSpaceName];
+ if (colorSpaceName == NSDeviceCMYKColorSpace) {
CGFloat cyan = 0, magenta = 0, yellow = 0, black = 0, alpha = 0;
- [componentColor getCyan:&cyan magenta:&magenta yellow:&yellow black:&black alpha:&alpha];
+ [color getCyan:&cyan magenta:&magenta yellow:&yellow black:&black alpha:&alpha];
mQtColor.setCmykF(cyan, magenta, yellow, black, alpha);
- } break;
- default:
- qWarning("QNSColorPanelDelegate: Unsupported color space model");
- break;
+ } else if (colorSpaceName == NSCalibratedRGBColorSpace || colorSpaceName == NSDeviceRGBColorSpace) {
+ CGFloat red = 0, green = 0, blue = 0, alpha = 0;
+ [color getRed:&red green:&green blue:&blue alpha:&alpha];
+ mQtColor.setRgbF(red, green, blue, alpha);
+ } else if (colorSpaceName == NSNamedColorSpace) {
+ NSColor *tmpColor = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
+ CGFloat red = 0, green = 0, blue = 0, alpha = 0;
+ [tmpColor getRed:&red green:&green blue:&blue alpha:&alpha];
+ mQtColor.setRgbF(red, green, blue, alpha);
+ } else {
+ NSColorSpace *colorSpace = [color colorSpace];
+ if ([colorSpace colorSpaceModel] == NSCMYKColorSpaceModel && [color numberOfComponents] == 5){
+ CGFloat components[5];
+ [color getComponents:components];
+ mQtColor.setCmykF(components[0], components[1], components[2], components[3], components[4]);
+ } else {
+ NSColor *tmpColor = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
+ CGFloat red = 0, green = 0, blue = 0, alpha = 0;
+ [tmpColor getRed:&red green:&green blue:&blue alpha:&alpha];
+ mQtColor.setRgbF(red, green, blue, alpha);
+ }
}
-
if (mHelper)
emit mHelper->currentColorChanged(mQtColor);
}
--
2.21.0

View file

@ -1,77 +0,0 @@
diff --git a/mkspecs/common/macx.conf b/mkspecs/common/macx.conf
--- a/mkspecs/common/macx.conf
+++ b/mkspecs/common/macx.conf
@@ -10,7 +10,7 @@ QMAKE_APPLE_DEVICE_ARCHS = x86_64
# Should be 10.15, but as long as the CI builds with
# older SDKs we have to keep this.
-QT_MAC_SDK_VERSION_MIN = 10.14
+QT_MAC_SDK_VERSION_MIN = 10.12
QT_MAC_SDK_VERSION_MAX = 10.15
diff --git a/src/corelib/kernel/qcore_mac.mm b/src/corelib/kernel/qcore_mac.mm
--- a/src/corelib/kernel/qcore_mac.mm
+++ b/src/corelib/kernel/qcore_mac.mm
@@ -261,16 +261,10 @@ QMacAutoReleasePool::QMacAutoReleasePool()
#ifdef QT_DEBUG
void *poolFrame = nullptr;
- if (__builtin_available(macOS 10.14, iOS 12.0, tvOS 12.0, watchOS 5.0, *)) {
- void *frame;
- if (backtrace_from_fp(__builtin_frame_address(0), &frame, 1))
- poolFrame = frame;
- } else {
static const int maxFrames = 3;
void *callstack[maxFrames];
if (backtrace(callstack, maxFrames) == maxFrames)
poolFrame = callstack[maxFrames - 1];
- }
if (poolFrame) {
Dl_info info;
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp
--- a/src/gui/rhi/qrhi.cpp
+++ b/src/gui/rhi/qrhi.cpp
@@ -4251,7 +4251,7 @@ QRhi *QRhi::create(Implementation impl, QRhiInitParams *params, Flags flags, QRh
break;
#endif
case Metal:
-#if defined(Q_OS_MACOS) || defined(Q_OS_IOS)
+#if 0
r->d = new QRhiMetal(static_cast<QRhiMetalInitParams *>(params),
static_cast<QRhiMetalNativeHandles *>(importDevice));
break;
diff --git a/src/gui/rhi/rhi.pri b/src/gui/rhi/rhi.pri
--- a/src/gui/rhi/rhi.pri
+++ b/src/gui/rhi/rhi.pri
@@ -43,7 +43,7 @@ win32 {
LIBS += -ld3d11 -ldxgi -ldxguid
}
-macos|ios {
+false {
HEADERS += \
rhi/qrhimetal_p.h \
rhi/qrhimetal_p_p.h
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
--- a/src/plugins/platforms/cocoa/qcocoadrag.mm
+++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
@@ -133,7 +133,7 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o)
NSImage *dragImage = [NSImage imageFromQImage:pm.toImage()];
Q_ASSERT(dragImage);
- QMacPasteboard dragBoard(CFStringRef(NSPasteboardNameDrag), QMacInternalPasteboardMime::MIME_DND);
+ QMacPasteboard dragBoard((CFStringRef) NSDragPboard, QMacInternalPasteboardMime::MIME_DND);
m_drag->mimeData()->setData(QLatin1String("application/x-qt-mime-type-name"), QByteArray("dummy"));
dragBoard.setMimeData(m_drag->mimeData(), QMacPasteboard::LazyRequest);
@@ -144,7 +144,7 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o)
CGFloat flippedY = dragImage.size.height - hotSpot.y();
event_location.y -= flippedY;
NSSize mouseOffset_unused = NSMakeSize(0.0, 0.0);
- NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSPasteboardNameDrag];
+ NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
[theWindow dragImage:dragImage
at:event_location

View file

@ -1,28 +1,3 @@
diff a/configure.pri b/configure.pri
--- a/configure.pri
+++ b/configure.pri
@@ -439,8 +439,6 @@ defineTest(qtwebengine_isWindowsPlatformSupported) {
defineTest(qtwebengine_isMacOsPlatformSupported) {
!qtwebengine_isMinXcodeVersion(10, 0, 0) {
- qtwebengine_platformError("requires at least version 10.0.0, but using Xcode version $${QMAKE_XCODE_VERSION}.")
- return(false)
}
!clang|intel_icc {
qtwebengine_platformError("requires Clang.")
@@ -449,12 +447,6 @@ defineTest(qtwebengine_isMacOsPlatformSupported) {
# We require macOS 10.13 (darwin version 17.0.0) or newer.
darwin_major_version = $$section(QMAKE_HOST.version, ., 0, 0)
lessThan(darwin_major_version, 17) {
- qtwebengine_platformError("requires macOS version 10.13 or newer.")
- return(false)
- }
- !qtwebengine_isMinOSXSDKVersion(10, 13): {
- qtwebengine_platformError("requires a macOS SDK version of 10.13 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
- return(false)
}
return(true)
}
diff a/src/buildtools/config/mac_osx.pri b/src/buildtools/config/mac_osx.pri
--- a/src/buildtools/config/mac_osx.pri
+++ b/src/buildtools/config/mac_osx.pri

View file

@ -118,16 +118,6 @@ qtModule {
"-DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_12"
"-DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_12"
"-Wno-elaborated-enum-base"
#
# Prevent errors like
# /nix/store/xxx-apple-framework-CoreData/Library/Frameworks/CoreData.framework/Headers/NSEntityDescription.h:51:7:
# error: pointer to non-const type 'id' with no explicit ownership
# id** _kvcPropertyAccessors;
#
# TODO remove when new Apple SDK is in
#
"-fno-objc-arc"
];
preConfigure = ''

View file

@ -22503,11 +22503,12 @@ with pkgs;
qt5 = recurseIntoAttrs (makeOverridable
(import ../development/libraries/qt-5/5.15) {
inherit newScope;
inherit lib stdenv fetchurl fetchpatch fetchgit fetchFromGitHub makeSetupHook makeWrapper;
inherit lib fetchurl fetchpatch fetchgit fetchFromGitHub makeSetupHook makeWrapper;
inherit bison cups dconf harfbuzz libGL perl gtk3 python3;
inherit (gst_all_1) gstreamer gst-plugins-base;
inherit darwin;
inherit buildPackages;
stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
});
libsForQt5 = recurseIntoAttrs (import ./qt5-packages.nix {