Merge #210062: Qt5 spring cleaning (darwin-focused)

...into staging-next
This commit is contained in:
Vladimír Čunát 2023-01-13 10:17:59 +01:00
commit d6ad68a561
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA
20 changed files with 130 additions and 699 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
@ -65,18 +55,19 @@ let
qtserialport = [ ./qtserialport.patch ];
qtwebengine = [
(fetchpatch {
url = "https://github.com/archlinux/svntogit-packages/raw/372ae3de526f783bdcb5d51b997fbf511055466a/trunk/qt5-webengine-python3.patch";
url = "https://raw.githubusercontent.com/Homebrew/formula-patches/a6f16c6daea3b5a1f7bc9f175d1645922c131563/qt5/qt5-webengine-python3.patch";
hash = "sha256-rUSDwTucXVP3Obdck7LRTeKZ+JYQSNhQ7+W31uHZ9yM=";
})
(fetchpatch {
url = "https://github.com/archlinux/svntogit-packages/raw/372ae3de526f783bdcb5d51b997fbf511055466a/trunk/qt5-webengine-chromium-python3.patch";
url = "https://raw.githubusercontent.com/Homebrew/formula-patches/7ae178a617d1e0eceb742557e63721af949bd28a/qt5/qt5-webengine-chromium-python3.patch";
stripLen = 1;
extraPrefix = "src/3rdparty/";
hash = "sha256-BODOw1ksPPns2fmMrk6KC5Po513xB0f1ycbsIL9MmHE=";
hash = "sha256-MZGYeMdGzwypfKoSUaa56K3inbcGRx7he/+AFyk5ekA=";
})
] ++ lib.optionals stdenv.isDarwin [
./qtwebengine-darwin-no-platform-check.patch
./qtwebengine-mac-dont-set-dsymutil-path.patch
./qtwebengine-darwin-checks.patch
];
qtwebkit = [
(fetchpatch {
@ -136,9 +127,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 +139,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 +173,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

@ -0,0 +1,29 @@
diff --git a/configure.pri b/configure.pri
index e072961f0..ac0861c01 100644
--- a/configure.pri
+++ b/configure.pri
@@ -442,24 +442,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.")
- return(false)
- }
- # 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)
}

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

@ -9,7 +9,7 @@
, dbus, fontconfig, freetype, glib, harfbuzz, icu, libdrm, libX11, libXcomposite
, libXcursor, libXext, libXi, libXrender, libinput, libjpeg, libpng , libxcb
, libxkbcommon, libxml2, libxslt, openssl, pcre16, pcre2, sqlite, udev, xcbutil
, libxkbcommon, libxml2, libxslt, openssl, pcre2, sqlite, udev, xcbutil
, xcbutilimage, xcbutilkeysyms, xcbutilrenderutil, xcbutilwm , zlib, at-spi2-core
# optional dependencies
@ -27,8 +27,6 @@
}:
let
compareVersion = v: builtins.compareVersions version v;
qmakeCacheName = if compareVersion "5.12.4" < 0 then ".qmake.cache" else ".qmake.stash";
debugSymbols = debug || developerBuild;
in
@ -45,7 +43,7 @@ stdenv.mkDerivation {
# Image formats
libjpeg libpng
(if compareVersion "5.9.0" < 0 then pcre16 else pcre2)
pcre2
] ++ (
if stdenv.isDarwin then [
# TODO: move to buildInputs, this should not be propagated.
@ -116,7 +114,7 @@ stdenv.mkDerivation {
# https://bugs.gentoo.org/803470
sed -i 's/-lpthread/-pthread/' mkspecs/common/linux.conf src/corelib/configure.json
'' + lib.optionalString (compareVersion "5.15.0" >= 0) ''
patchShebangs ./bin
'' + (
if stdenv.isDarwin then ''
@ -146,22 +144,18 @@ stdenv.mkDerivation {
setOutputFlags = false;
preConfigure = ''
export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
${lib.optionalString (compareVersion "5.9.0" < 0) ''
# We need to set LD to CXX or otherwise we get nasty compile errors
export LD=$CXX
''}
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QT_PLUGIN_PREFIX=\"$qtPluginPrefix\""
# paralellize compilation of qtmake, which happens within ./configure
export MAKEFLAGS+=" -j$NIX_BUILD_CORES"
'' + lib.optionalString (compareVersion "5.15.0" >= 0) ''
./bin/syncqt.pl -version $version
'';
postConfigure = ''
qmakeCacheInjectNixOutputs() {
local cache="$1/${qmakeCacheName}"
local cache="$1/.qmake.stash"
echo "qmakeCacheInjectNixOutputs: $cache"
if ! [ -f "$cache" ]; then
echo >&2 "qmakeCacheInjectNixOutputs: WARNING: $cache does not exist"
@ -184,7 +178,7 @@ stdenv.mkDerivation {
NIX_CFLAGS_COMPILE = toString ([
"-Wno-error=sign-compare" # freetype-2.5.4 changed signedness of some struct fields
''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"''
''-D${if compareVersion "5.11.0" >= 0 then "LIBRESOLV_SO" else "NIXPKGS_LIBRESOLV"}="${stdenv.cc.libc.out}/lib/libresolv"''
''-DLIBRESOLV_SO="${stdenv.cc.libc.out}/lib/libresolv"''
''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"''
] ++ lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"''
++ lib.optional stdenv.isLinux "-DUSE_X11"
@ -192,14 +186,10 @@ stdenv.mkDerivation {
# ignore "is only available on macOS 10.12.2 or newer" in obj-c code
"-Wno-error=unguarded-availability"
]
++ lib.optionals ((compareVersion "5.15.0" >= 0) && stdenv.isDarwin) [
# .moc/moc_qprintdialog.cpp:96:31: error: no member named '_q_togglePageSetCombo' in 'QPrintDialogPrivate'
"-DQ_OS_MAC"
] ++ lib.optionals withGtk3 [
++ lib.optionals withGtk3 [
''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"''
''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"''
]
++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC");
] ++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC");
prefixKey = "-prefix ";
@ -233,18 +223,14 @@ stdenv.mkDerivation {
"-L" "${icu.out}/lib"
"-I" "${icu.dev}/include"
"-pch"
] ++ lib.optional debugSymbols "-debug"
++ lib.optionals (compareVersion "5.11.0" < 0) [
"-qml-debug"
] ++ lib.optionals (compareVersion "5.9.0" < 0) [
"-c++11"
"-no-reduce-relocations"
] ++ lib.optionals developerBuild [
]
++ lib.optional debugSymbols "-debug"
++ lib.optionals developerBuild [
"-developer-build"
"-no-warnings-are-errors"
] ++ (if (!stdenv.hostPlatform.isx86_64) then [
"-no-sse2"
] else lib.optionals (compareVersion "5.9.0" >= 0) [
] else [
"-sse2"
"${lib.optionalString (!stdenv.hostPlatform.sse3Support) "-no"}-sse3"
"${lib.optionalString (!stdenv.hostPlatform.ssse3Support) "-no"}-ssse3"
@ -278,7 +264,7 @@ stdenv.mkDerivation {
"-make tools"
''-${lib.optionalString (!buildExamples) "no"}make examples''
''-${lib.optionalString (!buildTests) "no"}make tests''
] ++ lib.optional (compareVersion "5.15.0" < 0) "-v"
]
++ (
if stdenv.isDarwin then [
"-no-fontconfig"
@ -286,9 +272,8 @@ stdenv.mkDerivation {
"-qt-libpng"
"-no-framework"
] else [
"-${lib.optionalString (compareVersion "5.9.0" < 0) "no-"}rpath"
] ++ lib.optional (compareVersion "5.15.0" < 0) "-system-xcb"
++ [
"-rpath"
] ++ [
"-xcb"
"-qpa xcb"
"-L" "${libX11.out}/lib"
@ -303,20 +288,11 @@ stdenv.mkDerivation {
''-${lib.optionalString (cups == null) "no-"}cups''
"-dbus-linked"
"-glib"
] ++ lib.optional (compareVersion "5.15.0" < 0) "-system-libjpeg"
++ [
] ++ [
"-system-libpng"
] ++ lib.optional withGtk3 "-gtk"
++ lib.optional (compareVersion "5.9.0" >= 0) "-inotify"
++ lib.optionals (compareVersion "5.10.0" >= 0) [
# Without these, Qt stops working on kernels < 3.17. See:
# https://github.com/NixOS/nixpkgs/issues/38832
"-no-feature-renameat2"
"-no-feature-getentropy"
] ++ lib.optionals (compareVersion "5.12.1" < 0) [
# use -xkbcommon and -xkbcommon-evdev for versions before 5.12.1
"-system-xkbcommon"
"-xkbcommon-evdev"
++ [
"-inotify"
] ++ lib.optionals (cups != null) [
"-L" "${cups.lib}/lib"
"-I" "${cups.dev}/include"
@ -368,12 +344,6 @@ stdenv.mkDerivation {
license = with licenses; [ fdl13Plus gpl2Plus lgpl21Plus lgpl3Plus ];
maintainers = with maintainers; [ qknight ttuegel periklis bkchr ];
platforms = platforms.unix;
# Qt5 is broken on aarch64-darwin
# the build ends up with the following error:
# error: unknown target CPU 'armv8.3-a+crypto+sha2+aes+crc+fp16+lse+simd+ras+rdm+rcpc'
# note: valid target CPU values are: nocona, core2, penryn, ..., znver1, znver2, x86-64
# it seems the qmake/cmake passes x86_64 as preferred architecture somewhere
broken = stdenv.isDarwin && stdenv.isAarch64 && (compareVersion "5.15.3" < 0);
};
}

View File

@ -11,14 +11,14 @@ qtModule {
# wrapped executables from `wrapQtAppsHook` (see comment in patch for further
# context). Beware: shared among different Qt5 versions.
./qtwayland-app_id.patch
] ++ lib.optional (lib.versionAtLeast qtbase.version "5.15")
# Backport of https://codereview.qt-project.org/c/qt/qtwayland/+/388338
# Pulled from Fedora as they modified it to not apply to KDE as Plasma 5.x
# doesn't behave properly with the patch applied. See the discussion at
# https://invent.kde.org/qt/qt/qtwayland/-/merge_requests/39 for details
# This patch won't apply to versions before 5.15.
(fetchpatch {
url = "https://src.fedoraproject.org/rpms/qt5-qtwayland/raw/46376bb00d4c3dd3db2e82ad7ca5301ce16ea4ab/f/0080-Client-set-constraint-adjustments-for-popups-in-xdg.patch";
sha256 = "sha256-XP+noYCk8fUdA0ItCqMjV7lSXDlNdB7Az9q7NRpupHc=";
});
})
];
}

View File

@ -80,30 +80,21 @@ qtModule {
sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \
src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc
'' + lib.optionalString stdenv.isDarwin (
(if (lib.versionAtLeast qtCompatVersion "5.14") then ''
'' + lib.optionalString stdenv.isDarwin (''
substituteInPlace src/buildtools/config/mac_osx.pri \
--replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"'
'' else ''
substituteInPlace src/core/config/mac_osx.pri \
--replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"'
'')
# Following is required to prevent a build error:
# ninja: error: '/nix/store/z8z04p0ph48w22rqzx7ql67gy8cyvidi-SDKs/MacOSX10.12.sdk/usr/include/mach/exc.defs', needed by 'gen/third_party/crashpad/crashpad/util/mach/excUser.c', missing and no known rule to make it
+ ''
# Following is required to prevent a build error:
# ninja: error: '/nix/store/z8z04p0ph48w22rqzx7ql67gy8cyvidi-SDKs/MacOSX10.12.sdk/usr/include/mach/exc.defs', needed by 'gen/third_party/crashpad/crashpad/util/mach/excUser.c', missing and no known rule to make it
substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/BUILD.gn \
--replace '$sysroot/usr' "${xnu}"
''
# Apple has some secret stuff they don't share with OpenBSM
+ (if (lib.versionAtLeast qtCompatVersion "5.14") then ''
substituteInPlace src/3rdparty/chromium/base/mac/mach_port_rendezvous.cc \
--replace "audit_token_to_pid(request.trailer.msgh_audit)" "request.trailer.msgh_audit.val[5]"
substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/mach/mach_message.cc \
--replace "audit_token_to_pid(audit_trailer->msgh_audit)" "audit_trailer->msgh_audit.val[5]"
'' else ''
substituteInPlace src/3rdparty/chromium/base/mac/mach_port_broker.mm \
--replace "audit_token_to_pid(msg.trailer.msgh_audit)" "msg.trailer.msgh_audit.val[5]"
'')) + postPatch;
# Apple has some secret stuff they don't share with OpenBSM
substituteInPlace src/3rdparty/chromium/base/mac/mach_port_rendezvous.cc \
--replace "audit_token_to_pid(request.trailer.msgh_audit)" "request.trailer.msgh_audit.val[5]"
substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/mach/mach_message.cc \
--replace "audit_token_to_pid(audit_trailer->msgh_audit)" "audit_trailer->msgh_audit.val[5]"
'') + postPatch;
NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [
# with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit
@ -115,19 +106,7 @@ qtModule {
] ++ lib.optionals stdenv.cc.isClang [
"-Wno-elaborated-enum-base"
] ++ lib.optionals stdenv.isDarwin [
"-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 = ''
@ -139,7 +118,7 @@ qtModule {
'';
qmakeFlags = [ "--" "-system-ffmpeg" ]
++ lib.optional (pipewireSupport && (lib.versionAtLeast qtCompatVersion "5.15")) "-webengine-webrtc-pipewire"
++ lib.optional pipewireSupport "-webengine-webrtc-pipewire"
++ lib.optional enableProprietaryCodecs "-proprietary-codecs";
propagatedBuildInputs = [
@ -173,7 +152,7 @@ qtModule {
xorg.xrandr libXScrnSaver libXcursor libXrandr xorg.libpciaccess libXtst
xorg.libXcomposite xorg.libXdamage libdrm xorg.libxkbfile
] ++ lib.optionals (pipewireSupport && (lib.versionAtLeast qtCompatVersion "5.15")) [
] ++ lib.optionals pipewireSupport [
# Pipewire
pipewire_0_2
]
@ -231,7 +210,7 @@ qtModule {
[Paths]
Prefix = ..
EOF
'' + lib.optionalString (lib.versions.majorMinor qtCompatVersion == "5.15") ''
# Fix for out-of-sync QtWebEngine and Qt releases (since 5.15.3)
sed 's/${lib.head (lib.splitString "-" version)} /${qtCompatVersion} /' -i "$out"/lib/cmake/*/*Config.cmake
'';
@ -259,10 +238,5 @@ qtModule {
# This build takes a long time; particularly on slow architectures
timeout = 24 * 3600;
# we are still stuck with MacOS SDK 10.12 on x86_64-darwin
# and qtwebengine 5.14+ requires at least SDK 10.14
# (qtwebengine 5.12 is fine with SDK 10.12)
# on aarch64-darwin we are already at MacOS SDK 11.0
broken = stdenv.isDarwin;
};
}

View File

@ -19,35 +19,21 @@ let
'';
buildInputs = [ perl ];
};
usingAnnulenWebkitFork = lib.versionAtLeast qtbase.version "5.11.0";
in
qtModule {
pname = "qtwebkit";
qtInputs = [ qtbase qtdeclarative qtlocation qtsensors ]
++ lib.optional (stdenv.isDarwin && lib.versionAtLeast qtbase.version "5.9.0") qtmultimedia
++ lib.optional usingAnnulenWebkitFork qtwebchannel;
buildInputs = [ fontconfig libwebp libxml2 libxslt sqlite glib gst_all_1.gstreamer gst_all_1.gst-plugins-base ]
++ lib.optionals stdenv.isDarwin [ ICU OpenGL ]
++ lib.optional usingAnnulenWebkitFork hyphen;
nativeBuildInputs = [
bison flex gdb gperf perl pkg-config python38 ruby
] ++ lib.optional usingAnnulenWebkitFork cmake;
qtInputs = [ qtbase qtdeclarative qtlocation qtsensors qtwebchannel ]
++ lib.optional stdenv.isDarwin qtmultimedia;
buildInputs = [ fontconfig libwebp libxml2 libxslt sqlite glib gst_all_1.gstreamer gst_all_1.gst-plugins-base hyphen ]
++ lib.optionals stdenv.isDarwin [ ICU OpenGL ];
nativeBuildInputs = [ bison flex gdb gperf perl pkg-config python38 ruby cmake ];
cmakeFlags = lib.optionals usingAnnulenWebkitFork ([ "-DPORT=Qt" ]
cmakeFlags = [ "-DPORT=Qt" ]
++ lib.optionals stdenv.isDarwin [
"-DQt5Multimedia_DIR=${lib.getDev qtmultimedia}/lib/cmake/Qt5Multimedia"
"-DQt5MultimediaWidgets_DIR=${lib.getDev qtmultimedia}/lib/cmake/Qt5MultimediaWidgets"
"-DMACOS_FORCE_SYSTEM_XML_LIBRARIES=OFF"
]);
# QtWebKit overrides qmake's default_pre and default_post features,
# so its custom qmake files must be found first at the front of QMAKEPATH.
preConfigure = lib.optionalString (!usingAnnulenWebkitFork) ''
QMAKEPATH="$PWD/Tools/qmake''${QMAKEPATH:+:}$QMAKEPATH"
fixQtBuiltinPaths . '*.pr?'
# Fix hydra's "Log limit exceeded"
export qmakeFlags="$qmakeFlags CONFIG+=silent"
'';
];
NIX_CFLAGS_COMPILE = [
# with gcc7 this warning blows the log over Hydra's limit

View File

@ -58,17 +58,18 @@ let
configd = pkgs.darwin.apple_sdk.frameworks.SystemConfiguration;
IOKit = pkgs.darwin.apple_sdk.frameworks.IOKit;
callPackage = newScope (lib.optionalAttrs stdenv.isDarwin rec {
xcodebuild = pkgs.xcbuild.override {
inherit (pkgs.darwin.apple_sdk_11_0) stdenv;
inherit (pkgs.darwin.apple_sdk_11_0.frameworks) CoreServices CoreGraphics ImageIO;
};
callPackage = newScope (lib.optionalAttrs stdenv.isDarwin rec {
inherit (pkgs.darwin.apple_sdk_11_0) stdenv xcodebuild;
darwin = pkgs.darwin.overrideScope (_: prev: {
inherit (prev.darwin.apple_sdk_11_0) Libsystem LibsystemCross libcharset libunwind objc4 configd IOKit Security;
apple_sdk = prev.darwin.apple_sdk_11_0;
CF = prev.darwin.apple_sdk_11_0.CoreFoundation;
});
xcodebuild = pkgs.xcbuild.override {
inherit (pkgs.darwin.apple_sdk_11_0.frameworks) CoreServices CoreGraphics ImageIO;
inherit stdenv;
};
xcbuild = xcodebuild;
});

View File

@ -21856,8 +21856,9 @@ with pkgs;
mesa = callPackage ../development/libraries/mesa {
llvmPackages = llvmPackages_latest;
inherit (darwin.apple_sdk.frameworks) OpenGL;
inherit (darwin.apple_sdk.libs) Xplugin;
stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
inherit (darwin.apple_sdk_11_0.frameworks) OpenGL;
inherit (darwin.apple_sdk_11_0.libs) Xplugin;
};
mesa_glu = callPackage ../development/libraries/mesa-glu {
@ -22522,11 +22523,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 {