about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/applications/audio/faustPhysicalModeling/default.nix4
-rw-r--r--pkgs/applications/blockchains/exodus/default.nix4
-rw-r--r--pkgs/applications/misc/gpxsee/default.nix4
-rw-r--r--pkgs/applications/version-management/git-and-tools/git-chglog/default.nix6
-rw-r--r--pkgs/development/libraries/aspell/default.nix9
-rw-r--r--pkgs/development/libraries/at-spi2-core/default.nix4
-rw-r--r--pkgs/development/libraries/bctoolbox/default.nix4
-rw-r--r--pkgs/development/libraries/cairo/default.nix10
-rw-r--r--pkgs/development/libraries/gtest/default.nix11
-rw-r--r--pkgs/development/libraries/libedit/default.nix4
-rw-r--r--pkgs/development/libraries/libffi/default.nix6
-rw-r--r--pkgs/development/libraries/libgpg-error/default.nix4
-rw-r--r--pkgs/development/libraries/libgpg-error/fix-1.42-cross-compilation.patch142
-rw-r--r--pkgs/development/libraries/libidn/default.nix4
-rw-r--r--pkgs/development/libraries/libidn2/default.nix4
-rw-r--r--pkgs/development/libraries/mesa/default.nix4
-rw-r--r--pkgs/development/libraries/p11-kit/default.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.12/default.nix98
-rw-r--r--pkgs/development/libraries/qt-5/5.14/default.nix98
-rw-r--r--pkgs/development/libraries/qt-5/5.15/default.nix118
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtbase.nix484
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtdeclarative.nix2
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtmultimedia.nix21
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtserialport.nix6
-rw-r--r--pkgs/development/libraries/qt-5/modules/qttools.nix11
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtwebengine.nix148
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtwebkit.nix47
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtwebview.nix12
-rw-r--r--pkgs/development/python-modules/dateutil/default.nix4
-rw-r--r--pkgs/development/python-modules/scipy/default.nix24
-rw-r--r--pkgs/development/tools/misc/automake/automake-1.16.x.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/common-config.nix1
-rw-r--r--pkgs/os-specific/linux/lvm2/default.nix4
-rw-r--r--pkgs/stdenv/generic/setup.sh1
-rw-r--r--pkgs/tools/networking/networkmanager/default.nix4
-rw-r--r--pkgs/tools/networking/unbound/default.nix7
-rw-r--r--pkgs/tools/security/apg/default.nix6
-rw-r--r--pkgs/tools/security/ccrypt/default.nix7
-rw-r--r--pkgs/tools/security/chaps/default.nix18
-rw-r--r--pkgs/tools/security/dirmngr/default.nix5
-rw-r--r--pkgs/tools/security/hologram/default.nix3
-rw-r--r--pkgs/tools/security/mbox/default.nix3
-rw-r--r--pkgs/tools/security/meo/default.nix3
-rw-r--r--pkgs/tools/security/mkrand/default.nix7
-rw-r--r--pkgs/tools/security/mktemp/default.nix7
-rw-r--r--pkgs/tools/security/munge/default.nix5
-rw-r--r--pkgs/tools/security/pamtester/default.nix5
-rw-r--r--pkgs/tools/security/pwgen/default.nix7
-rw-r--r--pkgs/tools/security/super/default.nix7
-rw-r--r--pkgs/tools/system/acct/default.nix5
-rw-r--r--pkgs/tools/system/actkbd/default.nix5
-rw-r--r--pkgs/tools/system/bar/default.nix7
-rw-r--r--pkgs/tools/system/cron/default.nix8
-rw-r--r--pkgs/tools/system/dcfldd/default.nix5
-rw-r--r--pkgs/tools/system/ddrescue/default.nix5
-rw-r--r--pkgs/tools/system/ddrescueview/default.nix1
-rw-r--r--pkgs/tools/system/dog/default.nix7
-rw-r--r--pkgs/tools/system/fdisk/default.nix5
-rw-r--r--pkgs/tools/system/gdmap/default.nix5
-rw-r--r--pkgs/tools/system/gt5/default.nix5
-rw-r--r--pkgs/tools/system/idle3tools/default.nix7
-rw-r--r--pkgs/tools/system/incron/default.nix5
-rw-r--r--pkgs/tools/system/ipmitool/default.nix6
-rw-r--r--pkgs/tools/system/loadwatch/default.nix3
-rw-r--r--pkgs/tools/system/localtime/default.nix3
-rw-r--r--pkgs/tools/system/mcron/default.nix5
-rw-r--r--pkgs/tools/system/monit/default.nix5
-rw-r--r--pkgs/tools/system/opencl-info/default.nix3
-rw-r--r--pkgs/tools/system/pciutils/default.nix5
-rw-r--r--pkgs/tools/system/rowhammer-test/default.nix3
-rw-r--r--pkgs/tools/system/safecopy/default.nix5
-rw-r--r--pkgs/tools/system/sg3_utils/default.nix5
-rw-r--r--pkgs/tools/text/gawk/default.nix5
-rw-r--r--pkgs/tools/text/gnupatch/default.nix5
-rw-r--r--pkgs/top-level/all-packages.nix30
75 files changed, 862 insertions, 698 deletions
diff --git a/pkgs/applications/audio/faustPhysicalModeling/default.nix b/pkgs/applications/audio/faustPhysicalModeling/default.nix
index f55cee957c77..6f827cea9564 100644
--- a/pkgs/applications/audio/faustPhysicalModeling/default.nix
+++ b/pkgs/applications/audio/faustPhysicalModeling/default.nix
@@ -1,13 +1,13 @@
 { stdenv, lib, fetchFromGitHub, faust2jaqt, faust2lv2 }:
 stdenv.mkDerivation rec {
   pname = "faustPhysicalModeling";
-  version = "2.20.2";
+  version = "2.30.5";
 
   src = fetchFromGitHub {
     owner = "grame-cncm";
     repo = "faust";
     rev = version;
-    sha256 = "1mm93ba26b7q69hvabzalg30dh8pl858nj4m2bb57pznnp09lq9a";
+    sha256 = "sha256-hfpMeUhv6FC9lnPCfdWnAFCaKiteplyrS/o3Lf7cQY4=";
   };
 
   buildInputs = [ faust2jaqt faust2lv2 ];
diff --git a/pkgs/applications/blockchains/exodus/default.nix b/pkgs/applications/blockchains/exodus/default.nix
index 08eeac760c0f..442683946244 100644
--- a/pkgs/applications/blockchains/exodus/default.nix
+++ b/pkgs/applications/blockchains/exodus/default.nix
@@ -4,11 +4,11 @@ cups, vivaldi-ffmpeg-codecs, libpulseaudio, at-spi2-core, libxkbcommon, mesa }:
 
 stdenv.mkDerivation rec {
   pname = "exodus";
-  version = "21.1.29";
+  version = "21.5.25";
 
   src = fetchurl {
     url = "https://downloads.exodus.io/releases/${pname}-linux-x64-${version}.zip";
-    sha256 = "sha256-Qdiyjutzt8r1tIfcW7/AtSuOpf1Un5TeHoeZx5uQthM=";
+    sha256 = "sha256-2EIElhQGA0UprPF2pdIfYM9SWYIteD+kH+rupjxCiz4=";
   };
 
   sourceRoot = ".";
diff --git a/pkgs/applications/misc/gpxsee/default.nix b/pkgs/applications/misc/gpxsee/default.nix
index a2280e8bb012..0803fadc2a41 100644
--- a/pkgs/applications/misc/gpxsee/default.nix
+++ b/pkgs/applications/misc/gpxsee/default.nix
@@ -2,13 +2,13 @@
 
 mkDerivation rec {
   pname = "gpxsee";
-  version = "9.2";
+  version = "9.3";
 
   src = fetchFromGitHub {
     owner = "tumic0";
     repo = "GPXSee";
     rev = version;
-    sha256 = "sha256-pU02Eaq6tB7X6EPOo8YAyryJRbSV3KebQv8VELxXaBw=";
+    sha256 = "sha256-h/OWYzZkouhTC7j8HIOt94DHwNyhbkYGoy3wUYrh0O8=";
   };
 
   patches = (substituteAll {
diff --git a/pkgs/applications/version-management/git-and-tools/git-chglog/default.nix b/pkgs/applications/version-management/git-and-tools/git-chglog/default.nix
index 8ec57f2e69e8..19de4b28bfea 100644
--- a/pkgs/applications/version-management/git-and-tools/git-chglog/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git-chglog/default.nix
@@ -2,16 +2,16 @@
 
 buildGoModule rec {
   pname = "git-chglog";
-  version = "0.14.2";
+  version = "0.15.0";
 
   src = fetchFromGitHub {
     owner = "git-chglog";
     repo = "git-chglog";
     rev = "v${version}";
-    sha256 = "124bqywkj37gv61fswgrg528bf3rjqms1664x22lkn0sqh22zyv1";
+    sha256 = "sha256-BiTnPCgymfpPxuy0i8u7JbpbEBeaSIJaikjwsPSA3qc=";
   };
 
-  vendorSha256 = "09zjypmcc3ra7sw81q1pbbrlpxxp4k00p1cfkrrih8wvb25z89h5";
+  vendorSha256 = "sha256-jIq+oacyT71m78iMZwWOBsBVAY/WxgyH9zRr8GiMGTU=";
 
   buildFlagsArray = [ "-ldflags= -s -w -X=main.Version=v${version}" ];
 
diff --git a/pkgs/development/libraries/aspell/default.nix b/pkgs/development/libraries/aspell/default.nix
index 01acced98f6f..777bad1e5a53 100644
--- a/pkgs/development/libraries/aspell/default.nix
+++ b/pkgs/development/libraries/aspell/default.nix
@@ -23,7 +23,14 @@ stdenv.mkDerivation rec {
     sha256 = "1wi60ankalmh8ds7nplz434jd7j94gdvbahdwsr539rlad8pxdzr";
   };
 
-  patches = lib.optional searchNixProfiles ./data-dirs-from-nix-profiles.patch;
+  patches = [
+    (fetchpatch {
+      #  objstack: assert that the alloc size will fit within a chunk
+      name = "CVE-2019-25051.patch";
+      url = "https://github.com/gnuaspell/aspell/commit/0718b375425aad8e54e1150313b862e4c6fd324a.patch";
+      sha256 = "03z259xrk41x3j190gaprf3mqysyfgh3a04rjmch3h625vj95x39";
+    })
+  ] ++ lib.optional searchNixProfiles ./data-dirs-from-nix-profiles.patch;
 
   postPatch = ''
     patch interfaces/cc/aspell.h < ${./clang.patch}
diff --git a/pkgs/development/libraries/at-spi2-core/default.nix b/pkgs/development/libraries/at-spi2-core/default.nix
index 515c60c985a7..8413ae597f77 100644
--- a/pkgs/development/libraries/at-spi2-core/default.nix
+++ b/pkgs/development/libraries/at-spi2-core/default.nix
@@ -21,11 +21,11 @@
 
 stdenv.mkDerivation rec {
   pname = "at-spi2-core";
-  version = "2.40.2";
+  version = "2.40.3";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "RNwXr5Q7D9GWxhweA7bBZpYDhcrpbMtelb3v/7aEn5g=";
+    sha256 = "5Jg3wq0w1x4fKcqOCWilS5UDAnL3/0C4m0iWhlPzelw=";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/bctoolbox/default.nix b/pkgs/development/libraries/bctoolbox/default.nix
index 1a42211b9393..c1d2813a4f2a 100644
--- a/pkgs/development/libraries/bctoolbox/default.nix
+++ b/pkgs/development/libraries/bctoolbox/default.nix
@@ -7,7 +7,7 @@
 
 stdenv.mkDerivation rec {
   pname = "bctoolbox";
-  version = "4.5.20";
+  version = "5.0.0";
 
   nativeBuildInputs = [ cmake bcunit ];
   buildInputs = [ mbedtls ];
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     group = "BC";
     repo = pname;
     rev = version;
-    sha256 = "sha256-n/S0G7dGaDWWsvOITceITmWUNpebcHMedkLTklxGjQg=";
+    sha256 = "sha256-/jv59ZeELfP7PokzthvZNL4FS3tyzRmCHp4I/Lp8BJM=";
   };
 
   # Do not build static libraries
diff --git a/pkgs/development/libraries/cairo/default.nix b/pkgs/development/libraries/cairo/default.nix
index f18a7e94f069..414194acb830 100644
--- a/pkgs/development/libraries/cairo/default.nix
+++ b/pkgs/development/libraries/cairo/default.nix
@@ -42,6 +42,16 @@ in stdenv.mkDerivation rec {
       url = "https://gitlab.freedesktop.org/cairo/cairo/commit/5e34c5a9640e49dcc29e6b954c4187cfc838dbd1.patch";
       sha256 = "yCwsDUY7efVvOZkA6a0bPS+RrVc8Yk9bfPwWHeOjq5o=";
     })
+
+    # Fixes CVE-2020-35492; see https://github.com/NixOS/nixpkgs/issues/120364.
+    # CVE information: https://nvd.nist.gov/vuln/detail/CVE-2020-35492
+    # Upstream PR: https://gitlab.freedesktop.org/cairo/cairo/merge_requests/85
+    (fetchpatch {
+      name = "CVE-2020-35492.patch";
+      includes = [ "src/cairo-image-compositor.c" ];
+      url = "https://github.com/freedesktop/cairo/commit/78266cc8c0f7a595cfe8f3b694bfb9bcc3700b38.patch";
+      sha256 = "048nzfz7rkgqb9xs0dfs56qdw7ckkxr87nbj3p0qziqdq4nb6wki";
+    })
   ] ++ optionals stdenv.hostPlatform.isDarwin [
     # Workaround https://gitlab.freedesktop.org/cairo/cairo/-/issues/121
     ./skip-configure-stderr-check.patch
diff --git a/pkgs/development/libraries/gtest/default.nix b/pkgs/development/libraries/gtest/default.nix
index d15ce77213ca..ffe85538684d 100644
--- a/pkgs/development/libraries/gtest/default.nix
+++ b/pkgs/development/libraries/gtest/default.nix
@@ -1,8 +1,8 @@
-{ lib, stdenv, cmake, ninja, fetchFromGitHub, fetchpatch }:
+{ lib, stdenv, cmake, ninja, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "gtest";
-  version = "1.10.0";
+  version = "1.11.0";
 
   outputs = [ "out" "dev" ];
 
@@ -10,16 +10,11 @@ stdenv.mkDerivation rec {
     owner = "google";
     repo = "googletest";
     rev = "release-${version}";
-    sha256 = "1zbmab9295scgg4z2vclgfgjchfjailjnvzc6f5x9jvlsdi3dpwz";
+    hash = "sha256-SjlJxushfry13RGA7BCjYC9oZqV4z6x8dOiHfl/wpF0=";
   };
 
   patches = [
     ./fix-cmake-config-includedir.patch
-    (fetchpatch {
-      name = "fix-pkgconfig-paths.patch";
-      url = "https://github.com/google/googletest/commit/5126ff48d9ac54828d1947d1423a5ef2a8efee3b.patch";
-      sha256 = "sha256-TBvECU/9nuvwjsCjWJP2b6DNy+FYnHIFZeuVW7g++JE=";
-    })
   ];
 
   nativeBuildInputs = [ cmake ninja ];
diff --git a/pkgs/development/libraries/libedit/default.nix b/pkgs/development/libraries/libedit/default.nix
index daf0f2928416..35efdc781d46 100644
--- a/pkgs/development/libraries/libedit/default.nix
+++ b/pkgs/development/libraries/libedit/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libedit";
-  version = "20210522-3.1";
+  version = "20210714-3.1";
 
   src = fetchurl {
     url = "https://thrysoee.dk/editline/${pname}-${version}.tar.gz";
-    sha256 = "sha256-AiC8IEfpJ8DBmE7197TrKpRppbe/ErpXPKOyPKAru28=";
+    sha256 = "sha256-MCO0mK1ZP9d0WuOyCrrVRt5Qa2e4+7VXljfKaauC28k=";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/libffi/default.nix b/pkgs/development/libraries/libffi/default.nix
index 48611dffb069..7909b7abc4ff 100644
--- a/pkgs/development/libraries/libffi/default.nix
+++ b/pkgs/development/libraries/libffi/default.nix
@@ -10,11 +10,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libffi";
-  version = "3.3";
+  version = "3.4.2";
 
   src = fetchurl {
-    url = "https://sourceware.org/pub/libffi/${pname}-${version}.tar.gz";
-    sha256 = "0mi0cpf8aa40ljjmzxb7im6dbj45bb0kllcd09xgmp834y9agyvj";
+    url = "https://github.com/libffi/libffi/releases/download/v${version}/${pname}-${version}.tar.gz";
+    sha256 = "081nx7wpzds168jbr59m34n6s3lyiq6r8zggvqxvlslsc4hvf3sl";
   };
 
   patches = [];
diff --git a/pkgs/development/libraries/libgpg-error/default.nix b/pkgs/development/libraries/libgpg-error/default.nix
index 7490995e6611..e46e25593365 100644
--- a/pkgs/development/libraries/libgpg-error/default.nix
+++ b/pkgs/development/libraries/libgpg-error/default.nix
@@ -24,6 +24,10 @@ in stdenv.mkDerivation (rec {
     sha256 = "sha256-/AfnD2xhX4xPWQqON6m43S4soelAj45gRZxnRSuSXiM=";
   };
 
+  # 1.42 breaks (some?) cross-compilation (e.g. x86_64 -> aarch64).
+  # Backporting this fix (merged in upstream master but no release cut) by David Michael <fedora.dm0@gmail.com> https://dev.gnupg.org/rE33593864cd54143db594c4237bba41e14179061c
+  patches = [ ./fix-1.42-cross-compilation.patch ];
+
   postPatch = ''
     sed '/BUILD_TIMESTAMP=/s/=.*/=1970-01-01T00:01+0000/' -i ./configure
   '' + lib.optionalString (stdenv.hostPlatform.isAarch32 && stdenv.buildPlatform != stdenv.hostPlatform) ''
diff --git a/pkgs/development/libraries/libgpg-error/fix-1.42-cross-compilation.patch b/pkgs/development/libraries/libgpg-error/fix-1.42-cross-compilation.patch
new file mode 100644
index 000000000000..6c3099f72144
--- /dev/null
+++ b/pkgs/development/libraries/libgpg-error/fix-1.42-cross-compilation.patch
@@ -0,0 +1,142 @@
+diff --git a/src/gen-lock-obj.sh b/src/gen-lock-obj.sh
+index a710f0c..258eec6 100755
+--- a/src/gen-lock-obj.sh
++++ b/src/gen-lock-obj.sh
+@@ -1,136 +1,136 @@
+ #! /bin/sh
+ #
+ # gen-lock-obj.sh - Build tool to construct the lock object.
+ #
+ # Copyright (C) 2020, 2021  g10 Code GmbH
+ #
+ # This file is part of libgpg-error.
+ #
+ # libgpg-error is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU Lesser General Public License
+ # as published by the Free Software Foundation; either version 2.1 of
+ # the License, or (at your option) any later version.
+ #
+ # libgpg-error is distributed in the hope that it will be useful, but
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ # Lesser General Public License for more details.
+ #
+ # You should have received a copy of the GNU Lesser General Public
+ # License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ #
+ 
+ #
+ # Following variables should be defined to invoke this script
+ #
+ #   CC
+ #   OBJDUMP
+ #   AWK
+ #   ac_ext
+ #   ac_object
+ #   host
+ #   LOCK_ABI_VERSION
+ #
+ # An example:
+ #
+ # LOCK_ABI_VERSION=1 host=x86_64-pc-linux-gnu host_alias=x86_64-linux-gnu \
+ #     CC=$host_alias-gcc OBJDUMP=$host_alias-objdump ac_ext=c ac_objext=o \
+ #     AWK=gawk ./gen-lock-obj.sh
+ #
+ 
+-if test -n `echo -n`; then
++if test -n "`echo -n`"; then
+     ECHO_C='\c'
+     ECHO_N=''
+ else
+     ECHO_C=''
+     ECHO_N='-n'
+ fi
+ 
+ if test "$1" = --disable-threads; then
+     cat <<EOF
+ ## lock-obj-pub.$host.h - NO LOCK SUPPORT
+ ## File created by gen-lock-obj.sh - DO NOT EDIT
+ ## To be included by mkheader into gpg-error.h
+ 
+ /* Dummy object - no locking available.  */
+ typedef struct
+ {
+   long _vers;
+ } gpgrt_lock_t;
+ 
+ #define GPGRT_LOCK_INITIALIZER {-1}
+ EOF
+ else
+ AWK_VERSION_OUTPUT=$($AWK 'BEGIN { print PROCINFO["version"] }')
+ if test -n "$AWK_VERSION_OUTPUT"; then
+     # It's GNU awk, which supports PROCINFO.
+     AWK_OPTION=--non-decimal-data
+ fi
+ 
+ cat <<'EOF' >conftest.$ac_ext
+ #include <pthread.h>
+ pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
+ EOF
+ 
+ if $CC -c conftest.$ac_ext; then :
+   ac_mtx_size=$($OBJDUMP -j .bss -t conftest.$ac_objext \
+          | $AWK $AWK_OPTION '
+ /mtx$/ { mtx_size = int("0x" $5) }
+ END { print mtx_size }')
+ else
+     echo "Can't determine mutex size"
+     exit 1
+ fi
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ 
+ cat <<EOF
+ ## lock-obj-pub.$host.h
+ ## File created by gen-lock-obj.sh - DO NOT EDIT
+ ## To be included by mkheader into gpg-error.h
+ 
+ typedef struct
+ {
+   long _vers;
+   union {
+     volatile char _priv[$ac_mtx_size];
+     long _x_align;
+     long *_xp_align;
+   } u;
+ } gpgrt_lock_t;
+ 
+ EOF
+ 
+ # FIXME: Support different alignment conditions of:
+ #
+ #     USE_16BYTE_ALIGNMENT
+ #     USE_DOUBLE_FOR_ALIGNMENT
+ #     USE_LONG_DOUBLE_FOR_ALIGNMENT
+ #
+ 
+ echo ${ECHO_N} "#define GPGRT_LOCK_INITIALIZER {$LOCK_ABI_VERSION,{{${ECHO_C}"
+ 
+ i=0
+ while test "$i" -lt $ac_mtx_size; do
+     if test "$i" -ne 0 -a "$(( $i % 8 ))" -eq 0; then
+         echo ' \'
+         echo ${ECHO_N} "                                    ${ECHO_C}"
+     fi
+     echo ${ECHO_N} "0${ECHO_C}"
+     if test "$i" -lt $(($ac_mtx_size - 1)); then
+         echo ${ECHO_N} ",${ECHO_C}"
+     fi
+     i=$(( i + 1 ))
+ done
+ fi
+ 
+ cat <<'EOF'
+ }}}
+ ##
+ ## Local Variables:
+ ## mode: c
+ ## buffer-read-only: t
+ ## End:
+ ##
+ EOF
+ 
+ exit 0
diff --git a/pkgs/development/libraries/libidn/default.nix b/pkgs/development/libraries/libidn/default.nix
index 15d7ca33025d..e47bb070a36e 100644
--- a/pkgs/development/libraries/libidn/default.nix
+++ b/pkgs/development/libraries/libidn/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libidn";
-  version = "1.37";
+  version = "1.38";
 
   src = fetchurl {
     url = "mirror://gnu/libidn/${pname}-${version}.tar.gz";
-    sha256 = "1hljls9rkilh04dwiwg388wk8djkac8idijrdysqq2nqbh6rg3iw";
+    sha256 = "sha256-3gC4QPdXzTuxTdmiDVk2RzI13cugbUvC2oBGVLi78PY=";
   };
 
   outputs = [ "bin" "dev" "out" "info" "devdoc" ];
diff --git a/pkgs/development/libraries/libidn2/default.nix b/pkgs/development/libraries/libidn2/default.nix
index b1d234476c4b..2b5434e723aa 100644
--- a/pkgs/development/libraries/libidn2/default.nix
+++ b/pkgs/development/libraries/libidn2/default.nix
@@ -9,11 +9,11 @@ with lib;
 
 stdenv.mkDerivation rec {
   pname = "libidn2";
-  version = "2.3.1";
+  version = "2.3.2";
 
   src = fetchurl {
     url = "mirror://gnu/gnu/libidn/${pname}-${version}.tar.gz";
-    sha256 = "sha256-ivaElDg2uLU5ZdX1tnFO8TwmyR6qNs59JC49IfXUDy0=";
+    sha256 = "sha256-dpQM1Od46Ak1eanRlbJf/16Tbp3GJCBoUotDenZ2T5E=";
   };
 
   outputs = [ "bin" "dev" "out" "info" "devdoc" ];
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index a23d02c29e4b..fad8050e9752 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -31,7 +31,7 @@ with lib;
 let
   # Release calendar: https://www.mesa3d.org/release-calendar.html
   # Release frequency: https://www.mesa3d.org/releasing.html#schedule
-  version = "21.1.5";
+  version = "21.1.6";
   branch  = versions.major version;
 
 self = stdenv.mkDerivation {
@@ -45,7 +45,7 @@ self = stdenv.mkDerivation {
       "ftp://ftp.freedesktop.org/pub/mesa/${version}/mesa-${version}.tar.xz"
       "ftp://ftp.freedesktop.org/pub/mesa/older-versions/${branch}.x/${version}/mesa-${version}.tar.xz"
     ];
-    sha256 = "0vbn40azh7izrxvb15c51z3lfcb9zas2v1wc4z9cxvja0y9p4b02";
+    sha256 = "0dwyk7cxlwna24ap23i8i92a2qcc6xhp16i03zzakpqiz4i03jxi";
   };
 
   prePatch = "patchShebangs .";
diff --git a/pkgs/development/libraries/p11-kit/default.nix b/pkgs/development/libraries/p11-kit/default.nix
index 5e99c644ebef..681b60e16de4 100644
--- a/pkgs/development/libraries/p11-kit/default.nix
+++ b/pkgs/development/libraries/p11-kit/default.nix
@@ -1,16 +1,16 @@
-{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, pkg-config, which
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, which
 , gettext, libffi, libiconv, libtasn1
 }:
 
 stdenv.mkDerivation rec {
   pname = "p11-kit";
-  version = "0.23.22";
+  version = "0.24.0";
 
   src = fetchFromGitHub {
     owner = "p11-glue";
     repo = pname;
     rev = version;
-    sha256 = "sha256-erWqElJr0iESNUk9EZiJRmSMYhns8GxuFLNw7mIIIWs=";
+    sha256 = "sha256-jvUzOhMvbq05SxQ+kjKQHDDMzNwo4U6nFHu3JjygJHw=";
   };
 
   outputs = [ "out" "dev"];
diff --git a/pkgs/development/libraries/qt-5/5.12/default.nix b/pkgs/development/libraries/qt-5/5.12/default.nix
index 77b8c3f525a2..680debc164f7 100644
--- a/pkgs/development/libraries/qt-5/5.12/default.nix
+++ b/pkgs/development/libraries/qt-5/5.12/default.nix
@@ -14,21 +14,18 @@ top-level attribute to `top-level/all-packages.nix`.
 
 */
 
-{
-  newScope,
-  lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper,
-  bison, cups ? null, harfbuzz, libGL, perl,
-  gstreamer, gst-plugins-base, gtk3, dconf,
-  llvmPackages_5,
+{ newScope
+, lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper
+, bison, cups ? null, harfbuzz, libGL, perl
+, gstreamer, gst-plugins-base, gtk3, dconf
+, llvmPackages_5, darwin
 
   # options
-  developerBuild ? false,
-  decryptSslTraffic ? false,
-  debug ? false,
+, developerBuild ? false
+, decryptSslTraffic ? false
+, debug ? false
 }:
 
-with lib;
-
 let
 
   qtCompatVersion = srcs.qtbase.version;
@@ -50,31 +47,30 @@ let
   };
 
   patches = {
-    qtbase =
-      [
-        ./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
-        ./qtbase.patch.d/0002-qtbase-mac.patch
-        ./qtbase.patch.d/0013-define-kiosurfacesuccess.patch
-
-        # Patch framework detection to support X.framework/X.tbd,
-        # extending the current support for X.framework/X.
-        ./qtbase.patch.d/0015-qtbase-tbd-frameworks.patch
-
-        ./qtbase.patch.d/0003-qtbase-mkspecs.patch
-        ./qtbase.patch.d/0004-qtbase-replace-libdir.patch
-        ./qtbase.patch.d/0005-qtbase-cmake.patch
-        ./qtbase.patch.d/0006-qtbase-gtk3.patch
-        ./qtbase.patch.d/0007-qtbase-xcursor.patch
-        ./qtbase.patch.d/0008-qtbase-xcompose.patch
-        ./qtbase.patch.d/0009-qtbase-tzdir.patch
-        ./qtbase.patch.d/0010-qtbase-qtpluginpath.patch
-        ./qtbase.patch.d/0011-qtbase-assert.patch
-        ./qtbase.patch.d/0012-fix-header_module.patch
-
-        # Ensure -I${includedir} is added to Cflags in pkg-config files.
-        # See https://github.com/NixOS/nixpkgs/issues/52457
-        ./qtbase.patch.d/0014-qtbase-pkg-config.patch
-      ];
+    qtbase = [
+      ./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
+      ./qtbase.patch.d/0002-qtbase-mac.patch
+      ./qtbase.patch.d/0013-define-kiosurfacesuccess.patch
+
+      # Patch framework detection to support X.framework/X.tbd,
+      # extending the current support for X.framework/X.
+      ./qtbase.patch.d/0015-qtbase-tbd-frameworks.patch
+
+      ./qtbase.patch.d/0003-qtbase-mkspecs.patch
+      ./qtbase.patch.d/0004-qtbase-replace-libdir.patch
+      ./qtbase.patch.d/0005-qtbase-cmake.patch
+      ./qtbase.patch.d/0006-qtbase-gtk3.patch
+      ./qtbase.patch.d/0007-qtbase-xcursor.patch
+      ./qtbase.patch.d/0008-qtbase-xcompose.patch
+      ./qtbase.patch.d/0009-qtbase-tzdir.patch
+      ./qtbase.patch.d/0010-qtbase-qtpluginpath.patch
+      ./qtbase.patch.d/0011-qtbase-assert.patch
+      ./qtbase.patch.d/0012-fix-header_module.patch
+
+      # Ensure -I${includedir} is added to Cflags in pkg-config files.
+      # See https://github.com/NixOS/nixpkgs/issues/52457
+      ./qtbase.patch.d/0014-qtbase-pkg-config.patch
+    ];
     qtdeclarative = [ ./qtdeclarative.patch ];
     qtlocation = [ ./qtlocation-gcc-9.patch ];
     qtscript = [ ./qtscript.patch ];
@@ -143,6 +139,9 @@ let
         inherit bison cups harfbuzz libGL;
         withGtk3 = true; inherit dconf gtk3;
         inherit debug developerBuild decryptSslTraffic;
+        inherit (darwin.apple_sdk.frameworks) AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth
+          CoreLocation CoreServices DiskArbitration Foundation OpenGL MetalKit IOKit;
+        inherit (darwin) libobjc;
       };
 
       qtcharts = callPackage ../modules/qtcharts.nix {};
@@ -173,11 +172,21 @@ let
       qtvirtualkeyboard = callPackage ../modules/qtvirtualkeyboard.nix {};
       qtwayland = callPackage ../modules/qtwayland.nix {};
       qtwebchannel = callPackage ../modules/qtwebchannel.nix {};
-      qtwebengine = callPackage ../modules/qtwebengine.nix {};
+      qtwebengine = callPackage ../modules/qtwebengine.nix {
+        inherit (darwin) cctools libobjc libunwind xnu;
+        inherit (darwin.apple_sdk.libs) sandbox;
+        inherit (darwin.apple_sdk.frameworks) ApplicationServices AVFoundation Foundation ForceFeedback GameController AppKit
+          ImageCaptureCore CoreBluetooth IOBluetooth CoreWLAN Quartz Cocoa LocalAuthentication;
+      };
       qtwebglplugin = callPackage ../modules/qtwebglplugin.nix {};
-      qtwebkit = callPackage ../modules/qtwebkit.nix {};
+      qtwebkit = callPackage ../modules/qtwebkit.nix {
+        inherit (darwin) ICU;
+        inherit (darwin.apple_sdk.frameworks) OpenGL;
+      };
       qtwebsockets = callPackage ../modules/qtwebsockets.nix {};
-      qtwebview = callPackage ../modules/qtwebview.nix {};
+      qtwebview = callPackage ../modules/qtwebview.nix {
+        inherit (darwin.apple_sdk.frameworks) CoreFoundation WebKit;
+      };
       qtx11extras = callPackage ../modules/qtx11extras.nix {};
       qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {};
 
@@ -188,8 +197,8 @@ let
         qtscript qtsensors qtserialport qtsvg qttools qttranslations
         qtvirtualkeyboard qtwebchannel qtwebengine qtwebkit qtwebsockets
         qtwebview qtx11extras qtxmlpatterns
-      ] ++ optional (!stdenv.isDarwin) qtwayland
-        ++ optional (stdenv.isDarwin) qtmacextras);
+      ] ++ lib.optional (!stdenv.isDarwin) qtwayland
+        ++ lib.optional (stdenv.isDarwin) qtmacextras);
 
       qmake = makeSetupHook {
         deps = [ self.qtbase.dev ];
@@ -200,12 +209,11 @@ let
       } ../hooks/qmake-hook.sh;
 
       wrapQtAppsHook = makeSetupHook {
-        deps =
-          [ self.qtbase.dev makeWrapper ]
-          ++ optional stdenv.isLinux self.qtwayland.dev;
+        deps = [ self.qtbase.dev makeWrapper ]
+          ++ lib.optional stdenv.isLinux self.qtwayland.dev;
       } ../hooks/wrap-qt-apps-hook.sh;
     };
 
-   self = makeScope newScope addPackages;
+   self = lib.makeScope newScope addPackages;
 
 in self
diff --git a/pkgs/development/libraries/qt-5/5.14/default.nix b/pkgs/development/libraries/qt-5/5.14/default.nix
index 02b170e0eb17..eaf7998047f0 100644
--- a/pkgs/development/libraries/qt-5/5.14/default.nix
+++ b/pkgs/development/libraries/qt-5/5.14/default.nix
@@ -14,21 +14,18 @@ top-level attribute to `top-level/all-packages.nix`.
 
 */
 
-{
-  newScope,
-  lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper,
-  bison, cups ? null, harfbuzz, libGL, perl,
-  gstreamer, gst-plugins-base, gtk3, dconf,
-  llvmPackages_5,
+{ newScope
+, lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper
+, bison, cups ? null, harfbuzz, libGL, perl
+, gstreamer, gst-plugins-base, gtk3, dconf
+, llvmPackages_5, darwin
 
   # options
-  developerBuild ? false,
-  decryptSslTraffic ? false,
-  debug ? false,
+, developerBuild ? false
+, decryptSslTraffic ? false
+, debug ? false
 }:
 
-with lib;
-
 let
 
   qtCompatVersion = srcs.qtbase.version;
@@ -51,29 +48,27 @@ let
   };
 
   patches = {
-    qtbase =
-      optionals stdenv.isDarwin [
-        ./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
-
-        # Downgrade minimal required SDK to 10.12
-        ./qtbase.patch.d/0013-define-kiosurfacesuccess.patch
-        ./qtbase.patch.d/qtbase-sdk-10.12-mac.patch
-
-        # Patch framework detection to support X.framework/X.tbd,
-        # extending the current support for X.framework/X.
-        ./qtbase.patch.d/0012-qtbase-tbd-frameworks.patch
-      ]
-      ++ [
-        ./qtbase.patch.d/0003-qtbase-mkspecs.patch
-        ./qtbase.patch.d/0004-qtbase-replace-libdir.patch
-        ./qtbase.patch.d/0005-qtbase-cmake.patch
-        ./qtbase.patch.d/0006-qtbase-gtk3.patch
-        ./qtbase.patch.d/0007-qtbase-xcursor.patch
-        ./qtbase.patch.d/0008-qtbase-tzdir.patch
-        ./qtbase.patch.d/0009-qtbase-qtpluginpath.patch
-        ./qtbase.patch.d/0010-qtbase-assert.patch
-        ./qtbase.patch.d/0011-fix-header_module.patch
-      ];
+    qtbase = lib.optionals stdenv.isDarwin [
+      ./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
+
+      # Downgrade minimal required SDK to 10.12
+      ./qtbase.patch.d/0013-define-kiosurfacesuccess.patch
+      ./qtbase.patch.d/qtbase-sdk-10.12-mac.patch
+
+      # Patch framework detection to support X.framework/X.tbd,
+      # extending the current support for X.framework/X.
+      ./qtbase.patch.d/0012-qtbase-tbd-frameworks.patch
+    ] ++ [
+      ./qtbase.patch.d/0003-qtbase-mkspecs.patch
+      ./qtbase.patch.d/0004-qtbase-replace-libdir.patch
+      ./qtbase.patch.d/0005-qtbase-cmake.patch
+      ./qtbase.patch.d/0006-qtbase-gtk3.patch
+      ./qtbase.patch.d/0007-qtbase-xcursor.patch
+      ./qtbase.patch.d/0008-qtbase-tzdir.patch
+      ./qtbase.patch.d/0009-qtbase-qtpluginpath.patch
+      ./qtbase.patch.d/0010-qtbase-assert.patch
+      ./qtbase.patch.d/0011-fix-header_module.patch
+    ];
     qtdeclarative = [ ./qtdeclarative.patch ];
     qtlocation = [ ./qtlocation-gcc-9.patch ];
     qtscript = [ ./qtscript.patch ];
@@ -103,8 +98,7 @@ let
         stripLen = 1;
         extraPrefix = "src/3rdparty/";
       })
-    ]
-      ++ optional stdenv.isDarwin ./qtwebengine-darwin-no-platform-check.patch;
+    ] ++ lib.optional stdenv.isDarwin ./qtwebengine-darwin-no-platform-check.patch;
     qtwebkit = [
       (fetchpatch {
         name = "qtwebkit-bison-3.7-build.patch";
@@ -118,7 +112,7 @@ let
       })
       ./qtwebkit.patch
       ./qtwebkit-icu68.patch
-    ] ++ optionals stdenv.isDarwin [
+    ] ++ lib.optionals stdenv.isDarwin [
       ./qtwebkit-darwin-no-readline.patch
       ./qtwebkit-darwin-no-qos-classes.patch
     ];
