treewide: remove old patches for macOS

These shouldn’t be needed now that we are on macOS 10.12.
This commit is contained in:
Matthew Bauer 2019-02-09 14:00:48 -05:00
parent 5fad67d361
commit 0fe315c9b6
33 changed files with 22 additions and 1198 deletions

View File

@ -153,15 +153,9 @@ stdenv.mkDerivation rec {
]
++ lib.optionals (!isTorBrowserLike) [
"-I${nss.dev}/include/nss"
]
++ lib.optional stdenv.isDarwin [
"-isystem ${llvmPackages.libcxx}/include/c++/v1"
"-DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_10"
];
postPatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace js/src/jsmath.cpp --replace 'defined(HAVE___SINCOS)' 0
'' + lib.optionalString (lib.versionAtLeast ffversion "63.0" && !isTorBrowserLike) ''
postPatch = lib.optionalString (lib.versionAtLeast ffversion "63.0" && !isTorBrowserLike) ''
substituteInPlace third_party/prio/prio/rand.c --replace 'nspr/prinit.h' 'prinit.h'
'';

View File

@ -1,74 +0,0 @@
commit f00c7bccf7955b7dfbb4859fd9019e9eb3349f2d
Author: Tobias Mayer <tobim@fastmail.fm>
Date: Wed Feb 13 12:44:17 2019 +0100
Provide clock_gettime for xray on macos < 10.12
diff --git a/lib/xray/xray_basic_logging.cc b/lib/xray/xray_basic_logging.cc
index a46c151af..38aea6932 100644
--- a/lib/xray/xray_basic_logging.cc
+++ b/lib/xray/xray_basic_logging.cc
@@ -36,6 +36,29 @@
#include "xray_tsc.h"
#include "xray_utils.h"
+#if __MACH__
+#include <mach/clock.h>
+#include <mach/mach.h>
+enum clockid_t {
+ CLOCK_MONOTONIC = REALTIME_CLOCK,
+ CLOCK_REALTIME = REALTIME_CLOCK
+};
+
+int clock_gettime(clockid_t clock_id, struct timespec *ts) {
+ if (ts != NULL) {
+ clock_serv_t cclock;
+ mach_timespec_t mts;
+ host_get_clock_service(mach_host_self(), clock_id, &cclock);
+ clock_get_time(cclock, &mts);
+ mach_port_deallocate(mach_task_self(), cclock);
+ ts->tv_sec = mts.tv_sec;
+ ts->tv_nsec = mts.tv_nsec;
+ return 0;
+ }
+ return -1;
+}
+#endif
+
namespace __xray {
SpinMutex LogMutex;
diff --git a/lib/xray/xray_fdr_logging.cc b/lib/xray/xray_fdr_logging.cc
index 4b308b27f..1d044c8fd 100644
--- a/lib/xray/xray_fdr_logging.cc
+++ b/lib/xray/xray_fdr_logging.cc
@@ -38,6 +38,29 @@
#include "xray_tsc.h"
#include "xray_utils.h"
+#if __MACH__
+#include <mach/clock.h>
+#include <mach/mach.h>
+enum clockid_t {
+ CLOCK_MONOTONIC = REALTIME_CLOCK,
+ CLOCK_REALTIME = REALTIME_CLOCK
+};
+
+int clock_gettime(clockid_t clock_id, struct timespec *ts) {
+ if (ts != NULL) {
+ clock_serv_t cclock;
+ mach_timespec_t mts;
+ host_get_clock_service(mach_host_self(), clock_id, &cclock);
+ clock_get_time(cclock, &mts);
+ mach_port_deallocate(mach_task_self(), cclock);
+ ts->tv_sec = mts.tv_sec;
+ ts->tv_nsec = mts.tv_nsec;
+ return 0;
+ }
+ return -1;
+}
+#endif
+
namespace __xray {
atomic_sint32_t LoggingStatus = {XRayLogInitStatus::XRAY_LOG_UNINITIALIZED};

View File

@ -26,9 +26,8 @@ stdenv.mkDerivation rec {
patches = [
./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ./crtbegin-and-end.patch
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin ./compiler-rt-clock_gettime.patch;
] ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ./crtbegin-and-end.patch
++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch;
# TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
# to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra

View File

@ -14,17 +14,12 @@ stdenv.mkDerivation rec {
buildInputs = [ libpthreadstubs libpciaccess valgrind-light ];
# libdrm as of 2.4.70 does not actually do anything with udev.
patches = stdenv.lib.optional stdenv.isDarwin ./libdrm-apple.patch;
postPatch = ''
for a in */*-symbol-check ; do
patchShebangs $a
done
'';
preConfigure = stdenv.lib.optionalString stdenv.isDarwin
"echo : \\\${ac_cv_func_clock_gettime=\'yes\'} > config.cache";
configureFlags = [ "--enable-install-test-programs" ]
++ stdenv.lib.optionals (stdenv.isAarch32 || stdenv.isAarch64)
[ "--enable-tegra-experimental-api" "--enable-etnaviv-experimental-api" ]

View File

@ -1,88 +0,0 @@
diff -Naur libdrm-2.4.26-orig/intel/intel_bufmgr_gem.c libdrm-2.4.26/intel/intel_bufmgr_gem.c
--- libdrm-2.4.26-orig/intel/intel_bufmgr_gem.c 2011-04-01 10:30:51.000000000 -0400
+++ libdrm-2.4.26/intel/intel_bufmgr_gem.c 2011-08-29 02:17:20.000000000 -0400
@@ -51,6 +51,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <stdbool.h>
+#include <sys/time.h>
#include "errno.h"
#include "libdrm_lists.h"
@@ -987,9 +988,9 @@
if (atomic_dec_and_test(&bo_gem->refcount)) {
drm_intel_bufmgr_gem *bufmgr_gem =
(drm_intel_bufmgr_gem *) bo->bufmgr;
- struct timespec time;
+ struct timeval time;
- clock_gettime(CLOCK_MONOTONIC, &time);
+ gettimeofday(&time, NULL);
pthread_mutex_lock(&bufmgr_gem->lock);
drm_intel_gem_bo_unreference_final(bo, time.tv_sec);
diff -Naur libdrm-2.4.26-orig/xf86drm.c libdrm-2.4.26/xf86drm.c
--- libdrm-2.4.26-orig/xf86drm.c 2011-03-21 09:39:24.000000000 -0400
+++ libdrm-2.4.26/xf86drm.c 2011-08-29 02:17:49.000000000 -0400
@@ -51,6 +51,9 @@
#include <sys/mman.h>
#include <sys/time.h>
#include <stdarg.h>
+#if defined(__APPLE__) && defined(__MACH__)
+#include <mach/mach_time.h>
+#endif
/* Not all systems have MAP_FAILED defined */
#ifndef MAP_FAILED
@@ -1941,20 +1944,43 @@
*/
int drmWaitVBlank(int fd, drmVBlankPtr vbl)
{
+#if defined(__APPLE__) && defined(__MACH__)
+ uint64_t start, end, elapsed, elapsedNano;
+ static const uint64_t maxElapsed = 2000000000;
+ static mach_timebase_info_data_t timebaseInfo;
+ if ( timebaseInfo.denom == 0 ) {
+ (void) mach_timebase_info(&timebaseInfo);
+ }
+#else
struct timespec timeout, cur;
+#endif
int ret;
+#if defined(__APPLE__) && defined(__MACH__)
+ start = mach_absolute_time();
+#else
ret = clock_gettime(CLOCK_MONOTONIC, &timeout);
if (ret < 0) {
fprintf(stderr, "clock_gettime failed: %s\n", strerror(ret));
goto out;
}
timeout.tv_sec++;
+#endif
do {
ret = ioctl(fd, DRM_IOCTL_WAIT_VBLANK, vbl);
vbl->request.type &= ~DRM_VBLANK_RELATIVE;
if (ret && errno == EINTR) {
+#if defined(__APPLE__) && defined(__MACH__)
+ end = mach_absolute_time();
+ elapsed = end - start;
+ elapsedNano = elapsed * timebaseInfo.numer / timebaseInfo.denom;
+ if (elapsedNano > maxElapsed) {
+ errno = EBUSY;
+ ret = -1;
+ break;
+ }
+#else
clock_gettime(CLOCK_MONOTONIC, &cur);
/* Timeout after 1s */
if (cur.tv_sec > timeout.tv_sec + 1 ||
@@ -1964,6 +1990,7 @@
ret = -1;
break;
}
+#endif
}
} while (ret && errno == EINTR);

View File

@ -1,41 +0,0 @@
Adapted from https://github.com/zcash/libsnark/pull/10
diff --git a/depends/libff/libff/common/profiling.cpp b/depends/libff/libff/common/profiling.cpp
index f2a1985..319149c 100755
--- a/depends/libff/libff/common/profiling.cpp
+++ b/depends/libff/libff/common/profiling.cpp
@@ -27,6 +27,13 @@
#include <proc/readproc.h>
#endif
+#ifdef __MACH__
+#include <time.h>
+#include <sys/time.h>
+#include <mach/clock.h>
+#include <mach/mach.h>
+#endif
+
namespace libff {
long long get_nsec_time()
@@ -42,10 +49,20 @@ long long get_nsec_cpu_time()
return 0;
#else
::timespec ts;
+#ifdef __MACH__
+ clock_serv_t cclock;
+ mach_timespec_t mts;
+ host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
+ clock_get_time(cclock, &mts);
+ mach_port_deallocate(mach_task_self(), cclock);
+ ts.tv_sec = mts.tv_sec;
+ ts.tv_nsec = mts.tv_nsec;
+#else
if ( ::clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) )
throw ::std::runtime_error("clock_gettime(CLOCK_PROCESS_CPUTIME_ID) failed");
// If we expected this to work, don't silently ignore failures, because that would hide the problem and incur an unnecessarily system-call overhead. So if we ever observe this exception, we should probably add a suitable #ifdef .
//TODO: clock_gettime(CLOCK_PROCESS_CPUTIME_ID) is not supported by native Windows. What about Cygwin? Should we #ifdef on CLOCK_PROCESS_CPUTIME_ID or on __linux__?
+#endif
return ts.tv_sec * 1000000000ll + ts.tv_nsec;
#endif
}

View File

@ -19,8 +19,6 @@ in stdenv.mkDerivation rec {
fetchSubmodules = true;
};
patches = [ ./darwin-fix-clock-gettime.patch ];
enableParallelBuilding = true;
meta = with stdenv.lib; {

View File

@ -1,76 +0,0 @@
diff --git a/include/c11/threads_posix.h b/include/c11/threads_posix.h
index 45cb6075e6..62937311b9 100644
--- a/include/c11/threads_posix.h
+++ b/include/c11/threads_posix.h
@@ -36,6 +36,11 @@
#include <sched.h>
#include <stdint.h> /* for intptr_t */
+#ifdef __MACH__
+#include <mach/clock.h>
+#include <mach/mach.h>
+#endif
+
/*
Configuration macro:
@@ -383,12 +388,25 @@ tss_set(tss_t key, void *val)
/*-------------------- 7.25.7 Time functions --------------------*/
// 7.25.6.1
#ifndef HAVE_TIMESPEC_GET
+
static inline int
timespec_get(struct timespec *ts, int base)
{
if (!ts) return 0;
if (base == TIME_UTC) {
+#ifdef __MACH__
+ if (ts != NULL) {
+ clock_serv_t cclock;
+ mach_timespec_t mts;
+ host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
+ clock_get_time(cclock, &mts);
+ mach_port_deallocate(mach_task_self(), cclock);
+ ts->tv_sec = mts.tv_sec;
+ ts->tv_nsec = mts.tv_nsec;
+ }
+#else
clock_gettime(CLOCK_REALTIME, ts);
+#endif
return base;
}
return 0;
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 1208ebb315..e1378fb1f0 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -65,6 +65,11 @@
#include "util/u_vector.h"
#include "mapi/glapi/glapi.h"
+#ifdef __MACH__
+#include <mach/clock.h>
+#include <mach/mach.h>
+#endif
+
#define NUM_ATTRIBS 12
static void
@@ -3092,7 +3097,17 @@ dri2_client_wait_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
/* We override the clock to monotonic when creating the condition
* variable. */
+#ifdef __MACH__
+ clock_serv_t cclock;
+ mach_timespec_t mts;
+ host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
+ clock_get_time(cclock, &mts);
+ mach_port_deallocate(mach_task_self(), cclock);
+ current.tv_sec = mts.tv_sec;
+ current.tv_nsec = mts.tv_nsec;
+#else
clock_gettime(CLOCK_MONOTONIC, &current);
+#endif
/* calculating when to expire */
expire.tv_nsec = timeout % 1000000000L;

View File

@ -93,7 +93,7 @@ let self = stdenv.mkDerivation {
./symlink-drivers.patch
./missing-includes.patch # dev_t needs sys/stat.h, time_t needs time.h, etc.-- fixes build w/musl
./disk_cache-include-dri-driver-path-in-cache-key.patch
] ++ lib.optional stdenv.isDarwin ./darwin-clock-gettime.patch;
];
outputs = [ "out" "dev" "drivers" ]
++ lib.optional (elem "swrast" galliumDrivers) "osmesa";

View File

@ -51,29 +51,17 @@ let
patches = {
qtbase = [
./qtbase.patch
./qtbase-darwin.patch
./qtbase-revert-no-macos10.10.patch
./qtbase-fixguicmake.patch
] ++ optionals stdenv.isDarwin [
./qtbase-darwin-nseventtype.patch
./qtbase-darwin-revert-69221.patch
];
qtdeclarative = [ ./qtdeclarative.patch ];
qtscript = [ ./qtscript.patch ];
qtserialport = [ ./qtserialport.patch ];
qttools = [ ./qttools.patch ];
qtwebengine = [ ./qtwebengine-no-build-skip.patch ]
++ optional stdenv.cc.isClang ./qtwebengine-clang-fix.patch
++ optionals stdenv.isDarwin [
qtwebengine = [
./qtwebengine-no-build-skip.patch
./qtwebengine-darwin-no-platform-check.patch
./qtwebengine-darwin-sdk-10.10.patch
./qtwebengine-darwin-old-sdk.patch
];
qtwebkit = [ ./qtwebkit.patch ]
++ optionals stdenv.isDarwin [
./qtwebkit-darwin-no-readline.patch
./qtwebkit-darwin-no-qos-classes.patch
];
qtwebkit = [ ./qtwebkit.patch ];
};
mkDerivation =

View File

@ -1,13 +0,0 @@
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -404,8 +404,8 @@ void QCocoaWindow::setVisible(bool visible)
removeMonitor();
monitor = [NSEvent addGlobalMonitorForEventsMatchingMask:NSLeftMouseDownMask|NSRightMouseDownMask|NSOtherMouseDownMask|NSMouseMovedMask handler:^(NSEvent *e) {
QPointF localPoint = QCocoaScreen::mapFromNative([NSEvent mouseLocation]);
- const auto button = e.type == NSEventTypeMouseMoved ? Qt::NoButton : cocoaButton2QtButton([e buttonNumber]);
- const auto eventType = e.type == NSEventTypeMouseMoved ? QEvent::MouseMove : QEvent::MouseButtonPress;
+ const auto button = e.type == NSMouseMoved ? Qt::NoButton : cocoaButton2QtButton([e buttonNumber]);
+ const auto eventType = e.type == NSMouseMoved ? QEvent::MouseMove : QEvent::MouseButtonPress;
QWindowSystemInterface::handleMouseEvent(window(), window()->mapFromGlobal(localPoint.toPoint()), localPoint,
Qt::MouseButtons(uint(NSEvent.pressedMouseButtons & 0xFFFF)), button, eventType);
}];

View File

@ -1,73 +0,0 @@
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 00c3f7c22c..94d35f59d6 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -1355,15 +1355,6 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)
{
QMacAutoReleasePool pool;
- Qt::WindowType type = window()->type();
- Qt::WindowFlags flags = window()->flags();
-
- // Note: The macOS window manager has a bug, where if a screen is rotated, it will not allow
- // a window to be created within the area of the screen that has a Y coordinate (I quadrant)
- // higher than the height of the screen in its non-rotated state, unless the window is
- // created with the NSWindowStyleMaskBorderless style mask.
- NSWindowStyleMask styleMask = windowStyleMask(flags);
-
QRect rect = geometry();
QScreen *targetScreen = nullptr;
@@ -1375,22 +1366,26 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)
}
if (!targetScreen) {
- qCWarning(lcQpaCocoaWindow) << "Window position" << rect << "outside any known screen, using primary screen";
+ qCWarning(lcQpaCocoaWindow) << "Window position outside any known screen, using primary screen";
targetScreen = QGuiApplication::primaryScreen();
- // AppKit will only reposition a window that's outside the target screen area if
- // the window has a title bar. If left out, the window ends up with no screen.
- // The style mask will be corrected to the original style mask in setWindowFlags.
- styleMask |= NSWindowStyleMaskTitled;
}
rect.translate(-targetScreen->geometry().topLeft());
QCocoaScreen *cocoaScreen = static_cast<QCocoaScreen *>(targetScreen->handle());
NSRect frame = QCocoaScreen::mapToNative(rect, cocoaScreen);
+ // Note: The macOS window manager has a bug, where if a screen is rotated, it will not allow
+ // a window to be created within the area of the screen that has a Y coordinate (I quadrant)
+ // higher than the height of the screen in its non-rotated state, unless the window is
+ // created with the NSWindowStyleMaskBorderless style mask.
+
+ Qt::WindowType type = window()->type();
+ Qt::WindowFlags flags = window()->flags();
+
// Create NSWindow
Class windowClass = shouldBePanel ? [QNSPanel class] : [QNSWindow class];
QCocoaNSWindow *nsWindow = [[windowClass alloc] initWithContentRect:frame
- styleMask:styleMask
+ styleMask:windowStyleMask(flags)
// Deferring window creation breaks OpenGL (the GL context is
// set up before the window is shown and needs a proper window)
backing:NSBackingStoreBuffered defer:NO
@@ -1399,9 +1394,6 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)
Q_ASSERT_X(nsWindow.screen == cocoaScreen->nativeScreen(), "QCocoaWindow",
"Resulting NSScreen should match the requested NSScreen");
- if (targetScreen != window()->screen())
- QWindowSystemInterface::handleWindowScreenChanged(window(), targetScreen);
-
nsWindow.delegate = [[QNSWindowDelegate alloc] initWithQCocoaWindow:this];
// Prevent Cocoa from releasing the window on close. Qt
@@ -1421,6 +1413,9 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)
});
}
+ if (targetScreen != window()->screen())
+ QWindowSystemInterface::handleWindowScreenChanged(window(), targetScreen);
+
nsWindow.restorable = NO;
nsWindow.level = windowLevel(flags);

