summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/audio/mpg123/default.nix4
-rw-r--r--pkgs/applications/graphics/ImageMagick/7.0.nix4
-rw-r--r--pkgs/applications/misc/gnome-usage/default.nix4
-rw-r--r--pkgs/build-support/fetchgit/default.nix2
-rw-r--r--pkgs/data/misc/cacert/default.nix5
-rw-r--r--pkgs/development/compilers/llvm/10/compiler-rt/armv7l.patch (renamed from pkgs/development/compilers/llvm/10/compiler-rt-armv7l.patch)0
-rw-r--r--pkgs/development/compilers/llvm/10/compiler-rt/codesign.patch (renamed from pkgs/development/compilers/llvm/10/compiler-rt-codesign.patch)0
-rw-r--r--pkgs/development/compilers/llvm/10/compiler-rt/default.nix (renamed from pkgs/development/compilers/llvm/10/compiler-rt.nix)4
-rw-r--r--pkgs/development/compilers/llvm/10/compiler-rt/find-darwin-sdk-version.patch (renamed from pkgs/development/compilers/llvm/10/find-darwin-sdk-version.patch)0
-rw-r--r--pkgs/development/compilers/llvm/10/compiler-rt/sanitizers-nongnu.patch (renamed from pkgs/development/compilers/llvm/10/sanitizers-nongnu.patch)0
-rw-r--r--pkgs/development/compilers/llvm/10/default.nix10
-rw-r--r--pkgs/development/compilers/llvm/10/libc++abi/default.nix (renamed from pkgs/development/compilers/llvm/10/libc++abi.nix)4
-rw-r--r--pkgs/development/compilers/llvm/10/libc++abi/no-threads.patch (renamed from pkgs/development/compilers/llvm/10/libcxxabi-no-threads.patch)0
-rw-r--r--pkgs/development/compilers/llvm/10/libc++abi/wasm.patch (renamed from pkgs/development/compilers/llvm/10/libcxxabi-wasm.patch)0
-rw-r--r--pkgs/development/compilers/llvm/10/lld/default.nix (renamed from pkgs/development/compilers/llvm/10/lld.nix)0
-rw-r--r--pkgs/development/compilers/llvm/10/lldb/default.nix (renamed from pkgs/development/compilers/llvm/10/lldb.nix)2
-rw-r--r--pkgs/development/compilers/llvm/10/lldb/procfs.patch (renamed from pkgs/development/compilers/llvm/10/lldb-procfs.patch)0
-rw-r--r--pkgs/development/compilers/llvm/10/llvm/default.nix (renamed from pkgs/development/compilers/llvm/10/llvm.nix)6
-rw-r--r--pkgs/development/compilers/llvm/10/llvm/outputs.patch (renamed from pkgs/development/compilers/llvm/10/llvm-outputs.patch)0
-rw-r--r--pkgs/development/compilers/llvm/11/compiler-rt/X86-support-extension.patch (renamed from pkgs/development/compilers/llvm/11/compiler-rt-X86-support-extension.patch)0
-rw-r--r--pkgs/development/compilers/llvm/11/compiler-rt/armv7l.patch (renamed from pkgs/development/compilers/llvm/11/compiler-rt-armv7l.patch)0
-rw-r--r--pkgs/development/compilers/llvm/11/compiler-rt/codesign.patch (renamed from pkgs/development/compilers/llvm/11/compiler-rt-codesign.patch)0
-rw-r--r--pkgs/development/compilers/llvm/11/compiler-rt/default.nix (renamed from pkgs/development/compilers/llvm/11/compiler-rt.nix)6
-rw-r--r--pkgs/development/compilers/llvm/11/compiler-rt/sanitizers-nongnu.patch (renamed from pkgs/development/compilers/llvm/11/sanitizers-nongnu.patch)0
-rw-r--r--pkgs/development/compilers/llvm/11/default.nix10
-rw-r--r--pkgs/development/compilers/llvm/11/libc++abi/default.nix (renamed from pkgs/development/compilers/llvm/11/libc++abi.nix)4
-rw-r--r--pkgs/development/compilers/llvm/11/libc++abi/no-threads.patch (renamed from pkgs/development/compilers/llvm/11/libcxxabi-no-threads.patch)0
-rw-r--r--pkgs/development/compilers/llvm/11/libc++abi/wasm.patch (renamed from pkgs/development/compilers/llvm/11/libcxxabi-wasm.patch)0
-rw-r--r--pkgs/development/compilers/llvm/11/lld/default.nix (renamed from pkgs/development/compilers/llvm/11/lld.nix)0
-rw-r--r--pkgs/development/compilers/llvm/11/lldb/default.nix (renamed from pkgs/development/compilers/llvm/11/lldb.nix)2
-rw-r--r--pkgs/development/compilers/llvm/11/lldb/procfs.patch (renamed from pkgs/development/compilers/llvm/11/lldb-procfs.patch)0
-rw-r--r--pkgs/development/compilers/llvm/11/llvm/default.nix (renamed from pkgs/development/compilers/llvm/11/llvm.nix)4
-rw-r--r--pkgs/development/compilers/llvm/11/llvm/outputs.patch (renamed from pkgs/development/compilers/llvm/11/llvm-outputs.patch)0
-rw-r--r--pkgs/development/compilers/llvm/5/compiler-rt/armv7l.patch (renamed from pkgs/development/compilers/llvm/5/compiler-rt-armv7l.patch)0
-rw-r--r--pkgs/development/compilers/llvm/5/compiler-rt/codesign.patch (renamed from pkgs/development/compilers/llvm/5/compiler-rt-codesign.patch)0
-rw-r--r--pkgs/development/compilers/llvm/5/compiler-rt/default.nix (renamed from pkgs/development/compilers/llvm/5/compiler-rt.nix)9
-rw-r--r--pkgs/development/compilers/llvm/5/compiler-rt/sanitizers-nongnu.patch (renamed from pkgs/development/compilers/llvm/5/sanitizers-nongnu.patch)0
-rw-r--r--pkgs/development/compilers/llvm/5/compiler-rt/sys-ustat.patch (renamed from pkgs/development/compilers/llvm/5/compiler-rt-sys-ustat.patch)0
-rw-r--r--pkgs/development/compilers/llvm/5/default.nix10
-rw-r--r--pkgs/development/compilers/llvm/5/libc++abi/default.nix (renamed from pkgs/development/compilers/llvm/5/libc++abi.nix)0
-rw-r--r--pkgs/development/compilers/llvm/5/lld/default.nix (renamed from pkgs/development/compilers/llvm/5/lld.nix)0
-rw-r--r--pkgs/development/compilers/llvm/5/lldb/default.nix (renamed from pkgs/development/compilers/llvm/5/lldb.nix)0
-rw-r--r--pkgs/development/compilers/llvm/5/llvm/default.nix (renamed from pkgs/development/compilers/llvm/5/llvm.nix)34
-rw-r--r--pkgs/development/compilers/llvm/5/llvm/fix-gcc9.patch (renamed from pkgs/development/compilers/llvm/5/fix-gcc9.patch)0
-rw-r--r--pkgs/development/compilers/llvm/5/llvm/outputs.patch (renamed from pkgs/development/compilers/llvm/5/llvm-outputs.patch)0
-rw-r--r--pkgs/development/compilers/llvm/6/compiler-rt/armv7l.patch (renamed from pkgs/development/compilers/llvm/6/compiler-rt-armv7l.patch)0
-rw-r--r--pkgs/development/compilers/llvm/6/compiler-rt/codesign.patch (renamed from pkgs/development/compilers/llvm/6/compiler-rt-codesign.patch)0
-rw-r--r--pkgs/development/compilers/llvm/6/compiler-rt/default.nix (renamed from pkgs/development/compilers/llvm/6/compiler-rt.nix)7
-rw-r--r--pkgs/development/compilers/llvm/6/compiler-rt/sanitizers-nongnu.patch (renamed from pkgs/development/compilers/llvm/6/sanitizers-nongnu.patch)0
-rw-r--r--pkgs/development/compilers/llvm/6/default.nix10
-rw-r--r--pkgs/development/compilers/llvm/6/libc++abi/default.nix (renamed from pkgs/development/compilers/llvm/6/libc++abi.nix)0
-rw-r--r--pkgs/development/compilers/llvm/6/lld/default.nix (renamed from pkgs/development/compilers/llvm/6/lld.nix)0
-rw-r--r--pkgs/development/compilers/llvm/6/lldb/default.nix (renamed from pkgs/development/compilers/llvm/6/lldb.nix)0
-rw-r--r--pkgs/development/compilers/llvm/6/llvm/default.nix (renamed from pkgs/development/compilers/llvm/6/llvm.nix)6
-rw-r--r--pkgs/development/compilers/llvm/6/llvm/outputs.patch (renamed from pkgs/development/compilers/llvm/6/llvm-outputs.patch)0
-rw-r--r--pkgs/development/compilers/llvm/7/compiler-rt/armv7l.patch (renamed from pkgs/development/compilers/llvm/7/compiler-rt-armv7l.patch)0
-rw-r--r--pkgs/development/compilers/llvm/7/compiler-rt/codesign.patch (renamed from pkgs/development/compilers/llvm/7/compiler-rt-codesign.patch)0
-rw-r--r--pkgs/development/compilers/llvm/7/compiler-rt/crtbegin-and-end.patch (renamed from pkgs/development/compilers/llvm/7/crtbegin-and-end.patch)0
-rw-r--r--pkgs/development/compilers/llvm/7/compiler-rt/default.nix (renamed from pkgs/development/compilers/llvm/7/compiler-rt.nix)7
-rw-r--r--pkgs/development/compilers/llvm/7/compiler-rt/sanitizers-nongnu.patch (renamed from pkgs/development/compilers/llvm/7/sanitizers-nongnu.patch)0
-rw-r--r--pkgs/development/compilers/llvm/7/default.nix13
-rw-r--r--pkgs/development/compilers/llvm/7/libc++abi/default.nix (renamed from pkgs/development/compilers/llvm/7/libc++abi.nix)0
-rw-r--r--pkgs/development/compilers/llvm/7/lld/default.nix (renamed from pkgs/development/compilers/llvm/7/lld.nix)0
-rw-r--r--pkgs/development/compilers/llvm/7/lldb/default.nix (renamed from pkgs/development/compilers/llvm/7/lldb.nix)0
-rw-r--r--pkgs/development/compilers/llvm/7/llvm/default.nix (renamed from pkgs/development/compilers/llvm/7/llvm.nix)6
-rw-r--r--pkgs/development/compilers/llvm/7/llvm/outputs.patch (renamed from pkgs/development/compilers/llvm/7/llvm-outputs.patch)0
-rw-r--r--pkgs/development/compilers/llvm/8/compiler-rt/armv7l.patch (renamed from pkgs/development/compilers/llvm/8/compiler-rt-armv7l.patch)0
-rw-r--r--pkgs/development/compilers/llvm/8/compiler-rt/codesign.patch (renamed from pkgs/development/compilers/llvm/8/compiler-rt-codesign.patch)0
-rw-r--r--pkgs/development/compilers/llvm/8/compiler-rt/crtbegin-and-end.patch (renamed from pkgs/development/compilers/llvm/8/crtbegin-and-end.patch)0
-rw-r--r--pkgs/development/compilers/llvm/8/compiler-rt/default.nix (renamed from pkgs/development/compilers/llvm/8/compiler-rt.nix)7
-rw-r--r--pkgs/development/compilers/llvm/8/compiler-rt/sanitizers-nongnu.patch (renamed from pkgs/development/compilers/llvm/8/sanitizers-nongnu.patch)0
-rw-r--r--pkgs/development/compilers/llvm/8/default.nix13
-rw-r--r--pkgs/development/compilers/llvm/8/libc++abi/default.nix (renamed from pkgs/development/compilers/llvm/8/libc++abi.nix)4
-rw-r--r--pkgs/development/compilers/llvm/8/libc++abi/no-threads.patch (renamed from pkgs/development/compilers/llvm/8/libcxxabi-no-threads.patch)0
-rw-r--r--pkgs/development/compilers/llvm/8/libc++abi/wasm.patch (renamed from pkgs/development/compilers/llvm/8/libcxxabi-wasm.patch)0
-rw-r--r--pkgs/development/compilers/llvm/8/lld/default.nix (renamed from pkgs/development/compilers/llvm/8/lld.nix)0
-rw-r--r--pkgs/development/compilers/llvm/8/lldb/default.nix (renamed from pkgs/development/compilers/llvm/8/lldb.nix)0
-rw-r--r--pkgs/development/compilers/llvm/8/llvm/default.nix (renamed from pkgs/development/compilers/llvm/8/llvm.nix)6
-rw-r--r--pkgs/development/compilers/llvm/8/llvm/outputs.patch (renamed from pkgs/development/compilers/llvm/8/llvm-outputs.patch)0
-rw-r--r--pkgs/development/compilers/llvm/9/compiler-rt/armv7l.patch (renamed from pkgs/development/compilers/llvm/9/compiler-rt-armv7l.patch)0
-rw-r--r--pkgs/development/compilers/llvm/9/compiler-rt/codesign.patch (renamed from pkgs/development/compilers/llvm/9/compiler-rt-codesign.patch)0
-rw-r--r--pkgs/development/compilers/llvm/9/compiler-rt/default.nix (renamed from pkgs/development/compilers/llvm/9/compiler-rt.nix)7
-rw-r--r--pkgs/development/compilers/llvm/9/compiler-rt/sanitizers-nongnu.patch (renamed from pkgs/development/compilers/llvm/9/sanitizers-nongnu.patch)0
-rw-r--r--pkgs/development/compilers/llvm/9/default.nix13
-rw-r--r--pkgs/development/compilers/llvm/9/libc++abi/default.nix (renamed from pkgs/development/compilers/llvm/9/libc++abi.nix)4
-rw-r--r--pkgs/development/compilers/llvm/9/libc++abi/no-threads.patch (renamed from pkgs/development/compilers/llvm/9/libcxxabi-no-threads.patch)0
-rw-r--r--pkgs/development/compilers/llvm/9/libc++abi/wasm.patch (renamed from pkgs/development/compilers/llvm/9/libcxxabi-wasm.patch)0
-rw-r--r--pkgs/development/compilers/llvm/9/lld/default.nix (renamed from pkgs/development/compilers/llvm/9/lld.nix)0
-rw-r--r--pkgs/development/compilers/llvm/9/lldb/default.nix (renamed from pkgs/development/compilers/llvm/9/lldb.nix)2
-rw-r--r--pkgs/development/compilers/llvm/9/lldb/procfs.patch (renamed from pkgs/development/compilers/llvm/9/lldb-procfs.patch)0
-rw-r--r--pkgs/development/compilers/llvm/9/llvm/default.nix (renamed from pkgs/development/compilers/llvm/9/llvm.nix)6
-rw-r--r--pkgs/development/compilers/llvm/9/llvm/fix-test-on-non-x86-like-others.patch (renamed from pkgs/development/compilers/llvm/9/fix-test-on-non-x86-like-others.patch)0
-rw-r--r--pkgs/development/compilers/llvm/9/llvm/outputs.patch (renamed from pkgs/development/compilers/llvm/9/llvm-outputs.patch)0
-rw-r--r--pkgs/development/compilers/llvm/common/compiler-rt/glibc.patch (renamed from pkgs/development/compilers/llvm/7/compiler-rt-glibc.patch)0
-rw-r--r--pkgs/development/compilers/llvm/rocm/default.nix4
-rw-r--r--pkgs/development/compilers/llvm/rocm/lld/default.nix (renamed from pkgs/development/compilers/llvm/rocm/lld.nix)0
-rw-r--r--pkgs/development/compilers/llvm/rocm/llvm/default.nix (renamed from pkgs/development/compilers/llvm/rocm/llvm.nix)4
-rw-r--r--pkgs/development/compilers/llvm/rocm/llvm/outputs.patch (renamed from pkgs/development/compilers/llvm/rocm/llvm-outputs.patch)0
-rw-r--r--pkgs/development/compilers/ocaml/4.10.nix4
-rw-r--r--pkgs/development/interpreters/python/hooks/setuptools-build-hook.sh7
-rw-r--r--pkgs/development/libraries/fontconfig/default.nix3
-rw-r--r--pkgs/development/libraries/libaom/default.nix4
-rw-r--r--pkgs/development/libraries/libassuan/default.nix4
-rw-r--r--pkgs/development/libraries/libva/default.nix4
-rw-r--r--pkgs/development/libraries/libva/utils.nix4
-rw-r--r--pkgs/development/libraries/mesa/default.nix16
-rw-r--r--pkgs/development/libraries/nspr/default.nix4
-rw-r--r--pkgs/development/libraries/nss/default.nix4
-rw-r--r--pkgs/development/libraries/science/math/blis/default.nix4
-rw-r--r--pkgs/development/libraries/science/math/openblas/default.nix12
-rw-r--r--pkgs/development/python-modules/bootstrapped-pip/2.nix67
-rw-r--r--pkgs/development/python-modules/bootstrapped-pip/default.nix1
-rw-r--r--pkgs/development/python-modules/django/2.nix4
-rw-r--r--pkgs/development/python-modules/packaging/default.nix4
-rw-r--r--pkgs/development/python-modules/pip/20.nix44
-rw-r--r--pkgs/development/python-modules/pip/default.nix4
-rw-r--r--pkgs/development/python-modules/setuptools-rust/default.nix8
-rw-r--r--pkgs/development/python-modules/setuptools-rust/pyo3-test/default.nix6
-rw-r--r--pkgs/development/python-modules/setuptools/default.nix11
-rw-r--r--pkgs/development/tools/build-managers/cmake/default.nix4
-rw-r--r--pkgs/development/tools/misc/binutils/CVE-2020-35448.patch77
-rw-r--r--pkgs/development/tools/misc/binutils/default.nix1
-rw-r--r--pkgs/development/tools/misc/elfutils/default.nix6
-rw-r--r--pkgs/development/tools/ocaml/findlib/default.nix4
-rw-r--r--pkgs/development/tools/rust/maturin/pyo3-test/default.nix4
-rw-r--r--pkgs/development/tools/rust/maturin/pyo3-test/generic.nix10
-rw-r--r--pkgs/servers/x11/xorg/default.nix6
-rw-r--r--pkgs/servers/x11/xorg/tarballs.list2
-rw-r--r--pkgs/tools/backup/dar/default.nix4
-rw-r--r--pkgs/tools/filesystems/e2fsprogs/default.nix13
-rw-r--r--pkgs/tools/filesystems/ntfs-3g/default.nix22
-rw-r--r--pkgs/tools/misc/hdf5/default.nix6
-rw-r--r--pkgs/tools/networking/networkmanager/default.nix4
-rw-r--r--pkgs/tools/virtualization/govc/default.nix4
-rw-r--r--pkgs/top-level/all-packages.nix8
-rw-r--r--pkgs/top-level/python-packages.nix10
136 files changed, 448 insertions, 199 deletions
diff --git a/pkgs/applications/audio/mpg123/default.nix b/pkgs/applications/audio/mpg123/default.nix
index 5c7eb6b88cf..a3e5b3e50eb 100644
--- a/pkgs/applications/audio/mpg123/default.nix
+++ b/pkgs/applications/audio/mpg123/default.nix
@@ -7,11 +7,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "mpg123-1.26.4";
+  name = "mpg123-1.26.5";
 
   src = fetchurl {
     url = "mirror://sourceforge/mpg123/${name}.tar.bz2";
-    sha256 = "sha256-CBmRVA33pmaykEmthw8pPPoohjs2SIq01Yzqp7WEZFQ=";
+    sha256 = "sha256-UCqX4Nk1vn432YczgCHY8wG641wohPKoPVnEtSRm7wY=";
   };
 
   outputs = [ "out" "conplay" ];
