summary refs log tree commit diff
path: root/pkgs/development/libraries/qt-5
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/qt-5')
-rw-r--r--pkgs/development/libraries/qt-5/5.11/default.nix57
-rw-r--r--pkgs/development/libraries/qt-5/5.11/fetch.sh3
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtbase-darwin-nseventtype.patch13
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtbase-darwin-revert-69221.patch73
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtbase-darwin.patch70
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtbase-revert-no-macos10.10.patch102
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qttools.patch15
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtwebengine-clang-fix.patch30
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-no-platform-check.patch37
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-sdk-10.10.patch160
-rw-r--r--pkgs/development/libraries/qt-5/5.12/default.nix59
-rw-r--r--pkgs/development/libraries/qt-5/5.12/fetch.sh3
-rw-r--r--pkgs/development/libraries/qt-5/5.12/qtbase-darwin-nseventtype.patch13
-rw-r--r--pkgs/development/libraries/qt-5/5.12/qtbase-darwin.patch70
-rw-r--r--pkgs/development/libraries/qt-5/5.12/qtbase-revert-no-macos10.10.patch102
-rw-r--r--pkgs/development/libraries/qt-5/5.12/qtbase.patch384
-rw-r--r--pkgs/development/libraries/qt-5/5.12/qttools.patch15
-rw-r--r--pkgs/development/libraries/qt-5/5.12/qtwebengine-darwin-no-platform-check.patch33
-rw-r--r--pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-qos-classes.patch11
-rw-r--r--pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-readline.patch45
-rw-r--r--pkgs/development/libraries/qt-5/5.12/srcs.nix320
-rw-r--r--pkgs/development/libraries/qt-5/5.6/default.nix35
-rw-r--r--pkgs/development/libraries/qt-5/5.6/fetch.sh3
-rw-r--r--pkgs/development/libraries/qt-5/5.9/default.nix46
-rw-r--r--pkgs/development/libraries/qt-5/5.9/fetch.sh3
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qtbase-darwin.patch35
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qtwebengine-clang-fix.patch38
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qtwebengine-darwin-no-platform-check.patch50
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qtwebkit.patch13
-rw-r--r--pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh22
-rw-r--r--pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh106
-rw-r--r--pkgs/development/libraries/qt-5/mkDerivation.nix9
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtbase.nix84
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtconnectivity.nix4
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtmacextras.nix6
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtnetworkauth.nix6
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtspeech.nix2
-rw-r--r--pkgs/development/libraries/qt-5/modules/qttools.nix5
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtwebengine.nix49
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtwebkit.nix29
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtwebview.nix10
41 files changed, 949 insertions, 1221 deletions
diff --git a/pkgs/development/libraries/qt-5/5.11/default.nix b/pkgs/development/libraries/qt-5/5.11/default.nix
index 257e9215246..67c5047e507 100644
--- a/pkgs/development/libraries/qt-5/5.11/default.nix
+++ b/pkgs/development/libraries/qt-5/5.11/default.nix
@@ -17,10 +17,10 @@ top-level attribute to `top-level/all-packages.nix`.
 
 {
   newScope,
-  stdenv, fetchurl, fetchFromGitHub, makeSetupHook,
+  stdenv, fetchurl, fetchFromGitHub, makeSetupHook, makeWrapper,
   bison, cups ? null, harfbuzz, libGL, perl,
   gstreamer, gst-plugins-base, gtk3, dconf,
-  cf-private,
+  llvmPackages_5,
 
   # options
   developerBuild ? false,
@@ -34,6 +34,8 @@ let
 
   qtCompatVersion = "5.11";
 
+  stdenvActual = if stdenv.cc.isClang then llvmPackages_5.stdenv else stdenv;
+
   mirror = "https://download.qt.io";
   srcs = import ./srcs.nix { inherit fetchurl; inherit mirror; } // {
     # Community port of the now unmaintained upstream qtwebkit.
@@ -51,31 +53,31 @@ 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
-      ++ optional stdenv.isDarwin ./qtwebengine-darwin-sdk-10.10.patch;
+    qtwebengine = [
+      ./qtwebengine-no-build-skip.patch
+      ./qtwebengine-darwin-no-platform-check.patch
+    ];
     qtwebkit = [ ./qtwebkit.patch ];
   };
 
-  mkDerivation =
-    import ../mkDerivation.nix
-    { inherit stdenv; inherit (stdenv) lib; }
-    { inherit debug; };
-
   qtModule =
     import ../qtModule.nix
-    { inherit mkDerivation perl; inherit (stdenv) lib; }
+    {
+      inherit perl;
+      inherit (stdenv) lib;
+      # Use a variant of mkDerivation that does not include wrapQtApplications
+      # to avoid cyclic dependencies between Qt modules.
+      mkDerivation =
+        import ../mkDerivation.nix
+        { inherit (stdenv) lib; inherit debug; wrapQtAppsHook = null; }
+        stdenvActual.mkDerivation;
+    }
     { inherit self srcs patches; };
 
   addPackages = self: with self;
@@ -83,7 +85,11 @@ let
       callPackage = self.newScope { inherit qtCompatVersion qtModule srcs; };
     in {
 
-      inherit mkDerivation;
+      mkDerivationWith =
+        import ../mkDerivation.nix
+        { inherit (stdenv) lib; inherit debug; inherit (self) wrapQtAppsHook; };
+
+      mkDerivation = mkDerivationWith stdenvActual.mkDerivation;
 
       qtbase = callPackage ../modules/qtbase.nix {
         inherit (srcs.qtbase) src version;
@@ -94,20 +100,17 @@ let
       };
 
       qtcharts = callPackage ../modules/qtcharts.nix {};
-      qtconnectivity = callPackage ../modules/qtconnectivity.nix {
-        inherit cf-private;
-      };
+      qtconnectivity = callPackage ../modules/qtconnectivity.nix {};
       qtdeclarative = callPackage ../modules/qtdeclarative.nix {};
       qtdoc = callPackage ../modules/qtdoc.nix {};
       qtgraphicaleffects = callPackage ../modules/qtgraphicaleffects.nix {};
       qtimageformats = callPackage ../modules/qtimageformats.nix {};
-      qtlocation = callPackage ../modules/qtlocation.nix {};
-      qtmacextras = callPackage ../modules/qtmacextras.nix {
-        inherit cf-private;
-      };
+      qtlocation = callPackage ../modules/qtlocation.nix { };
+      qtmacextras = callPackage ../modules/qtmacextras.nix {};
       qtmultimedia = callPackage ../modules/qtmultimedia.nix {
         inherit gstreamer gst-plugins-base;
       };
+      qtnetworkauth = callPackage ../modules/qtnetworkauth.nix {};
       qtquick1 = null;
       qtquickcontrols = callPackage ../modules/qtquickcontrols.nix {};
       qtquickcontrols2 = callPackage ../modules/qtquickcontrols2.nix {};
@@ -147,6 +150,12 @@ let
           fix_qt_builtin_paths = ../hooks/fix-qt-builtin-paths.sh;
         };
       } ../hooks/qmake-hook.sh;
+
+      wrapQtAppsHook = makeSetupHook {
+        deps =
+          [ self.qtbase.dev makeWrapper ]
+          ++ optional stdenv.isLinux self.qtwayland.dev;
+      } ../hooks/wrap-qt-apps-hook.sh;
     };
 
    self = makeScope newScope addPackages;
diff --git a/pkgs/development/libraries/qt-5/5.11/fetch.sh b/pkgs/development/libraries/qt-5/5.11/fetch.sh
index dc1088fc371..2ab3dd71c24 100644
--- a/pkgs/development/libraries/qt-5/5.11/fetch.sh
+++ b/pkgs/development/libraries/qt-5/5.11/fetch.sh
@@ -1,2 +1 @@
-WGET_ARGS=( http://download.qt.io/official_releases/qt/5.11/5.11.3/submodules/ \
-            -A '*.tar.xz' )
+WGET_ARGS=( http://download.qt.io/official_releases/qt/5.11/5.11.3/submodules/ )
diff --git a/pkgs/development/libraries/qt-5/5.11/qtbase-darwin-nseventtype.patch b/pkgs/development/libraries/qt-5/5.11/qtbase-darwin-nseventtype.patch
deleted file mode 100644
index 9ef6e8ef069..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtbase-darwin-nseventtype.patch
+++ /dev/null
@@ -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);
-                         }];
diff --git a/pkgs/development/libraries/qt-5/5.11/qtbase-darwin-revert-69221.patch b/pkgs/development/libraries/qt-5/5.11/qtbase-darwin-revert-69221.patch
deleted file mode 100644
index 73eea435f84..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtbase-darwin-revert-69221.patch
+++ /dev/null
@@ -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);
- 
diff --git a/pkgs/development/libraries/qt-5/5.11/qtbase-darwin.patch b/pkgs/development/libraries/qt-5/5.11/qtbase-darwin.patch
deleted file mode 100644
index f6635175205..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtbase-darwin.patch
+++ /dev/null
@@ -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)
diff --git a/pkgs/development/libraries/qt-5/5.11/qtbase-revert-no-macos10.10.patch b/pkgs/development/libraries/qt-5/5.11/qtbase-revert-no-macos10.10.patch
deleted file mode 100644
index 29776518379..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtbase-revert-no-macos10.10.patch
+++ /dev/null
@@ -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);
diff --git a/pkgs/development/libraries/qt-5/5.11/qttools.patch b/pkgs/development/libraries/qt-5/5.11/qttools.patch
index fbba439ef7a..622efc35b6b 100644
--- a/pkgs/development/libraries/qt-5/5.11/qttools.patch
+++ b/pkgs/development/libraries/qt-5/5.11/qttools.patch
@@ -69,3 +69,18 @@ index 4318b16f..d60db4ff 100644
      _qt5_LinguistTools_check_file_exists(${imported_location})
  
      set_target_properties(Qt5::lconvert PROPERTIES
+--- a/src/macdeployqt/shared/shared.cpp
++++ b/src/macdeployqt/shared/shared.cpp
+@@ -1241,6 +1241,12 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
+     if (!QFile(qmlImportScannerPath).exists())
+         qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner";
+ 
++#ifdef NIXPKGS_QMLIMPORTSCANNER
++    // Fallback: Nixpkgs hardcoded path
++    if (!QFile(qmlImportScannerPath).exists())
++        qmlImportScannerPath = NIXPKGS_QMLIMPORTSCANNER;
++#endif
++
+     // Verify that we found a qmlimportscanner binary
+     if (!QFile(qmlImportScannerPath).exists()) {
+         LogError() << "qmlimportscanner not found at" << qmlImportScannerPath;
diff --git a/pkgs/development/libraries/qt-5/5.11/qtwebengine-clang-fix.patch b/pkgs/development/libraries/qt-5/5.11/qtwebengine-clang-fix.patch
deleted file mode 100644
index 8dafd65cd34..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtwebengine-clang-fix.patch
+++ /dev/null
@@ -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));
-   }
- }
- 
diff --git a/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-no-platform-check.patch b/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-no-platform-check.patch
new file mode 100644
index 00000000000..3e1a8762b36
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-no-platform-check.patch
@@ -0,0 +1,37 @@
+diff --git a/mkspecs/features/platform.prf b/mkspecs/features/platform.prf
+--- a/mkspecs/features/platform.prf
++++ b/mkspecs/features/platform.prf
+@@ -38,10 +38,6 @@ defineTest(isPlatformSupported) {
+          return(false)
+     }
+   } else:osx {
+-    !isMinXcodeVersion(7, 3) {
+-      skipBuild("Using Xcode version $$QMAKE_XCODE_VERSION, but at least version 7.3 is required to build Qt WebEngine.")
+-      return(false)
+-    }
+     !clang|intel_icc {
+         skipBuild("Qt WebEngine on macOS requires Clang.")
+         return(false)
+@@ -52,10 +48,6 @@ defineTest(isPlatformSupported) {
+       skipBuild("Building Qt WebEngine requires macOS version 10.11 or newer.")
+       return(false)
+     }
+-    !isMinOSXSDKVersion(10, 10): {
+-      skipBuild("Building Qt WebEngine requires a macOS SDK version of 10.11 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
+-      return(false)
+-    }
+   } else {
+     skipBuild("Unknown platform. Qt WebEngine only supports Linux, Windows, and macOS.")
+     return(false)
+diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri
+--- a/src/core/config/mac_osx.pri
++++ b/src/core/config/mac_osx.pri
+@@ -5,8 +5,6 @@ load(functions)
+ # otherwise query for it.
+ QMAKE_MAC_SDK_VERSION = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.SDKVersion)
+ isEmpty(QMAKE_MAC_SDK_VERSION) {
+-     QMAKE_MAC_SDK_VERSION = $$system("/usr/bin/xcodebuild -sdk $${QMAKE_MAC_SDK} -version SDKVersion 2>/dev/null")
+-     isEmpty(QMAKE_MAC_SDK_VERSION): error("Could not resolve SDK version for \'$${QMAKE_MAC_SDK}\'")
+ }
+ 
+ QMAKE_CLANG_DIR = "/usr"
diff --git a/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-sdk-10.10.patch b/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-sdk-10.10.patch
deleted file mode 100644
index d43b09b9538..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-sdk-10.10.patch
+++ /dev/null
@@ -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) {
diff --git a/pkgs/development/libraries/qt-5/5.12/default.nix b/pkgs/development/libraries/qt-5/5.12/default.nix
index e6af24cd8f6..186e154597f 100644
--- a/pkgs/development/libraries/qt-5/5.12/default.nix
+++ b/pkgs/development/libraries/qt-5/5.12/default.nix
@@ -17,10 +17,10 @@ top-level attribute to `top-level/all-packages.nix`.
 
 {
   newScope,
-  stdenv, fetchurl, fetchFromGitHub, makeSetupHook,
+  stdenv, fetchurl, fetchFromGitHub, makeSetupHook, makeWrapper,
   bison, cups ? null, harfbuzz, libGL, perl,
   gstreamer, gst-plugins-base, gtk3, dconf,
-  cf-private,
+  llvmPackages_5,
 
   # options
   developerBuild ? false,
@@ -34,6 +34,8 @@ let
 
   qtCompatVersion = "5.12";
 
+  stdenvActual = if stdenv.cc.isClang then llvmPackages_5.stdenv else stdenv;
+
   mirror = "https://download.qt.io";
   srcs = import ./srcs.nix { inherit fetchurl; inherit mirror; } // {
     # Community port of the now unmaintained upstream qtwebkit.
@@ -51,27 +53,35 @@ 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 ];
     qtserialport = [ ./qtserialport.patch ];
-    qtwebengine = [ ./qtwebengine-no-build-skip.patch ];
-    qtwebkit = [ ./qtwebkit.patch ];
+    qtwebengine = [
+      ./qtwebengine-no-build-skip.patch
+    ]
+      ++ optional stdenv.isDarwin ./qtwebengine-darwin-no-platform-check.patch;
+    qtwebkit = [ ./qtwebkit.patch ]
+      ++ optionals stdenv.isDarwin [
+        ./qtwebkit-darwin-no-readline.patch
+        ./qtwebkit-darwin-no-qos-classes.patch
+      ];
+    qttools = [ ./qttools.patch ];
   };
 
-  mkDerivation =
-    import ../mkDerivation.nix
-    { inherit stdenv; inherit (stdenv) lib; }
-    { inherit debug; };
-
   qtModule =
     import ../qtModule.nix
-    { inherit mkDerivation perl; inherit (stdenv) lib; }
+    {
+      inherit perl;
+      inherit (stdenv) lib;
+      # Use a variant of mkDerivation that does not include wrapQtApplications
+      # to avoid cyclic dependencies between Qt modules.
+      mkDerivation =
+        import ../mkDerivation.nix
+        { inherit (stdenv) lib; inherit debug; wrapQtAppsHook = null; }
+        stdenvActual.mkDerivation;
+    }
     { inherit self srcs patches; };
 
   addPackages = self: with self;
@@ -79,7 +89,11 @@ let
       callPackage = self.newScope { inherit qtCompatVersion qtModule srcs; };
     in {
 
-      inherit mkDerivation;
+      mkDerivationWith =
+        import ../mkDerivation.nix
+        { inherit (stdenv) lib; inherit debug; inherit (self) wrapQtAppsHook; };
+
+      mkDerivation = mkDerivationWith stdenvActual.mkDerivation;
 
       qtbase = callPackage ../modules/qtbase.nix {
         inherit (srcs.qtbase) src version;
@@ -90,20 +104,17 @@ let
       };
 
       qtcharts = callPackage ../modules/qtcharts.nix {};
-      qtconnectivity = callPackage ../modules/qtconnectivity.nix {
-        inherit cf-private;
-      };
+      qtconnectivity = callPackage ../modules/qtconnectivity.nix {};
       qtdeclarative = callPackage ../modules/qtdeclarative.nix {};
       qtdoc = callPackage ../modules/qtdoc.nix {};
       qtgraphicaleffects = callPackage ../modules/qtgraphicaleffects.nix {};
       qtimageformats = callPackage ../modules/qtimageformats.nix {};
       qtlocation = callPackage ../modules/qtlocation.nix {};
-      qtmacextras = callPackage ../modules/qtmacextras.nix {
-        inherit cf-private;
-      };
+      qtmacextras = callPackage ../modules/qtmacextras.nix {};
       qtmultimedia = callPackage ../modules/qtmultimedia.nix {
         inherit gstreamer gst-plugins-base;
       };
+      qtnetworkauth = callPackage ../modules/qtnetworkauth.nix {};
       qtquick1 = null;
       qtquickcontrols = callPackage ../modules/qtquickcontrols.nix {};
       qtquickcontrols2 = callPackage ../modules/qtquickcontrols2.nix {};
@@ -143,6 +154,12 @@ let
           fix_qt_builtin_paths = ../hooks/fix-qt-builtin-paths.sh;
         };
       } ../hooks/qmake-hook.sh;