@@ -157,6 +151,9 @@ let
         inherit bison cups harfbuzz libGL;
         withGtk3 = true; inherit dconf gtk3;
         inherit debug developerBuild decryptSslTraffic;
+        inherit (darwin.apple_sdk.frameworks) AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth
+          CoreLocation CoreServices DiskArbitration Foundation OpenGL MetalKit IOKit;
+        inherit (darwin) libobjc;
       };
 
       qtcharts = callPackage ../modules/qtcharts.nix {};
@@ -185,11 +182,21 @@ let
       qtvirtualkeyboard = callPackage ../modules/qtvirtualkeyboard.nix {};
       qtwayland = callPackage ../modules/qtwayland.nix {};
       qtwebchannel = callPackage ../modules/qtwebchannel.nix {};
-      qtwebengine = callPackage ../modules/qtwebengine.nix {};
+      qtwebengine = callPackage ../modules/qtwebengine.nix {
+        inherit (darwin) cctools libobjc libunwind xnu;
+        inherit (darwin.apple_sdk.libs) sandbox;
+        inherit (darwin.apple_sdk.frameworks) ApplicationServices AVFoundation Foundation ForceFeedback GameController AppKit
+          ImageCaptureCore CoreBluetooth IOBluetooth CoreWLAN Quartz Cocoa LocalAuthentication;
+      };
       qtwebglplugin = callPackage ../modules/qtwebglplugin.nix {};