diff --git a/pkgs/applications/graphics/ImageMagick/7.0.nix b/pkgs/applications/graphics/ImageMagick/7.0.nix
index 49021f5e3c3..29da4547250 100644
--- a/pkgs/applications/graphics/ImageMagick/7.0.nix
+++ b/pkgs/applications/graphics/ImageMagick/7.0.nix
@@ -14,8 +14,8 @@ let
     else throw "ImageMagick is not supported on this platform.";
 
   cfg = {
-    version = "7.0.11-3";
-    sha256 = "sha256-y937OxAHNTbWa96oQmTpp/ivxtPVL16hr4SvzZWugQo=";
+    version = "7.0.11-4";
+    sha256 = "sha256-Dwlt3EdDoRkJKm1gepDC+0QdKEkMVsacZQ7khnxmWto=";
     patches = [];
   };
 in
diff --git a/pkgs/applications/misc/gnome-usage/default.nix b/pkgs/applications/misc/gnome-usage/default.nix
index fee4ba655c3..bbd272754cd 100644
--- a/pkgs/applications/misc/gnome-usage/default.nix
+++ b/pkgs/applications/misc/gnome-usage/default.nix
@@ -19,11 +19,11 @@
 
 stdenv.mkDerivation rec {
   pname = "gnome-usage";
-  version = "3.38.0";
+  version = "3.38.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0mqs39yi2cqwkzlmmgzrszsva5hbdpws6zk4lbi4w2cjzl185mcl";
+    sha256 = "mMdm4X4VZXEfx0uaJP0u0NX618y0VRlhLdTiFHaO05M=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/build-support/fetchgit/default.nix b/pkgs/build-support/fetchgit/default.nix
index df97ef1492d..3222866dc78 100644
--- a/pkgs/build-support/fetchgit/default.nix
+++ b/pkgs/build-support/fetchgit/default.nix
@@ -3,7 +3,7 @@
     inherit (lib) removeSuffix splitString last;
     base = last (splitString ":" (baseNameOf (removeSuffix "/" url)));
 
-    matched = builtins.match "(.*).git" base;
+    matched = builtins.match "(.*)\\.git" base;
 
     short = builtins.substring 0 7 rev;
 
diff --git a/pkgs/data/misc/cacert/default.nix b/pkgs/data/misc/cacert/default.nix
index fec2dfa9001..ab9d2e84029 100644
--- a/pkgs/data/misc/cacert/default.nix
+++ b/pkgs/data/misc/cacert/default.nix
@@ -10,7 +10,8 @@
 with lib;
 
 let
-  version = "3.60";
+  version = "3.63";
+
   underscoreVersion = builtins.replaceStrings ["."] ["_"] version;
 in
 
@@ -19,7 +20,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "mirror://mozilla/security/nss/releases/NSS_${underscoreVersion}_RTM/src/nss-${version}.tar.gz";
-    sha256 = "hKvVV1q4dMU65RG9Rh5dCGjRobOE7kB1MVTN0dWQ/j0=";
+    sha256 = "0892xbjcaw6g4rd2rs4qa37nbda248cjrgxa4faaw0licbpjyb8q";
   };
 
   certdata2pem = fetchurl {
diff --git a/pkgs/development/compilers/llvm/10/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/10/compiler-rt/armv7l.patch
index 120cfe6feb2..120cfe6feb2 100644
--- a/pkgs/development/compilers/llvm/10/compiler-rt-armv7l.patch
+++ b/pkgs/development/compilers/llvm/10/compiler-rt/armv7l.patch
diff --git a/pkgs/development/compilers/llvm/10/compiler-rt-codesign.patch b/pkgs/development/compilers/llvm/10/compiler-rt/codesign.patch
index 3cc12b94b20..3cc12b94b20 100644
--- a/pkgs/development/compilers/llvm/10/compiler-rt-codesign.patch
+++ b/pkgs/development/compilers/llvm/10/compiler-rt/codesign.patch
diff --git a/pkgs/development/compilers/llvm/10/compiler-rt.nix b/pkgs/development/compilers/llvm/10/compiler-rt/default.nix
index 64d57e3e811..1d759c903fc 100644
--- a/pkgs/development/compilers/llvm/10/compiler-rt.nix
+++ b/pkgs/development/compilers/llvm/10/compiler-rt/default.nix
@@ -52,10 +52,10 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   patches = [
-    ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
+    ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory
     ./find-darwin-sdk-version.patch # don't test for macOS being >= 10.15
   ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
-    ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
+    ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch;
 
 
   # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
diff --git a/pkgs/development/compilers/llvm/10/find-darwin-sdk-version.patch b/pkgs/development/compilers/llvm/10/compiler-rt/find-darwin-sdk-version.patch
index fc16ddda76b..fc16ddda76b 100644
--- a/pkgs/development/compilers/llvm/10/find-darwin-sdk-version.patch
+++ b/pkgs/development/compilers/llvm/10/compiler-rt/find-darwin-sdk-version.patch
diff --git a/pkgs/development/compilers/llvm/10/sanitizers-nongnu.patch b/pkgs/development/compilers/llvm/10/compiler-rt/sanitizers-nongnu.patch
index 1f2ac97818e..1f2ac97818e 100644
--- a/pkgs/development/compilers/llvm/10/sanitizers-nongnu.patch
+++ b/pkgs/development/compilers/llvm/10/compiler-rt/sanitizers-nongnu.patch
diff --git a/pkgs/development/compilers/llvm/10/default.nix b/pkgs/development/compilers/llvm/10/default.nix
index 978f2895666..9663c512d86 100644
--- a/pkgs/development/compilers/llvm/10/default.nix
+++ b/pkgs/development/compilers/llvm/10/default.nix
@@ -29,7 +29,7 @@ let
     '';
   in {
 
-    llvm = callPackage ./llvm.nix { };
+    llvm = callPackage ./llvm { };
 
     clang-unwrapped = callPackage ./clang {
       inherit (tools) lld;
@@ -77,9 +77,9 @@ let
       extraBuildCommands = mkExtraBuildCommands cc;
     };
 
-    lld = callPackage ./lld.nix {};
+    lld = callPackage ./lld {};
 
-    lldb = callPackage ./lldb.nix {};
+    lldb = callPackage ./lldb {};
 
     # Below, is the LLVM bootstrapping logic. It handles building a
     # fully LLVM toolchain from scratch. No GCC toolchain should be
@@ -163,7 +163,7 @@ let
     callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
   in {
 
-    compiler-rt = callPackage ./compiler-rt.nix ({} //
+    compiler-rt = callPackage ./compiler-rt ({} //
       (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt;
       }));
@@ -177,7 +177,7 @@ let
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
       }));
 
-    libcxxabi = callPackage ./libc++abi.nix ({} //
+    libcxxabi = callPackage ./libc++abi ({} //
       (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
         libunwind = libraries.libunwind;
diff --git a/pkgs/development/compilers/llvm/10/libc++abi.nix b/pkgs/development/compilers/llvm/10/libc++abi/default.nix
index 61f778fbc55..7541cee1a54 100644
--- a/pkgs/development/compilers/llvm/10/libc++abi.nix
+++ b/pkgs/development/compilers/llvm/10/libc++abi/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
     "-DLIBCXXABI_ENABLE_SHARED=OFF"
   ];
 
-  patches = [ ./libcxxabi-no-threads.patch ];
+  patches = [ ./no-threads.patch ];
 
   postUnpack = ''
     unpackFile ${libcxx.src}
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
   '' + lib.optionalString stdenv.hostPlatform.isMusl ''
     patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
   '' + lib.optionalString stdenv.hostPlatform.isWasm ''
-    patch -p1 -d $(ls -d llvm-*) -i ${./libcxxabi-wasm.patch}
+    patch -p1 -d $(ls -d llvm-*) -i ${./wasm.patch}
   '';
 
   installPhase = if stdenv.isDarwin
diff --git a/pkgs/development/compilers/llvm/10/libcxxabi-no-threads.patch b/pkgs/development/compilers/llvm/10/libc++abi/no-threads.patch
index 787f3e16500..787f3e16500 100644
--- a/pkgs/development/compilers/llvm/10/libcxxabi-no-threads.patch
+++ b/pkgs/development/compilers/llvm/10/libc++abi/no-threads.patch
diff --git a/pkgs/development/compilers/llvm/10/libcxxabi-wasm.patch b/pkgs/development/compilers/llvm/10/libc++abi/wasm.patch
index 4ebfe46aa81..4ebfe46aa81 100644
--- a/pkgs/development/compilers/llvm/10/libcxxabi-wasm.patch
+++ b/pkgs/development/compilers/llvm/10/libc++abi/wasm.patch
diff --git a/pkgs/development/compilers/llvm/10/lld.nix b/pkgs/development/compilers/llvm/10/lld/default.nix
index a94c1b5b0dd..a94c1b5b0dd 100644
--- a/pkgs/development/compilers/llvm/10/lld.nix
+++ b/pkgs/development/compilers/llvm/10/lld/default.nix
diff --git a/pkgs/development/compilers/llvm/10/lldb.nix b/pkgs/development/compilers/llvm/10/lldb/default.nix
index e7dd48a23ce..7fb8ed57a01 100644
--- a/pkgs/development/compilers/llvm/10/lldb.nix
+++ b/pkgs/development/compilers/llvm/10/lldb/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation (rec {
 
   src = fetch pname "051p5b04y6z3g730rmc2n2v71lipbw7k69riww3a6sl74myfiaq7";
 
-  patches = [ ./lldb-procfs.patch ];
+  patches = [ ./procfs.patch ];
 
   nativeBuildInputs = [ cmake python3 which swig lit ]
     ++ lib.optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ];
diff --git a/pkgs/development/compilers/llvm/10/lldb-procfs.patch b/pkgs/development/compilers/llvm/10/lldb/procfs.patch
index b075dbaeee0..b075dbaeee0 100644
--- a/pkgs/development/compilers/llvm/10/lldb-procfs.patch
+++ b/pkgs/development/compilers/llvm/10/lldb/procfs.patch
diff --git a/pkgs/development/compilers/llvm/10/llvm.nix b/pkgs/development/compilers/llvm/10/llvm/default.nix
index e951375a833..3100eaf4db4 100644
--- a/pkgs/development/compilers/llvm/10/llvm.nix
+++ b/pkgs/development/compilers/llvm/10/llvm/default.nix
@@ -62,15 +62,15 @@ in stdenv.mkDerivation (rec {
   ''
   # Patch llvm-config to return correct library path based on --link-{shared,static}.
   + optionalString (enableSharedLibraries) ''
-    substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
-    patch -p1 < ./llvm-outputs.patch
+    substitute '${./outputs.patch}' ./outputs.patch --subst-var lib
+    patch -p1 < ./outputs.patch
   '' + ''
     # FileSystem permissions tests fail with various special bits
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "Path.cpp" ""
     rm unittests/Support/Path.cpp
   '' + optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -i ${../TLI-musl.patch}
+    patch -p1 -i ${../../TLI-musl.patch}
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "add_subdirectory(DynamicLibrary)" ""
     rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
diff --git a/pkgs/development/compilers/llvm/10/llvm-outputs.patch b/pkgs/development/compilers/llvm/10/llvm/outputs.patch
index 40096fa3497..40096fa3497 100644
--- a/pkgs/development/compilers/llvm/10/llvm-outputs.patch
+++ b/pkgs/development/compilers/llvm/10/llvm/outputs.patch
diff --git a/pkgs/development/compilers/llvm/11/compiler-rt-X86-support-extension.patch b/pkgs/development/compilers/llvm/11/compiler-rt/X86-support-extension.patch
index f6f9336ad5a..f6f9336ad5a 100644
--- a/pkgs/development/compilers/llvm/11/compiler-rt-X86-support-extension.patch
+++ b/pkgs/development/compilers/llvm/11/compiler-rt/X86-support-extension.patch
diff --git a/pkgs/development/compilers/llvm/11/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/11/compiler-rt/armv7l.patch
index 120cfe6feb2..120cfe6feb2 100644
--- a/pkgs/development/compilers/llvm/11/compiler-rt-armv7l.patch
+++ b/pkgs/development/compilers/llvm/11/compiler-rt/armv7l.patch
diff --git a/pkgs/development/compilers/llvm/11/compiler-rt-codesign.patch b/pkgs/development/compilers/llvm/11/compiler-rt/codesign.patch
index 3cc12b94b20..3cc12b94b20 100644
--- a/pkgs/development/compilers/llvm/11/compiler-rt-codesign.patch
+++ b/pkgs/development/compilers/llvm/11/compiler-rt/codesign.patch
diff --git a/pkgs/development/compilers/llvm/11/compiler-rt.nix b/pkgs/development/compilers/llvm/11/compiler-rt/default.nix
index 88a412f6cb4..6ab36063077 100644
--- a/pkgs/development/compilers/llvm/11/compiler-rt.nix
+++ b/pkgs/development/compilers/llvm/11/compiler-rt/default.nix
@@ -50,10 +50,10 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   patches = [
-    ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
-    ./compiler-rt-X86-support-extension.patch # Add support for i486 i586 i686 by reusing i386 config
+    ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory
+    ./X86-support-extension.patch # Add support for i486 i586 i686 by reusing i386 config
   ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
-    ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
+    ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch;
 
 
   # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
diff --git a/pkgs/development/compilers/llvm/11/sanitizers-nongnu.patch b/pkgs/development/compilers/llvm/11/compiler-rt/sanitizers-nongnu.patch
index 1f2ac97818e..1f2ac97818e 100644
--- a/pkgs/development/compilers/llvm/11/sanitizers-nongnu.patch
+++ b/pkgs/development/compilers/llvm/11/compiler-rt/sanitizers-nongnu.patch
diff --git a/pkgs/development/compilers/llvm/11/default.nix b/pkgs/development/compilers/llvm/11/default.nix
index e4d9f45c955..88e1850059a 100644
--- a/pkgs/development/compilers/llvm/11/default.nix
+++ b/pkgs/development/compilers/llvm/11/default.nix
@@ -31,7 +31,7 @@ let
     '';
   in {
 
-    llvm = callPackage ./llvm.nix { };
+    llvm = callPackage ./llvm { };
 
     clang-unwrapped = callPackage ./clang {
       inherit (tools) lld;
@@ -79,9 +79,9 @@ let
       extraBuildCommands = mkExtraBuildCommands cc;
     };
 
-    lld = callPackage ./lld.nix {};
+    lld = callPackage ./lld {};
 
-    lldb = callPackage ./lldb.nix {};
+    lldb = callPackage ./lldb {};
 
     # Below, is the LLVM bootstrapping logic. It handles building a
     # fully LLVM toolchain from scratch. No GCC toolchain should be
@@ -165,7 +165,7 @@ let
     callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
   in {
 
-    compiler-rt = callPackage ./compiler-rt.nix ({} //
+    compiler-rt = callPackage ./compiler-rt ({} //
       (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt;
       }));
@@ -179,7 +179,7 @@ let
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
       }));
 
-    libcxxabi = callPackage ./libc++abi.nix ({} //
+    libcxxabi = callPackage ./libc++abi ({} //
       (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
         libunwind = libraries.libunwind;
diff --git a/pkgs/development/compilers/llvm/11/libc++abi.nix b/pkgs/development/compilers/llvm/11/libc++abi/default.nix
index d941044ca60..a95a3051415 100644
--- a/pkgs/development/compilers/llvm/11/libc++abi.nix
+++ b/pkgs/development/compilers/llvm/11/libc++abi/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
     "-DLIBCXXABI_ENABLE_SHARED=OFF"
   ];
 
-  patches = [ ./libcxxabi-no-threads.patch ];
+  patches = [ ./no-threads.patch ];
 
   postUnpack = ''
     unpackFile ${libcxx.src}
@@ -33,7 +33,7 @@ stdenv.mkDerivation {
   '' + lib.optionalString stdenv.hostPlatform.isMusl ''
     patch -p1 -d libcxx -i ${../libcxx-0001-musl-hacks.patch}
   '' + lib.optionalString stdenv.hostPlatform.isWasm ''
-    patch -p1 -d llvm -i ${./libcxxabi-wasm.patch}
+    patch -p1 -d llvm -i ${./wasm.patch}
   '';
 
   installPhase = if stdenv.isDarwin
diff --git a/pkgs/development/compilers/llvm/11/libcxxabi-no-threads.patch b/pkgs/development/compilers/llvm/11/libc++abi/no-threads.patch
index 787f3e16500..787f3e16500 100644
--- a/pkgs/development/compilers/llvm/11/libcxxabi-no-threads.patch
+++ b/pkgs/development/compilers/llvm/11/libc++abi/no-threads.patch
diff --git a/pkgs/development/compilers/llvm/11/libcxxabi-wasm.patch b/pkgs/development/compilers/llvm/11/libc++abi/wasm.patch
index 4ebfe46aa81..4ebfe46aa81 100644
--- a/pkgs/development/compilers/llvm/11/libcxxabi-wasm.patch
+++ b/pkgs/development/compilers/llvm/11/libc++abi/wasm.patch
diff --git a/pkgs/development/compilers/llvm/11/lld.nix b/pkgs/development/compilers/llvm/11/lld/default.nix
index 1a16184a6e7..1a16184a6e7 100644
--- a/pkgs/development/compilers/llvm/11/lld.nix
+++ b/pkgs/development/compilers/llvm/11/lld/default.nix
diff --git a/pkgs/development/compilers/llvm/11/lldb.nix b/pkgs/development/compilers/llvm/11/lldb/default.nix
index 2f54305736a..fc9b471ec9a 100644
--- a/pkgs/development/compilers/llvm/11/lldb.nix
+++ b/pkgs/development/compilers/llvm/11/lldb/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation (rec {
 
   src = fetch pname "1vlyg015dyng43xqb8cg2l6r9ix8klibxsajazbfnckdnh54hwxj";
 
-  patches = [ ./lldb-procfs.patch ];
+  patches = [ ./procfs.patch ];
 
   nativeBuildInputs = [ cmake python3 which swig lit ]
     ++ lib.optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ];
diff --git a/pkgs/development/compilers/llvm/11/lldb-procfs.patch b/pkgs/development/compilers/llvm/11/lldb/procfs.patch
index b075dbaeee0..b075dbaeee0 100644
--- a/pkgs/development/compilers/llvm/11/lldb-procfs.patch
+++ b/pkgs/development/compilers/llvm/11/lldb/procfs.patch
diff --git a/pkgs/development/compilers/llvm/11/llvm.nix b/pkgs/development/compilers/llvm/11/llvm/default.nix
index cb44643ff78..fc64451e013 100644
--- a/pkgs/development/compilers/llvm/11/llvm.nix
+++ b/pkgs/development/compilers/llvm/11/llvm/default.nix
@@ -62,8 +62,8 @@ in stdenv.mkDerivation (rec {
   ''
   # Patch llvm-config to return correct library path based on --link-{shared,static}.
   + optionalString (enableSharedLibraries) ''
-    substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
-    patch -p1 < ./llvm-outputs.patch
+    substitute '${./outputs.patch}' ./outputs.patch --subst-var lib
+    patch -p1 < ./outputs.patch
   '' + ''
     # FileSystem permissions tests fail with various special bits
     substituteInPlace unittests/Support/CMakeLists.txt \
diff --git a/pkgs/development/compilers/llvm/11/llvm-outputs.patch b/pkgs/development/compilers/llvm/11/llvm/outputs.patch
index 40096fa3497..40096fa3497 100644
--- a/pkgs/development/compilers/llvm/11/llvm-outputs.patch
+++ b/pkgs/development/compilers/llvm/11/llvm/outputs.patch
diff --git a/pkgs/development/compilers/llvm/5/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/5/compiler-rt/armv7l.patch
index 77bf2640c47..77bf2640c47 100644
--- a/pkgs/development/compilers/llvm/5/compiler-rt-armv7l.patch
+++ b/pkgs/development/compilers/llvm/5/compiler-rt/armv7l.patch
diff --git a/pkgs/development/compilers/llvm/5/compiler-rt-codesign.patch b/pkgs/development/compilers/llvm/5/compiler-rt/codesign.patch
index 8f4c76bca1e..8f4c76bca1e 100644
--- a/pkgs/development/compilers/llvm/5/compiler-rt-codesign.patch
+++ b/pkgs/development/compilers/llvm/5/compiler-rt/codesign.patch
diff --git a/pkgs/development/compilers/llvm/5/compiler-rt.nix b/pkgs/development/compilers/llvm/5/compiler-rt/default.nix
index 81dbe7048e6..705c5994bd1 100644
--- a/pkgs/development/compilers/llvm/5/compiler-rt.nix
+++ b/pkgs/development/compilers/llvm/5/compiler-rt/default.nix
@@ -51,11 +51,12 @@ stdenv.mkDerivation {
   outputs = [ "out" "dev" ];
 
   patches = [
-    ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
-    ../7/compiler-rt-glibc.patch
+    ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory
+    # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce
+    ../../common/compiler-rt/glibc.patch
   ] ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
-    ++ lib.optional (stdenv.hostPlatform.libc == "glibc") ./compiler-rt-sys-ustat.patch
-    ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
+    ++ lib.optional (stdenv.hostPlatform.libc == "glibc") ./sys-ustat.patch
+    ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch;
 
   # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
   # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
diff --git a/pkgs/development/compilers/llvm/5/sanitizers-nongnu.patch b/pkgs/development/compilers/llvm/5/compiler-rt/sanitizers-nongnu.patch
index c9ddfe45c89..c9ddfe45c89 100644
--- a/pkgs/development/compilers/llvm/5/sanitizers-nongnu.patch
+++ b/pkgs/development/compilers/llvm/5/compiler-rt/sanitizers-nongnu.patch
diff --git a/pkgs/development/compilers/llvm/5/compiler-rt-sys-ustat.patch b/pkgs/development/compilers/llvm/5/compiler-rt/sys-ustat.patch
index d9e9a10d860..d9e9a10d860 100644
--- a/pkgs/development/compilers/llvm/5/compiler-rt-sys-ustat.patch
+++ b/pkgs/development/compilers/llvm/5/compiler-rt/sys-ustat.patch
diff --git a/pkgs/development/compilers/llvm/5/default.nix b/pkgs/development/compilers/llvm/5/default.nix
index f03325cd427..86bba415c01 100644
--- a/pkgs/development/compilers/llvm/5/default.nix
+++ b/pkgs/development/compilers/llvm/5/default.nix
@@ -28,7 +28,7 @@ let
     '';
   in {
 
-    llvm = callPackage ./llvm.nix { };
+    llvm = callPackage ./llvm { };
 
     clang-unwrapped = callPackage ./clang {
       inherit clang-tools-extra_src;
@@ -68,16 +68,16 @@ let
       extraBuildCommands = mkExtraBuildCommands cc;
     };
 
-    lld = callPackage ./lld.nix {};
+    lld = callPackage ./lld {};
 
-    lldb = callPackage ./lldb.nix {};
+    lldb = callPackage ./lldb {};
   });
 
   libraries = lib.makeExtensible (libraries: let
     callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
   in {
 
-    compiler-rt = callPackage ./compiler-rt.nix {};
+    compiler-rt = callPackage ./compiler-rt {};
 
     stdenv = overrideCC stdenv buildLlvmTools.clang;
 
@@ -85,7 +85,7 @@ let
 
     libcxx = callPackage ./libc++ {};
 
-    libcxxabi = callPackage ./libc++abi.nix {};
+    libcxxabi = callPackage ./libc++abi {};
 
     openmp = callPackage ./openmp.nix {};
   });
diff --git a/pkgs/development/compilers/llvm/5/libc++abi.nix b/pkgs/development/compilers/llvm/5/libc++abi/default.nix
index 8fc9ef9fded..8fc9ef9fded 100644
--- a/pkgs/development/compilers/llvm/5/libc++abi.nix
+++ b/pkgs/development/compilers/llvm/5/libc++abi/default.nix
diff --git a/pkgs/development/compilers/llvm/5/lld.nix b/pkgs/development/compilers/llvm/5/lld/default.nix
index 244960cf41b..244960cf41b 100644
--- a/pkgs/development/compilers/llvm/5/lld.nix
+++ b/pkgs/development/compilers/llvm/5/lld/default.nix
diff --git a/pkgs/development/compilers/llvm/5/lldb.nix b/pkgs/development/compilers/llvm/5/lldb/default.nix
index 61a9e60391c..61a9e60391c 100644
--- a/pkgs/development/compilers/llvm/5/lldb.nix
+++ b/pkgs/development/compilers/llvm/5/lldb/default.nix
diff --git a/pkgs/development/compilers/llvm/5/llvm.nix b/pkgs/development/compilers/llvm/5/llvm/default.nix
index c91e9420435..94d2a1e5863 100644
--- a/pkgs/development/compilers/llvm/5/llvm.nix
+++ b/pkgs/development/compilers/llvm/5/llvm/default.nix
@@ -16,6 +16,8 @@
 }:
 
 let
+  inherit (lib) optional optionals optionalString;
+
   # Used when creating a versioned symlinks of libLLVM.dylib
   versionSuffixes = with lib;
     let parts = splitVersion release_version; in
@@ -35,10 +37,10 @@ stdenv.mkDerivation ({
   '';
 
   outputs = [ "out" "python" ]
-    ++ lib.optional enableSharedLibraries "lib";
+    ++ optional enableSharedLibraries "lib";
 
   nativeBuildInputs = [ cmake python3 ]
-    ++ lib.optional enableManpages python3.pkgs.sphinx;
+    ++ optional enableManpages python3.pkgs.sphinx;
 
   buildInputs = [ libxml2 libffi ];
 
@@ -58,24 +60,24 @@ stdenv.mkDerivation ({
     #  stripLen = 1;
     #})
   ];
-  postPatch = lib.optionalString stdenv.isDarwin ''
+  postPatch = optionalString stdenv.isDarwin ''
     substituteInPlace cmake/modules/AddLLVM.cmake \
       --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \
       --replace 'set(_install_rpath "@loader_path/../lib" ''${extra_libdir})' ""
   ''
   # Patch llvm-config to return correct library path based on --link-{shared,static}.
-  + lib.optionalString (enableSharedLibraries) ''
-    substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
-    patch -p1 < ./llvm-outputs.patch
+  + optionalString (enableSharedLibraries) ''
+    substitute '${./outputs.patch}' ./outputs.patch --subst-var lib
+    patch -p1 < ./outputs.patch
   '' + ''
     # FileSystem permissions tests fail with various special bits
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "Path.cpp" ""
     rm unittests/Support/Path.cpp
-  '' + lib.optionalString stdenv.isAarch64 ''
-    patch -p0 < ${../aarch64.patch}
-  '' + lib.optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -i ${../TLI-musl.patch}
+  '' + optionalString stdenv.isAarch64 ''
+    patch -p0 < ${../../aarch64.patch}
+  '' + optionalString stdenv.hostPlatform.isMusl ''
+    patch -p1 -i ${../../TLI-musl.patch}
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "add_subdirectory(DynamicLibrary)" ""
     rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
@@ -98,18 +100,18 @@ stdenv.mkDerivation ({
     "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}"
     "-DTARGET_TRIPLE=${stdenv.hostPlatform.config}"
   ]
-  ++ lib.optional enableSharedLibraries
+  ++ optional enableSharedLibraries
     "-DLLVM_LINK_LLVM_DYLIB=ON"
-  ++ lib.optionals enableManpages [
+  ++ optionals enableManpages [
     "-DLLVM_BUILD_DOCS=ON"
     "-DLLVM_ENABLE_SPHINX=ON"
     "-DSPHINX_OUTPUT_MAN=ON"
     "-DSPHINX_OUTPUT_HTML=OFF"
     "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
   ]
-  ++ lib.optional (!isDarwin)
+  ++ optional (!isDarwin)
     "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
-  ++ lib.optionals (isDarwin) [
+  ++ optionals (isDarwin) [
     "-DLLVM_ENABLE_LIBCXX=ON"
     "-DCAN_TARGET_i386=false"
   ];
@@ -126,14 +128,14 @@ stdenv.mkDerivation ({
     mkdir -p $python/share
     mv $out/share/opt-viewer $python/share/opt-viewer
   ''
-  + lib.optionalString enableSharedLibraries ''
+  + optionalString enableSharedLibraries ''
     moveToOutput "lib/libLLVM-*" "$lib"
     moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib"
     moveToOutput "lib/libLTO${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib"
     substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
       --replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-"
   ''
-  + lib.optionalString (stdenv.isDarwin && enableSharedLibraries) ''
+  + optionalString (stdenv.isDarwin && enableSharedLibraries) ''
     substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
       --replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib" \
       --replace "\''${_IMPORT_PREFIX}/lib/libLTO.dylib" "$lib/lib/libLTO.dylib"
diff --git a/pkgs/development/compilers/llvm/5/fix-gcc9.patch b/pkgs/development/compilers/llvm/5/llvm/fix-gcc9.patch
index eaf71f1468d..eaf71f1468d 100644
--- a/pkgs/development/compilers/llvm/5/fix-gcc9.patch
+++ b/pkgs/development/compilers/llvm/5/llvm/fix-gcc9.patch
diff --git a/pkgs/development/compilers/llvm/5/llvm-outputs.patch b/pkgs/development/compilers/llvm/5/llvm/outputs.patch
index 40096fa3497..40096fa3497 100644
--- a/pkgs/development/compilers/llvm/5/llvm-outputs.patch
+++ b/pkgs/development/compilers/llvm/5/llvm/outputs.patch
diff --git a/pkgs/development/compilers/llvm/6/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/6/compiler-rt/armv7l.patch
index ca2ed632faa..ca2ed632faa 100644
--- a/pkgs/development/compilers/llvm/6/compiler-rt-armv7l.patch
+++ b/pkgs/development/compilers/llvm/6/compiler-rt/armv7l.patch
diff --git a/pkgs/development/compilers/llvm/6/compiler-rt-codesign.patch b/pkgs/development/compilers/llvm/6/compiler-rt/codesign.patch
index 8f4c76bca1e..8f4c76bca1e 100644
--- a/pkgs/development/compilers/llvm/6/compiler-rt-codesign.patch
+++ b/pkgs/development/compilers/llvm/6/compiler-rt/codesign.patch
diff --git a/pkgs/development/compilers/llvm/6/compiler-rt.nix b/pkgs/development/compilers/llvm/6/compiler-rt/default.nix
index 11d46289afe..f0a1c7ecc34 100644
--- a/pkgs/development/compilers/llvm/6/compiler-rt.nix
+++ b/pkgs/development/compilers/llvm/6/compiler-rt/default.nix
@@ -51,10 +51,11 @@ stdenv.mkDerivation {
   outputs = [ "out" "dev" ];
 
   patches = [
-    ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
-    ../7/compiler-rt-glibc.patch
+    ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory
+    # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce
+    ../../common/compiler-rt/glibc.patch
   ] ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
-    ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
+    ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch;
 
   # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
   # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
diff --git a/pkgs/development/compilers/llvm/6/sanitizers-nongnu.patch b/pkgs/development/compilers/llvm/6/compiler-rt/sanitizers-nongnu.patch
index 6266eb1958d..6266eb1958d 100644
--- a/pkgs/development/compilers/llvm/6/sanitizers-nongnu.patch
+++ b/pkgs/development/compilers/llvm/6/compiler-rt/sanitizers-nongnu.patch
diff --git a/pkgs/development/compilers/llvm/6/default.nix b/pkgs/development/compilers/llvm/6/default.nix
index a98314d1181..823b922705e 100644
--- a/pkgs/development/compilers/llvm/6/default.nix
+++ b/pkgs/development/compilers/llvm/6/default.nix
@@ -28,7 +28,7 @@ let
     '';
   in {
 
-    llvm = callPackage ./llvm.nix { };
+    llvm = callPackage ./llvm { };
 
     clang-unwrapped = callPackage ./clang {
       inherit clang-tools-extra_src;
@@ -68,16 +68,16 @@ let
       extraBuildCommands = mkExtraBuildCommands cc;
     };
 
-    lld = callPackage ./lld.nix {};
+    lld = callPackage ./lld {};
 
-    lldb = callPackage ./lldb.nix {};
+    lldb = callPackage ./lldb {};
   });
 
   libraries = lib.makeExtensible (libraries: let
     callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
   in {
 
-    compiler-rt = callPackage ./compiler-rt.nix {};
+    compiler-rt = callPackage ./compiler-rt {};
 
     stdenv = overrideCC stdenv buildLlvmTools.clang;
 
@@ -85,7 +85,7 @@ let
 
     libcxx = callPackage ./libc++ {};
 
-    libcxxabi = callPackage ./libc++abi.nix {};
+    libcxxabi = callPackage ./libc++abi {};
 
     openmp = callPackage ./openmp.nix {};
   });
diff --git a/pkgs/development/compilers/llvm/6/libc++abi.nix b/pkgs/development/compilers/llvm/6/libc++abi/default.nix
index 6e99f2d287a..6e99f2d287a 100644
--- a/pkgs/development/compilers/llvm/6/libc++abi.nix
+++ b/pkgs/development/compilers/llvm/6/libc++abi/default.nix
diff --git a/pkgs/development/compilers/llvm/6/lld.nix b/pkgs/development/compilers/llvm/6/lld/default.nix
index b8038524805..b8038524805 100644
--- a/pkgs/development/compilers/llvm/6/lld.nix
+++ b/pkgs/development/compilers/llvm/6/lld/default.nix
diff --git a/pkgs/development/compilers/llvm/6/lldb.nix b/pkgs/development/compilers/llvm/6/lldb/default.nix
index 7c6f8b1bd97..7c6f8b1bd97 100644
--- a/pkgs/development/compilers/llvm/6/lldb.nix
+++ b/pkgs/development/compilers/llvm/6/lldb/default.nix
diff --git a/pkgs/development/compilers/llvm/6/llvm.nix b/pkgs/development/compilers/llvm/6/llvm/default.nix
index 7d429e3ecf3..de99691094b 100644
--- a/pkgs/development/compilers/llvm/6/llvm.nix
+++ b/pkgs/development/compilers/llvm/6/llvm/default.nix
@@ -67,15 +67,15 @@ stdenv.mkDerivation ({
   ''
   # Patch llvm-config to return correct library path based on --link-{shared,static}.
   + optionalString (enableSharedLibraries) ''
-    substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
-    patch -p1 < ./llvm-outputs.patch
+    substitute '${./outputs.patch}' ./outputs.patch --subst-var lib
+    patch -p1 < ./outputs.patch
   '' + ''
     # FileSystem permissions tests fail with various special bits
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "Path.cpp" ""
     rm unittests/Support/Path.cpp
   '' + optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -i ${../TLI-musl.patch}
+    patch -p1 -i ${../../TLI-musl.patch}
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "add_subdirectory(DynamicLibrary)" ""
     rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
diff --git a/pkgs/development/compilers/llvm/6/llvm-outputs.patch b/pkgs/development/compilers/llvm/6/llvm/outputs.patch
index 40096fa3497..40096fa3497 100644
--- a/pkgs/development/compilers/llvm/6/llvm-outputs.patch
+++ b/pkgs/development/compilers/llvm/6/llvm/outputs.patch
diff --git a/pkgs/development/compilers/llvm/7/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/7/compiler-rt/armv7l.patch
index 89d7f1aec91..89d7f1aec91 100644
--- a/pkgs/development/compilers/llvm/7/compiler-rt-armv7l.patch
+++ b/pkgs/development/compilers/llvm/7/compiler-rt/armv7l.patch
diff --git a/pkgs/development/compilers/llvm/7/compiler-rt-codesign.patch b/pkgs/development/compilers/llvm/7/compiler-rt/codesign.patch
index 3cc12b94b20..3cc12b94b20 100644
--- a/pkgs/development/compilers/llvm/7/compiler-rt-codesign.patch
+++ b/pkgs/development/compilers/llvm/7/compiler-rt/codesign.patch
diff --git a/pkgs/development/compilers/llvm/7/crtbegin-and-end.patch b/pkgs/development/compilers/llvm/7/compiler-rt/crtbegin-and-end.patch
index e63be181f95..e63be181f95 100644
--- a/pkgs/development/compilers/llvm/7/crtbegin-and-end.patch
+++ b/pkgs/development/compilers/llvm/7/compiler-rt/crtbegin-and-end.patch
diff --git a/pkgs/development/compilers/llvm/7/compiler-rt.nix b/pkgs/development/compilers/llvm/7/compiler-rt/default.nix
index 0f91f3c5e6c..21842131599 100644
--- a/pkgs/development/compilers/llvm/7/compiler-rt.nix
+++ b/pkgs/development/compilers/llvm/7/compiler-rt/default.nix
@@ -52,12 +52,11 @@ stdenv.mkDerivation {
 
   patches = [
     # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce
-    ./compiler-rt-glibc.patch
-
-    ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
+    ../../common/compiler-rt/glibc.patch
+    ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory
   ] ++ lib.optional (useLLVM) ./crtbegin-and-end.patch
     ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
-    ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
+    ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch;
 
   # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
   # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
diff --git a/pkgs/development/compilers/llvm/7/sanitizers-nongnu.patch b/pkgs/development/compilers/llvm/7/compiler-rt/sanitizers-nongnu.patch
index 1f2ac97818e..1f2ac97818e 100644
--- a/pkgs/development/compilers/llvm/7/sanitizers-nongnu.patch
+++ b/pkgs/development/compilers/llvm/7/compiler-rt/sanitizers-nongnu.patch
diff --git a/pkgs/development/compilers/llvm/7/default.nix b/pkgs/development/compilers/llvm/7/default.nix
index 111ccbb9a38..2170177117e 100644
--- a/pkgs/development/compilers/llvm/7/default.nix
+++ b/pkgs/development/compilers/llvm/7/default.nix
@@ -28,8 +28,9 @@ let
     '';
   in {
 
-    llvm = callPackage ./llvm.nix { };
-    llvm-polly = callPackage ./llvm.nix { enablePolly = true; };
+    llvm = callPackage ./llvm { };
+
+    llvm-polly = callPackage ./llvm { enablePolly = true; };
 
     clang-unwrapped = callPackage ./clang {
       inherit (tools) lld;
@@ -75,9 +76,9 @@ let
       extraBuildCommands = mkExtraBuildCommands cc;
     };
 
-    lld = callPackage ./lld.nix {};
+    lld = callPackage ./lld {};
 
-    lldb = callPackage ./lldb.nix {};
+    lldb = callPackage ./lldb {};
 
     # Below, is the LLVM bootstrapping logic. It handles building a
     # fully LLVM toolchain from scratch. No GCC toolchain should be
@@ -159,7 +160,7 @@ let
     callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
   in {
 
-    compiler-rt = callPackage ./compiler-rt.nix {
+    compiler-rt = callPackage ./compiler-rt {
       stdenv = if stdenv.hostPlatform.useLLVM or false
                then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt
                else stdenv;
@@ -174,7 +175,7 @@ let
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
       }));
 
-    libcxxabi = callPackage ./libc++abi.nix ({} //
+    libcxxabi = callPackage ./libc++abi ({} //
       (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
         libunwind = libraries.libunwind;
diff --git a/pkgs/development/compilers/llvm/7/libc++abi.nix b/pkgs/development/compilers/llvm/7/libc++abi/default.nix
index 61879be91da..61879be91da 100644
--- a/pkgs/development/compilers/llvm/7/libc++abi.nix
+++ b/pkgs/development/compilers/llvm/7/libc++abi/default.nix
diff --git a/pkgs/development/compilers/llvm/7/lld.nix b/pkgs/development/compilers/llvm/7/lld/default.nix
index f4c58abef8a..f4c58abef8a 100644
--- a/pkgs/development/compilers/llvm/7/lld.nix
+++ b/pkgs/development/compilers/llvm/7/lld/default.nix
diff --git a/pkgs/development/compilers/llvm/7/lldb.nix b/pkgs/development/compilers/llvm/7/lldb/default.nix
index 3fa5b411f63..3fa5b411f63 100644
--- a/pkgs/development/compilers/llvm/7/lldb.nix
+++ b/pkgs/development/compilers/llvm/7/lldb/default.nix
diff --git a/pkgs/development/compilers/llvm/7/llvm.nix b/pkgs/development/compilers/llvm/7/llvm/default.nix
index 2d6f0d18722..53a7301b19b 100644
--- a/pkgs/development/compilers/llvm/7/llvm.nix
+++ b/pkgs/development/compilers/llvm/7/llvm/default.nix
@@ -76,15 +76,15 @@ in stdenv.mkDerivation ({
   ''
   # Patch llvm-config to return correct library path based on --link-{shared,static}.
   + optionalString (enableSharedLibraries) ''
-    substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
-    patch -p1 < ./llvm-outputs.patch
+    substitute '${./outputs.patch}' ./outputs.patch --subst-var lib
+    patch -p1 < ./outputs.patch
   '' + ''
     # FileSystem permissions tests fail with various special bits
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "Path.cpp" ""
     rm unittests/Support/Path.cpp
   '' + optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -i ${../TLI-musl.patch}
+    patch -p1 -i ${../../TLI-musl.patch}
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "add_subdirectory(DynamicLibrary)" ""
     rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
diff --git a/pkgs/development/compilers/llvm/7/llvm-outputs.patch b/pkgs/development/compilers/llvm/7/llvm/outputs.patch
index 40096fa3497..40096fa3497 100644
--- a/pkgs/development/compilers/llvm/7/llvm-outputs.patch
+++ b/pkgs/development/compilers/llvm/7/llvm/outputs.patch
diff --git a/pkgs/development/compilers/llvm/8/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/8/compiler-rt/armv7l.patch
index 89d7f1aec91..89d7f1aec91 100644
--- a/pkgs/development/compilers/llvm/8/compiler-rt-armv7l.patch
+++ b/pkgs/development/compilers/llvm/8/compiler-rt/armv7l.patch
diff --git a/pkgs/development/compilers/llvm/8/compiler-rt-codesign.patch b/pkgs/development/compilers/llvm/8/compiler-rt/codesign.patch
index 3cc12b94b20..3cc12b94b20 100644
--- a/pkgs/development/compilers/llvm/8/compiler-rt-codesign.patch
+++ b/pkgs/development/compilers/llvm/8/compiler-rt/codesign.patch
diff --git a/pkgs/development/compilers/llvm/8/crtbegin-and-end.patch b/pkgs/development/compilers/llvm/8/compiler-rt/crtbegin-and-end.patch
index e63be181f95..e63be181f95 100644
--- a/pkgs/development/compilers/llvm/8/crtbegin-and-end.patch
+++ b/pkgs/development/compilers/llvm/8/compiler-rt/crtbegin-and-end.patch
diff --git a/pkgs/development/compilers/llvm/8/compiler-rt.nix b/pkgs/development/compilers/llvm/8/compiler-rt/default.nix
index a9dabebb59a..3da3d59d111 100644
--- a/pkgs/development/compilers/llvm/8/compiler-rt.nix
+++ b/pkgs/development/compilers/llvm/8/compiler-rt/default.nix
@@ -51,11 +51,12 @@ stdenv.mkDerivation {
   outputs = [ "out" "dev" ];
 
   patches = [
-    ../7/compiler-rt-glibc.patch
-    ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
+    # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce
+    ../../common/compiler-rt/glibc.patch
+    ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory
   ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
     ++ lib.optional (useLLVM) ./crtbegin-and-end.patch
-    ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
+    ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch;
 
   # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
   # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
diff --git a/pkgs/development/compilers/llvm/8/sanitizers-nongnu.patch b/pkgs/development/compilers/llvm/8/compiler-rt/sanitizers-nongnu.patch
index 1f2ac97818e..1f2ac97818e 100644
--- a/pkgs/development/compilers/llvm/8/sanitizers-nongnu.patch
+++ b/pkgs/development/compilers/llvm/8/compiler-rt/sanitizers-nongnu.patch
diff --git a/pkgs/development/compilers/llvm/8/default.nix b/pkgs/development/compilers/llvm/8/default.nix
index 313b97455e5..2e3bf61099d 100644
--- a/pkgs/development/compilers/llvm/8/default.nix
+++ b/pkgs/development/compilers/llvm/8/default.nix
@@ -28,8 +28,9 @@ let
     '';
   in {
 
-    llvm = callPackage ./llvm.nix { };
-    llvm-polly = callPackage ./llvm.nix { enablePolly = true; };
+    llvm = callPackage ./llvm { };
+
+    llvm-polly = callPackage ./llvm { enablePolly = true; };
 
     clang-unwrapped = callPackage ./clang {
       inherit (tools) lld;
@@ -76,9 +77,9 @@ let
       extraBuildCommands = mkExtraBuildCommands cc;
     };
 
-    lld = callPackage ./lld.nix {};
+    lld = callPackage ./lld {};
 
-    lldb = callPackage ./lldb.nix {};
+    lldb = callPackage ./lldb {};
 
     # Below, is the LLVM bootstrapping logic. It handles building a
     # fully LLVM toolchain from scratch. No GCC toolchain should be
@@ -162,7 +163,7 @@ let
     callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
   in {
 
-    compiler-rt = callPackage ./compiler-rt.nix ({} //
+    compiler-rt = callPackage ./compiler-rt ({} //
       (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt;
       }));
@@ -176,7 +177,7 @@ let
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
       }));
 
-    libcxxabi = callPackage ./libc++abi.nix ({} //
+    libcxxabi = callPackage ./libc++abi ({} //
       (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
         libunwind = libraries.libunwind;
diff --git a/pkgs/development/compilers/llvm/8/libc++abi.nix b/pkgs/development/compilers/llvm/8/libc++abi/default.nix
index 5a74981eba8..411b94e6275 100644
--- a/pkgs/development/compilers/llvm/8/libc++abi.nix
+++ b/pkgs/development/compilers/llvm/8/libc++abi/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
     "-DLIBCXXABI_ENABLE_SHARED=OFF"
   ];
 
-  patches = [ ./libcxxabi-no-threads.patch ];
+  patches = [ ./no-threads.patch ];
 
   postUnpack = ''
     unpackFile ${libcxx.src}
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
   '' + lib.optionalString stdenv.hostPlatform.isMusl ''
     patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
   '' + lib.optionalString stdenv.hostPlatform.isWasm ''
-    patch -p1 -d $(ls -d llvm-*) -i ${./libcxxabi-wasm.patch}
+    patch -p1 -d $(ls -d llvm-*) -i ${./wasm.patch}
   '';
 
   installPhase = if stdenv.isDarwin
diff --git a/pkgs/development/compilers/llvm/8/libcxxabi-no-threads.patch b/pkgs/development/compilers/llvm/8/libc++abi/no-threads.patch
index 787f3e16500..787f3e16500 100644
--- a/pkgs/development/compilers/llvm/8/libcxxabi-no-threads.patch
+++ b/pkgs/development/compilers/llvm/8/libc++abi/no-threads.patch
diff --git a/pkgs/development/compilers/llvm/8/libcxxabi-wasm.patch b/pkgs/development/compilers/llvm/8/libc++abi/wasm.patch
index 4ebfe46aa81..4ebfe46aa81 100644
--- a/pkgs/development/compilers/llvm/8/libcxxabi-wasm.patch
+++ b/pkgs/development/compilers/llvm/8/libc++abi/wasm.patch
diff --git a/pkgs/development/compilers/llvm/8/lld.nix b/pkgs/development/compilers/llvm/8/lld/default.nix
index 8009beb7bc1..8009beb7bc1 100644
--- a/pkgs/development/compilers/llvm/8/lld.nix
+++ b/pkgs/development/compilers/llvm/8/lld/default.nix
diff --git a/pkgs/development/compilers/llvm/8/lldb.nix b/pkgs/development/compilers/llvm/8/lldb/default.nix
index 83c171d2a57..83c171d2a57 100644
--- a/pkgs/development/compilers/llvm/8/lldb.nix
+++ b/pkgs/development/compilers/llvm/8/lldb/default.nix
diff --git a/pkgs/development/compilers/llvm/8/llvm.nix b/pkgs/development/compilers/llvm/8/llvm/default.nix
index 9c2c3416aea..c0b88e7ff3e 100644
--- a/pkgs/development/compilers/llvm/8/llvm.nix
+++ b/pkgs/development/compilers/llvm/8/llvm/default.nix
@@ -71,15 +71,15 @@ in stdenv.mkDerivation ({
   ''
   # Patch llvm-config to return correct library path based on --link-{shared,static}.
   + optionalString (enableSharedLibraries) ''
-    substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
-    patch -p1 < ./llvm-outputs.patch
+    substitute '${./outputs.patch}' ./outputs.patch --subst-var lib
+    patch -p1 < ./outputs.patch
   '' + ''
     # FileSystem permissions tests fail with various special bits
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "Path.cpp" ""
     rm unittests/Support/Path.cpp
   '' + optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -i ${../TLI-musl.patch}
+    patch -p1 -i ${../../TLI-musl.patch}
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "add_subdirectory(DynamicLibrary)" ""
     rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
diff --git a/pkgs/development/compilers/llvm/8/llvm-outputs.patch b/pkgs/development/compilers/llvm/8/llvm/outputs.patch
index 40096fa3497..40096fa3497 100644
--- a/pkgs/development/compilers/llvm/8/llvm-outputs.patch
+++ b/pkgs/development/compilers/llvm/8/llvm/outputs.patch
diff --git a/pkgs/development/compilers/llvm/9/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/9/compiler-rt/armv7l.patch
index 89d7f1aec91..89d7f1aec91 100644
--- a/pkgs/development/compilers/llvm/9/compiler-rt-armv7l.patch
+++ b/pkgs/development/compilers/llvm/9/compiler-rt/armv7l.patch
diff --git a/pkgs/development/compilers/llvm/9/compiler-rt-codesign.patch b/pkgs/development/compilers/llvm/9/compiler-rt/codesign.patch
index 3cc12b94b20..3cc12b94b20 100644
--- a/pkgs/development/compilers/llvm/9/compiler-rt-codesign.patch
+++ b/pkgs/development/compilers/llvm/9/compiler-rt/codesign.patch
diff --git a/pkgs/development/compilers/llvm/9/compiler-rt.nix b/pkgs/development/compilers/llvm/9/compiler-rt/default.nix
index 1e9aa1d5d1b..cfc8e0ea74a 100644
--- a/pkgs/development/compilers/llvm/9/compiler-rt.nix
+++ b/pkgs/development/compilers/llvm/9/compiler-rt/default.nix
@@ -51,10 +51,11 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   patches = [
-    ../7/compiler-rt-glibc.patch
-    ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
+    # https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce
+    ../../common/compiler-rt/glibc.patch
+    ./codesign.patch # Revert compiler-rt commit that makes codesign mandatory
   ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
-    ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
+    ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch;
 
   # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
   # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
diff --git a/pkgs/development/compilers/llvm/9/sanitizers-nongnu.patch b/pkgs/development/compilers/llvm/9/compiler-rt/sanitizers-nongnu.patch
index 1f2ac97818e..1f2ac97818e 100644
--- a/pkgs/development/compilers/llvm/9/sanitizers-nongnu.patch
+++ b/pkgs/development/compilers/llvm/9/compiler-rt/sanitizers-nongnu.patch
diff --git a/pkgs/development/compilers/llvm/9/default.nix b/pkgs/development/compilers/llvm/9/default.nix
index dfb4981a5b7..4989c9bfad7 100644
--- a/pkgs/development/compilers/llvm/9/default.nix
+++ b/pkgs/development/compilers/llvm/9/default.nix
@@ -28,8 +28,9 @@ let
     '';
   in {
 
-    llvm = callPackage ./llvm.nix { };
-    llvm-polly = callPackage ./llvm.nix { enablePolly = true; };
+    llvm = callPackage ./llvm { };
+
+    llvm-polly = callPackage ./llvm { enablePolly = true; };
 
     clang-unwrapped = callPackage ./clang {
       inherit (tools) lld;
@@ -76,9 +77,9 @@ let
       extraBuildCommands = mkExtraBuildCommands cc;
     };
 
-    lld = callPackage ./lld.nix {};
+    lld = callPackage ./lld {};
 
-    lldb = callPackage ./lldb.nix {};
+    lldb = callPackage ./lldb {};
 
     # Below, is the LLVM bootstrapping logic. It handles building a
     # fully LLVM toolchain from scratch. No GCC toolchain should be
@@ -162,7 +163,7 @@ let
     callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
   in {
 
-    compiler-rt = callPackage ./compiler-rt.nix ({} //
+    compiler-rt = callPackage ./compiler-rt ({} //
       (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt;
       }));
@@ -176,7 +177,7 @@ let
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
       }));
 
-    libcxxabi = callPackage ./libc++abi.nix ({} //
+    libcxxabi = callPackage ./libc++abi ({} //
       (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
         libunwind = libraries.libunwind;
diff --git a/pkgs/development/compilers/llvm/9/libc++abi.nix b/pkgs/development/compilers/llvm/9/libc++abi/default.nix
index e8e08f84801..ceb83d252a8 100644
--- a/pkgs/development/compilers/llvm/9/libc++abi.nix
+++ b/pkgs/development/compilers/llvm/9/libc++abi/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
     "-DLIBCXXABI_ENABLE_SHARED=OFF"
   ];
 
-  patches = [ ./libcxxabi-no-threads.patch ];
+  patches = [ ./no-threads.patch ];
 
   postUnpack = ''
     unpackFile ${libcxx.src}
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
   '' + lib.optionalString stdenv.hostPlatform.isMusl ''
     patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
   '' + lib.optionalString stdenv.hostPlatform.isWasm ''
-    patch -p1 -d $(ls -d llvm-*) -i ${./libcxxabi-wasm.patch}
+    patch -p1 -d $(ls -d llvm-*) -i ${./wasm.patch}
   '';
 
   installPhase = if stdenv.isDarwin
diff --git a/pkgs/development/compilers/llvm/9/libcxxabi-no-threads.patch b/pkgs/development/compilers/llvm/9/libc++abi/no-threads.patch
index 787f3e16500..787f3e16500 100644
--- a/pkgs/development/compilers/llvm/9/libcxxabi-no-threads.patch
+++ b/pkgs/development/compilers/llvm/9/libc++abi/no-threads.patch
diff --git a/pkgs/development/compilers/llvm/9/libcxxabi-wasm.patch b/pkgs/development/compilers/llvm/9/libc++abi/wasm.patch
index 4ebfe46aa81..4ebfe46aa81 100644
--- a/pkgs/development/compilers/llvm/9/libcxxabi-wasm.patch
+++ b/pkgs/development/compilers/llvm/9/libc++abi/wasm.patch
diff --git a/pkgs/development/compilers/llvm/9/lld.nix b/pkgs/development/compilers/llvm/9/lld/default.nix
index 8b12642d2a7..8b12642d2a7 100644
--- a/pkgs/development/compilers/llvm/9/lld.nix
+++ b/pkgs/development/compilers/llvm/9/lld/default.nix
diff --git a/pkgs/development/compilers/llvm/9/lldb.nix b/pkgs/development/compilers/llvm/9/lldb/default.nix
index 8da5c0bef68..d75acf135f3 100644
--- a/pkgs/development/compilers/llvm/9/lldb.nix
+++ b/pkgs/development/compilers/llvm/9/lldb/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   src = fetch pname "02gb3fbz09kyw8n71218v5v77ip559x3gqbcp8y3w6n3jpbryywa";
 
-  patches = [ ./lldb-procfs.patch ];
+  patches = [ ./procfs.patch ];
 
   nativeBuildInputs = [ cmake python3 which swig lit ];
   buildInputs = [
diff --git a/pkgs/development/compilers/llvm/9/lldb-procfs.patch b/pkgs/development/compilers/llvm/9/lldb/procfs.patch
index b075dbaeee0..b075dbaeee0 100644
--- a/pkgs/development/compilers/llvm/9/lldb-procfs.patch
+++ b/pkgs/development/compilers/llvm/9/lldb/procfs.patch
diff --git a/pkgs/development/compilers/llvm/9/llvm.nix b/pkgs/development/compilers/llvm/9/llvm/default.nix
index 207dc242b91..b795f07d472 100644
--- a/pkgs/development/compilers/llvm/9/llvm.nix
+++ b/pkgs/development/compilers/llvm/9/llvm/default.nix
@@ -62,15 +62,15 @@ in stdenv.mkDerivation (rec {
   ''
   # Patch llvm-config to return correct library path based on --link-{shared,static}.
   + optionalString (enableSharedLibraries) ''
-    substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
-    patch -p1 < ./llvm-outputs.patch
+    substitute '${./outputs.patch}' ./outputs.patch --subst-var lib
+    patch -p1 < ./outputs.patch
   '' + ''
     # FileSystem permissions tests fail with various special bits
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "Path.cpp" ""
     rm unittests/Support/Path.cpp
   '' + optionalString stdenv.hostPlatform.isMusl ''
-    patch -p1 -i ${../TLI-musl.patch}
+    patch -p1 -i ${../../TLI-musl.patch}
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "add_subdirectory(DynamicLibrary)" ""
     rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp
diff --git a/pkgs/development/compilers/llvm/9/fix-test-on-non-x86-like-others.patch b/pkgs/development/compilers/llvm/9/llvm/fix-test-on-non-x86-like-others.patch
index e6c2f040684..e6c2f040684 100644
--- a/pkgs/development/compilers/llvm/9/fix-test-on-non-x86-like-others.patch
+++ b/pkgs/development/compilers/llvm/9/llvm/fix-test-on-non-x86-like-others.patch
diff --git a/pkgs/development/compilers/llvm/9/llvm-outputs.patch b/pkgs/development/compilers/llvm/9/llvm/outputs.patch
index 40096fa3497..40096fa3497 100644
--- a/pkgs/development/compilers/llvm/9/llvm-outputs.patch
+++ b/pkgs/development/compilers/llvm/9/llvm/outputs.patch
diff --git a/pkgs/development/compilers/llvm/7/compiler-rt-glibc.patch b/pkgs/development/compilers/llvm/common/compiler-rt/glibc.patch
index 2d211795fc8..2d211795fc8 100644
--- a/pkgs/development/compilers/llvm/7/compiler-rt-glibc.patch
+++ b/pkgs/development/compilers/llvm/common/compiler-rt/glibc.patch
diff --git a/pkgs/development/compilers/llvm/rocm/default.nix b/pkgs/development/compilers/llvm/rocm/default.nix
index 135fcd2d25a..6a11ded0529 100644
--- a/pkgs/development/compilers/llvm/rocm/default.nix
+++ b/pkgs/development/compilers/llvm/rocm/default.nix
@@ -28,12 +28,12 @@ in rec {
     src = "${src}/clang";
   };
 
-  lld = callPackage ./lld.nix {
+  lld = callPackage ./lld {
     inherit llvm version;
     src = "${src}/lld";
   };
 
-  llvm = callPackage ./llvm.nix {
+  llvm = callPackage ./llvm {
     inherit version;
     src = "${src}/llvm";
   };
diff --git a/pkgs/development/compilers/llvm/rocm/lld.nix b/pkgs/development/compilers/llvm/rocm/lld/default.nix
index a6e993bb203..a6e993bb203 100644
--- a/pkgs/development/compilers/llvm/rocm/lld.nix
+++ b/pkgs/development/compilers/llvm/rocm/lld/default.nix
diff --git a/pkgs/development/compilers/llvm/rocm/llvm.nix b/pkgs/development/compilers/llvm/rocm/llvm/default.nix
index d6fe211c475..62559bf1392 100644
--- a/pkgs/development/compilers/llvm/rocm/llvm.nix
+++ b/pkgs/development/compilers/llvm/rocm/llvm/default.nix
@@ -57,8 +57,8 @@ in stdenv.mkDerivation rec {
   ];
 
   postPatch = ''
-    substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
-    patch -p1 < ./llvm-outputs.patch
+    substitute '${./outputs.patch}' ./outputs.patch --subst-var lib
+    patch -p1 < ./outputs.patch
   '';
 
   # hacky fix: created binaries need to be run before installation
diff --git a/pkgs/development/compilers/llvm/rocm/llvm-outputs.patch b/pkgs/development/compilers/llvm/rocm/llvm/outputs.patch
index 40096fa3497..40096fa3497 100644
--- a/pkgs/development/compilers/llvm/rocm/llvm-outputs.patch
+++ b/pkgs/development/compilers/llvm/rocm/llvm/outputs.patch
diff --git a/pkgs/development/compilers/ocaml/4.10.nix b/pkgs/development/compilers/ocaml/4.10.nix
index 955cc3bebe2..78051040b57 100644
--- a/pkgs/development/compilers/ocaml/4.10.nix
+++ b/pkgs/development/compilers/ocaml/4.10.nix
@@ -1,6 +1,6 @@
 import ./generic.nix {
   major_version = "4";
   minor_version = "10";
-  patch_version = "0";
-  sha256 = "1dzy7lbdapcmwn1wg8k87419khi54f8hb6n314bdv7v0gfqlswrh";
+  patch_version = "2";
+  sha256 = "sha256-locUYQeCgtXbAiB32JveJchfteN2YStE+MN9ToTwAOM=";
 }
diff --git a/pkgs/development/interpreters/python/hooks/setuptools-build-hook.sh b/pkgs/development/interpreters/python/hooks/setuptools-build-hook.sh
index 311590425e6..cc037744925 100644
--- a/pkgs/development/interpreters/python/hooks/setuptools-build-hook.sh
+++ b/pkgs/development/interpreters/python/hooks/setuptools-build-hook.sh
@@ -31,6 +31,13 @@ setuptoolsShellHook() {
         mkdir -p "$tmp_path/@pythonSitePackages@"
         eval "@pythonInterpreter@ -m pip install -e . --prefix $tmp_path \
           --no-build-isolation >&2"
+
+        # Process pth file installed in tmp path. This allows one to
+        # actually import the editable installation. Note site.addsitedir
+        # appends, not prepends, new paths. Hence, it is not possible to override
+        # an existing installation of the package.
+        # https://github.com/pypa/setuptools/issues/2612
+        export NIX_PYTHONPATH="$tmp_path/@pythonSitePackages@:${NIX_PYTHONPATH-}"
     fi
 
     runHook postShellHook
diff --git a/pkgs/development/libraries/fontconfig/default.nix b/pkgs/development/libraries/fontconfig/default.nix
index daedaefcf9c..a7f8fa89c16 100644
--- a/pkgs/development/libraries/fontconfig/default.nix
+++ b/pkgs/development/libraries/fontconfig/default.nix
@@ -9,6 +9,7 @@
 , gperf
 , dejavu_fonts
 , autoreconfHook
+, CoreFoundation
 }:
 
 stdenv.mkDerivation rec {
@@ -73,7 +74,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     expat
-  ];
+  ] ++ lib.optional stdenv.isDarwin CoreFoundation;
 
   propagatedBuildInputs = [
     freetype
diff --git a/pkgs/development/libraries/libaom/default.nix b/pkgs/development/libraries/libaom/default.nix
index 5483909689d..62045a79ebf 100644
--- a/pkgs/development/libraries/libaom/default.nix
+++ b/pkgs/development/libraries/libaom/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   pname = "libaom";
-  version = "2.0.2";
+  version = "3.0.0";
 
   src = fetchgit {
     url = "https://aomedia.googlesource.com/aom";
     rev	= "v${version}";
-    sha256 = "0f3i983s9yvh9zc6mpy1ck5sjcg9l09lpw9v4md3mv8gbih9f0z0";
+    sha256 = "178rq1d7i9q4lg40bipkyhdrk18j9wi5k5avpa5bls0zm7g5ifsx";
   };
 
   patches = [ ./outputs.patch ];
diff --git a/pkgs/development/libraries/libassuan/default.nix b/pkgs/development/libraries/libassuan/default.nix
index a531cdff5b9..5e966d9c35b 100644
--- a/pkgs/development/libraries/libassuan/default.nix
+++ b/pkgs/development/libraries/libassuan/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libassuan";
-  version = "2.5.4";
+  version = "2.5.5";
 
   src = fetchurl {
     url = "mirror://gnupg/${pname}/${pname}-${version}.tar.bz2";
-    sha256 = "1w7vnnycq4z7gf4bk38pi4hrb8qrrzgfpz3cd7frwldxnfbfx060";
+    sha256 = "sha256-jowvzJgvnKZ9y7HZXi3HRrFzmkZovCCzo8W+Yy7bNOQ=";
   };
 
   outputs = [ "out" "dev" "info" ];
diff --git a/pkgs/development/libraries/libva/default.nix b/pkgs/development/libraries/libva/default.nix
index d78332bf5aa..69a59326856 100644
--- a/pkgs/development/libraries/libva/default.nix
+++ b/pkgs/development/libraries/libva/default.nix
@@ -7,13 +7,13 @@
 
 stdenv.mkDerivation rec {
   name = "libva-${lib.optionalString minimal "minimal-"}${version}";
-  version = "2.10.0";
+  version = "2.11.0";
 
   src = fetchFromGitHub {
     owner  = "intel";
     repo   = "libva";
     rev    = version;
-    sha256 = "1xyxnxmq04s3s6135v6av1rl5z809j9vxvg7af9wvyh3dgsxrlds";
+    sha256 = "0qk30p53mnwiqh2x68vyif11vg3gyjvw8v4qihg099m41qb44hws";
   };
 
   outputs = [ "dev" "out" ];
diff --git a/pkgs/development/libraries/libva/utils.nix b/pkgs/development/libraries/libva/utils.nix
index bcd24d51953..6dae93269bb 100644
--- a/pkgs/development/libraries/libva/utils.nix
+++ b/pkgs/development/libraries/libva/utils.nix
@@ -4,13 +4,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libva-utils";
-  version = "2.10.0";
+  version = "2.11.0";
 
   src = fetchFromGitHub {
     owner  = "intel";
     repo   = "libva-utils";
     rev    = version;
-    sha256 = "14v4mw0asjgg4l0683hn87d8jai8lrmcpbfcm9z93p4mpn2sp7aw";
+    sha256 = "130h1y67p5ig4pd7l56kncb93mws1i3zf6cklzhyj41f2k2lxayd";
   };
 
   nativeBuildInputs = [ meson ninja pkg-config ];
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index e7c87bbc2c7..397ae4227fe 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -1,8 +1,9 @@
 { stdenv, lib, fetchurl, fetchpatch, buildPackages
-, pkg-config, intltool, ninja, meson
-, file, flex, bison, expat, libdrm, xorg, wayland, wayland-protocols, openssl
+, meson, pkg-config, ninja
+, intltool, bison, flex, file, python3Packages
+, expat, libdrm, xorg, wayland, wayland-protocols, openssl
 , llvmPackages, libffi, libomxil-bellagio, libva-minimal
-, libelf, libvdpau, python3Packages
+, libelf, libvdpau
 , libglvnd
 , enableRadv ? true
 , galliumDrivers ? ["auto"]
@@ -31,7 +32,7 @@ with lib;
 let
   # Release calendar: https://www.mesa3d.org/release-calendar.html
   # Release frequency: https://www.mesa3d.org/releasing.html#schedule
-  version = "20.3.4";
+  version = "21.0.1";
   branch  = versions.major version;
 in
 
@@ -46,7 +47,7 @@ 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 = "1120kf280hg4h0a2505vxf6rdw8r2ydl3cg4iwkmpx0zxj3sj8fw";
+    sha256 = "1fqj2xhhd1ary0pfg31jq6fqcnd6qgyrw1445nmz554k8n2ck7rp";
   };
 
   prePatch = "patchShebangs .";
@@ -113,7 +114,8 @@ stdenv.mkDerivation {
     "-Dva-libs-path=${placeholder "drivers"}/lib/dri"
     "-Dd3d-drivers-path=${placeholder "drivers"}/lib/d3d"
     "-Dgallium-nine=${boolToString enableGalliumNine}" # Direct3D in Wine
-    "-Dosmesa=${if enableOSMesa then "gallium" else "none"}" # used by wine
+    "-Dosmesa=${boolToString enableOSMesa}" # used by wine
+    "-Dmicrosoft-clc=disabled" # Only relevant on Windows (OpenCL 1.2 API on top of D3D12)
   ] ++ optionals stdenv.isLinux [
     "-Dglvnd=true"
   ];
@@ -130,7 +132,7 @@ stdenv.mkDerivation {
   depsBuildBuild = [ pkg-config ];
 
   nativeBuildInputs = [
-    pkg-config meson ninja
+    meson pkg-config ninja
     intltool bison flex file
     python3Packages.python python3Packages.Mako
   ] ++ lib.optionals (elem "wayland" eglPlatforms) [
diff --git a/pkgs/development/libraries/nspr/default.nix b/pkgs/development/libraries/nspr/default.nix
index 17b8b9226d5..159f343cf4d 100644
--- a/pkgs/development/libraries/nspr/default.nix
+++ b/pkgs/development/libraries/nspr/default.nix
@@ -2,7 +2,7 @@
 , CoreServices ? null
 , buildPackages }:
 
-let version = "4.29"; in
+let version = "4.30"; in
 
 stdenv.mkDerivation {
   pname = "nspr";
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "mirror://mozilla/nspr/releases/v${version}/src/nspr-${version}.tar.gz";
-    sha256 = "22286bdb8059d74632cc7c2865c139e63953ecfb33bf4362ab58827e86e92582";
+    sha256 = "0fwivizfz88625lwv1ngxirnal7w9csq1q9i7m6dr14l83wdhk4d";
   };
 
   patches = [
diff --git a/pkgs/development/libraries/nss/default.nix b/pkgs/development/libraries/nss/default.nix
index 81a51c7beae..e6e2190a1a6 100644
--- a/pkgs/development/libraries/nss/default.nix
+++ b/pkgs/development/libraries/nss/default.nix
@@ -18,7 +18,7 @@ let
   #       It will rebuild itself using the version of this package (NSS) and if
   #       an update is required do the required changes to the expression.
   #       Example: nix-shell ./maintainers/scripts/update.nix --argstr package cacert
-  version = "3.62";
+  version = "3.63";
   underscoreVersion = builtins.replaceStrings ["."] ["_"] version;
 
 in stdenv.mkDerivation rec {
@@ -27,7 +27,7 @@ in stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://mozilla/security/nss/releases/NSS_${underscoreVersion}_RTM/src/${pname}-${version}.tar.gz";
-    sha256 = "0y2ld90bncjjggrn64c7g7mq9i03z6dc3r2kz978snz2xiydzml6";
+    sha256 = "0892xbjcaw6g4rd2rs4qa37nbda248cjrgxa4faaw0licbpjyb8q";
   };
 
   depsBuildBuild = [ buildPackages.stdenv.cc ];
diff --git a/pkgs/development/libraries/science/math/blis/default.nix b/pkgs/development/libraries/science/math/blis/default.nix
index eb91e0a3d22..26659ffc166 100644
--- a/pkgs/development/libraries/science/math/blis/default.nix
+++ b/pkgs/development/libraries/science/math/blis/default.nix
@@ -17,13 +17,13 @@ let
   blasIntSize = if blas64 then "64" else "32";
 in stdenv.mkDerivation rec {
   pname = "blis";
-  version = "0.8.0";
+  version = "0.8.1";
 
   src = fetchFromGitHub {
     owner = "flame";
     repo = "blis";
     rev = version;
-    sha256 = "0fp0nskydan3i7sj7qkabwc9sjh7mw73pjpgzh50qchkkcv0s3n1";
+    sha256 = "sha256-D5T/itq9zyD5TkeJ4Ae1vS4yEWU51omyJoIkKQ2NLhY=";
   };
 
   inherit blas64;
diff --git a/pkgs/development/libraries/science/math/openblas/default.nix b/pkgs/development/libraries/science/math/openblas/default.nix
index 23a82f483dc..c66e4ba44ef 100644
--- a/pkgs/development/libraries/science/math/openblas/default.nix
+++ b/pkgs/development/libraries/science/math/openblas/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, perl, which
+{ lib, stdenv, fetchFromGitHub, fetchpatch, perl, which
 # Most packages depending on openblas expect integer width to match
 # pointer width, but some expect to use 32-bit integers always
 # (for compatibility with reference BLAS).
@@ -124,6 +124,16 @@ stdenv.mkDerivation rec {
     sha256 = "14jxh0v3jfbw4mfjx4mcz4dd51lyq7pqvh9k8dg94539ypzjr2lj";
   };
 
+  # apply https://github.com/xianyi/OpenBLAS/pull/3060 to fix a crash on arm
+  # remove this when updating to 0.3.14 or newer
+  patches = [
+    (fetchpatch {
+      name = "label-get_cpu_ftr-as-volatile.patch";
+      url = "https://github.com/xianyi/OpenBLAS/commit/6fe0f1fab9d6a7f46d71d37ebb210fbf56924fbc.diff";
+      sha256 = "06gwh73k4sas1ap2fi3jvpifbjkys2vhmnbj4mzrsvj279ljsfdk";
+    })
+  ];
+
   inherit blas64;
 
   # Some hardening features are disabled due to sporadic failures in
diff --git a/pkgs/development/python-modules/bootstrapped-pip/2.nix b/pkgs/development/python-modules/bootstrapped-pip/2.nix
new file mode 100644
index 00000000000..5a6333d656a
--- /dev/null
+++ b/pkgs/development/python-modules/bootstrapped-pip/2.nix
@@ -0,0 +1,67 @@
+{ lib, stdenv, python, fetchPypi, makeWrapper, unzip, makeSetupHook
+, pipInstallHook
+, setuptoolsBuildHook
+, wheel, pip, setuptools
+, isPy27
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pip";
+  inherit (pip) version;
+  name = "${python.libPrefix}-bootstrapped-${pname}-${version}";
+
+  srcs = [ wheel.src pip.src setuptools.src ];
+  sourceRoot = ".";
+
+  dontUseSetuptoolsBuild = true;
+  dontUsePipInstall = true;
+
+  # Should be propagatedNativeBuildInputs
+  propagatedBuildInputs = [
+    # Override to remove dependencies to prevent infinite recursion.
+    (pipInstallHook.override{pip=null;})
+    (setuptoolsBuildHook.override{setuptools=null; wheel=null;})
+  ];
+
+  postPatch = ''
+    mkdir -p $out/bin
+  '';
+
+  nativeBuildInputs = [ makeWrapper unzip ];
+  buildInputs = [ python ];
+
+  buildPhase = ":";
+
+  installPhase = lib.strings.optionalString (!stdenv.hostPlatform.isWindows) ''
+    export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
+  '' + ''
+    # Give folders a known name
+    mv pip* pip
+    mv setuptools* setuptools
+    mv wheel* wheel
+    # Set up PYTHONPATH. The above folders need to be on PYTHONPATH
+    # $out is where we are installing to and takes precedence
+    export PYTHONPATH="$out/${python.sitePackages}:$(pwd)/pip/src:$(pwd)/setuptools:$(pwd)/setuptools/pkg_resources:$(pwd)/wheel:$PYTHONPATH"
+
+    echo "Building setuptools wheel..."
+    pushd setuptools
+    ${python.pythonForBuild.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out  --ignore-installed --no-dependencies --no-cache .
+    popd
+
+    echo "Building wheel wheel..."
+    pushd wheel
+    ${python.pythonForBuild.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out  --ignore-installed --no-dependencies --no-cache .
+    popd
+
+    echo "Building pip wheel..."
+    pushd pip
+    ${python.pythonForBuild.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out  --ignore-installed --no-dependencies --no-cache .
+    popd
+  '';
+
+  meta = {
+    description = "Version of pip used for bootstrapping";
+    license = lib.unique (pip.meta.license ++ setuptools.meta.license ++ wheel.meta.license);
+    homepage = pip.meta.homepage;
+  };
+}
diff --git a/pkgs/development/python-modules/bootstrapped-pip/default.nix b/pkgs/development/python-modules/bootstrapped-pip/default.nix
index 5a6333d656a..42eb1cccee3 100644
--- a/pkgs/development/python-modules/bootstrapped-pip/default.nix
+++ b/pkgs/development/python-modules/bootstrapped-pip/default.nix
@@ -45,6 +45,7 @@ stdenv.mkDerivation rec {
 
     echo "Building setuptools wheel..."
     pushd setuptools
+    rm pyproject.toml
     ${python.pythonForBuild.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out  --ignore-installed --no-dependencies --no-cache .
     popd
 
diff --git a/pkgs/development/python-modules/django/2.nix b/pkgs/development/python-modules/django/2.nix
index 06ec880e328..7d28d30e862 100644
--- a/pkgs/development/python-modules/django/2.nix
+++ b/pkgs/development/python-modules/django/2.nix
@@ -6,13 +6,13 @@
 
 buildPythonPackage rec {
   pname = "Django";
-  version = "2.2.18";
+  version = "2.2.19";
 
   disabled = !isPy3k;
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1d0b91343i9n0qz8xia1fbm4s3q8wi98nyc9a3acncm0w3sr9jf9";
+    sha256 = "0hysjf8bz4g8xrn2cdx6pmawimpyr6ag2fg3jxsnc1byr3g3bhih";
   };
 
   patches = lib.optional withGdal
diff --git a/pkgs/development/python-modules/packaging/default.nix b/pkgs/development/python-modules/packaging/default.nix
index a261c8c1e26..d76b5b1723e 100644
--- a/pkgs/development/python-modules/packaging/default.nix
+++ b/pkgs/development/python-modules/packaging/default.nix
@@ -10,12 +10,12 @@
 
 buildPythonPackage rec {
   pname = "packaging";
-  version = "20.8";
+  version = "20.9";
   format = "pyproject";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "sha256-eFmBhacAikcNZFJqgFnemqpEkjjygPyetrE7psQQkJM=";
+    sha256 = "sha256-WzJ6wTINyGPcpy9FFOzAhvMRhnRLhKIwN0zB/Xdv6uU=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/development/python-modules/pip/20.nix b/pkgs/development/python-modules/pip/20.nix
new file mode 100644
index 00000000000..6f859d365c5
--- /dev/null
+++ b/pkgs/development/python-modules/pip/20.nix
@@ -0,0 +1,44 @@
+{ lib
+, python
+, buildPythonPackage
+, bootstrapped-pip
+, fetchFromGitHub
+, mock
+, scripttest
+, virtualenv
+, pretend
+, pytest
+, setuptools
+, wheel
+}:
+
+buildPythonPackage rec {
+  pname = "pip";
+  version = "20.3.4";
+  format = "other";
+
+  src = fetchFromGitHub {
+    owner = "pypa";
+    repo = pname;
+    rev = version;
+    sha256 = "0hkhs9yc1cjdj1gn9wkycd3sy65c05q8k8rhqgsm5jbpksfssiwn";
+    name = "${pname}-${version}-source";
+  };
+
+  nativeBuildInputs = [ bootstrapped-pip ];
+
+  # pip detects that we already have bootstrapped_pip "installed", so we need
+  # to force it a little.
+  pipInstallFlags = [ "--ignore-installed" ];
+
+  checkInputs = [ mock scripttest virtualenv pretend pytest ];
+  # Pip wants pytest, but tests are not distributed
+  doCheck = false;
+
+  meta = {
+    description = "The PyPA recommended tool for installing Python packages";
+    license = with lib.licenses; [ mit ];
+    homepage = "https://pip.pypa.io/";
+    priority = 10;
+  };
+}
diff --git a/pkgs/development/python-modules/pip/default.nix b/pkgs/development/python-modules/pip/default.nix
index 6f859d365c5..f7979966703 100644
--- a/pkgs/development/python-modules/pip/default.nix
+++ b/pkgs/development/python-modules/pip/default.nix
@@ -14,14 +14,14 @@
 
 buildPythonPackage rec {
   pname = "pip";
-  version = "20.3.4";
+  version = "21.0.1";
   format = "other";
 
   src = fetchFromGitHub {
     owner = "pypa";
     repo = pname;
     rev = version;
-    sha256 = "0hkhs9yc1cjdj1gn9wkycd3sy65c05q8k8rhqgsm5jbpksfssiwn";
+    sha256 = "sha256-Yt5xqdo735f5sQKP8GnKM201SoIi7ZP9l2gw+feUVW0=";
     name = "${pname}-${version}-source";
   };
 
diff --git a/pkgs/development/python-modules/setuptools-rust/default.nix b/pkgs/development/python-modules/setuptools-rust/default.nix
index e3d8a35186a..f7cc04c4eeb 100644
--- a/pkgs/development/python-modules/setuptools-rust/default.nix
+++ b/pkgs/development/python-modules/setuptools-rust/default.nix
@@ -2,7 +2,7 @@
 , lib
 , buildPythonPackage
 , fetchPypi
-, isPy27
+, pythonOlder
 , semantic-version
 , setuptools
 , setuptools-scm
@@ -11,12 +11,12 @@
 
 buildPythonPackage rec {
   pname = "setuptools-rust";
-  version = "0.11.6";
-  disabled = isPy27;
+  version = "0.12.1";
+  disabled = pythonOlder "3.6";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "a5b5954909cbc5d66b914ee6763f81fa2610916041c7266105a469f504a7c4ca";
+    sha256 = "647009e924f0ae439c7f3e0141a184a69ad247ecb9044c511dabde232d3d570e";
   };
 
   nativeBuildInputs = [ setuptools-scm ];
diff --git a/pkgs/development/python-modules/setuptools-rust/pyo3-test/default.nix b/pkgs/development/python-modules/setuptools-rust/pyo3-test/default.nix
index 9af17aa5159..31730d6ff2d 100644
--- a/pkgs/development/python-modules/setuptools-rust/pyo3-test/default.nix
+++ b/pkgs/development/python-modules/setuptools-rust/pyo3-test/default.nix
@@ -17,5 +17,9 @@ callPackage ../../../tools/rust/maturin/pyo3-test/generic.nix {
     rust.rustc
   ]);
 
-  sourceRoot = "source/examples/word-count";
+  preConfigure = ''
+    # sourceRoot puts Cargo.lock in the wrong place due to the
+    # example setup.
+    cd examples/word-count
+  '';
 }
diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix
index 12bbbb7d0e5..0e144c5b009 100644
--- a/pkgs/development/python-modules/setuptools/default.nix
+++ b/pkgs/development/python-modules/setuptools/default.nix
@@ -1,4 +1,5 @@
 { stdenv
+, fetchurl
 , buildPythonPackage
 , fetchFromGitHub
 , python
@@ -13,7 +14,12 @@
 
 let
   pname = "setuptools";
-  version = "50.3.1";
+  version = "54.2.0";
+
+  bootstrap = fetchurl {
+    url = "https://raw.githubusercontent.com/pypa/setuptools/v52.0.0/bootstrap.py";
+    sha256 = "sha256-HzhlnJvMskBfb3kVnYltdnjS63wt1GWd0RK+VQqrJQ8=";
+  };
 
   # Create an sdist of setuptools
   sdist = stdenv.mkDerivation rec {
@@ -23,7 +29,7 @@ let
       owner = "pypa";
       repo = pname;
       rev = "v${version}";
-      sha256 = "Z4KHB3Pv4wZPou/Vbp1DFDgDp47OTDfVChGP55GtIJE=";
+      sha256 = "sha256-ZHJZiwlWLHP4vf2TLwj/DYB9wjbRp0apVmmjsKCLPq0=";
       name = "${pname}-${version}-source";
     };
 
@@ -32,6 +38,7 @@ let
     ];
 
     buildPhase = ''
+      cp ${bootstrap} bootstrap.py
       ${python.pythonForBuild.interpreter} bootstrap.py
       ${python.pythonForBuild.interpreter} setup.py sdist --formats=gztar
 
diff --git a/pkgs/development/tools/build-managers/cmake/default.nix b/pkgs/development/tools/build-managers/cmake/default.nix
index 65e1b553875..d1460507466 100644
--- a/pkgs/development/tools/build-managers/cmake/default.nix
+++ b/pkgs/development/tools/build-managers/cmake/default.nix
@@ -20,12 +20,12 @@ stdenv.mkDerivation (rec {
           + lib.optionalString useNcurses "-cursesUI"
           + lib.optionalString withQt5 "-qt5UI"
           + lib.optionalString useQt4 "-qt4UI";
-  version = "3.19.6";
+  version = "3.19.7";
 
   src = fetchurl {
     url = "${meta.homepage}files/v${lib.versions.majorMinor version}/cmake-${version}.tar.gz";
     # compare with https://cmake.org/files/v${lib.versions.majorMinor version}/cmake-${version}-SHA-256.txt
-    sha256 = "sha256-7IerZ8RfR8QoXyBCgMXN5I4ckgz8/tFVWyf7OxodILo=";
+    sha256 = "sha256-WKFfDVagr8zDzFNxI0/Oc/zGyPnb13XYmOUQuDF1WI4=";
   };
 
   patches = [
diff --git a/pkgs/development/tools/misc/binutils/CVE-2020-35448.patch b/pkgs/development/tools/misc/binutils/CVE-2020-35448.patch
new file mode 100644
index 00000000000..2eba7b51849
--- /dev/null
+++ b/pkgs/development/tools/misc/binutils/CVE-2020-35448.patch
@@ -0,0 +1,77 @@
+From 8642dafaef21aa6747cec01df1977e9c52eb4679 Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Fri, 4 Sep 2020 19:19:18 +0930
+Subject: [PATCH] PR26574, heap buffer overflow in
+ _bfd_elf_slurp_secondary_reloc_section
+
+A horribly fuzzed object with section headers inside the ELF header.
+Disallow that, and crazy reloc sizes.
+
+	PR 26574
+	* elfcode.h (elf_object_p): Sanity check section header offset.
+	* elf.c (_bfd_elf_slurp_secondary_reloc_section): Sanity check
+	sh_entsize.
+---
+ bfd/elf.c     | 4 +++-
+ bfd/elfcode.h | 8 ++++----
+ 3 files changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/bfd/elf.c b/bfd/elf.c
+index ac2095f787d..5a02f8dc309 100644
+--- a/bfd/elf.c
++++ b/bfd/elf.c
+@@ -12576,7 +12576,9 @@ _bfd_elf_slurp_secondary_reloc_section (bfd *      abfd,
+       Elf_Internal_Shdr * hdr = & elf_section_data (relsec)->this_hdr;
+ 
+       if (hdr->sh_type == SHT_SECONDARY_RELOC
+-	  && hdr->sh_info == (unsigned) elf_section_data (sec)->this_idx)
++	  && hdr->sh_info == (unsigned) elf_section_data (sec)->this_idx
++	  && (hdr->sh_entsize == ebd->s->sizeof_rel
++	      || hdr->sh_entsize == ebd->s->sizeof_rela))
+ 	{
+ 	  bfd_byte * native_relocs;
+ 	  bfd_byte * native_reloc;
+diff --git a/bfd/elfcode.h b/bfd/elfcode.h
+index 2ed2f135c34..606ff64fd4d 100644
+--- a/bfd/elfcode.h
++++ b/bfd/elfcode.h
+@@ -571,7 +571,7 @@ elf_object_p (bfd *abfd)
+ 
+   /* If this is a relocatable file and there is no section header
+      table, then we're hosed.  */
+-  if (i_ehdrp->e_shoff == 0 && i_ehdrp->e_type == ET_REL)
++  if (i_ehdrp->e_shoff < sizeof (x_ehdr) && i_ehdrp->e_type == ET_REL)
+     goto got_wrong_format_error;
+ 
+   /* As a simple sanity check, verify that what BFD thinks is the
+@@ -581,7 +581,7 @@ elf_object_p (bfd *abfd)
+     goto got_wrong_format_error;
+ 
+   /* Further sanity check.  */
+-  if (i_ehdrp->e_shoff == 0 && i_ehdrp->e_shnum != 0)
++  if (i_ehdrp->e_shoff < sizeof (x_ehdr) && i_ehdrp->e_shnum != 0)
+     goto got_wrong_format_error;
+ 
+   ebd = get_elf_backend_data (abfd);
+@@ -618,7 +618,7 @@ elf_object_p (bfd *abfd)
+       && ebd->elf_osabi != ELFOSABI_NONE)
+     goto got_wrong_format_error;
+ 
+-  if (i_ehdrp->e_shoff != 0)
++  if (i_ehdrp->e_shoff >= sizeof (x_ehdr))
+     {
+       file_ptr where = (file_ptr) i_ehdrp->e_shoff;
+ 
+@@ -819,7 +819,7 @@ elf_object_p (bfd *abfd)
+ 	}
+     }
+ 
+-  if (i_ehdrp->e_shstrndx != 0 && i_ehdrp->e_shoff != 0)
++  if (i_ehdrp->e_shstrndx != 0 && i_ehdrp->e_shoff >= sizeof (x_ehdr))
+     {
+       unsigned int num_sec;
+ 
+-- 
+2.27.0
+
+
diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix
index 5022f8a7f8c..37ba3420b18 100644
--- a/pkgs/development/tools/misc/binutils/default.nix
+++ b/pkgs/development/tools/misc/binutils/default.nix
@@ -61,6 +61,7 @@ stdenv.mkDerivation {
     # cross-compiling.
     ./always-search-rpath.patch
 
+    ./CVE-2020-35448.patch
   ] ++ lib.optional stdenv.targetPlatform.isiOS ./support-ios.patch
     ++ # This patch was suggested by Nick Clifton to fix
        # https://sourceware.org/bugzilla/show_bug.cgi?id=16177
diff --git a/pkgs/development/tools/misc/elfutils/default.nix b/pkgs/development/tools/misc/elfutils/default.nix
index 8954ff2bc42..c1227775785 100644
--- a/pkgs/development/tools/misc/elfutils/default.nix
+++ b/pkgs/development/tools/misc/elfutils/default.nix
@@ -61,10 +61,10 @@ stdenv.mkDerivation rec {
   # We need bzip2 in NativeInputs because otherwise we can't unpack the src,
   # as the host-bzip2 will be in the path.
   nativeBuildInputs = [ m4 bison flex gettext bzip2 ]
-    ++ lib.optional stdenv.hostPlatform.isMusl [ pkg-config autoreconfHook ]
-    ++ lib.optional enableDebuginfod [ pkg-config ];
+    ++ lib.optional stdenv.hostPlatform.isMusl autoreconfHook
+    ++ lib.optional (enableDebuginfod || stdenv.hostPlatform.isMusl) pkg-config;
   buildInputs = [ zlib bzip2 xz ]
-    ++ lib.optional stdenv.hostPlatform.isMusl [
+    ++ lib.optionals stdenv.hostPlatform.isMusl [
     argp-standalone
     musl-fts
     musl-obstack
diff --git a/pkgs/development/tools/ocaml/findlib/default.nix b/pkgs/development/tools/ocaml/findlib/default.nix
index 8752b2edb66..2286c0945fc 100644
--- a/pkgs/development/tools/ocaml/findlib/default.nix
+++ b/pkgs/development/tools/ocaml/findlib/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "ocaml-findlib";
-  version = "1.8.1";
+  version = "1.9.1";
 
   src = fetchurl {
     url = "http://download.camlcity.org/download/findlib-${version}.tar.gz";
-    sha256 = "00s3sfb02pnjmkax25pcnljcnhcggiliccfz69a72ic7gsjwz1cf";
+    sha256 = "sha256-K0K4vVRIjWTEvzy3BUtLN70wwdwSvUMeoeTXrYqYD+I=";
   };
 
   buildInputs = [m4 ncurses ocaml];
diff --git a/pkgs/development/tools/rust/maturin/pyo3-test/default.nix b/pkgs/development/tools/rust/maturin/pyo3-test/default.nix
index b118309b36d..7f79c8565d2 100644
--- a/pkgs/development/tools/rust/maturin/pyo3-test/default.nix
+++ b/pkgs/development/tools/rust/maturin/pyo3-test/default.nix
@@ -1,8 +1,8 @@
-{ callPackage
+{ python3
 , rustPlatform
 }:
 
-callPackage ./generic.nix {
+python3.pkgs.callPackage ./generic.nix {
   buildAndTestSubdir = "examples/word-count";
 
   nativeBuildInputs = with rustPlatform; [
diff --git a/pkgs/development/tools/rust/maturin/pyo3-test/generic.nix b/pkgs/development/tools/rust/maturin/pyo3-test/generic.nix
index f82c988fc51..41175ad8538 100644
--- a/pkgs/development/tools/rust/maturin/pyo3-test/generic.nix
+++ b/pkgs/development/tools/rust/maturin/pyo3-test/generic.nix
@@ -3,17 +3,17 @@
 
 { lib
 , fetchFromGitHub
-, python3Packages
+, python
 , rustPlatform
 
 , nativeBuildInputs
 
 , buildAndTestSubdir ? null
 , format ? "pyproject"
-, sourceRoot ? "source"
+, preConfigure ? ""
 }:
 
-python3Packages.buildPythonPackage rec {
+python.pkgs.buildPythonPackage rec {
   pname = "word-count";
   version = "0.13.2";
 
@@ -25,14 +25,14 @@ python3Packages.buildPythonPackage rec {
   };
 
   cargoDeps = rustPlatform.fetchCargoTarball {
-    inherit src sourceRoot patches;
+    inherit src patches;
     name = "${pname}-${version}";
     hash = "sha256-//TmozgWy9zrSpMKX92XdHj4fw/T1Elfgn4YhhR7ot0=";
   };
 
   patches = [ ./Cargo.lock.patch ];
 
-  inherit buildAndTestSubdir format nativeBuildInputs sourceRoot;
+  inherit buildAndTestSubdir format nativeBuildInputs preConfigure;
 
   pythonImportsCheck = [ "word_count" ];
 
diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix
index 11dcd57d9cc..45dd7a1131f 100644
--- a/pkgs/servers/x11/xorg/default.nix
+++ b/pkgs/servers/x11/xorg/default.nix
@@ -2679,11 +2679,11 @@ lib.makeScope newScope (self: with self; {
   }) {};
 
   xorgproto = callPackage ({ stdenv, pkg-config, fetchurl, libXt }: stdenv.mkDerivation {
-    name = "xorgproto-2020.1";
+    name = "xorgproto-2021.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = "mirror://xorg/individual/proto/xorgproto-2020.1.tar.bz2";
-      sha256 = "1llrnrkq6iprgiqakmwlv89745s9h02xsiaq0xn3fnh377qm78al";
+      url = "mirror://xorg/individual/proto/xorgproto-2021.3.tar.bz2";
+      sha256 = "0dypp7cvjf0rvwa7cn1zp7djw5ynhs1rwk9p0r1vczbwzha2nwsc";
     };
     hardeningDisable = [ "bindnow" "relro" ];
     nativeBuildInputs = [ pkg-config ];
diff --git a/pkgs/servers/x11/xorg/tarballs.list b/pkgs/servers/x11/xorg/tarballs.list
index 1da71809502..72261148476 100644
--- a/pkgs/servers/x11/xorg/tarballs.list
+++ b/pkgs/servers/x11/xorg/tarballs.list
@@ -211,7 +211,7 @@ mirror://xorg/individual/lib/libXxf86misc-1.0.4.tar.bz2
 mirror://xorg/individual/lib/libXxf86vm-1.1.4.tar.bz2
 mirror://xorg/individual/lib/xtrans-1.4.0.tar.bz2
 mirror://xorg/individual/proto/xcb-proto-1.14.1.tar.xz
-mirror://xorg/individual/proto/xorgproto-2020.1.tar.bz2
+mirror://xorg/individual/proto/xorgproto-2021.3.tar.bz2
 mirror://xorg/individual/util/gccmakedep-1.0.3.tar.bz2
 mirror://xorg/individual/util/imake-1.0.8.tar.bz2
 mirror://xorg/individual/util/lndir-1.0.3.tar.bz2
diff --git a/pkgs/tools/backup/dar/default.nix b/pkgs/tools/backup/dar/default.nix
index 709084d5108..172f30695d5 100644
--- a/pkgs/tools/backup/dar/default.nix
+++ b/pkgs/tools/backup/dar/default.nix
@@ -8,12 +8,12 @@
 with lib;
 
 stdenv.mkDerivation rec {
-  version = "2.6.13";
+  version = "2.6.14";
   pname = "dar";
 
   src = fetchurl {
     url = "mirror://sourceforge/dar/${pname}-${version}.tar.gz";
-    sha256 = "15yhpzyzw7h7d74xxh104cnbh19639yxx0502xz85fazwpwrzsiz";
+    sha256 = "sha256-1uzKj+q2klIdANhLzy6TStJzeQndeUvdT0Dzwijad+U=";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/tools/filesystems/e2fsprogs/default.nix b/pkgs/tools/filesystems/e2fsprogs/default.nix
index 154b0006663..327ddbf8d6d 100644
--- a/pkgs/tools/filesystems/e2fsprogs/default.nix
+++ b/pkgs/tools/filesystems/e2fsprogs/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   pname = "e2fsprogs";
-  version = "1.45.6";
+  version = "1.46.2";
 
   src = fetchurl {
     url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
-    sha256 = "sha256-X2SsUKK2C45nxbOCuxN97Dk0QBcQPK/8OmFVRCTy1pM=";
+    sha256 = "sha256-958mtPZb3AWfyhLh7GowQMPOGlA/tw65Fb7nGQOBXNU=";
   };
 
   outputs = [ "bin" "dev" "out" "man" "info" ];
@@ -68,10 +68,13 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     homepage = "http://e2fsprogs.sourceforge.net/";
     description = "Tools for creating and checking ext2/ext3/ext4 filesystems";
-    license = licenses.gpl2;
+    license = with licenses; [
+      gpl2Plus
+      lgpl2Plus # lib/ext2fs, lib/e2p
+      bsd3      # lib/uuid
+      mit       # lib/et, lib/ss
+    ];
     platforms = platforms.unix;
     maintainers = [ maintainers.eelco ];
-    # imager.c:70:2: error: unknown type name 'loff_t'; did you mean 'off_t'?
-    broken = stdenv.isDarwin;
   };
 }
diff --git a/pkgs/tools/filesystems/ntfs-3g/default.nix b/pkgs/tools/filesystems/ntfs-3g/default.nix
index 7039584ea90..89ef27827a1 100644
--- a/pkgs/tools/filesystems/ntfs-3g/default.nix
+++ b/pkgs/tools/filesystems/ntfs-3g/default.nix
@@ -1,5 +1,7 @@
-{lib, stdenv, fetchurl, util-linux, libuuid
-, crypto ? false, libgcrypt, gnutls, pkg-config}:
+{ lib, stdenv, fetchurl, pkg-config, mount, libuuid
+, macfuse-stubs, DiskArbitration
+, crypto ? false, libgcrypt, gnutls
+}:
 
 stdenv.mkDerivation rec {
   pname = "ntfs3g";
@@ -7,8 +9,9 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "man" "doc" ];
 
-  buildInputs = [ libuuid ] ++ lib.optionals crypto [ gnutls libgcrypt ];
-  nativeBuildInputs = lib.optional crypto pkg-config;
+  buildInputs = [ libuuid ] ++ lib.optionals crypto [ gnutls libgcrypt ]
+    ++ lib.optionals stdenv.isDarwin [ macfuse-stubs DiskArbitration ];
+  nativeBuildInputs = [ pkg-config ];
 
   src = fetchurl {
     url = "https://tuxera.com/opensource/ntfs-3g_ntfsprogs-${version}.tgz";
@@ -19,8 +22,8 @@ stdenv.mkDerivation rec {
     substituteInPlace src/Makefile.in --replace /sbin '@sbindir@'
     substituteInPlace ntfsprogs/Makefile.in --replace /sbin '@sbindir@'
     substituteInPlace libfuse-lite/mount_util.c \
-      --replace /bin/mount ${util-linux}/bin/mount \
-      --replace /bin/umount ${util-linux}/bin/umount
+      --replace /bin/mount ${mount}/bin/mount \
+      --replace /bin/umount ${mount}/bin/umount
   '';
 
   configureFlags = [
@@ -43,7 +46,10 @@ stdenv.mkDerivation rec {
     homepage = "https://www.tuxera.com/community/open-source-ntfs-3g/";
     description = "FUSE-based NTFS driver with full write support";
     maintainers = with maintainers; [ dezgeg ];
-    platforms = platforms.linux;
-    license = licenses.gpl2Plus; # and (lib)fuse-lite under LGPL2+
+    platforms = with platforms; darwin ++ linux;
+    license = with licenses; [
+      gpl2Plus # ntfs-3g itself
+      lgpl2Plus # fuse-lite
+    ];
   };
 }
diff --git a/pkgs/tools/misc/hdf5/default.nix b/pkgs/tools/misc/hdf5/default.nix
index e97a6dbdd18..712fae7f71f 100644
--- a/pkgs/tools/misc/hdf5/default.nix
+++ b/pkgs/tools/misc/hdf5/default.nix
@@ -19,11 +19,11 @@ assert !cpp || !mpiSupport;
 let inherit (lib) optional optionals; in
 
 stdenv.mkDerivation rec {
-  version = "1.10.7";
+  version = "1.12.0";
   pname = "hdf5";
   src = fetchurl {
-    url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/${pname}-${version}/src/${pname}-${version}.tar.bz2";
-    sha256 = "0pm5xxry55i0h7wmvc7svzdaa90rnk7h78rrjmnlkz2ygsn8y082";
+    url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${lib.versions.majorMinor version}/${pname}-${version}/src/${pname}-${version}.tar.bz2";
+    sha256 = "0qazfslkqbmzg495jafpvqp0khws3jkxa0z7rph9qvhacil6544p";
   };
 
   passthru = {
diff --git a/pkgs/tools/networking/networkmanager/default.nix b/pkgs/tools/networking/networkmanager/default.nix
index ba172a3922d..c2de2ed8adb 100644
--- a/pkgs/tools/networking/networkmanager/default.nix
+++ b/pkgs/tools/networking/networkmanager/default.nix
@@ -10,11 +10,11 @@ let
   pythonForDocs = python3.withPackages (pkgs: with pkgs; [ pygobject3 ]);
 in stdenv.mkDerivation rec {
   pname = "networkmanager";
-  version = "1.30.0";
+  version = "1.30.2";
 
   src = fetchurl {
     url = "mirror://gnome/sources/NetworkManager/${lib.versions.majorMinor version}/NetworkManager-${version}.tar.xz";
-    sha256 = "1yf3k3pcszn904lk6rdya1qhp3yxbzsbhcd9l6yfrhlbc8r15w1r";
+    sha256 = "sha256-DI6A53h3hg5KTmq0oPfNwRhuNWtlsEKnUYlxiLiJRNI=";
   };
 
   outputs = [ "out" "dev" "devdoc" "man" "doc" ];
diff --git a/pkgs/tools/virtualization/govc/default.nix b/pkgs/tools/virtualization/govc/default.nix
index bfe11127a92..3727d1ac1da 100644
--- a/pkgs/tools/virtualization/govc/default.nix
+++ b/pkgs/tools/virtualization/govc/default.nix
@@ -2,7 +2,7 @@
 
 buildGoPackage rec {
   pname = "govc";
-  version = "0.24.0";
+  version = "0.24.1";
 
   goPackagePath = "github.com/vmware/govmomi";
 
@@ -12,7 +12,7 @@ buildGoPackage rec {
     rev = "v${version}";
     owner = "vmware";
     repo = "govmomi";
-    sha256 = "sha256-Urfrkeqbl0+GB2Vr2IfekiilRvGcG0vGO5MGeZcP4C8=";
+    sha256 = "sha256-D2UrYdjstOxx9EAdBtAC44khp8hRf6W3+6kzytUVnOo=";
   };
 
   meta = {
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 960b672c96f..3487b8f2681 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -6818,7 +6818,9 @@ in
 
   nss_pam_ldapd = callPackage ../tools/networking/nss-pam-ldapd {};
 
-  ntfs3g = callPackage ../tools/filesystems/ntfs-3g { };
+  ntfs3g = callPackage ../tools/filesystems/ntfs-3g {
+    inherit (darwin.apple_sdk.frameworks) DiskArbitration;
+  };
 
   # ntfsprogs are merged into ntfs-3g
   ntfsprogs = pkgs.ntfs3g;
@@ -14045,7 +14047,9 @@ in
 
   cfitsio = callPackage ../development/libraries/cfitsio { };
 
-  fontconfig = callPackage ../development/libraries/fontconfig { };
+  fontconfig = callPackage ../development/libraries/fontconfig {
+    inherit (darwin.apple_sdk.frameworks) CoreFoundation;
+  };
 
   folly = callPackage ../development/libraries/folly { };
 
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 3bedb3d1816..eda6869c472 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -22,7 +22,10 @@ let
 
   namePrefix = python.libPrefix + "-";
 
-  bootstrapped-pip = callPackage ../development/python-modules/bootstrapped-pip { };
+  bootstrapped-pip = if isPy3k then
+    callPackage ../development/python-modules/bootstrapped-pip { }
+  else
+    callPackage ../development/python-modules/bootstrapped-pip/2.nix { };
 
   # Derivations built with `buildPythonPackage` can already be overriden with `override`, `overrideAttrs`, and `overrideDerivation`.
   # This function introduces `overridePythonAttrs` and it overrides the call to `buildPythonPackage`.
@@ -5127,7 +5130,10 @@ in {
 
   pint = callPackage ../development/python-modules/pint { };
 
-  pip = callPackage ../development/python-modules/pip { };
+  pip = if isPy3k then
+    callPackage ../development/python-modules/pip { }
+  else
+    callPackage ../development/python-modules/pip/20.nix { };
 
   pipdate = callPackage ../development/python-modules/pipdate { };