+
+      wrapQtAppsHook = makeSetupHook {
+        deps =
+          [ self.qtbase.dev makeWrapper ]
+          ++ optional stdenv.isLinux self.qtwayland.dev;
+      } ../hooks/wrap-qt-apps-hook.sh;
     };
 
    self = makeScope newScope addPackages;
diff --git a/pkgs/development/libraries/qt-5/5.12/fetch.sh b/pkgs/development/libraries/qt-5/5.12/fetch.sh
index b77a58cafa2..a4d2fc82ff2 100644
--- a/pkgs/development/libraries/qt-5/5.12/fetch.sh
+++ b/pkgs/development/libraries/qt-5/5.12/fetch.sh
@@ -1,2 +1 @@
-WGET_ARGS=( http://download.qt.io/official_releases/qt/5.12/5.12.0/submodules/ \
-            -A '*.tar.xz' )
+WGET_ARGS=( http://download.qt.io/official_releases/qt/5.12/5.12.3/submodules/ )
diff --git a/pkgs/development/libraries/qt-5/5.12/qtbase-darwin-nseventtype.patch b/pkgs/development/libraries/qt-5/5.12/qtbase-darwin-nseventtype.patch
deleted file mode 100644
index 9ef6e8ef069..00000000000
--- a/pkgs/development/libraries/qt-5/5.12/qtbase-darwin-nseventtype.patch
+++ /dev/null
@@ -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);
-                         }];
diff --git a/pkgs/development/libraries/qt-5/5.12/qtbase-darwin.patch b/pkgs/development/libraries/qt-5/5.12/qtbase-darwin.patch
deleted file mode 100644
index 7ce27a99758..00000000000
--- a/pkgs/development/libraries/qt-5/5.12/qtbase-darwin.patch
+++ /dev/null
@@ -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,
diff --git a/pkgs/development/libraries/qt-5/5.12/qtbase-revert-no-macos10.10.patch b/pkgs/development/libraries/qt-5/5.12/qtbase-revert-no-macos10.10.patch
deleted file mode 100644
index 29776518379..00000000000
--- a/pkgs/development/libraries/qt-5/5.12/qtbase-revert-no-macos10.10.patch
+++ /dev/null
@@ -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);
diff --git a/pkgs/development/libraries/qt-5/5.12/qtbase.patch b/pkgs/development/libraries/qt-5/5.12/qtbase.patch
index 68ebd56b76c..118ffaa511e 100644
--- a/pkgs/development/libraries/qt-5/5.12/qtbase.patch
+++ b/pkgs/development/libraries/qt-5/5.12/qtbase.patch
@@ -1,8 +1,7 @@
-diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf
-index 61bea952b2..9909dae726 100644
---- a/mkspecs/common/mac.conf
-+++ b/mkspecs/common/mac.conf
-@@ -23,7 +23,7 @@ QMAKE_INCDIR_OPENGL     = \
+diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/common/mac.conf qtbase-everywhere-src-5.12.3-b/mkspecs/common/mac.conf
+--- qtbase-everywhere-src-5.12.3-a/mkspecs/common/mac.conf	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/mkspecs/common/mac.conf	2019-07-10 09:35:08.917628566 -0500
+@@ -24,7 +24,7 @@
  
  QMAKE_FIX_RPATH         = install_name_tool -id
  
@@ -11,11 +10,10 @@ index 61bea952b2..9909dae726 100644
  QMAKE_LFLAGS_GCSECTIONS = -Wl,-dead_strip
  
  QMAKE_LFLAGS_REL_RPATH  =
-diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
-index 2ed708e085..05e60ff45f 100644
---- a/mkspecs/features/create_cmake.prf
-+++ b/mkspecs/features/create_cmake.prf
-@@ -21,7 +21,7 @@ load(cmake_functions)
+diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/create_cmake.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/create_cmake.prf
+--- qtbase-everywhere-src-5.12.3-a/mkspecs/features/create_cmake.prf	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/create_cmake.prf	2019-07-10 09:35:08.917628566 -0500
+@@ -21,7 +21,7 @@
  # at cmake time whether package has been found via a symlink, and correct
  # that to an absolute path. This is only done for installations to
  # the /usr or / prefix.
@@ -24,7 +22,7 @@ index 2ed708e085..05e60ff45f 100644
  contains(CMAKE_INSTALL_LIBS_DIR, ^(/usr)?/lib(64)?.*): CMAKE_USR_MOVE_WORKAROUND = $$CMAKE_INSTALL_LIBS_DIR
  
  CMAKE_OUT_DIR = $$MODULE_BASE_OUTDIR/lib/cmake
-@@ -51,45 +51,20 @@ split_incpath {
+@@ -51,45 +51,20 @@
          $$cmake_extra_source_includes.output
  }
  
@@ -81,7 +79,7 @@ index 2ed708e085..05e60ff45f 100644
  
  static|staticlib:CMAKE_STATIC_TYPE = true
  
-@@ -169,7 +144,7 @@ contains(CONFIG, plugin) {
+@@ -169,7 +144,7 @@
        cmake_target_file
  
      cmake_qt5_plugin_file.files = $$cmake_target_file.output
@@ -90,7 +88,7 @@ index 2ed708e085..05e60ff45f 100644
      INSTALLS += cmake_qt5_plugin_file
  
      return()
-@@ -316,7 +291,7 @@ exists($$cmake_macros_file.input) {
+@@ -318,7 +293,7 @@
      cmake_qt5_module_files.files += $$cmake_macros_file.output
  }
  
@@ -99,11 +97,10 @@ index 2ed708e085..05e60ff45f 100644
  
  # We are generating cmake files. Most developers of Qt are not aware of cmake,
  # so we require automatic tests to be available. The only module which should
-diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
-index 3ed6dd5889..4c7c8da21a 100644
---- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
-+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
-@@ -3,30 +3,6 @@ if (CMAKE_VERSION VERSION_LESS 3.1.0)
+diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in qtbase-everywhere-src-5.12.3-b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+--- qtbase-everywhere-src-5.12.3-a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in	2019-07-10 09:35:08.917628566 -0500
+@@ -3,30 +3,6 @@
      message(FATAL_ERROR \"Qt 5 $${CMAKE_MODULE_NAME} module requires at least CMake version 3.1.0\")
  endif()
  
@@ -134,7 +131,7 @@ index 3ed6dd5889..4c7c8da21a 100644
  !!IF !equals(TEMPLATE, aux)
  # For backwards compatibility only. Use Qt5$${CMAKE_MODULE_NAME}_VERSION instead.
  set(Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING "$$eval(QT.$${MODULE}.VERSION)")
-@@ -52,11 +28,7 @@ endmacro()
+@@ -52,11 +28,7 @@
  macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATION IMPLIB_LOCATION)
      set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
  
@@ -146,7 +143,7 @@ index 3ed6dd5889..4c7c8da21a 100644
      _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
      set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
          \"INTERFACE_LINK_LIBRARIES\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\"
-@@ -69,11 +41,7 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI
+@@ -69,11 +41,7 @@
      )
  
  !!IF !isEmpty(CMAKE_WINDOWS_BUILD)
@@ -158,7 +155,7 @@ index 3ed6dd5889..4c7c8da21a 100644
      _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_implib})
      if(NOT \"${IMPLIB_LOCATION}\" STREQUAL \"\")
          set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
-@@ -89,24 +57,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+@@ -89,24 +57,13 @@
  !!IF !no_module_headers
  !!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
      set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS
@@ -187,7 +184,7 @@ index 3ed6dd5889..4c7c8da21a 100644
      )
  !!ELSE
      set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
-@@ -122,7 +79,6 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+@@ -122,7 +79,6 @@
      set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
  !!ENDIF
  !!ENDIF
@@ -195,7 +192,7 @@ index 3ed6dd5889..4c7c8da21a 100644
  !!IF !isEmpty(CMAKE_ADD_SOURCE_INCLUDE_DIRS)
      include(\"${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake\" OPTIONAL)
  !!ENDIF
-@@ -272,25 +228,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+@@ -272,25 +228,13 @@
  !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
  !!IF isEmpty(CMAKE_DEBUG_TYPE)
  !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
@@ -221,7 +218,7 @@ index 3ed6dd5889..4c7c8da21a 100644
          _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
  !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
      endif()
-@@ -309,25 +253,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+@@ -309,25 +253,13 @@
  !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
  !!IF isEmpty(CMAKE_RELEASE_TYPE)
  !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
@@ -247,7 +244,7 @@ index 3ed6dd5889..4c7c8da21a 100644
          _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
  !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
      endif()
-@@ -346,11 +278,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+@@ -346,11 +278,7 @@
      macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION)
          set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
  
@@ -259,19 +256,17 @@ index 3ed6dd5889..4c7c8da21a 100644
          _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
          set_target_properties(Qt5::${Plugin} PROPERTIES
              \"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
-diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
-index 99f68b78f5..dde69cb7c2 100644
---- a/mkspecs/features/mac/default_post.prf
-+++ b/mkspecs/features/mac/default_post.prf
-@@ -63,199 +63,3 @@ qt {
-         }
+diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/mac/default_post.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/mac/default_post.prf
+--- qtbase-everywhere-src-5.12.3-a/mkspecs/features/mac/default_post.prf	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/mac/default_post.prf	2019-07-10 09:35:08.917628566 -0500
+@@ -64,202 +64,6 @@
      }
  }
--
+ 
 -# Add the same default rpaths as Xcode does for new projects.
 -# This is especially important for iOS/tvOS/watchOS where no other option is possible.
 -!no_default_rpath {
--    QMAKE_RPATHDIR += @executable_path/Frameworks
+-    QMAKE_RPATHDIR += @executable_path/../Frameworks
 -    equals(TEMPLATE, lib):!plugin:lib_bundle: QMAKE_RPATHDIR += @loader_path/Frameworks
 -}
 -
@@ -463,10 +458,13 @@ index 99f68b78f5..dde69cb7c2 100644
 -    xcode_product_bundle_target = ${PRODUCT_NAME:rfc1034identifier}
 -xcode_product_bundle_identifier_setting.value = "$${xcode_product_bundle_identifier_setting.value}.$${xcode_product_bundle_target}"
 -QMAKE_MAC_XCODE_SETTINGS += xcode_product_bundle_identifier_setting
-diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
-index e3534561a5..3b01424e67 100644
---- a/mkspecs/features/mac/default_pre.prf
-+++ b/mkspecs/features/mac/default_pre.prf
+-
+ !macx-xcode {
+     generate_xcode_project.commands = @$(QMAKE) -spec macx-xcode $(EXPORT__PRO_FILE_)
+     generate_xcode_project.target = xcodeproj
+diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/mac/default_pre.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/mac/default_pre.prf
+--- qtbase-everywhere-src-5.12.3-a/mkspecs/features/mac/default_pre.prf	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/mac/default_pre.prf	2019-07-10 09:35:08.917628566 -0500
 @@ -1,60 +1,2 @@
  CONFIG = asset_catalogs rez $$CONFIG
  load(default_pre)
@@ -528,11 +526,10 @@ index e3534561a5..3b01424e67 100644
 -xcode_copy_phase_strip_setting.name = COPY_PHASE_STRIP
 -xcode_copy_phase_strip_setting.value = NO
 -QMAKE_MAC_XCODE_SETTINGS += xcode_copy_phase_strip_setting
-diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
-index 8360dd8b38..8b13789179 100644
---- a/mkspecs/features/mac/sdk.prf
-+++ b/mkspecs/features/mac/sdk.prf
-@@ -1,58 +1 @@
+diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/mac/sdk.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/mac/sdk.prf
+--- qtbase-everywhere-src-5.12.3-a/mkspecs/features/mac/sdk.prf	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/mac/sdk.prf	2019-07-10 09:35:08.917628566 -0500
+@@ -1,54 +1 @@
  
 -isEmpty(QMAKE_MAC_SDK): \
 -    error("QMAKE_MAC_SDK must be set when using CONFIG += sdk.")
@@ -568,10 +565,6 @@ index 8360dd8b38..8b13789179 100644
 -QMAKE_MAC_SDK_PLATFORM_PATH = $$xcodeSDKInfo(PlatformPath)
 -QMAKE_MAC_SDK_VERSION = $$xcodeSDKInfo(SDKVersion)
 -
--sysrootified =
--for(val, QMAKE_INCDIR_OPENGL): sysrootified += $${QMAKE_MAC_SDK_PATH}$$val
--QMAKE_INCDIR_OPENGL = $$sysrootified
--
 -QMAKESPEC_NAME = $$basename(QMAKESPEC)
 -
 -# Resolve SDK version of various tools
@@ -591,37 +584,34 @@ index 8360dd8b38..8b13789179 100644
 -    $$tool = $$sysrooted $$member(value, 1, -1)
 -    cache($$tool_variable, set stash, $$tool)
 -}
-diff --git a/mkspecs/features/qml_module.prf b/mkspecs/features/qml_module.prf
-index 65212b2abf..accd4c07f0 100644
---- a/mkspecs/features/qml_module.prf
-+++ b/mkspecs/features/qml_module.prf
-@@ -52,7 +52,7 @@ qmldir.base = $$_PRO_FILE_PWD_
- # Tools need qmldir and plugins.qmltypes always installed on the file system
- qmldir.files = $$qmldir_file $$fq_aux_qml_files
+diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qml_module.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qml_module.prf
+--- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qml_module.prf	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qml_module.prf	2019-07-10 09:35:08.917628566 -0500
+@@ -54,7 +54,7 @@
+ 
+ qmldir.files = $$qmldir_file
  install_qml_files: qmldir.files += $$fq_qml_files