-      qtwebkit = callPackage ../modules/qtwebkit.nix {};
+      qtwebkit = callPackage ../modules/qtwebkit.nix {
+        inherit (darwin) ICU;
+        inherit (darwin.apple_sdk.frameworks) OpenGL;
+      };
       qtwebsockets = callPackage ../modules/qtwebsockets.nix {};
-      qtwebview = callPackage ../modules/qtwebview.nix {};
+      qtwebview = callPackage ../modules/qtwebview.nix {
+        inherit (darwin.apple_sdk.frameworks) CoreFoundation WebKit;
+      };
       qtx11extras = callPackage ../modules/qtx11extras.nix {};
       qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {};
 
@@ -200,8 +207,8 @@ let
         qtscript qtsensors qtserialport qtsvg qttools qttranslations
         qtvirtualkeyboard qtwebchannel qtwebengine qtwebkit qtwebsockets
         qtwebview qtx11extras qtxmlpatterns
-      ] ++ optional (!stdenv.isDarwin) qtwayland
-        ++ optional (stdenv.isDarwin) qtmacextras);
+      ] ++ lib.optional (!stdenv.isDarwin) qtwayland
+        ++ lib.optional (stdenv.isDarwin) qtmacextras);
 
       qmake = makeSetupHook {
         deps = [ self.qtbase.dev ];
@@ -212,12 +219,11 @@ let
       } ../hooks/qmake-hook.sh;
 
       wrapQtAppsHook = makeSetupHook {
-        deps =
-          [ self.qtbase.dev makeWrapper ]
-          ++ optional stdenv.isLinux self.qtwayland.dev;
+        deps = [ self.qtbase.dev makeWrapper ]
+          ++ lib.optional stdenv.isLinux self.qtwayland.dev;
       } ../hooks/wrap-qt-apps-hook.sh;
     };
 
-   self = makeScope newScope addPackages;
+   self = lib.makeScope newScope addPackages;
 
 in self
diff --git a/pkgs/development/libraries/qt-5/5.15/default.nix b/pkgs/development/libraries/qt-5/5.15/default.nix
index d7a3ff1f55ec..f2dd7e971f31 100644
--- a/pkgs/development/libraries/qt-5/5.15/default.nix
+++ b/pkgs/development/libraries/qt-5/5.15/default.nix
@@ -14,21 +14,18 @@ top-level attribute to `top-level/all-packages.nix`.
 
 */
 
-{
-  newScope,
-  lib, stdenv, fetchurl, fetchpatch, fetchgit, fetchFromGitHub, makeSetupHook, makeWrapper,
-  bison, cups ? null, harfbuzz, libGL, perl,
-  gstreamer, gst-plugins-base, gtk3, dconf,
-  llvmPackages_5,
+{ newScope
+, lib, stdenv, fetchurl, fetchgit, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper
+, bison, cups ? null, harfbuzz, libGL, perl
+, gstreamer, gst-plugins-base, gtk3, dconf
+, llvmPackages_5, darwin
 
   # options
-  developerBuild ? false,
-  decryptSslTraffic ? false,
-  debug ? false,
+, developerBuild ? false
+, decryptSslTraffic ? false
+, debug ? false
 }:
 
-with lib;
-
 let
 
   qtCompatVersion = srcs.qtbase.version;
@@ -63,7 +60,7 @@ let
           inherit rev branchName;
           fetchSubmodules = true;
           leaveDotGit = true;
-          name = "qtwebengine-${substring 0 7 rev}.tar.gz";
+          name = "qtwebengine-${lib.substring 0 7 rev}.tar.gz";
           postFetch = ''
             # remove submodule .git directory
             rm -rf $out/src/3rdparty/.git
@@ -83,40 +80,38 @@ let
   };
 
   patches = {
-    qtbase =
-      optionals stdenv.isDarwin [
-        ./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
-
-        # Downgrade minimal required SDK to 10.12
-        ./qtbase.patch.d/0013-define-kiosurfacesuccess.patch
-        ./qtbase.patch.d/macos-sdk-10.12/0001-Revert-QCocoaDrag-set-image-only-on-the-first-drag-i.patch
-        ./qtbase.patch.d/macos-sdk-10.12/0002-Revert-QCocoaDrag-drag-make-sure-clipboard-is-ours-a.patch
-        ./qtbase.patch.d/macos-sdk-10.12/0003-Revert-QCocoaDrag-maybeDragMultipleItems-fix-erroneo.patch
-        ./qtbase.patch.d/macos-sdk-10.12/0004-Revert-QCocoaDrag-avoid-using-the-deprecated-API-if-.patch
-        ./qtbase.patch.d/macos-sdk-10.12/0005-Revert-macOS-Fix-use-of-deprecated-NSOffState.patch
-        ./qtbase.patch.d/macos-sdk-10.12/0006-git-checkout-v5.15.0-src-plugins-platforms-cocoa-qco.patch
-        ./qtbase.patch.d/qtbase-sdk-10.12-mac.patch
-
-        # Patch framework detection to support X.framework/X.tbd,
-        # extending the current support for X.framework/X.
-        ./qtbase.patch.d/0012-qtbase-tbd-frameworks.patch
-      ]
-      ++ [
-        ./qtbase.patch.d/0003-qtbase-mkspecs.patch
-        ./qtbase.patch.d/0004-qtbase-replace-libdir.patch
-        ./qtbase.patch.d/0005-qtbase-cmake.patch
-        ./qtbase.patch.d/0006-qtbase-gtk3.patch
-        ./qtbase.patch.d/0007-qtbase-xcursor.patch
-        ./qtbase.patch.d/0008-qtbase-tzdir.patch
-        ./qtbase.patch.d/0009-qtbase-qtpluginpath.patch
-        ./qtbase.patch.d/0010-qtbase-assert.patch
-        ./qtbase.patch.d/0011-fix-header_module.patch
-        (fetchpatch { # This can be removed when https://codereview.qt-project.org/c/qt/qtbase/+/339323 is included in an release.
-          name = "0014-gcc11-compat.patch";
-          url = "https://codereview.qt-project.org/gitweb?p=qt/qtbase.git;a=patch;h=049e14870c13235cd066758f29c42dc96c1ccdf8";
-          sha256 = "1cb2hwi859hds0fa2cbap014qaa7mah9p0rcxcm2cvj2ybl33qfc";
-        })
-      ];
+    qtbase = lib.optionals stdenv.isDarwin [
+      ./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
+
+      # Downgrade minimal required SDK to 10.12
+      ./qtbase.patch.d/0013-define-kiosurfacesuccess.patch
+      ./qtbase.patch.d/macos-sdk-10.12/0001-Revert-QCocoaDrag-set-image-only-on-the-first-drag-i.patch
+      ./qtbase.patch.d/macos-sdk-10.12/0002-Revert-QCocoaDrag-drag-make-sure-clipboard-is-ours-a.patch
+      ./qtbase.patch.d/macos-sdk-10.12/0003-Revert-QCocoaDrag-maybeDragMultipleItems-fix-erroneo.patch
+      ./qtbase.patch.d/macos-sdk-10.12/0004-Revert-QCocoaDrag-avoid-using-the-deprecated-API-if-.patch
+      ./qtbase.patch.d/macos-sdk-10.12/0005-Revert-macOS-Fix-use-of-deprecated-NSOffState.patch
+      ./qtbase.patch.d/macos-sdk-10.12/0006-git-checkout-v5.15.0-src-plugins-platforms-cocoa-qco.patch
+      ./qtbase.patch.d/qtbase-sdk-10.12-mac.patch
+
+      # Patch framework detection to support X.framework/X.tbd,
+      # extending the current support for X.framework/X.
+      ./qtbase.patch.d/0012-qtbase-tbd-frameworks.patch
+    ] ++ [
+      ./qtbase.patch.d/0003-qtbase-mkspecs.patch
+      ./qtbase.patch.d/0004-qtbase-replace-libdir.patch
+      ./qtbase.patch.d/0005-qtbase-cmake.patch
+      ./qtbase.patch.d/0006-qtbase-gtk3.patch
+      ./qtbase.patch.d/0007-qtbase-xcursor.patch
+      ./qtbase.patch.d/0008-qtbase-tzdir.patch
+      ./qtbase.patch.d/0009-qtbase-qtpluginpath.patch
+      ./qtbase.patch.d/0010-qtbase-assert.patch
+      ./qtbase.patch.d/0011-fix-header_module.patch
+      (fetchpatch { # This can be removed when https://codereview.qt-project.org/c/qt/qtbase/+/339323 is included in an release.
+        name = "0014-gcc11-compat.patch";
+        url = "https://codereview.qt-project.org/gitweb?p=qt/qtbase.git;a=patch;h=049e14870c13235cd066758f29c42dc96c1ccdf8";
+        sha256 = "1cb2hwi859hds0fa2cbap014qaa7mah9p0rcxcm2cvj2ybl33qfc";
+      })
+    ];
     qtdeclarative = [ ./qtdeclarative.patch ];
     qtscript = [ ./qtscript.patch ];
     qtserialport = [ ./qtserialport.patch ];
@@ -127,7 +122,7 @@ let
         name = "qtwebengine-everywhere-src-5.15.5-_1904652.patch";
         sha256 = "01q7hagq0ysii1jnrh5adm97vdm9cis592xr6im7accyw6hgcn7b";
       })
-    ] ++ optionals stdenv.isDarwin [
+    ] ++ lib.optionals stdenv.isDarwin [
       ./qtwebengine-darwin-no-platform-check.patch
       ./qtwebengine-mac-dont-set-dsymutil-path.patch
     ];
@@ -144,7 +139,7 @@ let
       })
       ./qtwebkit.patch
       ./qtwebkit-icu68.patch
-    ] ++ optionals stdenv.isDarwin [
+    ] ++ lib.optionals stdenv.isDarwin [
       ./qtwebkit-darwin-no-readline.patch
       ./qtwebkit-darwin-no-qos-classes.patch
     ];
@@ -182,6 +177,9 @@ let
         inherit bison cups harfbuzz libGL;
         withGtk3 = true; inherit dconf gtk3;
         inherit developerBuild decryptSslTraffic;
+        inherit (darwin.apple_sdk.frameworks) AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth
+          CoreLocation CoreServices DiskArbitration Foundation OpenGL MetalKit IOKit;
+        inherit (darwin) libobjc;
       };
 
       qtcharts = callPackage ../modules/qtcharts.nix {};
@@ -213,11 +211,20 @@ let
       qtwebchannel = callPackage ../modules/qtwebchannel.nix {};
       qtwebengine = callPackage ../modules/qtwebengine.nix {
         inherit (srcs.qtwebengine) version;
+        inherit (darwin) cctools libobjc libunwind xnu;
+        inherit (darwin.apple_sdk.libs) sandbox;
+        inherit (darwin.apple_sdk.frameworks) ApplicationServices AVFoundation Foundation ForceFeedback GameController AppKit
+          ImageCaptureCore CoreBluetooth IOBluetooth CoreWLAN Quartz Cocoa LocalAuthentication;
       };
       qtwebglplugin = callPackage ../modules/qtwebglplugin.nix {};
-      qtwebkit = callPackage ../modules/qtwebkit.nix {};
+      qtwebkit = callPackage ../modules/qtwebkit.nix {
+        inherit (darwin) ICU;
+        inherit (darwin.apple_sdk.frameworks) OpenGL;
+      };
       qtwebsockets = callPackage ../modules/qtwebsockets.nix {};
-      qtwebview = callPackage ../modules/qtwebview.nix {};
+      qtwebview = callPackage ../modules/qtwebview.nix {
+        inherit (darwin.apple_sdk.frameworks) CoreFoundation WebKit;
+      };
       qtx11extras = callPackage ../modules/qtx11extras.nix {};
       qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {};
 
@@ -228,8 +235,8 @@ let
         qtscript qtsensors qtserialport qtsvg qttools qttranslations
         qtvirtualkeyboard qtwebchannel qtwebengine qtwebkit qtwebsockets
         qtwebview qtx11extras qtxmlpatterns
