summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/compilers/julia/0.6.nix8
-rw-r--r--pkgs/development/compilers/rust/bootstrap.nix3
-rwxr-xr-xpkgs/development/compilers/rust/print-hashes.sh1
-rw-r--r--pkgs/development/libraries/alembic/default.nix5
-rw-r--r--pkgs/development/libraries/kde-frameworks/kimageformats.nix2
-rw-r--r--pkgs/development/libraries/kde-frameworks/kinit/default.nix8
-rw-r--r--pkgs/development/libraries/kde-frameworks/srcs.nix8
-rw-r--r--pkgs/development/libraries/libnetfilter_queue/default.nix7
-rw-r--r--pkgs/development/libraries/qt-5/5.10/default.nix124
-rw-r--r--pkgs/development/libraries/qt-5/5.10/fetch.sh2
-rw-r--r--pkgs/development/libraries/qt-5/5.10/qtbase.patch1119
-rw-r--r--pkgs/development/libraries/qt-5/5.10/qtdeclarative.patch33
-rw-r--r--pkgs/development/libraries/qt-5/5.10/qtscript.patch13
-rw-r--r--pkgs/development/libraries/qt-5/5.10/qtserialport.patch22
-rw-r--r--pkgs/development/libraries/qt-5/5.10/qttools.patch71
-rw-r--r--pkgs/development/libraries/qt-5/5.10/qtwebengine-paxmark-mksnapshot.patch48
-rw-r--r--pkgs/development/libraries/qt-5/5.10/qtwebkit.patch77
-rw-r--r--pkgs/development/libraries/qt-5/5.10/srcs.nix341
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase.patch32
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qtbase.patch103
-rw-r--r--pkgs/development/libraries/qt-5/hooks/fix-qt-module-paths.sh11
-rw-r--r--pkgs/development/libraries/qt-5/hooks/fix-qt-static-libs.sh32
-rw-r--r--pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh10
-rw-r--r--pkgs/development/libraries/qt-5/mkDerivation.nix2
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtbase.nix7
-rw-r--r--pkgs/development/ocaml-modules/uri/default.nix54
-rw-r--r--pkgs/development/ocaml-modules/uri/legacy.nix51
-rw-r--r--pkgs/development/python-modules/aenum/default.nix19
-rw-r--r--pkgs/development/python-modules/nose-parameterized/default.nix27
-rw-r--r--pkgs/development/python-modules/scikitlearn/default.nix3
-rw-r--r--pkgs/development/python-modules/werkzeug/default.nix2
-rw-r--r--pkgs/development/tools/go-protobuf/default.nix24
32 files changed, 2078 insertions, 191 deletions
diff --git a/pkgs/development/compilers/julia/0.6.nix b/pkgs/development/compilers/julia/0.6.nix
index fabb2a7d6d73..6acb192933e6 100644
--- a/pkgs/development/compilers/julia/0.6.nix
+++ b/pkgs/development/compilers/julia/0.6.nix
@@ -33,10 +33,10 @@ let
     sha256 = "03kaqbjbi6viz0n33dk5jlf6ayxqlsq4804n7kwkndiga9s4hd42";
   };
 
-  libuvVersion = "52d72a52cc7ccd570929990f010ed16e2ec604c8";
+  libuvVersion = "d8ab1c6a33e77bf155facb54215dd8798e13825d";
   libuv = fetchurl {
     url = "https://api.github.com/repos/JuliaLang/libuv/tarball/${libuvVersion}";
-    sha256 = "1vldy94sfmlfqmi14126g590wi61fv78rzh7afk82zkipaixvak8";
+    sha256 = "0q5ahc9dzca2yc6cjbhpfi9nwc4yhhjbgxgsychksn13d24gv7ba";
   };
 
   rmathVersion = "0.1";