--qmldir.path = $$instbase/$$TARGETPATH
+-qmldir.path = $$[QT_INSTALL_QML]/$$TARGETPATH
 +qmldir.path = $$NIX_OUTPUT_QML/$$TARGETPATH
  INSTALLS += qmldir
  
- !debug_and_release|!build_all|CONFIG(release, debug|release) {
-diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf
-index cd6377dcc6..e98bf98151 100644
---- a/mkspecs/features/qml_plugin.prf
-+++ b/mkspecs/features/qml_plugin.prf
-@@ -56,7 +56,7 @@ qml1_target {
-     instbase = $$[QT_INSTALL_QML]
- }
+ qmlfiles.base = $$_PRO_FILE_PWD_
+diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qml_plugin.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qml_plugin.prf
+--- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qml_plugin.prf	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qml_plugin.prf	2019-07-10 09:35:08.918628595 -0500
+@@ -50,7 +50,7 @@
  
--target.path = $$instbase/$$TARGETPATH
+ DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
+ 
+-target.path = $$[QT_INSTALL_QML]/$$TARGETPATH
 +target.path = $$NIX_OUTPUT_QML/$$TARGETPATH
  INSTALLS += target
  
  # Some final setup
-diff --git a/mkspecs/features/qt_app.prf b/mkspecs/features/qt_app.prf
-index 8354f30eea..62028fef8e 100644
---- a/mkspecs/features/qt_app.prf
-+++ b/mkspecs/features/qt_app.prf
-@@ -30,7 +30,7 @@ host_build:force_bootstrap {
+diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_app.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_app.prf
+--- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_app.prf	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_app.prf	2019-07-10 09:35:08.918628595 -0500
+@@ -30,7 +30,7 @@
      target.path = $$[QT_HOST_BINS]
  } else {
      !build_pass:qtConfig(debug_and_release): CONFIG += release
@@ -630,11 +620,10 @@ index 8354f30eea..62028fef8e 100644
      CONFIG += relative_qt_rpath  # Qt's tools and apps should be relocatable
  }
  INSTALLS += target
-diff --git a/mkspecs/features/qt_build_paths.prf b/mkspecs/features/qt_build_paths.prf
-index 3bb3823a8e..655b7b7db8 100644
---- a/mkspecs/features/qt_build_paths.prf
-+++ b/mkspecs/features/qt_build_paths.prf
-@@ -24,6 +24,6 @@ exists($$MODULE_BASE_INDIR/.git): \
+diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_build_paths.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_build_paths.prf
+--- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_build_paths.prf	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_build_paths.prf	2019-07-10 09:35:08.918628595 -0500
+@@ -24,6 +24,6 @@
  !force_independent {
      # If the module is not built independently, everything ends up in qtbase.
      # This is the case in non-prefix builds, except for selected modules.
@@ -643,11 +632,10 @@ index 3bb3823a8e..655b7b7db8 100644
 +    MODULE_BASE_OUTDIR = $$NIX_OUTPUT_OUT
 +    MODULE_QMAKE_OUTDIR = $$NIX_OUTPUT_OUT
  }
-diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
-index 4ad9946ae0..6d66f29c26 100644
---- a/mkspecs/features/qt_common.prf
-+++ b/mkspecs/features/qt_common.prf
-@@ -34,8 +34,8 @@ contains(TEMPLATE, .*lib) {
+diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_common.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_common.prf
+--- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_common.prf	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_common.prf	2019-07-10 09:35:08.918628595 -0500
+@@ -34,8 +34,8 @@
          qqt_libdir = \$\$\$\$[QT_HOST_LIBS]
          qt_libdir = $$[QT_HOST_LIBS]
      } else {
@@ -658,11 +646,10 @@ index 4ad9946ae0..6d66f29c26 100644
      }
      contains(QMAKE_DEFAULT_LIBDIRS, $$qt_libdir) {
          lib_replace.match = "[^ ']*$$rplbase/lib"
-diff --git a/mkspecs/features/qt_docs.prf b/mkspecs/features/qt_docs.prf
-index 3139c443c6..1b4f2fddd8 100644
---- a/mkspecs/features/qt_docs.prf
-+++ b/mkspecs/features/qt_docs.prf
-@@ -45,7 +45,7 @@ QMAKE_DOCS_OUTPUTDIR = $$QMAKE_DOCS_BASE_OUTDIR/$$QMAKE_DOCS_TARGETDIR
+diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_docs.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_docs.prf
+--- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_docs.prf	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_docs.prf	2019-07-10 09:35:08.918628595 -0500
+@@ -45,7 +45,7 @@
  
  QDOC += -outputdir $$shell_quote($$QMAKE_DOCS_OUTPUTDIR)
  !build_online_docs: \
@@ -671,7 +658,7 @@ index 3139c443c6..1b4f2fddd8 100644
  PREP_DOC_INDEXES =
  DOC_INDEXES =
  !isEmpty(QTREPOS) {
-@@ -64,8 +64,8 @@ DOC_INDEXES =
+@@ -64,8 +64,8 @@
          DOC_INDEXES += -indexdir $$shell_quote($$qrep/doc)
  } else {
      prepare_docs: \
@@ -682,7 +669,7 @@ index 3139c443c6..1b4f2fddd8 100644
  }
  
  qtattributionsscanner.target = qtattributionsscanner
-@@ -88,12 +88,12 @@ prepare_docs {
+@@ -88,12 +88,12 @@
      qch_docs.commands = $$QHELPGENERATOR $$shell_quote($$QMAKE_DOCS_OUTPUTDIR/$${QMAKE_DOCS_TARGET}.qhp) -o $$shell_quote($$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch)
  
      inst_html_docs.files = $$QMAKE_DOCS_OUTPUTDIR
@@ -697,11 +684,10 @@ index 3139c443c6..1b4f2fddd8 100644
      inst_qch_docs.CONFIG += no_check_exist no_default_install no_build
      INSTALLS += inst_qch_docs
  
-diff --git a/mkspecs/features/qt_example_installs.prf b/mkspecs/features/qt_example_installs.prf
-index 43b58817fe..e635b8f67a 100644
---- a/mkspecs/features/qt_example_installs.prf
-+++ b/mkspecs/features/qt_example_installs.prf
-@@ -88,7 +88,7 @@ sourcefiles += \
+diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_example_installs.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_example_installs.prf
+--- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_example_installs.prf	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_example_installs.prf	2019-07-10 09:35:08.918628595 -0500
+@@ -88,7 +88,7 @@
      $$SOURCES $$HEADERS $$FORMS $$RESOURCES $$TRANSLATIONS \
      $$DBUS_ADAPTORS $$DBUS_INTERFACES
  addInstallFiles(sources.files, $$sourcefiles)
@@ -710,11 +696,10 @@ index 43b58817fe..e635b8f67a 100644
  INSTALLS += sources
  
  check_examples {
-diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
-index 1903e509c8..ae7b585989 100644
---- a/mkspecs/features/qt_functions.prf
-+++ b/mkspecs/features/qt_functions.prf
-@@ -69,7 +69,7 @@ defineTest(qtHaveModule) {
+diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_functions.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_functions.prf
+--- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_functions.prf	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_functions.prf	2019-07-10 09:35:08.918628595 -0500
+@@ -69,7 +69,7 @@
  defineTest(qtPrepareTool) {
      cmd = $$eval(QT_TOOL.$${2}.binary)
      isEmpty(cmd) {
@@ -723,10 +708,9 @@ index 1903e509c8..ae7b585989 100644
          exists($${cmd}.pl) {
              $${1}_EXE = $${cmd}.pl
              cmd = perl -w $$system_path($${cmd}.pl)
-diff --git a/mkspecs/features/qt_installs.prf b/mkspecs/features/qt_installs.prf
-index 8f98987b99..21b3bb8b32 100644
---- a/mkspecs/features/qt_installs.prf
-+++ b/mkspecs/features/qt_installs.prf
+diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_installs.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_installs.prf
+--- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_installs.prf	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_installs.prf	2019-07-10 09:35:08.918628595 -0500
 @@ -12,16 +12,10 @@
  #library
  !qt_no_install_library {
@@ -746,7 +730,7 @@ index 8f98987b99..21b3bb8b32 100644
      !static: target.CONFIG = no_dll
      INSTALLS += target
  }
-@@ -29,33 +23,33 @@
+@@ -29,35 +23,35 @@
  #headers
  qt_install_headers {
      gen_headers.files = $$SYNCQT.GENERATED_HEADER_FILES
@@ -762,6 +746,8 @@ index 8f98987b99..21b3bb8b32 100644
      private_headers.files = $$SYNCQT.PRIVATE_HEADER_FILES $$SYNCQT.INJECTED_PRIVATE_HEADER_FILES
 -    private_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME/private
 +    private_headers.path = $$NIX_OUTPUT_DEV/include/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME/private
+     generated_privates: \
+         private_headers.CONFIG += no_check_exist
      INSTALLS += private_headers
  
      qpa_headers.files = $$SYNCQT.QPA_HEADER_FILES
@@ -786,11 +772,10 @@ index 8f98987b99..21b3bb8b32 100644
          privpritarget.files = $$MODULE_PRIVATE_PRI
          INSTALLS += privpritarget
      }
-diff --git a/mkspecs/features/qt_plugin.prf b/mkspecs/features/qt_plugin.prf
-index 40528a65e2..903f795284 100644
---- a/mkspecs/features/qt_plugin.prf
-+++ b/mkspecs/features/qt_plugin.prf
-@@ -88,7 +88,7 @@ CONFIG(static, static|shared)|prefix_build {
+diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_plugin.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_plugin.prf
+--- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_plugin.prf	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_plugin.prf	2019-07-10 09:35:08.918628595 -0500
+@@ -88,7 +88,7 @@
      }
  }
  
@@ -799,11 +784,63 @@ index 40528a65e2..903f795284 100644
  INSTALLS += target
  
  TARGET = $$qt5LibraryTarget($$TARGET)
-diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
-index e0652fdcf9..450b2a2d28 100644
---- a/src/corelib/Qt5CoreConfigExtras.cmake.in
-+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
-@@ -3,7 +3,7 @@ if (NOT TARGET Qt5::qmake)
+diff -aur qtbase-everywhere-src-5.12.3-a/src/corelib/kernel/qcoreapplication.cpp qtbase-everywhere-src-5.12.3-b/src/corelib/kernel/qcoreapplication.cpp
+--- qtbase-everywhere-src-5.12.3-a/src/corelib/kernel/qcoreapplication.cpp	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/src/corelib/kernel/qcoreapplication.cpp	2019-07-10 09:35:08.919628625 -0500
+@@ -2668,6 +2668,15 @@
+         QStringList *app_libpaths = new QStringList;
+         coreappdata()->app_libpaths.reset(app_libpaths);
+ 
++        // Add library paths derived from PATH
++        const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
++        const QString plugindir = QStringLiteral("../" NIXPKGS_QT_PLUGIN_PREFIX);
++        for (const QString &path: paths) {
++            if (!path.isEmpty()) {
++                app_libpaths->append(QDir::cleanPath(path + QDir::separator() + plugindir));
++            }
++        }
++
+         QString libPathEnv = qEnvironmentVariable("QT_PLUGIN_PATH");
+         if (!libPathEnv.isEmpty()) {
+             QStringList paths = libPathEnv.split(QDir::listSeparator(), QString::SkipEmptyParts);
+diff -aur qtbase-everywhere-src-5.12.3-a/src/corelib/kernel/qcore_mac_p.h qtbase-everywhere-src-5.12.3-b/src/corelib/kernel/qcore_mac_p.h
+--- qtbase-everywhere-src-5.12.3-a/src/corelib/kernel/qcore_mac_p.h	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/src/corelib/kernel/qcore_mac_p.h	2019-07-10 09:35:08.920628655 -0500
+@@ -212,7 +212,7 @@
+ 
+ // --------------------------------------------------------------------------
+ 
+-#if !defined(QT_BOOTSTRAPPED)
++#if 0
+ 
+ QT_END_NAMESPACE
+ #include <os/activity.h>
+@@ -290,7 +290,19 @@
+ 
+ #define QT_APPLE_SCOPED_LOG_ACTIVITY(...) QAppleLogActivity scopedLogActivity = QT_APPLE_LOG_ACTIVITY(__VA_ARGS__).enter();
+ 
+-#endif // !defined(QT_BOOTSTRAPPED)
++#else // !defined(QT_BOOTSTRAPPED)
++
++#define QT_APPLE_LOG_ACTIVITY_WITH_PARENT3(...)
++#define QT_APPLE_LOG_ACTIVITY_WITH_PARENT2(...)
++#define QT_APPLE_LOG_ACTIVITY_WITH_PARENT(...)
++
++#define QT_APPLE_LOG_ACTIVITY2(...)
++#define QT_APPLE_LOG_ACTIVITY1(...)
++#define QT_APPLE_LOG_ACTIVITY(...)
++
++#define QT_APPLE_SCOPED_LOG_ACTIVITY(...)
++
++#endif
+ 
+ // -------------------------------------------------------------------------
+ 
+Only in qtbase-everywhere-src-5.12.3-b/src/corelib/kernel: qcore_mac_p.h.orig
+diff -aur qtbase-everywhere-src-5.12.3-a/src/corelib/Qt5CoreConfigExtras.cmake.in qtbase-everywhere-src-5.12.3-b/src/corelib/Qt5CoreConfigExtras.cmake.in
+--- qtbase-everywhere-src-5.12.3-a/src/corelib/Qt5CoreConfigExtras.cmake.in	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/src/corelib/Qt5CoreConfigExtras.cmake.in	2019-07-10 09:35:08.918628595 -0500
+@@ -3,7 +3,7 @@
      add_executable(Qt5::qmake IMPORTED)
  
  !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
@@ -812,7 +849,7 @@ index e0652fdcf9..450b2a2d28 100644
  !!ELSE
      set(imported_location \"$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
  !!ENDIF
-@@ -18,7 +18,7 @@ if (NOT TARGET Qt5::moc)
+@@ -18,7 +18,7 @@
      add_executable(Qt5::moc IMPORTED)
  
  !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
@@ -821,7 +858,7 @@ index e0652fdcf9..450b2a2d28 100644
  !!ELSE
      set(imported_location \"$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
  !!ENDIF
-@@ -35,7 +35,7 @@ if (NOT TARGET Qt5::rcc)
+@@ -35,7 +35,7 @@
      add_executable(Qt5::rcc IMPORTED)
  
  !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
@@ -830,7 +867,7 @@ index e0652fdcf9..450b2a2d28 100644
  !!ELSE
      set(imported_location \"$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
  !!ENDIF
-@@ -116,7 +116,7 @@ if (NOT TARGET Qt5::WinMain)
+@@ -116,7 +116,7 @@
  !!IF !isEmpty(CMAKE_RELEASE_TYPE)
      set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
  !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
@@ -839,7 +876,7 @@ index e0652fdcf9..450b2a2d28 100644
  !!ELSE
      set(imported_location \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
  !!ENDIF
-@@ -130,7 +130,7 @@ if (NOT TARGET Qt5::WinMain)
+@@ -130,7 +130,7 @@
      set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
  
  !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
@@ -848,10 +885,9 @@ index e0652fdcf9..450b2a2d28 100644
  !!ELSE
      set(imported_location \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\")
  !!ENDIF
-diff --git a/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in b/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
-index c357237d0e..6f0c75de3c 100644
---- a/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
-+++ b/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
+diff -aur qtbase-everywhere-src-5.12.3-a/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in qtbase-everywhere-src-5.12.3-b/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
+--- qtbase-everywhere-src-5.12.3-a/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in	2019-07-10 09:35:08.918628595 -0500
 @@ -1,6 +1,6 @@
  
  !!IF isEmpty(CMAKE_HOST_DATA_DIR_IS_ABSOLUTE)
@@ -860,10 +896,9 @@ index c357237d0e..6f0c75de3c 100644
  !!ELSE
  set(_qt5_corelib_extra_includes \"$${CMAKE_HOST_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
  !!ENDIF
-diff --git a/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in b/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
-index 706304cf34..546420f6ad 100644
---- a/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
-+++ b/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
+diff -aur qtbase-everywhere-src-5.12.3-a/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in qtbase-everywhere-src-5.12.3-b/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
+--- qtbase-everywhere-src-5.12.3-a/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in	2019-07-10 09:35:08.918628595 -0500
 @@ -1,6 +1,6 @@
  
  !!IF isEmpty(CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE)
@@ -872,31 +907,10 @@ index 706304cf34..546420f6ad 100644
  !!ELSE
  set(_qt5_corelib_extra_includes \"$${CMAKE_INSTALL_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
  !!ENDIF
-diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
-index 463e30e1c3..0e1ab669e4 100644
---- a/src/corelib/kernel/qcoreapplication.cpp
-+++ b/src/corelib/kernel/qcoreapplication.cpp
-@@ -2665,6 +2665,15 @@ QStringList QCoreApplication::libraryPaths()
-         QStringList *app_libpaths = new QStringList;
-         coreappdata()->app_libpaths.reset(app_libpaths);
- 
-+        // Add library paths derived from PATH
-+        const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
-+        const QString plugindir = QStringLiteral("../" NIXPKGS_QT_PLUGIN_PREFIX);
-+        for (const QString &path: paths) {
-+            if (!path.isEmpty()) {
-+                app_libpaths->append(QDir::cleanPath(path + QDir::separator() + plugindir));
-+            }
-+        }
-+
-         const QByteArray libPathEnv = qgetenv("QT_PLUGIN_PATH");
-         if (!libPathEnv.isEmpty()) {
-             QStringList paths = QFile::decodeName(libPathEnv).split(QDir::listSeparator(), QString::SkipEmptyParts);
-diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp
-index bed62a02bd..73158993f7 100644
---- a/src/corelib/tools/qtimezoneprivate_tz.cpp
-+++ b/src/corelib/tools/qtimezoneprivate_tz.cpp
-@@ -70,7 +70,11 @@ typedef QHash<QByteArray, QTzTimeZone> QTzTimeZoneHash;
+diff -aur qtbase-everywhere-src-5.12.3-a/src/corelib/tools/qtimezoneprivate_tz.cpp qtbase-everywhere-src-5.12.3-b/src/corelib/tools/qtimezoneprivate_tz.cpp
+--- qtbase-everywhere-src-5.12.3-a/src/corelib/tools/qtimezoneprivate_tz.cpp	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/src/corelib/tools/qtimezoneprivate_tz.cpp	2019-07-10 09:35:08.919628625 -0500
+@@ -70,7 +70,11 @@
  // Parse zone.tab table, assume lists all installed zones, if not will need to read directories
  static QTzTimeZoneHash loadTzTimeZones()
  {
@@ -909,7 +923,7 @@ index bed62a02bd..73158993f7 100644
      if (!QFile::exists(path))
          path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
  
-@@ -644,12 +648,16 @@ void QTzTimeZonePrivate::init(const QByteArray &ianaId)
+@@ -644,12 +648,16 @@
          if (!tzif.open(QIODevice::ReadOnly))
              return;
      } else {
@@ -931,10 +945,9 @@ index bed62a02bd..73158993f7 100644
          }
      }
  
-diff --git a/src/dbus/Qt5DBusConfigExtras.cmake.in b/src/dbus/Qt5DBusConfigExtras.cmake.in
-index 1d947159e2..b36865fc48 100644
---- a/src/dbus/Qt5DBusConfigExtras.cmake.in
-+++ b/src/dbus/Qt5DBusConfigExtras.cmake.in
+diff -aur qtbase-everywhere-src-5.12.3-a/src/dbus/Qt5DBusConfigExtras.cmake.in qtbase-everywhere-src-5.12.3-b/src/dbus/Qt5DBusConfigExtras.cmake.in
+--- qtbase-everywhere-src-5.12.3-a/src/dbus/Qt5DBusConfigExtras.cmake.in	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/src/dbus/Qt5DBusConfigExtras.cmake.in	2019-07-10 09:35:08.919628625 -0500
 @@ -2,11 +2,7 @@
  if (NOT TARGET Qt5::qdbuscpp2xml)
      add_executable(Qt5::qdbuscpp2xml IMPORTED)
@@ -948,7 +961,7 @@ index 1d947159e2..b36865fc48 100644
      _qt5_DBus_check_file_exists(${imported_location})
  
      set_target_properties(Qt5::qdbuscpp2xml PROPERTIES
-@@ -17,11 +13,7 @@ endif()
+@@ -17,11 +13,7 @@
  if (NOT TARGET Qt5::qdbusxml2cpp)
      add_executable(Qt5::qdbusxml2cpp IMPORTED)
  
@@ -961,10 +974,9 @@ index 1d947159e2..b36865fc48 100644
      _qt5_DBus_check_file_exists(${imported_location})
  
      set_target_properties(Qt5::qdbusxml2cpp PROPERTIES
-diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
-index 07869efd7d..fb4183bada 100644
---- a/src/gui/Qt5GuiConfigExtras.cmake.in
-+++ b/src/gui/Qt5GuiConfigExtras.cmake.in
+diff -aur qtbase-everywhere-src-5.12.3-a/src/gui/Qt5GuiConfigExtras.cmake.in qtbase-everywhere-src-5.12.3-b/src/gui/Qt5GuiConfigExtras.cmake.in
+--- qtbase-everywhere-src-5.12.3-a/src/gui/Qt5GuiConfigExtras.cmake.in	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/src/gui/Qt5GuiConfigExtras.cmake.in	2019-07-10 09:35:08.919628625 -0500
 @@ -2,7 +2,7 @@
  !!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE)
  
@@ -974,7 +986,7 @@ index 07869efd7d..fb4183bada 100644
  !!ELSE
  set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR/QtANGLE\")
  !!ENDIF
-@@ -17,13 +17,13 @@ macro(_populate_qt5gui_gl_target_properties TargetName Configuration LIB_LOCATIO
+@@ -17,13 +17,13 @@
      set_property(TARGET Qt5::${TargetName} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
  
  !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
@@ -990,11 +1002,10 @@ index 07869efd7d..fb4183bada 100644
  !!ELSE
      set(imported_implib \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
  !!ENDIF
-diff --git a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
-index b5a0a5bbeb..6c20305f4d 100644
---- a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
-+++ b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
-@@ -265,12 +265,9 @@ void TableGenerator::initPossibleLocations()
+diff -aur qtbase-everywhere-src-5.12.3-a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp qtbase-everywhere-src-5.12.3-b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
+--- qtbase-everywhere-src-5.12.3-a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp	2019-07-10 09:35:08.919628625 -0500
+@@ -265,12 +265,9 @@
      m_possibleLocations.reserve(7);
      if (qEnvironmentVariableIsSet("QTCOMPOSE"))
          m_possibleLocations.append(QString::fromLocal8Bit(qgetenv("QTCOMPOSE")));
@@ -1008,11 +1019,10 @@ index b5a0a5bbeb..6c20305f4d 100644
  }
  
  QString TableGenerator::findComposeFile()
-diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
-index 57629ac03a..8a7f219a98 100644
---- a/src/plugins/platforms/xcb/qxcbcursor.cpp
-+++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
-@@ -316,10 +316,10 @@ QXcbCursor::QXcbCursor(QXcbConnection *conn, QXcbScreen *screen)
+diff -aur qtbase-everywhere-src-5.12.3-a/src/plugins/platforms/xcb/qxcbcursor.cpp qtbase-everywhere-src-5.12.3-b/src/plugins/platforms/xcb/qxcbcursor.cpp
+--- qtbase-everywhere-src-5.12.3-a/src/plugins/platforms/xcb/qxcbcursor.cpp	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/src/plugins/platforms/xcb/qxcbcursor.cpp	2019-07-10 09:35:08.919628625 -0500
+@@ -317,10 +317,10 @@
  #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
      static bool function_ptrs_not_initialized = true;
      if (function_ptrs_not_initialized) {
@@ -1025,10 +1035,10 @@ index 57629ac03a..8a7f219a98 100644
              xcursorFound = xcursorLib.load();
          }
          if (xcursorFound) {
-diff --git a/src/plugins/platformthemes/gtk3/main.cpp b/src/plugins/platformthemes/gtk3/main.cpp
-index fb1c425d8e..bb8bab9795 100644
---- a/src/plugins/platformthemes/gtk3/main.cpp
-+++ b/src/plugins/platformthemes/gtk3/main.cpp
+Only in qtbase-everywhere-src-5.12.3-b/src/plugins/platforms/xcb: qxcbcursor.cpp.orig
+diff -aur qtbase-everywhere-src-5.12.3-a/src/plugins/platformthemes/gtk3/main.cpp qtbase-everywhere-src-5.12.3-b/src/plugins/platformthemes/gtk3/main.cpp
+--- qtbase-everywhere-src-5.12.3-a/src/plugins/platformthemes/gtk3/main.cpp	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/src/plugins/platformthemes/gtk3/main.cpp	2019-07-10 09:35:08.919628625 -0500
 @@ -39,6 +39,7 @@
  
  #include <qpa/qplatformthemeplugin.h>
@@ -1037,7 +1047,7 @@ index fb1c425d8e..bb8bab9795 100644
  
  QT_BEGIN_NAMESPACE
  
-@@ -54,8 +55,22 @@ public:
+@@ -54,8 +55,22 @@
  QPlatformTheme *QGtk3ThemePlugin::create(const QString &key, const QStringList &params)
  {
      Q_UNUSED(params);
@@ -1061,10 +1071,21 @@ index fb1c425d8e..bb8bab9795 100644
  
      return 0;
  }
-diff --git a/src/testlib/qtestassert.h b/src/testlib/qtestassert.h
-index 6498ea84ef..d821ced7fc 100644
---- a/src/testlib/qtestassert.h
-+++ b/src/testlib/qtestassert.h
+diff -aur qtbase-everywhere-src-5.12.3-a/src/testlib/qappletestlogger.cpp qtbase-everywhere-src-5.12.3-b/src/testlib/qappletestlogger.cpp
+--- qtbase-everywhere-src-5.12.3-a/src/testlib/qappletestlogger.cpp	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/src/testlib/qappletestlogger.cpp	2019-07-10 09:35:08.920628655 -0500
+@@ -43,7 +43,7 @@
+ 
+ QT_BEGIN_NAMESPACE
+ 
+-#if defined(QT_USE_APPLE_UNIFIED_LOGGING)
++#if defined(QT_USE_APPLE_UNIFIED_LOGGING) && 0
+ 
+ using namespace QTestPrivate;
+ 
+diff -aur qtbase-everywhere-src-5.12.3-a/src/testlib/qtestassert.h qtbase-everywhere-src-5.12.3-b/src/testlib/qtestassert.h
+--- qtbase-everywhere-src-5.12.3-a/src/testlib/qtestassert.h	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/src/testlib/qtestassert.h	2019-07-10 09:35:08.919628625 -0500
 @@ -44,10 +44,13 @@
  
  QT_BEGIN_NAMESPACE
@@ -1081,11 +1102,10 @@ index 6498ea84ef..d821ced7fc 100644
  
  QT_END_NAMESPACE
  
-diff --git a/src/widgets/Qt5WidgetsConfigExtras.cmake.in b/src/widgets/Qt5WidgetsConfigExtras.cmake.in
-index 99d87e2e46..a4eab2aa72 100644
---- a/src/widgets/Qt5WidgetsConfigExtras.cmake.in
-+++ b/src/widgets/Qt5WidgetsConfigExtras.cmake.in
-@@ -3,7 +3,7 @@ if (NOT TARGET Qt5::uic)
+diff -aur qtbase-everywhere-src-5.12.3-a/src/widgets/Qt5WidgetsConfigExtras.cmake.in qtbase-everywhere-src-5.12.3-b/src/widgets/Qt5WidgetsConfigExtras.cmake.in
+--- qtbase-everywhere-src-5.12.3-a/src/widgets/Qt5WidgetsConfigExtras.cmake.in	2019-04-09 04:51:26.000000000 -0500
++++ qtbase-everywhere-src-5.12.3-b/src/widgets/Qt5WidgetsConfigExtras.cmake.in	2019-07-10 09:35:08.919628625 -0500
+@@ -3,7 +3,7 @@
      add_executable(Qt5::uic IMPORTED)
  
  !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
diff --git a/pkgs/development/libraries/qt-5/5.12/qttools.patch b/pkgs/development/libraries/qt-5/5.12/qttools.patch
new file mode 100644
index 00000000000..8ae12198ca2
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.12/qttools.patch
@@ -0,0 +1,15 @@
+--- a/src/macdeployqt/shared/shared.cpp
++++ b/src/macdeployqt/shared/shared.cpp
+@@ -1241,6 +1241,12 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
+     if (!QFile(qmlImportScannerPath).exists())
+         qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner";
+ 
++#ifdef NIXPKGS_QMLIMPORTSCANNER
++    // Fallback: Nixpkgs hardcoded path
++    if (!QFile(qmlImportScannerPath).exists())
++        qmlImportScannerPath = NIXPKGS_QMLIMPORTSCANNER;
++#endif
++
+     // Verify that we found a qmlimportscanner binary
+     if (!QFile(qmlImportScannerPath).exists()) {
+         LogError() << "qmlimportscanner not found at" << qmlImportScannerPath;
diff --git a/pkgs/development/libraries/qt-5/5.12/qtwebengine-darwin-no-platform-check.patch b/pkgs/development/libraries/qt-5/5.12/qtwebengine-darwin-no-platform-check.patch
new file mode 100644
index 00000000000..546e753144d
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.12/qtwebengine-darwin-no-platform-check.patch
@@ -0,0 +1,33 @@
+diff --git a/mkspecs/features/platform.prf b/mkspecs/features/platform.prf
+--- a/mkspecs/features/platform.prf
++++ b/mkspecs/features/platform.prf
+@@ -40,8 +40,6 @@ defineTest(isPlatformSupported) {
+   } else:osx {
+     # FIXME: Try to get it back down to 8.2 for building on OS X 10.11
+     !isMinXcodeVersion(8, 3, 3) {
+-      skipBuild("Using Xcode version $$QMAKE_XCODE_VERSION, but at least version 8.3.3 is required to build Qt WebEngine.")
+-      return(false)
+     }
+     !clang|intel_icc {
+         skipBuild("Qt WebEngine on macOS requires Clang.")
+@@ -54,8 +52,6 @@ defineTest(isPlatformSupported) {
+       return(false)
+     }
+     !isMinOSXSDKVersion(10, 12): {
+-      skipBuild("Building Qt WebEngine requires a macOS SDK version of 10.12 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
+-      return(false)
+     }
+   } else {
+     skipBuild("Unknown platform. Qt WebEngine only supports Linux, Windows, and macOS.")
+diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri
+--- a/src/core/config/mac_osx.pri
++++ b/src/core/config/mac_osx.pri
+@@ -5,8 +5,6 @@ load(functions)
+ # otherwise query for it.
+ QMAKE_MAC_SDK_VERSION = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.SDKVersion)
+ isEmpty(QMAKE_MAC_SDK_VERSION) {
+-     QMAKE_MAC_SDK_VERSION = $$system("/usr/bin/xcodebuild -sdk $${QMAKE_MAC_SDK} -version SDKVersion 2>/dev/null")
+-     isEmpty(QMAKE_MAC_SDK_VERSION): error("Could not resolve SDK version for \'$${QMAKE_MAC_SDK}\'")
+ }
+
+ QMAKE_CLANG_DIR = "/usr"
diff --git a/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-qos-classes.patch b/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-qos-classes.patch
new file mode 100644
index 00000000000..a7087f51762
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-qos-classes.patch
@@ -0,0 +1,11 @@
+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)
diff --git a/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-readline.patch b/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-readline.patch
new file mode 100644
index 00000000000..26d189d8601
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-readline.patch
@@ -0,0 +1,45 @@
+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
+ )
+ 
diff --git a/pkgs/development/libraries/qt-5/5.12/srcs.nix b/pkgs/development/libraries/qt-5/5.12/srcs.nix
index d83edc97e94..ce567c3a2bc 100644
--- a/pkgs/development/libraries/qt-5/5.12/srcs.nix
+++ b/pkgs/development/libraries/qt-5/5.12/srcs.nix
@@ -3,323 +3,323 @@
 
 {
   qt3d = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qt3d-everywhere-src-5.12.0.tar.xz";
-      sha256 = "1nii8qz8791ripmqd158qah40j2dj50zn7lmqksqz8gz2jfdqam1";
-      name = "qt3d-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qt3d-everywhere-src-5.12.3.tar.xz";
+      sha256 = "8997f07c816bbc6dd43fc2171801178bc65e704d35039998530cfa49837eaa7d";
+      name = "qt3d-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtactiveqt = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtactiveqt-everywhere-src-5.12.0.tar.xz";
-      sha256 = "0gkdx3mc6ysqlf0ci77kf9c961dc9sbi4j3z5q237d1w4js7ca52";
-      name = "qtactiveqt-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtactiveqt-everywhere-src-5.12.3.tar.xz";
+      sha256 = "15a5fde0a069f402bea9f422d8d2c46af440d202122c6307c2a6be642d20dc0f";
+      name = "qtactiveqt-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtandroidextras = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtandroidextras-everywhere-src-5.12.0.tar.xz";
-      sha256 = "0s083ngvya8bknp0bvgb3hyk6zr8shg8rmkzn98956dqz0xs3agm";
-      name = "qtandroidextras-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtandroidextras-everywhere-src-5.12.3.tar.xz";
+      sha256 = "866b3fbcfc2cbebdb83b5adec4e5d0bd29b0e0b0762d66fb3fef0b400e37254f";
+      name = "qtandroidextras-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtbase = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtbase-everywhere-src-5.12.0.tar.xz";
-      sha256 = "1jzfx8c0hzch0kmz2m4vkn65s7ikiymnm29lsymil4hfg0fj40sy";
-      name = "qtbase-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtbase-everywhere-src-5.12.3.tar.xz";
+      sha256 = "fddfd8852ef7503febeed67b876d1425160869ae2b1ae8e10b3fb0fedc5fe701";
+      name = "qtbase-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtcanvas3d = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtcanvas3d-everywhere-src-5.12.0.tar.xz";
-      sha256 = "0a61z5amp409aq9v7j0fyk003fbz2i247idl7lgfbl4qqh0ry6xj";
-      name = "qtcanvas3d-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtcanvas3d-everywhere-src-5.12.3.tar.xz";
+      sha256 = "c0821f1232c6bcd00648af9a5d1eade8e0397c6bfff60621e0fcdfc75561baea";
+      name = "qtcanvas3d-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtcharts = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtcharts-everywhere-src-5.12.0.tar.xz";
-      sha256 = "0l6lrrwqbqaf6agsghaw4ysm2vb6b4n9j5lgrs1i0q8h9i51rmww";
-      name = "qtcharts-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtcharts-everywhere-src-5.12.3.tar.xz";
+      sha256 = "820c94b2bf5d73e921fe99be1e3a03a6f012d96574a08e504d68db237522b3a9";
+      name = "qtcharts-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtconnectivity = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtconnectivity-everywhere-src-5.12.0.tar.xz";
-      sha256 = "1912a4my72wcqmmdyj24wkwq9p9ih4gzzzvgiq75pfwyhnxa3g4f";
-      name = "qtconnectivity-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtconnectivity-everywhere-src-5.12.3.tar.xz";
+      sha256 = "01518cee71a8d53b9c2387f8c7facbcc2c4d63ab3b79462edfa06ba3bfeae661";
+      name = "qtconnectivity-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtdatavis3d = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtdatavis3d-everywhere-src-5.12.0.tar.xz";
-      sha256 = "0czlj088gf2r6w5ahh0p8n36lbwmds86mxqijshmhzax5cspxnjf";
-      name = "qtdatavis3d-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtdatavis3d-everywhere-src-5.12.3.tar.xz";
+      sha256 = "f6d073c4575542f8ff6de3ac3b6e8dde6ae2d87e98119de7a13bc984aa967313";
+      name = "qtdatavis3d-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtdeclarative = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtdeclarative-everywhere-src-5.12.0.tar.xz";
-      sha256 = "0yr29hm3bqlwxcmna0bzyxw8k4hw3x8k3k4iiw2sw52p5c85izag";
-      name = "qtdeclarative-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtdeclarative-everywhere-src-5.12.3.tar.xz";
+      sha256 = "839881cd6996e35c351bc7d560372ebb91e61f3688957c33248c4f31ea007fa7";
+      name = "qtdeclarative-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtdoc = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtdoc-everywhere-src-5.12.0.tar.xz";
-      sha256 = "1k8caa1nmc9nrhb29vq1qzaz608klnjxy509w6ppxlzz2zbpcr9h";
-      name = "qtdoc-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtdoc-everywhere-src-5.12.3.tar.xz";
+      sha256 = "ce5e9d0f48d108c48d742ab2127ead735270d7b525103c6cf409683d7fc8334f";
+      name = "qtdoc-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtgamepad = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtgamepad-everywhere-src-5.12.0.tar.xz";
-      sha256 = "14b0np15gm5lzvip33pg6w9dfs065wwdfz18na28bhbxj6wh06ac";
-      name = "qtgamepad-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtgamepad-everywhere-src-5.12.3.tar.xz";
+      sha256 = "5d046869e9646912936e3622efa755d85ccc8eddba91f5b12880cfb5e6489642";
+      name = "qtgamepad-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtgraphicaleffects = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtgraphicaleffects-everywhere-src-5.12.0.tar.xz";
-      sha256 = "0m9l031zhw8il66ld8bj1lwqlc2xx89nl6dvssz1kl2d5nqqy1c1";
-      name = "qtgraphicaleffects-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtgraphicaleffects-everywhere-src-5.12.3.tar.xz";
+      sha256 = "772c98a009cc82ac290f868906c5aa719e4608ef3c5905d69ef7402b15924a73";
+      name = "qtgraphicaleffects-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtimageformats = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtimageformats-everywhere-src-5.12.0.tar.xz";
-      sha256 = "0bkkk5skpplwfbqv7g41rhgynyxs3khvf8gk2rl2gdixdplpv42z";
-      name = "qtimageformats-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtimageformats-everywhere-src-5.12.3.tar.xz";
+      sha256 = "db5a9e784f9c327c1e6830b1550311024cc91202d3b8dde82cd0944164298be2";
+      name = "qtimageformats-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtlocation = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtlocation-everywhere-src-5.12.0.tar.xz";
-      sha256 = "0ja4cwj59y1xhwwf4f5gzr0fdrrsxbh14g2x812n03x0yd6i78xh";
-      name = "qtlocation-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtlocation-everywhere-src-5.12.3.tar.xz";
+      sha256 = "52d589be2852ada0c000b06cc411b61e521cd0797470be567fd1625bcc9d75c6";
+      name = "qtlocation-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtmacextras = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtmacextras-everywhere-src-5.12.0.tar.xz";
-      sha256 = "00xhkj66i3srwmzzin1mcx9m94l5ns08f93c1za3wl23ani7n2nr";
-      name = "qtmacextras-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtmacextras-everywhere-src-5.12.3.tar.xz";
+      sha256 = "38dedd29d07ea9e4e92a7ef28f9e03c06cf9a1525aee4f8084310c519f5b47ed";
+      name = "qtmacextras-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtmultimedia = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtmultimedia-everywhere-src-5.12.0.tar.xz";
-      sha256 = "1a96x6c2w9rs6vfsdcnzmmad4w32dxy2dvismldcwmwcq2whqjsw";
-      name = "qtmultimedia-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtmultimedia-everywhere-src-5.12.3.tar.xz";
+      sha256 = "a30beeb37fb284d93522e29c01fb8d12726f40e9248e80b70b1f8ab60197a301";
+      name = "qtmultimedia-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtnetworkauth = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtnetworkauth-everywhere-src-5.12.0.tar.xz";
-      sha256 = "0x877ra8375pf8d8p6hgdkyw8yzjqfca6rgki6vi1q8fyi31j4a1";
-      name = "qtnetworkauth-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtnetworkauth-everywhere-src-5.12.3.tar.xz";
+      sha256 = "dd6bf334be29fb82adaeecb184779328b4ad33a069528b9954d9c07f2d889332";
+      name = "qtnetworkauth-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtpurchasing = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtpurchasing-everywhere-src-5.12.0.tar.xz";
-      sha256 = "1nk0dp247v1rfbnj84g99zsj6iv86pq32f478r92adz9qcgfs2yr";
-      name = "qtpurchasing-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtpurchasing-everywhere-src-5.12.3.tar.xz";
+      sha256 = "a848f1e1022af38571f5ab0c4ec4b904c12fa6ef19154d44abbcaeb35156753e";
+      name = "qtpurchasing-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtquickcontrols = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtquickcontrols-everywhere-src-5.12.0.tar.xz";
-      sha256 = "0wyd24aphpixi3k9vbxw73z3dy1xnf8hwc99wimr5mpf1cj67yrb";
-      name = "qtquickcontrols-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtquickcontrols-everywhere-src-5.12.3.tar.xz";
+      sha256 = "68ae03b35eaa44a24c3f663b842252053c9f2b00b18841fd39ff7d2150986f46";
+      name = "qtquickcontrols-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtquickcontrols2 = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtquickcontrols2-everywhere-src-5.12.0.tar.xz";
-      sha256 = "1ikxj32rd9pipnrz81l5ln700lnw8w6bx573w01x424sx0p7wxw9";
-      name = "qtquickcontrols2-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtquickcontrols2-everywhere-src-5.12.3.tar.xz";
+      sha256 = "e855e8369c3cb5a2ebcd2028a2a195ba73945fd9d5bc26134706c2fa14e99b3a";
+      name = "qtquickcontrols2-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtremoteobjects = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtremoteobjects-everywhere-src-5.12.0.tar.xz";
-      sha256 = "0pwx2m17yw1qqv8qigfndgj1yd5kq8w5cbiaqlw4zdk1m6jd0h09";
-      name = "qtremoteobjects-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtremoteobjects-everywhere-src-5.12.3.tar.xz";
+      sha256 = "3475a409127739930e0bf833cea5f7f605adc66ab25fac39b72ce4bf3039cc42";
+      name = "qtremoteobjects-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtscript = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtscript-everywhere-src-5.12.0.tar.xz";
-      sha256 = "1a7ziipvy8cfmrpw2b868167sw21zrqhfv2la0w9vs6hwli1mzlp";
-      name = "qtscript-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtscript-everywhere-src-5.12.3.tar.xz";
+      sha256 = "0f37bf032a2370bd08667aad053f5a57717ea49596c16bf6cfb32b0d6e5c1f9e";
+      name = "qtscript-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtscxml = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtscxml-everywhere-src-5.12.0.tar.xz";
-      sha256 = "0syx3bx9pxxrsxanfv245ifppjhbj7sbrndh8il86xlrcr9cwvnw";
-      name = "qtscxml-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtscxml-everywhere-src-5.12.3.tar.xz";
+      sha256 = "70c4b1f8e23560cf54e69aeb3ded4078434e6f78e1b9573fbad1ddace5fc4b19";
+      name = "qtscxml-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtsensors = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtsensors-everywhere-src-5.12.0.tar.xz";
-      sha256 = "19n5vlx0j5a0h86mpgs86qzsxbyq8fcrls7yqnjdaw0zga234cf5";
-      name = "qtsensors-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtsensors-everywhere-src-5.12.3.tar.xz";
+      sha256 = "7f63fedf60fdf110a3fc529568c7226d7acd59cc5eaee908f4d5a969e34005fc";
+      name = "qtsensors-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtserialbus = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtserialbus-everywhere-src-5.12.0.tar.xz";
-      sha256 = "16imi82v17n18a5m0i2fcfj6hqdpnzn2z9kdcf6a8h93fv4qd4kb";
-      name = "qtserialbus-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtserialbus-everywhere-src-5.12.3.tar.xz";
+      sha256 = "792cd2d411d2ebd737f5d09580f8db479cd35f2f7e7cedb4412075ef20fcfe4d";
+      name = "qtserialbus-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtserialport = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtserialport-everywhere-src-5.12.0.tar.xz";
-      sha256 = "1fx9fm0418jq05j2hlb52lblq8nr4m0hj8sizi86p708jmb01m2r";
-      name = "qtserialport-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtserialport-everywhere-src-5.12.3.tar.xz";
+      sha256 = "1faf7df4a1f9028bef1ce79330badb4e5cbbba9f717c53cafc5aea41eed1de51";
+      name = "qtserialport-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtspeech = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtspeech-everywhere-src-5.12.0.tar.xz";
-      sha256 = "1yx4wahl7iaj6lgpvnw8pdi2q4wc2fkpzfidd3j1bc98wpna4f8r";
-      name = "qtspeech-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtspeech-everywhere-src-5.12.3.tar.xz";
+      sha256 = "ed211822765744553fb5abeb97058420668b18a50d985061d949a0e068ee64f5";
+      name = "qtspeech-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtsvg = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtsvg-everywhere-src-5.12.0.tar.xz";
-      sha256 = "1kpvqd0p7dblgh26p3a99npqr0wmyg5yv0dcmf78ssrvsy58vrpb";
-      name = "qtsvg-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtsvg-everywhere-src-5.12.3.tar.xz";
+      sha256 = "f666438dbf6816b7534e539b95e3fa4405f11d7e2e2bbcde34f2db5ae0f27dc2";
+      name = "qtsvg-everywhere-src-5.12.3.tar.xz";
     };
   };
   qttools = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qttools-everywhere-src-5.12.0.tar.xz";
-      sha256 = "1hyschrj568h65m3kl35xqz25hpk61vr98r08375vkavdr5y6k2p";
-      name = "qttools-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qttools-everywhere-src-5.12.3.tar.xz";
+      sha256 = "c9e92d2f0d369e44bb1a60e9fa6d970f8d9893d653212305e04be5e6daec2cd8";
+      name = "qttools-everywhere-src-5.12.3.tar.xz";
     };
   };
   qttranslations = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qttranslations-everywhere-src-5.12.0.tar.xz";
-      sha256 = "023m68vdjj75xnbpc1jflyg85amnjc9i6nwv650k0w4n1dp1hksv";
-      name = "qttranslations-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qttranslations-everywhere-src-5.12.3.tar.xz";
+      sha256 = "eefcec0a91c302548f9d948a138b8ec77d78570ce818931bd8475b1bff1205ca";
+      name = "qttranslations-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtvirtualkeyboard = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtvirtualkeyboard-everywhere-src-5.12.0.tar.xz";
-      sha256 = "1nnns0i577zda6qxxd7pxcy06dq0y7lnni8ghn4adh9yl6dvi4yv";
-      name = "qtvirtualkeyboard-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtvirtualkeyboard-everywhere-src-5.12.3.tar.xz";
+      sha256 = "7b83af4527310de4ab81146622f3a46677daabf05556d0e33a2e25ca2aa13b22";
+      name = "qtvirtualkeyboard-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtwayland = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtwayland-everywhere-src-5.12.0.tar.xz";
-      sha256 = "1mvyv4wkcxj4h3q0mqw53zb1d0pahf8mz3r29kckadvk64djsp2m";
-      name = "qtwayland-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtwayland-everywhere-src-5.12.3.tar.xz";
+      sha256 = "f0b45ad84180730e2d5a1249eb20c6357869b4b78f45eb266c2f2b17f77d86ff";
+      name = "qtwayland-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtwebchannel = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtwebchannel-everywhere-src-5.12.0.tar.xz";
-      sha256 = "1w2b31d7xjzdcgwkb4mz3qrl9ci7c9l4c3v4h8y59isip45g66l5";
-      name = "qtwebchannel-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtwebchannel-everywhere-src-5.12.3.tar.xz";
+      sha256 = "72d1620bcc94e14caa91ddf344c84cd1288aa9479e00b1bb3b5e51f92efe088a";
+      name = "qtwebchannel-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtwebengine = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtwebengine-everywhere-src-5.12.0.tar.xz";
-      sha256 = "0z38ad25n7ckylxnmqrxy95ds4pn7i5k7qxh856zgq1h18wiwn5x";
-      name = "qtwebengine-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtwebengine-everywhere-src-5.12.3.tar.xz";
+      sha256 = "3ff3bac12d75aa0f3fd993bb7077fe411f7b0e6a3993af6f8b039d48e3dc4317";
+      name = "qtwebengine-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtwebglplugin = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtwebglplugin-everywhere-src-5.12.0.tar.xz";
-      sha256 = "0bk5dg33kn2l5lmgd6slsrs9xg15x9h9li91lr1q7qs67b8kl8k5";
-      name = "qtwebglplugin-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtwebglplugin-everywhere-src-5.12.3.tar.xz";
+      sha256 = "23da63013101e97c4e663bb4f6dbb1c7b4386679c634680d3b8d79bcc59d26b3";
+      name = "qtwebglplugin-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtwebsockets = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtwebsockets-everywhere-src-5.12.0.tar.xz";
-      sha256 = "0gzwfjnlgcijym5bn9gi93qlvzizrhf1q9dq06576419sg0s2ka4";
-      name = "qtwebsockets-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtwebsockets-everywhere-src-5.12.3.tar.xz";
+      sha256 = "258883225c5e089015c4036f31019aa8f5bb013ecd8eecd193342e606319a577";
+      name = "qtwebsockets-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtwebview = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtwebview-everywhere-src-5.12.0.tar.xz";
-      sha256 = "11b16b31bxcazqzg1ag9rzh4gj9pif2cf3jz2mj1sdprxp22ra5p";
-      name = "qtwebview-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtwebview-everywhere-src-5.12.3.tar.xz";
+      sha256 = "f904e7fd7e755527e5bc4633c6f7c144065a3ffea473bf01fffb730385a983c5";
+      name = "qtwebview-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtwinextras = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtwinextras-everywhere-src-5.12.0.tar.xz";
-      sha256 = "1l6s140vrfxb9ar4p1dq9w2gfk3zvgrpqdxbbzs4ngfpwk6mlky6";
-      name = "qtwinextras-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtwinextras-everywhere-src-5.12.3.tar.xz";
+      sha256 = "2b6319f7dd19fc19b028685c163a69f0a10e610d7554411d4660c1b5e42ada3b";
+      name = "qtwinextras-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtx11extras = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtx11extras-everywhere-src-5.12.0.tar.xz";
-      sha256 = "114b4akzpcgx57c6gkl558bl0mbasi34r22fmq3ny84dhvlv9m06";
-      name = "qtx11extras-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtx11extras-everywhere-src-5.12.3.tar.xz";
+      sha256 = "85e3ae5177970c2d8656226d7535d0dff5764c100e55a79a59161d80754ba613";
+      name = "qtx11extras-everywhere-src-5.12.3.tar.xz";
     };
   };
   qtxmlpatterns = {
-    version = "5.12.0";
+    version = "5.12.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.0/submodules/qtxmlpatterns-everywhere-src-5.12.0.tar.xz";
-      sha256 = "0xckcw1j6f5l92c269pb8cx77d21sghp7m7dc05jl1dqmyy7jqpk";
-      name = "qtxmlpatterns-everywhere-src-5.12.0.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtxmlpatterns-everywhere-src-5.12.3.tar.xz";
+      sha256 = "e0b98e7c92cd791a9b354d090788347db78f14c47579384fe22d0b650c1d8a61";
+      name = "qtxmlpatterns-everywhere-src-5.12.3.tar.xz";
     };
   };
 }
diff --git a/pkgs/development/libraries/qt-5/5.6/default.nix b/pkgs/development/libraries/qt-5/5.6/default.nix
index e493fc169ab..4f739b57ffe 100644
--- a/pkgs/development/libraries/qt-5/5.6/default.nix
+++ b/pkgs/development/libraries/qt-5/5.6/default.nix
@@ -26,10 +26,9 @@ existing packages here and modify it as necessary.
 
 {
   newScope,
-  stdenv, fetchurl, fetchpatch, makeSetupHook,
+  stdenv, fetchurl, fetchpatch, makeSetupHook, makeWrapper,
   bison, cups ? null, harfbuzz, libGL, perl,
   gstreamer, gst-plugins-base,
-  cf-private,
 
   # options
   developerBuild ? false,
@@ -105,14 +104,18 @@ let
     ];
   };
 
-  mkDerivation =
-    import ../mkDerivation.nix
-    { inherit stdenv; inherit (stdenv) lib; }
-    { inherit debug; };
-
   qtModule =
     import ../qtModule.nix
-    { inherit mkDerivation perl; inherit (stdenv) lib; }
+    {
+      inherit perl;
+      inherit (stdenv) lib;
+      # Use a variant of mkDerivation that does not include wrapQtApplications
+      # to avoid cyclic dependencies between Qt modules.
+      mkDerivation =
+        import ../mkDerivation.nix
+        { inherit (stdenv) lib; inherit debug; wrapQtAppsHook = null; }
+        stdenv.mkDerivation;
+    }
     { inherit self srcs patches; };
 
   addPackages = self: with self;
@@ -120,7 +123,11 @@ let
       callPackage = self.newScope { inherit qtCompatVersion qtModule srcs; };
     in {
 
-      inherit mkDerivation;
+      mkDerivationWith =
+        import ../mkDerivation.nix
+        { inherit (stdenv) lib; inherit debug; inherit (self) wrapQtAppsHook; };
+
+      mkDerivation = mkDerivationWith stdenv.mkDerivation;
 
       qtbase = callPackage ../modules/qtbase.nix {
         inherit bison cups harfbuzz libGL;
@@ -133,9 +140,7 @@ let
       /* qtactiveqt = not packaged */
       /* qtandroidextras = not packaged */
       /* qtcanvas3d = not packaged */
-      qtconnectivity = callPackage ../modules/qtconnectivity.nix {
-        inherit cf-private;
-      };
+      qtconnectivity = callPackage ../modules/qtconnectivity.nix {};
       qtdeclarative = callPackage ../modules/qtdeclarative.nix {};
       qtdoc = callPackage ../modules/qtdoc.nix {};
       qtgraphicaleffects = callPackage ../modules/qtgraphicaleffects.nix {};
@@ -176,6 +181,12 @@ let
         deps = [ self.qtbase.dev ];
         substitutions = { inherit (stdenv) isDarwin; };
       } ../hooks/qmake-hook.sh;
+
+      wrapQtAppsHook = makeSetupHook {
+        deps =
+          [ self.qtbase.dev makeWrapper ]
+          ++ optional stdenv.isLinux self.qtwayland.dev;
+      } ../hooks/wrap-qt-apps-hook.sh;
     };
 
    self = makeScope newScope addPackages;
diff --git a/pkgs/development/libraries/qt-5/5.6/fetch.sh b/pkgs/development/libraries/qt-5/5.6/fetch.sh
index ee3a5ddf8de..bb9eb66a01d 100644
--- a/pkgs/development/libraries/qt-5/5.6/fetch.sh
+++ b/pkgs/development/libraries/qt-5/5.6/fetch.sh
@@ -1,3 +1,2 @@
 WGET_ARGS=( http://download.qt.io/official_releases/qt/5.6/5.6.3/submodules/ \
-            http://download.qt.io/community_releases/5.6/5.6.3/ \
-            -A '*.tar.xz' )
+            http://download.qt.io/community_releases/5.6/5.6.3/ )
diff --git a/pkgs/development/libraries/qt-5/5.9/default.nix b/pkgs/development/libraries/qt-5/5.9/default.nix
index 589f175efd9..f36f86e26ff 100644
--- a/pkgs/development/libraries/qt-5/5.9/default.nix
+++ b/pkgs/development/libraries/qt-5/5.9/default.nix
@@ -17,10 +17,9 @@ top-level attribute to `top-level/all-packages.nix`.
 
 {
   newScope,
-  stdenv, fetchurl, fetchpatch, makeSetupHook,
+  stdenv, fetchurl, fetchpatch, makeSetupHook, makeWrapper,
   bison, cups ? null, harfbuzz, libGL, perl,
   gstreamer, gst-plugins-base, gtk3, dconf,
-  cf-private,
 
   # options
   developerBuild ? false,
@@ -38,12 +37,14 @@ 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 ];
     qttools = [ ./qttools.patch ];
-    qtwebengine = [ ./qtwebengine-no-build-skip.patch ];
+    qtwebengine = [ ./qtwebengine-no-build-skip.patch ]
+      ++ optional stdenv.cc.isClang ./qtwebengine-clang-fix.patch
+      ++ optional stdenv.isDarwin ./qtwebengine-darwin-no-platform-check.patch;
     qtwebkit = [ ./qtwebkit.patch ];
     qtvirtualkeyboard = [
       (fetchpatch {
@@ -66,14 +67,18 @@ let
 
   };
 
-  mkDerivation =
-    import ../mkDerivation.nix
-    { inherit stdenv; inherit (stdenv) lib; }
-    { inherit debug; };
-
   qtModule =
     import ../qtModule.nix
-    { inherit mkDerivation perl; inherit (stdenv) lib; }
+    {
+      inherit perl;
+      inherit (stdenv) lib;
+      # Use a variant of mkDerivation that does not include wrapQtApplications
+      # to avoid cyclic dependencies between Qt modules.
+      mkDerivation =
+        import ../mkDerivation.nix
+        { inherit (stdenv) lib; inherit debug; wrapQtAppsHook = null; }
+        stdenv.mkDerivation;
+    }
     { inherit self srcs patches; };
 
   addPackages = self: with self;
@@ -81,7 +86,11 @@ let
       callPackage = self.newScope { inherit qtCompatVersion qtModule srcs; };
     in {
 
-      inherit mkDerivation;
+      mkDerivationWith =
+        import ../mkDerivation.nix
+        { inherit (stdenv) lib; inherit debug; inherit (self) wrapQtAppsHook; };
+
+      mkDerivation = mkDerivationWith stdenv.mkDerivation;
 
       qtbase = callPackage ../modules/qtbase.nix {
         inherit (srcs.qtbase) src version;
@@ -92,20 +101,17 @@ let
       };
 
       qtcharts = callPackage ../modules/qtcharts.nix {};
-      qtconnectivity = callPackage ../modules/qtconnectivity.nix {
-        inherit cf-private;
-      };
+      qtconnectivity = callPackage ../modules/qtconnectivity.nix {};
       qtdeclarative = callPackage ../modules/qtdeclarative.nix {};
       qtdoc = callPackage ../modules/qtdoc.nix {};
       qtgraphicaleffects = callPackage ../modules/qtgraphicaleffects.nix {};
       qtimageformats = callPackage ../modules/qtimageformats.nix {};
       qtlocation = callPackage ../modules/qtlocation.nix {};
-      qtmacextras = callPackage ../modules/qtmacextras.nix {
-        inherit cf-private;
-      };
+      qtmacextras = callPackage ../modules/qtmacextras.nix {};
       qtmultimedia = callPackage ../modules/qtmultimedia.nix {
         inherit gstreamer gst-plugins-base;
       };
+      qtnetworkauth = callPackage ../modules/qtnetworkauth.nix {};
       qtquick1 = null;
       qtquickcontrols = callPackage ../modules/qtquickcontrols.nix {};
       qtquickcontrols2 = callPackage ../modules/qtquickcontrols2.nix {};
@@ -142,6 +148,12 @@ let
           fix_qt_builtin_paths = ../hooks/fix-qt-builtin-paths.sh;
         };
       } ../hooks/qmake-hook.sh;
+
+      wrapQtAppsHook = makeSetupHook {
+        deps =
+          [ self.qtbase.dev makeWrapper ]
+          ++ optional stdenv.isLinux self.qtwayland.dev;
+      } ../hooks/wrap-qt-apps-hook.sh;
     };
 
    self = makeScope newScope addPackages;
diff --git a/pkgs/development/libraries/qt-5/5.9/fetch.sh b/pkgs/development/libraries/qt-5/5.9/fetch.sh
index e631d3ae9b0..17ebe1e532d 100644
--- a/pkgs/development/libraries/qt-5/5.9/fetch.sh
+++ b/pkgs/development/libraries/qt-5/5.9/fetch.sh
@@ -1,2 +1 @@
-WGET_ARGS=( http://download.qt.io/official_releases/qt/5.9/5.9.7/submodules/ \
-            -A '*.tar.xz' )
+WGET_ARGS=( http://download.qt.io/official_releases/qt/5.9/5.9.7/submodules/ )
diff --git a/pkgs/development/libraries/qt-5/5.9/qtbase-darwin.patch b/pkgs/development/libraries/qt-5/5.9/qtbase-darwin.patch
deleted file mode 100644
index 875fba12e2f..00000000000
--- a/pkgs/development/libraries/qt-5/5.9/qtbase-darwin.patch
+++ /dev/null
@@ -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)
diff --git a/pkgs/development/libraries/qt-5/5.9/qtwebengine-clang-fix.patch b/pkgs/development/libraries/qt-5/5.9/qtwebengine-clang-fix.patch
new file mode 100644
index 00000000000..cf082cddd11
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.9/qtwebengine-clang-fix.patch
@@ -0,0 +1,38 @@
+Fix a following build error:
+
+In file included from ../../3rdparty/chromium/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm:7:
+In file included from ../../3rdparty/chromium/base/bind.h:8:
+../../3rdparty/chromium/base/bind_internal.h:214:31: error: cannot initialize a parameter of type 'NSError *' with an lvalue of type 'const long'
+    return (receiver.*method)(std::forward<RunArgs>(args)...);
+                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
+../../3rdparty/chromium/base/bind_internal.h:285:20: note: in instantiation of function template specialization 'base::internal::FunctorTraits<void (device::BluetoothRemoteGat
+tCharacteristicMac::*)(NSError *), void>::Invoke<device::BluetoothRemoteGattCharacteristicMac *, const long &>' requested here
+    return Traits::Invoke(std::forward<Functor>(functor),
+                   ^
+../../3rdparty/chromium/base/bind_internal.h:361:43: note: in instantiation of function template specialization 'base::internal::InvokeHelper<false, void>::MakeItSo<void (devi
+ce::BluetoothRemoteGattCharacteristicMac::*const &)(NSError *), device::BluetoothRemoteGattCharacteristicMac *, const long &>' requested here
+    return InvokeHelper<is_weak_call, R>::MakeItSo(
+                                          ^
+../../3rdparty/chromium/base/bind_internal.h:339:12: note: in instantiation of function template specialization 'base::internal::Invoker<base::internal::BindState<void (device::BluetoothRemoteGattCharacteristicMac::*)(NSError *), base::internal::UnretainedWrapper<device::BluetoothRemoteGattCharacteristicMac>, long>, void ()>::RunImpl<void (device::BluetoothRemoteGattCharacteristicMac::*const &)(NSError *), const std::__1::tuple<base::internal::UnretainedWrapper<device::BluetoothRemoteGattCharacteristicMac>, long> &, 0, 1>' requested here
+    return RunImpl(storage->functor_,
+           ^
+../../3rdparty/chromium/base/bind.h:62:45: note: in instantiation of member function 'base::internal::Invoker<base::internal::BindState<void (device::BluetoothRemoteGattCharacteristicMac::*)(NSError *), base::internal::UnretainedWrapper<device::BluetoothRemoteGattCharacteristicMac>, long>, void ()>::Run' requested here
+  PolymorphicInvoke invoke_func = &Invoker::Run;
+                                            ^
+../../3rdparty/chromium/base/bind.h:77:10: note: in instantiation of function template specialization 'base::BindRepeating<void (device::BluetoothRemoteGattCharacteristicMac::*)(NSError *), base::internal::UnretainedWrapper<device::BluetoothRemoteGattCharacteristicMac>, long>' requested here
+  return BindRepeating(std::forward<Functor>(functor),
+         ^
+../../3rdparty/chromium/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm:241:15: note: in instantiation of function template specialization 'base::Bind<void (device::BluetoothRemoteGattCharacteristicMac::*)(NSError *), base::internal::UnretainedWrapper<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
+@@ -239,7 +239,7 @@ void BluetoothRemoteGattCharacteristicMac::WriteRemoteCharacteristic(
+     base::ThreadTaskRunnerHandle::Get()->PostTask(
+         FROM_HERE,
+         base::Bind(&BluetoothRemoteGattCharacteristicMac::DidWriteValue,
+-                   base::Unretained(this), nil));
++                   base::Unretained(this), nullptr));
+   }
+ }
+ 
diff --git a/pkgs/development/libraries/qt-5/5.9/qtwebengine-darwin-no-platform-check.patch b/pkgs/development/libraries/qt-5/5.9/qtwebengine-darwin-no-platform-check.patch
new file mode 100644
index 00000000000..7156c41c5ec
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.9/qtwebengine-darwin-no-platform-check.patch
@@ -0,0 +1,50 @@
+diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
+--- a/mkspecs/features/configure.prf
++++ b/mkspecs/features/configure.prf
+@@ -194,9 +194,6 @@ defineTest(runConfigure) {
+         } else {
+             log("Native Spellchecker .............. Not enabled         (Default, enable with WEBENGINE_CONFIG+=use_native_spellchecker)$${EOL}")
+         }
+-        !isMinOSXSDKVersion(10, 10, 3) {
+-            log("  Force Touch API usage .............. Not enabled         (Because the OS X SDK version to be used \"$${WEBENGINE_OSX_SDK_PRODUCT_VERSION}\" is lower than the required \"10.10.3\")$${EOL}")
+-        }
+     }
+ }
+ 
+diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf
+--- a/mkspecs/features/functions.prf
++++ b/mkspecs/features/functions.prf
+@@ -38,10 +38,6 @@ defineTest(isPlatformSupported) {
+       return(false)
+     }
+   } else:osx {
+-    !isMinXcodeVersion(5, 1) {
+-      skipBuild("Using XCode version $$QMAKE_XCODE_VERSION, but at least version 5.1 is required to build Qt WebEngine.")
+-      return(false)
+-    }
+     !clang|intel_icc {
+         skipBuild("Qt WebEngine on macOS requires Clang.")
+         return(false)
+@@ -52,10 +48,6 @@ defineTest(isPlatformSupported) {
+       skipBuild("Qt WebEngine requires OS X version 10.10 or newer.")
+       return(false)
+     }
+-    !isMinOSXSDKVersion(10, 10): {
+-      skipBuild("Qt WebEngine requires an OS X SDK version of 10.10 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
+-      return(false)
+-    }
+   } else {
+     skipBuild("Unknown platform. Qt WebEngine only supports Linux, Windows, and OS X.")
+     return(false)
+diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri
+--- a/src/core/config/mac_osx.pri
++++ b/src/core/config/mac_osx.pri
+@@ -5,8 +5,6 @@ load(functions)
+ # otherwise query for it.
+ QMAKE_MAC_SDK_VERSION = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.SDKVersion)
+ isEmpty(QMAKE_MAC_SDK_VERSION) {
+-     QMAKE_MAC_SDK_VERSION = $$system("/usr/bin/xcodebuild -sdk $${QMAKE_MAC_SDK} -version SDKVersion 2>/dev/null")
+-     isEmpty(QMAKE_MAC_SDK_VERSION): error("Could not resolve SDK version for \'$${QMAKE_MAC_SDK}\'")
+ }
+ 
+ QMAKE_CLANG_DIR = "/usr"
diff --git a/pkgs/development/libraries/qt-5/5.9/qtwebkit.patch b/pkgs/development/libraries/qt-5/5.9/qtwebkit.patch
index c78cb58f564..718bda36194 100644
--- a/pkgs/development/libraries/qt-5/5.9/qtwebkit.patch
+++ b/pkgs/development/libraries/qt-5/5.9/qtwebkit.patch
@@ -1,16 +1,3 @@
-diff --git a/Source/WTF/WTF.pri b/Source/WTF/WTF.pri
-index 69e4cd1f3..3f729a75e 100644
---- a/Source/WTF/WTF.pri
-+++ b/Source/WTF/WTF.pri
-@@ -12,7 +12,7 @@ mac {
-     # Mac OS does ship libicu but not the associated header files.
-     # Therefore WebKit provides adequate header files.
-     INCLUDEPATH = $${ROOT_WEBKIT_DIR}/Source/WTF/icu $$INCLUDEPATH
--    LIBS += -licucore
-+    LIBS += /usr/lib/libicucore.dylib
- } else:!use?(wchar_unicode): {
-     win32 {
-         CONFIG(static, static|shared) {
 diff --git a/Source/WebCore/plugins/qt/PluginPackageQt.cpp b/Source/WebCore/plugins/qt/PluginPackageQt.cpp
 index a923d49aa..46772a4bb 100644
 --- a/Source/WebCore/plugins/qt/PluginPackageQt.cpp
diff --git a/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh b/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
index 3a558153988..436c2e1d032 100644
--- a/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
+++ b/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
@@ -19,12 +19,14 @@ export QMAKEPATH
 QMAKEMODULES=
 export QMAKEMODULES
 
-addToQMAKEPATH() {
-    if [ -d "$1/mkspecs" ]; then
+qmakePathHook() {
+    if [ -d "$1/mkspecs" ]
+    then
         QMAKEMODULES="${QMAKEMODULES}${QMAKEMODULES:+:}/mkspecs"
         QMAKEPATH="${QMAKEPATH}${QMAKEPATH:+:}$1"
     fi
 }
+envBuildHostHooks+=(qmakePathHook)
 
 # Propagate any runtime dependency of the building package.
 # Each dependency is propagated to the user environment and as a build
@@ -32,18 +34,18 @@ addToQMAKEPATH() {
 # package depending on the building package. (This is necessary in case
 # the building package does not provide runtime dependencies itself and so
 # would not be propagated to the user environment.)
-qtEnvHook() {
-    addToQMAKEPATH "$1"
-    if providesQtRuntime "$1"; then
-        if [ "z${!outputBin}" != "z${!outputDev}" ]; then
-            propagatedBuildInputs+=" $1"
-        fi
-        propagatedUserEnvPkgs+=" $1"
+qtEnvHostTargetHook() {
+    if providesQtRuntime "$1" && [ "z${!outputBin}" != "z${!outputDev}" ]
+    then
+        propagatedBuildInputs+=" $1"
     fi
 }
-envHostTargetHooks+=(qtEnvHook)
+envHostTargetHooks+=(qtEnvHostTargetHook)
 
 postPatchMkspecs() {
+    # Prevent this hook from running multiple times
+    dontPatchMkspecs=1
+
     local bin="${!outputBin}"
     local dev="${!outputDev}"
     local doc="${!outputDoc}"
diff --git a/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh b/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh
new file mode 100644
index 00000000000..83f62e4ec2b
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh
@@ -0,0 +1,106 @@
+# Inherit arguments given in mkDerivation
+qtWrapperArgs=( $qtWrapperArgs )
+
+qtHostPathSeen=()
+
+qtUnseenHostPath() {
+    for pkg in "${qtHostPathSeen[@]}"
+    do
+        if [ "${pkg:?}" == "$1" ]
+        then
+            return 1
+        fi
+    done
+
+    qtHostPathSeen+=("$1")
+    return 0
+}
+
+qtHostPathHook() {
+    qtUnseenHostPath "$1" || return 0
+
+    local pluginDir="$1/${qtPluginPrefix:?}"
+    if [ -d "$pluginDir" ]
+    then
+        qtWrapperArgs+=(--prefix QT_PLUGIN_PATH : "$pluginDir")
+    fi
+
+    local qmlDir="$1/${qtQmlPrefix:?}"
+    if [ -d "$qmlDir" ]
+    then
+        qtWrapperArgs+=(--prefix QML2_IMPORT_PATH : "$qmlDir")
+    fi
+}
+addEnvHooks "$hostOffset" qtHostPathHook
+
+makeQtWrapper() {
+    local original="$1"
+    local wrapper="$2"
+    shift 2
+    makeWrapper "$original" "$wrapper" "${qtWrapperArgs[@]}" "$@"
+}
+
+wrapQtApp() {
+    local program="$1"
+    shift 1
+    wrapProgram "$program" "${qtWrapperArgs[@]}" "$@"
+}
+
+qtOwnPathsHook() {
+    local xdgDataDir="${!outputBin}/share"
+    if [ -d "$xdgDataDir" ]
+    then
+        qtWrapperArgs+=(--prefix XDG_DATA_DIRS : "$xdgDataDir")
+    fi
+
+    local xdgConfigDir="${!outputBin}/etc/xdg"
+    if [ -d "$xdgConfigDir" ]
+    then
+        qtWrapperArgs+=(--prefix XDG_CONFIG_DIRS : "$xdgConfigDir")
+    fi
+
+    qtHostPathHook "${!outputBin}"
+}
+
+preFixupPhases+=" qtOwnPathsHook"
+
+isQtApp () {
+    readelf -d "$1" 2>/dev/null | grep -q -F 'libQt5Core'
+}
+
+# Note: $qtWrapperArgs still gets defined even if $dontWrapQtApps is set.
+wrapQtAppsHook() {
+    # skip this hook when requested
+    [ -z "$dontWrapQtApps" ] || return 0
+
+    # guard against running multiple times (e.g. due to propagation)
+    [ -z "$wrapQtAppsHookHasRun" ] || return 0
+    wrapQtAppsHookHasRun=1
+
+    local targetDirs=( "$prefix/bin" )
+    echo "wrapping Qt applications in ${targetDirs[@]}"
+
+    for targetDir in "${targetDirs[@]}"
+    do
+        [ -d "$targetDir" ] || continue
+
+        find "$targetDir" -executable -print0 | while IFS= read -r -d '' file
+        do
+            isQtApp "$file" || continue
+
+            if [ -f "$file" ]
+            then
+                echo "wrapping $file"
+                wrapQtApp "$file"
+            elif [ -h "$file" ]
+            then
+                target="$(readlink -e "$file")"
+                echo "wrapping $file -> $target"
+                rm "$file"
+                makeQtWrapper "$target" "$file"
+            fi
+        done
+    done
+}
+
+fixupOutputHooks+=(wrapQtAppsHook)
diff --git a/pkgs/development/libraries/qt-5/mkDerivation.nix b/pkgs/development/libraries/qt-5/mkDerivation.nix
index 96014cfbc77..95357c096df 100644
--- a/pkgs/development/libraries/qt-5/mkDerivation.nix
+++ b/pkgs/development/libraries/qt-5/mkDerivation.nix
@@ -1,8 +1,8 @@
-{ stdenv, lib }:
+{ lib, debug, wrapQtAppsHook }:
 
 let inherit (lib) optional; in
 
-{ debug }:
+mkDerivation:
 
 args:
 
@@ -19,13 +19,14 @@ let
     cmakeFlags =
       (args.cmakeFlags or [])
       ++ [
-        "-DBUILD_TESTING=OFF"
         ("-DCMAKE_BUILD_TYPE=" + (if debug then "Debug" else "Release"))
       ];
 
     enableParallelBuilding = args.enableParallelBuilding or true;
 
+    nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ wrapQtAppsHook ];
+
   };
 in
 
-stdenv.mkDerivation (args // args_)
+mkDerivation (args // args_)
diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix
index b3d12fcea46..a1c3bea866e 100644
--- a/pkgs/development/libraries/qt-5/modules/qtbase.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix
@@ -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,
@@ -56,7 +56,7 @@ stdenv.mkDerivation {
           # TODO: move to buildInputs, this should not be propagated.
           AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth
           CoreLocation CoreServices DiskArbitration Foundation OpenGL
-          darwin.libobjc libiconv
+          darwin.libobjc libiconv MetalKit
         ]
       else
         [
@@ -78,17 +78,13 @@ stdenv.mkDerivation {
       [ libinput ]
       ++ lib.optional withGtk3 gtk3
     )
-    ++ lib.optional stdenv.isDarwin
-      # Needed for OBJC_CLASS_$_NSDate symbols.
-      [ 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 +195,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
-          [
-            ''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"''
-            ''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"''
-          ]
-    )
-
+    ++ 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 ";
@@ -248,6 +229,8 @@ stdenv.mkDerivation {
       "-widgets"
       "-opengl desktop"
       "-icu"
+      "-L" "${icu.out}/lib"
+      "-I" "${icu.dev}/include"
       "-pch"
     ]
     ++ lib.optionals (compareVersion "5.11.0" < 0)
@@ -266,25 +249,36 @@ stdenv.mkDerivation {
     ++ (
       if (!stdenv.hostPlatform.isx86_64)
       then [ "-no-sse2" ]
-      else lib.optional (compareVersion "5.9.0" >= 0) [ "-sse2" ]
+      else lib.optionals (compareVersion "5.9.0" >= 0) {
+        "default"        = [ "-sse2" "-no-sse3" "-no-ssse3" "-no-sse4.1" "-no-sse4.2" "-no-avx" "-no-avx2" ];
+        "westmere"       = [ "-sse2"    "-sse3"    "-ssse3"    "-sse4.1"    "-sse4.2" "-no-avx" "-no-avx2" ];
+        "sandybridge"    = [ "-sse2"    "-sse3"    "-ssse3"    "-sse4.1"    "-sse4.2"    "-avx" "-no-avx2" ];
+        "ivybridge"      = [ "-sse2"    "-sse3"    "-ssse3"    "-sse4.1"    "-sse4.2"    "-avx" "-no-avx2" ];
+        "haswell"        = [ "-sse2"    "-sse3"    "-ssse3"    "-sse4.1"    "-sse4.2"    "-avx"    "-avx2" ];
+        "broadwell"      = [ "-sse2"    "-sse3"    "-ssse3"    "-sse4.1"    "-sse4.2"    "-avx"    "-avx2" ];
+        "skylake"        = [ "-sse2"    "-sse3"    "-ssse3"    "-sse4.1"    "-sse4.2"    "-avx"    "-avx2" ];
+        "skylake-avx512" = [ "-sse2"    "-sse3"    "-ssse3"    "-sse4.1"    "-sse4.2"    "-avx"    "-avx2" ];
+      }.${stdenv.hostPlatform.platform.gcc.arch or "default"}
     )
     ++ [
-      "-no-sse3"
-      "-no-ssse3"
-      "-no-sse4.1"
-      "-no-sse4.2"
-      "-no-avx"
-      "-no-avx2"
       "-no-mips_dsp"
       "-no-mips_dspr2"
     ]
 
     ++ [
       "-system-zlib"
+      "-L" "${zlib.out}/lib"
+      "-I" "${zlib.dev}/include"
       "-system-libjpeg"
+      "-L" "${libjpeg.out}/lib"
+      "-I" "${libjpeg.dev}/include"
       "-system-harfbuzz"
+      "-L" "${harfbuzz.out}/lib"
+      "-I" "${harfbuzz.dev}/include"
       "-system-pcre"
       "-openssl-linked"
+      "-L" "${openssl.out}/lib"
+      "-I" "${openssl.dev}/include"
       "-system-sqlite"
       ''-${if mysql != null then "plugin" else "no"}-sql-mysql''
       ''-${if postgresql != null then "plugin" else "no"}-sql-psql''
@@ -313,10 +307,14 @@ stdenv.mkDerivation {
           "-system-xcb"
           "-xcb"
           "-qpa xcb"
+          "-L" "${libX11.out}/lib"
+          "-I" "${libX11.out}/include"
+          "-L" "${libXext.out}/lib"
+          "-I" "${libXext.out}/include"
+          "-L" "${libXrender.out}/lib"
+          "-I" "${libXrender.out}/include"
 
-          "-system-xkbcommon"
           "-libinput"
-          "-xkbcommon-evdev"
 
           "-no-eglfs"
           "-no-gbm"
@@ -337,6 +335,19 @@ stdenv.mkDerivation {
           "-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"
+        ]
+        ++ lib.optionals (cups != null) [
+          "-L" "${cups.lib}/lib"
+          "-I" "${cups.dev}/include"
+        ]
+        ++ lib.optionals (mysql != null) [
+          "-L" "${mysql.out}/lib"
+          "-I" "${mysql.out}/include"
+        ]
     );
 
   enableParallelBuilding = true;
@@ -404,6 +415,7 @@ stdenv.mkDerivation {
     license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ];
     maintainers = with maintainers; [ qknight ttuegel periklis bkchr ];
     platforms = platforms.unix;
+    broken = stdenv.isDarwin && (compareVersion "5.9.0" < 0);
   };
 
 }
diff --git a/pkgs/development/libraries/qt-5/modules/qtconnectivity.nix b/pkgs/development/libraries/qt-5/modules/qtconnectivity.nix
index 17e7f0ee7cf..36a736d03dc 100644
--- a/pkgs/development/libraries/qt-5/modules/qtconnectivity.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtconnectivity.nix
@@ -1,8 +1,8 @@
-{ qtModule, stdenv, qtbase, qtdeclarative, bluez, cf-private }:
+{ qtModule, stdenv, qtbase, qtdeclarative, bluez }:
 
 qtModule {
   name = "qtconnectivity";
   qtInputs = [ qtbase qtdeclarative ];
-  buildInputs = if stdenv.isDarwin then [ cf-private ] else [ bluez ];
+  buildInputs = stdenv.lib.optional stdenv.isLinux bluez;
   outputs = [ "out" "dev" "bin" ];
 }
diff --git a/pkgs/development/libraries/qt-5/modules/qtmacextras.nix b/pkgs/development/libraries/qt-5/modules/qtmacextras.nix
index 3f254885986..11964caf17b 100644
--- a/pkgs/development/libraries/qt-5/modules/qtmacextras.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtmacextras.nix
@@ -1,10 +1,8 @@
-{ stdenv, qtModule, qtbase, cf-private }:
+{ stdenv, qtModule, qtbase }:
 
 qtModule {
   name = "qtmacextras";
-  qtInputs = [ qtbase ]
-    # Needed for _OBJC_CLASS_$_NSData symbols.
-    ++ stdenv.lib.optional stdenv.isDarwin cf-private;
+  qtInputs = [ qtbase ];
   meta = with stdenv.lib; {
     maintainers = with maintainers; [ periklis ];
     platforms = platforms.darwin;
diff --git a/pkgs/development/libraries/qt-5/modules/qtnetworkauth.nix b/pkgs/development/libraries/qt-5/modules/qtnetworkauth.nix
new file mode 100644
index 00000000000..e6ef428cc3c
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/modules/qtnetworkauth.nix
@@ -0,0 +1,6 @@
+{ qtModule, qtbase }:
+
+qtModule {
+  name = "qtnetworkauth";
+  qtInputs = [ qtbase ];
+}
diff --git a/pkgs/development/libraries/qt-5/modules/qtspeech.nix b/pkgs/development/libraries/qt-5/modules/qtspeech.nix
index 7b4b19ccab5..ddef01a9482 100644
--- a/pkgs/development/libraries/qt-5/modules/qtspeech.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtspeech.nix
@@ -3,5 +3,5 @@
 qtModule {
   name = "qtspeech";
   qtInputs = [ ];
-  outputs = [ "out" "dev" "bin" ];
+  outputs = [ "out" "dev" ];
 }
diff --git a/pkgs/development/libraries/qt-5/modules/qttools.nix b/pkgs/development/libraries/qt-5/modules/qttools.nix
index 622d841b405..573472a8b5a 100644
--- a/pkgs/development/libraries/qt-5/modules/qttools.nix
+++ b/pkgs/development/libraries/qt-5/modules/qttools.nix
@@ -1,4 +1,4 @@
-{ qtModule, stdenv, lib, qtbase }:
+{ qtModule, stdenv, lib, qtbase, qtdeclarative }:
 
 with lib;
 
@@ -32,5 +32,8 @@ qtModule {
     "bin/macdeployqt"
   ];
 
+  NIX_CFLAGS_COMPILE =
+    lib.optional stdenv.isDarwin ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"'';
+
   setupHook = ../hooks/qttools-setup-hook.sh;
 }
diff --git a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
index ddb82832337..07fd048d653 100644
--- a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
@@ -33,6 +33,9 @@ qtModule {
 
   enableParallelBuilding = true;
 
+  # Don’t use the gn setup hook
+  dontUseGnConfigure = true;
+
   # ninja builds some components with -Wno-format,
   # which cannot be set at the same time as -Wformat-security
   hardeningDisable = [ "format" ];
@@ -67,39 +70,19 @@ qtModule {
         src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc
     ''
     + optionalString stdenv.isDarwin (''
-      # Remove annoying xcode check
-      substituteInPlace mkspecs/features/platform.prf \
-        --replace "lessThan(QMAKE_XCODE_VERSION, 7.3)" false \
-        --replace "/usr/bin/xcodebuild" "xcodebuild"
-
-      substituteInPlace src/3rdparty/chromium/build/mac_toolchain.py \
-        --replace "/usr/bin/xcode-select" "xcode-select"
-
       substituteInPlace src/core/config/mac_osx.pri \
-        --replace /usr ${stdenv.cc} \
-        --replace "isEmpty(QMAKE_MAC_SDK_VERSION)" false
-
+        --replace /usr ${stdenv.cc}
     ''
-    # TODO remove when new Apple SDK is in
-    + (if lib.versionOlder qtCompatVersion "5.11" then ''
-    substituteInPlace src/3rdparty/chromium/base/mac/foundation_util.mm \
-      --replace "NSArray<NSString*>*" "NSArray*"
-    substituteInPlace src/3rdparty/chromium/base/mac/sdk_forward_declarations.h \
-      --replace "NSDictionary<VNImageOption, id>*" "NSDictionary*" \
-      --replace "NSArray<VNRequest*>*" "NSArray*" \
-      --replace "typedef NSString* VNImageOption NS_STRING_ENUM" "typedef NSString* VNImageOption"
-    '' else ''
-    substituteInPlace src/3rdparty/chromium/third_party/webrtc/sdk/objc/Framework/Classes/Common/RTCFieldTrials.mm \
-      --replace "NSDictionary<NSString *, NSString *> *" "NSDictionary*"
-    substituteInPlace src/3rdparty/chromium/third_party/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCFieldTrials.h \
-      --replace "NSDictionary<NSString *, NSString *> *" "NSDictionary*"
+    + (optionalString (lib.versionAtLeast qtCompatVersion "5.11") ''
+      substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/BUILD.gn \
+        --replace '$sysroot/usr' "${darwin.xnu}"
     '')
     + ''
 
     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
@@ -114,9 +97,6 @@ print('sdk_platform_path=""')
 print('sdk_build="17B41"')
 EOF
 
-    substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/BUILD.gn \
-      --replace '$sysroot/usr' "${darwin.xnu}"
-
     # Apple has some secret stuff they don't share with OpenBSM
     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]"
@@ -126,7 +106,10 @@ EOF
     '');
 
   NIX_CFLAGS_COMPILE =
-    lib.optionalString stdenv.isDarwin [
+  # it fails when compiled with -march=sandybridge https://github.com/NixOS/nixpkgs/pull/59148#discussion_r276696940
+  # TODO: investigate and fix properly
+    lib.optionals (stdenv.hostPlatform.platform.gcc.arch or "" == "sandybridge") [ "-march=westmere" ] ++
+    lib.optionals 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"
 
@@ -217,14 +200,6 @@ EOF
     (runCommand "MacOS_SDK_sandbox.h" {} ''
       install -Dm444 "${lib.getDev darwin.apple_sdk.sdk}"/include/sandbox.h "$out"/include/sandbox.h
     '')
-
-    # For:
-    # _NSDefaultRunLoopMode
-    # _OBJC_CLASS_$_NSDate
-    # _OBJC_CLASS_$_NSDictionary
-    # _OBJC_CLASS_$_NSRunLoop
-    # _OBJC_CLASS_$_NSURL
-    darwin.cf-private
   ]);
 
   __impureHostDeps = optional stdenv.isDarwin "/usr/lib/libsandbox.1.dylib";
diff --git a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
index 526fc2b8b2d..d65449023b3 100644
--- a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
@@ -1,6 +1,6 @@
 { qtModule, stdenv, lib, fetchurl
 , qtbase, qtdeclarative, qtlocation, qtmultimedia, qtsensors, qtwebchannel
-, fontconfig, gdk_pixbuf, gtk2, libwebp, libxml2, libxslt
+, fontconfig, gtk2, libwebp, libxml2, libxslt
 , sqlite, systemd, glib, gst_all_1, cmake
 , bison2, flex, gdb, gperf, perl, pkgconfig, python2, ruby
 , darwin
@@ -8,7 +8,7 @@
 }:
 
 let
-  inherit (lib) optional optionals getLib;
+  inherit (lib) optional optionals getDev getLib;
   hyphen = stdenv.mkDerivation rec {
     name = "hyphen-2.8.8";
     src = fetchurl {
@@ -20,28 +20,30 @@ let
     '';
     buildInputs = [ perl ];
   };
+  usingAnnulenWebkitFork = lib.versionAtLeast qtbase.version "5.11.0";
 in
 qtModule {
   name = "qtwebkit";
   qtInputs = [ qtbase qtdeclarative qtlocation qtsensors ]
     ++ optional (stdenv.isDarwin && lib.versionAtLeast qtbase.version "5.9.0") qtmultimedia
-    ++ optional (lib.versionAtLeast qtbase.version "5.11.0") qtwebchannel;
+    ++ optional usingAnnulenWebkitFork qtwebchannel;
   buildInputs = [ fontconfig libwebp libxml2 libxslt sqlite glib gst_all_1.gstreamer gst_all_1.gst-plugins-base ]
-    ++ optionals (stdenv.isDarwin) (with darwin; with apple_sdk.frameworks; [ cf-private OpenGL ])
-    ++ optionals (lib.versionAtLeast qtbase.version "5.11.0") [ hyphen ];
+    ++ optionals (stdenv.isDarwin) (with darwin; with apple_sdk.frameworks; [ ICU OpenGL ])
+    ++ optional usingAnnulenWebkitFork hyphen;
   nativeBuildInputs = [
     bison2 flex gdb gperf perl pkgconfig python2 ruby
-  ] ++ optionals (lib.versionAtLeast qtbase.version "5.11.0") [ cmake ];
+  ] ++ optional usingAnnulenWebkitFork cmake;
 
-  cmakeFlags = optionals (lib.versionAtLeast qtbase.version "5.11.0") [ "-DPORT=Qt" ];
-
-  __impureHostDeps = optionals (stdenv.isDarwin) [
-    "/usr/lib/libicucore.dylib"
-  ];
+  cmakeFlags = optionals usingAnnulenWebkitFork ([ "-DPORT=Qt" ]
+    ++ optionals stdenv.isDarwin [
+      "-DQt5Multimedia_DIR=${getDev qtmultimedia}/lib/cmake/Qt5Multimedia"
+      "-DQt5MultimediaWidgets_DIR=${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 = ''
+  preConfigure = stdenv.lib.optionalString (!usingAnnulenWebkitFork) ''
     QMAKEPATH="$PWD/Tools/qmake''${QMAKEPATH:+:}$QMAKEPATH"
     fixQtBuiltinPaths . '*.pr?'
     # Fix hydra's "Log limit exceeded"
@@ -56,7 +58,8 @@ qtModule {
     ++ optionals flashplayerFix
       [
         ''-DNIXPKGS_LIBGTK2="${getLib gtk2}/lib/libgtk-x11-2.0"''
-        ''-DNIXPKGS_LIBGDK2="${getLib gdk_pixbuf}/lib/libgdk-x11-2.0"''
+        # this file used to exist in gdk_pixbuf?
+        ''-DNIXPKGS_LIBGDK2="${getLib gtk2}/lib/libgdk-x11-2.0"''
       ]
     ++ optional (!stdenv.isDarwin) ''-DNIXPKGS_LIBUDEV="${getLib systemd}/lib/libudev"'';
 
diff --git a/pkgs/development/libraries/qt-5/modules/qtwebview.nix b/pkgs/development/libraries/qt-5/modules/qtwebview.nix
index 6d5274cbc58..906d750c5d3 100644
--- a/pkgs/development/libraries/qt-5/modules/qtwebview.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtwebview.nix
@@ -1,20 +1,14 @@
 { darwin, stdenv, qtModule, qtdeclarative, qtwebengine }:
 
 with stdenv.lib;
- 
+
 qtModule {
   name = "qtwebview";
   qtInputs = [ qtdeclarative qtwebengine ];
   buildInputs = optional (stdenv.isDarwin) [
     darwin.apple_sdk.frameworks.CoreFoundation
     darwin.apple_sdk.frameworks.WebKit
-
-    # For:
-    # _OBJC_CLASS_$_NSArray
-    # _OBJC_CLASS_$_NSDate
-    # _OBJC_CLASS_$_NSURL
-    darwin.cf-private
   ];
   outputs = [ "out" "dev" "bin" ];
   NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework CoreFoundation -framework WebKit";
-}
\ No newline at end of file
+}