-      ] ++ optional (!stdenv.isDarwin) qtwayland
-        ++ optional (stdenv.isDarwin) qtmacextras);
+      ] ++ lib.optional (!stdenv.isDarwin) qtwayland
+        ++ lib.optional (stdenv.isDarwin) qtmacextras);
 
       qmake = makeSetupHook {
         deps = [ self.qtbase.dev ];
@@ -240,12 +247,11 @@ let
       } ../hooks/qmake-hook.sh;
 
       wrapQtAppsHook = makeSetupHook {
-        deps =
-          [ self.qtbase.dev makeWrapper ]
-          ++ optional stdenv.isLinux self.qtwayland.dev;
+        deps = [ self.qtbase.dev makeWrapper ]
+          ++ lib.optional stdenv.isLinux self.qtwayland.dev;
       } ../hooks/wrap-qt-apps-hook.sh;
     };
 
-   self = makeScope newScope addPackages;
+   self = lib.makeScope newScope addPackages;
 
 in self
diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix
index 0d0bef342b02..04a89558c3d0 100644
--- a/pkgs/development/libraries/qt-5/modules/qtbase.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix
@@ -1,30 +1,30 @@
-{
-  stdenv, lib,
-  src, patches, version, qtCompatVersion,
+{ stdenv, lib
+, src, patches, version, qtCompatVersion
 
-  coreutils, bison, flex, gdb, gperf, lndir, perl, pkg-config, python3,
-  which,
+, coreutils, bison, flex, gdb, gperf, lndir, perl, pkg-config, python3
+, which
   # darwin support
-  darwin, libiconv,
+, libiconv, libobjc, xcbuild, AGL, AppKit, ApplicationServices, Carbon, Cocoa, CoreAudio, CoreBluetooth
+, CoreLocation, CoreServices, DiskArbitration, Foundation, OpenGL, MetalKit, IOKit
 
-  dbus, fontconfig, freetype, glib, harfbuzz, icu, libX11, libXcomposite,
-  libXcursor, libXext, libXi, libXrender, libinput, libjpeg, libpng,
-  libxcb, libxkbcommon, libxml2, libxslt, openssl, pcre16, pcre2, sqlite, udev,
-  xcbutil, xcbutilimage, xcbutilkeysyms, xcbutilrenderutil, xcbutilwm,
-  zlib,
+, dbus, fontconfig, freetype, glib, harfbuzz, icu, libX11, libXcomposite
+, libXcursor, libXext, libXi, libXrender, libinput, libjpeg, libpng
+, libxcb, libxkbcommon, libxml2, libxslt, openssl, pcre16, pcre2, sqlite, udev
+, xcbutil, xcbutilimage, xcbutilkeysyms, xcbutilrenderutil, xcbutilwm
+, zlib
 
   # optional dependencies
-  cups ? null, libmysqlclient ? null, postgresql ? null,
-  withGtk3 ? false, dconf ? null, gtk3 ? null,
+, cups ? null, libmysqlclient ? null, postgresql ? null
+, withGtk3 ? false, dconf ? null, gtk3 ? null
 
   # options
-  libGLSupported ? !stdenv.isDarwin,
-  libGL,
-  buildExamples ? false,
-  buildTests ? false,
-  debug ? false,
-  developerBuild ? false,
-  decryptSslTraffic ? false
+, libGLSupported ? !stdenv.isDarwin
+, libGL
+, buildExamples ? false
+, buildTests ? false
+, debug ? false
+, developerBuild ? false
+, decryptSslTraffic ? false
 }:
 
 assert withGtk3 -> dconf != null;
@@ -32,53 +32,43 @@ assert withGtk3 -> gtk3 != null;
 
 let
   compareVersion = v: builtins.compareVersions version v;
-  qmakeCacheName =
-    if compareVersion "5.12.4" < 0 then ".qmake.cache" else ".qmake.stash";
+  qmakeCacheName = if compareVersion "5.12.4" < 0 then ".qmake.cache" else ".qmake.stash";
   debugSymbols = debug || developerBuild;
 in
 
 stdenv.mkDerivation {
-
-  name = "qtbase-${version}";
+  pname = "qtbase";
   inherit qtCompatVersion src version;
   debug = debugSymbols;
 
-  propagatedBuildInputs =
-    [
-      libxml2 libxslt openssl sqlite zlib
+  propagatedBuildInputs = [
+    libxml2 libxslt openssl sqlite zlib
+
+    # Text rendering
+    harfbuzz icu
+
+    # Image formats
+    libjpeg libpng
+    (if compareVersion "5.9.0" < 0 then pcre16 else pcre2)
+  ] ++ (
+    if stdenv.isDarwin then [
+      # TODO: move to buildInputs, this should not be propagated.
+      AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth
+      CoreLocation CoreServices DiskArbitration Foundation OpenGL
+      libobjc libiconv MetalKit IOKit
+    ] else [
+      dbus glib udev
 
       # Text rendering
-      harfbuzz icu
+      fontconfig freetype
 
-      # Image formats
-      libjpeg libpng
-      (if compareVersion "5.9.0" < 0 then pcre16 else pcre2)
-    ]
-    ++ (
-      if stdenv.isDarwin
-      then with darwin.apple_sdk.frameworks;
-        [
-          # TODO: move to buildInputs, this should not be propagated.
-          AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth
-          CoreLocation CoreServices DiskArbitration Foundation OpenGL
-          darwin.libobjc libiconv MetalKit IOKit
-        ]
-      else
-        [
-          dbus glib udev
-
-          # Text rendering
-          fontconfig freetype
-
-          # X11 libs
-          libX11 libXcomposite libXext libXi libXrender libxcb libxkbcommon xcbutil
-          xcbutilimage xcbutilkeysyms xcbutilrenderutil xcbutilwm
-        ]
-        ++ lib.optional libGLSupported libGL
-    );
-
-  buildInputs =
-    [ python3 ]
+      # X11 libs
+      libX11 libXcomposite libXext libXi libXrender libxcb libxkbcommon xcbutil
+      xcbutilimage xcbutilkeysyms xcbutilrenderutil xcbutilwm
+    ] ++ lib.optional libGLSupported libGL
+  );
+
+  buildInputs = [ python3 ]
     ++ lib.optionals (!stdenv.isDarwin)
     (
       [ libinput ]
@@ -89,8 +79,8 @@ stdenv.mkDerivation {
     ++ lib.optional (libmysqlclient != null) libmysqlclient
     ++ lib.optional (postgresql != null) postgresql;
 
-  nativeBuildInputs =
-    [ bison flex gperf lndir perl pkg-config which ];
+  nativeBuildInputs = [ bison flex gperf lndir perl pkg-config which ]
+    ++ lib.optionals stdenv.isDarwin [ xcbuild ];
 
   propagatedNativeBuildInputs = [ lndir ];
 
@@ -107,59 +97,42 @@ stdenv.mkDerivation {
     . ${../hooks/fix-qmake-libtool.sh}
   '';
 
-  postPatch =
-    ''
-      for prf in qml_plugin.prf qt_plugin.prf qt_docs.prf qml_module.prf create_cmake.prf; do
-          substituteInPlace "mkspecs/features/$prf" \
-              --subst-var qtPluginPrefix \
-              --subst-var qtQmlPrefix \
-              --subst-var qtDocPrefix
-      done
-
-      substituteInPlace configure --replace /bin/pwd pwd
-      substituteInPlace src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls
-      sed -e 's@/\(usr\|opt\)/@/var/empty/@g' -i mkspecs/*/*.conf
-
-      sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5Config.cmake.in
-      sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5CoreMacros.cmake
-      sed -i 's/NO_DEFAULT_PATH//' src/gui/Qt5GuiConfigExtras.cmake.in
-      sed -i '/PATHS.*NO_DEFAULT_PATH/ d' mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
-    ''
+  postPatch = ''
+    for prf in qml_plugin.prf qt_plugin.prf qt_docs.prf qml_module.prf create_cmake.prf; do
+        substituteInPlace "mkspecs/features/$prf" \
+            --subst-var qtPluginPrefix \
+            --subst-var qtQmlPrefix \
+            --subst-var qtDocPrefix
+    done
 
-    + (
-      if stdenv.isDarwin
-      then
-        ''
-          sed -i \
-              -e 's|! /usr/bin/xcode-select --print-path >/dev/null 2>&1;|false;|' \
-              -e 's|! /usr/bin/xcrun -find xcodebuild >/dev/null 2>&1;|false;|' \
-              -e 's|sysroot=$(/usr/bin/xcodebuild -sdk $sdk -version Path 2>/dev/null)|sysroot=/nonsense|' \
-              -e 's|sysroot=$(/usr/bin/xcrun --sdk $sdk --show-sdk-path 2>/dev/null)|sysroot=/nonsense|' \
-              -e 's|QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX`|QMAKE_CXX="clang++"\nQMAKE_CONF_COMPILER="clang++"|' \
-              -e 's|XCRUN=`/usr/bin/xcrun -sdk macosx clang -v 2>&1`|XCRUN="clang -v 2>&1"|' \
-              -e 's#sdk_val=$(/usr/bin/xcrun -sdk $sdk -find $(echo $val | cut -d \x27 \x27 -f 1))##' \
-              -e 's#val=$(echo $sdk_val $(echo $val | cut -s -d \x27 \x27 -f 2-))##' \
-              ./configure
-              substituteInPlace ./mkspecs/common/mac.conf \
-                  --replace "/System/Library/Frameworks/OpenGL.framework/" "${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework/"
-              substituteInPlace ./mkspecs/common/mac.conf \
-                  --replace "/System/Library/Frameworks/AGL.framework/" "${darwin.apple_sdk.frameworks.AGL}/Library/Frameworks/AGL.framework/"
-        ''
-        # Note on the above: \x27 is a way if including a single-quote
-        # character in the sed string arguments.
-      else
-        lib.optionalString libGLSupported
-          ''
-            sed -i mkspecs/common/linux.conf \
-                -e "/^QMAKE_INCDIR_OPENGL/ s|$|${libGL.dev or libGL}/include|" \
-                -e "/^QMAKE_LIBDIR_OPENGL/ s|$|${libGL.out}/lib|"
-          '' +
-        lib.optionalString (stdenv.hostPlatform.isx86_32 && stdenv.cc.isGNU)
-          ''
-            sed -i mkspecs/common/gcc-base-unix.conf \
-                -e "/^QMAKE_LFLAGS_SHLIB/ s/-shared/-shared -static-libgcc/"
-          ''
-    );
+    substituteInPlace configure --replace /bin/pwd pwd
+    substituteInPlace src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls
+    sed -e 's@/\(usr\|opt\)/@/var/empty/@g' -i mkspecs/*/*.conf
+
+    sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5Config.cmake.in
+    sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5CoreMacros.cmake
+    sed -i 's/NO_DEFAULT_PATH//' src/gui/Qt5GuiConfigExtras.cmake.in
+    sed -i '/PATHS.*NO_DEFAULT_PATH/ d' mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+  '' + (
+    if stdenv.isDarwin then ''
+        sed -i \
+            -e 's|/usr/bin/xcode-select|xcode-select|' \
+            -e 's|/usr/bin/xcrun|xcrun|' \
+            -e 's|/usr/bin/xcodebuild|xcodebuild|' \
+            -e 's|QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX`|QMAKE_CXX="clang++"\nQMAKE_CONF_COMPILER="clang++"|' \
+            ./configure
+            substituteInPlace ./mkspecs/common/mac.conf \
+                --replace "/System/Library/Frameworks/OpenGL.framework/" "${OpenGL}/Library/Frameworks/OpenGL.framework/" \
+                --replace "/System/Library/Frameworks/AGL.framework/" "${AGL}/Library/Frameworks/AGL.framework/"
+    '' else lib.optionalString libGLSupported ''
+      sed -i mkspecs/common/linux.conf \
+          -e "/^QMAKE_INCDIR_OPENGL/ s|$|${libGL.dev or libGL}/include|" \
+          -e "/^QMAKE_LIBDIR_OPENGL/ s|$|${libGL.out}/lib|"
+    '' + lib.optionalString (stdenv.hostPlatform.isx86_32 && stdenv.cc.isGNU) ''
+      sed -i mkspecs/common/gcc-base-unix.conf \
+          -e "/^QMAKE_LFLAGS_SHLIB/ s/-shared/-shared -static-libgcc/"
+    ''
+  );
 
   qtPluginPrefix = "lib/qt-${qtCompatVersion}/plugins";
   qtQmlPrefix = "lib/qt-${qtCompatVersion}/qml";
@@ -218,153 +191,128 @@ stdenv.mkDerivation {
   PSQL_LIBS = lib.optionalString (postgresql != null) "-L${postgresql.lib}/lib -lpq";
 
   # TODO Remove obsolete and useless flags once the build will be totally mastered
-  configureFlags =
-    [
-      "-plugindir $(out)/$(qtPluginPrefix)"
-      "-qmldir $(out)/$(qtQmlPrefix)"
-      "-docdir $(out)/$(qtDocPrefix)"
-
-      "-verbose"
-      "-confirm-license"
-      "-opensource"
-
-      "-release"
-      "-shared"
-      "-accessibility"
-      "-optimized-qmake"
-      "-strip"
-      "-system-proxies"
-      "-pkg-config"
-
-      "-gui"
-      "-widgets"
-      "-opengl desktop"
-      "-icu"
-      "-L" "${icu.out}/lib"
-      "-I" "${icu.dev}/include"
-      "-pch"
-    ]
-    ++ lib.optional debugSymbols "-debug"
-    ++ lib.optionals (compareVersion "5.11.0" < 0)
-    [
-      "-qml-debug"
-    ]
-    ++ lib.optionals (compareVersion "5.9.0" < 0)
-    [
-      "-c++11"
-      "-no-reduce-relocations"
-    ]
-    ++ lib.optionals developerBuild [
-      "-developer-build"
-      "-no-warnings-are-errors"
+  configureFlags = [
+    "-plugindir $(out)/$(qtPluginPrefix)"
+    "-qmldir $(out)/$(qtQmlPrefix)"
+    "-docdir $(out)/$(qtDocPrefix)"
+
+    "-verbose"
+    "-confirm-license"
+    "-opensource"
+
+    "-release"
+    "-shared"
+    "-accessibility"
+    "-optimized-qmake"
+    "-strip"
+    "-system-proxies"
+    "-pkg-config"
+
+    "-gui"
+    "-widgets"
+    "-opengl desktop"
+    "-icu"
+    "-L" "${icu.out}/lib"
+    "-I" "${icu.dev}/include"
+    "-pch"
+  ] ++ lib.optional debugSymbols "-debug"
+    ++ lib.optionals (compareVersion "5.11.0" < 0) [
+    "-qml-debug"
+  ] ++ lib.optionals (compareVersion "5.9.0" < 0) [
+    "-c++11"
+    "-no-reduce-relocations"
+  ] ++ lib.optionals developerBuild [
+    "-developer-build"
+    "-no-warnings-are-errors"
+  ] ++ (if (!stdenv.hostPlatform.isx86_64) then [
+    "-no-sse2"
+  ] else lib.optionals (compareVersion "5.9.0" >= 0) [
+    "-sse2"
+    "${lib.optionalString (!stdenv.hostPlatform.sse3Support)   "-no"}-sse3"
+    "${lib.optionalString (!stdenv.hostPlatform.ssse3Support)  "-no"}-ssse3"
+    "${lib.optionalString (!stdenv.hostPlatform.sse4_1Support) "-no"}-sse4.1"
+    "${lib.optionalString (!stdenv.hostPlatform.sse4_2Support) "-no"}-sse4.2"
+    "${lib.optionalString (!stdenv.hostPlatform.avxSupport)    "-no"}-avx"
+    "${lib.optionalString (!stdenv.hostPlatform.avx2Support)   "-no"}-avx2"
     ]
+  ) ++ [
+    "-no-mips_dsp"
+    "-no-mips_dspr2"
+  ] ++ [
+    "-system-zlib"
+    "-L" "${zlib.out}/lib"
+    "-I" "${zlib.dev}/include"
+    "-system-libjpeg"
+    "-L" "${libjpeg.out}/lib"
+    "-I" "${libjpeg.dev}/include"
+    "-system-harfbuzz"
+    "-L" "${harfbuzz.out}/lib"
+    "-I" "${harfbuzz.dev}/include"
+    "-system-pcre"
+    "-openssl-linked"
+    "-L" "${openssl.out}/lib"
+    "-I" "${openssl.dev}/include"
+    "-system-sqlite"
+    ''-${if libmysqlclient != null then "plugin" else "no"}-sql-mysql''
+    ''-${if postgresql != null then "plugin" else "no"}-sql-psql''
+
+    "-make libs"
+    "-make tools"
+    ''-${lib.optionalString (!buildExamples) "no"}make examples''
+    ''-${lib.optionalString (!buildTests) "no"}make tests''
+  ] ++ lib.optional (compareVersion "5.15.0" < 0) "-v"
     ++ (
-      if (!stdenv.hostPlatform.isx86_64) then [
-        "-no-sse2"
-      ] else if (compareVersion "5.9.0" >= 0) then [
-        "-sse2"
-        "${if stdenv.hostPlatform.sse3Support   then "" else "-no"}-sse3"
-        "${if stdenv.hostPlatform.ssse3Support  then "" else "-no"}-ssse3"
-        "${if stdenv.hostPlatform.sse4_1Support then "" else "-no"}-sse4.1"
-        "${if stdenv.hostPlatform.sse4_2Support then "" else "-no"}-sse4.2"
-        "${if stdenv.hostPlatform.avxSupport    then "" else "-no"}-avx"
-        "${if stdenv.hostPlatform.avx2Support   then "" else "-no"}-avx2"
-      ] else [
-      ]
-    )
-    ++ [
-      "-no-mips_dsp"
-      "-no-mips_dspr2"
-    ]
-
-    ++ [
-      "-system-zlib"
-      "-L" "${zlib.out}/lib"
-      "-I" "${zlib.dev}/include"
-      "-system-libjpeg"
-      "-L" "${libjpeg.out}/lib"
-      "-I" "${libjpeg.dev}/include"
-      "-system-harfbuzz"
-      "-L" "${harfbuzz.out}/lib"
-      "-I" "${harfbuzz.dev}/include"
-      "-system-pcre"
-      "-openssl-linked"
-      "-L" "${openssl.out}/lib"
-      "-I" "${openssl.dev}/include"
-      "-system-sqlite"
-      ''-${if libmysqlclient != null then "plugin" else "no"}-sql-mysql''
-      ''-${if postgresql != null then "plugin" else "no"}-sql-psql''
-
-      "-make libs"
-      "-make tools"
-      ''-${lib.optionalString (!buildExamples) "no"}make examples''
-      ''-${lib.optionalString (!buildTests) "no"}make tests''
+      if stdenv.isDarwin then [
+      "-platform macx-clang"
+      "-no-fontconfig"
+      "-qt-freetype"
+      "-qt-libpng"
+      "-no-framework"
+    ] else [
+      "-${lib.optionalString (compareVersion "5.9.0" < 0) "no-"}rpath"
+    ] ++ lib.optional (compareVersion "5.15.0" < 0) "-system-xcb"
+      ++ [
+      "-xcb"
+      "-qpa xcb"
+      "-L" "${libX11.out}/lib"
+      "-I" "${libX11.out}/include"
+      "-L" "${libXext.out}/lib"
+      "-I" "${libXext.out}/include"
+      "-L" "${libXrender.out}/lib"
+      "-I" "${libXrender.out}/include"
+
+      "-libinput"
+
+      ''-${lib.optionalString (cups == null) "no-"}cups''
+      "-dbus-linked"
+      "-glib"
+    ] ++ lib.optional (compareVersion "5.15.0" < 0) "-system-libjpeg"
+      ++ [
+      "-system-libpng"
+    ] ++ lib.optional withGtk3 "-gtk"
+      ++ lib.optional (compareVersion "5.9.0" >= 0) "-inotify"
+      ++ lib.optionals (compareVersion "5.10.0" >= 0) [
+      # Without these, Qt stops working on kernels < 3.17. See:
+      # https://github.com/NixOS/nixpkgs/issues/38832
+      "-no-feature-renameat2"
+      "-no-feature-getentropy"
+    ] ++ lib.optionals (compareVersion "5.12.1" < 0) [
+      # use -xkbcommon and -xkbcommon-evdev for versions before 5.12.1
+      "-system-xkbcommon"
+      "-xkbcommon-evdev"
+    ] ++ lib.optionals (cups != null) [
+      "-L" "${cups.lib}/lib"
+      "-I" "${cups.dev}/include"
+    ] ++ lib.optionals (libmysqlclient != null) [
+      "-L" "${libmysqlclient}/lib"
+      "-I" "${libmysqlclient}/include"
     ]
-    ++ lib.optional (compareVersion "5.15.0" < 0) "-v"
+  );
 
-    ++ (
-      if stdenv.isDarwin
-      then
-        [
-          "-platform macx-clang"
-          "-no-fontconfig"
-          "-qt-freetype"
-          "-qt-libpng"
-          "-no-framework"
-        ]
-      else
-        [
-          "-${lib.optionalString (compareVersion "5.9.0" < 0) "no-"}rpath"
-        ]
-        ++ lib.optional (compareVersion "5.15.0" < 0) "-system-xcb"
-        ++ [
-          "-xcb"
-          "-qpa xcb"
-          "-L" "${libX11.out}/lib"
-          "-I" "${libX11.out}/include"
-          "-L" "${libXext.out}/lib"
-          "-I" "${libXext.out}/include"
-          "-L" "${libXrender.out}/lib"
-          "-I" "${libXrender.out}/include"
-
-          "-libinput"
-
-          ''-${lib.optionalString (cups == null) "no-"}cups''
-          "-dbus-linked"
-          "-glib"
-        ]
-        ++ lib.optional (compareVersion "5.15.0" < 0) "-system-libjpeg"
-        ++ [
-          "-system-libpng"
-        ]
-        ++ lib.optional withGtk3 "-gtk"
-        ++ lib.optional (compareVersion "5.9.0" >= 0) "-inotify"
-        ++ lib.optionals (compareVersion "5.10.0" >= 0) [
-          # Without these, Qt stops working on kernels < 3.17. See:
-          # https://github.com/NixOS/nixpkgs/issues/38832
-          "-no-feature-renameat2"
-          "-no-feature-getentropy"
-        ]
-        ++ lib.optionals (compareVersion "5.12.1" < 0) [
-          # use -xkbcommon and -xkbcommon-evdev for versions before 5.12.1
-          "-system-xkbcommon"
-          "-xkbcommon-evdev"
-        ]
-        ++ lib.optionals (cups != null) [
-          "-L" "${cups.lib}/lib"
-          "-I" "${cups.dev}/include"
-        ]
-        ++ lib.optionals (libmysqlclient != null) [
-          "-L" "${libmysqlclient}/lib"
-          "-I" "${libmysqlclient}/include"
-        ]
-    );
-
-  postInstall =
-    # Move selected outputs.
-    ''
-      moveToOutput "mkspecs" "$dev"
-    '';
+  # Move selected outputs.
+  postInstall = ''
+    moveToOutput "mkspecs" "$dev"
+  '';
 
   devTools = [
     "bin/fixqt4headers.pl"
@@ -378,35 +326,27 @@ stdenv.mkDerivation {
     "bin/uic"
   ];
 
-  postFixup =
+  postFixup = ''
     # Don't retain build-time dependencies like gdb.
-    ''
-      sed '/QMAKE_DEFAULT_.*DIRS/ d' -i $dev/mkspecs/qconfig.pri
-    ''
-
-    + ''
-      fixQtModulePaths "''${!outputDev}/mkspecs/modules"
-      fixQtBuiltinPaths "''${!outputDev}" '*.pr?'
-    ''
+    sed '/QMAKE_DEFAULT_.*DIRS/ d' -i $dev/mkspecs/qconfig.pri
+    fixQtModulePaths "''${!outputDev}/mkspecs/modules"
+    fixQtBuiltinPaths "''${!outputDev}" '*.pr?'
 
     # Move development tools to $dev
-    + ''
-      moveQtDevTools
-      moveToOutput bin "$dev"
-    ''
+    moveQtDevTools
+    moveToOutput bin "$dev"
 
     # fixup .pc file (where to find 'moc' etc.)
-    + ''
-      sed -i "$dev/lib/pkgconfig/Qt5Core.pc" \
-          -e "/^host_bins=/ c host_bins=$dev/bin"
-    '';
+    sed -i "$dev/lib/pkgconfig/Qt5Core.pc" \
+      -e "/^host_bins=/ c host_bins=$dev/bin"
+  '';
 
   dontStrip = debugSymbols;
 
   setupHook = ../hooks/qtbase-setup-hook.sh;
 
   meta = with lib; {
-    homepage = "http://www.qt.io";
+    homepage = "https://www.qt.io/";
     description = "A cross-platform application framework for C++";
     license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ];
     maintainers = with maintainers; [ qknight ttuegel periklis bkchr ];
diff --git a/pkgs/development/libraries/qt-5/modules/qtdeclarative.nix b/pkgs/development/libraries/qt-5/modules/qtdeclarative.nix
index 97248ca18076..89f2672c26dd 100644
--- a/pkgs/development/libraries/qt-5/modules/qtdeclarative.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtdeclarative.nix
@@ -1,7 +1,5 @@
 { qtModule, lib, python3, qtbase, qtsvg }:
 
-with lib;
-
 qtModule {
   pname = "qtdeclarative";
   qtInputs = [ qtbase qtsvg ];
diff --git a/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix b/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix
index 0d2d565fe7ae..baf5c30e73c4 100644
--- a/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix
@@ -1,17 +1,24 @@
-{ qtModule, lib, stdenv, qtbase, qtdeclarative, pkg-config
-, alsa-lib, gstreamer, gst-plugins-base, libpulseaudio, wayland
+{ qtModule
+, lib
+, stdenv
+, qtbase
+, qtdeclarative
+, pkg-config
+, alsa-lib
+, gstreamer
+, gst-plugins-base
+, libpulseaudio
+, wayland
 }:
 
-with lib;
-
 qtModule {
   pname = "qtmultimedia";
   qtInputs = [ qtbase qtdeclarative ];
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [ gstreamer gst-plugins-base libpulseaudio ]
-    ++ optional (stdenv.isLinux) alsa-lib
-    ++ optional (versionAtLeast qtbase.version "5.14.0" && stdenv.isLinux) wayland;
+    ++ lib.optional (stdenv.isLinux) alsa-lib
+    ++ lib.optional (lib.versionAtLeast qtbase.version "5.14.0" && stdenv.isLinux) wayland;
   outputs = [ "bin" "dev" "out" ];
   qmakeFlags = [ "GST_VERSION=1.0" ];
-  NIX_LDFLAGS = optionalString (stdenv.isDarwin) "-lobjc";
+  NIX_LDFLAGS = lib.optionalString (stdenv.isDarwin) "-lobjc";
 }
diff --git a/pkgs/development/libraries/qt-5/modules/qtserialport.nix b/pkgs/development/libraries/qt-5/modules/qtserialport.nix
index caeaedbcf3d5..89d96eb29124 100644
--- a/pkgs/development/libraries/qt-5/modules/qtserialport.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtserialport.nix
@@ -1,11 +1,7 @@
 { qtModule, stdenv, lib, qtbase, systemd }:
 
-let inherit (lib) getLib optional; in
-
 qtModule {
   pname = "qtserialport";
   qtInputs = [ qtbase ];
-  NIX_CFLAGS_COMPILE =
-    optional stdenv.isLinux
-    ''-DNIXPKGS_LIBUDEV="${getLib systemd}/lib/libudev"'';
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isLinux "-DNIXPKGS_LIBUDEV=\"${lib.getLib systemd}/lib/libudev\"";
 }
diff --git a/pkgs/development/libraries/qt-5/modules/qttools.nix b/pkgs/development/libraries/qt-5/modules/qttools.nix
index 437ec6cef743..27008f6714ed 100644
--- a/pkgs/development/libraries/qt-5/modules/qttools.nix
+++ b/pkgs/development/libraries/qt-5/modules/qttools.nix
@@ -1,7 +1,5 @@
 { qtModule, stdenv, lib, qtbase, qtdeclarative }:
 
-with lib;
-
 qtModule {
   pname = "qttools";
   qtInputs = [ qtbase qtdeclarative ];
@@ -10,9 +8,9 @@ qtModule {
   # fixQtBuiltinPaths overwrites a builtin path we should keep
   postPatch = ''
     sed -i "src/linguist/linguist.pro" \
-        -e '/^cmake_linguist_config_version_file.input =/ s|$$\[QT_HOST_DATA.*\]|${getDev qtbase}|'
+        -e '/^cmake_linguist_config_version_file.input =/ s|$$\[QT_HOST_DATA.*\]|${lib.getDev qtbase}|'
     sed -i "src/qtattributionsscanner/qtattributionsscanner.pro" \
-        -e '/^cmake_qattributionsscanner_config_version_file.input =/ s|$$\[QT_HOST_DATA.*\]|${getDev qtbase}|'
+        -e '/^cmake_qattributionsscanner_config_version_file.input =/ s|$$\[QT_HOST_DATA.*\]|${lib.getDev qtbase}|'
   '';
 
   devTools = [
@@ -34,12 +32,11 @@ qtModule {
     "bin/qthelpconverter"
     "bin/lprodump"
     "bin/qdistancefieldgenerator"
-  ] ++ optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.isDarwin [
     "bin/macdeployqt"
   ];
 
-  NIX_CFLAGS_COMPILE =
-    lib.optional stdenv.isDarwin ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"'';
+  NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"'';
 
   setupHook = ../hooks/qttools-setup-hook.sh;
 }
diff --git a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
index 8d1eae712761..03247487749a 100644
--- a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
@@ -15,21 +15,22 @@
 , pipewire_0_2
 , enableProprietaryCodecs ? true
 , gn
-, cups, darwin, openbsm, runCommand, xcbuild, writeScriptBin
+, cctools, libobjc, libunwind, sandbox, xnu
+, ApplicationServices, AVFoundation, Foundation, ForceFeedback, GameController, AppKit
+, ImageCaptureCore, CoreBluetooth, IOBluetooth, CoreWLAN, Quartz, Cocoa, LocalAuthentication
+, cups, openbsm, runCommand, xcbuild, writeScriptBin
 , ffmpeg ? null
 , lib, stdenv, fetchpatch
 , version ? null
 , qtCompatVersion
 }:
 
-with lib;
-
 qtModule {
   pname = "qtwebengine";
   qtInputs = [ qtdeclarative qtquickcontrols qtlocation qtwebchannel ];
   nativeBuildInputs = [
     bison coreutils flex git gperf ninja pkg-config python2 which gn nodejs
-  ] ++ optional stdenv.isDarwin xcbuild;
+  ] ++ lib.optional stdenv.isDarwin xcbuild;
   doCheck = true;
   outputs = [ "bin" "dev" "out" ];
 
@@ -42,66 +43,65 @@ qtModule {
   # which cannot be set at the same time as -Wformat-security
   hardeningDisable = [ "format" ];
 
-  postPatch =
-    ''
-      # Patch Chromium build tools
-      (
-        cd src/3rdparty/chromium;
-
-        # Manually fix unsupported shebangs
-        substituteInPlace third_party/harfbuzz-ng/src/src/update-unicode-tables.make \
-          --replace "/usr/bin/env -S make -f" "/usr/bin/make -f" || true
-
-        patchShebangs .
-      )
-    ''
-    # Prevent Chromium build script from making the path to `clang` relative to
-    # the build directory.  `clang_base_path` is the value of `QMAKE_CLANG_DIR`
-    # from `src/core/config/mac_osx.pri`.
-    + optionalString stdenv.isDarwin ''
-      substituteInPlace ./src/3rdparty/chromium/build/toolchain/mac/BUILD.gn \
-        --replace 'prefix = rebase_path("$clang_base_path/bin/", root_build_dir)' 'prefix = "$clang_base_path/bin/"'
-    ''
-    # Patch library paths in Qt sources
-    + ''
-      sed -i \
-        -e "s,QLibraryInfo::location(QLibraryInfo::DataPath),QLatin1String(\"$out\"),g" \
-        -e "s,QLibraryInfo::location(QLibraryInfo::TranslationsPath),QLatin1String(\"$out/translations\"),g" \
-        -e "s,QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath),QLatin1String(\"$out/libexec\"),g" \
-        src/core/web_engine_library_info.cpp
-    ''
-    # Patch library paths in Chromium sources
-    + optionalString (!stdenv.isDarwin) ''
-      sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${lib.getLib systemd}/lib/\1!' \
-        src/3rdparty/chromium/device/udev_linux/udev?_loader.cc
-
-      sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \
-        src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc
-    ''
-    + optionalString stdenv.isDarwin (
-    (if (lib.versionAtLeast qtCompatVersion "5.14") then ''
-      substituteInPlace src/buildtools/config/mac_osx.pri \
-        --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"'
-    '' else ''
-      substituteInPlace src/core/config/mac_osx.pri \
-        --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"'
-    '')
-     # Following is required to prevent a build error:
-     # ninja: error: '/nix/store/z8z04p0ph48w22rqzx7ql67gy8cyvidi-SDKs/MacOSX10.12.sdk/usr/include/mach/exc.defs', needed by 'gen/third_party/crashpad/crashpad/util/mach/excUser.c', missing and no known rule to make it
-    + ''
-      substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/BUILD.gn \
-        --replace '$sysroot/usr' "${darwin.xnu}"
-    ''
-    # Apple has some secret stuff they don't share with OpenBSM
-    + (if (lib.versionAtLeast qtCompatVersion "5.14") then ''
-    substituteInPlace src/3rdparty/chromium/base/mac/mach_port_rendezvous.cc \
-      --replace "audit_token_to_pid(request.trailer.msgh_audit)" "request.trailer.msgh_audit.val[5]"
-    substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/mach/mach_message.cc \
-      --replace "audit_token_to_pid(audit_trailer->msgh_audit)" "audit_trailer->msgh_audit.val[5]"
-    '' else ''
-    substituteInPlace src/3rdparty/chromium/base/mac/mach_port_broker.mm \
-      --replace "audit_token_to_pid(msg.trailer.msgh_audit)" "msg.trailer.msgh_audit.val[5]"
-    ''));
+  postPatch = ''
+    # Patch Chromium build tools
+    (
+      cd src/3rdparty/chromium;
+
+      # Manually fix unsupported shebangs
+      substituteInPlace third_party/harfbuzz-ng/src/src/update-unicode-tables.make \
+        --replace "/usr/bin/env -S make -f" "/usr/bin/make -f" || true
+
+      # TODO: be more precise
+      patchShebangs .
+    )
+  ''
+  # Prevent Chromium build script from making the path to `clang` relative to
+  # the build directory.  `clang_base_path` is the value of `QMAKE_CLANG_DIR`
+  # from `src/core/config/mac_osx.pri`.
+  + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace ./src/3rdparty/chromium/build/toolchain/mac/BUILD.gn \
+      --replace 'prefix = rebase_path("$clang_base_path/bin/", root_build_dir)' 'prefix = "$clang_base_path/bin/"'
+  ''
+  # Patch library paths in Qt sources
+  + ''
+    sed -i \
+      -e "s,QLibraryInfo::location(QLibraryInfo::DataPath),QLatin1String(\"$out\"),g" \
+      -e "s,QLibraryInfo::location(QLibraryInfo::TranslationsPath),QLatin1String(\"$out/translations\"),g" \
+      -e "s,QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath),QLatin1String(\"$out/libexec\"),g" \
+      src/core/web_engine_library_info.cpp
+  ''
+  # Patch library paths in Chromium sources
+  + lib.optionalString (!stdenv.isDarwin) ''
+    sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${lib.getLib systemd}/lib/\1!' \
+      src/3rdparty/chromium/device/udev_linux/udev?_loader.cc
+
+    sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \
+      src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc
+  '' + lib.optionalString stdenv.isDarwin (
+  (if (lib.versionAtLeast qtCompatVersion "5.14") then ''
+    substituteInPlace src/buildtools/config/mac_osx.pri \
+      --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"'
+  '' else ''
+    substituteInPlace src/core/config/mac_osx.pri \
+      --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"'
+  '')
+   # Following is required to prevent a build error:
+   # ninja: error: '/nix/store/z8z04p0ph48w22rqzx7ql67gy8cyvidi-SDKs/MacOSX10.12.sdk/usr/include/mach/exc.defs', needed by 'gen/third_party/crashpad/crashpad/util/mach/excUser.c', missing and no known rule to make it
+  + ''
+    substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/BUILD.gn \
+      --replace '$sysroot/usr' "${xnu}"
+  ''
+  # Apple has some secret stuff they don't share with OpenBSM
+  + (if (lib.versionAtLeast qtCompatVersion "5.14") then ''
+  substituteInPlace src/3rdparty/chromium/base/mac/mach_port_rendezvous.cc \
+    --replace "audit_token_to_pid(request.trailer.msgh_audit)" "request.trailer.msgh_audit.val[5]"
+  substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/mach/mach_message.cc \
+    --replace "audit_token_to_pid(audit_trailer->msgh_audit)" "audit_trailer->msgh_audit.val[5]"
+  '' else ''
+  substituteInPlace src/3rdparty/chromium/base/mac/mach_port_broker.mm \
+    --replace "audit_token_to_pid(msg.trailer.msgh_audit)" "msg.trailer.msgh_audit.val[5]"
+  ''));
 
   NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [
     # with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit
@@ -134,8 +134,8 @@ qtModule {
   '';
 
   qmakeFlags = [ "--" "-system-ffmpeg" ]
-    ++ optional (stdenv.isLinux && (lib.versionAtLeast qtCompatVersion "5.15")) "-webengine-webrtc-pipewire"
-    ++ optional enableProprietaryCodecs "-proprietary-codecs";
+    ++ lib.optional (stdenv.isLinux && (lib.versionAtLeast qtCompatVersion "5.15")) "-webengine-webrtc-pipewire"
+    ++ lib.optional enableProprietaryCodecs "-proprietary-codecs";
 
   propagatedBuildInputs = [
     # Image formats
@@ -152,7 +152,7 @@ qtModule {
 
     libevent
     ffmpeg
-  ] ++ optionals (!stdenv.isDarwin) [
+  ] ++ lib.optionals (!stdenv.isDarwin) [
     dbus zlib minizip snappy nss protobuf jsoncpp
 
     # Audio formats
@@ -168,14 +168,14 @@ qtModule {
     xorg.xrandr libXScrnSaver libXcursor libXrandr xorg.libpciaccess libXtst
     xorg.libXcomposite xorg.libXdamage libdrm xorg.libxkbfile
 
-  ] ++ optionals (stdenv.isLinux && (lib.versionAtLeast qtCompatVersion "5.15")) [
+  ] ++ lib.optionals (stdenv.isLinux && (lib.versionAtLeast qtCompatVersion "5.15")) [
     # Pipewire
     pipewire_0_2
   ]
 
   # FIXME These dependencies shouldn't be needed but can't find a way
   # around it. Chromium pulls this in while bootstrapping GN.
-  ++ lib.optionals stdenv.isDarwin (with darwin; with apple_sdk.frameworks; [
+  ++ lib.optionals stdenv.isDarwin [
     libobjc
     cctools
 
@@ -196,11 +196,11 @@ qtModule {
 
     openbsm
     libunwind
-  ]);
+  ];
 
-  buildInputs = optionals stdenv.isDarwin (with darwin; [
+  buildInputs = lib.optionals stdenv.isDarwin [
     cups
-    apple_sdk.libs.sandbox
+    sandbox
 
     # `sw_vers` is used by `src/3rdparty/chromium/build/config/mac/sdk_info.py`
     # to get some information about the host platform.
@@ -216,11 +216,10 @@ qtModule {
         shift
       done
     '')
-  ]);
+  ];
 
   dontUseNinjaBuild = true;
   dontUseNinjaInstall = true;
-  dontUseXcbuild = true;
 
   postInstall = lib.optionalString stdenv.isLinux ''
     cat > $out/libexec/qt.conf <<EOF
@@ -241,5 +240,4 @@ qtModule {
     # This build takes a long time; particularly on slow architectures
     timeout = 24 * 3600;
   };
-
 }
diff --git a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
index e2dd0d4b19c7..dc9f5ccb9eb2 100644
--- a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
@@ -3,15 +3,15 @@
 , fontconfig, libwebp, libxml2, libxslt
 , sqlite, systemd, glib, gst_all_1, cmake
 , bison, flex, gdb, gperf, perl, pkg-config, python2, ruby
-, darwin
+, ICU, OpenGL
 }:
 
 let
-  inherit (lib) optional optionals getDev getLib;
   hyphen = stdenv.mkDerivation rec {
-    name = "hyphen-2.8.8";
+    pname = "hyphen";
+    version = "2.8.8";
     src = fetchurl {
-      url = "http://dev-www.libreoffice.org/src/5ade6ae2a99bc1e9e57031ca88d36dad-${name}.tar.gz";
+      url = "http://dev-www.libreoffice.org/src/5ade6ae2a99bc1e9e57031ca88d36dad-hyphen-${version}.tar.gz";
       sha256 = "304636d4eccd81a14b6914d07b84c79ebb815288c76fe027b9ebff6ff24d5705";
     };
     postPatch = ''
@@ -24,19 +24,19 @@ in
 qtModule {
   pname = "qtwebkit";
   qtInputs = [ qtbase qtdeclarative qtlocation qtsensors ]
-    ++ optional (stdenv.isDarwin && lib.versionAtLeast qtbase.version "5.9.0") qtmultimedia
-    ++ optional usingAnnulenWebkitFork qtwebchannel;
+    ++ lib.optional (stdenv.isDarwin && lib.versionAtLeast qtbase.version "5.9.0") qtmultimedia
+    ++ lib.optional usingAnnulenWebkitFork qtwebchannel;
   buildInputs = [ fontconfig libwebp libxml2 libxslt sqlite glib gst_all_1.gstreamer gst_all_1.gst-plugins-base ]
-    ++ optionals (stdenv.isDarwin) (with darwin; with apple_sdk.frameworks; [ ICU OpenGL ])
-    ++ optional usingAnnulenWebkitFork hyphen;
+    ++ lib.optionals stdenv.isDarwin [ ICU OpenGL ]
+    ++ lib.optional usingAnnulenWebkitFork hyphen;
   nativeBuildInputs = [
     bison flex gdb gperf perl pkg-config python2 ruby
-  ] ++ optional usingAnnulenWebkitFork cmake;
+  ] ++ lib.optional usingAnnulenWebkitFork cmake;
 
-  cmakeFlags = optionals usingAnnulenWebkitFork ([ "-DPORT=Qt" ]
-    ++ optionals stdenv.isDarwin [
-      "-DQt5Multimedia_DIR=${getDev qtmultimedia}/lib/cmake/Qt5Multimedia"
-      "-DQt5MultimediaWidgets_DIR=${getDev qtmultimedia}/lib/cmake/Qt5MultimediaWidgets"
+  cmakeFlags = lib.optionals usingAnnulenWebkitFork ([ "-DPORT=Qt" ]
+    ++ lib.optionals stdenv.isDarwin [
+      "-DQt5Multimedia_DIR=${lib.getDev qtmultimedia}/lib/cmake/Qt5Multimedia"
+      "-DQt5MultimediaWidgets_DIR=${lib.getDev qtmultimedia}/lib/cmake/Qt5MultimediaWidgets"
       "-DMACOS_FORCE_SYSTEM_XML_LIBRARIES=OFF"
     ]);
 
@@ -50,19 +50,22 @@ qtModule {
   '';
 
   NIX_CFLAGS_COMPILE = [
-      # with gcc7 this warning blows the log over Hydra's limit
-      "-Wno-expansion-to-defined"
-    ]
-    # with gcc8, -Wclass-memaccess became part of -Wall and this too exceeds the logging limit
-    ++ optional stdenv.cc.isGNU "-Wno-class-memaccess"
-    # with clang this warning blows the log over Hydra's limit
-    ++ optional stdenv.isDarwin "-Wno-inconsistent-missing-override"
-    ++ optional (!stdenv.isDarwin) ''-DNIXPKGS_LIBUDEV="${getLib systemd}/lib/libudev"'';
+    # with gcc7 this warning blows the log over Hydra's limit
+    "-Wno-expansion-to-defined"
+  ]
+  # with gcc8, -Wclass-memaccess became part of -Wall and this too exceeds the logging limit
+  ++ lib.optional stdenv.cc.isGNU "-Wno-class-memaccess"
+  # with clang this warning blows the log over Hydra's limit
+  ++ lib.optional stdenv.isDarwin "-Wno-inconsistent-missing-override"
+  ++ lib.optional (!stdenv.isDarwin) ''-DNIXPKGS_LIBUDEV="${lib.getLib systemd}/lib/libudev"'';
 
   doCheck = false; # fails 13 out of 13 tests (ctest)
 
   # Hack to avoid TMPDIR in RPATHs.
-  preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
+  preFixup = ''
+    rm -rf "$(pwd)"
+    mkdir "$(pwd)"
+  '';
 
   meta = {
     maintainers = with lib.maintainers; [ abbradar periklis ];
diff --git a/pkgs/development/libraries/qt-5/modules/qtwebview.nix b/pkgs/development/libraries/qt-5/modules/qtwebview.nix
index 1df8ef866389..14f7937a2e24 100644
--- a/pkgs/development/libraries/qt-5/modules/qtwebview.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtwebview.nix
@@ -1,14 +1,12 @@
-{ darwin, lib, stdenv, qtModule, qtdeclarative, qtwebengine }:
-
-with lib;
+{ lib, stdenv, qtModule, qtdeclarative, qtwebengine, CoreFoundation, WebKit }:
 
 qtModule {
   pname = "qtwebview";
   qtInputs = [ qtdeclarative qtwebengine ];
-  buildInputs = optional (stdenv.isDarwin) [
-    darwin.apple_sdk.frameworks.CoreFoundation
-    darwin.apple_sdk.frameworks.WebKit
+  buildInputs = lib.optional stdenv.isDarwin [
+    CoreFoundation
+    WebKit
   ];
   outputs = [ "out" "dev" "bin" ];
-  NIX_LDFLAGS = optionalString stdenv.isDarwin "-framework CoreFoundation -framework WebKit";
+  NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework CoreFoundation -framework WebKit";
 }
diff --git a/pkgs/development/python-modules/dateutil/default.nix b/pkgs/development/python-modules/dateutil/default.nix
index e71a532a806d..d263414b4a26 100644
--- a/pkgs/development/python-modules/dateutil/default.nix
+++ b/pkgs/development/python-modules/dateutil/default.nix
@@ -7,11 +7,11 @@
 
 buildPythonPackage rec {
   pname = "python-dateutil";
-  version = "2.8.1";
+  version = "2.8.2";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c";
+    sha256 = "sha256-ASPKzBYnrhnd88J6XeW9Z+5FhvvdZEDZdI+Ku0g9PoY=";
   };
 
   nativeBuildInputs = [ setuptools-scm ];
diff --git a/pkgs/development/python-modules/scipy/default.nix b/pkgs/development/python-modules/scipy/default.nix
index 19fa8e507281..7a9643aa7d24 100644
--- a/pkgs/development/python-modules/scipy/default.nix
+++ b/pkgs/development/python-modules/scipy/default.nix
@@ -1,4 +1,15 @@
-{lib, fetchPypi, python, buildPythonPackage, gfortran, nose, pytest, pytest-xdist, numpy, pybind11 }:
+{ lib
+, stdenv
+, fetchPypi
+, python
+, buildPythonPackage
+, gfortran
+, nose
+, pytest
+, pytest-xdist
+, numpy
+, pybind11
+}:
 
 buildPythonPackage rec {
   pname = "scipy";
@@ -30,6 +41,17 @@ buildPythonPackage rec {
     ln -s ${numpy.cfg} site.cfg
   '';
 
+
+  # disable stackprotector on aarch64-darwin for now
+  #
+  # build error:
+  #
+  # /private/tmp/nix-build-python3.9-scipy-1.6.3.drv-0/ccDEsw5U.s:109:15: error: index must be an integer in range [-256, 255].
+  #
+  #         ldr     x0, [x0, ___stack_chk_guard];momd
+  #
+  hardeningDisable = lib.optionals (stdenv.isAarch64 && stdenv.isDarwin) [ "stackprotector" ];
+
   checkPhase = ''
     runHook preCheck
     pushd dist
diff --git a/pkgs/development/tools/misc/automake/automake-1.16.x.nix b/pkgs/development/tools/misc/automake/automake-1.16.x.nix
index 48f01f8d0f67..588e9053adb0 100644
--- a/pkgs/development/tools/misc/automake/automake-1.16.x.nix
+++ b/pkgs/development/tools/misc/automake/automake-1.16.x.nix
@@ -1,11 +1,11 @@
 { lib, stdenv, fetchurl, perl, autoconf }:
 
 stdenv.mkDerivation rec {
-  name = "automake-1.16.3";
+  name = "automake-1.16.4";
 
   src = fetchurl {
     url = "mirror://gnu/automake/${name}.tar.xz";
-    sha256 = "0fmz2fhmzcpacnprl5msphvaflwiy0hvpgmqlgfny72ddijzfazz";
+    sha256 = "sha256-gPrMCYhaV+bUnQaXLArhCJxfqPTUx8/luupY5QhfE20=";
   };
 
   nativeBuildInputs = [ autoconf perl ];
diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix
index 2a23c8d3ea55..c82f872e4889 100644
--- a/pkgs/os-specific/linux/kernel/common-config.nix
+++ b/pkgs/os-specific/linux/kernel/common-config.nix
@@ -790,6 +790,7 @@ let
       MODVERSIONS        = whenOlder "4.9" yes;
       MOUSE_ELAN_I2C_SMBUS = yes;
       MOUSE_PS2_ELANTECH = yes; # Elantech PS/2 protocol extension
+      MOUSE_PS2_VMMOUSE  = yes;
       MTRR_SANITIZER     = yes;
       NET_FC             = yes; # Fibre Channel driver support
       # GPIO on Intel Bay Trail, for some Chromebook internal eMMC disks
diff --git a/pkgs/os-specific/linux/lvm2/default.nix b/pkgs/os-specific/linux/lvm2/default.nix
index d822ceed714c..2e52e49639e2 100644
--- a/pkgs/os-specific/linux/lvm2/default.nix
+++ b/pkgs/os-specific/linux/lvm2/default.nix
@@ -4,7 +4,7 @@
 , pkg-config
 , util-linux
 , libuuid
-, thin-provisioning-tools, libaio
+, libaio
 , enableCmdlib ? false
 , enableDmeventd ? false
 , udev ? null
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ pkg-config ];
-  buildInputs = [ udev libuuid thin-provisioning-tools libaio ];
+  buildInputs = [ udev libuuid libaio ];
 
   configureFlags = [
     "--disable-readline"
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index 2a1e0cfc6de3..ec5a5e6dcb9d 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -975,6 +975,7 @@ configurePhase() {
     fi
 
     if [ -z "${dontFixLibtool:-}" ]; then
+        export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"
         local i
         find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do
             echo "fixing libtool script $i"
diff --git a/pkgs/tools/networking/networkmanager/default.nix b/pkgs/tools/networking/networkmanager/default.nix
index 94d9dff1f849..63c52a337103 100644
--- a/pkgs/tools/networking/networkmanager/default.nix
+++ b/pkgs/tools/networking/networkmanager/default.nix
@@ -54,11 +54,11 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "networkmanager";
-  version = "1.32.4";
+  version = "1.32.6";
 
   src = fetchurl {
     url = "mirror://gnome/sources/NetworkManager/${lib.versions.majorMinor version}/NetworkManager-${version}.tar.xz";
-    sha256 = "sha256-Kay9QceLfvh/+I/sU2DR6vi1tvy5BVXXORq8XjaSMVg=";
+    sha256 = "sha256-PSdGBR87MylArCk1TgFpEVnUZ4PXL9IyvTbpgijOWgk=";
   };
 
   outputs = [ "out" "dev" "devdoc" "man" "doc" ];
diff --git a/pkgs/tools/networking/unbound/default.nix b/pkgs/tools/networking/unbound/default.nix
index a0c774fb7341..2e31fadba377 100644
--- a/pkgs/tools/networking/unbound/default.nix
+++ b/pkgs/tools/networking/unbound/default.nix
@@ -59,6 +59,13 @@ stdenv.mkDerivation rec {
     "--with-libnghttp2=${libnghttp2.dev}"
   ];
 
+  # Remove references to compile-time dependencies that are included in the configure flags
+  postConfigure = let
+    inherit (builtins) storeDir;
+  in ''
+    sed -E '/CONFCMDLINE/ s;${storeDir}/[a-z0-9]{32}-;${storeDir}/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-;g' -i config.h
+  '';
+
   installFlags = [ "configfile=\${out}/etc/unbound/unbound.conf" ];
 
   postInstall = ''
diff --git a/pkgs/tools/security/apg/default.nix b/pkgs/tools/security/apg/default.nix
index a185c09bda69..cfcadd75740f 100644
--- a/pkgs/tools/security/apg/default.nix
+++ b/pkgs/tools/security/apg/default.nix
@@ -1,8 +1,10 @@
 { lib, stdenv, fetchurl, openssl }:
 stdenv.mkDerivation rec {
-  name = "apg-2.3.0b";
+  pname = "apg";
+  version = "2.3.0b";
+
   src = fetchurl {
-    url = "http://www.adel.nursat.kz/apg/download/${name}.tar.gz";
+    url = "http://www.adel.nursat.kz/apg/download/apg-${version}.tar.gz";
     sha256 = "14lbq81xrcsmpk1b9qmqyz7n6ypf08zcxvcvp6f7ybcyf0lj1rfi";
   };
   configurePhase = ''
diff --git a/pkgs/tools/security/ccrypt/default.nix b/pkgs/tools/security/ccrypt/default.nix
index bf5f26f7044f..2972fc9ae55f 100644
--- a/pkgs/tools/security/ccrypt/default.nix
+++ b/pkgs/tools/security/ccrypt/default.nix
@@ -1,10 +1,11 @@
 {lib, stdenv, fetchurl, perl}:
 
-stdenv.mkDerivation {
-  name = "ccrypt-1.11";
+stdenv.mkDerivation rec {
+  pname = "ccrypt";
+  version = "1.11";
 
   src = fetchurl {
-    url = "mirror://sourceforge/ccrypt/ccrypt-1.11.tar.gz";
+    url = "mirror://sourceforge/ccrypt/ccrypt-${version}.tar.gz";
     sha256 = "0kx4a5mhmp73ljknl2lcccmw9z3f5y8lqw0ghaymzvln1984g75i";
   };
 
diff --git a/pkgs/tools/security/chaps/default.nix b/pkgs/tools/security/chaps/default.nix
index 2f89c3ea5858..13ac6d67febf 100644
--- a/pkgs/tools/security/chaps/default.nix
+++ b/pkgs/tools/security/chaps/default.nix
@@ -23,7 +23,7 @@ let
 in
 
 stdenv.mkDerivation rec {
-  name = "chaps-0.42-6812";
+  pname = "chaps";
   version = "0.42-6812";
 
   src = fetchFromGitHub {
@@ -59,25 +59,25 @@ stdenv.mkDerivation rec {
 
   installPhase = ''
     mkdir -p $out/bin
-    cp ${name}/out/chapsd $out/bin/.
-    cp ${name}/out/chaps_client $out/bin/.
+    cp ${pname}-${version}/out/chapsd $out/bin/.
+    cp ${pname}-${version}/out/chaps_client $out/bin/.
 
     mkdir -p $out/lib
-    cp ${name}/out/libchaps.so.* $out/lib/.
+    cp ${pname}-${version}/out/libchaps.so.* $out/lib/.
     mkdir -p $out/lib/security
-    cp ${name}/out/pam_chaps.so $out/lib/security/.
+    cp ${pname}-${version}/out/pam_chaps.so $out/lib/security/.
 
     mkdir -p $out/include
-    cp -r ${name}/out/chaps $out/include/.
+    cp -r ${pname}-${version}/out/chaps $out/include/.
 
     mkdir -p $out/etc/dbus-1/system.d
-    cp ${name}/out/org.chromium.Chaps.conf $out/etc/dbus-1/system.d/.
+    cp ${pname}-${version}/out/org.chromium.Chaps.conf $out/etc/dbus-1/system.d/.
     mkdir -p $out/etc/dbus-1/system-services
-    cp ${name}/platform2/chaps/org.chromium.Chaps.service $out/etc/dbus-1/system-services/.
+    cp ${pname}-${version}/platform2/chaps/org.chromium.Chaps.service $out/etc/dbus-1/system-services/.
 
     mkdir -p $out/usr/share/pam-configs/chaps
     mkdir -p $out/usr/share/man/man8
-    cp ${name}/man/* $out/usr/share/man/man8/.
+    cp ${pname}-${version}/man/* $out/usr/share/man/man8/.
     '';
 
   meta = with lib; {
diff --git a/pkgs/tools/security/dirmngr/default.nix b/pkgs/tools/security/dirmngr/default.nix
index cab059ca33ea..3e45759c51d2 100644
--- a/pkgs/tools/security/dirmngr/default.nix
+++ b/pkgs/tools/security/dirmngr/default.nix
@@ -2,9 +2,10 @@
 , libiconv}:
 
 stdenv.mkDerivation rec {
-  name = "dirmngr-1.1.1";
+  pname = "dirmngr";
+  version = "1.1.1";
   src = fetchurl {
-    url = "mirror://gnupg/dirmngr/${name}.tar.bz2";
+    url = "mirror://gnupg/dirmngr/dirmngr-${version}.tar.bz2";
     sha256 = "1zz6m87ca55nq5f59hzm6qs48d37h93il881y7d0rf2d6660na6j";
   };
   buildInputs = [ libgpgerror libgcrypt libassuan libksba
diff --git a/pkgs/tools/security/hologram/default.nix b/pkgs/tools/security/hologram/default.nix
index ca4666d9f07f..c4e90bd94bb2 100644
--- a/pkgs/tools/security/hologram/default.nix
+++ b/pkgs/tools/security/hologram/default.nix
@@ -1,7 +1,8 @@
 { lib, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
-  name = "hologram-2018-03-19";
+  pname = "hologram";
+  version = "2018-03-19";
   rev = "a7bab58642b530edb75b9cf6c1d834c85822ceac";
 
   src = fetchFromGitHub {
diff --git a/pkgs/tools/security/mbox/default.nix b/pkgs/tools/security/mbox/default.nix
index dd73e1624c7d..d7a303a3672f 100644
--- a/pkgs/tools/security/mbox/default.nix
+++ b/pkgs/tools/security/mbox/default.nix
@@ -1,7 +1,8 @@
 { lib, stdenv, fetchFromGitHub, openssl, which }:
 
 stdenv.mkDerivation {
-  name = "mbox-20140526";
+  pname = "mbox";
+  version = "20140526";
 
   src = fetchFromGitHub {
     owner = "tsgates";
diff --git a/pkgs/tools/security/meo/default.nix b/pkgs/tools/security/meo/default.nix
index 05aa8323cc91..4b96f2b42c23 100644
--- a/pkgs/tools/security/meo/default.nix
+++ b/pkgs/tools/security/meo/default.nix
@@ -1,7 +1,8 @@
 { lib, stdenv, fetchhg, openssl, pcre-cpp, qt4, boost, pkcs11helper }:
 
 stdenv.mkDerivation {
-  name = "meo-20121113";
+  pname = "meo";
+  version = "20121113";
 
   src = fetchhg {
     url = "http://oss.stamfest.net/hg/meo";
diff --git a/pkgs/tools/security/mkrand/default.nix b/pkgs/tools/security/mkrand/default.nix
index 59b48f1881d2..21c9586cd6c3 100644
--- a/pkgs/tools/security/mkrand/default.nix
+++ b/pkgs/tools/security/mkrand/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl }:
 
-stdenv.mkDerivation {
-  name = "mkrand-0.1.0";
+stdenv.mkDerivation rec {
+  pname = "mkrand";
+  version = "0.1.0";
 
   src = fetchurl {
-    url = "https://github.com/mknight-tag/MKRAND/releases/download/v0.1.0/mkrand-0.1.0.tar.gz";
+    url = "https://github.com/mknight-tag/MKRAND/releases/download/v${version}/mkrand-${version}.tar.gz";
     sha256 = "1irwyv2j5c3606k3qbq77yrd65y27rcq3jdlp295rz875q8iq9fs";
   };
 
diff --git a/pkgs/tools/security/mktemp/default.nix b/pkgs/tools/security/mktemp/default.nix
index dc3f2a8904bc..02be5103cbf6 100644
--- a/pkgs/tools/security/mktemp/default.nix
+++ b/pkgs/tools/security/mktemp/default.nix
@@ -1,7 +1,8 @@
 { lib, stdenv, fetchurl, groff }:
 
-stdenv.mkDerivation {
-  name = "mktemp-1.7";
+stdenv.mkDerivation rec {
+  pname = "mktemp";
+  version = "1.7";
 
   # Have `configure' avoid `/usr/bin/nroff' in non-chroot builds.
   NROFF = "${groff}/bin/nroff";
@@ -12,7 +13,7 @@ stdenv.mkDerivation {
   '';
 
   src = fetchurl {
-    url = "ftp://ftp.mktemp.org/pub/mktemp/mktemp-1.7.tar.gz";
+    url = "ftp://ftp.mktemp.org/pub/mktemp/mktemp-${version}.tar.gz";
     sha256 = "0x969152znxxjbj7387xb38waslr4yv6bnj5jmhb4rpqxphvk54f";
   };
 
diff --git a/pkgs/tools/security/munge/default.nix b/pkgs/tools/security/munge/default.nix
index 0462db8859c9..01e208958a50 100644
--- a/pkgs/tools/security/munge/default.nix
+++ b/pkgs/tools/security/munge/default.nix
@@ -1,12 +1,13 @@
 { lib, stdenv, fetchFromGitHub, autoreconfHook, gawk, gnused, libgcrypt, zlib, bzip2 }:
 
 stdenv.mkDerivation rec {
-  name = "munge-0.5.14";
+  pname = "munge";
+  version = "0.5.14";
 
   src = fetchFromGitHub {
     owner = "dun";
     repo = "munge";
-    rev = name;
+    rev = "${pname}-${version}";
     sha256 = "15h805rwcb9f89dyrkxfclzs41n3ff8x7cc1dbvs8mb0ds682c4j";
   };
 
diff --git a/pkgs/tools/security/pamtester/default.nix b/pkgs/tools/security/pamtester/default.nix
index 1944e5187d21..face92a00af3 100644
--- a/pkgs/tools/security/pamtester/default.nix
+++ b/pkgs/tools/security/pamtester/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, pam }:
 
 stdenv.mkDerivation rec {
-  name = "pamtester-0.1.2";
+  pname = "pamtester";
+  version = "0.1.2";
 
   src = fetchurl {
-    url = "mirror://sourceforge/pamtester/${name}.tar.gz";
+    url = "mirror://sourceforge/pamtester/pamtester-${version}.tar.gz";
     sha256 = "1mdj1wj0adcnx354fs17928yn2xfr1hj5mfraq282dagi873sqw3";
   };
 
diff --git a/pkgs/tools/security/pwgen/default.nix b/pkgs/tools/security/pwgen/default.nix
index c84b9472e96f..fc410f19843b 100644
--- a/pkgs/tools/security/pwgen/default.nix
+++ b/pkgs/tools/security/pwgen/default.nix
@@ -1,9 +1,10 @@
 {lib, stdenv, fetchurl, autoreconfHook}:
-stdenv.mkDerivation {
-  name = "pwgen-2.08";
+stdenv.mkDerivation rec {
+  pname = "pwgen";
+  version = "2.08";
 
   src = fetchurl {
-    url = "https://github.com/tytso/pwgen/archive/v2.08.tar.gz";
+    url = "https://github.com/tytso/pwgen/archive/v${version}.tar.gz";
     sha256 = "8d6e94f28655e61d6126290e3eafad4d17d7fba0d0d354239522a740a270bb2f";
   };
 
diff --git a/pkgs/tools/security/super/default.nix b/pkgs/tools/security/super/default.nix
index f8e78c66979f..d87580975f19 100644
--- a/pkgs/tools/security/super/default.nix
+++ b/pkgs/tools/security/super/default.nix
@@ -1,11 +1,12 @@
 { lib, stdenv, fetchurl, fetchpatch }:
 
 stdenv.mkDerivation rec {
-  name = "super-3.30.0";
+  pname = "super";
+  version = "3.30.0";
 
   src = fetchurl {
-    name = "${name}.tar.gz";
-    url = "https://www.ucolick.org/~will/RUE/super/${name}-tar.gz";
+    name = "super-${version}.tar.gz";
+    url = "https://www.ucolick.org/~will/RUE/super/super-${version}-tar.gz";
     sha256 = "0k476f83w7f45y9jpyxwr00ikv1vhjiq0c26fgjch9hnv18icvwy";
   };
 
diff --git a/pkgs/tools/system/acct/default.nix b/pkgs/tools/system/acct/default.nix
index fbe396f1fdf4..9a363eb8706e 100644
--- a/pkgs/tools/system/acct/default.nix
+++ b/pkgs/tools/system/acct/default.nix
@@ -1,10 +1,11 @@
 { fetchurl, lib, stdenv }:
 
 stdenv.mkDerivation rec {
-  name = "acct-6.6.4";
+  pname = "acct";
+  version = "6.6.4";
 
   src = fetchurl {
-    url = "mirror://gnu/acct/${name}.tar.gz";
+    url = "mirror://gnu/acct/acct-${version}.tar.gz";
     sha256 = "0gv6m8giazshvgpvwbng98chpas09myyfw1zr2y7hqxib0mvy5ac";
   };
 
diff --git a/pkgs/tools/system/actkbd/default.nix b/pkgs/tools/system/actkbd/default.nix
index ac2fb338d3d2..61be7e5a4a92 100644
--- a/pkgs/tools/system/actkbd/default.nix
+++ b/pkgs/tools/system/actkbd/default.nix
@@ -1,10 +1,11 @@
 { fetchurl, lib, stdenv }:
 
 stdenv.mkDerivation rec {
-  name = "actkbd-0.2.8";
+  pname = "actkbd";
+  version = "0.2.8";
 
   src = fetchurl {
-    url = "http://users.softlab.ece.ntua.gr/~thkala/projects/actkbd/files/${name}.tar.bz2";
+    url = "http://users.softlab.ece.ntua.gr/~thkala/projects/actkbd/files/actkbd-${version}.tar.bz2";
     sha256 = "1ipb7k5q7k7p54is96ij2n74jfa6xc0llb9lpjwxhsqviqxn9slm";
   };
 
diff --git a/pkgs/tools/system/bar/default.nix b/pkgs/tools/system/bar/default.nix
index 79bb3f79a998..ddea8881ca70 100644
--- a/pkgs/tools/system/bar/default.nix
+++ b/pkgs/tools/system/bar/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl }:
 
-stdenv.mkDerivation {
-  name = "bar-1.11.1";
+stdenv.mkDerivation rec {
+  pname = "bar";
+  version = "1.11.1";
 
   src = fetchurl {
-    url = "mirror://sourceforge/project/clpbar/clpbar/bar-1.11.1/bar_1.11.1.tar.gz";
+    url = "mirror://sourceforge/project/clpbar/clpbar/bar-${version}/bar_${version}.tar.gz";
     sha256 = "00v5cb6vzizyyhflgr62d3k8dqc0rg6wdgfyyk11c0s0r32mw3zs";
   };
 
diff --git a/pkgs/tools/system/cron/default.nix b/pkgs/tools/system/cron/default.nix
index d1b8d2d6afd9..8f8421781e36 100644
--- a/pkgs/tools/system/cron/default.nix
+++ b/pkgs/tools/system/cron/default.nix
@@ -1,9 +1,11 @@
 {lib, stdenv, fetchurl, vim, sendmailPath ? "/usr/sbin/sendmail"}:
 
-stdenv.mkDerivation {
-  name = "cron-4.1";
+stdenv.mkDerivation rec {
+  pname = "cron";
+  version = "4.1";
+
   src = fetchurl {
-    url = "ftp://ftp.isc.org/isc/cron/cron_4.1.shar";
+    url = "ftp://ftp.isc.org/isc/cron/cron_${version}.shar";
     sha256 = "16n3dras4b1jh7g958nz1k54pl9pg5fwb3fvjln8z67varvq6if4";
   };
 
diff --git a/pkgs/tools/system/dcfldd/default.nix b/pkgs/tools/system/dcfldd/default.nix
index e5d5026e6290..7dc6e1fc1237 100644
--- a/pkgs/tools/system/dcfldd/default.nix
+++ b/pkgs/tools/system/dcfldd/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "dcfldd-1.3.4-1";
+  pname = "dcfldd";
+  version = "1.3.4-1";
 
   src = fetchurl {
-    url = "mirror://sourceforge/dcfldd/${name}.tar.gz";
+    url = "mirror://sourceforge/dcfldd/dcfldd-${version}.tar.gz";
     sha256 = "1y6mwsvm75f5jzxsjjk0yhf8xnpmz6y8qvcxfandavx59lc3l57m";
   };
 
diff --git a/pkgs/tools/system/ddrescue/default.nix b/pkgs/tools/system/ddrescue/default.nix
index 7e96a4c01f7c..6191947ac32f 100644
--- a/pkgs/tools/system/ddrescue/default.nix
+++ b/pkgs/tools/system/ddrescue/default.nix
@@ -3,10 +3,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "ddrescue-1.25";
+  pname = "ddrescue";
+  version = "1.25";
 
   src = fetchurl {
-    url = "mirror://gnu/ddrescue/${name}.tar.lz";
+    url = "mirror://gnu/ddrescue/ddrescue-${version}.tar.lz";
     sha256 = "0qqh38izl5ppap9a5izf3hijh94k65s3zbfkczd4b7x04syqwlyf";
   };
 
diff --git a/pkgs/tools/system/ddrescueview/default.nix b/pkgs/tools/system/ddrescueview/default.nix
index 6c8e9c56cdc9..41b28e6fca0d 100644
--- a/pkgs/tools/system/ddrescueview/default.nix
+++ b/pkgs/tools/system/ddrescueview/default.nix
@@ -6,7 +6,6 @@ let
 in stdenv.mkDerivation rec {
   pname = "ddrescueview";
   version = "${versionBase}${versionSuffix}";
-  name = "ddrescueview-0.4alpha4";
 
   src = fetchurl {
     name = "ddrescueview-${versionBase}${versionSuffix}.tar.xz";
diff --git a/pkgs/tools/system/dog/default.nix b/pkgs/tools/system/dog/default.nix
index 94a6b34ff53e..4073034a9b92 100644
--- a/pkgs/tools/system/dog/default.nix
+++ b/pkgs/tools/system/dog/default.nix
@@ -1,10 +1,11 @@
 {lib, stdenv, fetchurl}:
 
-stdenv.mkDerivation {
-  name = "dog-1.7";
+stdenv.mkDerivation rec {
+  pname = "dog";
+  version = "1.7";
 
   src = fetchurl {
-    url = "http://archive.debian.org/debian/pool/main/d/dog/dog_1.7.orig.tar.gz";
+    url = "http://archive.debian.org/debian/pool/main/d/dog/dog_${version}.orig.tar.gz";
     sha256 = "3ef25907ec5d1dfb0df94c9388c020b593fbe162d7aaa9bd08f35d2a125af056";
   };
 
diff --git a/pkgs/tools/system/fdisk/default.nix b/pkgs/tools/system/fdisk/default.nix
index 4ad654783dfc..e12fedd6eec9 100644
--- a/pkgs/tools/system/fdisk/default.nix
+++ b/pkgs/tools/system/fdisk/default.nix
@@ -1,10 +1,11 @@
 { fetchurl, lib, stdenv, parted, libuuid, gettext, guile }:
 
 stdenv.mkDerivation rec {
-  name = "gnufdisk-2.0.0a"; # .0a1 seems broken, see https://lists.gnu.org/archive/html/bug-fdisk/2012-09/msg00000.html
+  pname = "gnufdisk";
+  version = "2.0.0a"; # .0a1 seems broken, see https://lists.gnu.org/archive/html/bug-fdisk/2012-09/msg00000.html
 
   src = fetchurl {
-    url = "mirror://gnu/fdisk/${name}.tar.gz";
+    url = "mirror://gnu/fdisk/gnufdisk-${version}.tar.gz";
     sha256 = "04nd7civ561x2lwcmxhsqbprml3178jfc58fy1v7hzqg5k4nbhy3";
   };
 
diff --git a/pkgs/tools/system/gdmap/default.nix b/pkgs/tools/system/gdmap/default.nix
index d9c639ab1c41..5fc242d533b8 100644
--- a/pkgs/tools/system/gdmap/default.nix
+++ b/pkgs/tools/system/gdmap/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, gtk2, pkg-config, libxml2, intltool, gettext }:
 
 stdenv.mkDerivation rec {
-  name = "gdmap-0.8.1";
+  pname = "gdmap";
+  version = "0.8.1";
 
   src = fetchurl {
-    url = "mirror://sourceforge/gdmap/${name}.tar.gz";
+    url = "mirror://sourceforge/gdmap/gdmap-${version}.tar.gz";
     sha256 = "0nr8l88cg19zj585hczj8v73yh21k7j13xivhlzl8jdk0j0cj052";
   };
 
diff --git a/pkgs/tools/system/gt5/default.nix b/pkgs/tools/system/gt5/default.nix
index 374bcf0e3146..15b658c9916b 100644
--- a/pkgs/tools/system/gt5/default.nix
+++ b/pkgs/tools/system/gt5/default.nix
@@ -1,10 +1,11 @@
 {lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
-  name = "gt5-1.4.0";
+  pname = "gt5";
+  version = "1.4.0";
 
   src = fetchurl {
-    url = "mirror://sourceforge/gt5/${name}.tar.gz";
+    url = "mirror://sourceforge/gt5/gt5-${version}.tar.gz";
     sha256 = "0gm0gzyp4d9rxqddbaskbz5zvmlhyr4nyb5x9g7x4abyyxqjlnkq";
   };
 
diff --git a/pkgs/tools/system/idle3tools/default.nix b/pkgs/tools/system/idle3tools/default.nix
index 5e9796396a9c..f4de055a60a8 100644
--- a/pkgs/tools/system/idle3tools/default.nix
+++ b/pkgs/tools/system/idle3tools/default.nix
@@ -1,10 +1,11 @@
 {lib, stdenv, fetchurl}:
 
-stdenv.mkDerivation {
-  name = "idle3-tools-0.9.1";
+stdenv.mkDerivation rec {
+  pname = "idle3-tools";
+  version = "0.9.1";
 
   src = fetchurl {
-    url = "mirror://sourceforge/idle3-tools/idle3-tools-0.9.1.tgz";
+    url = "mirror://sourceforge/idle3-tools/idle3-tools-${version}.tgz";
     sha256 = "00ia7xq9yldxyl9gz0mr4xa568nav14p0fnv82f2rbbkg060cy4p";
   };
 
diff --git a/pkgs/tools/system/incron/default.nix b/pkgs/tools/system/incron/default.nix
index 2df4acba9b58..cc986d453569 100644
--- a/pkgs/tools/system/incron/default.nix
+++ b/pkgs/tools/system/incron/default.nix
@@ -1,11 +1,12 @@
 { lib, stdenv, fetchFromGitHub, bash }:
 
 stdenv.mkDerivation rec {
-  name = "incron-0.5.12";
+  pname = "incron";
+  version = "0.5.12";
   src = fetchFromGitHub {
     owner = "ar-";
     repo = "incron";
-    rev = name;
+    rev = "${pname}-${version}";
     sha256 = "11d5f98cjafiv9h9zzzrw2s06s2fvdg8gp64km7mdprd2xmy6dih";
   };
 
diff --git a/pkgs/tools/system/ipmitool/default.nix b/pkgs/tools/system/ipmitool/default.nix
index e7d6130ffa60..416fab94ddc9 100644
--- a/pkgs/tools/system/ipmitool/default.nix
+++ b/pkgs/tools/system/ipmitool/default.nix
@@ -1,14 +1,14 @@
 { stdenv, lib, fetchurl, openssl, fetchpatch, static ? stdenv.hostPlatform.isStatic }:
 
 let
-  pkgname = "ipmitool";
+  pname = "ipmitool";
   version = "1.8.18";
 in
 stdenv.mkDerivation {
-  name = "${pkgname}-${version}";
+  inherit pname version;
 
   src = fetchurl {
-    url = "mirror://sourceforge/${pkgname}/${pkgname}-${version}.tar.gz";
+    url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
     sha256 = "0kfh8ny35rvwxwah4yv91a05qwpx74b5slq2lhrh71wz572va93m";
   };
 
diff --git a/pkgs/tools/system/loadwatch/default.nix b/pkgs/tools/system/loadwatch/default.nix
index 80f808214bc1..722e5a9afde1 100644
--- a/pkgs/tools/system/loadwatch/default.nix
+++ b/pkgs/tools/system/loadwatch/default.nix
@@ -1,7 +1,8 @@
 { lib, stdenv, fetchgit, ... }:
 
 stdenv.mkDerivation {
-  name = "loadwatch-1.1-1-g6d2544c";
+  pname = "loadwatch";
+  version = "1.1-1-g6d2544c";
   src = fetchgit {
     url = "git://woffs.de/git/fd/loadwatch.git";
     sha256 = "1bhw5ywvhyb6snidsnllfpdi1migy73wg2gchhsfbcpm8aaz9c9b";
diff --git a/pkgs/tools/system/localtime/default.nix b/pkgs/tools/system/localtime/default.nix
index 798e3b3e8831..4c12c9eb27da 100644
--- a/pkgs/tools/system/localtime/default.nix
+++ b/pkgs/tools/system/localtime/default.nix
@@ -1,7 +1,8 @@
 { lib, fetchFromGitHub, buildGoPackage, m4 }:
 
 buildGoPackage rec {
-  name = "localtime-2017-11-07";
+  pname = "localtime";
+  version = "2017-11-07";
 
   src = fetchFromGitHub {
     owner = "Stebalien";
diff --git a/pkgs/tools/system/mcron/default.nix b/pkgs/tools/system/mcron/default.nix
index b8175b51483d..485df4231ecf 100644
--- a/pkgs/tools/system/mcron/default.nix
+++ b/pkgs/tools/system/mcron/default.nix
@@ -1,10 +1,11 @@
 { fetchurl, lib, stdenv, guile, which, ed, libtool }:
 
 stdenv.mkDerivation rec {
-  name = "mcron-1.0.6";
+  pname = "mcron";
+  version = "1.0.6";
 
   src = fetchurl {
-    url = "mirror://gnu/mcron/${name}.tar.gz";
+    url = "mirror://gnu/mcron/mcron-${version}.tar.gz";
     sha256 = "0yvrfzzdy2m7fbqkr61fw01wd9r2jpnbyabxhcsfivgxywknl0fy";
   };
 
diff --git a/pkgs/tools/system/monit/default.nix b/pkgs/tools/system/monit/default.nix
index 8a2a3406c3e8..9e176677c761 100644
--- a/pkgs/tools/system/monit/default.nix
+++ b/pkgs/tools/system/monit/default.nix
@@ -6,10 +6,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "monit-5.27.2";
+  pname = "monit";
+  version = "5.27.2";
 
   src = fetchurl {
-    url = "${meta.homepage}dist/${name}.tar.gz";
+    url = "${meta.homepage}dist/monit-${version}.tar.gz";
     sha256 = "sha256-2ICceNXcHtenujKlpVxRFIVRMsxNpIBfjTqvjPRuqkw=";
   };
 
diff --git a/pkgs/tools/system/opencl-info/default.nix b/pkgs/tools/system/opencl-info/default.nix
index d5fd86f231ab..173de5f607fe 100644
--- a/pkgs/tools/system/opencl-info/default.nix
+++ b/pkgs/tools/system/opencl-info/default.nix
@@ -1,7 +1,8 @@
 { lib, stdenv, fetchFromGitHub, opencl-clhpp, ocl-icd }:
 
 stdenv.mkDerivation {
-  name = "opencl-info-2014-02-21";
+  pname = "opencl-info";
+  version = "2014-02-21";
 
   src = fetchFromGitHub {
     owner = "marchv";
diff --git a/pkgs/tools/system/pciutils/default.nix b/pkgs/tools/system/pciutils/default.nix
index 8c017c42d7a3..95fd4f52c393 100644
--- a/pkgs/tools/system/pciutils/default.nix
+++ b/pkgs/tools/system/pciutils/default.nix
@@ -5,10 +5,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "pciutils-3.7.0"; # with release-date database
+  pname = "pciutils";
+  version = "3.7.0"; # with release-date database
 
   src = fetchurl {
-    url = "mirror://kernel/software/utils/pciutils/${name}.tar.xz";
+    url = "mirror://kernel/software/utils/pciutils/pciutils-${version}.tar.xz";
     sha256 = "1ss0rnfsx8gvqjxaji4mvbhf9xyih4cadmgadbwwv8mnx1xvjh4x";
   };
 
diff --git a/pkgs/tools/system/rowhammer-test/default.nix b/pkgs/tools/system/rowhammer-test/default.nix
index 9afb1933e17f..685697f861ff 100644
--- a/pkgs/tools/system/rowhammer-test/default.nix
+++ b/pkgs/tools/system/rowhammer-test/default.nix
@@ -1,7 +1,8 @@
 { lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation {
-  name = "rowhammer-test-20150811";
+  pname = "rowhammer-test";
+  version = "20150811";
 
   src = fetchFromGitHub {
     owner = "google";
diff --git a/pkgs/tools/system/safecopy/default.nix b/pkgs/tools/system/safecopy/default.nix
index 5533c9a57ff5..1c0bedff474e 100644
--- a/pkgs/tools/system/safecopy/default.nix
+++ b/pkgs/tools/system/safecopy/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "safecopy-1.7";
+  pname = "safecopy";
+  version = "1.7";
 
   src = fetchurl {
-    url = "mirror://sourceforge/project/safecopy/safecopy/${name}/${name}.tar.gz";
+    url = "mirror://sourceforge/project/safecopy/safecopy/safecopy-${version}/safecopy-${version}.tar.gz";
     sha256 = "1zf4kk9r8za9pn4hzy1y3j02vrhl1rxfk5adyfq0w0k48xfyvys2";
   };
 
diff --git a/pkgs/tools/system/sg3_utils/default.nix b/pkgs/tools/system/sg3_utils/default.nix
index d0084e1f4d8a..31c58bbbaafb 100644
--- a/pkgs/tools/system/sg3_utils/default.nix
+++ b/pkgs/tools/system/sg3_utils/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "sg3_utils-1.45";
+  pname = "sg3_utils";
+  version = "1.45";
 
   src = fetchurl {
-    url = "http://sg.danny.cz/sg/p/${name}.tgz";
+    url = "http://sg.danny.cz/sg/p/sg3_utils-${version}.tgz";
     sha256 = "0qasc3qm4i8swjfaywiwpgz76gdxqvm47qycxgmprbsjmxqwk1qb";
   };
 
diff --git a/pkgs/tools/text/gawk/default.nix b/pkgs/tools/text/gawk/default.nix
index b7eb00ee5944..fd746ca117e8 100644
--- a/pkgs/tools/text/gawk/default.nix
+++ b/pkgs/tools/text/gawk/default.nix
@@ -19,10 +19,11 @@ let
   inherit (lib) optional;
 in
 stdenv.mkDerivation rec {
-  name = "gawk-5.1.0";
+  pname = "gawk";
+  version = "5.1.0";
 
   src = fetchurl {
-    url = "mirror://gnu/gawk/${name}.tar.xz";
+    url = "mirror://gnu/gawk/gawk-${version}.tar.xz";
     sha256 = "1gc2cccqy1x1bf6rhwlmd8q7dz7gnam6nwgl38bxapv6qm5flpyg";
   };
 
diff --git a/pkgs/tools/text/gnupatch/default.nix b/pkgs/tools/text/gnupatch/default.nix
index 97d3136e7e72..8d8fa7d0a8ba 100644
--- a/pkgs/tools/text/gnupatch/default.nix
+++ b/pkgs/tools/text/gnupatch/default.nix
@@ -3,10 +3,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "patch-2.7.6";
+  pname = "patch";
+  version = "2.7.6";
 
   src = fetchurl {
-    url = "mirror://gnu/patch/${name}.tar.xz";
+    url = "mirror://gnu/patch/patch-${version}.tar.xz";
     sha256 = "1zfqy4rdcy279vwn2z1kbv19dcfw25d2aqy9nzvdkq5bjzd0nqdc";
   };
 
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 5af6ed97f140..32181d9c47a7 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -18243,45 +18243,27 @@ with pkgs;
     (import ../development/libraries/qt-5/5.12) {
       inherit newScope;
       inherit lib stdenv fetchurl fetchpatch fetchFromGitHub makeSetupHook makeWrapper;
-      inherit bison;
-      inherit cups;
-      inherit dconf;
-      inherit harfbuzz;
-      inherit libGL;
-      inherit perl;
-      inherit gtk3;
+      inherit bison cups dconf harfbuzz libGL perl gtk3;
       inherit (gst_all_1) gstreamer gst-plugins-base;
-      inherit llvmPackages_5;
+      inherit llvmPackages_5 darwin;
     });
 
   qt514 = recurseIntoAttrs (makeOverridable
     (import ../development/libraries/qt-5/5.14) {
       inherit newScope;
       inherit lib stdenv fetchurl fetchpatch fetchFromGitHub makeSetupHook makeWrapper;
-      inherit bison;
-      inherit cups;
-      inherit dconf;
-      inherit harfbuzz;
-      inherit libGL;
-      inherit perl;
-      inherit gtk3;
+      inherit bison cups dconf harfbuzz libGL perl gtk3;
       inherit (gst_all_1) gstreamer gst-plugins-base;
-      inherit llvmPackages_5;
+      inherit llvmPackages_5 darwin;
     });
 
   qt515 = recurseIntoAttrs (makeOverridable
     (import ../development/libraries/qt-5/5.15) {
       inherit newScope;
       inherit lib stdenv fetchurl fetchpatch fetchgit fetchFromGitHub makeSetupHook makeWrapper;
-      inherit bison;
-      inherit cups;
-      inherit dconf;
-      inherit harfbuzz;
-      inherit libGL;
-      inherit perl;
-      inherit gtk3;
+      inherit bison cups dconf harfbuzz libGL perl gtk3;
       inherit (gst_all_1) gstreamer gst-plugins-base;
-      inherit llvmPackages_5;
+      inherit llvmPackages_5 darwin;
     });
 
   libsForQt512 = recurseIntoAttrs (import ./qt5-packages.nix {