View File

@ -1,70 +0,0 @@
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
index 341d3bccf2..3368234c26 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
+++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm
@@ -287,7 +287,7 @@ void QScanThread::getUserConfigurations()
QMacAutoReleasePool pool;
userProfiles.clear();
- NSArray<NSString *> *wifiInterfaces = [CWWiFiClient interfaceNames];
+ NSArray *wifiInterfaces = [CWWiFiClient interfaceNames];
for (NSString *ifName in wifiInterfaces) {
CWInterface *wifiInterface = [[CWWiFiClient sharedWiFiClient] interfaceWithName:ifName];
@@ -602,7 +602,7 @@ void QCoreWlanEngine::doRequestUpdate()
QMacAutoReleasePool pool;
- NSArray<NSString *> *wifiInterfaces = [CWWiFiClient interfaceNames];
+ NSArray *wifiInterfaces = [CWWiFiClient interfaceNames];
for (NSString *ifName in wifiInterfaces) {
scanThread->interfaceName = QString::fromNSString(ifName);
scanThread->start();
diff --git a/src/plugins/platforms/cocoa/qcocoascreen.mm b/src/plugins/platforms/cocoa/qcocoascreen.mm
index a17a02b629..d76c42fa03 100644
--- a/src/plugins/platforms/cocoa/qcocoascreen.mm
+++ b/src/plugins/platforms/cocoa/qcocoascreen.mm
@@ -114,7 +114,7 @@ void QCocoaScreen::updateGeometry()
return;
// The reference screen for the geometry is always the primary screen
- QRectF primaryScreenGeometry = QRectF::fromCGRect([[NSScreen screens] firstObject].frame);
+ QRectF primaryScreenGeometry = QRectF::fromCGRect([[[NSScreen screens] firstObject] frame]);
m_geometry = qt_mac_flip(QRectF::fromCGRect(nsScreen.frame), primaryScreenGeometry).toRect();
m_availableGeometry = qt_mac_flip(QRectF::fromCGRect(nsScreen.visibleFrame), primaryScreenGeometry).toRect();
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 72f3bc0075..a9c058a850 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -1676,7 +1676,7 @@ void QCocoaWindow::applyContentBorderThickness(NSWindow *window)
if (!m_drawContentBorderGradient) {
window.styleMask = window.styleMask & ~NSTexturedBackgroundWindowMask;
- [window.contentView.superview setNeedsDisplay:YES];
+ [[window.contentView superview] setNeedsDisplay:YES];
window.titlebarAppearsTransparent = NO;
return;
}
diff --git a/src/plugins/platforms/cocoa/qnswindow.mm b/src/plugins/platforms/cocoa/qnswindow.mm
index cb13b7d184..0159d68dca 100644
--- a/src/plugins/platforms/cocoa/qnswindow.mm
+++ b/src/plugins/platforms/cocoa/qnswindow.mm
@@ -231,7 +231,7 @@ static bool isMouseEvent(NSEvent *ev)
if (pw->frameStrutEventsEnabled() && isMouseEvent(theEvent)) {
NSPoint loc = [theEvent locationInWindow];
NSRect windowFrame = [self convertRectFromScreen:self.frame];
- NSRect contentFrame = self.contentView.frame;
+ NSRect contentFrame = [self.contentView frame];
if (NSMouseInRect(loc, windowFrame, NO) && !NSMouseInRect(loc, contentFrame, NO))
[qnsview_cast(pw->view()) handleFrameStrutMouseEvent:theEvent];
}
@@ -260,7 +260,7 @@ static bool isMouseEvent(NSEvent *ev)
+ (void)applicationActivationChanged:(NSNotification*)notification
{
const id sender = self;
- NSEnumerator<NSWindow*> *windowEnumerator = nullptr;
+ NSEnumerator *windowEnumerator = nullptr;
NSApplication *application = [NSApplication sharedApplication];
#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12)

View File

@ -1,102 +0,0 @@
Revert "Remove code paths for macOS < 10.11"
This reverts commit 138a65e0cfa80b13fd018a01e7d8b33341a3cfd3.
From 138a65e0cfa80b13fd018a01e7d8b33341a3cfd3 Mon Sep 17 00:00:00 2001
From: Jake Petroules <jake.petroules@qt.io>
Date: Thu, 8 Feb 2018 11:05:42 -0800
Subject: [PATCH] Remove code paths for macOS < 10.11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Change-Id: I5ae02d88aa3dcd97d1f2ebf6255a68643e5d6daa
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
---
.../fontdatabases/mac/qfontengine_coretext.mm | 16 +++-------------
src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm | 6 +-----
src/plugins/platforms/cocoa/qnswindowdelegate.mm | 16 ----------------
3 files changed, 4 insertions(+), 34 deletions(-)
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index 98b753eff9..489d9cd031 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -47,18 +47,28 @@
#include <cmath>
-#if defined(Q_OS_MACOS)
+#if defined(Q_OS_OSX) && !QT_OSX_DEPLOYMENT_TARGET_BELOW(__MAC_10_11)
#import <AppKit/AppKit.h>
#endif
-#if defined(QT_PLATFORM_UIKIT)
+#if defined(QT_PLATFORM_UIKIT) && !QT_IOS_DEPLOYMENT_TARGET_BELOW(__IPHONE_8_2)
#import <UIKit/UIKit.h>
#endif
// These are available cross platform, exported as kCTFontWeightXXX from CoreText.framework,
// but they are not documented and are not in public headers so are private API and exposed
// only through the NSFontWeightXXX and UIFontWeightXXX aliases in AppKit and UIKit (rdar://26109857)
-#if defined(Q_OS_MACOS)
+#if QT_MAC_DEPLOYMENT_TARGET_BELOW(__MAC_10_11, __IPHONE_8_2)
+#define kCTFontWeightUltraLight -0.8
+#define kCTFontWeightThin -0.6
+#define kCTFontWeightLight -0.4
+#define kCTFontWeightRegular 0
+#define kCTFontWeightMedium 0.23
+#define kCTFontWeightSemibold 0.3
+#define kCTFontWeightBold 0.4
+#define kCTFontWeightHeavy 0.56
+#define kCTFontWeightBlack 0.62
+#elif defined(Q_OS_OSX)
#define kCTFontWeightUltraLight NSFontWeightUltraLight
#define kCTFontWeightThin NSFontWeightThin
#define kCTFontWeightLight NSFontWeightLight
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 94f2125bad..272cd9f3dc 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -162,7 +162,11 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSOpenSavePanelDelegate);
// resetting our mCurrentDir, set the delegate
// here to make sure it gets the correct value.
[mSavePanel setDelegate:self];
- mOpenPanel.accessoryViewDisclosed = YES;
+
+#if QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_11)
+ if (__builtin_available(macOS 10.11, *))
+ mOpenPanel.accessoryViewDisclosed = YES;
+#endif
if (mOptions->isLabelExplicitlySet(QFileDialogOptions::Accept))
[mSavePanel setPrompt:[self strip:options->labelText(QFileDialogOptions::Accept)]];
diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
index 057a4c2943..eb55e50622 100644
--- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm
+++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
@@ -103,6 +103,22 @@ static QRegExp whitespaceRegex = QRegExp(QStringLiteral("\\s*"));
return QCocoaScreen::mapToNative(maximizedFrame);
}
+#if QT_MACOS_DEPLOYMENT_TARGET_BELOW(__MAC_10_11)
+/*
+ AppKit on OS X 10.10 wrongly calls windowWillUseStandardFrame:defaultFrame
+ from -[NSWindow _frameForFullScreenMode] when going into fullscreen, resulting
+ in black bars on top and bottom of the window. By implementing the following
+ method, AppKit will choose that instead, and resolve the right fullscreen
+ geometry.
+*/
+- (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize
+{
+ Q_UNUSED(proposedSize);
+ Q_ASSERT(window == m_cocoaWindow->nativeWindow());
+ return NSSizeFromCGSize(m_cocoaWindow->screen()->geometry().size().toCGSize());
+}
+#endif
+
- (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu
{
Q_UNUSED(window);

View File

@ -1,30 +0,0 @@
Fix a following build error:
In file included from ../../3rdparty/chromium/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm:7:
../../3rdparty/chromium/base/bind.h:59:3: error: static_assert failed "Bound argument |i| of type |Arg| cannot be forwarded as |Unwrapped| to the bound functor, which declares it as |Param|."
static_assert(
^
../../3rdparty/chromium/base/bind.h:91:7: note: in instantiation of template class 'base::internal::AssertConstructible<1, long, long, const long &, NSError *>' requested here
: AssertConstructible<Ns, Args, std::decay_t<Args>, Unwrapped, Params>... {
^
../../3rdparty/chromium/base/bind.h:213:27: note: in instantiation of template class 'base::internal::AssertBindArgsValidity<std::__1::integer_sequence<unsigned long, 0, 1>, base::internal::TypeList<base::WeakPtr<device::BluetoothRemoteGattCharacteristicMac>, long>, base::internal::TypeList<device::BluetoothRemoteGattCharacteristicMac *, const long &>, base::internal::TypeList<device::BluetoothRemoteGattCharacteristicMac *, NSError *> >' requested here
static_assert(internal::AssertBindArgsValidity<
^
../../3rdparty/chromium/base/bind.h:242:16: note: in instantiation of function template specialization 'base::BindRepeating<void (device::BluetoothRemoteGattCharacteristicMac::*)(NSError *), base::WeakPtr<device::BluetoothRemoteGattCharacteristicMac>, long>' requested here
return base::BindRepeating(std::forward<Functor>(functor),
^
../../3rdparty/chromium/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm:211:15: note: in instantiation of function template specialization 'base::Bind<void (device::BluetoothRemoteGattCharacteristicMac::*)(NSError *), base::WeakPtr<device::BluetoothRemoteGattCharacteristicMac>, long>' requested here
base::Bind(&BluetoothRemoteGattCharacteristicMac::DidWriteValue,
^
--- a/src/3rdparty/chromium/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm
+++ b/src/3rdparty/chromium/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm
@@ -209,7 +209,7 @@ void BluetoothRemoteGattCharacteristicMac::WriteRemoteCharacteristic(
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(&BluetoothRemoteGattCharacteristicMac::DidWriteValue,
- weak_ptr_factory_.GetWeakPtr(), nil));
+ weak_ptr_factory_.GetWeakPtr(), nullptr));
}
}

View File

@ -1,21 +0,0 @@
diff --git a/src/3rdparty/chromium/third_party/webrtc/sdk/objc/Framework/Classes/Common/RTCFieldTrials.mm b/src/3rdparty/chromium/third_party/webrtc/sdk/objc/Framework/Classes/Common/RTCFieldTrials.mm
--- a/src/3rdparty/chromium/third_party/webrtc/sdk/objc/Framework/Classes/Common/RTCFieldTrials.mm
+++ b/src/3rdparty/chromium/third_party/webrtc/sdk/objc/Framework/Classes/Common/RTCFieldTrials.mm
@@ -45,7 +45,7 @@ NSString *RTCFieldTrialTrendlineFilterValue(
return [NSString stringWithFormat:format, windowSize, smoothingCoeff, thresholdGain];
}
-void RTCInitFieldTrialDictionary(NSDictionary<NSString *, NSString *> *fieldTrials) {
+void RTCInitFieldTrialDictionary(NSDictionary *fieldTrials) {
if (!fieldTrials) {
RTCLogWarning(@"No fieldTrials provided.");
return;
diff --git a/src/3rdparty/chromium/third_party/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCFieldTrials.h b/src/3rdparty/chromium/third_party/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCFieldTrials.h
--- a/src/3rdparty/chromium/third_party/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCFieldTrials.h
+++ b/src/3rdparty/chromium/third_party/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCFieldTrials.h
@@ -40,4 +40,4 @@ RTC_EXTERN NSString *RTCFieldTrialTrendlineFilterValue(
* Must be called before any other call into WebRTC. See:
* webrtc/system_wrappers/include/field_trial_default.h
*/
-RTC_EXTERN void RTCInitFieldTrialDictionary(NSDictionary<NSString *, NSString *> *fieldTrials);
+RTC_EXTERN void RTCInitFieldTrialDictionary(NSDictionary *fieldTrials);

View File

@ -1,160 +0,0 @@
Fix build against 10.10 SDK
The SecKey part perhaps could be fixed by implementing a revert to
https://chromium.googlesource.com/chromium/src.git/+/8418e098b9cbedf884878b61dcd3292c515845cf%5E%21/#F0
--- a/src/3rdparty/chromium/content/browser/renderer_host/input/web_input_event_builders_mac.mm
+++ b/src/3rdparty/chromium/content/browser/renderer_host/input/web_input_event_builders_mac.mm
@@ -1,3 +1,4 @@
+#define NSEventTypeScrollWheel 22
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
--- a/src/3rdparty/chromium/net/ssl/ssl_platform_key_mac.cc
+++ b/src/3rdparty/chromium/net/ssl/ssl_platform_key_mac.cc
@@ -48,21 +48,6 @@ namespace net {
namespace {
-// TODO(davidben): Remove this when we switch to building to the 10.13
-// SDK. https://crbug.com/780980
-#if !defined(MAC_OS_X_VERSION_10_13) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_13
-API_AVAILABLE(macosx(10.13))
-const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPSSSHA256 =
- CFSTR("algid:sign:RSA:digest-PSS:SHA256:SHA256:32");
-API_AVAILABLE(macosx(10.13))
-const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPSSSHA384 =
- CFSTR("algid:sign:RSA:digest-PSS:SHA384:SHA384:48");
-API_AVAILABLE(macosx(10.13))
-const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPSSSHA512 =
- CFSTR("algid:sign:RSA:digest-PSS:SHA512:SHA512:64");
-#endif
-
class ScopedCSSM_CC_HANDLE {
public:
ScopedCSSM_CC_HANDLE() : handle_(0) {}
@@ -187,109 +172,6 @@ class SSLPlatformKeyCSSM : public ThreadedSSLPrivateKey::Delegate {
DISALLOW_COPY_AND_ASSIGN(SSLPlatformKeyCSSM);
};
-// Returns the corresponding SecKeyAlgorithm or nullptr if unrecognized.
-API_AVAILABLE(macosx(10.12))
-SecKeyAlgorithm GetSecKeyAlgorithm(uint16_t algorithm) {
- switch (algorithm) {
- case SSL_SIGN_RSA_PKCS1_SHA512:
- return kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA512;
- case SSL_SIGN_RSA_PKCS1_SHA384:
- return kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA384;
- case SSL_SIGN_RSA_PKCS1_SHA256:
- return kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA256;
- case SSL_SIGN_RSA_PKCS1_SHA1:
- return kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA1;
- case SSL_SIGN_RSA_PKCS1_MD5_SHA1:
- return kSecKeyAlgorithmRSASignatureDigestPKCS1v15Raw;
- case SSL_SIGN_ECDSA_SECP521R1_SHA512:
- return kSecKeyAlgorithmECDSASignatureDigestX962SHA512;
- case SSL_SIGN_ECDSA_SECP384R1_SHA384:
- return kSecKeyAlgorithmECDSASignatureDigestX962SHA384;
- case SSL_SIGN_ECDSA_SECP256R1_SHA256:
- return kSecKeyAlgorithmECDSASignatureDigestX962SHA256;
- case SSL_SIGN_ECDSA_SHA1:
- return kSecKeyAlgorithmECDSASignatureDigestX962SHA1;
- }
-
- if (base::mac::IsAtLeastOS10_13()) {
- switch (algorithm) {
- case SSL_SIGN_RSA_PSS_SHA512:
- return kSecKeyAlgorithmRSASignatureDigestPSSSHA512;
- case SSL_SIGN_RSA_PSS_SHA384:
- return kSecKeyAlgorithmRSASignatureDigestPSSSHA384;
- case SSL_SIGN_RSA_PSS_SHA256:
- return kSecKeyAlgorithmRSASignatureDigestPSSSHA256;
- }
- }
-
- return nullptr;
-}
-
-class API_AVAILABLE(macosx(10.12)) SSLPlatformKeySecKey
- : public ThreadedSSLPrivateKey::Delegate {
- public:
- SSLPlatformKeySecKey(int type, size_t max_length, SecKeyRef key)
- : key_(key, base::scoped_policy::RETAIN) {
- // Determine the algorithms supported by the key.
- for (uint16_t algorithm : SSLPrivateKey::DefaultAlgorithmPreferences(
- type, true /* include PSS */)) {
- SecKeyAlgorithm sec_algorithm = GetSecKeyAlgorithm(algorithm);
- if (sec_algorithm &&
- SecKeyIsAlgorithmSupported(key_.get(), kSecKeyOperationTypeSign,
- sec_algorithm)) {
- preferences_.push_back(algorithm);
- }
- }
- }
-
- ~SSLPlatformKeySecKey() override {}
-
- std::vector<uint16_t> GetAlgorithmPreferences() override {
- return preferences_;
- }
-
- Error Sign(uint16_t algorithm,
- base::span<const uint8_t> input,
- std::vector<uint8_t>* signature) override {
- SecKeyAlgorithm sec_algorithm = GetSecKeyAlgorithm(algorithm);
- if (!sec_algorithm) {
- NOTREACHED();
- return ERR_FAILED;
- }
-
- const EVP_MD* md = SSL_get_signature_algorithm_digest(algorithm);
- uint8_t digest[EVP_MAX_MD_SIZE];
- unsigned digest_len;
- if (!md || !EVP_Digest(input.data(), input.size(), digest, &digest_len, md,
- nullptr)) {
- return ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED;
- }
-
- base::ScopedCFTypeRef<CFDataRef> digest_ref(CFDataCreateWithBytesNoCopy(
- kCFAllocatorDefault, digest, base::checked_cast<CFIndex>(digest_len),
- kCFAllocatorNull));
-
- base::ScopedCFTypeRef<CFErrorRef> error;
- base::ScopedCFTypeRef<CFDataRef> signature_ref(SecKeyCreateSignature(
- key_, sec_algorithm, digest_ref, error.InitializeInto()));
- if (!signature_ref) {
- LOG(ERROR) << error;
- return ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED;
- }
-
- signature->assign(
- CFDataGetBytePtr(signature_ref),
- CFDataGetBytePtr(signature_ref) + CFDataGetLength(signature_ref));
- return OK;
- }
-
- private:
- std::vector<uint16_t> preferences_;
- base::ScopedCFTypeRef<SecKeyRef> key_;
-
- DISALLOW_COPY_AND_ASSIGN(SSLPlatformKeySecKey);
-};
-
scoped_refptr<SSLPrivateKey> CreateSSLPrivateKeyForSecKey(
const X509Certificate* certificate,
SecKeyRef private_key) {
@@ -298,13 +180,6 @@ scoped_refptr<SSLPrivateKey> CreateSSLPrivateKeyForSecKey(
if (!GetClientCertInfo(certificate, &key_type, &max_length))
return nullptr;
- if (base::mac::IsAtLeastOS10_12()) {
- return base::MakeRefCounted<ThreadedSSLPrivateKey>(
- std::make_unique<SSLPlatformKeySecKey>(key_type, max_length,
- private_key),
- GetSSLPlatformKeyTaskRunner());
- }
-
const CSSM_KEY* cssm_key;
OSStatus status = SecKeyGetCSSMKey(private_key, &cssm_key);
if (status != noErr) {

View File

@ -1,11 +0,0 @@
diff --git a/Source/cmake/OptionsQt.cmake b/Source/cmake/OptionsQt.cmake
--- a/Source/cmake/OptionsQt.cmake
+++ b/Source/cmake/OptionsQt.cmake
@@ -683,7 +683,6 @@ if (WIN32 AND COMPILER_IS_GCC_OR_CLANG)
endif ()
if (APPLE)
- SET_AND_EXPOSE_TO_BUILD(HAVE_QOS_CLASSES 1)
endif ()
if (ENABLE_MATHML)

View File

@ -1,45 +0,0 @@
diff --git a/Source/JavaScriptCore/shell/CMakeLists.txt b/Source/JavaScriptCore/shell/CMakeLists.txt
--- a/Source/JavaScriptCore/shell/CMakeLists.txt
+++ b/Source/JavaScriptCore/shell/CMakeLists.txt
@@ -9,7 +9,6 @@ set(JSC_LIBRARIES
)
if (WTF_OS_MAC_OS_X)
- list(APPEND JSC_LIBRARIES edit)
endif ()
if ("${JavaScriptCore_LIBRARY_TYPE}" MATCHES "STATIC")
diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
--- a/Source/WTF/wtf/Platform.h
+++ b/Source/WTF/wtf/Platform.h
@@ -563,7 +563,6 @@
#if PLATFORM(IOS)
#define HAVE_NETWORK_EXTENSION 1
-#define HAVE_READLINE 1
#if USE(APPLE_INTERNAL_SDK)
#define USE_CFNETWORK 1
#endif
@@ -650,7 +649,6 @@
#define HAVE_MADV_DONTNEED 1
#define HAVE_MERGESORT 1
#define HAVE_PTHREAD_SETNAME_NP 1
-#define HAVE_READLINE 1
#define HAVE_SYS_TIMEB_H 1
#if !PLATFORM(GTK) && !PLATFORM(QT)
diff --git a/Source/WTF/wtf/PlatformMac.cmake b/Source/WTF/wtf/PlatformMac.cmake
--- a/Source/WTF/wtf/PlatformMac.cmake
+++ b/Source/WTF/wtf/PlatformMac.cmake
@@ -2,11 +2,9 @@ set(WTF_LIBRARY_TYPE SHARED)
find_library(COCOA_LIBRARY Cocoa)
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
-find_library(READLINE_LIBRARY Readline)
list(APPEND WTF_LIBRARIES
${COREFOUNDATION_LIBRARY}
${COCOA_LIBRARY}
- ${READLINE_LIBRARY}
libicucore.dylib
)

View File

@ -51,11 +51,7 @@ let
patches = {
qtbase = [
./qtbase.patch
./qtbase-darwin.patch
./qtbase-revert-no-macos10.10.patch
./qtbase-fixguicmake.patch
] ++ optionals stdenv.isDarwin [
./qtbase-darwin-nseventtype.patch
];
qtdeclarative = [ ./qtdeclarative.patch ];
qtscript = [ ./qtscript.patch ];

View File

@ -1,13 +0,0 @@
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -404,8 +404,8 @@ void QCocoaWindow::setVisible(bool visible)
removeMonitor();
monitor = [NSEvent addGlobalMonitorForEventsMatchingMask:NSLeftMouseDownMask|NSRightMouseDownMask|NSOtherMouseDownMask|NSMouseMovedMask handler:^(NSEvent *e) {
QPointF localPoint = QCocoaScreen::mapFromNative([NSEvent mouseLocation]);
- const auto button = e.type == NSEventTypeMouseMoved ? Qt::NoButton : cocoaButton2QtButton([e buttonNumber]);
- const auto eventType = e.type == NSEventTypeMouseMoved ? QEvent::MouseMove : QEvent::MouseButtonPress;
+ const auto button = e.type == NSMouseMoved ? Qt::NoButton : cocoaButton2QtButton([e buttonNumber]);
+ const auto eventType = e.type == NSMouseMoved ? QEvent::MouseMove : QEvent::MouseButtonPress;
QWindowSystemInterface::handleMouseEvent(window(), window()->mapFromGlobal(localPoint.toPoint()), localPoint,
Qt::MouseButtons(uint(NSEvent.pressedMouseButtons & 0xFFFF)), button, eventType);
}];

View File

@ -1,70 +0,0 @@
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
index c3dd49ff3e..6871399817 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
+++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm
@@ -283,7 +283,7 @@ void QScanThread::getUserConfigurations()
QMacAutoReleasePool pool;
userProfiles.clear();
- NSArray<NSString *> *wifiInterfaces = [CWWiFiClient interfaceNames];
+ NSArray *wifiInterfaces = [CWWiFiClient interfaceNames];
for (NSString *ifName in wifiInterfaces) {
CWInterface *wifiInterface = [[CWWiFiClient sharedWiFiClient] interfaceWithName:ifName];
@@ -598,7 +598,7 @@ void QCoreWlanEngine::doRequestUpdate()
QMacAutoReleasePool pool;
- NSArray<NSString *> *wifiInterfaces = [CWWiFiClient interfaceNames];
+ NSArray *wifiInterfaces = [CWWiFiClient interfaceNames];
for (NSString *ifName in wifiInterfaces) {
scanThread->interfaceName = QString::fromNSString(ifName);
scanThread->start();
diff --git a/src/plugins/platforms/cocoa/qcocoascreen.mm b/src/plugins/platforms/cocoa/qcocoascreen.mm
index afe14e623c..74d69c2fa1 100644
--- a/src/plugins/platforms/cocoa/qcocoascreen.mm
+++ b/src/plugins/platforms/cocoa/qcocoascreen.mm
@@ -127,7 +127,7 @@ void QCocoaScreen::updateProperties()
const qreal previousRefreshRate = m_refreshRate;
// The reference screen for the geometry is always the primary screen
- QRectF primaryScreenGeometry = QRectF::fromCGRect([[NSScreen screens] firstObject].frame);
+ QRectF primaryScreenGeometry = QRectF::fromCGRect([[[NSScreen screens] firstObject] frame]);
m_geometry = qt_mac_flip(QRectF::fromCGRect(nsScreen.frame), primaryScreenGeometry).toRect();
m_availableGeometry = qt_mac_flip(QRectF::fromCGRect(nsScreen.visibleFrame), primaryScreenGeometry).toRect();
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index df1ad82592..0318a4ff96 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -1704,7 +1704,7 @@ void QCocoaWindow::applyContentBorderThickness(NSWindow *window)
if (!m_drawContentBorderGradient) {
window.styleMask = window.styleMask & ~NSWindowStyleMaskTexturedBackground;
- [window.contentView.superview setNeedsDisplay:YES];
+ [[window.contentView superview] setNeedsDisplay:YES];
window.titlebarAppearsTransparent = NO;
return;
}
diff --git a/src/plugins/platforms/cocoa/qnswindow.mm b/src/plugins/platforms/cocoa/qnswindow.mm
index c17ad47aba..a0f1dd38fb 100644
--- a/src/plugins/platforms/cocoa/qnswindow.mm
+++ b/src/plugins/platforms/cocoa/qnswindow.mm
@@ -230,7 +230,7 @@ static bool isMouseEvent(NSEvent *ev)
if (pw->frameStrutEventsEnabled() && isMouseEvent(theEvent)) {
NSPoint loc = [theEvent locationInWindow];
NSRect windowFrame = [self convertRectFromScreen:self.frame];
- NSRect contentFrame = self.contentView.frame;
+ NSRect contentFrame = [self.contentView frame];
if (NSMouseInRect(loc, windowFrame, NO) && !NSMouseInRect(loc, contentFrame, NO))
[qnsview_cast(pw->view()) handleFrameStrutMouseEvent:theEvent];
}
@@ -257,7 +257,7 @@ static bool isMouseEvent(NSEvent *ev)
+ (void)applicationActivationChanged:(NSNotification*)notification
{
const id sender = self;
- NSEnumerator<NSWindow*> *windowEnumerator = nullptr;
+ NSEnumerator *windowEnumerator = nullptr;
NSApplication *application = [NSApplication sharedApplication];
// Unfortunately there's no NSWindowListOrderedBackToFront,

View File

@ -1,102 +0,0 @@
Revert "Remove code paths for macOS < 10.11"
This reverts commit 138a65e0cfa80b13fd018a01e7d8b33341a3cfd3.
From 138a65e0cfa80b13fd018a01e7d8b33341a3cfd3 Mon Sep 17 00:00:00 2001
From: Jake Petroules <jake.petroules@qt.io>
Date: Thu, 8 Feb 2018 11:05:42 -0800
Subject: [PATCH] Remove code paths for macOS < 10.11
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Change-Id: I5ae02d88aa3dcd97d1f2ebf6255a68643e5d6daa
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
---
.../fontdatabases/mac/qfontengine_coretext.mm | 16 +++-------------
src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm | 6 +-----
src/plugins/platforms/cocoa/qnswindowdelegate.mm | 16 ----------------
3 files changed, 4 insertions(+), 34 deletions(-)
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index 98b753eff9..489d9cd031 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -47,18 +47,28 @@
#include <cmath>
-#if defined(Q_OS_MACOS)
+#if defined(Q_OS_OSX) && !QT_OSX_DEPLOYMENT_TARGET_BELOW(__MAC_10_11)
#import <AppKit/AppKit.h>
#endif
-#if defined(QT_PLATFORM_UIKIT)
+#if defined(QT_PLATFORM_UIKIT) && !QT_IOS_DEPLOYMENT_TARGET_BELOW(__IPHONE_8_2)
#import <UIKit/UIKit.h>
#endif
// These are available cross platform, exported as kCTFontWeightXXX from CoreText.framework,
// but they are not documented and are not in public headers so are private API and exposed
// only through the NSFontWeightXXX and UIFontWeightXXX aliases in AppKit and UIKit (rdar://26109857)
-#if defined(Q_OS_MACOS)
+#if QT_MAC_DEPLOYMENT_TARGET_BELOW(__MAC_10_11, __IPHONE_8_2)
+#define kCTFontWeightUltraLight -0.8
+#define kCTFontWeightThin -0.6
+#define kCTFontWeightLight -0.4
+#define kCTFontWeightRegular 0
+#define kCTFontWeightMedium 0.23
+#define kCTFontWeightSemibold 0.3
+#define kCTFontWeightBold 0.4
+#define kCTFontWeightHeavy 0.56
+#define kCTFontWeightBlack 0.62
+#elif defined(Q_OS_OSX)
#define kCTFontWeightUltraLight NSFontWeightUltraLight
#define kCTFontWeightThin NSFontWeightThin
#define kCTFontWeightLight NSFontWeightLight
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 94f2125bad..272cd9f3dc 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -162,7 +162,11 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSOpenSavePanelDelegate);
// resetting our mCurrentDir, set the delegate
// here to make sure it gets the correct value.
[mSavePanel setDelegate:self];
- mOpenPanel.accessoryViewDisclosed = YES;
+
+#if QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_11)
+ if (__builtin_available(macOS 10.11, *))
+ mOpenPanel.accessoryViewDisclosed = YES;
+#endif
if (mOptions->isLabelExplicitlySet(QFileDialogOptions::Accept))
[mSavePanel setPrompt:[self strip:options->labelText(QFileDialogOptions::Accept)]];
diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
index 057a4c2943..eb55e50622 100644
--- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm
+++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
@@ -103,6 +103,22 @@ static QRegExp whitespaceRegex = QRegExp(QStringLiteral("\\s*"));
return QCocoaScreen::mapToNative(maximizedFrame);
}
+#if QT_MACOS_DEPLOYMENT_TARGET_BELOW(__MAC_10_11)
+/*
+ AppKit on OS X 10.10 wrongly calls windowWillUseStandardFrame:defaultFrame
+ from -[NSWindow _frameForFullScreenMode] when going into fullscreen, resulting
+ in black bars on top and bottom of the window. By implementing the following
+ method, AppKit will choose that instead, and resolve the right fullscreen
+ geometry.
+*/
+- (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize
+{
+ Q_UNUSED(proposedSize);
+ Q_ASSERT(window == m_cocoaWindow->nativeWindow());
+ return NSSizeFromCGSize(m_cocoaWindow->screen()->geometry().size().toCGSize());
+}
+#endif
+
- (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu
{
Q_UNUSED(window);

View File

@ -38,7 +38,7 @@ let
srcs = import ./srcs.nix { inherit fetchurl; inherit mirror; };
patches = {
qtbase = [ ./qtbase.patch ./qtbase-fixguicmake.patch ] ++ optional stdenv.isDarwin ./qtbase-darwin.patch;
qtbase = [ ./qtbase.patch ./qtbase-fixguicmake.patch ];
qtdeclarative = [ ./qtdeclarative.patch ];
qtscript = [ ./qtscript.patch ];
qtserialport = [ ./qtserialport.patch ];

View File

@ -1,35 +0,0 @@
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
index 341d3bc..3368234 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
+++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm
@@ -287,7 +287,7 @@ void QScanThread::getUserConfigurations()
QMacAutoReleasePool pool;
userProfiles.clear();
- NSArray<NSString *> *wifiInterfaces = [CWWiFiClient interfaceNames];
+ NSArray *wifiInterfaces = [CWWiFiClient interfaceNames];
for (NSString *ifName in wifiInterfaces) {
CWInterface *wifiInterface = [[CWWiFiClient sharedWiFiClient] interfaceWithName:ifName];
@@ -602,7 +602,7 @@ void QCoreWlanEngine::doRequestUpdate()
QMacAutoReleasePool pool;
- NSArray<NSString *> *wifiInterfaces = [CWWiFiClient interfaceNames];
+ NSArray *wifiInterfaces = [CWWiFiClient interfaceNames];
for (NSString *ifName in wifiInterfaces) {
scanThread->interfaceName = QString::fromNSString(ifName);
scanThread->start();
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 5cd4beb..84919e6 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -320,7 +320,7 @@ static void qt_closePopups()
+ (void)applicationActivationChanged:(NSNotification*)notification
{
const id sender = self;
- NSEnumerator<NSWindow*> *windowEnumerator = nullptr;
+ NSEnumerator *windowEnumerator = nullptr;
NSApplication *application = [NSApplication sharedApplication];
#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12)

View File

@ -2,7 +2,7 @@
stdenv, lib,
src, patches, version, qtCompatVersion,
coreutils, bison, flex, gdb, gperf, lndir, patchelf, perl, pkgconfig, python2,
coreutils, bison, flex, gdb, gperf, lndir, perl, pkgconfig, python2,
which,
# darwin support
darwin, libiconv,
@ -78,17 +78,15 @@ stdenv.mkDerivation {
[ libinput ]
++ lib.optional withGtk3 gtk3
)
++ lib.optional stdenv.isDarwin
# Needed for OBJC_CLASS_$_NSDate symbols.
[ darwin.cf-private ]
++ lib.optional stdenv.isDarwin darwin.cf-private
++ lib.optional developerBuild gdb
++ lib.optional (cups != null) cups
++ lib.optional (mysql != null) mysql.connector-c
++ lib.optional (postgresql != null) postgresql;
nativeBuildInputs =
[ bison flex gperf lndir perl pkgconfig python2 which ]
++ lib.optional (!stdenv.isDarwin) patchelf;
[ bison flex gperf lndir perl pkgconfig python2 which ];
propagatedNativeBuildInputs = [ lndir ];
@ -199,26 +197,11 @@ stdenv.mkDerivation {
''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"''
]
++ (
if stdenv.isDarwin
then
[
"-Wno-missing-sysroot"
"-D__MAC_OS_X_VERSION_MAX_ALLOWED=1090"
"-D__AVAILABILITY_INTERNAL__MAC_10_10=__attribute__((availability(macosx,introduced=10.10)))"
# Note that nixpkgs's objc4 is from macOS 10.11 while the SDK is
# 10.9 which necessitates the above macro definition that mentions
# 10.10
]
else
lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"''
++ lib.optionals withGtk3
[
++ lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"''
++ 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";
prefixKey = "-prefix ";

View File

@ -79,7 +79,7 @@ qtModule {
cat <<EOF > src/3rdparty/chromium/build/mac/find_sdk.py
#!/usr/bin/env python
print("${darwin.apple_sdk.sdk}")
print("10.10.0")
print("10.12.0")
EOF
cat <<EOF > src/3rdparty/chromium/build/config/mac/sdk_info.py
@ -102,22 +102,6 @@ EOF
--replace 'libs = [ "sandbox" ]' 'libs = [ "/usr/lib/libsandbox.1.dylib" ]'
'');
NIX_CFLAGS_COMPILE =
lib.optionalString stdenv.isDarwin [
"-DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_10"
"-DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_10"
#
# 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 = ''
export NINJAFLAGS=-j$NIX_BUILD_CORES

View File

@ -60,7 +60,7 @@ buildPythonPackage rec {
url = "https://github.com/matplotlib/matplotlib/commit/2980184d092382a40ab21f95b79582ffae6e19d6.patch";
sha256 = "1c0wj28zy8s5h6qiavx9zzbhlmhjwpzbc3fyyw9039mbnqk0spg2";
})
] ++ stdenv.lib.optionals stdenv.isDarwin [ ./darwin-stdenv-2.2.3.patch ];
];
# Matplotlib tries to find Tcl/Tk by opening a Tk window and asking the
# corresponding interpreter object for its library paths. This fails if

View File

@ -1,10 +0,0 @@
--- a/src/_macosx.m 2015-10-30 00:46:20.000000000 +0200
+++ b/src/_macosx.m 2015-11-01 14:52:25.000000000 +0200
@@ -6264,6 +6264,7 @@
static bool verify_framework(void)
{
+ return true; /* nixpkgs darwin stdenv */
#ifdef COMPILING_FOR_10_6
NSRunningApplication* app = [NSRunningApplication currentApplication];
NSApplicationActivationPolicy activationPolicy = [app activationPolicy];

View File

@ -1,12 +0,0 @@
diff -ruN matplotlib-3.0.0/src/_macosx.m matplotlib-3.0.0.patched/src/_macosx.m
--- matplotlib-3.0.0/src/_macosx.m 2018-09-16 00:35:21.000000000 +0200
+++ matplotlib-3.0.0.patched/src/_macosx.m 2018-11-03 13:14:33.000000000 +0100
@@ -2577,6 +2577,7 @@
static bool verify_framework(void)
{
+ return true; /* nixpkgs darwin stdenv */
ProcessSerialNumber psn;
/* These methods are deprecated, but they don't require the app to
have started */

View File

@ -52,8 +52,7 @@ buildPythonPackage rec {
++ stdenv.lib.optionals enableQt [ pyqt4 ];
patches =
[ ./basedirlist.patch ] ++
stdenv.lib.optionals stdenv.isDarwin [ ./darwin-stdenv.patch ];
[ ./basedirlist.patch ];
# Matplotlib tries to find Tcl/Tk by opening a Tk window and asking the
# corresponding interpreter object for its library paths. This fails if

View File

@ -1,64 +0,0 @@
--- a/garglk/fontmac.m
+++ b/garglk/fontmac.m
@@ -167,7 +167,7 @@ static void propfont(char *file, int style)
}
}
-static NSMutableArray<NSURL *> * gli_registered_fonts = nil;
+static NSMutableArray * gli_registered_fonts = nil;
static NSDistributedLock * gli_font_lock = nil;
void fontreplace(char *font, int type)
@@ -181,7 +181,7 @@ void fontreplace(char *font, int type)
NSFontDescriptor * fontFamilyDescriptor =
[[NSFontDescriptor fontDescriptorWithFontAttributes: nil] fontDescriptorWithFamily: fontFamily];
- NSArray<NSFontDescriptor *> * fontMatches =
+ NSArray * fontMatches =
[fontFamilyDescriptor matchingFontDescriptorsWithMandatoryKeys: nil];
for (NSFontDescriptor * sysfont in fontMatches)
@@ -259,7 +259,7 @@ void fontload(void)
// obtain a list of all files in the Fonts directory
NSString * fontFolder = [[NSString stringWithUTF8String: env] stringByAppendingPathComponent: @"Fonts"];
- NSArray<NSString *> * fontFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath: fontFolder error: nil];
+ NSArray * fontFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath: fontFolder error: nil];
// create a collection to hold the registered font URLs
gli_registered_fonts = [NSMutableArray new];
--- a/garglk/launchmac.m
+++ b/garglk/launchmac.m
@@ -556,7 +556,7 @@ static BOOL isTextbufferEvent(NSEvent * evt)
<GargoyleApp, NSApplicationDelegate, NSWindowDelegate>
{
BOOL openedFirstGame;
- NSMutableDictionary<NSNumber *, GargoyleWindow *> * windows;
+ NSMutableDictionary * windows;
NSConnection * link;
}
- (BOOL) launchFile: (NSString *) file;
--- a/garglk/ttsmac.m
+++ b/garglk/ttsmac.m
@@ -30,7 +30,7 @@
#import "sysmac.h"
// a queue of phrases to feed to the speech synthesizer
-static NSMutableArray<NSString *> * phraseQueue = nil;
+static NSMutableArray * phraseQueue = nil;
static NSRange purgeRange;
@interface SpeechDelegate : NSObject <NSSpeechSynthesizerDelegate>
@@ -96,10 +96,10 @@ void gli_initialize_tts(void)
NSString * lang = [NSString stringWithCString: gli_conf_speak_language
encoding: NSUTF8StringEncoding];
- NSArray<NSString *> * voices = [NSSpeechSynthesizer availableVoices];
+ NSArray * voices = [NSSpeechSynthesizer availableVoices];
for (NSString * voice in voices)
{
- NSDictionary<NSString *, id> * attr = [NSSpeechSynthesizer attributesForVoice: voice];
+ NSDictionary * attr = [NSSpeechSynthesizer attributesForVoice: voice];
if ([lang isEqualToString: [attr objectForKey: NSVoiceLocaleIdentifier]])
{
[synth setVoice: voice];

View File

@ -34,8 +34,6 @@ stdenv.mkDerivation {
buildInputs = [ SDL SDL_mixer SDL_sound gtk2 ]
++ stdenv.lib.optionals stdenv.isDarwin [ cf-private smpeg libvorbis ];
patches = [ ./darwin.patch ];
buildPhase = jamenv + "jam -j$NIX_BUILD_CORES";
installPhase =