@@ -54,12 +54,12 @@ in
 
 stdenv.mkDerivation rec {
   pname = "julia";
-  version = "0.6.0";
+  version = "0.6.2";
   name = "${pname}-${version}";
 
   src = fetchzip {
     url = "https://github.com/JuliaLang/${pname}/releases/download/v${version}/${name}.tar.gz";
-    sha256 = "19xk2cs43lnsy9y0d8wmxj7ich908ipb40vkf7xg9031x272brxw";
+    sha256 = "0ym4n9vn6w8vj175mmsc2nzvdk2ij0cdrs44lkr3p0signji73b5";
   };
   prePatch = ''
     mkdir deps/srccache
diff --git a/pkgs/development/compilers/rust/bootstrap.nix b/pkgs/development/compilers/rust/bootstrap.nix
index 7814bc94828f..034334f58500 100644
--- a/pkgs/development/compilers/rust/bootstrap.nix
+++ b/pkgs/development/compilers/rust/bootstrap.nix
@@ -9,6 +9,7 @@ let
   hashes = {
     i686-unknown-linux-gnu = "b7caed0f602cdb8ef22e0bfa9125a65bec411e15c0b8901d937e43303ec7dbee";
     x86_64-unknown-linux-gnu = "b41e70e018402bc04d02fde82f91bea24428e6be432f0df12ac400cfb03108e8";
+    armv7-unknown-linux-gnueabihf = "416fa6f107ad9e386002e6af1aec495472e2ee489c842183dd429a25b07488d6";
     aarch64-unknown-linux-gnu = "491ee6c43cc672006968d665bd34c94cc2219ef3592d93d38097c97eaaa864c3";
     i686-apple-darwin = "c8b0fabeebcde66b683f3a871187e614e07305adda414c2862cb332aecb2b3bf";
     x86_64-apple-darwin = "75a7f4bd7c72948030bb9e421df27e8a650dea826fb5b836cf59d23d6f985a0d";
@@ -19,6 +20,8 @@ let
     then "i686-unknown-linux-gnu"
     else if stdenv.system == "x86_64-linux"
     then "x86_64-unknown-linux-gnu"
+    else if stdenv.system == "armv7l-linux"
+    then "armv7-unknown-linux-gnueabihf"
     else if stdenv.system == "aarch64-linux"
     then "aarch64-unknown-linux-gnu"
     else if stdenv.system == "i686-darwin"
diff --git a/pkgs/development/compilers/rust/print-hashes.sh b/pkgs/development/compilers/rust/print-hashes.sh
index dc7e3719355c..7eb00a30ad73 100755
--- a/pkgs/development/compilers/rust/print-hashes.sh
+++ b/pkgs/development/compilers/rust/print-hashes.sh
@@ -10,6 +10,7 @@ set -euo pipefail
 PLATFORMS=(
   i686-unknown-linux-gnu
   x86_64-unknown-linux-gnu
+  armv7-unknown-linux-gnueabihf
   aarch64-unknown-linux-gnu
   i686-apple-darwin
   x86_64-apple-darwin
diff --git a/pkgs/development/libraries/alembic/default.nix b/pkgs/development/libraries/alembic/default.nix
index bd540cdd5005..a185f19a9a16 100644
--- a/pkgs/development/libraries/alembic/default.nix
+++ b/pkgs/development/libraries/alembic/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, unzip, cmake, openexr, hdf5 }:
+{ stdenv, fetchFromGitHub, unzip, cmake, openexr, hdf5-threadsafe }:
 
 stdenv.mkDerivation rec
 {
@@ -14,7 +14,8 @@ stdenv.mkDerivation rec
 
   outputs = [ "bin" "dev" "out" "lib" ];
 
-  buildInputs = [ unzip cmake openexr hdf5 ];
+  nativeBuildInputs = [ unzip cmake ];
+  buildInputs = [ openexr hdf5-threadsafe ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/kde-frameworks/kimageformats.nix b/pkgs/development/libraries/kde-frameworks/kimageformats.nix
index 26a8637bafc2..29748a5f7f42 100644
--- a/pkgs/development/libraries/kde-frameworks/kimageformats.nix
+++ b/pkgs/development/libraries/kde-frameworks/kimageformats.nix
@@ -12,5 +12,5 @@ mkDerivation {
   nativeBuildInputs = [ extra-cmake-modules ];
   buildInputs = [ karchive openexr qtbase ];
   outputs = [ "out" ]; # plugins only
-  NIX_CFLAGS_COMPILE = "-I${getDev ilmbase}/include/OpenEXR";
+  CXXFLAGS = "-I${getDev ilmbase}/include/OpenEXR";
 }
diff --git a/pkgs/development/libraries/kde-frameworks/kinit/default.nix b/pkgs/development/libraries/kde-frameworks/kinit/default.nix
index 1036ea277452..538078fd7457 100644
--- a/pkgs/development/libraries/kde-frameworks/kinit/default.nix
+++ b/pkgs/development/libraries/kde-frameworks/kinit/default.nix
@@ -14,10 +14,10 @@ mkDerivation {
     kconfig kcrash ki18n kio kservice kwindowsystem
   ];
   patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
-  NIX_CFLAGS_COMPILE = [
-    ''-DNIXPKGS_KF5_KIOCORE="${getLib kio}/lib/libKF5KIOCore.so.5"''
-    ''-DNIXPKGS_KF5_PARTS="${getLib kparts}/lib/libKF5Parts.so.5"''
-    ''-DNIXPKGS_KF5_PLASMA="${getLib plasma-framework}/lib/libKF5Plasma.so.5"''
+  CXXFLAGS = [
+    ''-DNIXPKGS_KF5_KIOCORE=\"${getLib kio}/lib/libKF5KIOCore.so.5\"''
+    ''-DNIXPKGS_KF5_PARTS=\"${getLib kparts}/lib/libKF5Parts.so.5\"''
+    ''-DNIXPKGS_KF5_PLASMA=\"${getLib plasma-framework}/lib/libKF5Plasma.so.5\"''
   ];
   postFixup = ''
     moveToOutput "lib/libexec/kf5/start_kdeinit" "$bin"
diff --git a/pkgs/development/libraries/kde-frameworks/srcs.nix b/pkgs/development/libraries/kde-frameworks/srcs.nix
index d4390da66506..f8d4bcf5c8f9 100644
--- a/pkgs/development/libraries/kde-frameworks/srcs.nix
+++ b/pkgs/development/libraries/kde-frameworks/srcs.nix
@@ -499,11 +499,11 @@
     };
   };
   kwidgetsaddons = {
-    version = "5.42.0";
+    version = "5.42.1";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kwidgetsaddons-5.42.0.tar.xz";
-      sha256 = "19fhcscc0irznqmjpi57sl22vrv2lcmqbhkcg2smimgd0r7pm7wg";
-      name = "kwidgetsaddons-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kwidgetsaddons-5.42.1.tar.xz";
+      sha256 = "0h0vfrfl5zi01fpvmd825kazzlyawz3i66qrfkymdrnvqmfzcmlg";
+      name = "kwidgetsaddons-5.42.1.tar.xz";
     };
   };
   kwindowsystem = {
diff --git a/pkgs/development/libraries/libnetfilter_queue/default.nix b/pkgs/development/libraries/libnetfilter_queue/default.nix
index 5de9409b729f..12a45d088ef6 100644
--- a/pkgs/development/libraries/libnetfilter_queue/default.nix
+++ b/pkgs/development/libraries/libnetfilter_queue/default.nix
@@ -1,11 +1,12 @@
 { stdenv, fetchurl, pkgconfig, libmnl, libnfnetlink }:
 
 stdenv.mkDerivation rec {
-  name = "libnetfilter_queue-1.0.2";
+  version = "1.0.3";
+  name = "libnetfilter_queue-${version}";
 
   src = fetchurl {
-    url = "ftp://ftp.netfilter.org/pub/libnetfilter_queue/${name}.tar.bz2";
-    sha256 = "0chsmj9ky80068vn458ijz9sh4sk5yc08dw2d6b8yddybpmr1143";
+    url = "https://www.netfilter.org/projects/libnetfilter_queue/files/${name}.tar.bz2";
+    sha256 = "0x77m1fvbqzz5z64jz59fb6j8dvv8b9pg4fmznqwax4x6imjcncq";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/qt-5/5.10/default.nix b/pkgs/development/libraries/qt-5/5.10/default.nix
new file mode 100644
index 000000000000..34ab82d42abe
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/default.nix
@@ -0,0 +1,124 @@
+/*
+
+# Updates
+
+Before a major version update, make a copy of this directory. (We like to
+keep the old version around for a short time after major updates.) Add a
+top-level attribute to `top-level/all-packages.nix`.
+
+1. Update the URL in `pkgs/development/libraries/qt-5/$VERSION/fetch.sh`.
+2. From the top of the Nixpkgs tree, run
+   `./maintainers/scripts/fetch-kde-qt.sh > pkgs/development/libraries/qt-5/$VERSION/srcs.nix`.
+3. Update `qtCompatVersion` below if the minor version number changes.
+4. Check that the new packages build correctly.
+5. Commit the changes and open a pull request.
+
+*/
+
+{
+  newScope,
+  stdenv, fetchurl, makeSetupHook, makeWrapper,
+  bison, cups ? null, harfbuzz, mesa, perl,
+  gstreamer, gst-plugins-base, gtk3, dconf,
+
+  # options
+  developerBuild ? false,
+  decryptSslTraffic ? false,
+  debug ? null,
+}:
+
+with stdenv.lib;
+
+let
+
+  qtCompatVersion = "5.10";
+
+  mirror = "http://download.qt.io";
+  srcs = import ./srcs.nix { inherit fetchurl; inherit mirror; };
+
+  patches = {
+    qtbase = [ ./qtbase.patch ];
+    qtdeclarative = [ ./qtdeclarative.patch ];
+    qtscript = [ ./qtscript.patch ];
+    qtserialport = [ ./qtserialport.patch ];
+    qttools = [ ./qttools.patch ];
+    qtwebengine = optional stdenv.needsPax ./qtwebengine-paxmark-mksnapshot.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 self srcs patches; };
+
+  addPackages = self: with self;
+    let
+      callPackage = self.newScope { inherit qtCompatVersion qtModule srcs; };
+    in {
+
+      inherit mkDerivation;
+
+      qtbase = callPackage ../modules/qtbase.nix {
+        inherit (srcs.qtbase) src version;
+        patches = patches.qtbase;
+        inherit bison cups harfbuzz mesa;
+        withGtk3 = true; inherit dconf gtk3;
+        inherit developerBuild decryptSslTraffic;
+      };
+
+      qtcharts = callPackage ../modules/qtcharts.nix {};
+      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 {};
+      qtmultimedia = callPackage ../modules/qtmultimedia.nix {
+        inherit gstreamer gst-plugins-base;
+      };
+      qtquick1 = null;
+      qtquickcontrols = callPackage ../modules/qtquickcontrols.nix {};
+      qtquickcontrols2 = callPackage ../modules/qtquickcontrols2.nix {};
+      qtscript = callPackage ../modules/qtscript.nix {};
+      qtsensors = callPackage ../modules/qtsensors.nix {};
+      qtserialport = callPackage ../modules/qtserialport.nix {};
+      qtsvg = callPackage ../modules/qtsvg.nix {};
+      qttools = callPackage ../modules/qttools.nix {};
+      qttranslations = callPackage ../modules/qttranslations.nix {};
+      qtvirtualkeyboard = callPackage ../modules/qtvirtualkeyboard.nix {};
+      qtwayland = callPackage ../modules/qtwayland.nix {};
+      qtwebchannel = callPackage ../modules/qtwebchannel.nix {};
+      qtwebengine = callPackage ../modules/qtwebengine.nix {};
+      qtwebkit = callPackage ../modules/qtwebkit.nix {};
+      qtwebsockets = callPackage ../modules/qtwebsockets.nix {};
+      qtx11extras = callPackage ../modules/qtx11extras.nix {};
+      qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {};
+
+      env = callPackage ../qt-env.nix {};
+      full = env "qt-${qtbase.version}" ([
+        qtcharts qtconnectivity qtdeclarative qtdoc qtgraphicaleffects
+        qtimageformats qtlocation qtmultimedia qtquickcontrols qtscript
+        qtsensors qtserialport qtsvg qttools qttranslations qtwebsockets
+        qtx11extras qtxmlpatterns
+      ] ++ optional (!stdenv.isDarwin) qtwayland
+        ++ optional (stdenv.isDarwin) qtmacextras);
+
+      qmake = makeSetupHook {
+        deps = [ self.qtbase.dev ];
+        substitutions = {
+          inherit (stdenv) isDarwin;
+          qtbase_dev = self.qtbase.dev;
+          fix_qt_builtin_paths = ../hooks/fix-qt-builtin-paths.sh;
+        };
+      } ../hooks/qmake-hook.sh;
+    };
+
+   self = makeScope newScope addPackages;
+
+in self
diff --git a/pkgs/development/libraries/qt-5/5.10/fetch.sh b/pkgs/development/libraries/qt-5/5.10/fetch.sh
new file mode 100644
index 000000000000..849e76d616df
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/fetch.sh
@@ -0,0 +1,2 @@
+WGET_ARGS=( http://download.qt.io/official_releases/qt/5.10/5.10.0/submodules/ \
+            -A '*.tar.xz' )
diff --git a/pkgs/development/libraries/qt-5/5.10/qtbase.patch b/pkgs/development/libraries/qt-5/5.10/qtbase.patch
new file mode 100644
index 000000000000..b79ce9fc3568
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/qtbase.patch
@@ -0,0 +1,1119 @@
+diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf
+index 5208379f9a..92fe29a0ac 100644
+--- a/mkspecs/common/mac.conf
++++ b/mkspecs/common/mac.conf
+@@ -23,7 +23,7 @@ QMAKE_INCDIR_OPENGL     = \
+ 
+ QMAKE_FIX_RPATH         = install_name_tool -id
+ 
+-QMAKE_LFLAGS_RPATH      = -Wl,-rpath,
++QMAKE_LFLAGS_RPATH      =
+ 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 bb5083c925..77034f9bb6 100644
+--- a/mkspecs/features/create_cmake.prf
++++ b/mkspecs/features/create_cmake.prf
+@@ -21,7 +21,7 @@ load(cmake_functions)
+ # 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.
+-CMAKE_INSTALL_LIBS_DIR = $$cmakeTargetPath($$[QT_INSTALL_LIBS])
++CMAKE_INSTALL_LIBS_DIR = $$cmakeTargetPath($$NIX_OUTPUT_OUT/lib/)
+ contains(CMAKE_INSTALL_LIBS_DIR, ^(/usr)?/lib(64)?.*): CMAKE_USR_MOVE_WORKAROUND = $$CMAKE_INSTALL_LIBS_DIR
+ 
+ CMAKE_OUT_DIR = $$MODULE_BASE_OUTDIR/lib/cmake
+@@ -47,47 +47,22 @@ split_incpath {
+         $$cmake_extra_source_includes.output
+ }
+ 
+-CMAKE_INCLUDE_DIR = $$cmakeRelativePath($$[QT_INSTALL_HEADERS], $$[QT_INSTALL_PREFIX])
+-contains(CMAKE_INCLUDE_DIR, "^\\.\\./.*") {
+-    CMAKE_INCLUDE_DIR = $$[QT_INSTALL_HEADERS]/
+-    CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True
+-}
++CMAKE_INCLUDE_DIR = $$NIX_OUTPUT_DEV/include/
++CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True
+ 
+ !exists($$first(QT.$${MODULE}_private.includes)): CMAKE_NO_PRIVATE_INCLUDES = true
+ 
+-CMAKE_LIB_DIR = $$cmakeRelativePath($$[QT_INSTALL_LIBS], $$[QT_INSTALL_PREFIX])
+-contains(CMAKE_LIB_DIR,"^\\.\\./.*") {
+-    CMAKE_LIB_DIR = $$[QT_INSTALL_LIBS]/
+-    CMAKE_LIB_DIR_IS_ABSOLUTE = True
+-} else {
+-    CMAKE_RELATIVE_INSTALL_LIBS_DIR = $$cmakeRelativePath($$[QT_INSTALL_PREFIX], $$[QT_INSTALL_LIBS])
+-    # We need to go up another two levels because the CMake files are
+-    # installed in $${CMAKE_LIB_DIR}/cmake/Qt5$${CMAKE_MODULE_NAME}
+-    CMAKE_RELATIVE_INSTALL_DIR = "$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}../../"
+-}
++CMAKE_LIB_DIR = $$NIX_OUTPUT_OUT/lib/
++CMAKE_LIB_DIR_IS_ABSOLUTE = True
+ 
+-CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
+-contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
+-    CMAKE_BIN_DIR = $$[QT_HOST_BINS]/
+-    CMAKE_BIN_DIR_IS_ABSOLUTE = True
+-}
++CMAKE_BIN_DIR = $$NIX_OUTPUT_BIN/bin/
++CMAKE_BIN_DIR_IS_ABSOLUTE = True
+ 
+-CMAKE_PLUGIN_DIR = $$cmakeRelativePath($$[QT_INSTALL_PLUGINS], $$[QT_INSTALL_PREFIX])
+-contains(CMAKE_PLUGIN_DIR, "^\\.\\./.*") {
+-    CMAKE_PLUGIN_DIR = $$[QT_INSTALL_PLUGINS]/
+-    CMAKE_PLUGIN_DIR_IS_ABSOLUTE = True
+-}
++CMAKE_PLUGIN_DIR = $$NIX_OUTPUT_PLUGIN/
++CMAKE_PLUGIN_DIR_IS_ABSOLUTE = True
+ 
+-win32:!static:!staticlib {
+-    CMAKE_DLL_DIR = $$cmakeRelativePath($$[QT_INSTALL_BINS], $$[QT_INSTALL_PREFIX])
+-    contains(CMAKE_DLL_DIR, "^\\.\\./.*") {
+-        CMAKE_DLL_DIR = $$[QT_INSTALL_BINS]/
+-        CMAKE_DLL_DIR_IS_ABSOLUTE = True
+-    }
+-} else {
+-    CMAKE_DLL_DIR = $$CMAKE_LIB_DIR
+-    CMAKE_DLL_DIR_IS_ABSOLUTE = $$CMAKE_LIB_DIR_IS_ABSOLUTE
+-}
++CMAKE_DLL_DIR = $$NIX_OUTPUT_OUT/lib/
++CMAKE_DLL_DIR_IS_ABSOLUTE = True
+ 
+ static|staticlib:CMAKE_STATIC_TYPE = true
+ 
+@@ -167,7 +142,7 @@ contains(CONFIG, plugin) {
+       cmake_target_file
+ 
+     cmake_qt5_plugin_file.files = $$cmake_target_file.output
+-    cmake_qt5_plugin_file.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME}
++    cmake_qt5_plugin_file.path = $$NIX_OUTPUT_OUT/lib/cmake/Qt5$${CMAKE_MODULE_NAME}
+     INSTALLS += cmake_qt5_plugin_file
+ 
+     return()
+@@ -314,7 +289,7 @@ exists($$cmake_macros_file.input) {
+     cmake_qt5_module_files.files += $$cmake_macros_file.output
+ }
+ 
+-cmake_qt5_module_files.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME}
++cmake_qt5_module_files.path = $$NIX_OUTPUT_OUT/lib/cmake/Qt5$${CMAKE_MODULE_NAME}
+ 
+ # 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 55c74aad66..0bbc8718eb 100644
+--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
++++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+@@ -9,30 +9,6 @@ if (CMAKE_VERSION VERSION_LESS 3.0.0)
+ endif()
+ !!ENDIF
+ 
+-!!IF !isEmpty(CMAKE_USR_MOVE_WORKAROUND)
+-!!IF !isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")
+-!!ELSE
+-get_filename_component(_IMPORT_PREFIX \"${CMAKE_CURRENT_LIST_FILE}\" PATH)
+-# Use original install prefix when loaded through a
+-# cross-prefix symbolic link such as /lib -> /usr/lib.
+-get_filename_component(_realCurr \"${_IMPORT_PREFIX}\" REALPATH)
+-get_filename_component(_realOrig \"$$CMAKE_INSTALL_LIBS_DIR/cmake/Qt5$${CMAKE_MODULE_NAME}\" REALPATH)
+-if(_realCurr STREQUAL _realOrig)
+-    get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$CMAKE_INSTALL_LIBS_DIR/$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}\" ABSOLUTE)
+-else()
+-    get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
+-endif()
+-unset(_realOrig)
+-unset(_realCurr)
+-unset(_IMPORT_PREFIX)
+-!!ENDIF
+-!!ELIF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
+-!!ELSE
+-set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")
+-!!ENDIF
+-
+ !!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)")
+@@ -58,11 +34,7 @@ endmacro()
+ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATION IMPLIB_LOCATION)
+     set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
+ 
+-!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
+-!!ELSE
+     set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
+-!!ENDIF
+     _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}\"
+@@ -75,11 +47,7 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI
+     )
+ 
+ !!IF !isEmpty(CMAKE_WINDOWS_BUILD)
+-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-    set(imported_implib \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
+-!!ELSE
+     set(imported_implib \"IMPORTED_IMPLIB_${Configuration}\" \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
+-!!ENDIF
+     _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_implib})
+     if(NOT \"${IMPLIB_LOCATION}\" STREQUAL \"\")
+         set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
+@@ -95,24 +63,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+ !!IF !no_module_headers
+ !!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
+     set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS
+-      \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework\"
+-      \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Headers\"
++      \"$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework\"
++      \"$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Headers\"
+     )
+ !!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
+     set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
+-        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/\"
+-        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\"
+-    )
+-!!ELSE
+-    set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
+-!!ENDIF
+-!!ELSE
+-!!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
+-    set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}\")
+-!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
+-    set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
+-        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION\"
+-        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION/$${MODULE_INCNAME}\"
++        \"$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/\"
++        \"$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\"
+     )
+ !!ELSE
+     set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
+@@ -128,7 +85,6 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+     set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
+ !!ENDIF
+ !!ENDIF
+-!!ENDIF
+ !!IF !isEmpty(CMAKE_ADD_SOURCE_INCLUDE_DIRS)
+     include(\"${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake\" OPTIONAL)
+ !!ENDIF
+@@ -280,25 +236,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+ !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
+ !!IF isEmpty(CMAKE_DEBUG_TYPE)
+ !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
+-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-    if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
+-!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
+     if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
+-!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
+         _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" )
+ !!ELSE // CMAKE_STATIC_WINDOWS_BUILD
+     if (EXISTS
+-!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
+-        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
+-!!ELSE
+         \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
+-!!ENDIF
+       AND EXISTS
+-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
+-!!ELSE
+         \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
+-!!ENDIF
+         _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
+ !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
+     endif()
+@@ -317,25 +261,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+ !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
+ !!IF isEmpty(CMAKE_RELEASE_TYPE)
+ !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
+-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-    if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
+-!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
+     if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
+-!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
+         _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" )
+ !!ELSE // CMAKE_STATIC_WINDOWS_BUILD
+     if (EXISTS
+-!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
+-        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
+-!!ELSE
+         \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
+-!!ENDIF
+       AND EXISTS
+-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
+-!!ELSE
+         \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
+-!!ENDIF
+         _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
+ !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
+     endif()
+@@ -354,11 +286,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+     macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION)
+         set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
+ 
+-!!IF isEmpty(CMAKE_PLUGIN_DIR_IS_ABSOLUTE)
+-        set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
+-!!ELSE
+         set(imported_location \"$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
+-!!ENDIF
+         _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 e645ba5803..a0e5c68b7e 100644
+--- a/mkspecs/features/mac/default_post.prf
++++ b/mkspecs/features/mac/default_post.prf
+@@ -24,166 +24,3 @@ qt {
+         }
+     }
+ }
+-
+-# 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
+-    equals(TEMPLATE, lib):!plugin:lib_bundle: QMAKE_RPATHDIR += @loader_path/Frameworks
+-}
+-
+-# Don't pass -headerpad_max_install_names when using Bitcode.
+-# In that case the linker emits a warning stating that the flag is ignored when
+-# used with bitcode, for reasons that cannot be determined (rdar://problem/20748962).
+-# Using this flag is also unnecessary in practice on UIKit platforms since they
+-# are sandboxed, and only UIKit platforms support bitcode to begin with.
+-!bitcode: QMAKE_LFLAGS += $$QMAKE_LFLAGS_HEADERPAD
+-
+-app_extension_api_only {
+-    QMAKE_CFLAGS              += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
+-    QMAKE_CXXFLAGS            += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
+-    QMAKE_CXXFLAGS_PRECOMPILE += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
+-    QMAKE_LFLAGS              += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
+-}
+-
+-macx-xcode {
+-    !isEmpty(QMAKE_XCODE_DEBUG_INFORMATION_FORMAT) {
+-        debug_information_format.name = DEBUG_INFORMATION_FORMAT
+-        debug_information_format.value = $$QMAKE_XCODE_DEBUG_INFORMATION_FORMAT
+-        debug_information_format.build = debug
+-        QMAKE_MAC_XCODE_SETTINGS += debug_information_format
+-    }
+-
+-    QMAKE_XCODE_ARCHS =
+-
+-    arch_device.name = "ARCHS[sdk=$${device.sdk}*]"
+-    arch_device.value = $$QMAKE_APPLE_DEVICE_ARCHS
+-    QMAKE_XCODE_ARCHS += $$QMAKE_APPLE_DEVICE_ARCHS
+-    QMAKE_MAC_XCODE_SETTINGS += arch_device
+-
+-    simulator {
+-        arch_simulator.name = "ARCHS[sdk=$${simulator.sdk}*]"
+-        arch_simulator.value = $$QMAKE_APPLE_SIMULATOR_ARCHS
+-        QMAKE_XCODE_ARCHS += $$QMAKE_APPLE_SIMULATOR_ARCHS
+-        QMAKE_MAC_XCODE_SETTINGS += arch_simulator
+-    }
+-
+-    only_active_arch.name = ONLY_ACTIVE_ARCH
+-    only_active_arch.value = YES
+-    only_active_arch.build = debug
+-    QMAKE_MAC_XCODE_SETTINGS += only_active_arch
+-} else {
+-    device|!simulator: VALID_DEVICE_ARCHS = $$QMAKE_APPLE_DEVICE_ARCHS
+-    simulator: VALID_SIMULATOR_ARCHS = $$QMAKE_APPLE_SIMULATOR_ARCHS
+-    VALID_ARCHS = $$VALID_DEVICE_ARCHS $$VALID_SIMULATOR_ARCHS
+-
+-    isEmpty(VALID_ARCHS): \
+-        error("QMAKE_APPLE_DEVICE_ARCHS or QMAKE_APPLE_SIMULATOR_ARCHS must contain at least one architecture")
+-
+-    single_arch: VALID_ARCHS = $$first(VALID_ARCHS)
+-
+-    ACTIVE_ARCHS = $(filter $(EXPORT_VALID_ARCHS), $(ARCHS))
+-    ARCH_ARGS = $(foreach arch, $(if $(EXPORT_ACTIVE_ARCHS), $(EXPORT_ACTIVE_ARCHS), $(EXPORT_VALID_ARCHS)), -arch $(arch))
+-
+-    QMAKE_EXTRA_VARIABLES += VALID_ARCHS ACTIVE_ARCHS ARCH_ARGS
+-
+-    arch_flags = $(EXPORT_ARCH_ARGS)
+-
+-    QMAKE_CFLAGS += $$arch_flags
+-    QMAKE_CXXFLAGS += $$arch_flags
+-    QMAKE_LFLAGS += $$arch_flags
+-
+-    QMAKE_PCH_ARCHS = $$VALID_ARCHS
+-
+-    macos: deployment_target = $$QMAKE_MACOSX_DEPLOYMENT_TARGET
+-    ios: deployment_target = $$QMAKE_IOS_DEPLOYMENT_TARGET
+-    tvos: deployment_target = $$QMAKE_TVOS_DEPLOYMENT_TARGET
+-    watchos: deployment_target = $$QMAKE_WATCHOS_DEPLOYMENT_TARGET
+-
+-    # If we're doing a simulator and device build, device and simulator
+-    # architectures use different paths and flags for the sysroot and
+-    # deployment target switch, so we must multiplex them across multiple
+-    # architectures using -Xarch. Otherwise we fall back to the simple path.
+-    # This is not strictly necessary, but results in cleaner command lines
+-    # and makes it easier for people to override EXPORT_VALID_ARCHS to limit
+-    # individual rules to a different set of architecture(s) from the overall
+-    # build (such as machtest in QtCore).
+-    simulator:device {
+-        QMAKE_XARCH_CFLAGS =
+-        QMAKE_XARCH_LFLAGS =
+-        QMAKE_EXTRA_VARIABLES += QMAKE_XARCH_CFLAGS QMAKE_XARCH_LFLAGS
+-
+-        for (arch, VALID_ARCHS) {
+-            contains(VALID_SIMULATOR_ARCHS, $$arch) {
+-                sdk = $$simulator.sdk
+-                version_identifier = $$simulator.deployment_identifier
+-            } else {
+-                sdk = $$device.sdk
+-                version_identifier = $$device.deployment_identifier
+-            }
+-
+-            version_min_flags = \
+-                -Xarch_$${arch} \
+-                -m$${version_identifier}-version-min=$$deployment_target
+-            QMAKE_XARCH_CFLAGS_$${arch} = $$version_min_flags \
+-                -Xarch_$${arch} \
+-                -isysroot$$xcodeSDKInfo(Path, $$sdk)
+-            QMAKE_XARCH_LFLAGS_$${arch} = $$version_min_flags \
+-                -Xarch_$${arch} \
+-                -Wl,-syslibroot,$$xcodeSDKInfo(Path, $$sdk)
+-
+-            QMAKE_XARCH_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS_$${arch})
+-            QMAKE_XARCH_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS_$${arch})
+-
+-            QMAKE_EXTRA_VARIABLES += \
+-                QMAKE_XARCH_CFLAGS_$${arch} \
+-                QMAKE_XARCH_LFLAGS_$${arch}
+-        }
+-
+-        QMAKE_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS)
+-        QMAKE_CXXFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS)
+-        QMAKE_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS)
+-    } else {
+-        simulator: \
+-            version_identifier = $$simulator.deployment_identifier
+-        else: \
+-            version_identifier = $$device.deployment_identifier
+-        version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
+-        QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag
+-        QMAKE_CXXFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag
+-        QMAKE_LFLAGS += -Wl,-syslibroot,$$QMAKE_MAC_SDK_PATH $$version_min_flag
+-    }
+-
+-    # Enable precompiled headers for multiple architectures
+-    QMAKE_CFLAGS_USE_PRECOMPILE =
+-    for (arch, VALID_ARCHS) {
+-        icc_pch_style: \
+-            use_flag = "-pch-use "
+-        else: \
+-            use_flag = -include
+-
+-        # Only use Xarch with multi-arch, as the option confuses ccache
+-        count(VALID_ARCHS, 1, greaterThan): \
+-            QMAKE_CFLAGS_USE_PRECOMPILE += \
+-                -Xarch_$${arch}
+-
+-        QMAKE_CFLAGS_USE_PRECOMPILE += \
+-            $${use_flag}${QMAKE_PCH_OUTPUT_$${arch}}
+-    }
+-    icc_pch_style {
+-        QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE -include ${QMAKE_PCH_INPUT}
+-        QMAKE_CFLAGS_USE_PRECOMPILE =
+-    } else {
+-        QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
+-        QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
+-        QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
+-    }
+-
+-    QMAKE_PCH_OUTPUT_EXT = _${QMAKE_PCH_ARCH}$${QMAKE_PCH_OUTPUT_EXT}
+-}
+-
+-cache(QMAKE_XCODE_DEVELOPER_PATH, stash)
+-!isEmpty(QMAKE_XCODE_VERSION): \
+-    cache(QMAKE_XCODE_VERSION, stash)
+-
+-QMAKE_XCODE_LIBRARY_SUFFIX = $$qtPlatformTargetSuffix()
+diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
+index 44636f2288..3b01424e67 100644
+--- a/mkspecs/features/mac/default_pre.prf
++++ b/mkspecs/features/mac/default_pre.prf
+@@ -1,56 +1,2 @@
+ CONFIG = asset_catalogs rez $$CONFIG
+ load(default_pre)
+-
+-isEmpty(QMAKE_XCODE_DEVELOPER_PATH) {
+-    # Get path of Xcode's Developer directory
+-    QMAKE_XCODE_DEVELOPER_PATH = $$system("/usr/bin/xcode-select --print-path 2>/dev/null")
+-    isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \
+-        error("Xcode path is not set. Please use xcode-select to choose Xcode installation path.")
+-
+-    # Make sure Xcode path is valid
+-    !exists($$QMAKE_XCODE_DEVELOPER_PATH): \
+-        error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}. Please use xcode-select to choose Xcode installation path.")
+-}
+-
+-isEmpty(QMAKE_XCODEBUILD_PATH): \
+-    QMAKE_XCODEBUILD_PATH = $$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null")
+-
+-!isEmpty(QMAKE_XCODEBUILD_PATH) {
+-    # Make sure Xcode is set up properly
+-    !system("/usr/bin/xcrun xcodebuild -license check 2>/dev/null"): \
+-        error("Xcode not set up properly. You need to confirm the license agreement by running 'sudo xcrun xcodebuild -license accept'.")
+-
+-    isEmpty(QMAKE_XCODE_VERSION) {
+-        # Extract Xcode version using xcodebuild
+-        xcode_version = $$system("/usr/bin/xcrun xcodebuild -version")
+-        QMAKE_XCODE_VERSION = $$member(xcode_version, 1)
+-        isEmpty(QMAKE_XCODE_VERSION): error("Could not resolve Xcode version.")
+-        unset(xcode_version)
+-    }
+-}
+-
+-isEmpty(QMAKE_TARGET_BUNDLE_PREFIX) {
+-    QMAKE_XCODE_PREFERENCES_FILE = $$(HOME)/Library/Preferences/com.apple.dt.Xcode.plist
+-    exists($$QMAKE_XCODE_PREFERENCES_FILE): \
+-        QMAKE_TARGET_BUNDLE_PREFIX = $$system("/usr/libexec/PlistBuddy -c 'print IDETemplateOptions:bundleIdentifierPrefix' $$QMAKE_XCODE_PREFERENCES_FILE 2>/dev/null")
+-
+-    !isEmpty(_QMAKE_CACHE_):!isEmpty(QMAKE_TARGET_BUNDLE_PREFIX): \
+-        cache(QMAKE_TARGET_BUNDLE_PREFIX)
+-}
+-
+-QMAKE_ASSET_CATALOGS_APP_ICON = AppIcon
+-
+-# Make the default debug info format for static debug builds
+-# DWARF instead of DWARF with dSYM. This cuts down build times
+-# for application debug builds significantly, as Xcode doesn't
+-# have to pull out all the DWARF info from the Qt static libs
+-# and put it into a dSYM file. We don't need that dSYM file in
+-# the first place, since the information is available in the
+-# object files inside the archives (static libraries).
+-macx-xcode:qtConfig(static): \
+-    QMAKE_XCODE_DEBUG_INFORMATION_FORMAT = dwarf
+-
+-# This variable is used by the xcode_dynamic_library_suffix
+-# feature, which allows Xcode to choose the Qt libraries to link to
+-# at build time, depending on the current Xcode SDK and configuration.
+-QMAKE_XCODE_LIBRARY_SUFFIX_SETTING = QT_LIBRARY_SUFFIX
+diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
+index 3f6dc076ca..e69de29bb2 100644
+--- a/mkspecs/features/mac/sdk.prf
++++ b/mkspecs/features/mac/sdk.prf
+@@ -1,58 +0,0 @@
+-
+-isEmpty(QMAKE_MAC_SDK): \
+-    error("QMAKE_MAC_SDK must be set when using CONFIG += sdk.")
+-
+-contains(QMAKE_MAC_SDK, .*/.*): \
+-    error("QMAKE_MAC_SDK can only contain short-form SDK names (eg. macosx, iphoneos)")
+-
+-defineReplace(xcodeSDKInfo) {
+-    info = $$1
+-    equals(info, "Path"): \
+-        info = --show-sdk-path
+-    equals(info, "PlatformPath"): \
+-        info = --show-sdk-platform-path
+-    equals(info, "SDKVersion"): \
+-        info = --show-sdk-version
+-    sdk = $$2
+-    isEmpty(sdk): \
+-        sdk = $$QMAKE_MAC_SDK
+-
+-    isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}) {
+-        QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("/usr/bin/xcrun --sdk $$sdk $$info 2>/dev/null")
+-        # --show-sdk-platform-path won't work for Command Line Tools; this is fine
+-        # only used by the XCTest backend to testlib
+-        isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}):if(!isEmpty(QMAKE_XCODEBUILD_PATH)|!equals(info, "--show-sdk-platform-path")): \
+-            error("Could not resolve SDK $$info for \'$$sdk\'")
+-        cache(QMAKE_MAC_SDK.$${sdk}.$${info}, set stash, QMAKE_MAC_SDK.$${sdk}.$${info})
+-    }
+-
+-    return($$eval(QMAKE_MAC_SDK.$${sdk}.$${info}))
+-}
+-
+-QMAKE_MAC_SDK_PATH = $$xcodeSDKInfo(Path)
+-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
+-for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_LINK QMAKE_LINK_SHLIB QMAKE_ACTOOL)) {
+-    tool_variable = QMAKE_MAC_SDK.$${QMAKESPEC_NAME}.$${QMAKE_MAC_SDK}.$${tool}
+-    !isEmpty($$tool_variable) {
+-        $$tool = $$eval($$tool_variable)
+-        next()
+-    }
+-
+-    value = $$eval($$tool)
+-    isEmpty(value): next()
+-
+-    sysrooted = $$system("/usr/bin/xcrun -sdk $$QMAKE_MAC_SDK -find $$first(value) 2>/dev/null")
+-    isEmpty(sysrooted): next()
+-
+-    $$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 4db0040dc5..65d6da1f4d 100644
+--- a/mkspecs/features/qml_module.prf
++++ b/mkspecs/features/qml_module.prf
+@@ -23,13 +23,8 @@ for(qmlf, AUX_QML_FILES): fq_aux_qml_files += $$absolute_path($$qmlf, $$_PRO_FIL
+ 
+ load(qt_build_paths)
+ 
+-qml1_target {
+-    DESTDIR = $$MODULE_BASE_OUTDIR/imports/$$TARGETPATH
+-    instbase = $$[QT_INSTALL_IMPORTS]
+-} else {
+-    DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
+-    instbase = $$[QT_INSTALL_QML]
+-}
++DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
++instbase = $$NIX_OUTPUT_QML
+ 
+ !qml1_target:static: CONFIG += builtin_resources
+ 
+diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf
+index d49f4c49c1..097dcd7d39 100644
+--- a/mkspecs/features/qml_plugin.prf
++++ b/mkspecs/features/qml_plugin.prf
+@@ -48,13 +48,8 @@ exists($$QMLTYPEFILE): AUX_QML_FILES += $$QMLTYPEFILE
+ 
+ load(qt_build_paths)
+ 
+-qml1_target {
+-    DESTDIR = $$MODULE_BASE_OUTDIR/imports/$$TARGETPATH
+-    instbase = $$[QT_INSTALL_IMPORTS]
+-} else {
+-    DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
+-    instbase = $$[QT_INSTALL_QML]
+-}
++DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
++instbase = $$NIX_OUTPUT_QML
+ 
+ target.path = $$instbase/$$TARGETPATH
+ INSTALLS += target
+diff --git a/mkspecs/features/qt_app.prf b/mkspecs/features/qt_app.prf
+index 883f8ca215..81db8eb2d4 100644
+--- a/mkspecs/features/qt_app.prf
++++ b/mkspecs/features/qt_app.prf
+@@ -33,7 +33,7 @@ host_build:force_bootstrap {
+     target.path = $$[QT_HOST_BINS]
+ } else {
+     !build_pass:qtConfig(debug_and_release): CONFIG += release
+-    target.path = $$[QT_INSTALL_BINS]
++    target.path = $$NIX_OUTPUT_BIN/bin
+     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 1848f00e90..2af93675c5 100644
+--- a/mkspecs/features/qt_build_paths.prf
++++ b/mkspecs/features/qt_build_paths.prf
+@@ -23,6 +23,6 @@ exists($$MODULE_BASE_INDIR/.git): \
+ !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.
+-    MODULE_BASE_OUTDIR = $$[QT_HOST_PREFIX]
+-    MODULE_QMAKE_OUTDIR = $$[QT_HOST_PREFIX]
++    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 f4ae5bde80..6d4c6d223f 100644
+--- a/mkspecs/features/qt_common.prf
++++ b/mkspecs/features/qt_common.prf
+@@ -32,8 +32,8 @@ contains(TEMPLATE, .*lib) {
+         qqt_libdir = \$\$\$\$[QT_HOST_LIBS]
+         qt_libdir = $$[QT_HOST_LIBS]
+     } else {
+-        qqt_libdir = \$\$\$\$[QT_INSTALL_LIBS]
+-        qt_libdir = $$[QT_INSTALL_LIBS]
++        qqt_libdir = \$\$\$\$NIX_OUTPUT_OUT/lib
++        qt_libdir = $$NIX_OUTPUT_OUT/lib
+     }
+     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 72dde61a40..f891a2baed 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
+ 
+ QDOC += -outputdir $$shell_quote($$QMAKE_DOCS_OUTPUTDIR)
+ !build_online_docs: \
+-    QDOC += -installdir $$shell_quote($$[QT_INSTALL_DOCS])
++    QDOC += -installdir $$shell_quote($$NIX_OUTPUT_DOC)
+ PREP_DOC_INDEXES =
+ DOC_INDEXES =
+ !isEmpty(QTREPOS) {
+@@ -64,8 +64,8 @@ DOC_INDEXES =
+         DOC_INDEXES += -indexdir $$shell_quote($$qrep/doc)
+ } else {
+     prepare_docs: \
+-        PREP_DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get])
+-    DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get])
++        PREP_DOC_INDEXES += -indexdir $$shell_quote($$NIX_OUTPUT_DOC)
++    DOC_INDEXES += -indexdir $$shell_quote($$NIX_OUTPUT_DOC)
+ }
+ 
+ qtattributionsscanner.target = qtattributionsscanner
+@@ -88,12 +88,12 @@ prepare_docs {
+     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
+-    inst_html_docs.path = $$[QT_INSTALL_DOCS]
++    inst_html_docs.path = $$NIX_OUTPUT_DOC
+     inst_html_docs.CONFIG += no_check_exist directory no_default_install no_build
+     INSTALLS += inst_html_docs
+ 
+     inst_qch_docs.files = $$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch
+-    inst_qch_docs.path = $$[QT_INSTALL_DOCS]
++    inst_qch_docs.path = $$NIX_OUTPUT_DOC
+     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 668669e4cd..eb4840a0aa 100644
+--- a/mkspecs/features/qt_example_installs.prf
++++ b/mkspecs/features/qt_example_installs.prf
+@@ -82,7 +82,7 @@ sourcefiles += \
+     $$SOURCES $$HEADERS $$FORMS $$RESOURCES $$TRANSLATIONS \
+     $$DBUS_ADAPTORS $$DBUS_INTERFACES
+ addInstallFiles(sources.files, $$sourcefiles)
+-sources.path = $$[QT_INSTALL_EXAMPLES]/$$probase
++sources.path = $$NIX_OUTPUT_DEV/share/examples/$$probase
+ 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) {
+ defineTest(qtPrepareTool) {
+     cmd = $$eval(QT_TOOL.$${2}.binary)
+     isEmpty(cmd) {
+-        cmd = $$[QT_HOST_BINS]/$$2
++        cmd = $$system("command -v $$2")
+         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 90d84cc535..387481bfc6 100644
+--- a/mkspecs/features/qt_installs.prf
++++ b/mkspecs/features/qt_installs.prf
+@@ -12,16 +12,10 @@
+ #library
+ !qt_no_install_library {
+     win32 {
+-       host_build: \
+-           dlltarget.path = $$[QT_HOST_BINS]
+-       else: \
+-           dlltarget.path = $$[QT_INSTALL_BINS]
++        dlltarget.path = $$NIX_OUTPUT_BIN/bin
+        INSTALLS += dlltarget
+     }
+-    host_build: \
+-        target.path = $$[QT_HOST_LIBS]
+-    else: \
+-        target.path = $$[QT_INSTALL_LIBS]
++    target.path = $$NIX_OUTPUT_OUT/lib
+     !static: target.CONFIG = no_dll
+     INSTALLS += target
+ }
+@@ -29,33 +23,33 @@
+ #headers
+ qt_install_headers {
+     class_headers.files = $$SYNCQT.HEADER_CLASSES
+-    class_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME
++    class_headers.path = $$NIX_OUTPUT_DEV/include/$$MODULE_INCNAME
+     INSTALLS += class_headers
+ 
+     targ_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.INJECTED_HEADER_FILES
+-    targ_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME
++    targ_headers.path = $$NIX_OUTPUT_DEV/include/$$MODULE_INCNAME
+     INSTALLS += targ_headers
+ 
+     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
+     INSTALLS += private_headers
+ 
+     qpa_headers.files = $$SYNCQT.QPA_HEADER_FILES
+-    qpa_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME/qpa
++    qpa_headers.path = $$NIX_OUTPUT_DEV/include/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME/qpa
+     INSTALLS += qpa_headers
+ }
+ 
+ #module
+ qt_install_module {
+     !isEmpty(MODULE_PRI) {
+-        pritarget.path = $$[QT_HOST_DATA]/mkspecs/modules
++        pritarget.path = $$NIX_OUTPUT_DEV/mkspecs/modules
+         pritarget.files = $$MODULE_PRI
+         INSTALLS += pritarget
+     } else: isEmpty(MODULE_PRIVATE_PRI) {
+         warning("Project $$basename(_PRO_FILE_) is a module, but has not defined MODULE_PRI, which is required for Qt to expose the module to other projects.")
+     }
+     !isEmpty(MODULE_PRIVATE_PRI) {
+-        privpritarget.path = $$[QT_HOST_DATA]/mkspecs/modules
++        privpritarget.path = $$NIX_OUTPUT_DEV/mkspecs/modules
+         privpritarget.files = $$MODULE_PRIVATE_PRI
+         INSTALLS += privpritarget
+     }
+diff --git a/mkspecs/features/qt_plugin.prf b/mkspecs/features/qt_plugin.prf
+index 62e1b69fde..abd63123f9 100644
+--- a/mkspecs/features/qt_plugin.prf
++++ b/mkspecs/features/qt_plugin.prf
+@@ -88,7 +88,7 @@ CONFIG(static, static|shared)|prefix_build {
+     }
+ }
+ 
+-target.path = $$[QT_INSTALL_PLUGINS]/$$PLUGIN_TYPE
++target.path = $$NIX_OUTPUT_PLUGIN/$$PLUGIN_TYPE
+ INSTALLS += target
+ 
+ TARGET = $$qt5LibraryTarget($$TARGET)
+diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
+index 545b9a3d1e..6ac0cdefe4 100644
+--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
++++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
+@@ -3,7 +3,7 @@ if (NOT TARGET Qt5::qmake)
+     add_executable(Qt5::qmake IMPORTED)
+ 
+ !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
++    set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
+ !!ELSE
+     set(imported_location \"$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
+ !!ENDIF
+@@ -18,7 +18,7 @@ if (NOT TARGET Qt5::moc)
+     add_executable(Qt5::moc IMPORTED)
+ 
+ !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
++    set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
+ !!ELSE
+     set(imported_location \"$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
+ !!ENDIF
+@@ -35,7 +35,7 @@ if (NOT TARGET Qt5::rcc)
+     add_executable(Qt5::rcc IMPORTED)
+ 
+ !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
++    set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
+ !!ELSE
+     set(imported_location \"$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
+ !!ENDIF
+@@ -133,7 +133,7 @@ if (NOT TARGET Qt5::WinMain)
+ !!IF !isEmpty(CMAKE_RELEASE_TYPE)
+     set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+ !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
++    set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
+ !!ELSE
+     set(imported_location \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
+ !!ENDIF
+@@ -147,7 +147,7 @@ if (NOT TARGET Qt5::WinMain)
+     set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+ 
+ !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\")
++    set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\")
+ !!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
+@@ -1,6 +1,6 @@
+ 
+ !!IF isEmpty(CMAKE_HOST_DATA_DIR_IS_ABSOLUTE)
+-set(_qt5_corelib_extra_includes \"${_qt5Core_install_prefix}/$${CMAKE_HOST_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
++set(_qt5_corelib_extra_includes \"$$NIX_OUTPUT_DEV/$${CMAKE_HOST_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
+ !!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
+@@ -1,6 +1,6 @@
+ 
+ !!IF isEmpty(CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE)
+-set(_qt5_corelib_extra_includes \"${_qt5Core_install_prefix}/$${CMAKE_INSTALL_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
++set(_qt5_corelib_extra_includes \"$$NIX_OUTPUT_DEV/$${CMAKE_INSTALL_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
+ !!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 609e52d9d2..f0f29ce61f 100644
+--- a/src/corelib/kernel/qcoreapplication.cpp
++++ b/src/corelib/kernel/qcoreapplication.cpp
+@@ -2580,6 +2580,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 bcc1285472..a77eb472a3 100644
+--- a/src/corelib/tools/qtimezoneprivate_tz.cpp
++++ b/src/corelib/tools/qtimezoneprivate_tz.cpp
+@@ -70,7 +70,11 @@ typedef QHash<QByteArray, QTzTimeZone> QTzTimeZoneHash;
+ // Parse zone.tab table, assume lists all installed zones, if not will need to read directories
+ static QTzTimeZoneHash loadTzTimeZones()
+ {
+-    QString path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
++    // Try TZDIR first, in case we're running on NixOS.
++    QString path = QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/zone.tab");
++    // Fallback to traditional paths in case we are not on NixOS.
++    if (!QFile::exists(path))
++        path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
+     if (!QFile::exists(path))
+         path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
+ 
+@@ -644,12 +648,16 @@ void QTzTimeZonePrivate::init(const QByteArray &ianaId)
+         if (!tzif.open(QIODevice::ReadOnly))
+             return;
+     } else {
+-        // Open named tz, try modern path first, if fails try legacy path
+-        tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
++        // Try TZDIR first, in case we're running on NixOS
++        tzif.setFileName(QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/") + QString::fromLocal8Bit(ianaId));
+         if (!tzif.open(QIODevice::ReadOnly)) {
+-            tzif.setFileName(QLatin1String("/usr/lib/zoneinfo/") + QString::fromLocal8Bit(ianaId));
+-            if (!tzif.open(QIODevice::ReadOnly))
+-                return;
++            // Open named tz, try modern path first, if fails try legacy path
++            tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
++            if (!tzif.open(QIODevice::ReadOnly)) {
++                tzif.setFileName(QLatin1String("/usr/lib/zoneinfo/") + QString::fromLocal8Bit(ianaId));
++                if (!tzif.open(QIODevice::ReadOnly))
++                    return;
++            }
+         }
+     }
+ 
+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
+@@ -2,11 +2,7 @@
+ if (NOT TARGET Qt5::qdbuscpp2xml)
+     add_executable(Qt5::qdbuscpp2xml IMPORTED)
+ 
+-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
+-!!ELSE
+-    set(imported_location \"$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
+-!!ENDIF
++    set(imported_location \"$$NIX_OUTPUT_DEV/bin/qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
+     _qt5_DBus_check_file_exists(${imported_location})
+ 
+     set_target_properties(Qt5::qdbuscpp2xml PROPERTIES
+@@ -17,11 +13,7 @@ endif()
+ if (NOT TARGET Qt5::qdbusxml2cpp)
+     add_executable(Qt5::qdbusxml2cpp IMPORTED)
+ 
+-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
+-!!ELSE
+-    set(imported_location \"$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
+-!!ENDIF
++    set(imported_location \"$$NIX_OUTPUT_DEV/bin/qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
+     _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
+@@ -2,7 +2,7 @@
+ !!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE)
+ 
+ !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
+-set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR/QtANGLE\")
++set(Qt5Gui_EGL_INCLUDE_DIRS \"$$NIX_OUTPUT_DEV/$$CMAKE_INCLUDE_DIR/QtANGLE\")
+ !!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
+     set_property(TARGET Qt5::${TargetName} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
+ 
+ !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5Gui_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
++    set(imported_location \"$$NIX_OUTPUT_OUT/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
+ !!ELSE
+     set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
+ !!ENDIF
+ 
+ !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-    set(imported_implib \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
++    set(imported_implib \"$$NIX_OUTPUT_OUT/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
+ !!ELSE
+     set(imported_implib \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
+ !!ENDIF
+diff --git a/src/network/kernel/qdnslookup_unix.cpp b/src/network/kernel/qdnslookup_unix.cpp
+index 1da00813ce..0bf877afcb 100644
+--- a/src/network/kernel/qdnslookup_unix.cpp
++++ b/src/network/kernel/qdnslookup_unix.cpp
+@@ -92,7 +92,7 @@ static bool resolveLibraryInternal()
+     if (!lib.load())
+ #endif
+     {
+-        lib.setFileName(QLatin1String("resolv"));
++        lib.setFileName(QLatin1String(NIXPKGS_LIBRESOLV));
+         if (!lib.load())
+             return false;
+     }
+diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
+index 8d2cffc304..9730fb33f2 100644
+--- a/src/network/kernel/qhostinfo_unix.cpp
++++ b/src/network/kernel/qhostinfo_unix.cpp
+@@ -98,7 +98,7 @@ static bool resolveLibraryInternal()
+     if (!lib.load())
+ #endif
+     {
+-        lib.setFileName(QLatin1String("resolv"));
++        lib.setFileName(QLatin1String(NIXPKGS_LIBRESOLV));
+         if (!lib.load())
+             return false;
+     }
+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()
+     m_possibleLocations.reserve(7);
+     if (qEnvironmentVariableIsSet("QTCOMPOSE"))
+         m_possibleLocations.append(QString::fromLocal8Bit(qgetenv("QTCOMPOSE")));
+-    m_possibleLocations.append(QStringLiteral("/usr/share/X11/locale"));
+-    m_possibleLocations.append(QStringLiteral("/usr/local/share/X11/locale"));
+-    m_possibleLocations.append(QStringLiteral("/usr/lib/X11/locale"));
+-    m_possibleLocations.append(QStringLiteral("/usr/local/lib/X11/locale"));
+     m_possibleLocations.append(QStringLiteral(X11_PREFIX "/share/X11/locale"));
+     m_possibleLocations.append(QStringLiteral(X11_PREFIX "/lib/X11/locale"));
++    m_possibleLocations.append(QLatin1String(NIXPKGS_QTCOMPOSE));
+ }
+ 
+ QString TableGenerator::findComposeFile()
+diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
+index 3bc8590d36..2a78fde518 100644
+--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
++++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
+@@ -580,7 +580,14 @@ QFunctionPointer QGLXContext::getProcAddress(const char *procName)
+ #if QT_CONFIG(library)
+                 extern const QString qt_gl_library_name();
+ //                QLibrary lib(qt_gl_library_name());
++                // Check system library paths first
+                 QLibrary lib(QLatin1String("GL"));
++#ifdef NIXPKGS_MESA_GL
++                if (!lib.load()) {
++                    // Fallback to Mesa driver
++                    lib.setFileName(QLatin1String(NIXPKGS_MESA_GL));
++                }
++#endif // NIXPKGS_MESA_GL
+                 glXGetProcAddressARB = (qt_glXGetProcAddressARB) lib.resolve("glXGetProcAddressARB");
+ #endif
+             }
+diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
+index da63360333..95e34e2e50 100644
+--- a/src/plugins/platforms/xcb/qxcbcursor.cpp
++++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
+@@ -311,10 +311,10 @@ QXcbCursor::QXcbCursor(QXcbConnection *conn, QXcbScreen *screen)
+ #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
+     static bool function_ptrs_not_initialized = true;
+     if (function_ptrs_not_initialized) {
+-        QLibrary xcursorLib(QLatin1String("Xcursor"), 1);
++        QLibrary xcursorLib(QLatin1String(NIXPKGS_LIBXCURSOR), 1);
+         bool xcursorFound = xcursorLib.load();
+         if (!xcursorFound) { // try without the version number
+-            xcursorLib.setFileName(QLatin1String("Xcursor"));
++            xcursorLib.setFileName(QLatin1String(NIXPKGS_LIBXCURSOR));
+             xcursorFound = xcursorLib.load();
+         }
+         if (xcursorFound) {
+diff --git a/src/plugins/platformthemes/gtk3/main.cpp b/src/plugins/platformthemes/gtk3/main.cpp
+index c4cd66c33b..b6f2691587 100644
+--- a/src/plugins/platformthemes/gtk3/main.cpp
++++ b/src/plugins/platformthemes/gtk3/main.cpp
+@@ -39,6 +39,7 @@
+ 
+ #include <qpa/qplatformthemeplugin.h>
+ #include "qgtk3theme.h"
++#include <QFile>
+ 
+ QT_BEGIN_NAMESPACE
+ 
+@@ -54,8 +55,22 @@ public:
+ QPlatformTheme *QGtk3ThemePlugin::create(const QString &key, const QStringList &params)
+ {
+     Q_UNUSED(params);
+-    if (!key.compare(QLatin1String(QGtk3Theme::name), Qt::CaseInsensitive))
++    if (!key.compare(QLatin1String(QGtk3Theme::name), Qt::CaseInsensitive)) {
++
++#ifdef NIXPKGS_QGTK3_XDG_DATA_DIRS
++        QStringList XDG_DATA_DIRS = QFile::decodeName(qgetenv("XDG_DATA_DIRS")).split(':');
++        XDG_DATA_DIRS << QLatin1String(NIXPKGS_QGTK3_XDG_DATA_DIRS);
++        qputenv("XDG_DATA_DIRS", QFile::encodeName(XDG_DATA_DIRS.join(':')));
++#endif
++
++#ifdef NIXPKGS_QGTK3_GIO_EXTRA_MODULES
++        QStringList GIO_EXTRA_MODULES = QFile::decodeName(qgetenv("GIO_EXTRA_MODULES")).split(':');
++        GIO_EXTRA_MODULES << QLatin1String(NIXPKGS_QGTK3_GIO_EXTRA_MODULES);
++        qputenv("GIO_EXTRA_MODULES", QFile::encodeName(GIO_EXTRA_MODULES.join(':')));
++#endif
++
+         return new QGtk3Theme;
++    }
+ 
+     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
+@@ -44,10 +44,13 @@
+ 
+ QT_BEGIN_NAMESPACE
+ 
+-
++#if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
++#define QTEST_ASSERT(cond) do { } while ((false) && (cond))
++#define QTEST_ASSERT_X(cond, where, what) do { } while ((false) && (cond))
++#else
+ #define QTEST_ASSERT(cond) do { if (!(cond)) qt_assert(#cond,__FILE__,__LINE__); } while (false)
+-
+ #define QTEST_ASSERT_X(cond, where, what) do { if (!(cond)) qt_assert_x(where, what,__FILE__,__LINE__); } while (false)
++#endif
+ 
+ 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)
+     add_executable(Qt5::uic IMPORTED)
+ 
+ !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5Widgets_install_prefix}/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
++    set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
+ !!ELSE
+     set(imported_location \"$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
+ !!ENDIF
diff --git a/pkgs/development/libraries/qt-5/5.10/qtdeclarative.patch b/pkgs/development/libraries/qt-5/5.10/qtdeclarative.patch
new file mode 100644
index 000000000000..01a975c14ec7
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/qtdeclarative.patch
@@ -0,0 +1,33 @@
+diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
+index a7cafa1a9..e17ffd35b 100644
+--- a/src/qml/qml/qqmlimport.cpp
++++ b/src/qml/qml/qqmlimport.cpp
+@@ -1737,6 +1737,15 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
+     QString installImportsPath =  QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
+     addImportPath(installImportsPath);
+ 
++    // Add import paths derived from PATH
++    const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
++    const QString qmldir = QStringLiteral("../" NIXPKGS_QML2_IMPORT_PREFIX);
++    for (const QString &path: paths) {
++        if (!path.isEmpty()) {
++            addImportPath(QDir::cleanPath(path + QDir::separator() + qmldir));
++        }
++    }
++
+     // env import paths
+     if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QML2_IMPORT_PATH"))) {
+         const QString envImportPath = qEnvironmentVariable("QML2_IMPORT_PATH");
+diff --git a/tools/qmlcachegen/qmlcache.prf b/tools/qmlcachegen/qmlcache.prf
+index 330da358b..cdf570205 100644
+--- a/tools/qmlcachegen/qmlcache.prf
++++ b/tools/qmlcachegen/qmlcache.prf
+@@ -44,7 +44,7 @@ defineReplace(qmlCacheOutputFileName) {
+ }
+ 
+ qmlcacheinst.base = $$QMLCACHE_DESTDIR
+-qmlcacheinst.path = $$[QT_INSTALL_QML]/$$TARGETPATH
++qmlcacheinst.path = $$NIX_OUTPUT_QML/$$TARGETPATH
+ qmlcacheinst.CONFIG = no_check_exist
+ 
+ qmlcachegen.input = CACHEGEN_FILES
diff --git a/pkgs/development/libraries/qt-5/5.10/qtscript.patch b/pkgs/development/libraries/qt-5/5.10/qtscript.patch
new file mode 100644
index 000000000000..5508dec1280e
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/qtscript.patch
@@ -0,0 +1,13 @@
+diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
+index 1f6d25e..087c3fb 100644
+--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
++++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
+@@ -81,7 +81,7 @@
+ #include <pthread.h>
+ #elif PLATFORM(GTK)
+ #include <wtf/gtk/GOwnPtr.h>
+-typedef struct _GMutex GMutex;
++typedef union _GMutex GMutex;
+ typedef struct _GCond GCond;
+ #endif
+ 
diff --git a/pkgs/development/libraries/qt-5/5.10/qtserialport.patch b/pkgs/development/libraries/qt-5/5.10/qtserialport.patch
new file mode 100644
index 000000000000..f25524e80bcf
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/qtserialport.patch
@@ -0,0 +1,22 @@
+diff --git a/src/serialport/qtudev_p.h b/src/serialport/qtudev_p.h
+index af2dab2..8e17f64 100644
+--- a/src/serialport/qtudev_p.h
++++ b/src/serialport/qtudev_p.h
+@@ -111,9 +111,17 @@ inline QFunctionPointer resolveSymbol(QLibrary *udevLibrary, const char *symbolN
+ inline bool resolveSymbols(QLibrary *udevLibrary)
+ {
+     if (!udevLibrary->isLoaded()) {
++#ifdef NIXPKGS_LIBUDEV
++        udevLibrary->setFileNameAndVersion(QLatin1String(NIXPKGS_LIBUDEV), 1);
++#else
+         udevLibrary->setFileNameAndVersion(QStringLiteral("udev"), 1);
++#endif
+         if (!udevLibrary->load()) {
++#ifdef NIXPKGS_LIBUDEV
++            udevLibrary->setFileNameAndVersion(QLatin1String(NIXPKGS_LIBUDEV), 0);
++#else
+             udevLibrary->setFileNameAndVersion(QStringLiteral("udev"), 0);
++#endif
+             if (!udevLibrary->load()) {
+                 qWarning("Failed to load the library: %s, supported version(s): %i and %i", qPrintable(udevLibrary->fileName()), 1, 0);
+                 return false;
diff --git a/pkgs/development/libraries/qt-5/5.10/qttools.patch b/pkgs/development/libraries/qt-5/5.10/qttools.patch
new file mode 100644
index 000000000000..fbba439ef7a5
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/qttools.patch
@@ -0,0 +1,71 @@
+diff --git a/src/assistant/help/Qt5HelpConfigExtras.cmake.in b/src/assistant/help/Qt5HelpConfigExtras.cmake.in
+index 3b97923a..63336bd5 100644
+--- a/src/assistant/help/Qt5HelpConfigExtras.cmake.in
++++ b/src/assistant/help/Qt5HelpConfigExtras.cmake.in
+@@ -2,11 +2,10 @@
+ if (NOT TARGET Qt5::qcollectiongenerator)
+     add_executable(Qt5::qcollectiongenerator IMPORTED)
+ 
+-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5Help_install_prefix}/$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\")
+-!!ELSE
+     set(imported_location \"$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\")
+-!!ENDIF
++    if(NOT EXISTS \"${imported_location}\")
++        set(imported_location \"$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\")
++    endif()
+     _qt5_Help_check_file_exists(${imported_location})
+ 
+     set_target_properties(Qt5::qcollectiongenerator PROPERTIES
+@@ -17,11 +16,7 @@ endif()
+ if (NOT TARGET Qt5::qhelpgenerator)
+     add_executable(Qt5::qhelpgenerator IMPORTED)
+ 
+-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5Help_install_prefix}/$${CMAKE_BIN_DIR}qhelpgenerator$$CMAKE_BIN_SUFFIX\")
+-!!ELSE
+     set(imported_location \"$${CMAKE_BIN_DIR}qhelpgenerator$$CMAKE_BIN_SUFFIX\")
+-!!ENDIF
+     _qt5_Help_check_file_exists(${imported_location})
+ 
+     set_target_properties(Qt5::qhelpgenerator PROPERTIES
+diff --git a/src/linguist/Qt5LinguistToolsConfig.cmake.in b/src/linguist/Qt5LinguistToolsConfig.cmake.in
+index 4318b16f..d60db4ff 100644
+--- a/src/linguist/Qt5LinguistToolsConfig.cmake.in
++++ b/src/linguist/Qt5LinguistToolsConfig.cmake.in
+@@ -44,11 +44,7 @@ endmacro()
+ if (NOT TARGET Qt5::lrelease)
+     add_executable(Qt5::lrelease IMPORTED)
+ 
+-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5_linguisttools_install_prefix}/$${CMAKE_BIN_DIR}lrelease$$CMAKE_BIN_SUFFIX\")
+-!!ELSE
+     set(imported_location \"$${CMAKE_BIN_DIR}lrelease$$CMAKE_BIN_SUFFIX\")
+-!!ENDIF
+     _qt5_LinguistTools_check_file_exists(${imported_location})
+ 
+     set_target_properties(Qt5::lrelease PROPERTIES
+@@ -59,11 +55,7 @@ endif()
+ if (NOT TARGET Qt5::lupdate)
+     add_executable(Qt5::lupdate IMPORTED)
+ 
+-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5_linguisttools_install_prefix}/$${CMAKE_BIN_DIR}lupdate$$CMAKE_BIN_SUFFIX\")
+-!!ELSE
+     set(imported_location \"$${CMAKE_BIN_DIR}lupdate$$CMAKE_BIN_SUFFIX\")
+-!!ENDIF
+     _qt5_LinguistTools_check_file_exists(${imported_location})
+ 
+     set_target_properties(Qt5::lupdate PROPERTIES
+@@ -74,11 +66,7 @@ endif()
+ if (NOT TARGET Qt5::lconvert)
+     add_executable(Qt5::lconvert IMPORTED)
+ 
+-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5_linguisttools_install_prefix}/$${CMAKE_BIN_DIR}lconvert$$CMAKE_BIN_SUFFIX\")
+-!!ELSE
+     set(imported_location \"$${CMAKE_BIN_DIR}lconvert$$CMAKE_BIN_SUFFIX\")
+-!!ENDIF
+     _qt5_LinguistTools_check_file_exists(${imported_location})
+ 
+     set_target_properties(Qt5::lconvert PROPERTIES
diff --git a/pkgs/development/libraries/qt-5/5.10/qtwebengine-paxmark-mksnapshot.patch b/pkgs/development/libraries/qt-5/5.10/qtwebengine-paxmark-mksnapshot.patch
new file mode 100644
index 000000000000..e1621b005c61
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/qtwebengine-paxmark-mksnapshot.patch
@@ -0,0 +1,48 @@
+diff --git a/src/3rdparty/chromium/v8/src/v8.gyp b/chromium/v8/src/v8.gyp
+index e7e19f5059..934448c7d8 100644
+--- a/src/3rdparty/chromium/v8/src/v8.gyp
++++ b/src/3rdparty/chromium/v8/src/v8.gyp
+@@ -35,6 +35,7 @@
+     'v8_extra_library_files%': [],
+     'v8_experimental_extra_library_files%': [],
+     'mksnapshot_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mksnapshot<(EXECUTABLE_SUFFIX)',
++    'mksnapshot_u_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mksnapshot_u<(EXECUTABLE_SUFFIX)',
+     'v8_os_page_size%': 0,
+   },
+   'includes': ['../gypfiles/toolchain.gypi', '../gypfiles/features.gypi', 'inspector/inspector.gypi'],
+@@ -2576,7 +2577,7 @@
+         ]
+     },
+     {
+-      'target_name': 'mksnapshot',
++      'target_name': 'mksnapshot_u',
+       'type': 'executable',
+       'dependencies': [
+         'v8_base',
+@@ -2606,5 +2607,26 @@
+         }],
+       ],
+     },
++    {
++      'target_name': 'mksnapshot',
++      'type': 'executable',
++      'dependencies': ['mksnapshot_u'],
++      'actions': [
++        {
++          'action_name': 'paxmark_m_mksnapshot',
++          'inputs': [
++            '<(mksnapshot_u_exec)',
++          ],
++          'outputs': [
++            '<(mksnapshot_exec)',
++          ],
++          'action': [
++            'sh',
++            '-c',
++            'cp <(mksnapshot_u_exec) <(mksnapshot_exec) && paxctl -czexm <(mksnapshot_exec)',
++          ],
++        },
++      ],
++    },
+   ],
+ }
diff --git a/pkgs/development/libraries/qt-5/5.10/qtwebkit.patch b/pkgs/development/libraries/qt-5/5.10/qtwebkit.patch
new file mode 100644
index 000000000000..c78cb58f564b
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/qtwebkit.patch
@@ -0,0 +1,77 @@
+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
++++ b/Source/WebCore/plugins/qt/PluginPackageQt.cpp
+@@ -136,7 +136,11 @@ static void initializeGtk(QLibrary* module = 0)
+         }
+     }
+ 
++#ifdef NIXPKGS_LIBGTK2
++    QLibrary library(QLatin1String(NIXPKGS_LIBGTK2), 0);
++#else
+     QLibrary library(QLatin1String("libgtk-x11-2.0"), 0);
++#endif
+     if (library.load()) {
+         typedef void *(*gtk_init_check_ptr)(int*, char***);
+         gtk_init_check_ptr gtkInitCheck = (gtk_init_check_ptr)library.resolve("gtk_init_check");
+diff --git a/Source/WebCore/plugins/qt/PluginViewQt.cpp b/Source/WebCore/plugins/qt/PluginViewQt.cpp
+index de06a2fea..86fe39ef1 100644
+--- a/Source/WebCore/plugins/qt/PluginViewQt.cpp
++++ b/Source/WebCore/plugins/qt/PluginViewQt.cpp
+@@ -697,7 +697,11 @@ static Display *getPluginDisplay()
+     // support gdk based plugins (like flash) that use a different X connection.
+     // The code below has the same effect as this one:
+     // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default());
++#ifdef NIXPKGS_LIBGDK2
++    QLibrary library(QLatin1String(NIXPKGS_LIBGDK2), 0);
++#else
+     QLibrary library(QLatin1String("libgdk-x11-2.0"), 0);
++#endif
+     if (!library.load())
+         return 0;
+ 
+diff --git a/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp b/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
+index 8de65216b..38f5c05e5 100644
+--- a/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
++++ b/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
+@@ -53,7 +53,11 @@ static void messageHandler(QtMsgType type, const QMessageLogContext&, const QStr
+ 
+ static bool initializeGtk()
+ {
++#ifdef NIXPKGS_LIBGTK2
++    QLibrary gtkLibrary(QLatin1String(NIXPKGS_LIBGTK2), 0);
++#else
+     QLibrary gtkLibrary(QLatin1String("libgtk-x11-2.0"), 0);
++#endif
+     if (!gtkLibrary.load())
+         return false;
+     typedef void* (*gtk_init_ptr)(void*, void*);
+diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
+index d734ff684..0f6ff63d1 100644
+--- a/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
++++ b/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
+@@ -64,7 +64,11 @@ static Display* getPluginDisplay()
+     // The code below has the same effect as this one:
+     // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default());
+ 
++#ifdef NIXPKGS_LIBGDK2
++    QLibrary library(QLatin1String(NIXPKGS_LIBGDK2), 0);
++#else
+     QLibrary library(QLatin1String("libgdk-x11-2.0"), 0);
++#endif
+     if (!library.load())
+         return 0;
+ 
diff --git a/pkgs/development/libraries/qt-5/5.10/srcs.nix b/pkgs/development/libraries/qt-5/5.10/srcs.nix
new file mode 100644
index 000000000000..5369169aa67f
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/srcs.nix
@@ -0,0 +1,341 @@
+# DO NOT EDIT! This file is generated automatically by fetch-kde-qt.sh
+{ fetchurl, mirror }:
+
+{
+  qt3d = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qt3d-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1arlplfpqdk0qki7bs1pp16y9cwa0awn071p551jg4y74xr7wi8j";
+      name = "qt3d-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtactiveqt = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtactiveqt-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0x6nbi5hlbr1pncbd8zzkwmqi04gcy64q3bjy5w45rg6zws41mzr";
+      name = "qtactiveqt-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtandroidextras = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtandroidextras-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1ifb49px86abaf4znmlis9wyyxq132nlgj3fyqppbx1sranikygk";
+      name = "qtandroidextras-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtbase = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtbase-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0qpp56cbw1sfz5ayhj2mskb07cl6jd1ijayg29y624qa6b6phmgx";
+      name = "qtbase-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtcanvas3d = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtcanvas3d-everywhere-src-5.10.0.tar.xz";
+      sha256 = "11r98mdxy833kcnywlsjrfaqhax7m3b6yhb56072qvr30rpn52fj";
+      name = "qtcanvas3d-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtcharts = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtcharts-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1vri3f7wyg84w6j84452g8h2p7sk7k01r0xszpn4klv7hi52rkhj";
+      name = "qtcharts-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtconnectivity = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtconnectivity-everywhere-src-5.10.0.tar.xz";
+      sha256 = "19k9n6gzrbg0sbgyhhcl5gv0d4b2gjwmz5966gn6b424fblf4grf";
+      name = "qtconnectivity-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtdatavis3d = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtdatavis3d-everywhere-src-5.10.0.tar.xz";
+      sha256 = "06363x449k7wkqrd7c0y6b5vqlpwssnkl0g5s1bhp8lkl3bw81lj";
+      name = "qtdatavis3d-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtdeclarative = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtdeclarative-everywhere-src-5.10.0.tar.xz";
+      sha256 = "07kicxzbwiqwkg1x2k6447rwzvzn31cv1yyggc1m8r84lny4vjsw";
+      name = "qtdeclarative-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtdoc = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtdoc-everywhere-src-5.10.0.tar.xz";
+      sha256 = "01z4ikqrnnx9mzf5pvk4i2lqks4xai32fs9qqbqnsp0qrrcb1jfn";
+      name = "qtdoc-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtgamepad = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtgamepad-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1rl77rsfgs69cdv75nfjp9w66mndwi211wix5cwl46d7i3wm0xak";
+      name = "qtgamepad-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtgraphicaleffects = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtgraphicaleffects-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0c2y0ixxncn5xslpxciigq1gfaxd3n7wkcf14k4iy5i15w8nkfcp";
+      name = "qtgraphicaleffects-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtimageformats = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtimageformats-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1z7lnw85apzf6ph3dgnbb6py17qzpgww92kz31n6vbv5z62bigwi";
+      name = "qtimageformats-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtlocation = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtlocation-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1iw5m9v5p6l6mivjvj7g1macpqf2n21mg4wg0hza36dwrz3wwkfq";
+      name = "qtlocation-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtmacextras = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtmacextras-everywhere-src-5.10.0.tar.xz";
+      sha256 = "08n8na36j9c15hvicqfs7h915m2av5xd5v0azf7660z0q9lk9zb3";
+      name = "qtmacextras-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtmultimedia = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtmultimedia-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0vw0i5jgn4q63g5ijwwrb6835qdaxcw7sfcjffbqfbdwqgyk70q0";
+      name = "qtmultimedia-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtnetworkauth = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtnetworkauth-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1lnqi1qpy9j5pi2lcmdihf81lspxv6hgdg5jmbqqdqxwzblgpnpc";
+      name = "qtnetworkauth-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtpurchasing = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtpurchasing-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0mkxslc8qc6sclpngllby3bb86qq5csrsz0xrc14nwmbkhwksxwc";
+      name = "qtpurchasing-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtquickcontrols = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtquickcontrols-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0ab19raip9828br21qqaglr4y0kqmxix882r13sfxlnm4ivyycx1";
+      name = "qtquickcontrols-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtquickcontrols2 = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtquickcontrols2-everywhere-src-5.10.0.tar.xz";
+      sha256 = "18d1b5aivaqgs1px61glkyclkky60xd7yzy1vwa1f89sg8j711w1";
+      name = "qtquickcontrols2-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtremoteobjects = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtremoteobjects-everywhere-src-5.10.0.tar.xz";
+      sha256 = "01bf1ykqxb4d8wz58vxy15yj4jsaqhi258k05dhy7ygdvfgscdnz";
+      name = "qtremoteobjects-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtscript = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtscript-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1z6a14x9yj0p2znc0vny8y4zkdvm5fp42rnisnf9rynakkqg5wkc";
+      name = "qtscript-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtscxml = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtscxml-everywhere-src-5.10.0.tar.xz";
+      sha256 = "142qysd5s706r62gap62s89xm7334i1ys29dqsp09av9n7b1kfsb";
+      name = "qtscxml-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtsensors = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtsensors-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0w9rzqc0hva4521i5j298lrsvys3jqddmqd80cxj9nsvnapwb66d";
+      name = "qtsensors-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtserialbus = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtserialbus-everywhere-src-5.10.0.tar.xz";
+      sha256 = "06rr0191zy5yxqzxiv0c6dvshncjg8kdc33lszk41pajv624fn9z";
+      name = "qtserialbus-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtserialport = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtserialport-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0mqlhdp20jl6agv58mszznsikmi1dflhalkpfbgpiafjzzczx075";
+      name = "qtserialport-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtspeech = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtspeech-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1hashidb33f1215f0azjby1lh8iw7v2bvxp08mqvdk02jld9w5br";
+      name = "qtspeech-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtsvg = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtsvg-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1c77wnpzjz4wwic5if876y5v1n44v2g2nhjmcs25cc8awz5afaja";
+      name = "qtsvg-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qttools = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qttools-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0cpybii2yznk6gwaa2cz83rk3cpzzm6l4wvn4n2xwdbrgdsdrx8z";
+      name = "qttools-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qttranslations = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qttranslations-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1gmrisf08nsrni7fyjlz5ggfgfzzkjpq3g7l2hc6vq5g04vbskgc";
+      name = "qttranslations-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtvirtualkeyboard = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtvirtualkeyboard-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0mqb9sgvq7djd2lz4q4p6p9f0c23cfhk447zx4axvv1mldjxsb9c";
+      name = "qtvirtualkeyboard-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtwayland = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtwayland-everywhere-src-5.10.0.tar.xz";
+      sha256 = "14sb0227rzqzf5z8dz8b9nzkk5rwq6hrfxifz603iy4mdijzjmsn";
+      name = "qtwayland-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtwebchannel = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtwebchannel-everywhere-src-5.10.0.tar.xz";
+      sha256 = "18rml5xyb9chz8wrfamsgx4z32kkjbk1rc47ynvhn49mcbf2897j";
+      name = "qtwebchannel-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtwebengine = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtwebengine-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1yb7jpydxg0dwdrx0iv7i5dq4wb9ld1iff8zpjdj8yl4xy4mkgx8";
+      name = "qtwebengine-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtwebglplugin = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtwebglplugin-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0hgwb5lll3275knnj3ms04y1n0i6gph9kac2246ixmcq8sc7a2k7";
+      name = "qtwebglplugin-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtwebsockets = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtwebsockets-everywhere-src-5.10.0.tar.xz";
+      sha256 = "00wlyhw7h2axyhinksfm912jfa3n73szxdccz5dlir8742i0zaqp";
+      name = "qtwebsockets-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtwebview = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtwebview-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1955fkc7a22d7a0y2n7kz7r1md56v2s5qvyb3h68szs60zjnk3xa";
+      name = "qtwebview-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtwinextras = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtwinextras-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1mx5qihmh3awqcr9k3z2chxz8273bi5ha90v7f4fqr2vk3g6w4yd";
+      name = "qtwinextras-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtx11extras = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtx11extras-everywhere-src-5.10.0.tar.xz";
+      sha256 = "11jp0a40jqwcdq7isyip4f4mq2d58c9fx1kvg9g71m92n52ffyfb";
+      name = "qtx11extras-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtxmlpatterns = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtxmlpatterns-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1hq3sbimbhaiw570d2cd84jhki0n2jw2x2s7iq92m53y4akbr2mh";
+      name = "qtxmlpatterns-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtwebkit = {
+    version = "5.9.1";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtwebkit-opensource-src-5.9.1.tar.xz";
+      sha256 = "1ksjn1vjbfhdm4y4rg08ag4krk87ahp7qcdcpwll42l0rnz61998";
+      name = "qtwebkit-opensource-src-5.9.1.tar.xz";
+    };
+  };
+  qtwebkit-examples = {
+    version = "5.9.1";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtwebkit-examples-opensource-src-5.9.1.tar.xz";
+      sha256 = "1l2l7ycgqql6rf4gx6sjhsqjapdhvy6vxaxssax3l938nkk4vkp4";
+      name = "qtwebkit-examples-opensource-src-5.9.1.tar.xz";
+    };
+  };
+}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase.patch b/pkgs/development/libraries/qt-5/5.6/qtbase.patch
index 6bdf774e15d6..d8322cbc1997 100644
--- a/pkgs/development/libraries/qt-5/5.6/qtbase.patch
+++ b/pkgs/development/libraries/qt-5/5.6/qtbase.patch
@@ -1,5 +1,5 @@
 diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
-index 11fb52a0b1..a4cca1fdcb 100644
+index 11fb52a0b1..614fdbb046 100644
 --- a/mkspecs/features/create_cmake.prf
 +++ b/mkspecs/features/create_cmake.prf
 @@ -21,7 +21,7 @@ load(cmake_functions)
@@ -35,7 +35,7 @@ index 11fb52a0b1..a4cca1fdcb 100644
 -    # installed in $${CMAKE_LIB_DIR}/cmake/Qt5$${CMAKE_MODULE_NAME}
 -    CMAKE_RELATIVE_INSTALL_DIR = "$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}../../"
 -}
-+CMAKE_LIB_DIR = $$NIX_OUTPUT_DEV/lib/
++CMAKE_LIB_DIR = $$NIX_OUTPUT_OUT/lib/
 +CMAKE_LIB_DIR_IS_ABSOLUTE = True
  
 -CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
@@ -64,7 +64,7 @@ index 11fb52a0b1..a4cca1fdcb 100644
 -    CMAKE_DLL_DIR = $$CMAKE_LIB_DIR
 -    CMAKE_DLL_DIR_IS_ABSOLUTE = $$CMAKE_LIB_DIR_IS_ABSOLUTE
 -}
-+CMAKE_DLL_DIR = $$NIX_OUTPUT_DEV/lib/
++CMAKE_DLL_DIR = $$NIX_OUTPUT_OUT/lib/
 +CMAKE_DLL_DIR_IS_ABSOLUTE = True
  
  static|staticlib:CMAKE_STATIC_TYPE = true
@@ -628,7 +628,7 @@ index 1d947159e2..b36865fc48 100644
  
      set_target_properties(Qt5::qdbusxml2cpp PROPERTIES
 diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
-index 07869efd7d..37b95d1b6b 100644
+index 07869efd7d..fb4183bada 100644
 --- a/src/gui/Qt5GuiConfigExtras.cmake.in
 +++ b/src/gui/Qt5GuiConfigExtras.cmake.in
 @@ -2,7 +2,7 @@
@@ -652,7 +652,7 @@ index 07869efd7d..37b95d1b6b 100644
  
  !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
 -    set(imported_implib \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
-+    set(imported_implib \"$$NIX_OUTPUT_DEV/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
++    set(imported_implib \"$$NIX_OUTPUT_OUT/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
  !!ELSE
      set(imported_implib \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
  !!ENDIF
@@ -758,6 +758,28 @@ index 4646ced954..ff3111f393 100644
              xcursorFound = xcursorLib.load();
          }
          if (xcursorFound) {
+diff --git a/src/testlib/qtestassert.h b/src/testlib/qtestassert.h
+index ca3e02ca06..28dd73d772 100644
+--- a/src/testlib/qtestassert.h
++++ b/src/testlib/qtestassert.h
+@@ -38,10 +38,13 @@
+ 
+ QT_BEGIN_NAMESPACE
+ 
+-
+-#define QTEST_ASSERT(cond) do { if (!(cond)) qt_assert(#cond,__FILE__,__LINE__); } while (0)
+-
+-#define QTEST_ASSERT_X(cond, where, what) do { if (!(cond)) qt_assert_x(where, what,__FILE__,__LINE__); } while (0)
++#if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
++#define QTEST_ASSERT(cond) do { } while ((false) && (cond))
++#define QTEST_ASSERT_X(cond, where, what) do { } while ((false) && (cond))
++#else
++#define QTEST_ASSERT(cond) do { if (!(cond)) qt_assert(#cond,__FILE__,__LINE__); } while (false)
++#define QTEST_ASSERT_X(cond, where, what) do { if (!(cond)) qt_assert_x(where, what,__FILE__,__LINE__); } while (false)
++#endif
+ 
+ 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
diff --git a/pkgs/development/libraries/qt-5/5.9/qtbase.patch b/pkgs/development/libraries/qt-5/5.9/qtbase.patch
index 69e389a5a6d4..086ddf4fe3e7 100644
--- a/pkgs/development/libraries/qt-5/5.9/qtbase.patch
+++ b/pkgs/development/libraries/qt-5/5.9/qtbase.patch
@@ -12,7 +12,7 @@ index 5208379f9a..92fe29a0ac 100644
  
  QMAKE_LFLAGS_REL_RPATH  =
 diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
-index bb5083c925..da8e2cb386 100644
+index bb5083c925..77034f9bb6 100644
 --- a/mkspecs/features/create_cmake.prf
 +++ b/mkspecs/features/create_cmake.prf
 @@ -21,7 +21,7 @@ load(cmake_functions)
@@ -48,7 +48,7 @@ index bb5083c925..da8e2cb386 100644
 -    # installed in $${CMAKE_LIB_DIR}/cmake/Qt5$${CMAKE_MODULE_NAME}
 -    CMAKE_RELATIVE_INSTALL_DIR = "$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}../../"
 -}
-+CMAKE_LIB_DIR = $$NIX_OUTPUT_DEV/lib/
++CMAKE_LIB_DIR = $$NIX_OUTPUT_OUT/lib/
 +CMAKE_LIB_DIR_IS_ABSOLUTE = True
  
 -CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
@@ -77,7 +77,7 @@ index bb5083c925..da8e2cb386 100644
 -    CMAKE_DLL_DIR = $$CMAKE_LIB_DIR
 -    CMAKE_DLL_DIR_IS_ABSOLUTE = $$CMAKE_LIB_DIR_IS_ABSOLUTE
 -}
-+CMAKE_DLL_DIR = $$NIX_OUTPUT_DEV/lib/
++CMAKE_DLL_DIR = $$NIX_OUTPUT_OUT/lib/
 +CMAKE_DLL_DIR_IS_ABSOLUTE = True
  
  static|staticlib:CMAKE_STATIC_TYPE = true
@@ -432,13 +432,13 @@ index e645ba5803..a0e5c68b7e 100644
 -
 -QMAKE_XCODE_LIBRARY_SUFFIX = $$qtPlatformTargetSuffix()
 diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
-index 44636f2288..61ed486a76 100644
+index 44636f2288..3b01424e67 100644
 --- a/mkspecs/features/mac/default_pre.prf
 +++ b/mkspecs/features/mac/default_pre.prf
-@@ -1,56 +1,3 @@
+@@ -1,56 +1,2 @@
  CONFIG = asset_catalogs rez $$CONFIG
  load(default_pre)
- 
+-
 -isEmpty(QMAKE_XCODE_DEVELOPER_PATH) {
 -    # Get path of Xcode's Developer directory
 -    QMAKE_XCODE_DEVELOPER_PATH = $$system("/usr/bin/xcode-select --print-path 2>/dev/null")
@@ -493,11 +493,11 @@ index 44636f2288..61ed486a76 100644
 -# at build time, depending on the current Xcode SDK and configuration.
 -QMAKE_XCODE_LIBRARY_SUFFIX_SETTING = QT_LIBRARY_SUFFIX
 diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
-index 3f6dc076ca..8b13789179 100644
+index 3f6dc076ca..e69de29bb2 100644
 --- a/mkspecs/features/mac/sdk.prf
 +++ b/mkspecs/features/mac/sdk.prf
-@@ -1,58 +1 @@
- 
+@@ -1,58 +0,0 @@
+-
 -isEmpty(QMAKE_MAC_SDK): \
 -    error("QMAKE_MAC_SDK must be set when using CONFIG += sdk.")
 -
@@ -676,30 +676,18 @@ index 72dde61a40..f891a2baed 100644
      INSTALLS += inst_qch_docs
  
 diff --git a/mkspecs/features/qt_example_installs.prf b/mkspecs/features/qt_example_installs.prf
-index 668669e4cd..30f7fbac41 100644
+index 668669e4cd..eb4840a0aa 100644
 --- a/mkspecs/features/qt_example_installs.prf
 +++ b/mkspecs/features/qt_example_installs.prf
-@@ -77,13 +77,13 @@ for(extra, extras): \
- # Just for Qt Creator
- OTHER_FILES += $$sourcefiles
- 
--sourcefiles += \
--    $$_PRO_FILE_ $$RC_FILE $$DEF_FILE \
--    $$SOURCES $$HEADERS $$FORMS $$RESOURCES $$TRANSLATIONS \
--    $$DBUS_ADAPTORS $$DBUS_INTERFACES
--addInstallFiles(sources.files, $$sourcefiles)
+@@ -82,7 +82,7 @@ sourcefiles += \
+     $$SOURCES $$HEADERS $$FORMS $$RESOURCES $$TRANSLATIONS \
+     $$DBUS_ADAPTORS $$DBUS_INTERFACES
+ addInstallFiles(sources.files, $$sourcefiles)
 -sources.path = $$[QT_INSTALL_EXAMPLES]/$$probase
--INSTALLS += sources
-+    sourcefiles += \
-+        $$_PRO_FILE_ $$RC_FILE $$DEF_FILE \
-+        $$SOURCES $$HEADERS $$FORMS $$RESOURCES $$TRANSLATIONS \
-+        $$DBUS_ADAPTORS $$DBUS_INTERFACES
-+    addInstallFiles(sources.files, $$sourcefiles)
-+    sources.path = $$NIX_OUTPUT_DEV/share/examples/$$probase
-+    INSTALLS += sources
++sources.path = $$NIX_OUTPUT_DEV/share/examples/$$probase
+ INSTALLS += sources
  
  check_examples {
-     srcfiles = $$sources.files
 diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
 index 1903e509c8..ae7b585989 100644
 --- a/mkspecs/features/qt_functions.prf
@@ -952,7 +940,7 @@ index 1d947159e2..b36865fc48 100644
  
      set_target_properties(Qt5::qdbusxml2cpp PROPERTIES
 diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
-index 07869efd7d..37b95d1b6b 100644
+index 07869efd7d..fb4183bada 100644
 --- a/src/gui/Qt5GuiConfigExtras.cmake.in
 +++ b/src/gui/Qt5GuiConfigExtras.cmake.in
 @@ -2,7 +2,7 @@
@@ -976,7 +964,7 @@ index 07869efd7d..37b95d1b6b 100644
  
  !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
 -    set(imported_implib \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
-+    set(imported_implib \"$$NIX_OUTPUT_DEV/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
++    set(imported_implib \"$$NIX_OUTPUT_OUT/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
  !!ELSE
      set(imported_implib \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
  !!ENDIF
@@ -1028,28 +1016,6 @@ index c92d8fc3f8..6008063bcf 100644
          {
              // specific curves requested, but not possible to set -> error
              sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocket::tr("OpenSSL version too old, need at least v1.0.2"));
-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/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
@@ -1068,19 +1034,6 @@ index b5a0a5bbeb..6c20305f4d 100644
  }
  
  QString TableGenerator::findComposeFile()
-diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
-index 5cd4beb4f0..84919e6d6a 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/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
 index e2e573f0e1..1c8289f81e 100644
 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
@@ -1153,6 +1106,26 @@ index c4cd66c33b..b6f2691587 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
+@@ -44,10 +44,13 @@
+ 
+ QT_BEGIN_NAMESPACE
+ 
+-
++#if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
++#define QTEST_ASSERT(cond) do { } while ((false) && (cond))
++#define QTEST_ASSERT_X(cond, where, what) do { } while ((false) && (cond))
++#else
+ #define QTEST_ASSERT(cond) do { if (!(cond)) qt_assert(#cond,__FILE__,__LINE__); } while (false)
+-
+ #define QTEST_ASSERT_X(cond, where, what) do { if (!(cond)) qt_assert_x(where, what,__FILE__,__LINE__); } while (false)
++#endif
+ 
+ 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
diff --git a/pkgs/development/libraries/qt-5/hooks/fix-qt-module-paths.sh b/pkgs/development/libraries/qt-5/hooks/fix-qt-module-paths.sh
index 916981b5299f..33682f6f3c69 100644
--- a/pkgs/development/libraries/qt-5/hooks/fix-qt-module-paths.sh
+++ b/pkgs/development/libraries/qt-5/hooks/fix-qt-module-paths.sh
@@ -15,8 +15,8 @@ fixQtModulePaths () {
             if grep -q '\$\$QT_MODULE_' "${pr:?}"; then
                 echo "fixQtModulePaths: Fixing module paths in \`${pr:?}'..."
                 sed -i "${pr:?}" \
-                    -e "s|\\\$\\\$QT_MODULE_LIB_BASE|$dev/lib|g" \
-                    -e "s|\\\$\\\$QT_MODULE_HOST_LIB_BASE|$dev/lib|g" \
+                    -e "s|\\\$\\\$QT_MODULE_LIB_BASE|$lib/lib|g" \
+                    -e "s|\\\$\\\$QT_MODULE_HOST_LIB_BASE|$lib/lib|g" \
                     -e "s|\\\$\\\$QT_MODULE_INCLUDE_BASE|$dev/include|g" \
                     -e "s|\\\$\\\$QT_MODULE_BIN_BASE|$dev/bin|g"
             fi
@@ -27,13 +27,6 @@ fixQtModulePaths () {
         echo "fixQtModulePaths: Warning: \`$dir' does not exist"
     fi
 
-    if [ "z$dev" != "z$lib" ]; then
-        if [ -d "$lib/lib" ]; then
-            mkdir -p "$dev/lib"
-            lndir -silent "$lib/lib" "$dev/lib"
-        fi
-    fi
-
     if [ "z$bin" != "z$dev" ]; then
         if [ -d "$bin/bin" ]; then
             mkdir -p "$dev/bin"
diff --git a/pkgs/development/libraries/qt-5/hooks/fix-qt-static-libs.sh b/pkgs/development/libraries/qt-5/hooks/fix-qt-static-libs.sh
deleted file mode 100644
index 2a20e77e7ba7..000000000000
--- a/pkgs/development/libraries/qt-5/hooks/fix-qt-static-libs.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-# fixQtStaticLibs
-#
-# Usage: fixQtStaticLibs _lib_ _dev_
-#
-# Find static Qt libraries in output _lib_ and move them to the corresponding
-# path in output _dev_. Any QMake library definitions (*.prl files) are also
-# moved and library paths are patched.
-#
-fixQtStaticLibs() {
-    local lib="$1"
-    local dev="$2"
-
-    pushd "$lib"
-    if [ -d "lib" ]; then
-        find lib \( -name '*.a' -o -name '*.la' -o -name '*.prl' \) -print0 | \
-            while read -r -d $'\0' file; do
-                mkdir -p "$dev/$(dirname "$file")"
-                mv "$lib/$file" "$dev/$file"
-            done
-    fi
-    popd
-
-    if [ -d "$dev" ]; then
-        find "$dev" -name '*.prl' | while read prl; do
-            echo "fixQtStaticLibs: Fixing built-in paths in \`$prl'..."
-            sed -i "$prl" \
-                -e '/^QMAKE_PRL_BUILD_DIR =/d' \
-                -e '/^QMAKE_PRO_INPUT =/d' \
-                -e "s|-L\\\$\\\$NIX_OUTPUT_OUT/lib|-L$lib/lib -L$dev/lib|g"
-        done
-    fi
-}
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 754a75cbef4f..3a558153988c 100644
--- a/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
+++ b/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
@@ -4,7 +4,6 @@ qtDocPrefix=@qtDocPrefix@
 
 . @fix_qt_builtin_paths@
 . @fix_qt_module_paths@
-. @fix_qt_static_libs@
 
 providesQtRuntime() {
     [ -d "$1/$qtPluginPrefix" ] || [ -d "$1/$qtQmlPrefix" ]
@@ -63,12 +62,3 @@ postPatchMkspecs() {
 if [ -z "$dontPatchMkspecs" ]; then
     postPhases="${postPhases}${postPhases:+ }postPatchMkspecs"
 fi
-
-postMoveQtStaticLibs() {
-    if [ "z${!outputLib}" != "z${!outputDev}" ]; then
-        fixQtStaticLibs "${!outputLib}" "${!outputDev}"
-    fi
-}
-if [ -z "$dontMoveQtStaticLibs" ]; then
-    postPhases="${postPhases}${postPhases:+ }postMoveQtStaticLibs"
-fi
diff --git a/pkgs/development/libraries/qt-5/mkDerivation.nix b/pkgs/development/libraries/qt-5/mkDerivation.nix
index 385ebeacd8f8..97bd09c327b2 100644
--- a/pkgs/development/libraries/qt-5/mkDerivation.nix
+++ b/pkgs/development/libraries/qt-5/mkDerivation.nix
@@ -14,6 +14,8 @@ let
       ++ optional (debug != null)
           (if debug then "CONFIG+=debug" else "CONFIG+=release");
 
+    NIX_CFLAGS_COMPILE = optional (debug != null) "-DQT_NO_DEBUG";
+
     cmakeFlags =
       (args.cmakeFlags or [])
       ++ [ "-DBUILD_TESTING=OFF" ]
diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix
index 5f65f71bbbaa..aa4449504bb9 100644
--- a/pkgs/development/libraries/qt-5/modules/qtbase.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix
@@ -93,11 +93,9 @@ stdenv.mkDerivation {
 
   inherit patches;
 
-  fix_qt_static_libs = ../hooks/fix-qt-static-libs.sh;
   fix_qt_builtin_paths = ../hooks/fix-qt-builtin-paths.sh;
   fix_qt_module_paths = ../hooks/fix-qt-module-paths.sh;
   preHook = ''
-    . "$fix_qt_static_libs"
     . "$fix_qt_builtin_paths"
     . "$fix_qt_module_paths"
     . ${../hooks/move-qt-dev-tools.sh}
@@ -363,11 +361,6 @@ stdenv.mkDerivation {
       fixQtBuiltinPaths "''${!outputDev}" '*.pr?'
     ''
 
-    # Move static libraries and QMake library definitions into $dev.
-    + ''
-      fixQtStaticLibs "''${!outputLib}" "''${!outputDev}"
-    ''
-
     # Move development tools to $dev
     + ''
       moveQtDevTools
diff --git a/pkgs/development/ocaml-modules/uri/default.nix b/pkgs/development/ocaml-modules/uri/default.nix
index f08ee7fc2fc1..5059ef24aa32 100644
--- a/pkgs/development/ocaml-modules/uri/default.nix
+++ b/pkgs/development/ocaml-modules/uri/default.nix
@@ -1,51 +1,33 @@
-{ stdenv, fetchzip, ocaml, findlib, ocamlbuild, re, stringext, ounit
-, sexplib, ppx_sexp_conv
-, legacyVersion ? false
-, sexplib_p4
+{ stdenv, fetchurl, ocaml, findlib, jbuilder, ppx_sexp_conv, ounit
+, ppx_deriving, re, sexplib, stringext
 }:
 
-if !stdenv.lib.versionAtLeast ocaml.version "4"
-|| legacyVersion && stdenv.lib.versionAtLeast ocaml.version "4.03"
-then throw "uri${stdenv.lib.optionalString legacyVersion "_p4"} is not available for OCaml ${ocaml.version}" else
-
-with
-  if legacyVersion
-  then {
-    version = "1.9.1";
-    sha256 = "0v3jxqgyi4kj92r3x83rszfpnvvzy9lyb913basch4q64yka3w85";
-  } else {
-    version = "1.9.2";
-    sha256 = "137pg8j654x7r0d1664iy2zp3l82nki1kkh921lwdrwc5qqdl6jx";
-  };
-
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
+  version = "1.9.6";
   name = "ocaml${ocaml.version}-uri-${version}";
 
-  src = fetchzip {
-    url = "https://github.com/mirage/ocaml-uri/archive/v${version}.tar.gz";
-    inherit sha256;
+  src = fetchurl {
+    url = "https://github.com/mirage/ocaml-uri/releases/download/v${version}/uri-${version}.tbz";
+    sha256 = "1m845rwd70wi4iijkrigyz939m1x84ba70hvv0d9sgk6971w4kz0";
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild ounit ]
-  ++ stdenv.lib.optional (!legacyVersion) ppx_sexp_conv;
-  propagatedBuildInputs = [ re (if legacyVersion then sexplib_p4 else sexplib) stringext ];
+  unpackCmd = "tar -xjf $curSrc";
+
+  buildInputs = [ ocaml findlib jbuilder ppx_sexp_conv ounit ];
+  propagatedBuildInputs = [ ppx_deriving re sexplib stringext ];
+
+  buildPhase = "jbuilder build";
 
-  configurePhase = "ocaml setup.ml -configure --prefix $out --enable-tests";
-  buildPhase = ''
-    ocaml setup.ml -build
-    ocaml setup.ml -doc
-  '';
   doCheck = true;
-  checkPhase = "ocaml setup.ml -test";
-  installPhase = "ocaml setup.ml -install";
+  checkPhase = "jbuilder runtest";
 
-  createFindlibDestdir = true;
+  inherit (jbuilder) installPhase;
 
   meta = {
-    homepage = https://github.com/mirage/ocaml-uri;
-    platforms = ocaml.meta.platforms or [];
+    homepage = "https://github.com/mirage/ocaml-uri";
     description = "RFC3986 URI parsing library for OCaml";
     license = stdenv.lib.licenses.isc;
-    maintainers = with stdenv.lib.maintainers; [ vbgl ];
+    maintainers = [ stdenv.lib.maintainers.vbgl ];
+    inherit (ocaml.meta) platforms;
   };
 }
diff --git a/pkgs/development/ocaml-modules/uri/legacy.nix b/pkgs/development/ocaml-modules/uri/legacy.nix
new file mode 100644
index 000000000000..f08ee7fc2fc1
--- /dev/null
+++ b/pkgs/development/ocaml-modules/uri/legacy.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchzip, ocaml, findlib, ocamlbuild, re, stringext, ounit
+, sexplib, ppx_sexp_conv
+, legacyVersion ? false
+, sexplib_p4
+}:
+
+if !stdenv.lib.versionAtLeast ocaml.version "4"
+|| legacyVersion && stdenv.lib.versionAtLeast ocaml.version "4.03"
+then throw "uri${stdenv.lib.optionalString legacyVersion "_p4"} is not available for OCaml ${ocaml.version}" else
+
+with
+  if legacyVersion
+  then {
+    version = "1.9.1";
+    sha256 = "0v3jxqgyi4kj92r3x83rszfpnvvzy9lyb913basch4q64yka3w85";
+  } else {
+    version = "1.9.2";
+    sha256 = "137pg8j654x7r0d1664iy2zp3l82nki1kkh921lwdrwc5qqdl6jx";
+  };
+
+stdenv.mkDerivation {
+  name = "ocaml${ocaml.version}-uri-${version}";
+
+  src = fetchzip {
+    url = "https://github.com/mirage/ocaml-uri/archive/v${version}.tar.gz";
+    inherit sha256;
+  };
+
+  buildInputs = [ ocaml findlib ocamlbuild ounit ]
+  ++ stdenv.lib.optional (!legacyVersion) ppx_sexp_conv;
+  propagatedBuildInputs = [ re (if legacyVersion then sexplib_p4 else sexplib) stringext ];
+
+  configurePhase = "ocaml setup.ml -configure --prefix $out --enable-tests";
+  buildPhase = ''
+    ocaml setup.ml -build
+    ocaml setup.ml -doc
+  '';
+  doCheck = true;
+  checkPhase = "ocaml setup.ml -test";
+  installPhase = "ocaml setup.ml -install";
+
+  createFindlibDestdir = true;
+
+  meta = {
+    homepage = https://github.com/mirage/ocaml-uri;
+    platforms = ocaml.meta.platforms or [];
+    description = "RFC3986 URI parsing library for OCaml";
+    license = stdenv.lib.licenses.isc;
+    maintainers = with stdenv.lib.maintainers; [ vbgl ];
+  };
+}
diff --git a/pkgs/development/python-modules/aenum/default.nix b/pkgs/development/python-modules/aenum/default.nix
index 45e7f8915acf..466c20e19ca5 100644
--- a/pkgs/development/python-modules/aenum/default.nix
+++ b/pkgs/development/python-modules/aenum/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchPypi, buildPythonPackage, isPy3k }:
+{ stdenv, fetchPypi, buildPythonPackage, python, isPy3k, glibcLocales }:
 
 buildPythonPackage rec {
   pname = "aenum";
@@ -10,12 +10,17 @@ buildPythonPackage rec {
     sha256 = "d98bc55136d696fcf323760c3db0de489da9e41fd51283fa6f90205deb85bf6a";
   };
 
-  doCheck = !isPy3k;
-  # The following tests fail (only in python3
-  # test_convert (aenum.test.TestIntEnumConvert)
-  # test_convert_value_lookup_priority (aenum.test.TestIntEnumConvert)
-  # test_convert (aenum.test.TestIntEnumConvert)
-  # test_convert_value_lookup_priority (aenum.test.TestIntEnumConvert)
+  # For Python 3, locale has to be set to en_US.UTF-8 for
+  # tests to pass
+  checkInputs = if isPy3k then [ glibcLocales ] else [];
+
+  checkPhase = ''
+  runHook preCheck
+  ${if isPy3k then "export LC_ALL=en_US.UTF-8" else ""}
+  PYTHONPATH=`pwd` ${python.interpreter} aenum/test.py
+  runHook postCheck
+  '';
+
 
   meta = {
     description = "Advanced Enumerations (compatible with Python's stdlib Enum), NamedTuples, and NamedConstants";
diff --git a/pkgs/development/python-modules/nose-parameterized/default.nix b/pkgs/development/python-modules/nose-parameterized/default.nix
new file mode 100644
index 000000000000..3c7cd077cdc0
--- /dev/null
+++ b/pkgs/development/python-modules/nose-parameterized/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchPypi, buildPythonPackage, nose, six, glibcLocales, isPy3k }:
+
+buildPythonPackage rec {
+  pname = "nose-parameterized";
+  version = "0.6.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1khlabgib4161vn6alxsjaa8javriywgx9vydddi659gp9x6fpnk";
+  };
+
+  # Tests require some python3-isms but code works without.
+  doCheck = isPy3k;
+
+  buildInputs = [ nose glibcLocales ];
+  propagatedBuildInputs = [ six ];
+
+  checkPhase = ''
+    LC_ALL="en_US.UTF-8" nosetests -v
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Parameterized testing with any Python test framework";
+    homepage = https://pypi.python.org/pypi/nose-parameterized;
+    license = licenses.bsd3;
+  };
+}
diff --git a/pkgs/development/python-modules/scikitlearn/default.nix b/pkgs/development/python-modules/scikitlearn/default.nix
index b2826588a288..6d32b056a0a9 100644
--- a/pkgs/development/python-modules/scikitlearn/default.nix
+++ b/pkgs/development/python-modules/scikitlearn/default.nix
@@ -20,8 +20,9 @@ buildPythonPackage rec {
 
   LC_ALL="en_US.UTF-8";
 
+  # Disable doctests on OSX: https://github.com/scikit-learn/scikit-learn/issues/10213
   checkPhase = ''
-    HOME=$TMPDIR OMP_NUM_THREADS=1 nosetests $out/${python.sitePackages}/sklearn/
+    HOME=$TMPDIR OMP_NUM_THREADS=1 nosetests ${stdenv.lib.optionalString stdenv.isDarwin "--doctest-options=+SKIP"} $out/${python.sitePackages}/sklearn/
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/python-modules/werkzeug/default.nix b/pkgs/development/python-modules/werkzeug/default.nix
index 78380900416d..58be98f183b6 100644
--- a/pkgs/development/python-modules/werkzeug/default.nix
+++ b/pkgs/development/python-modules/werkzeug/default.nix
@@ -16,7 +16,7 @@ buildPythonPackage rec {
   checkInputs = [ pytest requests glibcLocales hypothesis ];
 
   checkPhase = ''
-    LC_ALL="en_US.UTF-8" py.test
+    LC_ALL="en_US.UTF-8" py.test ${stdenv.lib.optionalString stdenv.isDarwin "-k 'not test_get_machine_id'"}
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/tools/go-protobuf/default.nix b/pkgs/development/tools/go-protobuf/default.nix
new file mode 100644
index 000000000000..361fc74c729b
--- /dev/null
+++ b/pkgs/development/tools/go-protobuf/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, buildGoPackage, fetchFromGitHub }:
+
+buildGoPackage rec {
+  name = "go-protobuf-${version}";
+  version = "2018-01-04";
+  rev = "1e59b77b52bf8e4b449a57e6f79f21226d571845";
+
+  goPackagePath = "github.com/golang/protobuf";
+
+  src = fetchFromGitHub {
+    inherit rev;
+    owner = "golang";
+    repo = "protobuf";
+    sha256 = "19bkh81wnp6njg3931wky6hsnnl2d1ig20vfjxpv450sd3k6yys8";
+  };
+
+  meta = with stdenv.lib; {
+    homepage    = "https://github.com/golang/protobuf";
+    description = " Go bindings for protocol buffer";
+    maintainers = with maintainers; [ lewo ];
+    license     = licenses.bsd3;
+    platforms   = platforms.linux;
+  };
+}