summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/compilers/gcc/4.8/default.nix1
-rw-r--r--pkgs/development/compilers/gcc/4.9/default.nix1
-rw-r--r--pkgs/development/compilers/gcc/5/default.nix1
-rw-r--r--pkgs/development/compilers/go/1.10.nix6
-rw-r--r--pkgs/development/compilers/go/1.11.nix7
-rw-r--r--pkgs/development/compilers/go/1.12.nix5
-rw-r--r--pkgs/development/compilers/ldc/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/3.7/libc++/default.nix1
-rw-r--r--pkgs/development/compilers/llvm/3.9/llvm.nix16
-rw-r--r--pkgs/development/compilers/llvm/4/lld.nix1
-rw-r--r--pkgs/development/compilers/llvm/4/llvm.nix16
-rw-r--r--pkgs/development/compilers/llvm/5/lld.nix1
-rw-r--r--pkgs/development/compilers/llvm/5/llvm.nix16
-rw-r--r--pkgs/development/compilers/llvm/6/llvm.nix15
-rw-r--r--pkgs/development/compilers/llvm/7/clang/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/7/compiler-rt-clock_gettime.patch74
-rw-r--r--pkgs/development/compilers/llvm/7/compiler-rt.nix7
-rw-r--r--pkgs/development/compilers/llvm/7/default.nix4
-rw-r--r--pkgs/development/compilers/llvm/7/libc++/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/7/libc++abi.nix2
-rw-r--r--pkgs/development/compilers/llvm/7/lld.nix2
-rw-r--r--pkgs/development/compilers/llvm/7/lldb.nix2
-rw-r--r--pkgs/development/compilers/llvm/7/llvm.nix22
-rw-r--r--pkgs/development/compilers/llvm/7/openmp.nix2
-rw-r--r--pkgs/development/compilers/llvm/8/compiler-rt-clock_gettime.patch74
-rw-r--r--pkgs/development/compilers/llvm/8/compiler-rt.nix3
-rw-r--r--pkgs/development/compilers/rust/default.nix11
-rw-r--r--pkgs/development/haskell-modules/configuration-nix.nix19
-rw-r--r--pkgs/development/interpreters/guile/2.0.nix9
-rw-r--r--pkgs/development/interpreters/guile/default.nix8
-rw-r--r--pkgs/development/interpreters/guile/filter-mkostemp-darwin.patch28
-rw-r--r--pkgs/development/interpreters/python/cpython/2.7/default.nix2
-rw-r--r--pkgs/development/interpreters/python/cpython/default.nix2
-rw-r--r--pkgs/development/interpreters/python/default.nix3
-rw-r--r--pkgs/development/interpreters/python/pypy/default.nix1
-rw-r--r--pkgs/development/interpreters/python/pypy/prebuilt.nix1
-rw-r--r--pkgs/development/interpreters/python/setup-hook.sh4
-rw-r--r--pkgs/development/interpreters/tcl/8.6.nix4
-rw-r--r--pkgs/development/interpreters/tcl/generic.nix5
-rw-r--r--pkgs/development/libraries/boost/1.67.nix32
-rw-r--r--pkgs/development/libraries/boost/generic.nix5
-rw-r--r--pkgs/development/libraries/bullet/default.nix2
-rw-r--r--pkgs/development/libraries/clucene-core/2.x.nix2
-rw-r--r--pkgs/development/libraries/glib/default.nix4
-rw-r--r--pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch50
-rw-r--r--pkgs/development/libraries/gobject-introspection/default.nix5
-rw-r--r--pkgs/development/libraries/gobject-introspection/macos-shared-library.patch36
-rw-r--r--pkgs/development/libraries/gobject-introspection/test_shlibs.patch31
-rw-r--r--pkgs/development/libraries/libao/default.nix2
-rw-r--r--pkgs/development/libraries/libcdio/default.nix2
-rw-r--r--pkgs/development/libraries/libcroco/default.nix19
-rw-r--r--pkgs/development/libraries/libdrm/default.nix5
-rw-r--r--pkgs/development/libraries/libdrm/libdrm-apple.patch88
-rw-r--r--pkgs/development/libraries/libproxy/default.nix8
-rw-r--r--pkgs/development/libraries/libsnark/darwin-fix-clock-gettime.patch41
-rw-r--r--pkgs/development/libraries/libsnark/default.nix2
-rw-r--r--pkgs/development/libraries/libsoup/default.nix4
-rw-r--r--pkgs/development/libraries/libtins/default.nix6
-rw-r--r--pkgs/development/libraries/libuv/default.nix4
-rw-r--r--pkgs/development/libraries/libva/default.nix4
-rw-r--r--pkgs/development/libraries/libxslt/default.nix10
-rw-r--r--pkgs/development/libraries/mesa/darwin-clock-gettime.patch76
-rw-r--r--pkgs/development/libraries/mesa/default.nix2
-rw-r--r--pkgs/development/libraries/polkit/default.nix38
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/default.nix1
-rw-r--r--pkgs/development/libraries/qt-5/5.11/default.nix32
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtbase-darwin-nseventtype.patch13
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtbase-darwin-revert-69221.patch73
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtbase-darwin.patch70
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtbase-revert-no-macos10.10.patch102
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtwebengine-clang-fix.patch30
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-old-sdk.patch21
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-sdk-10.10.patch160
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtwebkit-darwin-no-qos-classes.patch11
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtwebkit-darwin-no-readline.patch45
-rw-r--r--pkgs/development/libraries/qt-5/5.12/default.nix12
-rw-r--r--pkgs/development/libraries/qt-5/5.12/qtbase-darwin-nseventtype.patch13
-rw-r--r--pkgs/development/libraries/qt-5/5.12/qtbase-darwin.patch70
-rw-r--r--pkgs/development/libraries/qt-5/5.12/qtbase-revert-no-macos10.10.patch102
-rw-r--r--pkgs/development/libraries/qt-5/5.9/default.nix2
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qtbase-darwin.patch35
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtbase.nix36
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtwebengine.nix2
-rw-r--r--pkgs/development/libraries/science/math/fenics/default.nix9
-rw-r--r--pkgs/development/libraries/science/math/openblas/default.nix1
-rw-r--r--pkgs/development/libraries/sqlite/analyzer.nix6
-rw-r--r--pkgs/development/libraries/sqlite/default.nix8
-rw-r--r--pkgs/development/libraries/tk/8.6.nix4
-rw-r--r--pkgs/development/libraries/tk/generic.nix11
-rw-r--r--pkgs/development/libraries/wxwidgets/2.9/default.nix3
-rw-r--r--pkgs/development/libraries/wxwidgets/3.0/default.nix1
-rw-r--r--pkgs/development/libraries/wxwidgets/3.0/mac.nix1
-rw-r--r--pkgs/development/python-modules/Wand/default.nix4
-rw-r--r--pkgs/development/python-modules/ansible-runner/default.nix4
-rw-r--r--pkgs/development/python-modules/asyncssh/default.nix36
-rw-r--r--pkgs/development/python-modules/asyncssh/fix-sftp-chmod-test-nixos.patch15
-rw-r--r--pkgs/development/python-modules/atomman/default.nix4
-rw-r--r--pkgs/development/python-modules/aws-sam-translator/default.nix2
-rw-r--r--pkgs/development/python-modules/azure-common/default.nix4
-rw-r--r--pkgs/development/python-modules/cffi/default.nix6
-rw-r--r--pkgs/development/python-modules/cfn-lint/default.nix40
-rw-r--r--pkgs/development/python-modules/cryptography/default.nix8
-rw-r--r--pkgs/development/python-modules/cx_oracle/default.nix4
-rw-r--r--pkgs/development/python-modules/cypari2/default.nix4
-rw-r--r--pkgs/development/python-modules/django_silk/default.nix4
-rw-r--r--pkgs/development/python-modules/ecdsa/default.nix4
-rw-r--r--pkgs/development/python-modules/genanki/default.nix4
-rw-r--r--pkgs/development/python-modules/gsd/default.nix4
-rw-r--r--pkgs/development/python-modules/httplib2/default.nix4
-rw-r--r--pkgs/development/python-modules/j2cli/default.nix4
-rw-r--r--pkgs/development/python-modules/jdcal/default.nix4
-rw-r--r--pkgs/development/python-modules/jinja2/default.nix3
-rw-r--r--pkgs/development/python-modules/junos-eznc/default.nix4
-rw-r--r--pkgs/development/python-modules/matplotlib/2.nix2
-rw-r--r--pkgs/development/python-modules/matplotlib/darwin-stdenv-2.2.3.patch10
-rw-r--r--pkgs/development/python-modules/matplotlib/darwin-stdenv.patch12
-rw-r--r--pkgs/development/python-modules/matplotlib/default.nix3
-rw-r--r--pkgs/development/python-modules/mecab-python3/default.nix4
-rw-r--r--pkgs/development/python-modules/moto/default.nix7
-rw-r--r--pkgs/development/python-modules/nameparser/default.nix4
-rw-r--r--pkgs/development/python-modules/nilearn/default.nix4
-rw-r--r--pkgs/development/python-modules/numpy/default.nix6
-rw-r--r--pkgs/development/python-modules/objgraph/default.nix4
-rw-r--r--pkgs/development/python-modules/paho-mqtt/default.nix4
-rw-r--r--pkgs/development/python-modules/papis/default.nix3
-rw-r--r--pkgs/development/python-modules/phonenumbers/default.nix4
-rw-r--r--pkgs/development/python-modules/pyasn1-modules/default.nix22
-rw-r--r--pkgs/development/python-modules/pycairo/default.nix4
-rw-r--r--pkgs/development/python-modules/pygobject/3.nix4
-rw-r--r--pkgs/development/python-modules/pyro-ppl/default.nix4
-rw-r--r--pkgs/development/python-modules/pyrr/default.nix4
-rw-r--r--pkgs/development/python-modules/pyspark/default.nix4
-rw-r--r--pkgs/development/python-modules/pytest-mock/default.nix4
-rw-r--r--pkgs/development/python-modules/ruamel_yaml/default.nix4
-rw-r--r--pkgs/development/python-modules/s3fs/default.nix4
-rw-r--r--pkgs/development/python-modules/setuptools/default.nix4
-rw-r--r--pkgs/development/python-modules/smart_open/default.nix4
-rw-r--r--pkgs/development/python-modules/sparqlwrapper/default.nix4
-rw-r--r--pkgs/development/python-modules/sqlalchemy-migrate/default.nix2
-rw-r--r--pkgs/development/python-modules/sseclient/default.nix4
-rw-r--r--pkgs/development/python-modules/typed-ast/default.nix4
-rw-r--r--pkgs/development/python-modules/urllib3/default.nix4
-rw-r--r--pkgs/development/python-modules/xkcdpass/default.nix4
-rw-r--r--pkgs/development/python-modules/xlib/default.nix2
-rw-r--r--pkgs/development/python-modules/xml2rfc/default.nix3
-rw-r--r--pkgs/development/python-modules/zope_testrunner/default.nix2
-rw-r--r--pkgs/development/tools/analysis/valgrind/default.nix19
-rw-r--r--pkgs/development/tools/build-managers/cmake/application-services.patch12
-rw-r--r--pkgs/development/tools/build-managers/cmake/default.nix3
-rw-r--r--pkgs/development/tools/build-managers/dub/default.nix2
-rw-r--r--pkgs/development/tools/gnulib/default.nix9
-rw-r--r--pkgs/development/tools/misc/gnum4/darwin-secure-format.patch15
-rw-r--r--pkgs/development/tools/misc/gnum4/default.nix3
-rw-r--r--pkgs/development/tools/misc/tokei/default.nix4
-rw-r--r--pkgs/development/tools/xcbuild/toolchains.nix1
-rw-r--r--pkgs/development/tools/xcbuild/wrapper.nix14
-rw-r--r--pkgs/development/web/nodejs/v12.nix10
157 files changed, 572 insertions, 1578 deletions
diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix
index b9a24183cde..d03c2b64894 100644
--- a/pkgs/development/compilers/gcc/4.8/default.nix
+++ b/pkgs/development/compilers/gcc/4.8/default.nix
@@ -418,6 +418,7 @@ stdenv.mkDerivation ({
       stdenv.lib.platforms.freebsd ++
       stdenv.lib.platforms.illumos ++
       stdenv.lib.platforms.darwin;
+    badPlatforms = [ "x86_64-darwin" ];
   };
 }
 
diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix
index 36ad5b46b79..3ce5ea1f64c 100644
--- a/pkgs/development/compilers/gcc/4.9/default.nix
+++ b/pkgs/development/compilers/gcc/4.9/default.nix
@@ -430,6 +430,7 @@ stdenv.mkDerivation ({
       stdenv.lib.platforms.freebsd ++
       stdenv.lib.platforms.illumos ++
       stdenv.lib.platforms.darwin;
+    badPlatforms = [ "x86_64-darwin" ];
   };
 }
 
diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix
index 2d7ac9497bb..e6115b10481 100644
--- a/pkgs/development/compilers/gcc/5/default.nix
+++ b/pkgs/development/compilers/gcc/5/default.nix
@@ -435,6 +435,7 @@ stdenv.mkDerivation ({
       stdenv.lib.platforms.freebsd ++
       stdenv.lib.platforms.illumos ++
       stdenv.lib.platforms.darwin;
+    badPlatforms = [ "x86_64-darwin" ];
   };
 }
 
diff --git a/pkgs/development/compilers/go/1.10.nix b/pkgs/development/compilers/go/1.10.nix
index 5dce1529a8b..d18d260b505 100644
--- a/pkgs/development/compilers/go/1.10.nix
+++ b/pkgs/development/compilers/go/1.10.nix
@@ -131,11 +131,6 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  postPatch = optionalString stdenv.isDarwin ''
-    echo "substitute hardcoded dsymutil with ${llvm}/bin/llvm-dsymutil"
-    substituteInPlace "src/cmd/link/internal/ld/lib.go" --replace dsymutil ${llvm}/bin/llvm-dsymutil
-  '';
-
   GOOS = if stdenv.isDarwin then "darwin" else "linux";
   GOARCH = if stdenv.isDarwin then "amd64"
            else if stdenv.hostPlatform.system == "i686-linux" then "386"
@@ -187,5 +182,6 @@ stdenv.mkDerivation rec {
     license = licenses.bsd3;
     maintainers = with maintainers; [ cstrahan orivej velovix mic92 ];
     platforms = platforms.linux ++ platforms.darwin;
+    badPlatforms = [ "x86_64-darwin" ];
   };
 }
diff --git a/pkgs/development/compilers/go/1.11.nix b/pkgs/development/compilers/go/1.11.nix
index 1e3a63983f4..eec472fb88e 100644
--- a/pkgs/development/compilers/go/1.11.nix
+++ b/pkgs/development/compilers/go/1.11.nix
@@ -136,11 +136,6 @@ stdenv.mkDerivation rec {
     ./skip-test-extra-files-on-386.patch
   ];
 
-  postPatch = optionalString stdenv.isDarwin ''
-    echo "substitute hardcoded dsymutil with ${llvm}/bin/llvm-dsymutil"
-    substituteInPlace "src/cmd/link/internal/ld/lib.go" --replace dsymutil ${llvm}/bin/llvm-dsymutil
-  '';
-
   GOOS = stdenv.targetPlatform.parsed.kernel.name;
   GOARCH = goarch stdenv.targetPlatform;
   # GOHOSTOS/GOHOSTARCH must match the building system, not the host system.
@@ -188,7 +183,7 @@ stdenv.mkDerivation rec {
     (cd src && ./make.bash)
   '';
 
-  doCheck = stdenv.hostPlatform == stdenv.targetPlatform;
+  doCheck = stdenv.hostPlatform == stdenv.targetPlatform && !stdenv.isDarwin;
 
   checkPhase = ''
     runHook preCheck
diff --git a/pkgs/development/compilers/go/1.12.nix b/pkgs/development/compilers/go/1.12.nix
index 44304006f6b..68f9d1d531f 100644
--- a/pkgs/development/compilers/go/1.12.nix
+++ b/pkgs/development/compilers/go/1.12.nix
@@ -141,9 +141,6 @@ stdenv.mkDerivation rec {
 
   postPatch = ''
     find . -name '*.orig' -exec rm {} ';'
-  '' + optionalString stdenv.isDarwin ''
-    echo "substitute hardcoded dsymutil with ${llvm}/bin/llvm-dsymutil"
-    substituteInPlace "src/cmd/link/internal/ld/lib.go" --replace dsymutil ${llvm}/bin/llvm-dsymutil
   '';
 
   GOOS = stdenv.targetPlatform.parsed.kernel.name;
@@ -193,7 +190,7 @@ stdenv.mkDerivation rec {
     (cd src && ./make.bash)
   '';
 
-  doCheck = stdenv.hostPlatform == stdenv.targetPlatform;
+  doCheck = stdenv.hostPlatform == stdenv.targetPlatform && !stdenv.isDarwin;
 
   checkPhase = ''
     runHook preCheck
diff --git a/pkgs/development/compilers/ldc/default.nix b/pkgs/development/compilers/ldc/default.nix
index 71473be580e..043347889c8 100644
--- a/pkgs/development/compilers/ldc/default.nix
+++ b/pkgs/development/compilers/ldc/default.nix
@@ -150,7 +150,7 @@ stdenv.mkDerivation rec {
   else
     "";
 
-  doCheck = !bootstrapVersion;
+  doCheck = !bootstrapVersion && !stdenv.isDarwin;
 
   checkPhase = stdenv.lib.optionalString doCheck ''
     # Build default lib test runners
diff --git a/pkgs/development/compilers/llvm/3.7/libc++/default.nix b/pkgs/development/compilers/llvm/3.7/libc++/default.nix
index 462e35a483f..7b7ac7297ba 100644
--- a/pkgs/development/compilers/llvm/3.7/libc++/default.nix
+++ b/pkgs/development/compilers/llvm/3.7/libc++/default.nix
@@ -43,5 +43,6 @@ stdenv.mkDerivation rec {
     description = "A new implementation of the C++ standard library, targeting C++11";
     license = with stdenv.lib.licenses; [ ncsa mit ];
     platforms = stdenv.lib.platforms.unix;
+    badPlatforms = [ "x86_64-darwin" ];
   };
 }
diff --git a/pkgs/development/compilers/llvm/3.9/llvm.nix b/pkgs/development/compilers/llvm/3.9/llvm.nix
index 6c935fd88de..174cb17908c 100644
--- a/pkgs/development/compilers/llvm/3.9/llvm.nix
+++ b/pkgs/development/compilers/llvm/3.9/llvm.nix
@@ -22,10 +22,13 @@ assert (stdenv.hostPlatform != stdenv.buildPlatform) -> !enableSharedLibraries;
 let
   src = fetch "llvm" "1vi9sf7rx1q04wj479rsvxayb6z740iaz3qniwp266fgp5a07n8z";
 
-  # Used when creating a version-suffixed symlink of libLLVM.dylib
-  shortVersion = with stdenv.lib;
-    concatStringsSep "." (take 2 (splitString "." version));
-in stdenv.mkDerivation rec {
+  # Used when creating a versioned symlinks of libLLVM.dylib
+  versionSuffixes = with stdenv.lib;
+    let parts = splitString "." version; in
+    imap (i: _: concatStringsSep "." (take i parts)) parts;
+in
+
+stdenv.mkDerivation {
   name = "llvm-${version}";
 
   unpackPhase = ''
@@ -153,8 +156,9 @@ in stdenv.mkDerivation rec {
   + stdenv.lib.optionalString (stdenv.isDarwin && enableSharedLibraries) ''
     substituteInPlace "$out/lib/cmake/llvm/LLVMExports-release.cmake" \
       --replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib"
-    ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib
-    ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${version}.dylib
+    ${stdenv.lib.concatMapStringsSep "\n" (v: ''
+      ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib
+    '') versionSuffixes}
   '';
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/compilers/llvm/4/lld.nix b/pkgs/development/compilers/llvm/4/lld.nix
index 21b0c1c3601..cf6de26a9e8 100644
--- a/pkgs/development/compilers/llvm/4/lld.nix
+++ b/pkgs/development/compilers/llvm/4/lld.nix
@@ -27,5 +27,6 @@ stdenv.mkDerivation {
     homepage    = http://lld.llvm.org/;
     license     = stdenv.lib.licenses.ncsa;
     platforms   = stdenv.lib.platforms.all;
+    badPlatforms = [ "x86_64-darwin" ];
   };
 }
diff --git a/pkgs/development/compilers/llvm/4/llvm.nix b/pkgs/development/compilers/llvm/4/llvm.nix
index 5cd7901fe22..ecb18a58054 100644
--- a/pkgs/development/compilers/llvm/4/llvm.nix
+++ b/pkgs/development/compilers/llvm/4/llvm.nix
@@ -19,10 +19,13 @@
 let
   src = fetch "llvm" "0l9bf7kdwhlj0kq1hawpyxhna1062z3h7qcz2y8nfl9dz2qksy6s";
 
-  # Used when creating a version-suffixed symlink of libLLVM.dylib
-  shortVersion = with stdenv.lib;
-    concatStringsSep "." (take 2 (splitString "." release_version));
-in stdenv.mkDerivation (rec {
+  # Used when creating a versioned symlinks of libLLVM.dylib
+  versionSuffixes = with stdenv.lib;
+    let parts = splitString "." release_version; in
+    imap (i: _: concatStringsSep "." (take i parts)) parts;
+in
+
+stdenv.mkDerivation (rec {
   name = "llvm-${version}";
 
   unpackPhase = ''
@@ -136,8 +139,9 @@ in stdenv.mkDerivation (rec {
   + stdenv.lib.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"
-    ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib
-    ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
+    ${stdenv.lib.concatMapStringsSep "\n" (v: ''
+      ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib
+    '') versionSuffixes}
   '';
 
   doCheck = stdenv.isLinux && (!stdenv.isi686);
diff --git a/pkgs/development/compilers/llvm/5/lld.nix b/pkgs/development/compilers/llvm/5/lld.nix
index 9a47435cf14..bf23f80ef10 100644
--- a/pkgs/development/compilers/llvm/5/lld.nix
+++ b/pkgs/development/compilers/llvm/5/lld.nix
@@ -27,5 +27,6 @@ stdenv.mkDerivation {
     homepage    = http://lld.llvm.org/;
     license     = stdenv.lib.licenses.ncsa;
     platforms   = stdenv.lib.platforms.all;
+    badPlatforms = [ "x86_64-darwin" ];
   };
 }
diff --git a/pkgs/development/compilers/llvm/5/llvm.nix b/pkgs/development/compilers/llvm/5/llvm.nix
index 41dc20ec4fe..d6839f0f290 100644
--- a/pkgs/development/compilers/llvm/5/llvm.nix
+++ b/pkgs/development/compilers/llvm/5/llvm.nix
@@ -18,10 +18,13 @@
 let
   src = fetch "llvm" "0g1bbj2n6xv4p1n6hh17vj3vpvg56wacipc81dgwga9mg2lys8nm";
 
-  # Used when creating a version-suffixed symlink of libLLVM.dylib
-  shortVersion = with stdenv.lib;
-    concatStringsSep "." (take 2 (splitString "." release_version));
-in stdenv.mkDerivation (rec {
+  # Used when creating a versioned symlinks of libLLVM.dylib
+  versionSuffixes = with stdenv.lib;
+    let parts = splitString "." release_version; in
+    imap (i: _: concatStringsSep "." (take i parts)) parts;
+in
+
+stdenv.mkDerivation (rec {
   name = "llvm-${version}";
 
   unpackPhase = ''
@@ -119,8 +122,9 @@ in stdenv.mkDerivation (rec {
     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"
-    ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib
-    ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
+    ${stdenv.lib.concatMapStringsSep "\n" (v: ''
+      ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib
+    '') versionSuffixes}
   '';
 
   doCheck = stdenv.isLinux && (!stdenv.isi686);
diff --git a/pkgs/development/compilers/llvm/6/llvm.nix b/pkgs/development/compilers/llvm/6/llvm.nix
index 1d96513a0ec..9237d442b77 100644
--- a/pkgs/development/compilers/llvm/6/llvm.nix
+++ b/pkgs/development/compilers/llvm/6/llvm.nix
@@ -21,11 +21,13 @@ let
 
   src = fetch "llvm" "1qpls3vk85lydi5b4axl0809fv932qgsqgdgrk098567z4jc7mmn";
 
-  # Used when creating a version-suffixed symlink of libLLVM.dylib
-  shortVersion = with stdenv.lib;
-    concatStringsSep "." (take 2 (splitString "." release_version));
+  # Used when creating a versioned symlinks of libLLVM.dylib
+  versionSuffixes = with stdenv.lib;
+    let parts = splitString "." release_version; in
+    imap (i: _: concatStringsSep "." (take i parts)) parts;
+in
 
-in stdenv.mkDerivation (rec {
+stdenv.mkDerivation (rec {
   name = "llvm-${version}";
 
   unpackPhase = ''
@@ -133,8 +135,9 @@ in stdenv.mkDerivation (rec {
   + 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"
-    ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib
-    ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
+    ${stdenv.lib.concatMapStringsSep "\n" (v: ''
+      ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib
+    '') versionSuffixes}
   '';
 
   doCheck = stdenv.isLinux && (!stdenv.isi686);
diff --git a/pkgs/development/compilers/llvm/7/clang/default.nix b/pkgs/development/compilers/llvm/7/clang/default.nix
index e4252647ce6..a4877b3fe6f 100644
--- a/pkgs/development/compilers/llvm/7/clang/default.nix
+++ b/pkgs/development/compilers/llvm/7/clang/default.nix
@@ -9,7 +9,7 @@ let
     name = "clang-${version}";
 
     unpackPhase = ''
-      unpackFile ${fetch "cfe" "067lwggnbg0w1dfrps790r5l6k8n5zwhlsw7zb6zvmfpwpfn4nx4"}
+      unpackFile ${fetch "cfe" "0vc4i87qwxnw9lci4ayws9spakg0z6w5w670snj9f8g5m9rc8zg9"}
       mv cfe-${version}* clang
       sourceRoot=$PWD/clang
       unpackFile ${clang-tools-extra_src}
diff --git a/pkgs/development/compilers/llvm/7/compiler-rt-clock_gettime.patch b/pkgs/development/compilers/llvm/7/compiler-rt-clock_gettime.patch
deleted file mode 100644
index f9323ed95c0..00000000000
--- a/pkgs/development/compilers/llvm/7/compiler-rt-clock_gettime.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-commit f00c7bccf7955b7dfbb4859fd9019e9eb3349f2d
-Author: Tobias Mayer <tobim@fastmail.fm>
-Date:   Wed Feb 13 12:44:17 2019 +0100
-
-    Provide clock_gettime for xray on macos < 10.12
-
-diff --git a/lib/xray/xray_basic_logging.cc b/lib/xray/xray_basic_logging.cc
-index a46c151af..38aea6932 100644
---- a/lib/xray/xray_basic_logging.cc
-+++ b/lib/xray/xray_basic_logging.cc
-@@ -36,6 +36,29 @@
- #include "xray_tsc.h"
- #include "xray_utils.h"
- 
-+#if __MACH__
-+#include <mach/clock.h>
-+#include <mach/mach.h>
-+enum clockid_t {
-+    CLOCK_MONOTONIC = REALTIME_CLOCK,
-+    CLOCK_REALTIME = REALTIME_CLOCK
-+};
-+
-+int clock_gettime(clockid_t clock_id, struct timespec *ts) {
-+  if (ts != NULL) {
-+      clock_serv_t cclock;
-+      mach_timespec_t mts;
-+      host_get_clock_service(mach_host_self(), clock_id, &cclock);
-+      clock_get_time(cclock, &mts);
-+      mach_port_deallocate(mach_task_self(), cclock);
-+      ts->tv_sec = mts.tv_sec;
-+      ts->tv_nsec = mts.tv_nsec;
-+      return 0;
-+  }
-+  return -1;
-+}
-+#endif
-+
- namespace __xray {
- 
- SpinMutex LogMutex;
-diff --git a/lib/xray/xray_fdr_logging.cc b/lib/xray/xray_fdr_logging.cc
-index 4b308b27f..1d044c8fd 100644
---- a/lib/xray/xray_fdr_logging.cc
-+++ b/lib/xray/xray_fdr_logging.cc
-@@ -38,6 +38,29 @@
- #include "xray_tsc.h"
- #include "xray_utils.h"
- 
-+#if __MACH__
-+#include <mach/clock.h>
-+#include <mach/mach.h>
-+enum clockid_t {
-+    CLOCK_MONOTONIC = REALTIME_CLOCK,
-+    CLOCK_REALTIME = REALTIME_CLOCK
-+};
-+
-+int clock_gettime(clockid_t clock_id, struct timespec *ts) {
-+  if (ts != NULL) {
-+      clock_serv_t cclock;
-+      mach_timespec_t mts;
-+      host_get_clock_service(mach_host_self(), clock_id, &cclock);
-+      clock_get_time(cclock, &mts);
-+      mach_port_deallocate(mach_task_self(), cclock);
-+      ts->tv_sec = mts.tv_sec;
-+      ts->tv_nsec = mts.tv_nsec;
-+      return 0;
-+  }
-+  return -1;
-+}
-+#endif
-+
- namespace __xray {
- 
- atomic_sint32_t LoggingStatus = {XRayLogInitStatus::XRAY_LOG_UNINITIALIZED};
diff --git a/pkgs/development/compilers/llvm/7/compiler-rt.nix b/pkgs/development/compilers/llvm/7/compiler-rt.nix
index 7a6c91fb832..989529ff8cc 100644
--- a/pkgs/development/compilers/llvm/7/compiler-rt.nix
+++ b/pkgs/development/compilers/llvm/7/compiler-rt.nix
@@ -2,7 +2,7 @@
 stdenv.mkDerivation rec {
   name = "compiler-rt-${version}";
   inherit version;
-  src = fetch "compiler-rt" "065ybd8fsc4h2hikbdyricj6pyv4r7r7kpcikhb2y5zf370xybkq";
+  src = fetch "compiler-rt" "1n48p8gjarihkws0i2bay5w9bdwyxyxxbpwyng7ba58jb30dlyq5";
 
   nativeBuildInputs = [ cmake python llvm ];
   buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
@@ -26,9 +26,8 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
-  ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
-    ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ./crtbegin-and-end.patch
-    ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin ./compiler-rt-clock_gettime.patch;
+  ] ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ./crtbegin-and-end.patch
+    ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch;
 
   # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
   # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
diff --git a/pkgs/development/compilers/llvm/7/default.nix b/pkgs/development/compilers/llvm/7/default.nix
index 060bef69bc1..7f99cc9ae2c 100644
--- a/pkgs/development/compilers/llvm/7/default.nix
+++ b/pkgs/development/compilers/llvm/7/default.nix
@@ -5,7 +5,7 @@
 }:
 
 let
-  release_version = "7.0.1";
+  release_version = "7.1.0";
   version = release_version; # differentiating these is important for rc's
 
   fetch = name: sha256: fetchurl {
@@ -13,7 +13,7 @@ let
     inherit sha256;
   };
 
-  clang-tools-extra_src = fetch "clang-tools-extra" "1v9vc7id1761qm7mywlknsp810232iwyz8rd4y5km4h7pg9cg4sc";
+  clang-tools-extra_src = fetch "clang-tools-extra" "0lb4kdh7j2fhfz8kd6iv5df7m3pikiryk1vvwsf87spc90n09q0w";
 
   tools = stdenv.lib.makeExtensible (tools: let
     callPackage = newScope (tools // { inherit stdenv cmake libxml2 python isl release_version version fetch; });
diff --git a/pkgs/development/compilers/llvm/7/libc++/default.nix b/pkgs/development/compilers/llvm/7/libc++/default.nix
index d372984dac7..e2ec4e274f4 100644
--- a/pkgs/development/compilers/llvm/7/libc++/default.nix
+++ b/pkgs/development/compilers/llvm/7/libc++/default.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation rec {
   name = "libc++-${version}";
 
-  src = fetch "libcxx" "1wdrxg365ig0kngx52pd0n820sncp24blb0zpalc579iidhh4002";
+  src = fetch "libcxx" "0kmhcapm2cjwalyiqasj9dmqbw59mcwdl8fgl951wg7ax84b8hj4";
 
   postUnpack = ''
     unpackFile ${libcxxabi.src}
diff --git a/pkgs/development/compilers/llvm/7/libc++abi.nix b/pkgs/development/compilers/llvm/7/libc++abi.nix
index b65b75b3688..2fe6f1c58f6 100644
--- a/pkgs/development/compilers/llvm/7/libc++abi.nix
+++ b/pkgs/development/compilers/llvm/7/libc++abi.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation {
   name = "libc++abi-${version}";
 
-  src = fetch "libcxxabi" "1n6yx0949l9bprh75dffchahn8wplkm79ffk4f2ap9vw2lx90s41";
+  src = fetch "libcxxabi" "1zcqxsdjhawgz1cvpk07y3jl6fg9p3ay4nl69zsirqb2ghgyhhb2";
 
   nativeBuildInputs = [ cmake ];
   buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;
diff --git a/pkgs/development/compilers/llvm/7/lld.nix b/pkgs/development/compilers/llvm/7/lld.nix
index 33085eb3c80..63ad43e62cd 100644
--- a/pkgs/development/compilers/llvm/7/lld.nix
+++ b/pkgs/development/compilers/llvm/7/lld.nix
@@ -9,7 +9,7 @@
 stdenv.mkDerivation {
   name = "lld-${version}";
 
-  src = fetch "lld" "0ca0qygrk87lhjk6cpv1wbmdfnficqqjsda3k7b013idvnralsc8";
+  src = fetch "lld" "0rsqb7zcnij5r5ipfhr129j7skr5n9pyr388kjpqwh091952f3x1";
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ llvm libxml2 ];
diff --git a/pkgs/development/compilers/llvm/7/lldb.nix b/pkgs/development/compilers/llvm/7/lldb.nix
index 14cc0514fe6..a697aac5b8f 100644
--- a/pkgs/development/compilers/llvm/7/lldb.nix
+++ b/pkgs/development/compilers/llvm/7/lldb.nix
@@ -17,7 +17,7 @@
 stdenv.mkDerivation {
   name = "lldb-${version}";
 
-  src = fetch "lldb" "10k9lyk3i72j9hca523r9pz79qp7d8q7jqnjy0i3saj1bgknpd3n";
+  src = fetch "lldb" "0klsscg1sczc4nw2l53xggi969k361cng2sjjrfp3bv4g5x14s4v";
 
   postPatch = ''
     # Fix up various paths that assume llvm and clang are installed in the same place
diff --git a/pkgs/development/compilers/llvm/7/llvm.nix b/pkgs/development/compilers/llvm/7/llvm.nix
index 34f8a5478d1..c288fd3e2a5 100644
--- a/pkgs/development/compilers/llvm/7/llvm.nix
+++ b/pkgs/development/compilers/llvm/7/llvm.nix
@@ -22,12 +22,13 @@
 let
   inherit (stdenv.lib) optional optionals optionalString;
 
-  src = fetch "llvm" "16s196wqzdw4pmri15hadzqgdi926zln3an2viwyq0kini6zr3d3";
-  polly_src = fetch "polly" "0wgvayfilgb530bq51l7szxfb13l24nnrmyji2f6ncq95a24dw8v";
+  src = fetch "llvm" "0r1p5didv4rkgxyvbkyz671xddg6i3dxvbpsi1xxipkla0l9pk0v";
+  polly_src = fetch "polly" "16qkns4ab4x0azrvhy4j7cncbyb2rrbdrqj87zphvqxm5pvm8m1h";
 
-  # Used when creating a version-suffixed symlink of libLLVM.dylib
-  shortVersion = with stdenv.lib;
-    concatStringsSep "." (take 1 (splitString "." release_version));
+  # Used when creating a versioned symlinks of libLLVM.dylib
+  versionSuffixes = with stdenv.lib;
+    let parts = splitString "." release_version; in
+    imap (i: _: concatStringsSep "." (take i parts)) parts;
 
 in stdenv.mkDerivation (rec {
   name = "llvm-${version}";
@@ -53,12 +54,6 @@ in stdenv.mkDerivation (rec {
   propagatedBuildInputs = [ ncurses zlib ];
 
   patches = [
-    # https://bugs.llvm.org/show_bug.cgi?id=39427
-    # https://github.com/NixOS/nixpkgs/issues/54370
-    (fetchpatch {
-      url = "https://github.com/llvm-mirror/llvm/commit/57567def148f387153a8149fb590bd39b1b006a1.patch";
-      sha256 = "1w1xg5pxpc6cals1nf5j5k4p6qi8lcrpvn0paxc86m415i79xmcg";
-    })
     # backport, fix building rust crates with lto
     (fetchpatch {
       url = "https://github.com/llvm-mirror/llvm/commit/da1fb72bb305d6bc1f3899d541414146934bf80f.patch";
@@ -148,8 +143,9 @@ in stdenv.mkDerivation (rec {
   + 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"
-    ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib
-    ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
+    ${stdenv.lib.concatMapStringsSep "\n" (v: ''
+      ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib
+    '') versionSuffixes}
   '';
 
   doCheck = stdenv.isLinux && (!stdenv.isx86_32);
diff --git a/pkgs/development/compilers/llvm/7/openmp.nix b/pkgs/development/compilers/llvm/7/openmp.nix
index fb856eaa51f..e55f4aa5ba1 100644
--- a/pkgs/development/compilers/llvm/7/openmp.nix
+++ b/pkgs/development/compilers/llvm/7/openmp.nix
@@ -9,7 +9,7 @@
 stdenv.mkDerivation {
   name = "openmp-${version}";
 
-  src = fetch "openmp" "030dkg5cypd7j9hq0mcqb5gs31lxwmzfq52j81l7v9ldcy5bf5mz";
+  src = fetch "openmp" "1dg53wzsci2kra8lh1y0chh60h2l8h1by93br5spzvzlxshkmrqy";
 
   nativeBuildInputs = [ cmake perl ];
   buildInputs = [ llvm ];
diff --git a/pkgs/development/compilers/llvm/8/compiler-rt-clock_gettime.patch b/pkgs/development/compilers/llvm/8/compiler-rt-clock_gettime.patch
deleted file mode 100644
index f9323ed95c0..00000000000
--- a/pkgs/development/compilers/llvm/8/compiler-rt-clock_gettime.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-commit f00c7bccf7955b7dfbb4859fd9019e9eb3349f2d
-Author: Tobias Mayer <tobim@fastmail.fm>
-Date:   Wed Feb 13 12:44:17 2019 +0100
-
-    Provide clock_gettime for xray on macos < 10.12
-
-diff --git a/lib/xray/xray_basic_logging.cc b/lib/xray/xray_basic_logging.cc
-index a46c151af..38aea6932 100644
---- a/lib/xray/xray_basic_logging.cc
-+++ b/lib/xray/xray_basic_logging.cc
-@@ -36,6 +36,29 @@
- #include "xray_tsc.h"
- #include "xray_utils.h"
- 
-+#if __MACH__
-+#include <mach/clock.h>
-+#include <mach/mach.h>
-+enum clockid_t {
-+    CLOCK_MONOTONIC = REALTIME_CLOCK,
-+    CLOCK_REALTIME = REALTIME_CLOCK
-+};
-+
-+int clock_gettime(clockid_t clock_id, struct timespec *ts) {
-+  if (ts != NULL) {
-+      clock_serv_t cclock;
-+      mach_timespec_t mts;
-+      host_get_clock_service(mach_host_self(), clock_id, &cclock);
-+      clock_get_time(cclock, &mts);
-+      mach_port_deallocate(mach_task_self(), cclock);
-+      ts->tv_sec = mts.tv_sec;
-+      ts->tv_nsec = mts.tv_nsec;
-+      return 0;
-+  }
-+  return -1;
-+}
-+#endif
-+
- namespace __xray {
- 
- SpinMutex LogMutex;
-diff --git a/lib/xray/xray_fdr_logging.cc b/lib/xray/xray_fdr_logging.cc
-index 4b308b27f..1d044c8fd 100644
---- a/lib/xray/xray_fdr_logging.cc
-+++ b/lib/xray/xray_fdr_logging.cc
-@@ -38,6 +38,29 @@
- #include "xray_tsc.h"
- #include "xray_utils.h"
- 
-+#if __MACH__
-+#include <mach/clock.h>
-+#include <mach/mach.h>
-+enum clockid_t {
-+    CLOCK_MONOTONIC = REALTIME_CLOCK,
-+    CLOCK_REALTIME = REALTIME_CLOCK
-+};
-+
-+int clock_gettime(clockid_t clock_id, struct timespec *ts) {
-+  if (ts != NULL) {
-+      clock_serv_t cclock;
-+      mach_timespec_t mts;
-+      host_get_clock_service(mach_host_self(), clock_id, &cclock);
-+      clock_get_time(cclock, &mts);
-+      mach_port_deallocate(mach_task_self(), cclock);
-+      ts->tv_sec = mts.tv_sec;
-+      ts->tv_nsec = mts.tv_nsec;
-+      return 0;
-+  }
-+  return -1;
-+}
-+#endif
-+
- namespace __xray {
- 
- atomic_sint32_t LoggingStatus = {XRayLogInitStatus::XRAY_LOG_UNINITIALIZED};
diff --git a/pkgs/development/compilers/llvm/8/compiler-rt.nix b/pkgs/development/compilers/llvm/8/compiler-rt.nix
index 2b591cc94af..a8bbb1f719b 100644
--- a/pkgs/development/compilers/llvm/8/compiler-rt.nix
+++ b/pkgs/development/compilers/llvm/8/compiler-rt.nix
@@ -34,8 +34,7 @@ stdenv.mkDerivation rec {
   patches = [
     ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
   ]# ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
-    ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ./crtbegin-and-end.patch
-    ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin ./compiler-rt-clock_gettime.patch;
+    ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ./crtbegin-and-end.patch;
 
   # 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/rust/default.nix b/pkgs/development/compilers/rust/default.nix
index 47df7e716dc..5c3c0895207 100644
--- a/pkgs/development/compilers/rust/default.nix
+++ b/pkgs/development/compilers/rust/default.nix
@@ -2,6 +2,8 @@
 , buildPackages
 , newScope, callPackage
 , CoreFoundation, Security
+, llvmPackages_5
+, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost
 }: rec {
   makeRustPlatform = { rustc, cargo, ... }: {
     rust = {
@@ -48,10 +50,15 @@
       buildRustPackages = buildPackages.rust.packages.stable;
       # Analogous to stdenv
       rustPlatform = makeRustPlatform self.buildRustPackages;
-      rustc = self.callPackage ./rustc.nix {
+      rustc = self.callPackage ./rustc.nix ({
         # Use boot package set to break cycle
         rustPlatform = bootRustPlatform;
-      };
+      } // lib.optionalAttrs (stdenv.cc.isClang && stdenv.hostPlatform == stdenv.buildPlatform) {
+        stdenv = llvmPackages_5.stdenv;
+        pkgsBuildBuild = pkgsBuildBuild // { targetPackages.stdenv = llvmPackages_5.stdenv; };
+        pkgsBuildHost = pkgsBuildBuild // { targetPackages.stdenv = llvmPackages_5.stdenv; };
+        pkgsBuildTarget = pkgsBuildTarget // { targetPackages.stdenv = llvmPackages_5.stdenv; };
+      });
       cargo = self.callPackage ./cargo.nix {
         # Use boot package set to break cycle
         rustPlatform = bootRustPlatform;
diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix
index af5bd2220d4..1be90f902e6 100644
--- a/pkgs/development/haskell-modules/configuration-nix.nix
+++ b/pkgs/development/haskell-modules/configuration-nix.nix
@@ -128,25 +128,6 @@ self: super: builtins.intersectAttrs super {
   # the system-fileio tests use canonicalizePath, which fails in the sandbox
   system-fileio = if pkgs.stdenv.isDarwin then dontCheck super.system-fileio else super.system-fileio;
 
-  # Prevents needing to add `security_tool` as a run-time dependency for
-  # everything using x509-system to give access to the `security` executable.
-  x509-system = if pkgs.stdenv.hostPlatform.isDarwin && !pkgs.stdenv.cc.nativeLibc
-    then let inherit (pkgs.darwin) security_tool;
-      in pkgs.lib.overrideDerivation (addBuildDepend super.x509-system security_tool) (drv: {
-        # darwin.security_tool is broken in Mojave (#45042)
-
-        # We will use the system provided security for now.
-        # Beware this WILL break in sandboxes!
-
-        # TODO(matthewbauer): If someone really needs this to work in sandboxes,
-        # I think we can add a propagatedImpureHost dep here, but I’m hoping to
-        # get a proper fix available soonish.
-        postPatch = (drv.postPatch or "") + ''
-          substituteInPlace System/X509/MacOS.hs --replace security /usr/bin/security
-        '';
-      })
-    else super.x509-system;
-
   # https://github.com/NixOS/cabal2nix/issues/136 and https://github.com/NixOS/cabal2nix/issues/216
   gio = disableHardening (addPkgconfigDepend (addBuildTool super.gio self.buildHaskellPackages.gtk2hs-buildtools) pkgs.glib) ["fortify"];
   glib = disableHardening (addPkgconfigDepend (addBuildTool super.glib self.buildHaskellPackages.gtk2hs-buildtools) pkgs.glib) ["fortify"];
diff --git a/pkgs/development/interpreters/guile/2.0.nix b/pkgs/development/interpreters/guile/2.0.nix
index 17ca1d1dcd9..24266d59676 100644
--- a/pkgs/development/interpreters/guile/2.0.nix
+++ b/pkgs/development/interpreters/guile/2.0.nix
@@ -46,7 +46,14 @@
     })
     ./riscv.patch
   ] ++
-    (stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch);
+    (stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch)
+    ++ stdenv.lib.optionals stdenv.isDarwin [
+      (fetchpatch {
+        url = "https://gitlab.gnome.org/GNOME/gtk-osx/raw/52898977f165777ad9ef169f7d4818f2d4c9b731/patches/guile-clocktime.patch";
+        sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207";
+      })
+      ./filter-mkostemp-darwin.patch
+    ];
 
   # Explicitly link against libgcc_s, to work around the infamous
   # "libgcc_s.so.1 must be installed for pthread_cancel to work".
diff --git a/pkgs/development/interpreters/guile/default.nix b/pkgs/development/interpreters/guile/default.nix
index 5e458c6e2cc..fb8e75e8793 100644
--- a/pkgs/development/interpreters/guile/default.nix
+++ b/pkgs/development/interpreters/guile/default.nix
@@ -2,6 +2,7 @@
 , fetchurl, makeWrapper, gawk, pkgconfig
 , libffi, libtool, readline, gmp, boehmgc, libunistring
 , coverageAnalysis ? null
+, fetchpatch
 }:
 
 # Do either a coverage analysis build or a standard build.
@@ -42,8 +43,11 @@
   patches = [
     ./eai_system.patch
     ./riscv.patch
-  ] ++
-    (stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch);
+  ] ++ stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch
+    ++ stdenv.lib.optional stdenv.isDarwin (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/gtk-osx/raw/52898977f165777ad9ef169f7d4818f2d4c9b731/patches/guile-clocktime.patch";
+      sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207";
+    });
 
   # Explicitly link against libgcc_s, to work around the infamous
   # "libgcc_s.so.1 must be installed for pthread_cancel to work".
diff --git a/pkgs/development/interpreters/guile/filter-mkostemp-darwin.patch b/pkgs/development/interpreters/guile/filter-mkostemp-darwin.patch
new file mode 100644
index 00000000000..8b9b853fb00
--- /dev/null
+++ b/pkgs/development/interpreters/guile/filter-mkostemp-darwin.patch
@@ -0,0 +1,28 @@
+Filter incompat. mkostemp(3) flags on macOS 10.12
+
+macOS Sierra introduces a mkostemp(3) function which is used when
+present. Contrary to the GNUlib version of mkostemp(3) that was used
+previously, this version fails with 'invalid argument' when flags other
+than from a specified set are passed. From mktemp(3):
+
+| The mkostemp() function is like mkstemp() but allows specifying
+| additional open(2) flags (defined in <fcntl.h>). The permitted flags
+| are O_APPEND, O_SHLOCK, O_EXLOCK and O_CLOEXEC.
+
+Signed-off-by: Clemens Lang <cal@macports.org>
+Upstream-Status: Submitted [https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24862#23]
+--- a/libguile/filesys.c.orig	2017-01-09 00:53:27.000000000 +0100
++++ b/libguile/filesys.c	2017-01-09 00:54:48.000000000 +0100
+@@ -1486,6 +1486,12 @@
+       mode_bits = scm_i_mode_bits (mode);
+     }
+ 
++#ifdef __APPLE__
++  /* macOS starting with 10.12 defines mkostemp(2) which is used if defined,
++   * but only accepts some flags according to its manpage. It fails with
++   * invalid argument when other flags are passed. */
++  open_flags &= O_APPEND | O_SHLOCK | O_EXLOCK | O_CLOEXEC;
++#endif
+   SCM_SYSCALL (rv = mkostemp (c_tmpl, open_flags));
+   if (rv == -1)
+     SCM_SYSERROR;
diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix
index 505929df8ef..894a9b084c6 100644
--- a/pkgs/development/interpreters/python/cpython/2.7/default.nix
+++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix
@@ -42,7 +42,7 @@ let
     executable = libPrefix;
     pythonVersion = with sourceVersion; "${major}.${minor}";
     sitePackages = "lib/${libPrefix}/site-packages";
-    inherit pythonForBuild;
+    inherit hasDistutilsCxxPatch pythonForBuild;
   } // {
     inherit ucsEncoding;
   };
diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix
index 7d90e201d19..60ea3bdf4c7 100644
--- a/pkgs/development/interpreters/python/cpython/default.nix
+++ b/pkgs/development/interpreters/python/cpython/default.nix
@@ -39,7 +39,7 @@ let
     executable = libPrefix;
     pythonVersion = with sourceVersion; "${major}.${minor}";
     sitePackages = "lib/${libPrefix}/site-packages";
-    inherit pythonForBuild;
+    inherit hasDistutilsCxxPatch pythonForBuild;
   };
 
   version = with sourceVersion; "${major}.${minor}.${patch}${suffix}";
diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix
index ef4cab35021..119c0a2728b 100644
--- a/pkgs/development/interpreters/python/default.nix
+++ b/pkgs/development/interpreters/python/default.nix
@@ -13,6 +13,7 @@ with pkgs;
     , pythonVersion
     , packageOverrides
     , sitePackages
+    , hasDistutilsCxxPatch
     , pythonForBuild
     , self
     }: let
@@ -40,7 +41,7 @@ with pkgs;
         inherit sourceVersion;
         pythonAtLeast = lib.versionAtLeast pythonVersion;
         pythonOlder = lib.versionOlder pythonVersion;
-        inherit pythonForBuild;
+        inherit hasDistutilsCxxPatch pythonForBuild;
   };
 
 in {
diff --git a/pkgs/development/interpreters/python/pypy/default.nix b/pkgs/development/interpreters/python/pypy/default.nix
index 46cf0475de4..3cdc30b9234 100644
--- a/pkgs/development/interpreters/python/pypy/default.nix
+++ b/pkgs/development/interpreters/python/pypy/default.nix
@@ -24,6 +24,7 @@ let
     executable = "pypy${if isPy3k then "3" else ""}";
     pythonForBuild = self; # No cross-compiling for now.
     sitePackages = "site-packages";
+    hasDistutilsCxxPatch = false;
   };
   pname = passthru.executable;
   version = with sourceVersion; "${major}.${minor}.${patch}";
diff --git a/pkgs/development/interpreters/python/pypy/prebuilt.nix b/pkgs/development/interpreters/python/pypy/prebuilt.nix
index ee556ba05bf..552f230ee71 100644
--- a/pkgs/development/interpreters/python/pypy/prebuilt.nix
+++ b/pkgs/development/interpreters/python/pypy/prebuilt.nix
@@ -34,6 +34,7 @@ let
     executable = "pypy${if isPy3k then "3" else ""}";
     pythonForBuild = self; # Not possible to cross-compile with.
     sitePackages = "site-packages";
+    hasDistutilsCxxPatch = false;
   };
   pname = "${passthru.executable}_prebuilt";
   version = with sourceVersion; "${major}.${minor}.${patch}";
diff --git a/pkgs/development/interpreters/python/setup-hook.sh b/pkgs/development/interpreters/python/setup-hook.sh
index 77ec9e9ac0b..523df5762fa 100644
--- a/pkgs/development/interpreters/python/setup-hook.sh
+++ b/pkgs/development/interpreters/python/setup-hook.sh
@@ -12,7 +12,9 @@ toPythonPath() {
     echo $result
 }
 
-addEnvHooks "$hostOffset" addPythonPath
+if [ -z "${dontAddPythonPath:-}" ]; then
+    addEnvHooks "$hostOffset" addPythonPath
+fi
 
 # Determinism: The interpreter is patched to write null timestamps when compiling python files.
 # This way python doesn't try to update them when we freeze timestamps in nix store.
diff --git a/pkgs/development/interpreters/tcl/8.6.nix b/pkgs/development/interpreters/tcl/8.6.nix
index 61d67a874e9..d76ceb3421d 100644
--- a/pkgs/development/interpreters/tcl/8.6.nix
+++ b/pkgs/development/interpreters/tcl/8.6.nix
@@ -2,10 +2,10 @@
 
 callPackage ./generic.nix (args // rec {
   release = "8.6";
-  version = "${release}.6";
+  version = "${release}.9";
 
   src = fetchurl {
     url = "mirror://sourceforge/tcl/tcl${version}-src.tar.gz";
-    sha256 = "01zypqhy57wvh1ikk28bg733sk5kf4q568pq9v6fvcz4h6bl0rd2";
+    sha256 = "0kjzj7mkzfnb7ksxanbibibfpciyvsh5ffdlhs0bmfc75kgd435d";
   };
 })
diff --git a/pkgs/development/interpreters/tcl/generic.nix b/pkgs/development/interpreters/tcl/generic.nix
index 11c02acf1de..cd377e70cd9 100644
--- a/pkgs/development/interpreters/tcl/generic.nix
+++ b/pkgs/development/interpreters/tcl/generic.nix
@@ -33,11 +33,12 @@ stdenv.mkDerivation rec {
   postInstall = ''
     make install-private-headers
     ln -s $out/bin/tclsh${release} $out/bin/tclsh
+    ln -s $out/lib/libtcl${release}.so $out/lib/libtcl.so
   '';
 
   meta = with stdenv.lib; {
-    description = "The Tcl scription language";
-    homepage = http://www.tcl.tk/;
+    description = "The Tcl scripting language";
+    homepage = https://www.tcl.tk/;
     license = licenses.tcltk;
     platforms = platforms.all;
     maintainers = with maintainers; [ vrthra ];
diff --git a/pkgs/development/libraries/boost/1.67.nix b/pkgs/development/libraries/boost/1.67.nix
index 938892ef355..406e63b9622 100644
--- a/pkgs/development/libraries/boost/1.67.nix
+++ b/pkgs/development/libraries/boost/1.67.nix
@@ -3,11 +3,33 @@
 callPackage ./generic.nix (args // rec {
   version = "1.67.0";
 
-  patches = [ (fetchpatch {
-    url = "https://github.com/boostorg/lockfree/commit/12726cda009a855073b9bedbdce57b6ce7763da2.patch";
-    sha256 = "0x65nkwzv8fdacj8sw5njl3v63jj19dirrpklbwy6qpsncw7fc7h";
-    stripLen = 1;
-  })];
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/boostorg/lockfree/commit/12726cda009a855073b9bedbdce57b6ce7763da2.patch";
+      sha256 = "0x65nkwzv8fdacj8sw5njl3v63jj19dirrpklbwy6qpsncw7fc7h";
+      stripLen = 1;
+    })
+  ] ++ stdenv.lib.optionals stdenv.cc.isClang [
+    # Fixes https://github.com/boostorg/atomic/issues/15
+    (fetchpatch {
+      url = https://github.com/boostorg/atomic/commit/6e14ca24dab50ad4c1fa8c27c7dd6f1cb791b534.patch;
+      sha256 = "102g35ygvv8cxagp9651284xk4vybk93q2fm577y4mdxf5k46b7a";
+      stripLen = 1;
+    })
+
+    # Needed for the next patch
+    (fetchpatch {
+      url = https://github.com/boostorg/asio/commit/38cb19719748ad56b14d73ca1fff5828f36e5894.patch;
+      sha256 = "0cj9cxz9rfbsx8p8f5alxx00dq3r7g0vh23j68bbxbs9gq1arq2n";
+      stripLen = 1;
+    })
+    # Fixes https://github.com/boostorg/asio/pull/91
+    (fetchpatch {
+      url = https://github.com/boostorg/asio/commit/43874d5497414c67655d901e48c939ef01337edb.patch;
+      sha256 = "1c2ds164s2ygvpb4785p4ncv8ywbpm08cphirb99xp4mqvb693is";
+      stripLen = 1;
+    })
+  ];
 
   src = fetchurl {
     url = "mirror://sourceforge/boost/boost_1_67_0.tar.bz2";
diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix
index 8ce44b878d0..c0c69b0fe70 100644
--- a/pkgs/development/libraries/boost/generic.nix
+++ b/pkgs/development/libraries/boost/generic.nix
@@ -114,8 +114,9 @@ stdenv.mkDerivation {
     description = "Collection of C++ libraries";
     license = stdenv.lib.licenses.boost;
 
-    platforms = (platforms.unix ++ platforms.windows);
-    badPlatforms = stdenv.lib.optional (versionOlder version "1.59") "aarch64-linux";
+    platforms = platforms.unix ++ platforms.windows;
+    badPlatforms = stdenv.lib.optional (versionOlder version "1.59") "aarch64-linux"
+                 ++ stdenv.lib.optional ((versionOlder version "1.57") || version == "1.58") "x86_64-darwin";
     maintainers = with maintainers; [ peti ];
   };
 
diff --git a/pkgs/development/libraries/bullet/default.nix b/pkgs/development/libraries/bullet/default.nix
index fca5e8d70a3..b4a2133f7d8 100644
--- a/pkgs/development/libraries/bullet/default.nix
+++ b/pkgs/development/libraries/bullet/default.nix
@@ -40,6 +40,8 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=argument-outside-range";
+
   meta = with stdenv.lib; {
     description = "A professional free 3D Game Multiphysics Library";
     longDescription = ''
diff --git a/pkgs/development/libraries/clucene-core/2.x.nix b/pkgs/development/libraries/clucene-core/2.x.nix
index 6eb310550bc..91347813a24 100644
--- a/pkgs/development/libraries/clucene-core/2.x.nix
+++ b/pkgs/development/libraries/clucene-core/2.x.nix
@@ -36,6 +36,8 @@ stdenv.mkDerivation rec {
   # /build/clucene-core-2.3.3.4/build/bin/cl_test"
   doCheck = false;
 
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
+
   meta = with stdenv.lib; {
     description = "Core library for full-featured text search engine";
     longDescription = ''
diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix
index 05a52dce0f9..95eaf37d5c7 100644
--- a/pkgs/development/libraries/glib/default.nix
+++ b/pkgs/development/libraries/glib/default.nix
@@ -46,7 +46,7 @@ let
   '';
 
   binPrograms = optional (!stdenv.isDarwin) "gapplication" ++ [ "gdbus" "gio" "gsettings" ];
-  version = "2.60.0";
+  version = "2.60.1";
 in
 
 stdenv.mkDerivation rec {
@@ -54,7 +54,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/glib/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
-    sha256 = "0ls3njqknb345ni5i8hn9nr1n70kn6s8bi0g6kcqj3c4js5mv1i0";
+    sha256 = "0q2mkdvp20v6dvrhik8k5j875kj29hcfz346xi0624n6spsq9y49";
   };
 
   patches = optional stdenv.isDarwin ./darwin-compilation.patch
diff --git a/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch b/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch
index e2525d833f8..6e56d3fab41 100644
--- a/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch
+++ b/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch
@@ -1,6 +1,6 @@
 --- a/giscanner/scannermain.py
 +++ b/giscanner/scannermain.py
-@@ -101,6 +101,39 @@
+@@ -95,6 +95,39 @@ def get_windows_option_group(parser):
      return group
  
  
@@ -40,7 +40,7 @@
  def _get_option_parser():
      parser = optparse.OptionParser('%prog [options] sources',
                                     version='%prog ' + giscanner.__version__)
-@@ -211,6 +244,10 @@
+@@ -205,6 +238,10 @@ match the namespace prefix.""")
      parser.add_option("", "--filelist",
                        action="store", dest="filelist", default=[],
                        help="file containing headers and sources to be scanned")
@@ -53,7 +53,7 @@
      parser.add_option_group(group)
 --- a/giscanner/shlibs.py
 +++ b/giscanner/shlibs.py
-@@ -62,6 +62,12 @@
+@@ -57,6 +57,12 @@ def _ldd_library_pattern(library_name):
      $""" % re.escape(library_name), re.VERBOSE)
  
  
@@ -66,21 +66,33 @@
  # This is a what we do for non-la files. We assume that we are on an
  # ELF-like system where ldd exists and the soname extracted with ldd is
  # a filename that can be opened with dlopen().
-@@ -110,17 +116,16 @@ def _resolve_non_libtool(options, binary, libraries):
-         if isinstance(output, bytes):
+@@ -106,7 +112,8 @@ def _resolve_non_libtool(options, binary, libraries):
              output = output.decode("utf-8", "replace")
  
--        # Use absolute paths on OS X to conform to how libraries are usually
--        # referenced on OS X systems, and file names everywhere else.
--        basename = platform.system() != 'Darwin'
--        return resolve_from_ldd_output(libraries, output, basename=basename)
-+        # Never strip away absolute paths in Nix
-+        basename = False
-+        return resolve_from_ldd_output(libraries, output, basename=basename, fallback_libpath=options.fallback_libpath)
+         shlibs = resolve_from_ldd_output(libraries, output)
+-        return list(map(sanitize_shlib_path, shlibs))
++        fallback_libpath = options.fallback_libpath or "";
++        return list(map(lambda p: os.path.join(fallback_libpath, p), map(sanitize_shlib_path, shlibs)))
  
  
--def resolve_from_ldd_output(libraries, output, basename=False):
-+def resolve_from_ldd_output(libraries, output, basename=False, fallback_libpath=""):
+ def sanitize_shlib_path(lib):
+@@ -115,19 +122,18 @@ def sanitize_shlib_path(lib):
+     # In case we get relative paths on macOS (like @rpath) then we fall
+     # back to the basename as well:
+     # https://gitlab.gnome.org/GNOME/gobject-introspection/issues/222
+-    if sys.platform == "darwin":
+-        if not os.path.isabs(lib):
+-            return os.path.basename(lib)
+-        return lib
+-    else:
++
++    # Always use absolute paths if available
++    if not os.path.isabs(lib):
+         return os.path.basename(lib)
++    return lib
+ 
+ 
+ def resolve_from_ldd_output(libraries, output):
      patterns = {}
      for library in libraries:
          if not os.path.isfile(library):
@@ -89,7 +101,7 @@
      if len(patterns) == 0:
          return []
  
-@@ -129,11 +134,14 @@ def resolve_from_ldd_output(libraries, output, basename=False):
+@@ -139,8 +145,11 @@ def resolve_from_ldd_output(libraries, output):
          if line.endswith(':'):
              continue
          for word in line.split():
@@ -102,14 +114,10 @@
 +                    m = pattern.match(word)
                  if m:
                      del patterns[library]
--                    shlibs.append(_sanitize_install_name(m.group()))
-+                    shlibs.append(os.path.join(fallback_libpath, _sanitize_install_name(m.group())))
-                     break
- 
-     if len(patterns) > 0:
+                     shlibs.append(m.group())
 --- a/giscanner/utils.py
 +++ b/giscanner/utils.py
-@@ -116,17 +116,11 @@
+@@ -111,17 +111,11 @@ def extract_libtool_shlib(la_file):
      if dlname is None:
          return None
  
diff --git a/pkgs/development/libraries/gobject-introspection/default.nix b/pkgs/development/libraries/gobject-introspection/default.nix
index e6978d0955f..26c472930ed 100644
--- a/pkgs/development/libraries/gobject-introspection/default.nix
+++ b/pkgs/development/libraries/gobject-introspection/default.nix
@@ -9,7 +9,7 @@
 
 let
   pname = "gobject-introspection";
-  version = "1.60.0";
+  version = "1.60.1";
 in
 with stdenv.lib;
 stdenv.mkDerivation rec {
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
-    sha256 = "0pgk9lcvz3i79m6g2ynlp00ghws7g0p0d5qyf0k72warrf841zly";
+    sha256 = "1cr4r3lh5alrks9q2ycs1kn2crnkhrhn2wrmibng6dndkr4x2i6q";
   };
 
   outputs = [ "out" "dev" "man" ];
@@ -40,7 +40,6 @@ stdenv.mkDerivation rec {
   setupHook = ./setup-hook.sh;
 
   patches = [
-    ./macos-shared-library.patch
     (substituteAll {
       src = ./test_shlibs.patch;
       inherit nixStoreDir;
diff --git a/pkgs/development/libraries/gobject-introspection/macos-shared-library.patch b/pkgs/development/libraries/gobject-introspection/macos-shared-library.patch
deleted file mode 100644
index 9941878c427..00000000000
--- a/pkgs/development/libraries/gobject-introspection/macos-shared-library.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py
-index c93d20c..4d4915d 100644
---- a/giscanner/shlibs.py
-+++ b/giscanner/shlibs.py
-@@ -43,6 +43,22 @@ def _resolve_libtool(options, binary, libraries):
- 
-     return shlibs
- 
-+def _sanitize_install_name(install_name):
-+    '''
-+    On macOS, the dylib can be built with install_name as @rpath/libfoo.so
-+    instead of the absolute path to the library, so handle that. The name
-+    can also be @loader_path or @executable_path.
-+    '''
-+    if not install_name.startswith('@'):
-+        return install_name
-+    if install_name.startswith('@rpath/'):
-+        return install_name[7:]
-+    if install_name.startswith('@loader_path/'):
-+        return install_name[13:]
-+    if install_name.startswith('@executable_path/'):
-+        return install_name[17:]
-+    raise RuntimeError('Unknown install_name {!r}'.format(install_name))
-+
- 
- # Assume ldd output is something vaguely like
- #
-@@ -136,7 +152,7 @@ def resolve_from_ldd_output(libraries, output, basename=False):
-                 m = pattern.match(word)
-                 if m:
-                     del patterns[library]
--                    shlibs.append(m.group())
-+                    shlibs.append(_sanitize_install_name(m.group()))
-                     break
- 
-     if len(patterns) > 0:
diff --git a/pkgs/development/libraries/gobject-introspection/test_shlibs.patch b/pkgs/development/libraries/gobject-introspection/test_shlibs.patch
index c3152982d19..65b5a1a13b9 100644
--- a/pkgs/development/libraries/gobject-introspection/test_shlibs.patch
+++ b/pkgs/development/libraries/gobject-introspection/test_shlibs.patch
@@ -1,6 +1,6 @@
 --- a/tests/scanner/test_shlibs.py
 +++ b/tests/scanner/test_shlibs.py
-@@ -10,6 +10,46 @@ from giscanner.shlibs import resolve_from_ldd_output
+@@ -7,6 +7,30 @@ from giscanner.shlibs import resolve_from_ldd_output, sanitize_shlib_path
  
  class TestLddParser(unittest.TestCase):
  
@@ -26,25 +26,18 @@
 +        self.assertEqual(
 +            ['@nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libglib-2.0.so.0',
 +             '@nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libgio-2.0.so.0'],
-+            resolve_from_ldd_output(libraries, output, basename=False))
-+
-+    def test_resolve_from_ldd_output_macos(self):
-+        output = '''\
-+            @rpath/libatk-1.0.0.dylib
-+            @rpath/libgstreamer-1.0.0.dylib (compatibility version 0.0.0, current version 0.0.0)
-+            /Volumes/USB_SSD/cerbero/build/dist/darwin_x86_64/lib/libglib-2.0.0.dylib (compatibility version 0.0.0, current version 0.0.0)
-+            /Volumes/USB_SSD/cerbero/build/dist/darwin_x86_64/lib/libintl.dylib (compatibility version 0.0.0, current version 0.0.0)
-+            /Volumes/USB_SSD/cerbero/build/dist/darwin_x86_64/lib/libgobject-2.0.0.dylib (compatibility version 0.0.0, current version 0.0.0)
-+            /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)
-+        '''
-+        libraries = ['atk-1.0']
-+        fallback_libpath = '@nixStoreDir@/1ynd5b01z87c1nw75k5iy7sq49hpkw53-atk-2.30.0/lib'
-+
-+        self.assertEqual(
-+            [ '%s/libatk-1.0.0.dylib' % fallback_libpath ],
-+            resolve_from_ldd_output(libraries, output, basename=False, fallback_libpath=fallback_libpath))
++            resolve_from_ldd_output(libraries, output))
 +
      def test_resolve_from_ldd_output(self):
          output = '''\
              libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fbe12d68000)
-
+@@ -40,7 +64,8 @@ class TestLddParser(unittest.TestCase):
+ 
+         self.assertEqual(
+             sanitize_shlib_path('/foo/bar'),
+-            '/foo/bar' if sys.platform == 'darwin' else 'bar')
++            # NixOS always want the absolute path
++            '/foo/bar')
+ 
+     def test_unresolved_library(self):
+         output = ''
diff --git a/pkgs/development/libraries/libao/default.nix b/pkgs/development/libraries/libao/default.nix
index 826f72b1f5f..c1cf3215c16 100644
--- a/pkgs/development/libraries/libao/default.nix
+++ b/pkgs/development/libraries/libao/default.nix
@@ -1,5 +1,5 @@
 { stdenv, lib, fetchFromGitHub, autoreconfHook, pkgconfig, libpulseaudio, alsaLib, libcap
-, CoreAudio, CoreServices, AudioUnit
+, CoreAudio, CoreServices, AudioUnit, AudioToolbox
 , usePulseAudio }:
 
 stdenv.mkDerivation rec {
diff --git a/pkgs/development/libraries/libcdio/default.nix b/pkgs/development/libraries/libcdio/default.nix
index 5c50d093243..531ca4102af 100644
--- a/pkgs/development/libraries/libcdio/default.nix
+++ b/pkgs/development/libraries/libcdio/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ libcddb ncurses help2man ]
     ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv Carbon IOKit ];
 
-  doCheck = true;
+  doCheck = !stdenv.isDarwin;
 
   meta = with stdenv.lib; {
     description = "A library for OS-independent CD-ROM and CD image access";
diff --git a/pkgs/development/libraries/libcroco/default.nix b/pkgs/development/libraries/libcroco/default.nix
index dc4a967e7ac..90ed8c6d985 100644
--- a/pkgs/development/libraries/libcroco/default.nix
+++ b/pkgs/development/libraries/libcroco/default.nix
@@ -1,27 +1,14 @@
-{ stdenv, fetchurl, pkgconfig, libxml2, glib, fetchpatch, gnome3 }:
+{ stdenv, fetchurl, pkgconfig, libxml2, glib, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "libcroco";
-  version = "0.6.12";
+  version = "0.6.13";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0q7qhi7z64i26zabg9dbs5706fa8pmzp1qhpa052id4zdiabbi6x";
+    sha256 = "1m110rbj5d2raxcdp4iz0qp172284945awrsbdlq99ksmqsc4zkn";
   };
 
-  patches = [
-    (fetchpatch {
-      name = "CVE-2017-7960.patch";
-      url = https://gitlab.gnome.org/GNOME/libcroco/commit/898e3a8c8c0314d2e6b106809a8e3e93cf9d4394.patch;
-      sha256 = "1xjwdqijxf4b7mhdp3kkgnb6c14y0bn3b3gg79kyrm82x696d94l";
-    })
-    (fetchpatch {
-      name = "CVE-2017-7961.patch";
-      url = https://gitlab.gnome.org/GNOME/libcroco/commit/9ad72875e9f08e4c519ef63d44cdbd94aa9504f7.patch;
-      sha256 = "0zakd72ynzjgzskwyvqglqiznsb93j1bkvc1lgyrzgv9rwrbwv9s";
-    })
-  ];
-
   outputs = [ "out" "dev" ];
   outputBin = "dev";
 
diff --git a/pkgs/development/libraries/libdrm/default.nix b/pkgs/development/libraries/libdrm/default.nix
index a0bd7d86454..a8daf575416 100644
--- a/pkgs/development/libraries/libdrm/default.nix
+++ b/pkgs/development/libraries/libdrm/default.nix
@@ -14,17 +14,12 @@ stdenv.mkDerivation rec {
   buildInputs = [ libpthreadstubs libpciaccess valgrind-light ];
     # libdrm as of 2.4.70 does not actually do anything with udev.
 
-  patches = stdenv.lib.optional stdenv.isDarwin ./libdrm-apple.patch;
-
   postPatch = ''
     for a in */*-symbol-check ; do
       patchShebangs $a
     done
   '';
 
-  preConfigure = stdenv.lib.optionalString stdenv.isDarwin
-    "echo : \\\${ac_cv_func_clock_gettime=\'yes\'} > config.cache";
-
   configureFlags = [ "--enable-install-test-programs" ]
     ++ stdenv.lib.optionals (stdenv.isAarch32 || stdenv.isAarch64)
       [ "--enable-tegra-experimental-api" "--enable-etnaviv-experimental-api" ]
diff --git a/pkgs/development/libraries/libdrm/libdrm-apple.patch b/pkgs/development/libraries/libdrm/libdrm-apple.patch
deleted file mode 100644
index 17b447789c2..00000000000
--- a/pkgs/development/libraries/libdrm/libdrm-apple.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-diff -Naur libdrm-2.4.26-orig/intel/intel_bufmgr_gem.c libdrm-2.4.26/intel/intel_bufmgr_gem.c
---- libdrm-2.4.26-orig/intel/intel_bufmgr_gem.c	2011-04-01 10:30:51.000000000 -0400
-+++ libdrm-2.4.26/intel/intel_bufmgr_gem.c	2011-08-29 02:17:20.000000000 -0400
-@@ -51,6 +51,7 @@
- #include <sys/stat.h>
- #include <sys/types.h>
- #include <stdbool.h>
-+#include <sys/time.h>
- 
- #include "errno.h"
- #include "libdrm_lists.h"
-@@ -987,9 +988,9 @@
- 	if (atomic_dec_and_test(&bo_gem->refcount)) {
- 		drm_intel_bufmgr_gem *bufmgr_gem =
- 		    (drm_intel_bufmgr_gem *) bo->bufmgr;
--		struct timespec time;
-+		struct timeval time;
- 
--		clock_gettime(CLOCK_MONOTONIC, &time);
-+		gettimeofday(&time, NULL);
- 
- 		pthread_mutex_lock(&bufmgr_gem->lock);
- 		drm_intel_gem_bo_unreference_final(bo, time.tv_sec);
-diff -Naur libdrm-2.4.26-orig/xf86drm.c libdrm-2.4.26/xf86drm.c
---- libdrm-2.4.26-orig/xf86drm.c	2011-03-21 09:39:24.000000000 -0400
-+++ libdrm-2.4.26/xf86drm.c	2011-08-29 02:17:49.000000000 -0400
-@@ -51,6 +51,9 @@
- #include <sys/mman.h>
- #include <sys/time.h>
- #include <stdarg.h>
-+#if defined(__APPLE__) && defined(__MACH__)
-+#include <mach/mach_time.h>
-+#endif
- 
- /* Not all systems have MAP_FAILED defined */
- #ifndef MAP_FAILED
-@@ -1941,20 +1944,43 @@
-  */
- int drmWaitVBlank(int fd, drmVBlankPtr vbl)
- {
-+#if defined(__APPLE__) && defined(__MACH__)
-+    uint64_t start, end, elapsed, elapsedNano;
-+    static const uint64_t maxElapsed = 2000000000;
-+    static mach_timebase_info_data_t timebaseInfo;
-+    if ( timebaseInfo.denom == 0 ) {
-+	(void) mach_timebase_info(&timebaseInfo);
-+    }
-+#else
-     struct timespec timeout, cur;
-+#endif
-     int ret;
- 
-+#if defined(__APPLE__) && defined(__MACH__)
-+    start = mach_absolute_time();
-+#else
-     ret = clock_gettime(CLOCK_MONOTONIC, &timeout);
-     if (ret < 0) {
- 	fprintf(stderr, "clock_gettime failed: %s\n", strerror(ret));
- 	goto out;
-     }
-     timeout.tv_sec++;
-+#endif
- 
-     do {
-        ret = ioctl(fd, DRM_IOCTL_WAIT_VBLANK, vbl);
-        vbl->request.type &= ~DRM_VBLANK_RELATIVE;
-        if (ret && errno == EINTR) {
-+#if defined(__APPLE__) && defined(__MACH__)
-+	       end = mach_absolute_time();
-+	       elapsed = end - start;
-+	       elapsedNano = elapsed * timebaseInfo.numer / timebaseInfo.denom;
-+	       if (elapsedNano > maxElapsed) {
-+		   errno = EBUSY;
-+		   ret = -1;
-+		   break;
-+	       }
-+#else
- 	       clock_gettime(CLOCK_MONOTONIC, &cur);
- 	       /* Timeout after 1s */
- 	       if (cur.tv_sec > timeout.tv_sec + 1 ||
-@@ -1964,6 +1990,7 @@
- 		       ret = -1;
- 		       break;
- 	       }
-+#endif
-        }
-     } while (ret && errno == EINTR);
- 
diff --git a/pkgs/development/libraries/libproxy/default.nix b/pkgs/development/libraries/libproxy/default.nix
index 0e0499251eb..3b050c3dc6a 100644
--- a/pkgs/development/libraries/libproxy/default.nix
+++ b/pkgs/development/libraries/libproxy/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkgconfig, cmake, zlib
+{ stdenv, fetchFromGitHub, pkgconfig, cmake, zlib, fetchpatch
 , dbus, networkmanager, spidermonkey_38, pcre, python2, python3
 , SystemConfiguration, CoreFoundation, JavaScriptCore }:
 
@@ -30,6 +30,12 @@ stdenv.mkDerivation rec {
     )
   '';
 
+  patches = stdenv.lib.optional stdenv.isDarwin
+    (fetchpatch {
+      url = "https://github.com/libproxy/libproxy/commit/44158f03f8522116758d335688ed840dfcb50ac8.patch";
+      sha256 = "0axfvb6j7gcys6fkwi9dkn006imhvm3kqr83gpwban8419n0q5v1";
+    });
+
   doCheck = false; # fails 1 out of 10 tests
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/libsnark/darwin-fix-clock-gettime.patch b/pkgs/development/libraries/libsnark/darwin-fix-clock-gettime.patch
deleted file mode 100644
index 2eee84d1c4b..00000000000
--- a/pkgs/development/libraries/libsnark/darwin-fix-clock-gettime.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-Adapted from https://github.com/zcash/libsnark/pull/10
-
-diff --git a/depends/libff/libff/common/profiling.cpp b/depends/libff/libff/common/profiling.cpp
-index f2a1985..319149c 100755
---- a/depends/libff/libff/common/profiling.cpp
-+++ b/depends/libff/libff/common/profiling.cpp
-@@ -27,6 +27,13 @@
- #include <proc/readproc.h>
- #endif
- 
-+#ifdef __MACH__
-+#include <time.h>
-+#include <sys/time.h>
-+#include <mach/clock.h>
-+#include <mach/mach.h>
-+#endif
-+
- namespace libff {
- 
- long long get_nsec_time()
-@@ -42,10 +49,20 @@ long long get_nsec_cpu_time()
- 	return 0;
- #else
-     ::timespec ts;
-+#ifdef __MACH__
-+    clock_serv_t cclock;
-+    mach_timespec_t mts;
-+    host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
-+    clock_get_time(cclock, &mts);
-+    mach_port_deallocate(mach_task_self(), cclock);
-+    ts.tv_sec = mts.tv_sec;
-+    ts.tv_nsec = mts.tv_nsec;
-+#else
-     if ( ::clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) )
-         throw ::std::runtime_error("clock_gettime(CLOCK_PROCESS_CPUTIME_ID) failed");
-         // If we expected this to work, don't silently ignore failures, because that would hide the problem and incur an unnecessarily system-call overhead. So if we ever observe this exception, we should probably add a suitable #ifdef .
-         //TODO: clock_gettime(CLOCK_PROCESS_CPUTIME_ID) is not supported by native Windows. What about Cygwin? Should we #ifdef on CLOCK_PROCESS_CPUTIME_ID or on __linux__?
-+#endif
-     return ts.tv_sec * 1000000000ll + ts.tv_nsec;
- #endif
- }
diff --git a/pkgs/development/libraries/libsnark/default.nix b/pkgs/development/libraries/libsnark/default.nix
index 4ea2209160f..15d8169f102 100644
--- a/pkgs/development/libraries/libsnark/default.nix
+++ b/pkgs/development/libraries/libsnark/default.nix
@@ -19,8 +19,6 @@ in stdenv.mkDerivation rec {
     fetchSubmodules = true;
   };
 
-  patches = [ ./darwin-fix-clock-gettime.patch ];
-
   enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/libsoup/default.nix b/pkgs/development/libraries/libsoup/default.nix
index d0023a3d4f3..61cad10c190 100644
--- a/pkgs/development/libraries/libsoup/default.nix
+++ b/pkgs/development/libraries/libsoup/default.nix
@@ -5,11 +5,11 @@
 stdenv.mkDerivation rec {
   name = "${pname}-${version}";
   pname = "libsoup";
-  version = "2.66.0";
+  version = "2.66.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
-    sha256 = "08c9kkdhzy504gv23pfdm4sq3dd3j20sikwz6gv0qrwcdjnw5bai";
+    sha256 = "1zs3bhspwg7fggxd7x1rrggpkcf2j9ch6dhncq9syh252z0vcb2a";
   };
 
   postPatch = ''
diff --git a/pkgs/development/libraries/libtins/default.nix b/pkgs/development/libraries/libtins/default.nix
index 1af7548ac96..483fb56f43b 100644
--- a/pkgs/development/libraries/libtins/default.nix
+++ b/pkgs/development/libraries/libtins/default.nix
@@ -31,7 +31,11 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
   doCheck = true;
-  checkPhase = "make tests && LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib make test";
+  preCheck = ''
+    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
+    export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PWD/lib
+  '';
+  checkTarget = "tests test";
 
   meta = with stdenv.lib; {
     description = "High-level, multiplatform C++ network packet sniffing and crafting library";
diff --git a/pkgs/development/libraries/libuv/default.nix b/pkgs/development/libraries/libuv/default.nix
index 32697bdc0e0..4fdfc855642 100644
--- a/pkgs/development/libraries/libuv/default.nix
+++ b/pkgs/development/libraries/libuv/default.nix
@@ -1,14 +1,14 @@
 { stdenv, lib, fetchpatch, fetchFromGitHub, autoconf, automake, libtool, pkgconfig, ApplicationServices, CoreServices }:
 
 stdenv.mkDerivation rec {
-  version = "1.27.0";
+  version = "1.28.0";
   pname = "libuv";
 
   src = fetchFromGitHub {
     owner = pname;
     repo = pname;
     rev = "v${version}";
-    sha256 = "1nhd3772qymlv0b251wg9rrqz279vki4hnd4s23yyll0kpmzkpac";
+    sha256 = "0l0gx69sdy3sv3pirjbca2ws54n9d83mj0j96h77k0ncywimvi64";
   };
 
   postPatch = let
diff --git a/pkgs/development/libraries/libva/default.nix b/pkgs/development/libraries/libva/default.nix
index 7f17b9af08b..752d56a344e 100644
--- a/pkgs/development/libraries/libva/default.nix
+++ b/pkgs/development/libraries/libva/default.nix
@@ -6,14 +6,14 @@
 
 stdenv.mkDerivation rec {
   name = "libva-${lib.optionalString minimal "minimal-"}${version}";
-  version = "2.4.0";
+  version = "2.4.1";
 
   # update libva-utils and vaapiIntel as well
   src = fetchFromGitHub {
     owner  = "01org";
     repo   = "libva";
     rev    = version;
-    sha256 = "1b58n6rjfsfjfw1s5kdfa0jpfiqs83g2w14s7sfp1qkckkz3988l";
+    sha256 = "06kqff05jhd87yi53gyc2qivgg4sbf19qyznm9s4dyz92k04cl5c";
   };
 
   outputs = [ "dev" "out" ];
diff --git a/pkgs/development/libraries/libxslt/default.nix b/pkgs/development/libraries/libxslt/default.nix
index ce79b2ac5ff..41633d91f3b 100644
--- a/pkgs/development/libraries/libxslt/default.nix
+++ b/pkgs/development/libraries/libxslt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libxml2, findXMLCatalogs, python2, libgcrypt
+{ stdenv, fetchurl, fetchpatch, libxml2, findXMLCatalogs, python2, libgcrypt
 , cryptoSupport ? false
 , pythonSupport ? stdenv.buildPlatform == stdenv.hostPlatform
 }:
@@ -18,6 +18,14 @@ stdenv.mkDerivation rec {
     sha256 = "1j1q1swnsy8jgi9x7mclvkrqhfgn09886gdlr9wzk7a08i8n0dlf";
   };
 
+  patches = [
+    (fetchpatch {
+      name = "CVE-2019-11068.patch";
+      url = "https://gitlab.gnome.org/GNOME/libxslt/commit/e03553605b45c88f0b4b2980adfbbb8f6fca2fd6.patch";
+      sha256 = "0pkpb4837km15zgg6h57bncp66d5lwrlvkr73h0lanywq7zrwhj8";
+    })
+  ];
+
   outputs = [ "bin" "dev" "out" "man" "doc" ] ++ stdenv.lib.optional pythonSupport "py";
 
   buildInputs = [ libxml2.dev ]
diff --git a/pkgs/development/libraries/mesa/darwin-clock-gettime.patch b/pkgs/development/libraries/mesa/darwin-clock-gettime.patch
deleted file mode 100644
index 94e90a1c587..00000000000
--- a/pkgs/development/libraries/mesa/darwin-clock-gettime.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-diff --git a/include/c11/threads_posix.h b/include/c11/threads_posix.h
-index 45cb6075e6..62937311b9 100644
---- a/include/c11/threads_posix.h
-+++ b/include/c11/threads_posix.h
-@@ -36,6 +36,11 @@
- #include <sched.h>
- #include <stdint.h> /* for intptr_t */
- 
-+#ifdef __MACH__
-+#include <mach/clock.h>
-+#include <mach/mach.h>
-+#endif
-+
- /*
- Configuration macro:
- 
-@@ -383,12 +388,25 @@ tss_set(tss_t key, void *val)
- /*-------------------- 7.25.7 Time functions --------------------*/
- // 7.25.6.1
- #ifndef HAVE_TIMESPEC_GET
-+
- static inline int
- timespec_get(struct timespec *ts, int base)
- {
-     if (!ts) return 0;
-     if (base == TIME_UTC) {
-+#ifdef __MACH__
-+        if (ts != NULL) {
-+            clock_serv_t cclock;
-+            mach_timespec_t mts;
-+            host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
-+            clock_get_time(cclock, &mts);
-+            mach_port_deallocate(mach_task_self(), cclock);
-+            ts->tv_sec = mts.tv_sec;
-+            ts->tv_nsec = mts.tv_nsec;
-+        }
-+#else
-         clock_gettime(CLOCK_REALTIME, ts);
-+#endif
-         return base;
-     }
-     return 0;
-diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
-index 1208ebb315..e1378fb1f0 100644
---- a/src/egl/drivers/dri2/egl_dri2.c
-+++ b/src/egl/drivers/dri2/egl_dri2.c
-@@ -65,6 +65,11 @@
- #include "util/u_vector.h"
- #include "mapi/glapi/glapi.h"
- 
-+#ifdef __MACH__
-+#include <mach/clock.h>
-+#include <mach/mach.h>
-+#endif
-+
- #define NUM_ATTRIBS 12
- 
- static void
-@@ -3092,7 +3097,17 @@ dri2_client_wait_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
- 
-             /* We override the clock to monotonic when creating the condition
-              * variable. */
-+#ifdef __MACH__
-+            clock_serv_t cclock;
-+            mach_timespec_t mts;
-+            host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
-+            clock_get_time(cclock, &mts);
-+            mach_port_deallocate(mach_task_self(), cclock);
-+            current.tv_sec = mts.tv_sec;
-+            current.tv_nsec = mts.tv_nsec;
-+#else
-             clock_gettime(CLOCK_MONOTONIC, &current);
-+#endif
- 
-             /* calculating when to expire */
-             expire.tv_nsec = timeout % 1000000000L;
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index 5bc1dfaf878..c9ce97849e1 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -93,7 +93,7 @@ let self = stdenv.mkDerivation {
     ./symlink-drivers.patch
     ./missing-includes.patch # dev_t needs sys/stat.h, time_t needs time.h, etc.-- fixes build w/musl
     ./disk_cache-include-dri-driver-path-in-cache-key.patch
-  ] ++ lib.optional stdenv.isDarwin ./darwin-clock-gettime.patch;
+  ];
 
   outputs = [ "out" "dev" "drivers" ]
             ++ lib.optional (elem "swrast" galliumDrivers) "osmesa";
diff --git a/pkgs/development/libraries/polkit/default.nix b/pkgs/development/libraries/polkit/default.nix
index f47d2713f1a..fb16a7fb693 100644
--- a/pkgs/development/libraries/polkit/default.nix
+++ b/pkgs/development/libraries/polkit/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, fetchpatch, autoreconfHook, pkgconfig, glib, expat, pam, perl
-, intltool, spidermonkey_52 , gobject-introspection, libxslt, docbook_xsl, dbus
+, intltool, spidermonkey_60 , gobject-introspection, libxslt, docbook_xsl, dbus
 , docbook_xml_dtd_412, gtk-doc, coreutils
 , useSystemd ? stdenv.isLinux, systemd
 , withGnome ? true
@@ -14,28 +14,14 @@ let
 in
 
 stdenv.mkDerivation rec {
-  name = "polkit-0.115";
+  pname = "polkit";
+  version = "0.116";
 
   src = fetchurl {
-    url = "https://www.freedesktop.org/software/polkit/releases/${name}.tar.gz";
-    sha256 = "0c91y61y4gy6p91cwbzg32dhavw4b7fflg370rimqhdxpzdfr1rg";
+    url = "https://www.freedesktop.org/software/${pname}/releases/${pname}-${version}.tar.gz";
+    sha256 = "1c9lbpndh5zis22f154vjrhnqw65z8s85nrgl42v738yf6g0q5w8";
   };
 
-  patches = [
-    # CVE-2019-6133 - See: https://bugs.chromium.org/p/project-zero/issues/detail?id=1692
-    (fetchpatch {
-      url = "https://gitlab.freedesktop.org/polkit/polkit/commit/6cc6aafee135ba44ea748250d7d29b562ca190e3.patch";
-      name = "CVE-2019-6133.patch";
-      sha256 = "0jjlbjzqcz96xh6w3nv3ss9jl0hhrcd7jg4aa5advf08ibaj29r1";
-    })
-    # CVE-2018-19788 - high UID fixup
-    (fetchpatch {
-      url = "https://gitlab.freedesktop.org/polkit/polkit/commit/5230646dc6876ef6e27f57926b1bad348f636147.patch";
-      name = "CVE-2018-19788.patch";
-      sha256 = "1y3az4mlxx8k1zcss5qm7k102s7k1kqgcfnf11j9678fh7p008vp";
-    })
-  ];
-
   postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
     sed -i -e "s/-Wl,--as-needed//" configure.ac
   '';
@@ -46,7 +32,7 @@ stdenv.mkDerivation rec {
     [ glib gtk-doc pkgconfig intltool perl ]
     ++ [ libxslt docbook_xsl docbook_xml_dtd_412 ]; # man pages
   buildInputs =
-    [ glib expat pam spidermonkey_52 ]
+    [ glib expat pam spidermonkey_60 ]
     ++ stdenv.lib.optional useSystemd systemd
     ++ stdenv.lib.optional withGnome gobject-introspection;
 
@@ -72,15 +58,21 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--datadir=${system}/share"
     "--sysconfdir=/etc"
-    "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
+    "--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
     "--with-polkitd-user=polkituser" #TODO? <nixos> config.ids.uids.polkituser
     "--with-os-type=NixOS" # not recognized but prevents impurities on non-NixOS
     (if withGnome then "--enable-introspection" else "--disable-introspection")
   ] ++ stdenv.lib.optional (!doCheck) "--disable-test";
 
-  makeFlags = "INTROSPECTION_GIRDIR=$(out)/share/gir-1.0 INTROSPECTION_TYPELIBDIR=$(out)/lib/girepository-1.0";
+  makeFlags = [
+    "INTROSPECTION_GIRDIR=${placeholder "out"}/share/gir-1.0"
+    "INTROSPECTION_TYPELIBDIR=${placeholder "out"}/lib/girepository-1.0"
+  ];
 
-  installFlags=["datadir=$(out)/share" "sysconfdir=$(out)/etc"];
+  installFlags = [
+    "datadir=${placeholder "out"}/share"
+    "sysconfdir=${placeholder "out"}/etc"
+  ];
 
   inherit doCheck;
   checkInputs = [dbus];
diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix
index 8715aaaa44d..de9a656f6ff 100644
--- a/pkgs/development/libraries/qt-4.x/4.8/default.nix
+++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix
@@ -231,5 +231,6 @@ stdenv.mkDerivation rec {
     license     = lib.licenses.lgpl21Plus; # or gpl3
     maintainers = with lib.maintainers; [ orivej lovek323 phreedom sander ];
     platforms   = lib.platforms.unix;
+    badPlatforms = [ "x86_64-darwin" ];
   };
 }
diff --git a/pkgs/development/libraries/qt-5/5.11/default.nix b/pkgs/development/libraries/qt-5/5.11/default.nix
index 379c370e1fc..0014a1452aa 100644
--- a/pkgs/development/libraries/qt-5/5.11/default.nix
+++ b/pkgs/development/libraries/qt-5/5.11/default.nix
@@ -20,7 +20,7 @@ top-level attribute to `top-level/all-packages.nix`.
   stdenv, fetchurl, fetchFromGitHub, makeSetupHook,
   bison, cups ? null, harfbuzz, libGL, perl,
   gstreamer, gst-plugins-base, gtk3, dconf,
-  cf-private,
+  cf-private, llvmPackages_5,
 
   # options
   developerBuild ? false,
@@ -51,34 +51,24 @@ let
   patches = {
     qtbase = [
       ./qtbase.patch
-      ./qtbase-darwin.patch
-      ./qtbase-revert-no-macos10.10.patch
       ./qtbase-fixguicmake.patch
-    ] ++ optionals stdenv.isDarwin [
-      ./qtbase-darwin-nseventtype.patch
-      ./qtbase-darwin-revert-69221.patch
     ];
     qtdeclarative = [ ./qtdeclarative.patch ];
     qtscript = [ ./qtscript.patch ];
     qtserialport = [ ./qtserialport.patch ];
     qttools = [ ./qttools.patch ];
-    qtwebengine = [ ./qtwebengine-no-build-skip.patch ]
-      ++ optional stdenv.cc.isClang ./qtwebengine-clang-fix.patch
-      ++ optionals stdenv.isDarwin [
-        ./qtwebengine-darwin-no-platform-check.patch
-        ./qtwebengine-darwin-sdk-10.10.patch
-        ./qtwebengine-darwin-old-sdk.patch
-      ];
-    qtwebkit = [ ./qtwebkit.patch ]
-      ++ optionals stdenv.isDarwin [
-        ./qtwebkit-darwin-no-readline.patch
-        ./qtwebkit-darwin-no-qos-classes.patch
-      ];
+    qtwebengine = [
+      ./qtwebengine-no-build-skip.patch
+      ./qtwebengine-darwin-no-platform-check.patch
+    ];
+    qtwebkit = [ ./qtwebkit.patch ];
   };
 
   mkDerivation =
-    import ../mkDerivation.nix
-    { inherit stdenv; inherit (stdenv) lib; }
+    import ../mkDerivation.nix {
+      inherit (stdenv) lib;
+      stdenv = if stdenv.cc.isClang then llvmPackages_5.stdenv else stdenv;
+    }
     { inherit debug; };
 
   qtModule =
@@ -109,7 +99,7 @@ let
       qtdoc = callPackage ../modules/qtdoc.nix {};
       qtgraphicaleffects = callPackage ../modules/qtgraphicaleffects.nix {};
       qtimageformats = callPackage ../modules/qtimageformats.nix {};
-      qtlocation = callPackage ../modules/qtlocation.nix {};
+      qtlocation = callPackage ../modules/qtlocation.nix { };
       qtmacextras = callPackage ../modules/qtmacextras.nix {
         inherit cf-private;
       };
diff --git a/pkgs/development/libraries/qt-5/5.11/qtbase-darwin-nseventtype.patch b/pkgs/development/libraries/qt-5/5.11/qtbase-darwin-nseventtype.patch
deleted file mode 100644
index 9ef6e8ef069..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtbase-darwin-nseventtype.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/src/plugins/platforms/cocoa/qcocoawindow.mm
-+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
-@@ -404,8 +404,8 @@ void QCocoaWindow::setVisible(bool visible)
-                         removeMonitor();
-                         monitor = [NSEvent addGlobalMonitorForEventsMatchingMask:NSLeftMouseDownMask|NSRightMouseDownMask|NSOtherMouseDownMask|NSMouseMovedMask handler:^(NSEvent *e) {
-                             QPointF localPoint = QCocoaScreen::mapFromNative([NSEvent mouseLocation]);
--                            const auto button = e.type == NSEventTypeMouseMoved ? Qt::NoButton : cocoaButton2QtButton([e buttonNumber]);
--                            const auto eventType = e.type == NSEventTypeMouseMoved ? QEvent::MouseMove : QEvent::MouseButtonPress;
-+                            const auto button = e.type == NSMouseMoved ? Qt::NoButton : cocoaButton2QtButton([e buttonNumber]);
-+                            const auto eventType = e.type == NSMouseMoved ? QEvent::MouseMove : QEvent::MouseButtonPress;
-                             QWindowSystemInterface::handleMouseEvent(window(), window()->mapFromGlobal(localPoint.toPoint()), localPoint,
-                                                                      Qt::MouseButtons(uint(NSEvent.pressedMouseButtons & 0xFFFF)), button, eventType);
-                         }];
diff --git a/pkgs/development/libraries/qt-5/5.11/qtbase-darwin-revert-69221.patch b/pkgs/development/libraries/qt-5/5.11/qtbase-darwin-revert-69221.patch
deleted file mode 100644
index 73eea435f84..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtbase-darwin-revert-69221.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
-index 00c3f7c22c..94d35f59d6 100644
---- a/src/plugins/platforms/cocoa/qcocoawindow.mm
-+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
-@@ -1355,15 +1355,6 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)
- {
-     QMacAutoReleasePool pool;
- 
--    Qt::WindowType type = window()->type();
--    Qt::WindowFlags flags = window()->flags();
--
--    // Note: The macOS window manager has a bug, where if a screen is rotated, it will not allow
--    // a window to be created within the area of the screen that has a Y coordinate (I quadrant)
--    // higher than the height of the screen  in its non-rotated state, unless the window is
--    // created with the NSWindowStyleMaskBorderless style mask.
--    NSWindowStyleMask styleMask = windowStyleMask(flags);
--
-     QRect rect = geometry();
- 
-     QScreen *targetScreen = nullptr;
-@@ -1375,22 +1366,26 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)
-     }
- 
-     if (!targetScreen) {
--        qCWarning(lcQpaCocoaWindow) << "Window position" << rect << "outside any known screen, using primary screen";
-+        qCWarning(lcQpaCocoaWindow) << "Window position outside any known screen, using primary screen";
-         targetScreen = QGuiApplication::primaryScreen();
--        // AppKit will only reposition a window that's outside the target screen area if
--        // the window has a title bar. If left out, the window ends up with no screen.
--        // The style mask will be corrected to the original style mask in setWindowFlags.
--        styleMask |= NSWindowStyleMaskTitled;
-     }
- 
-     rect.translate(-targetScreen->geometry().topLeft());
-     QCocoaScreen *cocoaScreen = static_cast<QCocoaScreen *>(targetScreen->handle());
-     NSRect frame = QCocoaScreen::mapToNative(rect, cocoaScreen);
- 
-+    // Note: The macOS window manager has a bug, where if a screen is rotated, it will not allow
-+    // a window to be created within the area of the screen that has a Y coordinate (I quadrant)
-+    // higher than the height of the screen  in its non-rotated state, unless the window is
-+    // created with the NSWindowStyleMaskBorderless style mask.
-+
-+    Qt::WindowType type = window()->type();
-+    Qt::WindowFlags flags = window()->flags();
-+
-     // Create NSWindow
-     Class windowClass = shouldBePanel ? [QNSPanel class] : [QNSWindow class];
-     QCocoaNSWindow *nsWindow = [[windowClass alloc] initWithContentRect:frame
--        styleMask:styleMask
-+        styleMask:windowStyleMask(flags)
-         // Deferring window creation breaks OpenGL (the GL context is
-         // set up before the window is shown and needs a proper window)
-         backing:NSBackingStoreBuffered defer:NO
-@@ -1399,9 +1394,6 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)
-     Q_ASSERT_X(nsWindow.screen == cocoaScreen->nativeScreen(), "QCocoaWindow",
-         "Resulting NSScreen should match the requested NSScreen");
- 
--    if (targetScreen != window()->screen())
--        QWindowSystemInterface::handleWindowScreenChanged(window(), targetScreen);
--
-     nsWindow.delegate = [[QNSWindowDelegate alloc] initWithQCocoaWindow:this];
- 
-     // Prevent Cocoa from releasing the window on close. Qt
-@@ -1421,6 +1413,9 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)
-         });
-     }
- 
-+    if (targetScreen != window()->screen())
-+        QWindowSystemInterface::handleWindowScreenChanged(window(), targetScreen);
-+
-     nsWindow.restorable = NO;
-     nsWindow.level = windowLevel(flags);
- 
diff --git a/pkgs/development/libraries/qt-5/5.11/qtbase-darwin.patch b/pkgs/development/libraries/qt-5/5.11/qtbase-darwin.patch
deleted file mode 100644
index f6635175205..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtbase-darwin.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
-index 341d3bccf2..3368234c26 100644
---- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
-+++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm
-@@ -287,7 +287,7 @@ void QScanThread::getUserConfigurations()
-     QMacAutoReleasePool pool;
-     userProfiles.clear();
- 
--    NSArray<NSString *> *wifiInterfaces = [CWWiFiClient interfaceNames];
-+    NSArray *wifiInterfaces = [CWWiFiClient interfaceNames];
-     for (NSString *ifName in wifiInterfaces) {
- 
-         CWInterface *wifiInterface = [[CWWiFiClient sharedWiFiClient] interfaceWithName:ifName];
-@@ -602,7 +602,7 @@ void QCoreWlanEngine::doRequestUpdate()
- 
-     QMacAutoReleasePool pool;
- 
--    NSArray<NSString *> *wifiInterfaces = [CWWiFiClient interfaceNames];
-+    NSArray *wifiInterfaces = [CWWiFiClient interfaceNames];
-     for (NSString *ifName in wifiInterfaces) {
-             scanThread->interfaceName = QString::fromNSString(ifName);
-             scanThread->start();
-diff --git a/src/plugins/platforms/cocoa/qcocoascreen.mm b/src/plugins/platforms/cocoa/qcocoascreen.mm
-index a17a02b629..d76c42fa03 100644
---- a/src/plugins/platforms/cocoa/qcocoascreen.mm
-+++ b/src/plugins/platforms/cocoa/qcocoascreen.mm
-@@ -114,7 +114,7 @@ void QCocoaScreen::updateGeometry()
-         return;
-
-     // The reference screen for the geometry is always the primary screen
--    QRectF primaryScreenGeometry = QRectF::fromCGRect([[NSScreen screens] firstObject].frame);
-+    QRectF primaryScreenGeometry = QRectF::fromCGRect([[[NSScreen screens] firstObject] frame]);
-     m_geometry = qt_mac_flip(QRectF::fromCGRect(nsScreen.frame), primaryScreenGeometry).toRect();
-     m_availableGeometry = qt_mac_flip(QRectF::fromCGRect(nsScreen.visibleFrame), primaryScreenGeometry).toRect();
-
-diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
-index 72f3bc0075..a9c058a850 100644
---- a/src/plugins/platforms/cocoa/qcocoawindow.mm
-+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
-@@ -1676,7 +1676,7 @@ void QCocoaWindow::applyContentBorderThickness(NSWindow *window)
- 
-     if (!m_drawContentBorderGradient) {
-         window.styleMask = window.styleMask & ~NSTexturedBackgroundWindowMask;
--        [window.contentView.superview setNeedsDisplay:YES];
-+        [[window.contentView superview] setNeedsDisplay:YES];
-         window.titlebarAppearsTransparent = NO;
-         return;
-     }
-diff --git a/src/plugins/platforms/cocoa/qnswindow.mm b/src/plugins/platforms/cocoa/qnswindow.mm
-index cb13b7d184..0159d68dca 100644
---- a/src/plugins/platforms/cocoa/qnswindow.mm
-+++ b/src/plugins/platforms/cocoa/qnswindow.mm
-@@ -231,7 +231,7 @@ static bool isMouseEvent(NSEvent *ev)
-     if (pw->frameStrutEventsEnabled() && isMouseEvent(theEvent)) {
-         NSPoint loc = [theEvent locationInWindow];
-         NSRect windowFrame = [self convertRectFromScreen:self.frame];
--        NSRect contentFrame = self.contentView.frame;
-+        NSRect contentFrame = [self.contentView frame];
-         if (NSMouseInRect(loc, windowFrame, NO) && !NSMouseInRect(loc, contentFrame, NO))
-             [qnsview_cast(pw->view()) handleFrameStrutMouseEvent:theEvent];
-     }
-@@ -260,7 +260,7 @@ static bool isMouseEvent(NSEvent *ev)
- + (void)applicationActivationChanged:(NSNotification*)notification
- {
-     const id sender = self;
--    NSEnumerator<NSWindow*> *windowEnumerator = nullptr;
-+    NSEnumerator *windowEnumerator = nullptr;
-     NSApplication *application = [NSApplication sharedApplication];
- 
- #if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12)
diff --git a/pkgs/development/libraries/qt-5/5.11/qtbase-revert-no-macos10.10.patch b/pkgs/development/libraries/qt-5/5.11/qtbase-revert-no-macos10.10.patch
deleted file mode 100644
index 29776518379..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtbase-revert-no-macos10.10.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-Revert "Remove code paths for macOS < 10.11"
-
-This reverts commit 138a65e0cfa80b13fd018a01e7d8b33341a3cfd3.
-
-From 138a65e0cfa80b13fd018a01e7d8b33341a3cfd3 Mon Sep 17 00:00:00 2001
-From: Jake Petroules <jake.petroules@qt.io>
-Date: Thu, 8 Feb 2018 11:05:42 -0800
-Subject: [PATCH] Remove code paths for macOS < 10.11
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Change-Id: I5ae02d88aa3dcd97d1f2ebf6255a68643e5d6daa
-Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
-Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
----
- .../fontdatabases/mac/qfontengine_coretext.mm            | 16 +++-------------
- src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm    |  6 +-----
- src/plugins/platforms/cocoa/qnswindowdelegate.mm         | 16 ----------------
- 3 files changed, 4 insertions(+), 34 deletions(-)
-
-diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
-index 98b753eff9..489d9cd031 100644
---- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
-+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
-@@ -47,18 +47,28 @@
- 
- #include <cmath>
- 
--#if defined(Q_OS_MACOS)
-+#if defined(Q_OS_OSX) && !QT_OSX_DEPLOYMENT_TARGET_BELOW(__MAC_10_11)
- #import <AppKit/AppKit.h>
- #endif
- 
--#if defined(QT_PLATFORM_UIKIT)
-+#if defined(QT_PLATFORM_UIKIT) && !QT_IOS_DEPLOYMENT_TARGET_BELOW(__IPHONE_8_2)
- #import <UIKit/UIKit.h>
- #endif
- 
- // These are available cross platform, exported as kCTFontWeightXXX from CoreText.framework,
- // but they are not documented and are not in public headers so are private API and exposed
- // only through the NSFontWeightXXX and UIFontWeightXXX aliases in AppKit and UIKit (rdar://26109857)
--#if defined(Q_OS_MACOS)
-+#if QT_MAC_DEPLOYMENT_TARGET_BELOW(__MAC_10_11, __IPHONE_8_2)
-+#define kCTFontWeightUltraLight -0.8
-+#define kCTFontWeightThin -0.6
-+#define kCTFontWeightLight -0.4
-+#define kCTFontWeightRegular 0
-+#define kCTFontWeightMedium 0.23
-+#define kCTFontWeightSemibold 0.3
-+#define kCTFontWeightBold 0.4
-+#define kCTFontWeightHeavy 0.56
-+#define kCTFontWeightBlack 0.62
-+#elif defined(Q_OS_OSX)
- #define kCTFontWeightUltraLight NSFontWeightUltraLight
- #define kCTFontWeightThin NSFontWeightThin
- #define kCTFontWeightLight NSFontWeightLight
-diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
-index 94f2125bad..272cd9f3dc 100644
---- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
-+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
-@@ -162,7 +162,11 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSOpenSavePanelDelegate);
-     // resetting our mCurrentDir, set the delegate
-     // here to make sure it gets the correct value.
-     [mSavePanel setDelegate:self];
--    mOpenPanel.accessoryViewDisclosed = YES;
-+
-+#if QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_11)
-+    if (__builtin_available(macOS 10.11, *))
-+        mOpenPanel.accessoryViewDisclosed = YES;
-+#endif
- 
-     if (mOptions->isLabelExplicitlySet(QFileDialogOptions::Accept))
-         [mSavePanel setPrompt:[self strip:options->labelText(QFileDialogOptions::Accept)]];
-diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
-index 057a4c2943..eb55e50622 100644
---- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm
-+++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
-@@ -103,6 +103,22 @@ static QRegExp whitespaceRegex = QRegExp(QStringLiteral("\\s*"));
-     return QCocoaScreen::mapToNative(maximizedFrame);
- }
- 
-+#if QT_MACOS_DEPLOYMENT_TARGET_BELOW(__MAC_10_11)
-+/*
-+    AppKit on OS X 10.10 wrongly calls windowWillUseStandardFrame:defaultFrame
-+    from -[NSWindow _frameForFullScreenMode] when going into fullscreen, resulting
-+    in black bars on top and bottom of the window. By implementing the following
-+    method, AppKit will choose that instead, and resolve the right fullscreen
-+    geometry.
-+*/
-+- (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize
-+{
-+    Q_UNUSED(proposedSize);
-+    Q_ASSERT(window == m_cocoaWindow->nativeWindow());
-+    return NSSizeFromCGSize(m_cocoaWindow->screen()->geometry().size().toCGSize());
-+}
-+#endif
-+
- - (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu
- {
-     Q_UNUSED(window);
diff --git a/pkgs/development/libraries/qt-5/5.11/qtwebengine-clang-fix.patch b/pkgs/development/libraries/qt-5/5.11/qtwebengine-clang-fix.patch
deleted file mode 100644
index 8dafd65cd34..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtwebengine-clang-fix.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-Fix a following build error:
-
-In file included from ../../3rdparty/chromium/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm:7:
-../../3rdparty/chromium/base/bind.h:59:3: error: static_assert failed "Bound argument |i| of type |Arg| cannot be forwarded as |Unwrapped| to the bound functor, which declares it as |Param|."
-  static_assert(
-  ^
-../../3rdparty/chromium/base/bind.h:91:7: note: in instantiation of template class 'base::internal::AssertConstructible<1, long, long, const long &, NSError *>' requested here
-    : AssertConstructible<Ns, Args, std::decay_t<Args>, Unwrapped, Params>... {
-      ^
-../../3rdparty/chromium/base/bind.h:213:27: note: in instantiation of template class 'base::internal::AssertBindArgsValidity<std::__1::integer_sequence<unsigned long, 0, 1>, base::internal::TypeList<base::WeakPtr<device::BluetoothRemoteGattCharacteristicMac>, long>, base::internal::TypeList<device::BluetoothRemoteGattCharacteristicMac *, const long &>, base::internal::TypeList<device::BluetoothRemoteGattCharacteristicMac *, NSError *> >' requested here
-  static_assert(internal::AssertBindArgsValidity<
-                          ^
-../../3rdparty/chromium/base/bind.h:242:16: note: in instantiation of function template specialization 'base::BindRepeating<void (device::BluetoothRemoteGattCharacteristicMac::*)(NSError *), base::WeakPtr<device::BluetoothRemoteGattCharacteristicMac>, long>' requested here
-  return base::BindRepeating(std::forward<Functor>(functor),
-               ^
-../../3rdparty/chromium/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm:211:15: note: in instantiation of function template specialization 'base::Bind<void (device::BluetoothRemoteGattCharacteristicMac::*)(NSError *), base::WeakPtr<device::BluetoothRemoteGattCharacteristicMac>, long>' requested here
-        base::Bind(&BluetoothRemoteGattCharacteristicMac::DidWriteValue,
-              ^
-
---- a/src/3rdparty/chromium/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm
-+++ b/src/3rdparty/chromium/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm
-@@ -209,7 +209,7 @@ void BluetoothRemoteGattCharacteristicMac::WriteRemoteCharacteristic(
-     base::ThreadTaskRunnerHandle::Get()->PostTask(
-         FROM_HERE,
-         base::Bind(&BluetoothRemoteGattCharacteristicMac::DidWriteValue,
--                   weak_ptr_factory_.GetWeakPtr(), nil));
-+                   weak_ptr_factory_.GetWeakPtr(), nullptr));
-   }
- }
- 
diff --git a/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-old-sdk.patch b/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-old-sdk.patch
deleted file mode 100644
index b065c221101..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-old-sdk.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/src/3rdparty/chromium/third_party/webrtc/sdk/objc/Framework/Classes/Common/RTCFieldTrials.mm b/src/3rdparty/chromium/third_party/webrtc/sdk/objc/Framework/Classes/Common/RTCFieldTrials.mm
---- a/src/3rdparty/chromium/third_party/webrtc/sdk/objc/Framework/Classes/Common/RTCFieldTrials.mm
-+++ b/src/3rdparty/chromium/third_party/webrtc/sdk/objc/Framework/Classes/Common/RTCFieldTrials.mm
-@@ -45,7 +45,7 @@ NSString *RTCFieldTrialTrendlineFilterValue(
-   return [NSString stringWithFormat:format, windowSize, smoothingCoeff, thresholdGain];
- }
- 
--void RTCInitFieldTrialDictionary(NSDictionary<NSString *, NSString *> *fieldTrials) {
-+void RTCInitFieldTrialDictionary(NSDictionary *fieldTrials) {
-   if (!fieldTrials) {
-     RTCLogWarning(@"No fieldTrials provided.");
-     return;
-diff --git a/src/3rdparty/chromium/third_party/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCFieldTrials.h b/src/3rdparty/chromium/third_party/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCFieldTrials.h
---- a/src/3rdparty/chromium/third_party/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCFieldTrials.h
-+++ b/src/3rdparty/chromium/third_party/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCFieldTrials.h
-@@ -40,4 +40,4 @@ RTC_EXTERN NSString *RTCFieldTrialTrendlineFilterValue(
-  *  Must be called before any other call into WebRTC. See:
-  *  webrtc/system_wrappers/include/field_trial_default.h
-  */
--RTC_EXTERN void RTCInitFieldTrialDictionary(NSDictionary<NSString *, NSString *> *fieldTrials);
-+RTC_EXTERN void RTCInitFieldTrialDictionary(NSDictionary *fieldTrials);
diff --git a/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-sdk-10.10.patch b/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-sdk-10.10.patch
deleted file mode 100644
index d43b09b9538..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-sdk-10.10.patch
+++ /dev/null
@@ -1,160 +0,0 @@
-Fix build against 10.10 SDK
-
-The SecKey part perhaps could be fixed by implementing a revert to
-https://chromium.googlesource.com/chromium/src.git/+/8418e098b9cbedf884878b61dcd3292c515845cf%5E%21/#F0
-
---- a/src/3rdparty/chromium/content/browser/renderer_host/input/web_input_event_builders_mac.mm
-+++ b/src/3rdparty/chromium/content/browser/renderer_host/input/web_input_event_builders_mac.mm
-@@ -1,3 +1,4 @@
-+#define NSEventTypeScrollWheel 22
- // Copyright 2015 The Chromium Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
---- a/src/3rdparty/chromium/net/ssl/ssl_platform_key_mac.cc
-+++ b/src/3rdparty/chromium/net/ssl/ssl_platform_key_mac.cc
-@@ -48,21 +48,6 @@ namespace net {
- 
- namespace {
- 
--// TODO(davidben): Remove this when we switch to building to the 10.13
--// SDK. https://crbug.com/780980
--#if !defined(MAC_OS_X_VERSION_10_13) || \
--    MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_13
--API_AVAILABLE(macosx(10.13))
--const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPSSSHA256 =
--    CFSTR("algid:sign:RSA:digest-PSS:SHA256:SHA256:32");
--API_AVAILABLE(macosx(10.13))
--const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPSSSHA384 =
--    CFSTR("algid:sign:RSA:digest-PSS:SHA384:SHA384:48");
--API_AVAILABLE(macosx(10.13))
--const SecKeyAlgorithm kSecKeyAlgorithmRSASignatureDigestPSSSHA512 =
--    CFSTR("algid:sign:RSA:digest-PSS:SHA512:SHA512:64");
--#endif
--
- class ScopedCSSM_CC_HANDLE {
-  public:
-   ScopedCSSM_CC_HANDLE() : handle_(0) {}
-@@ -187,109 +172,6 @@ class SSLPlatformKeyCSSM : public ThreadedSSLPrivateKey::Delegate {
-   DISALLOW_COPY_AND_ASSIGN(SSLPlatformKeyCSSM);
- };
- 
--// Returns the corresponding SecKeyAlgorithm or nullptr if unrecognized.
--API_AVAILABLE(macosx(10.12))
--SecKeyAlgorithm GetSecKeyAlgorithm(uint16_t algorithm) {
--  switch (algorithm) {
--    case SSL_SIGN_RSA_PKCS1_SHA512:
--      return kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA512;
--    case SSL_SIGN_RSA_PKCS1_SHA384:
--      return kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA384;
--    case SSL_SIGN_RSA_PKCS1_SHA256:
--      return kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA256;
--    case SSL_SIGN_RSA_PKCS1_SHA1:
--      return kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA1;
--    case SSL_SIGN_RSA_PKCS1_MD5_SHA1:
--      return kSecKeyAlgorithmRSASignatureDigestPKCS1v15Raw;
--    case SSL_SIGN_ECDSA_SECP521R1_SHA512:
--      return kSecKeyAlgorithmECDSASignatureDigestX962SHA512;
--    case SSL_SIGN_ECDSA_SECP384R1_SHA384:
--      return kSecKeyAlgorithmECDSASignatureDigestX962SHA384;
--    case SSL_SIGN_ECDSA_SECP256R1_SHA256:
--      return kSecKeyAlgorithmECDSASignatureDigestX962SHA256;
--    case SSL_SIGN_ECDSA_SHA1:
--      return kSecKeyAlgorithmECDSASignatureDigestX962SHA1;
--  }
--
--  if (base::mac::IsAtLeastOS10_13()) {
--    switch (algorithm) {
--      case SSL_SIGN_RSA_PSS_SHA512:
--        return kSecKeyAlgorithmRSASignatureDigestPSSSHA512;
--      case SSL_SIGN_RSA_PSS_SHA384:
--        return kSecKeyAlgorithmRSASignatureDigestPSSSHA384;
--      case SSL_SIGN_RSA_PSS_SHA256:
--        return kSecKeyAlgorithmRSASignatureDigestPSSSHA256;
--    }
--  }
--
--  return nullptr;
--}
--
--class API_AVAILABLE(macosx(10.12)) SSLPlatformKeySecKey
--    : public ThreadedSSLPrivateKey::Delegate {
-- public:
--  SSLPlatformKeySecKey(int type, size_t max_length, SecKeyRef key)
--      : key_(key, base::scoped_policy::RETAIN) {
--    // Determine the algorithms supported by the key.
--    for (uint16_t algorithm : SSLPrivateKey::DefaultAlgorithmPreferences(
--             type, true /* include PSS */)) {
--      SecKeyAlgorithm sec_algorithm = GetSecKeyAlgorithm(algorithm);
--      if (sec_algorithm &&
--          SecKeyIsAlgorithmSupported(key_.get(), kSecKeyOperationTypeSign,
--                                     sec_algorithm)) {
--        preferences_.push_back(algorithm);
--      }
--    }
--  }
--
--  ~SSLPlatformKeySecKey() override {}
--
--  std::vector<uint16_t> GetAlgorithmPreferences() override {
--    return preferences_;
--  }
--
--  Error Sign(uint16_t algorithm,
--             base::span<const uint8_t> input,
--             std::vector<uint8_t>* signature) override {
--    SecKeyAlgorithm sec_algorithm = GetSecKeyAlgorithm(algorithm);
--    if (!sec_algorithm) {
--      NOTREACHED();
--      return ERR_FAILED;
--    }
--
--    const EVP_MD* md = SSL_get_signature_algorithm_digest(algorithm);
--    uint8_t digest[EVP_MAX_MD_SIZE];
--    unsigned digest_len;
--    if (!md || !EVP_Digest(input.data(), input.size(), digest, &digest_len, md,
--                           nullptr)) {
--      return ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED;
--    }
--
--    base::ScopedCFTypeRef<CFDataRef> digest_ref(CFDataCreateWithBytesNoCopy(
--        kCFAllocatorDefault, digest, base::checked_cast<CFIndex>(digest_len),
--        kCFAllocatorNull));
--
--    base::ScopedCFTypeRef<CFErrorRef> error;
--    base::ScopedCFTypeRef<CFDataRef> signature_ref(SecKeyCreateSignature(
--        key_, sec_algorithm, digest_ref, error.InitializeInto()));
--    if (!signature_ref) {
--      LOG(ERROR) << error;
--      return ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED;
--    }
--
--    signature->assign(
--        CFDataGetBytePtr(signature_ref),
--        CFDataGetBytePtr(signature_ref) + CFDataGetLength(signature_ref));
--    return OK;
--  }
--
-- private:
--  std::vector<uint16_t> preferences_;
--  base::ScopedCFTypeRef<SecKeyRef> key_;
--
--  DISALLOW_COPY_AND_ASSIGN(SSLPlatformKeySecKey);
--};
--
- scoped_refptr<SSLPrivateKey> CreateSSLPrivateKeyForSecKey(
-     const X509Certificate* certificate,
-     SecKeyRef private_key) {
-@@ -298,13 +180,6 @@ scoped_refptr<SSLPrivateKey> CreateSSLPrivateKeyForSecKey(
-   if (!GetClientCertInfo(certificate, &key_type, &max_length))
-     return nullptr;
- 
--  if (base::mac::IsAtLeastOS10_12()) {
--    return base::MakeRefCounted<ThreadedSSLPrivateKey>(
--        std::make_unique<SSLPlatformKeySecKey>(key_type, max_length,
--                                               private_key),
--        GetSSLPlatformKeyTaskRunner());
--  }
--
-   const CSSM_KEY* cssm_key;
-   OSStatus status = SecKeyGetCSSMKey(private_key, &cssm_key);
-   if (status != noErr) {
diff --git a/pkgs/development/libraries/qt-5/5.11/qtwebkit-darwin-no-qos-classes.patch b/pkgs/development/libraries/qt-5/5.11/qtwebkit-darwin-no-qos-classes.patch
deleted file mode 100644
index a7087f51762..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtwebkit-darwin-no-qos-classes.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff --git a/Source/cmake/OptionsQt.cmake b/Source/cmake/OptionsQt.cmake
---- a/Source/cmake/OptionsQt.cmake
-+++ b/Source/cmake/OptionsQt.cmake
-@@ -683,7 +683,6 @@ if (WIN32 AND COMPILER_IS_GCC_OR_CLANG)
- endif ()
- 
- if (APPLE)
--    SET_AND_EXPOSE_TO_BUILD(HAVE_QOS_CLASSES 1)
- endif ()
- 
- if (ENABLE_MATHML)
diff --git a/pkgs/development/libraries/qt-5/5.11/qtwebkit-darwin-no-readline.patch b/pkgs/development/libraries/qt-5/5.11/qtwebkit-darwin-no-readline.patch
deleted file mode 100644
index 26d189d8601..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtwebkit-darwin-no-readline.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-diff --git a/Source/JavaScriptCore/shell/CMakeLists.txt b/Source/JavaScriptCore/shell/CMakeLists.txt
---- a/Source/JavaScriptCore/shell/CMakeLists.txt
-+++ b/Source/JavaScriptCore/shell/CMakeLists.txt
-@@ -9,7 +9,6 @@ set(JSC_LIBRARIES
- )
- 
- if (WTF_OS_MAC_OS_X)
--    list(APPEND JSC_LIBRARIES edit)
- endif ()
- 
- if ("${JavaScriptCore_LIBRARY_TYPE}" MATCHES "STATIC")
-diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
---- a/Source/WTF/wtf/Platform.h
-+++ b/Source/WTF/wtf/Platform.h
-@@ -563,7 +563,6 @@
- #if PLATFORM(IOS)
- 
- #define HAVE_NETWORK_EXTENSION 1
--#define HAVE_READLINE 1
- #if USE(APPLE_INTERNAL_SDK)
- #define USE_CFNETWORK 1
- #endif
-@@ -650,7 +649,6 @@
- #define HAVE_MADV_DONTNEED 1
- #define HAVE_MERGESORT 1
- #define HAVE_PTHREAD_SETNAME_NP 1
--#define HAVE_READLINE 1
- #define HAVE_SYS_TIMEB_H 1
- 
- #if !PLATFORM(GTK) && !PLATFORM(QT)
-diff --git a/Source/WTF/wtf/PlatformMac.cmake b/Source/WTF/wtf/PlatformMac.cmake
---- a/Source/WTF/wtf/PlatformMac.cmake
-+++ b/Source/WTF/wtf/PlatformMac.cmake
-@@ -2,11 +2,9 @@ set(WTF_LIBRARY_TYPE SHARED)
- 
- find_library(COCOA_LIBRARY Cocoa)
- find_library(COREFOUNDATION_LIBRARY CoreFoundation)
--find_library(READLINE_LIBRARY Readline)
- list(APPEND WTF_LIBRARIES
-     ${COREFOUNDATION_LIBRARY}
-     ${COCOA_LIBRARY}
--    ${READLINE_LIBRARY}
-     libicucore.dylib
- )
- 
diff --git a/pkgs/development/libraries/qt-5/5.12/default.nix b/pkgs/development/libraries/qt-5/5.12/default.nix
index 6d0e241d7a5..d84596bd054 100644
--- a/pkgs/development/libraries/qt-5/5.12/default.nix
+++ b/pkgs/development/libraries/qt-5/5.12/default.nix
@@ -20,7 +20,7 @@ top-level attribute to `top-level/all-packages.nix`.
   stdenv, fetchurl, fetchFromGitHub, makeSetupHook,
   bison, cups ? null, harfbuzz, libGL, perl,
   gstreamer, gst-plugins-base, gtk3, dconf,
-  cf-private,
+  cf-private, llvmPackages_5,
 
   # options
   developerBuild ? false,
@@ -51,11 +51,7 @@ let
   patches = {
     qtbase = [
       ./qtbase.patch
-      ./qtbase-darwin.patch
-      ./qtbase-revert-no-macos10.10.patch
       ./qtbase-fixguicmake.patch
-    ] ++ optionals stdenv.isDarwin [
-      ./qtbase-darwin-nseventtype.patch
     ];
     qtdeclarative = [ ./qtdeclarative.patch ];
     qtscript = [ ./qtscript.patch ];
@@ -73,8 +69,10 @@ let
   };
 
   mkDerivation =
-    import ../mkDerivation.nix
-    { inherit stdenv; inherit (stdenv) lib; }
+    import ../mkDerivation.nix {
+      inherit (stdenv) lib;
+      stdenv = if stdenv.cc.isClang then llvmPackages_5.stdenv else stdenv;
+    }
     { inherit debug; };
 
   qtModule =
diff --git a/pkgs/development/libraries/qt-5/5.12/qtbase-darwin-nseventtype.patch b/pkgs/development/libraries/qt-5/5.12/qtbase-darwin-nseventtype.patch
deleted file mode 100644
index 9ef6e8ef069..00000000000
--- a/pkgs/development/libraries/qt-5/5.12/qtbase-darwin-nseventtype.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/src/plugins/platforms/cocoa/qcocoawindow.mm
-+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
-@@ -404,8 +404,8 @@ void QCocoaWindow::setVisible(bool visible)
-                         removeMonitor();
-                         monitor = [NSEvent addGlobalMonitorForEventsMatchingMask:NSLeftMouseDownMask|NSRightMouseDownMask|NSOtherMouseDownMask|NSMouseMovedMask handler:^(NSEvent *e) {
-                             QPointF localPoint = QCocoaScreen::mapFromNative([NSEvent mouseLocation]);
--                            const auto button = e.type == NSEventTypeMouseMoved ? Qt::NoButton : cocoaButton2QtButton([e buttonNumber]);
--                            const auto eventType = e.type == NSEventTypeMouseMoved ? QEvent::MouseMove : QEvent::MouseButtonPress;
-+                            const auto button = e.type == NSMouseMoved ? Qt::NoButton : cocoaButton2QtButton([e buttonNumber]);
-+                            const auto eventType = e.type == NSMouseMoved ? QEvent::MouseMove : QEvent::MouseButtonPress;
-                             QWindowSystemInterface::handleMouseEvent(window(), window()->mapFromGlobal(localPoint.toPoint()), localPoint,
-                                                                      Qt::MouseButtons(uint(NSEvent.pressedMouseButtons & 0xFFFF)), button, eventType);
-                         }];
diff --git a/pkgs/development/libraries/qt-5/5.12/qtbase-darwin.patch b/pkgs/development/libraries/qt-5/5.12/qtbase-darwin.patch
deleted file mode 100644
index 7ce27a99758..00000000000
--- a/pkgs/development/libraries/qt-5/5.12/qtbase-darwin.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
-index c3dd49ff3e..6871399817 100644
---- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
-+++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm
-@@ -283,7 +283,7 @@ void QScanThread::getUserConfigurations()
-     QMacAutoReleasePool pool;
-     userProfiles.clear();
- 
--    NSArray<NSString *> *wifiInterfaces = [CWWiFiClient interfaceNames];
-+    NSArray *wifiInterfaces = [CWWiFiClient interfaceNames];
-     for (NSString *ifName in wifiInterfaces) {
- 
-         CWInterface *wifiInterface = [[CWWiFiClient sharedWiFiClient] interfaceWithName:ifName];
-@@ -598,7 +598,7 @@ void QCoreWlanEngine::doRequestUpdate()
- 
-     QMacAutoReleasePool pool;
- 
--    NSArray<NSString *> *wifiInterfaces = [CWWiFiClient interfaceNames];
-+    NSArray *wifiInterfaces = [CWWiFiClient interfaceNames];
-     for (NSString *ifName in wifiInterfaces) {
-             scanThread->interfaceName = QString::fromNSString(ifName);
-             scanThread->start();
-diff --git a/src/plugins/platforms/cocoa/qcocoascreen.mm b/src/plugins/platforms/cocoa/qcocoascreen.mm
-index afe14e623c..74d69c2fa1 100644
---- a/src/plugins/platforms/cocoa/qcocoascreen.mm
-+++ b/src/plugins/platforms/cocoa/qcocoascreen.mm
-@@ -127,7 +127,7 @@ void QCocoaScreen::updateProperties()
-     const qreal previousRefreshRate = m_refreshRate;
- 
-     // The reference screen for the geometry is always the primary screen
--    QRectF primaryScreenGeometry = QRectF::fromCGRect([[NSScreen screens] firstObject].frame);
-+    QRectF primaryScreenGeometry = QRectF::fromCGRect([[[NSScreen screens] firstObject] frame]);
-     m_geometry = qt_mac_flip(QRectF::fromCGRect(nsScreen.frame), primaryScreenGeometry).toRect();
-     m_availableGeometry = qt_mac_flip(QRectF::fromCGRect(nsScreen.visibleFrame), primaryScreenGeometry).toRect();
- 
-diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
-index df1ad82592..0318a4ff96 100644
---- a/src/plugins/platforms/cocoa/qcocoawindow.mm
-+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
-@@ -1704,7 +1704,7 @@ void QCocoaWindow::applyContentBorderThickness(NSWindow *window)
- 
-     if (!m_drawContentBorderGradient) {
-         window.styleMask = window.styleMask & ~NSWindowStyleMaskTexturedBackground;
--        [window.contentView.superview setNeedsDisplay:YES];
-+        [[window.contentView superview] setNeedsDisplay:YES];
-         window.titlebarAppearsTransparent = NO;
-         return;
-     }
-diff --git a/src/plugins/platforms/cocoa/qnswindow.mm b/src/plugins/platforms/cocoa/qnswindow.mm
-index c17ad47aba..a0f1dd38fb 100644
---- a/src/plugins/platforms/cocoa/qnswindow.mm
-+++ b/src/plugins/platforms/cocoa/qnswindow.mm
-@@ -230,7 +230,7 @@ static bool isMouseEvent(NSEvent *ev)
-     if (pw->frameStrutEventsEnabled() && isMouseEvent(theEvent)) {
-         NSPoint loc = [theEvent locationInWindow];
-         NSRect windowFrame = [self convertRectFromScreen:self.frame];
--        NSRect contentFrame = self.contentView.frame;
-+        NSRect contentFrame = [self.contentView frame];
-         if (NSMouseInRect(loc, windowFrame, NO) && !NSMouseInRect(loc, contentFrame, NO))
-             [qnsview_cast(pw->view()) handleFrameStrutMouseEvent:theEvent];
-     }
-@@ -257,7 +257,7 @@ static bool isMouseEvent(NSEvent *ev)
- + (void)applicationActivationChanged:(NSNotification*)notification
- {
-     const id sender = self;
--    NSEnumerator<NSWindow*> *windowEnumerator = nullptr;
-+    NSEnumerator *windowEnumerator = nullptr;
-     NSApplication *application = [NSApplication sharedApplication];
- 
-     // Unfortunately there's no NSWindowListOrderedBackToFront,
diff --git a/pkgs/development/libraries/qt-5/5.12/qtbase-revert-no-macos10.10.patch b/pkgs/development/libraries/qt-5/5.12/qtbase-revert-no-macos10.10.patch
deleted file mode 100644
index 29776518379..00000000000
--- a/pkgs/development/libraries/qt-5/5.12/qtbase-revert-no-macos10.10.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-Revert "Remove code paths for macOS < 10.11"
-
-This reverts commit 138a65e0cfa80b13fd018a01e7d8b33341a3cfd3.
-
-From 138a65e0cfa80b13fd018a01e7d8b33341a3cfd3 Mon Sep 17 00:00:00 2001
-From: Jake Petroules <jake.petroules@qt.io>
-Date: Thu, 8 Feb 2018 11:05:42 -0800
-Subject: [PATCH] Remove code paths for macOS < 10.11
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Change-Id: I5ae02d88aa3dcd97d1f2ebf6255a68643e5d6daa
-Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
-Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
----
- .../fontdatabases/mac/qfontengine_coretext.mm            | 16 +++-------------
- src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm    |  6 +-----
- src/plugins/platforms/cocoa/qnswindowdelegate.mm         | 16 ----------------
- 3 files changed, 4 insertions(+), 34 deletions(-)
-
-diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
-index 98b753eff9..489d9cd031 100644
---- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
-+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
-@@ -47,18 +47,28 @@
- 
- #include <cmath>
- 
--#if defined(Q_OS_MACOS)
-+#if defined(Q_OS_OSX) && !QT_OSX_DEPLOYMENT_TARGET_BELOW(__MAC_10_11)
- #import <AppKit/AppKit.h>
- #endif
- 
--#if defined(QT_PLATFORM_UIKIT)
-+#if defined(QT_PLATFORM_UIKIT) && !QT_IOS_DEPLOYMENT_TARGET_BELOW(__IPHONE_8_2)
- #import <UIKit/UIKit.h>
- #endif
- 
- // These are available cross platform, exported as kCTFontWeightXXX from CoreText.framework,
- // but they are not documented and are not in public headers so are private API and exposed
- // only through the NSFontWeightXXX and UIFontWeightXXX aliases in AppKit and UIKit (rdar://26109857)
--#if defined(Q_OS_MACOS)
-+#if QT_MAC_DEPLOYMENT_TARGET_BELOW(__MAC_10_11, __IPHONE_8_2)
-+#define kCTFontWeightUltraLight -0.8
-+#define kCTFontWeightThin -0.6
-+#define kCTFontWeightLight -0.4
-+#define kCTFontWeightRegular 0
-+#define kCTFontWeightMedium 0.23
-+#define kCTFontWeightSemibold 0.3
-+#define kCTFontWeightBold 0.4
-+#define kCTFontWeightHeavy 0.56
-+#define kCTFontWeightBlack 0.62
-+#elif defined(Q_OS_OSX)
- #define kCTFontWeightUltraLight NSFontWeightUltraLight
- #define kCTFontWeightThin NSFontWeightThin
- #define kCTFontWeightLight NSFontWeightLight
-diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
-index 94f2125bad..272cd9f3dc 100644
---- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
-+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
-@@ -162,7 +162,11 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSOpenSavePanelDelegate);
-     // resetting our mCurrentDir, set the delegate
-     // here to make sure it gets the correct value.
-     [mSavePanel setDelegate:self];
--    mOpenPanel.accessoryViewDisclosed = YES;
-+
-+#if QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_11)
-+    if (__builtin_available(macOS 10.11, *))
-+        mOpenPanel.accessoryViewDisclosed = YES;
-+#endif
- 
-     if (mOptions->isLabelExplicitlySet(QFileDialogOptions::Accept))
-         [mSavePanel setPrompt:[self strip:options->labelText(QFileDialogOptions::Accept)]];
-diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
-index 057a4c2943..eb55e50622 100644
---- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm
-+++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
-@@ -103,6 +103,22 @@ static QRegExp whitespaceRegex = QRegExp(QStringLiteral("\\s*"));
-     return QCocoaScreen::mapToNative(maximizedFrame);
- }
- 
-+#if QT_MACOS_DEPLOYMENT_TARGET_BELOW(__MAC_10_11)
-+/*
-+    AppKit on OS X 10.10 wrongly calls windowWillUseStandardFrame:defaultFrame
-+    from -[NSWindow _frameForFullScreenMode] when going into fullscreen, resulting
-+    in black bars on top and bottom of the window. By implementing the following
-+    method, AppKit will choose that instead, and resolve the right fullscreen
-+    geometry.
-+*/
-+- (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize
-+{
-+    Q_UNUSED(proposedSize);
-+    Q_ASSERT(window == m_cocoaWindow->nativeWindow());
-+    return NSSizeFromCGSize(m_cocoaWindow->screen()->geometry().size().toCGSize());
-+}
-+#endif
-+
- - (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu
- {
-     Q_UNUSED(window);
diff --git a/pkgs/development/libraries/qt-5/5.9/default.nix b/pkgs/development/libraries/qt-5/5.9/default.nix
index be84691e6c3..d1e9af29926 100644
--- a/pkgs/development/libraries/qt-5/5.9/default.nix
+++ b/pkgs/development/libraries/qt-5/5.9/default.nix
@@ -38,7 +38,7 @@ let
   srcs = import ./srcs.nix { inherit fetchurl; inherit mirror; };
 
   patches = {
-    qtbase = [ ./qtbase.patch ./qtbase-fixguicmake.patch ] ++ optional stdenv.isDarwin ./qtbase-darwin.patch;
+    qtbase = [ ./qtbase.patch ./qtbase-fixguicmake.patch ];
     qtdeclarative = [ ./qtdeclarative.patch ];
     qtscript = [ ./qtscript.patch ];
     qtserialport = [ ./qtserialport.patch ];
diff --git a/pkgs/development/libraries/qt-5/5.9/qtbase-darwin.patch b/pkgs/development/libraries/qt-5/5.9/qtbase-darwin.patch
deleted file mode 100644
index 875fba12e2f..00000000000
--- a/pkgs/development/libraries/qt-5/5.9/qtbase-darwin.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
-index 341d3bc..3368234 100644
---- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
-+++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm
-@@ -287,7 +287,7 @@ void QScanThread::getUserConfigurations()
-     QMacAutoReleasePool pool;
-     userProfiles.clear();
- 
--    NSArray<NSString *> *wifiInterfaces = [CWWiFiClient interfaceNames];
-+    NSArray *wifiInterfaces = [CWWiFiClient interfaceNames];
-     for (NSString *ifName in wifiInterfaces) {
- 
-         CWInterface *wifiInterface = [[CWWiFiClient sharedWiFiClient] interfaceWithName:ifName];
-@@ -602,7 +602,7 @@ void QCoreWlanEngine::doRequestUpdate()
- 
-     QMacAutoReleasePool pool;
- 
--    NSArray<NSString *> *wifiInterfaces = [CWWiFiClient interfaceNames];
-+    NSArray *wifiInterfaces = [CWWiFiClient interfaceNames];
-     for (NSString *ifName in wifiInterfaces) {
-             scanThread->interfaceName = QString::fromNSString(ifName);
-             scanThread->start();
-diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
-index 5cd4beb..84919e6 100644
---- a/src/plugins/platforms/cocoa/qcocoawindow.mm
-+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
-@@ -320,7 +320,7 @@ static void qt_closePopups()
- + (void)applicationActivationChanged:(NSNotification*)notification
- {
-     const id sender = self;
--    NSEnumerator<NSWindow*> *windowEnumerator = nullptr;
-+    NSEnumerator *windowEnumerator = nullptr;
-     NSApplication *application = [NSApplication sharedApplication];
- 
- #if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12)
diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix
index 71d27c33a92..bd92d9bc27c 100644
--- a/pkgs/development/libraries/qt-5/modules/qtbase.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix
@@ -2,7 +2,7 @@
   stdenv, lib,
   src, patches, version, qtCompatVersion,
 
-  coreutils, bison, flex, gdb, gperf, lndir, patchelf, perl, pkgconfig, python2,
+  coreutils, bison, flex, gdb, gperf, lndir, perl, pkgconfig, python2,
   which,
   # darwin support
   darwin, libiconv,
@@ -78,17 +78,15 @@ stdenv.mkDerivation {
       [ libinput ]
       ++ lib.optional withGtk3 gtk3
     )
-    ++ lib.optional stdenv.isDarwin
-      # Needed for OBJC_CLASS_$_NSDate symbols.
-      [ darwin.cf-private ]
+       # Needed for OBJC_CLASS_$_NSDate symbols.
+    ++ lib.optional stdenv.isDarwin darwin.cf-private
     ++ lib.optional developerBuild gdb
     ++ lib.optional (cups != null) cups
     ++ lib.optional (mysql != null) mysql.connector-c
     ++ lib.optional (postgresql != null) postgresql;
 
   nativeBuildInputs =
-    [ bison flex gperf lndir perl pkgconfig python2 which ]
-    ++ lib.optional (!stdenv.isDarwin) patchelf;
+    [ bison flex gperf lndir perl pkgconfig python2 which ];
 
   propagatedNativeBuildInputs = [ lndir ];
 
@@ -199,26 +197,11 @@ stdenv.mkDerivation {
       ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"''
     ]
 
-    ++ (
-      if stdenv.isDarwin
-      then
-        [
-          "-Wno-missing-sysroot"
-          "-D__MAC_OS_X_VERSION_MAX_ALLOWED=1090"
-          "-D__AVAILABILITY_INTERNAL__MAC_10_10=__attribute__((availability(macosx,introduced=10.10)))"
-          # Note that nixpkgs's objc4 is from macOS 10.11 while the SDK is
-          # 10.9 which necessitates the above macro definition that mentions
-          # 10.10
-        ]
-      else
-        lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"''
-        ++ lib.optionals withGtk3
-          [
-            ''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"''
-            ''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"''
-          ]
-    )
-
+    ++ lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"''
+    ++ lib.optionals withGtk3 [
+         ''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"''
+         ''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"''
+       ]
     ++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC";
 
   prefixKey = "-prefix ";
@@ -395,6 +378,7 @@ stdenv.mkDerivation {
     license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ];
     maintainers = with maintainers; [ qknight ttuegel periklis bkchr ];
     platforms = platforms.unix;
+    broken = stdenv.isDarwin && (compareVersion "5.9.0" < 0);
   };
 
 }
diff --git a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
index af580401887..86897cb3f16 100644
--- a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
@@ -79,7 +79,7 @@ qtModule {
     cat <<EOF > src/3rdparty/chromium/build/mac/find_sdk.py
 #!/usr/bin/env python
 print("${darwin.apple_sdk.sdk}")
-print("10.10.0")
+print("10.12.0")
 EOF
 
     cat <<EOF > src/3rdparty/chromium/build/config/mac/sdk_info.py
diff --git a/pkgs/development/libraries/science/math/fenics/default.nix b/pkgs/development/libraries/science/math/fenics/default.nix
index 6c939d9a3a4..8134cc63eb0 100644
--- a/pkgs/development/libraries/science/math/fenics/default.nix
+++ b/pkgs/development/libraries/science/math/fenics/default.nix
@@ -35,10 +35,15 @@ let
       url = "https://bitbucket.org/fenics-project/dijitso/downloads/dijitso-${version}.tar.gz";
       sha256 = "0mw6mynjmg6yl3l2k33yra2x84s4r6mh44ylhk9znjfk74jra8zg";
     };
-    buildInputs = [ numpy pytest six ];
-    checkPhase = ''
+    buildInputs = [ numpy six ];
+    nativeBuildInputs = [ pytest ];
+    preCheck = ''
       export HOME=$PWD
+    '';
+    checkPhase = ''
+      runHook preCheck
       py.test test/
+      runHook postCheck
     '';
     meta = {
       description = "Distributed just-in-time shared library building";
diff --git a/pkgs/development/libraries/science/math/openblas/default.nix b/pkgs/development/libraries/science/math/openblas/default.nix
index 5d0f6794d17..489883e644c 100644
--- a/pkgs/development/libraries/science/math/openblas/default.nix
+++ b/pkgs/development/libraries/science/math/openblas/default.nix
@@ -58,6 +58,7 @@ let
       BINARY = 64;
       TARGET = setTarget "ATHLON";
       DYNAMIC_ARCH = true;
+      NO_AVX512 = true;
       USE_OPENMP = true;
     };
   };
diff --git a/pkgs/development/libraries/sqlite/analyzer.nix b/pkgs/development/libraries/sqlite/analyzer.nix
index 5c42f729469..f0390486b10 100644
--- a/pkgs/development/libraries/sqlite/analyzer.nix
+++ b/pkgs/development/libraries/sqlite/analyzer.nix
@@ -6,11 +6,11 @@ in
 
 stdenv.mkDerivation rec {
   name = "sqlite-analyzer-${version}";
-  version = "3.27.2";
+  version = "3.28.0";
 
   src = assert version == sqlite.version; fetchurl {
     url = "https://sqlite.org/2019/sqlite-src-${archiveVersion version}.zip";
-    sha256 = "02nz1y22wyb8101d9y6wfdrvp855wvch67js12p5y3riya345g8m";
+    sha256 = "15v57b113bpgcshfsx5jw93szar3da94rr03i053xhl15la7jllh";
   };
 
   nativeBuildInputs = [ unzip ];
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   meta = with stdenv.lib; {
     description = "A tool that shows statistics about SQLite databases";
     downloadPage = http://sqlite.org/download.html;
-    homepage = http://www.sqlite.org;
+    homepage = https://www.sqlite.org;
     license = licenses.publicDomain;
     maintainers = with maintainers; [ pesterhazy ];
     platforms = platforms.unix;
diff --git a/pkgs/development/libraries/sqlite/default.nix b/pkgs/development/libraries/sqlite/default.nix
index bacba396c25..ea1c38ea476 100644
--- a/pkgs/development/libraries/sqlite/default.nix
+++ b/pkgs/development/libraries/sqlite/default.nix
@@ -10,12 +10,12 @@ in
 
 stdenv.mkDerivation rec {
   name = "sqlite-${version}";
-  version = "3.27.2";
+  version = "3.28.0";
 
   # NB! Make sure to update analyzer.nix src (in the same directory).
   src = fetchurl {
     url = "https://sqlite.org/2019/sqlite-autoconf-${archiveVersion version}.tar.gz";
-    sha256 = "0vpgwszs19pwks2b4dhqwa0n6q5sx6pn1s7rngyyrd98xa2rxhsh";
+    sha256 = "1hxpi45crbqp6lacl7z611lna02k956m9bsy2bjzrbb2y23546yn";
   };
 
   outputs = [ "bin" "dev" "out" ];
@@ -75,8 +75,8 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "A self-contained, serverless, zero-configuration, transactional SQL database engine";
-    downloadPage = http://sqlite.org/download.html;
-    homepage = http://www.sqlite.org/;
+    downloadPage = https://sqlite.org/download.html;
+    homepage = https://www.sqlite.org/;
     license = licenses.publicDomain;
     maintainers = with maintainers; [ eelco np ];
     platforms = platforms.unix ++ platforms.windows;
diff --git a/pkgs/development/libraries/tk/8.6.nix b/pkgs/development/libraries/tk/8.6.nix
index cd8d42faa91..5013db64bba 100644
--- a/pkgs/development/libraries/tk/8.6.nix
+++ b/pkgs/development/libraries/tk/8.6.nix
@@ -3,8 +3,8 @@
 callPackage ./generic.nix (args // rec {
 
   src = fetchurl {
-    url = "mirror://sourceforge/tcl/tk${tcl.version}-src.tar.gz";
-    sha256 = "17diivcfcwdhp4v5zi6j9nkxncccjqkivhp363c4wx5lf4d3fb6n";
+    url = "mirror://sourceforge/tcl/tk${tcl.version}.1-src.tar.gz"; # TODO: remove '.1' for v8.6.10 or v8.7.x
+    sha256 = "1d7bfkxpacy33w5nahf73lkwxqpff44w1jplg7i2gmwgiaawvjwg";
   };
 
   patches = [ ./different-prefix-with-tcl.patch ] ++ stdenv.lib.optionals stdenv.isDarwin [ ./Fix-bad-install_name-for-libtk8.6.dylib.patch ];
diff --git a/pkgs/development/libraries/tk/generic.nix b/pkgs/development/libraries/tk/generic.nix
index d5eaff77c11..10b8bc7cd71 100644
--- a/pkgs/development/libraries/tk/generic.nix
+++ b/pkgs/development/libraries/tk/generic.nix
@@ -19,16 +19,19 @@ stdenv.mkDerivation {
   postInstall = ''
     ln -s $out/bin/wish* $out/bin/wish
     cp ../{unix,generic}/*.h $out/include
+    ln -s $out/lib/libtk${tcl.release}.so $out/lib/libtk.so
   '';
 
   configureFlags = [
+    "--enable-threads"
     "--with-tcl=${tcl}/lib"
-  ] ++ stdenv.lib.optional enableAqua "--enable-aqua";
+  ] ++ stdenv.lib.optional stdenv.is64bit "--enable-64bit"
+    ++ stdenv.lib.optional enableAqua "--enable-aqua";
 
   nativeBuildInputs = [ pkgconfig ];
 
-  propagatedBuildInputs = [ tcl libXft ];
-  buildInputs = lib.optional enableAqua (with darwin; with apple_sdk.frameworks; [
+  propagatedBuildInputs = [ tcl libXft ]
+    ++ lib.optional enableAqua (with darwin; with apple_sdk.frameworks; [
       Cocoa cf-private
     ]);
 
@@ -44,7 +47,7 @@ stdenv.mkDerivation {
 
   meta = with stdenv.lib; {
     description = "A widget toolkit that provides a library of basic elements for building a GUI in many different programming languages";
-    homepage = http://www.tcl.tk/;
+    homepage = https://www.tcl.tk/;
     license = licenses.tcltk;
     platforms = platforms.all;
     maintainers = with maintainers; [ lovek323 vrthra ];
diff --git a/pkgs/development/libraries/wxwidgets/2.9/default.nix b/pkgs/development/libraries/wxwidgets/2.9/default.nix
index 1938b15efbb..18e0cebec85 100644
--- a/pkgs/development/libraries/wxwidgets/2.9/default.nix
+++ b/pkgs/development/libraries/wxwidgets/2.9/default.nix
@@ -74,12 +74,13 @@ stdenv.mkDerivation {
   };
 
   enableParallelBuilding = true;
-  
+
   meta = {
     platforms = with platforms; darwin ++ linux;
     license = licenses.wxWindows;
     homepage = https://www.wxwidgets.org/;
     description = "a C++ library that lets developers create applications for Windows, macOS, Linux and other platforms with a single code base";
     longDescription = "wxWidgets gives you a single, easy-to-use API for writing GUI applications on multiple platforms that still utilize the native platform's controls and utilities. Link with the appropriate library for your platform and compiler, and your application will adopt the look and feel appropriate to that platform. On top of great GUI functionality, wxWidgets gives you: online help, network programming, streams, clipboard and drag and drop, multithreading, image loading and saving in a variety of popular formats, database support, HTML viewing and printing, and much more.";
+    badPlatforms = [ "x86_64-darwin" ];
   };
 }
diff --git a/pkgs/development/libraries/wxwidgets/3.0/default.nix b/pkgs/development/libraries/wxwidgets/3.0/default.nix
index 948b261fe45..a89f132b832 100644
--- a/pkgs/development/libraries/wxwidgets/3.0/default.nix
+++ b/pkgs/development/libraries/wxwidgets/3.0/default.nix
@@ -89,5 +89,6 @@ stdenv.mkDerivation rec {
     homepage = https://www.wxwidgets.org/;
     description = "a C++ library that lets developers create applications for Windows, macOS, Linux and other platforms with a single code base";
     longDescription = "wxWidgets gives you a single, easy-to-use API for writing GUI applications on multiple platforms that still utilize the native platform's controls and utilities. Link with the appropriate library for your platform and compiler, and your application will adopt the look and feel appropriate to that platform. On top of great GUI functionality, wxWidgets gives you: online help, network programming, streams, clipboard and drag and drop, multithreading, image loading and saving in a variety of popular formats, database support, HTML viewing and printing, and much more.";
+    badPlatforms = [ "x86_64-darwin" ];
   };
 }
diff --git a/pkgs/development/libraries/wxwidgets/3.0/mac.nix b/pkgs/development/libraries/wxwidgets/3.0/mac.nix
index 040273e28b9..6e559cfb6a9 100644
--- a/pkgs/development/libraries/wxwidgets/3.0/mac.nix
+++ b/pkgs/development/libraries/wxwidgets/3.0/mac.nix
@@ -71,5 +71,6 @@ stdenv.mkDerivation rec {
     homepage = https://www.wxwidgets.org/;
     description = "a C++ library that lets developers create applications for Windows, macOS, Linux and other platforms with a single code base";
     longDescription = "wxWidgets gives you a single, easy-to-use API for writing GUI applications on multiple platforms that still utilize the native platform's controls and utilities. Link with the appropriate library for your platform and compiler, and your application will adopt the look and feel appropriate to that platform. On top of great GUI functionality, wxWidgets gives you: online help, network programming, streams, clipboard and drag and drop, multithreading, image loading and saving in a variety of popular formats, database support, HTML viewing and printing, and much more.";
+    broken = true;
   };
 }
diff --git a/pkgs/development/python-modules/Wand/default.nix b/pkgs/development/python-modules/Wand/default.nix
index 1db067838fb..0b61f671f83 100644
--- a/pkgs/development/python-modules/Wand/default.nix
+++ b/pkgs/development/python-modules/Wand/default.nix
@@ -6,11 +6,11 @@
 
 buildPythonPackage rec {
   pname = "Wand";
-  version = "0.5.2";
+  version = "0.5.3";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0nvdq15gmkzhwpwkln8wmkq0h4izznnr6zmrnwqza8lsa1c0jz5f";
+    sha256 = "a2c318993791fab4fcfd460045415176f81d42f8c6fd8a88fb8d74d2f0f34b97";
   };
 
   postPatch = ''
diff --git a/pkgs/development/python-modules/ansible-runner/default.nix b/pkgs/development/python-modules/ansible-runner/default.nix
index b3bb4733423..5326300a146 100644
--- a/pkgs/development/python-modules/ansible-runner/default.nix
+++ b/pkgs/development/python-modules/ansible-runner/default.nix
@@ -13,11 +13,11 @@
 
 buildPythonPackage rec {
   pname = "ansible-runner";
-  version = "1.3.2";
+  version = "1.3.3";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "6e4d8256351228c00fe68697e7f5ad2a2e0fd4085084b913eda22735023bb891";
+    sha256 = "2a2b83e63b830de3ff01c2992342cfe09f96e410953c85904ee7e301b21fa513";
   };
 
   checkInputs = [ pytest mock ];
diff --git a/pkgs/development/python-modules/asyncssh/default.nix b/pkgs/development/python-modules/asyncssh/default.nix
index bea0857f0cf..5320d5be108 100644
--- a/pkgs/development/python-modules/asyncssh/default.nix
+++ b/pkgs/development/python-modules/asyncssh/default.nix
@@ -1,18 +1,35 @@
-{ stdenv, buildPythonPackage, fetchPypi, pythonOlder
+{ stdenv, buildPythonPackage, fetchPypi, pythonOlder, fetchpatch
 , cryptography
 , bcrypt, gssapi, libnacl, libsodium, nettle, pyopenssl
-, openssl }:
+, openssl, openssh }:
 
 buildPythonPackage rec {
   pname = "asyncssh";
-  version = "1.15.1";
+  version = "1.16.1";
   disabled = pythonOlder "3.4";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "f2065a8b3af0c514c8de264e7b01f08df5213b707bacb7e7c080bd46c3e3bc35";
+    sha256 = "0qia1ay2dhwps5sfh0hif7mrv7yxvykxs9l7cmfp4m6hmqnn3r5r";
   };
 
+  patches = [
+    # Reverts https://github.com/ronf/asyncssh/commit/4b3dec994b3aa821dba4db507030b569c3a32730
+    #
+    # This changed the test to avoid setting the sticky bit
+    # because that's not allowed for plain files in FreeBSD.
+    # However that broke the test on NixOS, failing with
+    # "Operation not permitted"
+    ./fix-sftp-chmod-test-nixos.patch
+
+    # Restore libnacl support for curve25519/ed25519 as a fallback for PyCA
+    # Fixes https://github.com/ronf/asyncssh/issues/206 with older openssl
+    (fetchpatch {
+      url = "https://github.com/ronf/asyncssh/commit/1dee113bb3e4a6888de562b0413e9abd6a0f0f04.patch";
+      sha256 = "04bckdj7i6xk24lizkn3a8cj375pkz7yc57fc0vk222c6jzwzaml";
+    })
+  ];
+
   propagatedBuildInputs = [
     bcrypt
     cryptography
@@ -23,17 +40,20 @@ buildPythonPackage rec {
     pyopenssl
   ];
 
-  checkInputs = [ openssl ];
+  checkInputs = [
+    openssh
+    openssl
+  ];
 
   # Disables windows specific test (specifically the GSSAPI wrapper for Windows)
   postPatch = ''
-    rm ./tests/sspi_stub.py
+    rm tests/sspi_stub.py
   '';
 
   meta = with stdenv.lib; {
     description = "Provides an asynchronous client and server implementation of the SSHv2 protocol on top of the Python asyncio framework";
-    homepage    = https://pypi.python.org/pypi/asyncssh;
-    license     = licenses.epl20;
+    homepage = https://asyncssh.readthedocs.io/en/latest;
+    license = licenses.epl20;
     maintainers = with maintainers; [ worldofpeace ];
   };
 }
diff --git a/pkgs/development/python-modules/asyncssh/fix-sftp-chmod-test-nixos.patch b/pkgs/development/python-modules/asyncssh/fix-sftp-chmod-test-nixos.patch
new file mode 100644
index 00000000000..845139a4fec
--- /dev/null
+++ b/pkgs/development/python-modules/asyncssh/fix-sftp-chmod-test-nixos.patch
@@ -0,0 +1,15 @@
+diff --git a/tests/test_sftp.py b/tests/test_sftp.py
+index db9cc88..234004b 100644
+--- a/tests/test_sftp.py
++++ b/tests/test_sftp.py
+@@ -957,8 +957,8 @@ class _TestSFTP(_CheckSFTP):
+ 
+         try:
+             self._create_file('file')
+-            yield from sftp.chmod('file', 0o4321)
+-            self.assertEqual(stat.S_IMODE(os.stat('file').st_mode), 0o4321)
++            yield from sftp.chmod('file', 0o1234)
++            self.assertEqual(stat.S_IMODE(os.stat('file').st_mode), 0o1234)
+         finally:
+             remove('file')
+ 
diff --git a/pkgs/development/python-modules/atomman/default.nix b/pkgs/development/python-modules/atomman/default.nix
index 07757d5304b..a2f6cd721b7 100644
--- a/pkgs/development/python-modules/atomman/default.nix
+++ b/pkgs/development/python-modules/atomman/default.nix
@@ -13,12 +13,12 @@
 }:
 
 buildPythonPackage rec {
-  version = "1.2.5";
+  version = "1.2.6";
   pname = "atomman";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "10eca8c6fc890f2ee2e30f65178c618175529e9998be449e276f7c3d1dce0e95";
+    sha256 = "19501bfdf7e66090764a0ccbecf85a128b46333ea232c2137fa4345512b8b502";
   };
 
   checkInputs = [ pytest ];
diff --git a/pkgs/development/python-modules/aws-sam-translator/default.nix b/pkgs/development/python-modules/aws-sam-translator/default.nix
index c6c84882fcd..224e39736a8 100644
--- a/pkgs/development/python-modules/aws-sam-translator/default.nix
+++ b/pkgs/development/python-modules/aws-sam-translator/default.nix
@@ -20,8 +20,6 @@ buildPythonPackage rec {
   # Tests are not included in the PyPI package
   doCheck = false;
 
-  disabled = isPy3k;
-
   propagatedBuildInputs = [
     boto3
     enum34
diff --git a/pkgs/development/python-modules/azure-common/default.nix b/pkgs/development/python-modules/azure-common/default.nix
index d6d1ba832d6..f0d5f883392 100644
--- a/pkgs/development/python-modules/azure-common/default.nix
+++ b/pkgs/development/python-modules/azure-common/default.nix
@@ -7,14 +7,14 @@
 }:
 
 buildPythonPackage rec {
-  version = "1.1.18";
+  version = "1.1.19";
   pname = "azure-common";
   disabled = isPyPy;
 
   src = fetchPypi {
     inherit pname version;
     extension = "zip";
-    sha256 = "5fd62ae10b1add97d3c69af970328ec3bd869184396bcf6bfa9c7bc94d688424";
+    sha256 = "622d9360a1b61172b4c0d1cc58f939c68402aa19ca44872ab3d224d913aa6d0c";
   };
 
   propagatedBuildInputs = [ azure-nspkg ];
diff --git a/pkgs/development/python-modules/cffi/default.nix b/pkgs/development/python-modules/cffi/default.nix
index 22d25fa9cff..cfabeb16b59 100644
--- a/pkgs/development/python-modules/cffi/default.nix
+++ b/pkgs/development/python-modules/cffi/default.nix
@@ -2,11 +2,11 @@
 
 if isPyPy then null else buildPythonPackage rec {
   pname = "cffi";
-  version = "1.12.2";
+  version = "1.12.3";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "e113878a446c6228669144ae8a56e268c91b7f1fafae927adc4879d9849e0ea7";
+    sha256 = "041c81822e9f84b1d9c401182e174996f0bae9991f33725d059b771744290774";
   };
 
   outputs = [ "out" "dev" ];
@@ -31,7 +31,7 @@ if isPyPy then null else buildPythonPackage rec {
   # The tests use -Werror but with python3.6 clang detects some unreachable code.
   NIX_CFLAGS_COMPILE = stdenv.lib.optionals stdenv.cc.isClang [ "-Wno-unused-command-line-argument" "-Wno-unreachable-code" ];
 
-  doCheck = !stdenv.hostPlatform.isMusl; # TODO: Investigate
+  doCheck = !stdenv.hostPlatform.isMusl && !stdenv.isDarwin; # TODO: Investigate
   checkPhase = ''
     py.test -k "not test_char_pointer_conversion"
   '';
diff --git a/pkgs/development/python-modules/cfn-lint/default.nix b/pkgs/development/python-modules/cfn-lint/default.nix
new file mode 100644
index 00000000000..d6205b27687
--- /dev/null
+++ b/pkgs/development/python-modules/cfn-lint/default.nix
@@ -0,0 +1,40 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pyyaml
+, six
+, requests
+, aws-sam-translator
+, jsonpatch
+, jsonschema
+, pathlib2
+}:
+
+buildPythonPackage rec {
+  pname = "cfn-lint";
+  version = "0.19.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "5a723ff791fc23aced78e9cde28f18f9eeae9a24f91db2b7a20f7aa837a613b3";
+  };
+
+  propagatedBuildInputs = [
+    pyyaml
+    six
+    requests
+    aws-sam-translator
+    jsonpatch
+    jsonschema
+    pathlib2
+  ];
+
+  # No tests included in archive
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Checks cloudformation for practices and behaviour that could potentially be improved";
+    homepage = https://github.com/aws-cloudformation/cfn-python-lint;
+    license = licenses.mit;
+  };
+}
diff --git a/pkgs/development/python-modules/cryptography/default.nix b/pkgs/development/python-modules/cryptography/default.nix
index 69c9f729294..f40f0bf63d8 100644
--- a/pkgs/development/python-modules/cryptography/default.nix
+++ b/pkgs/development/python-modules/cryptography/default.nix
@@ -53,14 +53,6 @@ buildPythonPackage rec {
     py.test --disable-pytest-warnings tests
   '';
 
-  # The test assumes that if we're on Sierra or higher, that we use `getentropy`, but for binary
-  # compatibility with pre-Sierra for binary caches, we hide that symbol so the library doesn't
-  # use it. This boils down to them checking compatibility with `getentropy` in two different places,
-  # so let's neuter the second test.
-  postPatch = ''
-    substituteInPlace ./tests/hazmat/backends/test_openssl.py --replace '"16.0"' '"99.0"'
-  '';
-
   # IOKit's dependencies are inconsistent between OSX versions, so this is the best we
   # can do until nix 1.11's release
   __impureHostDeps = [ "/usr/lib" ];
diff --git a/pkgs/development/python-modules/cx_oracle/default.nix b/pkgs/development/python-modules/cx_oracle/default.nix
index 1976b30cc17..ca28f231831 100644
--- a/pkgs/development/python-modules/cx_oracle/default.nix
+++ b/pkgs/development/python-modules/cx_oracle/default.nix
@@ -2,13 +2,13 @@
 
 buildPythonPackage rec {
   pname = "cx_Oracle";
-  version = "7.1.2";
+  version = "7.1.3";
 
   buildInputs = [ odpic ];
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "7d0e30d6ce62bedd41ae4885d43fff727314b67655ec8737b8af5cc0aad7f925";
+    sha256 = "4f26b7418e2796112f8b36338a2f9a7c07dd08df53d857e3478bb53f61dd52e4";
   };
 
   preConfigure = ''
diff --git a/pkgs/development/python-modules/cypari2/default.nix b/pkgs/development/python-modules/cypari2/default.nix
index a4921b85e37..6c3e20b3f70 100644
--- a/pkgs/development/python-modules/cypari2/default.nix
+++ b/pkgs/development/python-modules/cypari2/default.nix
@@ -11,11 +11,11 @@
 buildPythonPackage rec {
   pname = "cypari2";
   # upgrade may break sage, please test the sage build or ping @timokau on upgrade
-  version = "2.1.0";
+  version = "2.1.1";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0bm5jvmwqp48n6b385mw4v7wsws9zk62mgb7xf5ymiq7k6wgvxli";
+    sha256 = "df1ef62e771ec36e5a456f5fc8b51bc6745b70f0efdd0c7a30c3f0b5f1fb93db";
   };
 
   # This differs slightly from the default python installPhase in that it pip-installs
diff --git a/pkgs/development/python-modules/django_silk/default.nix b/pkgs/development/python-modules/django_silk/default.nix
index aa4e9fb778f..e8c44efdc40 100644
--- a/pkgs/development/python-modules/django_silk/default.nix
+++ b/pkgs/development/python-modules/django_silk/default.nix
@@ -16,11 +16,11 @@
 
 buildPythonPackage rec {
   pname = "django-silk";
-  version = "3.0.1";
+  version = "3.0.2";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "bce0e35d2a6ec3688a0c062c6964695beef4a452be48085f2c1e25f685652d9d";
+    sha256 = "8dd5b78531360bd8c3d571384f9f4f82ef03e1764e30dd4621c5638f5c973a1d";
   };
 
   doCheck = false;
diff --git a/pkgs/development/python-modules/ecdsa/default.nix b/pkgs/development/python-modules/ecdsa/default.nix
index 9b12119b9e9..95e1835198e 100644
--- a/pkgs/development/python-modules/ecdsa/default.nix
+++ b/pkgs/development/python-modules/ecdsa/default.nix
@@ -6,11 +6,11 @@
 
 buildPythonPackage rec {
   pname = "ecdsa";
-  version = "0.13";
+  version = "0.13.2";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1yj31j0asmrx4an9xvsaj2icdmzy6pw0glfpqrrkrphwdpi1xkv4";
+    sha256 = "5c034ffa23413ac923541ceb3ac14ec15a0d2530690413bff58c12b80e56d884";
   };
 
   # Only needed for tests
diff --git a/pkgs/development/python-modules/genanki/default.nix b/pkgs/development/python-modules/genanki/default.nix
index af2f99289a3..a39d3e58733 100644
--- a/pkgs/development/python-modules/genanki/default.nix
+++ b/pkgs/development/python-modules/genanki/default.nix
@@ -4,11 +4,11 @@
 
 buildPythonPackage rec {
   pname = "genanki";
-  version = "0.6.3";
+  version = "0.6.4";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "2408f7d9955c8963fd9b1ecbb873f5d18dee786e060dcb083aef5dd86c736773";
+    sha256 = "6d17761e06aca2d9acb588acfdce33fd3d05571338825760622c99fc7210f15a";
   };
 
   propagatedBuildInputs = [
diff --git a/pkgs/development/python-modules/gsd/default.nix b/pkgs/development/python-modules/gsd/default.nix
index 07fca0d2404..38826a9b3f2 100644
--- a/pkgs/development/python-modules/gsd/default.nix
+++ b/pkgs/development/python-modules/gsd/default.nix
@@ -5,12 +5,12 @@
 }:
 
 buildPythonPackage rec {
-  version = "1.6.1";
+  version = "1.6.2";
   pname = "gsd";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "18icw5cbsq4gnhx4vsjwhxzcx11mbnz6kmwgrylkf82m7m1v2921";
+    sha256 = "58a6669f2375936810d74c3ee7e62c5616acf9e15aa32603701e55ab6fada5f5";
   };
 
   propagatedBuildInputs = [ numpy ];
diff --git a/pkgs/development/python-modules/httplib2/default.nix b/pkgs/development/python-modules/httplib2/default.nix
index ab9e65d78cb..c37c4b13562 100644
--- a/pkgs/development/python-modules/httplib2/default.nix
+++ b/pkgs/development/python-modules/httplib2/default.nix
@@ -2,11 +2,11 @@
 
 buildPythonPackage rec {
   pname = "httplib2";
-  version = "0.12.1";
+  version = "0.12.3";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "4ba6b8fd77d0038769bf3c33c9a96a6f752bc4cdf739701fdcaf210121f399d4";
+    sha256 = "a18121c7c72a56689efbf1aef990139ad940fee1e64c6f2458831736cd593600";
   };
 
   # Needs setting up
diff --git a/pkgs/development/python-modules/j2cli/default.nix b/pkgs/development/python-modules/j2cli/default.nix
index 163dbba07f7..2f8ab29d432 100644
--- a/pkgs/development/python-modules/j2cli/default.nix
+++ b/pkgs/development/python-modules/j2cli/default.nix
@@ -9,12 +9,12 @@
 
 buildPythonPackage rec {
   pname = "j2cli";
-  version = "0.3.6.post1";
+  version = "0.3.7";
   disabled = isPy3k;
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1j8s09b75w041b2lawjz341ri997n9fnxbd2ipm9czxj6fhj8hi2";
+    sha256 = "a7b0bdb02a3afb6d2eff40228b2216306332ace4341372310dafd15f938e1afa";
   };
 
   buildInputs = [ nose ];
diff --git a/pkgs/development/python-modules/jdcal/default.nix b/pkgs/development/python-modules/jdcal/default.nix
index 7b235b44639..4fd89c83abc 100644
--- a/pkgs/development/python-modules/jdcal/default.nix
+++ b/pkgs/development/python-modules/jdcal/default.nix
@@ -6,11 +6,11 @@
 
 buildPythonPackage rec {
   pname = "jdcal";
-  version = "1.4";
+  version = "1.4.1";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "ea0a5067c5f0f50ad4c7bdc80abad3d976604f6fb026b0b3a17a9d84bb9046c9";
+    sha256 = "472872e096eb8df219c23f2689fc336668bdb43d194094b5cc1707e1640acfc8";
   };
 
   checkInputs = [ pytest ];
diff --git a/pkgs/development/python-modules/jinja2/default.nix b/pkgs/development/python-modules/jinja2/default.nix
index 52827f0a23c..797c72546c7 100644
--- a/pkgs/development/python-modules/jinja2/default.nix
+++ b/pkgs/development/python-modules/jinja2/default.nix
@@ -17,9 +17,6 @@ buildPythonPackage rec {
     pytest -v tests
   '';
 
-  # RecursionError: maximum recursion depth exceeded
-  doCheck = false;
-
   meta = with stdenv.lib; {
     homepage = http://jinja.pocoo.org/;
     description = "Stand-alone template engine";
diff --git a/pkgs/development/python-modules/junos-eznc/default.nix b/pkgs/development/python-modules/junos-eznc/default.nix
index a365f600140..6970efd0914 100644
--- a/pkgs/development/python-modules/junos-eznc/default.nix
+++ b/pkgs/development/python-modules/junos-eznc/default.nix
@@ -15,11 +15,11 @@
 
 buildPythonPackage rec {
   pname = "junos-eznc";
-  version = "2.2.0";
+  version = "2.2.1";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "d97d8babf650abca25a096825aa6d88573d340481a0b0793afcdac4a7bee09d3";
+    sha256 = "0133a10ba3d46ddf70f0ba6620aa3b92e5533f08c57edd000dbffd8fe60d586d";
   };
 
 
diff --git a/pkgs/development/python-modules/matplotlib/2.nix b/pkgs/development/python-modules/matplotlib/2.nix
index 810f37b4b13..5a45b02a240 100644
--- a/pkgs/development/python-modules/matplotlib/2.nix
+++ b/pkgs/development/python-modules/matplotlib/2.nix
@@ -60,7 +60,7 @@ buildPythonPackage rec {
       url = "https://github.com/matplotlib/matplotlib/commit/2980184d092382a40ab21f95b79582ffae6e19d6.patch";
       sha256 = "1c0wj28zy8s5h6qiavx9zzbhlmhjwpzbc3fyyw9039mbnqk0spg2";
     })
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [ ./darwin-stdenv-2.2.3.patch ];
+  ];
 
   # Matplotlib tries to find Tcl/Tk by opening a Tk window and asking the
   # corresponding interpreter object for its library paths. This fails if
diff --git a/pkgs/development/python-modules/matplotlib/darwin-stdenv-2.2.3.patch b/pkgs/development/python-modules/matplotlib/darwin-stdenv-2.2.3.patch
deleted file mode 100644
index ca399b4e684..00000000000
--- a/pkgs/development/python-modules/matplotlib/darwin-stdenv-2.2.3.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/src/_macosx.m	2015-10-30 00:46:20.000000000 +0200
-+++ b/src/_macosx.m	2015-11-01 14:52:25.000000000 +0200
-@@ -6264,6 +6264,7 @@
- 
- static bool verify_framework(void)
- {
-+    return true;  /* nixpkgs darwin stdenv */
- #ifdef COMPILING_FOR_10_6
-     NSRunningApplication* app = [NSRunningApplication currentApplication];
-     NSApplicationActivationPolicy activationPolicy = [app activationPolicy];
diff --git a/pkgs/development/python-modules/matplotlib/darwin-stdenv.patch b/pkgs/development/python-modules/matplotlib/darwin-stdenv.patch
deleted file mode 100644
index 27ed8fc9f96..00000000000
--- a/pkgs/development/python-modules/matplotlib/darwin-stdenv.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ruN matplotlib-3.0.0/src/_macosx.m matplotlib-3.0.0.patched/src/_macosx.m
---- matplotlib-3.0.0/src/_macosx.m	2018-09-16 00:35:21.000000000 +0200
-+++ matplotlib-3.0.0.patched/src/_macosx.m	2018-11-03 13:14:33.000000000 +0100
-@@ -2577,6 +2577,7 @@
- 
- static bool verify_framework(void)
- {
-+    return true;  /* nixpkgs darwin stdenv */
-     ProcessSerialNumber psn;
-     /* These methods are deprecated, but they don't require the app to
-        have started  */
-
diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix
index d3ea365082c..cbdd43af811 100644
--- a/pkgs/development/python-modules/matplotlib/default.nix
+++ b/pkgs/development/python-modules/matplotlib/default.nix
@@ -52,8 +52,7 @@ buildPythonPackage rec {
     ++ stdenv.lib.optionals enableQt [ pyqt4 ];
 
   patches =
-    [ ./basedirlist.patch ] ++
-    stdenv.lib.optionals stdenv.isDarwin [ ./darwin-stdenv.patch ];
+    [ ./basedirlist.patch ];
 
   # Matplotlib tries to find Tcl/Tk by opening a Tk window and asking the
   # corresponding interpreter object for its library paths. This fails if
diff --git a/pkgs/development/python-modules/mecab-python3/default.nix b/pkgs/development/python-modules/mecab-python3/default.nix
index c68fb90952e..4a6f6b0c4dd 100644
--- a/pkgs/development/python-modules/mecab-python3/default.nix
+++ b/pkgs/development/python-modules/mecab-python3/default.nix
@@ -7,11 +7,11 @@
 
 buildPythonPackage rec {
   pname = "mecab-python3";
-  version = "0.996.1";
+  version = "0.996.2";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "5aca4d0d196161e41452b89921042c0e61a6b7e7e9373211c0c1c50d1809055d";
+    sha256 = "a80383fba343dad247b486a9afa486b7f0ec6244cb8bbf2d6a24d2fab5f19180";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/development/python-modules/moto/default.nix b/pkgs/development/python-modules/moto/default.nix
index 024a4a4c896..c8f1a0cbd08 100644
--- a/pkgs/development/python-modules/moto/default.nix
+++ b/pkgs/development/python-modules/moto/default.nix
@@ -1,14 +1,14 @@
-{ buildPythonPackage, fetchPypi, jinja2, werkzeug, flask
+{ buildPythonPackage, fetchPypi, jinja2, werkzeug, flask, cfn-lint
 , requests, pytz, backports_tempfile, cookies, jsondiff, botocore, aws-xray-sdk, docker, responses
 , six, boto, httpretty, xmltodict, nose, sure, boto3, freezegun, dateutil, mock, pyaml, python-jose }:
 
 buildPythonPackage rec {
   pname = "moto";
-  version = "1.3.7";
+  version = "1.3.8";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "129de2e04cb250d9f8b2c722ec152ed1b5426ef179b4ebb03e9ec36e6eb3fcc5";
+    sha256 = "9cb02134148fbe3ed81f11d6ab9bd71bbd6bc2db7e59a45de77fb1d0fedb744e";
   };
 
   postPatch = ''
@@ -24,6 +24,7 @@ buildPythonPackage rec {
     aws-xray-sdk
     boto
     boto3
+    cfn-lint
     dateutil
     flask
     httpretty
diff --git a/pkgs/development/python-modules/nameparser/default.nix b/pkgs/development/python-modules/nameparser/default.nix
index fa62bd327a4..91e6e5f0fd6 100644
--- a/pkgs/development/python-modules/nameparser/default.nix
+++ b/pkgs/development/python-modules/nameparser/default.nix
@@ -6,11 +6,11 @@
 
 buildPythonPackage rec {
   pname = "nameparser";
-  version = "1.0.2";
+  version = "1.0.3";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0w1m8qva2d7xfqrdxsnh1cncr3ank2205i5rz44hawjh2frzmik2";
+    sha256 = "c01ec7d0bc093420a45d8b5ea8261a84ba12bff0cabf47cb15b716c5ea8f3d23";
   };
 
   LC_ALL="en_US.UTF-8";
diff --git a/pkgs/development/python-modules/nilearn/default.nix b/pkgs/development/python-modules/nilearn/default.nix
index 0d2519d4e10..e45a0033c82 100644
--- a/pkgs/development/python-modules/nilearn/default.nix
+++ b/pkgs/development/python-modules/nilearn/default.nix
@@ -3,12 +3,12 @@
 
 buildPythonPackage rec {
   pname = "nilearn";
-  version = "0.5.1";
+  version = "0.5.2";
   name = pname + "-" + version;
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "dca56e8a1f0fc6dcd1c997383187efc31788294ac6bcbbaebac2b9a962a44cbb";
+    sha256 = "18b763d641e6903bdf8512e0ec5cdc14133fb4679e9a15648415e9be62c81b56";
   };
 
   # disable some failing tests
diff --git a/pkgs/development/python-modules/numpy/default.nix b/pkgs/development/python-modules/numpy/default.nix
index e479542c509..171496584ef 100644
--- a/pkgs/development/python-modules/numpy/default.nix
+++ b/pkgs/development/python-modules/numpy/default.nix
@@ -16,18 +16,18 @@ let
   };
 in buildPythonPackage rec {
   pname = "numpy";
-  version = "1.16.2";
+  version = "1.16.3";
 
   src = fetchPypi {
     inherit pname version;
     extension = "zip";
-    sha256 = "1c4inssky16p6ab63n1gass6dik1dzxrp3y7kmxbdq6xg4w2wsbc";
+    sha256 = "78a6f89da87eeb48014ec652a65c4ffde370c036d780a995edaeb121d3625621";
   };
 
   nativeBuildInputs = [ gfortran pytest ];
   buildInputs = [ blas ];
 
-  patches = lib.optionals (python.hasDistutilsCxxPatch or false) [
+  patches = lib.optionals python.hasDistutilsCxxPatch [
     # We patch cpython/distutils to fix https://bugs.python.org/issue1222585
     # Patching of numpy.distutils is needed to prevent it from undoing the
     # patch to distutils.
diff --git a/pkgs/development/python-modules/objgraph/default.nix b/pkgs/development/python-modules/objgraph/default.nix
index 0eb1deee0d3..c0e0cddb2c8 100644
--- a/pkgs/development/python-modules/objgraph/default.nix
+++ b/pkgs/development/python-modules/objgraph/default.nix
@@ -10,11 +10,11 @@
 
 buildPythonPackage rec {
   pname = "objgraph";
-  version = "3.4.0";
+  version = "3.4.1";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "4a0c2c6268e10a9e8176ae054ff3faac9a432087801e1f95c3ebbe52550295a0";
+    sha256 = "bf29512d7f8b457b53fa0722ea59f516abb8abc59b78f97f0ef81394a0c615a7";
   };
 
   # Tests fail with PyPy.
diff --git a/pkgs/development/python-modules/paho-mqtt/default.nix b/pkgs/development/python-modules/paho-mqtt/default.nix
index d58b31ffc04..bf7ebee5657 100644
--- a/pkgs/development/python-modules/paho-mqtt/default.nix
+++ b/pkgs/development/python-modules/paho-mqtt/default.nix
@@ -1,5 +1,5 @@
 { lib, buildPythonPackage, fetchFromGitHub, isPy3k
-, pytestrunner, pytest, mock }:
+, stdenv, pytestrunner, pytest, mock }:
 
 buildPythonPackage rec {
   pname = "paho-mqtt";
@@ -20,6 +20,8 @@ buildPythonPackage rec {
 
   checkInputs = [ pytestrunner pytest ] ++ lib.optional (!isPy3k) mock;
 
+  doCheck = !stdenv.isDarwin;
+
   meta = with lib; {
     homepage = https://eclipse.org/paho;
     description = "MQTT version 3.1.1 client class";
diff --git a/pkgs/development/python-modules/papis/default.nix b/pkgs/development/python-modules/papis/default.nix
index d9be946900c..5a9934d6be6 100644
--- a/pkgs/development/python-modules/papis/default.nix
+++ b/pkgs/development/python-modules/papis/default.nix
@@ -5,6 +5,7 @@
 , prompt_toolkit, pygments
 #, optional, dependencies
 , jinja2, whoosh, pytest
+, stdenv
 }:
 
 buildPythonPackage rec {
@@ -28,6 +29,8 @@ buildPythonPackage rec {
     jinja2 whoosh
   ];
 
+  doCheck = !stdenv.isDarwin;
+
   checkInputs = ([
     pytest
   ]) ++ [
diff --git a/pkgs/development/python-modules/phonenumbers/default.nix b/pkgs/development/python-modules/phonenumbers/default.nix
index 9fe07fe329b..e22c52bb248 100644
--- a/pkgs/development/python-modules/phonenumbers/default.nix
+++ b/pkgs/development/python-modules/phonenumbers/default.nix
@@ -2,11 +2,11 @@
 
 buildPythonPackage rec {
   pname = "phonenumbers";
-  version = "8.10.9";
+  version = "8.10.10";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "d9cf2e8e4ad40552487ab47182bc9759fca1edaa7d513e95a9f20c6742416234";
+    sha256 = "dabc8cfcff96446b0787ea337739ea286ec3949ec27a4790a9b4587817da5c5f";
   };
 
   meta = {
diff --git a/pkgs/development/python-modules/pyasn1-modules/default.nix b/pkgs/development/python-modules/pyasn1-modules/default.nix
index 6ab9d3c7c3a..9817a73be92 100644
--- a/pkgs/development/python-modules/pyasn1-modules/default.nix
+++ b/pkgs/development/python-modules/pyasn1-modules/default.nix
@@ -1,16 +1,32 @@
-{ stdenv, buildPythonPackage, fetchPypi, pyasn1, isPyPy }:
+{ stdenv
+, buildPythonPackage
+, fetchPypi
+, pyasn1
+, isPyPy
+, pytest
+}:
 
 buildPythonPackage rec {
   pname = "pyasn1-modules";
-  version = "0.2.4";
+  version = "0.2.5";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "a52090e8c5841ebbf08ae455146792d9ef3e8445b21055d3a3b7ed9c712b7c7c";
+    sha256 = "ef721f68f7951fab9b0404d42590f479e30d9005daccb1699b0a51bb4177db96";
   };
 
   propagatedBuildInputs = [ pyasn1 ];
 
+  checkInputs = [
+    pytest
+  ];
+
+  # running tests through setup.py fails only for python2 for some reason:
+  # AttributeError: 'module' object has no attribute 'suitetests'
+  checkPhase = ''
+    py.test
+  '';
+
   meta = with stdenv.lib; {
     description = "A collection of ASN.1-based protocols modules";
     homepage = https://pypi.python.org/pypi/pyasn1-modules;
diff --git a/pkgs/development/python-modules/pycairo/default.nix b/pkgs/development/python-modules/pycairo/default.nix
index 126ec15e053..ca6f7284715 100644
--- a/pkgs/development/python-modules/pycairo/default.nix
+++ b/pkgs/development/python-modules/pycairo/default.nix
@@ -2,7 +2,7 @@
 
 buildPythonPackage rec {
   pname = "pycairo";
-  version = "1.18.0";
+  version = "1.18.1";
 
   format = "other";
 
@@ -12,7 +12,7 @@ buildPythonPackage rec {
     owner = "pygobject";
     repo = "pycairo";
     rev = "v${version}";
-    sha256 = "0k266cf477j74v7mv0d4jxaq3wx8b7qa85qgh68cn094gzaasqd9";
+    sha256 = "0f4l7d1ibkk8xdspyv5zx8fah9z3x775bd91zirnp37vlgqds7xj";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/development/python-modules/pygobject/3.nix b/pkgs/development/python-modules/pygobject/3.nix
index 399fc6c7e3c..8372adc9bdb 100644
--- a/pkgs/development/python-modules/pygobject/3.nix
+++ b/pkgs/development/python-modules/pygobject/3.nix
@@ -3,13 +3,13 @@ pycairo, cairo, which, ncurses, meson, ninja, isPy3k, gnome3 }:
 
 buildPythonPackage rec {
   pname = "pygobject";
-  version = "3.32.0";
+  version = "3.32.1";
 
   format = "other";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0agg8nxgqp96wyw4qnjjpiczf0j8aw454plwsfqccsyykzjxgx43";
+    sha256 = "1n04dnvq3bx7vk7pgnxlg6kiwnc7xxv9bjabkv7abpmqjkprvj9j";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/python-modules/pyro-ppl/default.nix b/pkgs/development/python-modules/pyro-ppl/default.nix
index 2ef68338687..5490cd4baa7 100644
--- a/pkgs/development/python-modules/pyro-ppl/default.nix
+++ b/pkgs/development/python-modules/pyro-ppl/default.nix
@@ -1,12 +1,12 @@
 { buildPythonPackage, fetchPypi, lib, pytorch, contextlib2
 , graphviz, networkx, six, opt-einsum, tqdm }:
 buildPythonPackage rec {
-  version = "0.3.1.post1";
+  version = "0.3.2";
   pname = "pyro-ppl";
 
   src = fetchPypi {
     inherit version pname;
-    sha256 = "f5174bcd1b74fb455db948413dcbf5ac1a13dbddc6c54c6d215dd2e4b6b9548d";
+    sha256 = "f00db7e7747e016479ef65e3f00115d66a4200e59914f016d50e4d3e32bc94b0";
   };
 
   propagatedBuildInputs = [
diff --git a/pkgs/development/python-modules/pyrr/default.nix b/pkgs/development/python-modules/pyrr/default.nix
index 10e9781b3ab..3380cf1205c 100644
--- a/pkgs/development/python-modules/pyrr/default.nix
+++ b/pkgs/development/python-modules/pyrr/default.nix
@@ -7,12 +7,12 @@
 }:
 
 buildPythonPackage rec {
-  version = "0.10.2";
+  version = "0.10.3";
   pname = "pyrr";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1q9i4qa6ygr8hlpnw55s58naynxzwm0sc1m54wyy1ghbf8m8d2f0";
+    sha256 = "3c0f7b20326e71f706a610d58f2190fff73af01eef60c19cb188b186f0ec7e1d";
   };
 
   buildInputs = [ setuptools ];
diff --git a/pkgs/development/python-modules/pyspark/default.nix b/pkgs/development/python-modules/pyspark/default.nix
index 3687f1a33ef..7c35ffda885 100644
--- a/pkgs/development/python-modules/pyspark/default.nix
+++ b/pkgs/development/python-modules/pyspark/default.nix
@@ -2,11 +2,11 @@
 
 buildPythonPackage rec {
   pname = "pyspark";
-  version = "2.4.1";
+  version = "2.4.2";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "923cc4075d586074f68b722f5ed029b0d25396828441b5ed421a0e40fe14e749";
+    sha256 = "5ab07ed12c3c9035bfaad93921887736abf89130130b38de7dfa985e50542438";
   };
 
   # pypandoc is broken with pandoc2, so we just lose docs.
diff --git a/pkgs/development/python-modules/pytest-mock/default.nix b/pkgs/development/python-modules/pytest-mock/default.nix
index f07ba9b43f7..68c16725cd4 100644
--- a/pkgs/development/python-modules/pytest-mock/default.nix
+++ b/pkgs/development/python-modules/pytest-mock/default.nix
@@ -2,11 +2,11 @@
 
 buildPythonPackage rec {
   pname = "pytest-mock";
-  version = "1.10.3";
+  version = "1.10.4";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "330bfa1a71c9b6e84e2976f01d70d8a174f755e7f9dc5b22f4b7335992e1e98b";
+    sha256 = "5bf5771b1db93beac965a7347dc81c675ec4090cb841e49d9d34637a25c30568";
   };
 
   propagatedBuildInputs = lib.optional (!isPy3k) mock;
diff --git a/pkgs/development/python-modules/ruamel_yaml/default.nix b/pkgs/development/python-modules/ruamel_yaml/default.nix
index eadebc05c77..01dcdb7104b 100644
--- a/pkgs/development/python-modules/ruamel_yaml/default.nix
+++ b/pkgs/development/python-modules/ruamel_yaml/default.nix
@@ -8,11 +8,11 @@
 
 buildPythonPackage rec {
   pname = "ruamel.yaml";
-  version = "0.15.92";
+  version = "0.15.94";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "c6d05e38a141922eca7902135e7a40b605763d6da8ec6624517370631ce9fb6d";
+    sha256 = "0939bcb399ad037ef903d74ccf2f8a074f06683bc89133ad19305067d34487c8";
   };
 
   # Tests cannot load the module to test
diff --git a/pkgs/development/python-modules/s3fs/default.nix b/pkgs/development/python-modules/s3fs/default.nix
index 77aafc1c94d..0a974133252 100644
--- a/pkgs/development/python-modules/s3fs/default.nix
+++ b/pkgs/development/python-modules/s3fs/default.nix
@@ -2,11 +2,11 @@
 
 buildPythonPackage rec {
   pname = "s3fs";
-  version = "0.2.0";
+  version = "0.2.1";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1p14sm3lbkwz2fidiinmyfyxwkh58ymjb0c0bsv5i0zfv0fy87x3";
+    sha256 = "2146aae91ba3a06d7bfa7130688219599f8696d2825fb00f62923bb56f6e7ed3";
   };
 
   buildInputs = [ docutils ];
diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix
index d4573a2bc43..a849dad54aa 100644
--- a/pkgs/development/python-modules/setuptools/default.nix
+++ b/pkgs/development/python-modules/setuptools/default.nix
@@ -8,13 +8,13 @@
 # Should use buildPythonPackage here somehow
 stdenv.mkDerivation rec {
   pname = "setuptools";
-  version = "41.0.0";
+  version = "41.0.1";
   name = "${python.libPrefix}-${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
     extension = "zip";
-    sha256 = "79d30254b6fe7a8e672e43cd85f13a9f3f2a50080bc81d851143e2219ef0dcb1";
+    sha256 = "a222d126f5471598053c9a77f4b5d4f26eaa1f150ad6e01dcf1a42e185d05613";
   };
 
   nativeBuildInputs = [ unzip wrapPython python.pythonForBuild ];
diff --git a/pkgs/development/python-modules/smart_open/default.nix b/pkgs/development/python-modules/smart_open/default.nix
index 7504d527ca7..f3f7acabfd6 100644
--- a/pkgs/development/python-modules/smart_open/default.nix
+++ b/pkgs/development/python-modules/smart_open/default.nix
@@ -12,11 +12,11 @@
 
 buildPythonPackage rec {
   pname = "smart_open";
-  version = "1.8.1";
+  version = "1.8.2";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0a38mwlz92mlaxz8f8z4yyacpgykiysbcwfykrgr74vlic8x4m5i";
+    sha256 = "d3c16477ad7e8f94ab033630ea31993670ad21153172367db1acb143077d501c";
   };
 
   # nixpkgs version of moto is >=1.2.0, remove version pin to fix build
diff --git a/pkgs/development/python-modules/sparqlwrapper/default.nix b/pkgs/development/python-modules/sparqlwrapper/default.nix
index d61c51f26c7..0a51bb5f9e8 100644
--- a/pkgs/development/python-modules/sparqlwrapper/default.nix
+++ b/pkgs/development/python-modules/sparqlwrapper/default.nix
@@ -10,11 +10,11 @@
 
 buildPythonPackage rec {
   pname = "SPARQLWrapper";
-  version = "1.8.2";
+  version = "1.8.4";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "7f4c8d38ea1bfcffbc358c9a05de35a3fd7152cc3e8ea57963ee7a0a242f7a5e";
+    sha256 = "21928e7a97f565e772cdeeb0abad428960f4307e3a13dbdd8f6d3da8a6a506c9";
   };
 
   # break circular dependency loop
diff --git a/pkgs/development/python-modules/sqlalchemy-migrate/default.nix b/pkgs/development/python-modules/sqlalchemy-migrate/default.nix
index 9daf2a696c2..596f9e47a08 100644
--- a/pkgs/development/python-modules/sqlalchemy-migrate/default.nix
+++ b/pkgs/development/python-modules/sqlalchemy-migrate/default.nix
@@ -21,6 +21,8 @@ buildPythonPackage rec {
   checkInputs = [ unittest2 scripttest pytz mock testtools testrepository ];
   propagatedBuildInputs = [ pbr tempita decorator sqlalchemy six sqlparse ];
 
+  doCheck = !stdenv.isDarwin;
+
   prePatch = ''
     sed -i -e /tempest-lib/d \
            -e /testtools/d \
diff --git a/pkgs/development/python-modules/sseclient/default.nix b/pkgs/development/python-modules/sseclient/default.nix
index a911cd23948..8157b893d74 100644
--- a/pkgs/development/python-modules/sseclient/default.nix
+++ b/pkgs/development/python-modules/sseclient/default.nix
@@ -4,11 +4,11 @@
 
 buildPythonPackage rec {
   pname = "sseclient";
-  version = "0.0.23";
+  version = "0.0.24";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "82a1d281b2bcb98847882069bde57a6772156f9539ddefbb78fea4f915197ec3";
+    sha256 = "1b4c5119b9381cb6ddaf3236f3f7e1437a14e488d1ed61336873a839788481b0";
   };
 
   propagatedBuildInputs = [ requests six ];
diff --git a/pkgs/development/python-modules/typed-ast/default.nix b/pkgs/development/python-modules/typed-ast/default.nix
index ea4c9a63a19..507f7ec49bd 100644
--- a/pkgs/development/python-modules/typed-ast/default.nix
+++ b/pkgs/development/python-modules/typed-ast/default.nix
@@ -1,10 +1,10 @@
 { buildPythonPackage, fetchPypi, lib, pythonOlder }:
 buildPythonPackage rec {
   pname = "typed-ast";
-  version = "1.3.1";
+  version = "1.3.4";
   src = fetchPypi{
     inherit pname version;
-    sha256 = "606d8afa07eef77280c2bf84335e24390055b478392e1975f96286d99d0cb424";
+    sha256 = "68c362848d9fb71d3c3e5f43c09974a0ae319144634e7a47db62f0f2a54a7fa7";
   };
   # Only works with Python 3.3 and newer;
   disabled = pythonOlder "3.3";
diff --git a/pkgs/development/python-modules/urllib3/default.nix b/pkgs/development/python-modules/urllib3/default.nix
index af0066ddc74..4546207b08c 100644
--- a/pkgs/development/python-modules/urllib3/default.nix
+++ b/pkgs/development/python-modules/urllib3/default.nix
@@ -4,11 +4,11 @@
 
 buildPythonPackage rec {
   pname = "urllib3";
-  version = "1.24.1";
+  version = "1.24.2";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22";
+    sha256 = "9a247273df709c4fedb38c711e44292304f73f39ab01beda9f6b9fc375669ac3";
   };
 
   NOSE_EXCLUDE = stdenv.lib.concatStringsSep "," [
diff --git a/pkgs/development/python-modules/xkcdpass/default.nix b/pkgs/development/python-modules/xkcdpass/default.nix
index 674a56d3cb4..9ea1445eff5 100644
--- a/pkgs/development/python-modules/xkcdpass/default.nix
+++ b/pkgs/development/python-modules/xkcdpass/default.nix
@@ -5,11 +5,11 @@
 
 buildPythonPackage rec {
   pname = "xkcdpass";
-  version = "1.17.2";
+  version = "1.17.3";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "ae7ad57c0287cc41c8c9f164b59296463f2e009d4b7aed382160cb40dfb4d91b";
+    sha256 = "95cf3fd41130606ba64ec7edb9efac7c5d61efe21abab51a2c21ccbbebc48bb6";
   };
 
   # No tests included
diff --git a/pkgs/development/python-modules/xlib/default.nix b/pkgs/development/python-modules/xlib/default.nix
index 0b0f60ea16e..1903c3aaca8 100644
--- a/pkgs/development/python-modules/xlib/default.nix
+++ b/pkgs/development/python-modules/xlib/default.nix
@@ -30,6 +30,8 @@ buildPythonPackage rec {
   buildInputs = [ xorg.libX11 ];
   propagatedBuildInputs = [ six ];
 
+  doCheck = !stdenv.isDarwin;
+
   meta = with stdenv.lib; {
     description = "Fully functional X client library for Python programs";
     homepage = http://python-xlib.sourceforge.net/;
diff --git a/pkgs/development/python-modules/xml2rfc/default.nix b/pkgs/development/python-modules/xml2rfc/default.nix
index e86b1b20609..f737cf344b8 100644
--- a/pkgs/development/python-modules/xml2rfc/default.nix
+++ b/pkgs/development/python-modules/xml2rfc/default.nix
@@ -1,5 +1,6 @@
 { lib, fetchPypi, buildPythonPackage, intervaltree, pyflakes, requests, lxml, google-i18n-address
 , pycountry, html5lib, six
+, stdenv
 }:
 
 buildPythonPackage rec {
@@ -26,6 +27,8 @@ buildPythonPackage rec {
     export HOME=$(mktemp -d)
   '';
 
+  doCheck = !stdenv.isDarwin;
+
   meta = with lib; {
     description = "Tool generating IETF RFCs and drafts from XML sources";
     homepage = https://tools.ietf.org/tools/xml2rfc/trac/;
diff --git a/pkgs/development/python-modules/zope_testrunner/default.nix b/pkgs/development/python-modules/zope_testrunner/default.nix
index 25f167b2e94..fd2cf470e6f 100644
--- a/pkgs/development/python-modules/zope_testrunner/default.nix
+++ b/pkgs/development/python-modules/zope_testrunner/default.nix
@@ -19,6 +19,8 @@ buildPythonPackage rec {
 
   propagatedBuildInputs = [ zope_interface zope_exceptions zope_testing six ];
 
+  doCheck = !stdenv.isDarwin;
+
   meta = with stdenv.lib; {
     description = "A flexible test runner with layer support";
     homepage = https://pypi.python.org/pypi/zope.testrunner;
diff --git a/pkgs/development/tools/analysis/valgrind/default.nix b/pkgs/development/tools/analysis/valgrind/default.nix
index 88a53a7667e..4def201952a 100644
--- a/pkgs/development/tools/analysis/valgrind/default.nix
+++ b/pkgs/development/tools/analysis/valgrind/default.nix
@@ -1,18 +1,15 @@
-{ stdenv, fetchurl, perl, gdb, llvm, cctools, xnu, bootstrap_cmds, autoreconfHook }:
+{ stdenv, fetchurl, perl, gdb, llvm, cctools, xnu, bootstrap_cmds }:
 
 stdenv.mkDerivation rec {
-  name = "valgrind-3.14.0";
+  name = "valgrind-3.15.0";
 
   src = fetchurl {
     url = "https://sourceware.org/pub/valgrind/${name}.tar.bz2";
-    sha256 = "19ds42jwd89zrsjb94g7gizkkzipn8xik3xykrpcqxylxyzi2z03";
+    sha256 = "1ccawxrni8brcvwhygy12iprkvz409hbr9xkk1bd03gnm2fplz21";
   };
 
-  # autoreconfHook is needed to pick up patching of Makefile.am
-  # Remove when the patch no longer applies.
-  patches = [ ./coregrind-makefile-race.patch ];
   # Perl is needed for `cg_annotate'.
-  nativeBuildInputs = [ autoreconfHook perl ];
+  nativeBuildInputs = [ perl ];
 
   outputs = [ "out" "dev" "man" "doc" ];
 
@@ -44,14 +41,8 @@ stdenv.mkDerivation rec {
       substituteInPlace coregrind/Makefile.in \
          --replace /usr/include/mach ${xnu}/include/mach
 
-      echo "substitute hardcoded dsymutil with ${llvm}/bin/llvm-dsymutil"
-      find -name "Makefile.in" | while read file; do
-         substituteInPlace "$file" \
-           --replace dsymutil ${llvm}/bin/llvm-dsymutil
-      done
-
       substituteInPlace coregrind/m_debuginfo/readmacho.c \
-         --replace /usr/bin/dsymutil ${llvm}/bin/llvm-dsymutil
+         --replace /usr/bin/dsymutil ${stdenv.cc.bintools.bintools}/bin/dsymutil
 
       echo "substitute hardcoded /usr/bin/ld with ${cctools}/bin/ld"
       substituteInPlace coregrind/link_tool_exe_darwin.in \
diff --git a/pkgs/development/tools/build-managers/cmake/application-services.patch b/pkgs/development/tools/build-managers/cmake/application-services.patch
index 78077f9eaa5..2107dcdfbc6 100644
--- a/pkgs/development/tools/build-managers/cmake/application-services.patch
+++ b/pkgs/development/tools/build-managers/cmake/application-services.patch
@@ -2,16 +2,16 @@ diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
 index 8aff8f6..af1852d 100644
 --- a/Source/CMakeLists.txt
 +++ b/Source/CMakeLists.txt
-@@ -791,12 +791,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR MATCHES "sparc"
+@@ -791,12 +791,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR MATCHES "sparc"
    endif()
  endif()
  
--# On Apple we need CoreFoundation and CoreServices
--if(APPLE)
--  target_link_libraries(CMakeLib "-framework CoreFoundation")
+ # On Apple we need CoreFoundation and CoreServices
+ if(APPLE)
+   target_link_libraries(CMakeLib "-framework CoreFoundation")
 -  target_link_libraries(CMakeLib "-framework CoreServices")
--endif()
--
+ endif()
+ 
  if(WIN32 AND NOT UNIX)
    # We need the rpcrt4 library on Windows.
    # We need the crypt32 library on Windows for crypto/cert APIs.
diff --git a/pkgs/development/tools/build-managers/cmake/default.nix b/pkgs/development/tools/build-managers/cmake/default.nix
index 54fe8e4af5a..721015f0c7c 100644
--- a/pkgs/development/tools/build-managers/cmake/default.nix
+++ b/pkgs/development/tools/build-managers/cmake/default.nix
@@ -2,7 +2,7 @@
 , bzip2, curl, expat, libarchive, xz, zlib, libuv, rhash
 , buildPackages
 # darwin attributes
-, cf-private, ps
+, ps
 , isBootstrap ? false
 , useSharedLibraries ? (!isBootstrap && !stdenv.isCygwin)
 , useNcurses ? false, ncurses
@@ -52,7 +52,6 @@ stdenv.mkDerivation rec {
 
   buildInputs =
     [ setupHook pkgconfig ]
-    ++ optional stdenv.isDarwin cf-private  # needed for CFBundleCopyExecutableURL
     ++ optionals useSharedLibraries [ bzip2 curl expat libarchive xz zlib libuv rhash ]
     ++ optional useNcurses ncurses
     ++ optional useQt4 qt4
diff --git a/pkgs/development/tools/build-managers/dub/default.nix b/pkgs/development/tools/build-managers/dub/default.nix
index 3f733e97eed..7b882926e1f 100644
--- a/pkgs/development/tools/build-managers/dub/default.nix
+++ b/pkgs/development/tools/build-managers/dub/default.nix
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
     ./build.sh
   '';
 
-  doCheck = true;
+  doCheck = !stdenv.isDarwin;
 
   checkPhase = ''
     export DUB=$NIX_BUILD_TOP/source/bin/dub
diff --git a/pkgs/development/tools/gnulib/default.nix b/pkgs/development/tools/gnulib/default.nix
index 18af16d3652..15042353b1d 100644
--- a/pkgs/development/tools/gnulib/default.nix
+++ b/pkgs/development/tools/gnulib/default.nix
@@ -1,12 +1,13 @@
 { stdenv, fetchgit }:
 
 stdenv.mkDerivation {
-  name = "gnulib-20180226";
+  pname = "gnulib";
+  version = "20190326";
 
   src = fetchgit {
-    url = "https://git.savannah.gnu.org/r/gnulib.git";
-    rev = "0bec5d56c6938c2f28417bb5fd1c4b05ea2e7d28";
-    sha256 = "0sifr3bkmhyr5s6ljgfyr0fw6w49ajf11rlp1r797f3r3r6j9w4k";
+    url = https://git.savannah.gnu.org/r/gnulib.git;
+    rev = "a18f7ce3c0aa760c33d46bbeb8e5b3a14cf24984";
+    sha256 = "04py5n3j17wyqv9wfsslcrxzapni9vmw6p5g0adzy2md3ygjw4x4";
   };
 
   dontFixup = true;
diff --git a/pkgs/development/tools/misc/gnum4/darwin-secure-format.patch b/pkgs/development/tools/misc/gnum4/darwin-secure-format.patch
new file mode 100644
index 00000000000..b14d8be6ef1
--- /dev/null
+++ b/pkgs/development/tools/misc/gnum4/darwin-secure-format.patch
@@ -0,0 +1,15 @@
+With format string strictness, High Sierra also enforces that %n isn't used
+in dynamic format strings, but we should just disable its use on darwin in
+general.
+
+--- a/lib/vasnprintf.c	2017-06-22 15:19:15.000000000 -0700
++++ b/lib/vasnprintf.c	2017-06-22 15:20:20.000000000 -0700
+@@ -4869,7 +4869,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *
+ #endif
+                   *fbp = dp->conversion;
+ #if USE_SNPRINTF
+-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
++# if !defined(__APPLE__) && !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+                 fbp[1] = '%';
+                 fbp[2] = 'n';
+                 fbp[3] = '\0';
diff --git a/pkgs/development/tools/misc/gnum4/default.nix b/pkgs/development/tools/misc/gnum4/default.nix
index f477d42fcf1..afe9b59e012 100644
--- a/pkgs/development/tools/misc/gnum4/default.nix
+++ b/pkgs/development/tools/misc/gnum4/default.nix
@@ -13,7 +13,8 @@ stdenv.mkDerivation rec {
   configureFlags = [ "--with-syscmd-shell=${stdenv.shell}" ];
 
   # Upstream is aware of it; it may be in the next release.
-  patches = [ ./s_isdir.patch ] ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin stdenv.secure-format-patch;
+  patches = [ ./s_isdir.patch ]
+    ++ stdenv.lib.optional stdenv.isDarwin ./darwin-secure-format.patch;
 
   meta = {
     homepage = https://www.gnu.org/software/m4/;
diff --git a/pkgs/development/tools/misc/tokei/default.nix b/pkgs/development/tools/misc/tokei/default.nix
index 65a210ed4b9..f9b4343a63a 100644
--- a/pkgs/development/tools/misc/tokei/default.nix
+++ b/pkgs/development/tools/misc/tokei/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, rustPlatform }:
+{ stdenv, fetchFromGitHub, rustPlatform, libiconv }:
 
 rustPlatform.buildRustPackage rec {
   pname = "tokei";
@@ -13,6 +13,8 @@ rustPlatform.buildRustPackage rec {
 
   cargoSha256 = "1xai3jxvs8r3s3v5d5w40miw6nihnj9gzlzzdrwphmgrkywr88c4";
 
+  buildInputs = [ libiconv ];
+
   meta = with stdenv.lib; {
     description = "Program that displays statistics about your code";
     homepage = https://github.com/XAMPPRocky/tokei;
diff --git a/pkgs/development/tools/xcbuild/toolchains.nix b/pkgs/development/tools/xcbuild/toolchains.nix
index 92ff35ac8b5..e435f0978c5 100644
--- a/pkgs/development/tools/xcbuild/toolchains.nix
+++ b/pkgs/development/tools/xcbuild/toolchains.nix
@@ -67,6 +67,7 @@ runCommand "Toolchains" {} (''
   done
 
   ln -s ${buildPackages.darwin.bootstrap_cmds}/bin/mig $toolchain/bin
+  mkdir -p $toolchain/libexec
   ln -s ${buildPackages.darwin.bootstrap_cmds}/libexec/migcom $toolchain/libexec
   ln -s ${mkdep-darwin-src} $toolchain/bin/mkdep
 '')
diff --git a/pkgs/development/tools/xcbuild/wrapper.nix b/pkgs/development/tools/xcbuild/wrapper.nix
index 959c79405e8..902d2104050 100644
--- a/pkgs/development/tools/xcbuild/wrapper.nix
+++ b/pkgs/development/tools/xcbuild/wrapper.nix
@@ -1,6 +1,6 @@
 { stdenv, lib, buildPackages, makeWrapper, writeText, runCommand
 , CoreServices, ImageIO, CoreGraphics
-, runtimeShell
+, runtimeShell, callPackage
 , xcodePlatform ? stdenv.targetPlatform.xcodePlatform or "MacOSX"
 , xcodeVer ? stdenv.targetPlatform.xcodeVer or "9.4.1"
 , sdkVer ? stdenv.targetPlatform.sdkVer or "10.10" }:
@@ -14,20 +14,20 @@ let
   sdkBuildVersion = "17E189";
   xcodeSelectVersion = "2349";
 
-  xcbuild = buildPackages.callPackage ./default.nix {
-    inherit CoreServices ImageIO CoreGraphics;
+  xcbuild = callPackage ./default.nix {
+    inherit CoreServices ImageIO CoreGraphics stdenv;
   };
 
-  toolchains = buildPackages.callPackage ./toolchains.nix {
-    inherit toolchainName;
+  toolchains = callPackage ./toolchains.nix {
+    inherit toolchainName stdenv;
   };
 
-  sdks = buildPackages.callPackage ./sdks.nix {
+  sdks = callPackage ./sdks.nix {
     inherit toolchainName sdkName xcodePlatform;
     version = sdkVer;
   };
 
-  platforms = buildPackages.callPackage ./platforms.nix {
+  platforms = callPackage ./platforms.nix {
     inherit sdks xcodePlatform;
   };
 
diff --git a/pkgs/development/web/nodejs/v12.nix b/pkgs/development/web/nodejs/v12.nix
new file mode 100644
index 00000000000..d087e7dea99
--- /dev/null
+++ b/pkgs/development/web/nodejs/v12.nix
@@ -0,0 +1,10 @@
+{ stdenv, callPackage, lib, openssl, enableNpm ? true }:
+
+let
+  buildNodejs = callPackage ./nodejs.nix { inherit openssl; };
+in
+  buildNodejs {
+    inherit enableNpm;
+    version = "12.1.0";
+    sha256 = "1efb792c689fed2e028025e1398e84193281f329427a17a62b0bffee8e771395";
+  }