summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/CGAL/default.nix4
-rw-r--r--pkgs/development/libraries/accountsservice/default.nix18
-rw-r--r--pkgs/development/libraries/accountsservice/no-create-dirs.patch26
-rw-r--r--pkgs/development/libraries/agda/agda-iowa-stdlib/default.nix15
-rw-r--r--pkgs/development/libraries/agda/agda-stdlib/default.nix4
-rw-r--r--pkgs/development/libraries/allegro/default.nix2
-rw-r--r--pkgs/development/libraries/appstream-glib/default.nix4
-rw-r--r--pkgs/development/libraries/arrow-cpp/darwin.patch11
-rw-r--r--pkgs/development/libraries/arrow-cpp/default.nix48
-rw-r--r--pkgs/development/libraries/arrow-cpp/double-conversion_cmake.patch43
-rw-r--r--pkgs/development/libraries/atk/default.nix2
-rw-r--r--pkgs/development/libraries/aubio/default.nix4
-rw-r--r--pkgs/development/libraries/audio/zita-alsa-pcmi/default.nix16
-rw-r--r--pkgs/development/libraries/audio/zita-convolver/default.nix6
-rw-r--r--pkgs/development/libraries/audio/zita-resampler/default.nix6
-rw-r--r--pkgs/development/libraries/babl/default.nix4
-rw-r--r--pkgs/development/libraries/boehm-gc/7.6.6.nix74
-rw-r--r--pkgs/development/libraries/boehm-gc/default.nix4
-rw-r--r--pkgs/development/libraries/boost/generic.nix17
-rw-r--r--pkgs/development/libraries/brigand/default.nix26
-rw-r--r--pkgs/development/libraries/c-ares/default.nix2
-rw-r--r--pkgs/development/libraries/caf/default.nix4
-rw-r--r--pkgs/development/libraries/cairo/default.nix4
-rw-r--r--pkgs/development/libraries/cl/default.nix4
-rw-r--r--pkgs/development/libraries/clutter-gst/default.nix2
-rw-r--r--pkgs/development/libraries/clutter-gtk/default.nix4
-rw-r--r--pkgs/development/libraries/clutter/default.nix4
-rw-r--r--pkgs/development/libraries/cogl/default.nix4
-rw-r--r--pkgs/development/libraries/cpp-hocon/default.nix4
-rw-r--r--pkgs/development/libraries/cyrus-sasl/default.nix16
-rw-r--r--pkgs/development/libraries/dbus-sharp-glib/dbus-sharp-glib-1.0.nix1
-rw-r--r--pkgs/development/libraries/dbus-sharp-glib/default.nix1
-rw-r--r--pkgs/development/libraries/dbus-sharp/dbus-sharp-1.0.nix1
-rw-r--r--pkgs/development/libraries/dbus-sharp/default.nix1
-rw-r--r--pkgs/development/libraries/dclxvi/default.nix1
-rw-r--r--pkgs/development/libraries/eccodes/default.nix8
-rw-r--r--pkgs/development/libraries/enchant/default.nix5
-rw-r--r--pkgs/development/libraries/epoxy/default.nix4
-rw-r--r--pkgs/development/libraries/epoxy/libgl-path.patch25
-rw-r--r--pkgs/development/libraries/farstream/default.nix6
-rw-r--r--pkgs/development/libraries/fcppt/default.nix8
-rw-r--r--pkgs/development/libraries/ffmpeg/generic.nix10
-rw-r--r--pkgs/development/libraries/fmt/default.nix31
-rw-r--r--pkgs/development/libraries/gdal/default.nix9
-rw-r--r--pkgs/development/libraries/gdbm/default.nix6
-rw-r--r--pkgs/development/libraries/gdk-pixbuf/default.nix2
-rw-r--r--pkgs/development/libraries/geos/default.nix4
-rw-r--r--pkgs/development/libraries/gettext/default.nix1
-rw-r--r--pkgs/development/libraries/giflib/libungif.nix6
-rw-r--r--pkgs/development/libraries/git2/0.27.nix4
-rw-r--r--pkgs/development/libraries/glib-networking/default.nix2
-rw-r--r--pkgs/development/libraries/glib/default.nix2
-rw-r--r--pkgs/development/libraries/gmm/default.nix8
-rw-r--r--pkgs/development/libraries/gobject-introspection/default.nix3
-rw-r--r--pkgs/development/libraries/gpgme/default.nix18
-rw-r--r--pkgs/development/libraries/grantlee/5/default.nix1
-rw-r--r--pkgs/development/libraries/grantlee/default.nix2
-rw-r--r--pkgs/development/libraries/gspell/default.nix2
-rw-r--r--pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix5
-rw-r--r--pkgs/development/libraries/gtk+/3.x.nix2
-rw-r--r--pkgs/development/libraries/gtk-sharp-beans/default.nix3
-rw-r--r--pkgs/development/libraries/gtk-sharp/2.0.nix7
-rw-r--r--pkgs/development/libraries/gtksourceview/3.x.nix2
-rw-r--r--pkgs/development/libraries/gtksourceview/4.x.nix2
-rw-r--r--pkgs/development/libraries/gtkspell/default.nix11
-rw-r--r--pkgs/development/libraries/gvfs/default.nix2
-rw-r--r--pkgs/development/libraries/harfbuzz/default.nix5
-rw-r--r--pkgs/development/libraries/hiredis/default.nix4
-rw-r--r--pkgs/development/libraries/hspell/default.nix8
-rw-r--r--pkgs/development/libraries/hunspell/default.nix1
-rw-r--r--pkgs/development/libraries/hwloc/default.nix9
-rw-r--r--pkgs/development/libraries/hyena/default.nix1
-rw-r--r--pkgs/development/libraries/id3lib/default.nix7
-rw-r--r--pkgs/development/libraries/java/commons/compress/default.nix4
-rw-r--r--pkgs/development/libraries/java/commons/math/default.nix4
-rw-r--r--pkgs/development/libraries/leatherman/default.nix4
-rw-r--r--pkgs/development/libraries/lesstif/default.nix11
-rw-r--r--pkgs/development/libraries/libHX/default.nix7
-rw-r--r--pkgs/development/libraries/libaccounts-glib/default.nix6
-rw-r--r--pkgs/development/libraries/libaom/default.nix1
-rw-r--r--pkgs/development/libraries/libatomic_ops/default.nix4
-rw-r--r--pkgs/development/libraries/libbap/default.nix7
-rw-r--r--pkgs/development/libraries/libblockdev/default.nix4
-rw-r--r--pkgs/development/libraries/libbsd/cdefs.patch222
-rw-r--r--pkgs/development/libraries/libbsd/darwin.patch752
-rw-r--r--pkgs/development/libraries/libbsd/default.nix15
-rw-r--r--pkgs/development/libraries/libbsd/features.patch26
-rw-r--r--pkgs/development/libraries/libbsd/musl.patch14
-rw-r--r--pkgs/development/libraries/libbsd/non-glibc.patch74
-rw-r--r--pkgs/development/libraries/libcacard/default.nix22
-rw-r--r--pkgs/development/libraries/libcanberra/default.nix2
-rw-r--r--pkgs/development/libraries/libchamplain/default.nix4
-rw-r--r--pkgs/development/libraries/libclthreads/default.nix18
-rw-r--r--pkgs/development/libraries/libclxclient/default.nix16
-rw-r--r--pkgs/development/libraries/libcouchbase/default.nix4
-rw-r--r--pkgs/development/libraries/libdaemon/default.nix14
-rw-r--r--pkgs/development/libraries/libdap/default.nix6
-rw-r--r--pkgs/development/libraries/libdbusmenu-qt/default.nix2
-rw-r--r--pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix1
-rw-r--r--pkgs/development/libraries/libdrm/default.nix4
-rw-r--r--pkgs/development/libraries/libexttextcat/default.nix5
-rw-r--r--pkgs/development/libraries/libgdiplus/default.nix7
-rw-r--r--pkgs/development/libraries/libgnome-keyring/default.nix1
-rw-r--r--pkgs/development/libraries/libgnurl/default.nix1
-rw-r--r--pkgs/development/libraries/libgsf/default.nix4
-rw-r--r--pkgs/development/libraries/libgtop/default.nix2
-rw-r--r--pkgs/development/libraries/libgudev/default.nix2
-rw-r--r--pkgs/development/libraries/libguestfs/default.nix4
-rw-r--r--pkgs/development/libraries/libharu/default.nix2
-rw-r--r--pkgs/development/libraries/libhttpseverywhere/default.nix2
-rw-r--r--pkgs/development/libraries/libicns/default.nix7
-rw-r--r--pkgs/development/libraries/libimagequant/default.nix29
-rw-r--r--pkgs/development/libraries/libinput/default.nix10
-rw-r--r--pkgs/development/libraries/libinput/udev-absolute-path.patch2
-rw-r--r--pkgs/development/libraries/libiodbc/default.nix10
-rw-r--r--pkgs/development/libraries/libisoburn/default.nix4
-rw-r--r--pkgs/development/libraries/libite/default.nix1
-rw-r--r--pkgs/development/libraries/libjson/default.nix13
-rw-r--r--pkgs/development/libraries/libkate/default.nix6
-rw-r--r--pkgs/development/libraries/liblastfm/default.nix5
-rw-r--r--pkgs/development/libraries/liblastfmSF/default.nix1
-rw-r--r--pkgs/development/libraries/liblinear/default.nix4
-rw-r--r--pkgs/development/libraries/liblqr-1/default.nix2
-rw-r--r--pkgs/development/libraries/libmesode/default.nix4
-rw-r--r--pkgs/development/libraries/libmilter/default.nix1
-rw-r--r--pkgs/development/libraries/libmms/default.nix7
-rw-r--r--pkgs/development/libraries/libmp3splt/default.nix1
-rw-r--r--pkgs/development/libraries/libmtp/default.nix6
-rw-r--r--pkgs/development/libraries/libmusicbrainz/5.x.nix6
-rw-r--r--pkgs/development/libraries/libmusicbrainz/default.nix6
-rw-r--r--pkgs/development/libraries/libnatspec/default.nix6
-rw-r--r--pkgs/development/libraries/libnetfilter_queue/default.nix6
-rw-r--r--pkgs/development/libraries/libnice/default.nix5
-rw-r--r--pkgs/development/libraries/libnotify/default.nix5
-rw-r--r--pkgs/development/libraries/libnova/default.nix9
-rw-r--r--pkgs/development/libraries/liboauth/default.nix1
-rw-r--r--pkgs/development/libraries/libofa/default.nix5
-rw-r--r--pkgs/development/libraries/liboggz/default.nix6
-rw-r--r--pkgs/development/libraries/libpcap/default.nix1
-rw-r--r--pkgs/development/libraries/libpqxx/default.nix4
-rw-r--r--pkgs/development/libraries/libqalculate/default.nix1
-rw-r--r--pkgs/development/libraries/libqtav/default.nix16
-rw-r--r--pkgs/development/libraries/libraw/default.nix4
-rw-r--r--pkgs/development/libraries/librdf/redland.nix6
-rw-r--r--pkgs/development/libraries/librealsense/default.nix4
-rw-r--r--pkgs/development/libraries/libressl/default.nix4
-rw-r--r--pkgs/development/libraries/librsvg/default.nix2
-rw-r--r--pkgs/development/libraries/libsecret/default.nix2
-rw-r--r--pkgs/development/libraries/libsndfile/default.nix5
-rw-r--r--pkgs/development/libraries/libsoup/default.nix2
-rw-r--r--pkgs/development/libraries/libssh/default.nix6
-rw-r--r--pkgs/development/libraries/libssh2/default.nix5
-rw-r--r--pkgs/development/libraries/libtap/default.nix6
-rw-r--r--pkgs/development/libraries/libtiger/default.nix1
-rw-r--r--pkgs/development/libraries/libtorrent-rasterbar/default.nix4
-rw-r--r--pkgs/development/libraries/libtoxcore/default.nix4
-rw-r--r--pkgs/development/libraries/libtxc_dxtn/default.nix5
-rw-r--r--pkgs/development/libraries/libui/default.nix5
-rw-r--r--pkgs/development/libraries/libunistring/default.nix14
-rw-r--r--pkgs/development/libraries/libusb/default.nix12
-rw-r--r--pkgs/development/libraries/libusb1/default.nix13
-rw-r--r--pkgs/development/libraries/libuv/default.nix6
-rw-r--r--pkgs/development/libraries/libwacom/default.nix3
-rw-r--r--pkgs/development/libraries/libwnck/3.x.nix2
-rw-r--r--pkgs/development/libraries/lirc/default.nix20
-rw-r--r--pkgs/development/libraries/mapnik/default.nix4
-rw-r--r--pkgs/development/libraries/mesa-darwin/default.nix73
-rw-r--r--pkgs/development/libraries/mesa-darwin/patches/0003-mesa-fix-per-level-max-texture-size-error-checking.patch147
-rw-r--r--pkgs/development/libraries/mesa-darwin/patches/0008-glsl-initialise-const-force-glsl-extension-warning-i.patch33
-rw-r--r--pkgs/development/libraries/mesa-darwin/patches/0009-mesa-test-for-GL_EXT_framebuffer_sRGB-in-glPopAttrib.patch28
-rw-r--r--pkgs/development/libraries/mesa-darwin/patches/0011-Apple-glFlush-is-not-needed-with-CGLFlushDrawable.patch29
-rw-r--r--pkgs/development/libraries/mesa-darwin/patches/0012-glapi-Avoid-heap-corruption-in-_glapi_table.patch28
-rw-r--r--pkgs/development/libraries/mesa-darwin/patches/0013-darwin-Fix-test-for-kCGLPFAOpenGLProfile-support-at-.patch40
-rw-r--r--pkgs/development/libraries/mesa-darwin/patches/1001-appleglx-Improve-error-reporting-if-CGLChoosePixelFo.patch30
-rw-r--r--pkgs/development/libraries/mesa-darwin/patches/1002-darwin-Write-errors-in-choosing-the-pixel-format-to-.patch55
-rw-r--r--pkgs/development/libraries/mesa-darwin/patches/1003-darwin-Guard-Core-Profile-usage-behind-a-testing-env.patch69
-rw-r--r--pkgs/development/libraries/mesa-darwin/patches/patch-src-mapi-vgapi-Makefile.diff11
-rw-r--r--pkgs/development/libraries/mesa/darwin-clock-gettime.patch76
-rw-r--r--pkgs/development/libraries/mesa/default.nix84
-rw-r--r--pkgs/development/libraries/mesa/missing-includes.patch10
-rw-r--r--pkgs/development/libraries/msgpack/generic.nix2
-rw-r--r--pkgs/development/libraries/nanoflann/default.nix4
-rw-r--r--pkgs/development/libraries/newt/default.nix7
-rw-r--r--pkgs/development/libraries/nghttp2/default.nix9
-rw-r--r--pkgs/development/libraries/nlohmann_json/default.nix6
-rw-r--r--pkgs/development/libraries/nspr/default.nix4
-rw-r--r--pkgs/development/libraries/opencv/3.x.nix5
-rw-r--r--pkgs/development/libraries/p11-kit/default.nix4
-rw-r--r--pkgs/development/libraries/parquet-cpp/api.patch12
-rw-r--r--pkgs/development/libraries/parquet-cpp/default.nix37
-rw-r--r--pkgs/development/libraries/physics/apfel/default.nix25
-rw-r--r--pkgs/development/libraries/physics/apfelgrid/default.nix26
-rw-r--r--pkgs/development/libraries/physics/applgrid/bad_code.patch39
-rw-r--r--pkgs/development/libraries/physics/applgrid/default.nix42
-rw-r--r--pkgs/development/libraries/physics/hoppet/default.nix23
-rw-r--r--pkgs/development/libraries/physics/mela/default.nix25
-rw-r--r--pkgs/development/libraries/physics/qcdnum/default.nix23
-rw-r--r--pkgs/development/libraries/postgis/default.nix4
-rw-r--r--pkgs/development/libraries/proj/default.nix6
-rw-r--r--pkgs/development/libraries/qpdf/default.nix8
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/default.nix1
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/kill-legacy-darwin-apis.patch330
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtgraphicaleffects.nix2
-rw-r--r--pkgs/development/libraries/range-v3/default.nix4
-rw-r--r--pkgs/development/libraries/rapidcheck/default.nix27
-rw-r--r--pkgs/development/libraries/rarian/default.nix2
-rw-r--r--pkgs/development/libraries/rlog/default.nix1
-rw-r--r--pkgs/development/libraries/sbc/default.nix4
-rw-r--r--pkgs/development/libraries/science/math/ipopt/default.nix4
-rw-r--r--pkgs/development/libraries/science/math/mkl/default.nix85
-rw-r--r--pkgs/development/libraries/science/math/openblas/default.nix19
-rw-r--r--pkgs/development/libraries/science/math/zn_poly/default.nix41
-rw-r--r--pkgs/development/libraries/spice/default.nix6
-rw-r--r--pkgs/development/libraries/sqlite/default.nix2
-rw-r--r--pkgs/development/libraries/sundials/default.nix4
-rw-r--r--pkgs/development/libraries/termbox/default.nix24
-rw-r--r--pkgs/development/libraries/ti-rpc/default.nix2
-rw-r--r--pkgs/development/libraries/tnt/default.nix1
-rw-r--r--pkgs/development/libraries/v8/6_x.nix124
-rw-r--r--pkgs/development/libraries/vc/default.nix4
-rw-r--r--pkgs/development/libraries/vigra/default.nix8
-rw-r--r--pkgs/development/libraries/vulkan-headers/default.nix6
-rw-r--r--pkgs/development/libraries/vulkan-loader/default.nix14
-rw-r--r--pkgs/development/libraries/wcslib/default.nix4
-rw-r--r--pkgs/development/libraries/webkitgtk/2.22.nix83
-rw-r--r--pkgs/development/libraries/wolfssl/default.nix1
-rw-r--r--pkgs/development/libraries/xdg-desktop-portal/default.nix4
-rw-r--r--pkgs/development/libraries/yojimbo/default.nix43
-rw-r--r--pkgs/development/libraries/zlib/default.nix2
229 files changed, 2088 insertions, 2018 deletions
diff --git a/pkgs/development/libraries/CGAL/default.nix b/pkgs/development/libraries/CGAL/default.nix
index 0de1e35440b9..787c54c1b0a3 100644
--- a/pkgs/development/libraries/CGAL/default.nix
+++ b/pkgs/development/libraries/CGAL/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchFromGitHub, cmake, boost, gmp, mpfr }:
 
 stdenv.mkDerivation rec {
-  version = "4.12.1";
+  version = "4.13";
   name = "cgal-" + version;
 
   src = fetchFromGitHub {
     owner = "CGAL";
     repo = "releases";
     rev = "CGAL-${version}";
-    sha256 = "0b8wwfnvbayxi18jahfdplkjqr59ynq6phk0kz62gqp8vmwia9d9";
+    sha256 = "1gzfz0fz7q5qyhzwfl3n1f5jrqa1ijq9kjjms7hb0ywpagipq6ax";
   };
 
   # note: optional component libCGAL_ImageIO would need zlib and opengl;
diff --git a/pkgs/development/libraries/accountsservice/default.nix b/pkgs/development/libraries/accountsservice/default.nix
index 36d7912d0f8a..66d540f8d66b 100644
--- a/pkgs/development/libraries/accountsservice/default.nix
+++ b/pkgs/development/libraries/accountsservice/default.nix
@@ -1,22 +1,26 @@
 { stdenv, fetchurl, pkgconfig, glib, intltool, makeWrapper, shadow
-, libtool, gobjectIntrospection, polkit, systemd, coreutils }:
+, gobjectIntrospection, polkit, systemd, coreutils, meson, dbus
+, ninja, python3 }:
 
 stdenv.mkDerivation rec {
   name = "accountsservice-${version}";
-  version = "0.6.50";
+  version = "0.6.54";
 
   src = fetchurl {
     url = "https://www.freedesktop.org/software/accountsservice/accountsservice-${version}.tar.xz";
-    sha256 = "0jn7vg1z4vxnna0hl33hbcb4bb3zpilxc2vyclh24vx4vvsjhn83";
+    sha256 = "1b115n0a4yfa06kgxc69qfc1rc0w4frgs3id3029czkrhhn0ds96";
   };
 
-  nativeBuildInputs = [ pkgconfig makeWrapper ];
+  nativeBuildInputs = [ pkgconfig makeWrapper meson ninja python3 ];
 
-  buildInputs = [ glib intltool libtool gobjectIntrospection polkit systemd ];
+  buildInputs = [ glib intltool gobjectIntrospection polkit systemd dbus ];
 
-  configureFlags = [ "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
-                     "--localstatedir=/var" ];
+  mesonFlags = [ "-Dsystemdsystemunitdir=etc/systemd/system"
+                 "-Dlocalstatedir=/var" ];
   prePatch = ''
+    chmod +x meson_post_install.py
+    patchShebangs meson_post_install.py
+
     substituteInPlace src/daemon.c --replace '"/usr/sbin/useradd"' '"${shadow}/bin/useradd"' \
                                    --replace '"/usr/sbin/userdel"' '"${shadow}/bin/userdel"'
     substituteInPlace src/user.c   --replace '"/usr/sbin/usermod"' '"${shadow}/bin/usermod"' \
diff --git a/pkgs/development/libraries/accountsservice/no-create-dirs.patch b/pkgs/development/libraries/accountsservice/no-create-dirs.patch
index f26f5c738227..ef1a59b0249f 100644
--- a/pkgs/development/libraries/accountsservice/no-create-dirs.patch
+++ b/pkgs/development/libraries/accountsservice/no-create-dirs.patch
@@ -1,13 +1,15 @@
---- a/src/Makefile.in	2014-04-23 22:30:00.276005326 +0200
-+++ b/src/Makefile.in	2014-04-23 22:30:16.809409113 +0200
-@@ -881,8 +881,8 @@
- 	gdbus-codegen --generate-c-code accounts-user-generated --c-namespace Accounts --interface-prefix=org.freedesktop.Accounts. $(top_srcdir)/data/org.freedesktop.Accounts.User.xml
+diff --git a/meson_post_install.py b/meson_post_install.py
+index ba95055..17f7926 100644
+--- a/meson_post_install.py
++++ b/meson_post_install.py
+@@ -9,8 +9,8 @@ localstatedir = os.path.normpath(destdir + os.sep + sys.argv[1])
+ # FIXME: meson will not track the creation of these directories
+ #        https://github.com/mesonbuild/meson/blob/master/mesonbuild/scripts/uninstall.py#L39
+ dst_dirs = [
+-  os.path.join(localstatedir, 'lib', 'AccountsService', 'icons'),
+-  os.path.join(localstatedir, 'lib', 'AccountsService', 'users'),
++  #os.path.join(localstatedir, 'lib', 'AccountsService', 'icons'),
++  #os.path.join(localstatedir, 'lib', 'AccountsService', 'users'),
+ ]
  
- install-data-hook:
--	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/AccountsService/users"
--	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/AccountsService/icons"
-+#	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/AccountsService/users"
-+#	$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/AccountsService/icons"
- 
- # Tell versions [3.59,3.63) of GNU make to not export all variables.
- # Otherwise a system limit (for SysV at least) may be exceeded.
+ for dst_dir in dst_dirs:
diff --git a/pkgs/development/libraries/agda/agda-iowa-stdlib/default.nix b/pkgs/development/libraries/agda/agda-iowa-stdlib/default.nix
index ce25521ad2e5..3ab4ed3e9623 100644
--- a/pkgs/development/libraries/agda/agda-iowa-stdlib/default.nix
+++ b/pkgs/development/libraries/agda/agda-iowa-stdlib/default.nix
@@ -1,13 +1,14 @@
-{ stdenv, agda, fetchsvn }:
+{ stdenv, agda, fetchFromGitHub }:
 
 agda.mkDerivation (self: rec {
-  version = "18734";
+  version = "1.4.0";
   name = "agda-iowa-stdlib-${version}";
 
-  src = fetchsvn {
-    url = "https://svn.divms.uiowa.edu/repos/clc/projects/agda/lib";
-    rev = version;
-    sha256 = "0aqib88m5n6aqb5lmns9nl62x40yqhg6zpj0zjxibbn4s4qjw9ky";
+  src = fetchFromGitHub {
+    owner = "cedille";
+    repo  = "ial";
+    rev = "v${version}";
+    sha256 = "1gwxpybxwdj5ipbb3gapm7r5hfl3g6sj9kp13954pdmx8d5b0gma";
   };
 
   sourceDirectories = [ "./." ];
@@ -22,7 +23,5 @@ agda.mkDerivation (self: rec {
     license = stdenv.lib.licenses.free;
     platforms = stdenv.lib.platforms.unix;
     maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
-
-    broken = true;
   };
 })
diff --git a/pkgs/development/libraries/agda/agda-stdlib/default.nix b/pkgs/development/libraries/agda/agda-stdlib/default.nix
index bd4270e8b935..12d35e270209 100644
--- a/pkgs/development/libraries/agda/agda-stdlib/default.nix
+++ b/pkgs/development/libraries/agda/agda-stdlib/default.nix
@@ -1,14 +1,14 @@
 { stdenv, agda, fetchFromGitHub, ghcWithPackages }:
 
 agda.mkDerivation (self: rec {
-  version = "0.16";
+  version = "0.16.1";
   name = "agda-stdlib-${version}";
 
   src = fetchFromGitHub {
     repo = "agda-stdlib";
     owner = "agda";
     rev = "v${version}";
-    sha256 = "0kqfx6742vbyyr8glqm5bkvj0z0y0dkaajlw10p3pzidrc17767r";
+    sha256 = "17dv5r3ygmbwwh7k8qaffp2965sv165b47i53ymc0gbfcwr6cy2n";
   };
 
   nativeBuildInputs = [ (ghcWithPackages (self : [ self.filemanip ])) ];
diff --git a/pkgs/development/libraries/allegro/default.nix b/pkgs/development/libraries/allegro/default.nix
index 21d9ce23d319..f53aa873b482 100644
--- a/pkgs/development/libraries/allegro/default.nix
+++ b/pkgs/development/libraries/allegro/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
   version="4.4.2";
 
   src = fetchurl {
-    url = "http://download.gna.org/allegro/allegro/${version}/${name}.tar.gz";
+    url = "https://github.com/liballeg/allegro5/releases/download/${version}/${name}.tar.gz";
     sha256 = "1p0ghkmpc4kwij1z9rzxfv7adnpy4ayi0ifahlns1bdzgmbyf88v";
   };
 
diff --git a/pkgs/development/libraries/appstream-glib/default.nix b/pkgs/development/libraries/appstream-glib/default.nix
index 39b3d6aba6bd..2aacfd07364f 100644
--- a/pkgs/development/libraries/appstream-glib/default.nix
+++ b/pkgs/development/libraries/appstream-glib/default.nix
@@ -4,7 +4,7 @@
 , libuuid, json-glib, meson, gperf, ninja
 }:
 stdenv.mkDerivation rec {
-  name = "appstream-glib-0.7.12";
+  name = "appstream-glib-0.7.13";
 
   outputs = [ "out" "dev" "man" "installedTests" ];
   outputBin = "dev";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     owner = "hughsie";
     repo = "appstream-glib";
     rev = stdenv.lib.replaceStrings ["." "-"] ["_" "_"] name;
-    sha256 = "0kqhm3j0nmf9pp9mpykzs2hg3nr6126ibrq1ap21hpasnq4rzlax";
+    sha256 = "0r1gb806p68axspzwvpn1ygmd6pfc17mncg3i6yazk3n10k5cl06";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/development/libraries/arrow-cpp/darwin.patch b/pkgs/development/libraries/arrow-cpp/darwin.patch
new file mode 100644
index 000000000000..de9b1986ffed
--- /dev/null
+++ b/pkgs/development/libraries/arrow-cpp/darwin.patch
@@ -0,0 +1,11 @@
+diff --git a/cmake_modules/FindPythonLibsNew.cmake b/cmake_modules/FindPythonLibsNew.cmake
+--- a/cmake_modules/FindPythonLibsNew.cmake
++++ b/cmake_modules/FindPythonLibsNew.cmake
+@@ -117,6 +117,7 @@ list(GET _PYTHON_VALUES 6 PYTHON_SIZEOF_VOID_P)
+ list(GET _PYTHON_VALUES 7 PYTHON_LIBRARY_SUFFIX)
+ list(GET _PYTHON_VALUES 8 PYTHON_LIBRARY_PATH)
+ list(GET _PYTHON_VALUES 9 PYTHON_OTHER_LIBS)
++string(REPLACE "-lncurses" "" PYTHON_OTHER_LIBS "${PYTHON_OTHER_LIBS}")
+ 
+ # Make sure the Python has the same pointer-size as the chosen compiler
+ # Skip the check on OS X, it doesn't consistently have CMAKE_SIZEOF_VOID_P defined
diff --git a/pkgs/development/libraries/arrow-cpp/default.nix b/pkgs/development/libraries/arrow-cpp/default.nix
index 952f7435c069..77ce77dee5ad 100644
--- a/pkgs/development/libraries/arrow-cpp/default.nix
+++ b/pkgs/development/libraries/arrow-cpp/default.nix
@@ -1,39 +1,75 @@
-{ stdenv, symlinkJoin, fetchurl, boost, brotli, cmake, flatbuffers, gtest, gflags, lz4, python, rapidjson, snappy, zlib, zstd }:
+{ stdenv, symlinkJoin, fetchurl, fetchFromGitHub, boost, brotli, cmake, double-conversion, flatbuffers, gflags, glog, gtest, lz4, perl, python, rapidjson, snappy, thrift, which, zlib, zstd }:
+
+let
+  parquet-testing = fetchFromGitHub {
+    owner = "apache";
+    repo = "parquet-testing";
+    rev = "46ae2605c2de306f5740587107dcf333a527f2d1";
+    sha256 = "07ps745gas2zcfmg56m3vwl63yyzmalnxwb5dc40vd004cx5hdik";
+  };
+in
 
 stdenv.mkDerivation rec {
   name = "arrow-cpp-${version}";
-  version = "0.9.0";
+  version = "0.11.0";
 
   src = fetchurl {
     url = "mirror://apache/arrow/arrow-${version}/apache-arrow-${version}.tar.gz";
-    sha256 = "16l91fixb5dgx3v6xc73ipn1w1hjgbmijyvs81j7ywzpna2cdcdy";
+    sha256 = "0pc5pqr0dbnx8s1ji102dhw9bbrsq3ml4ac3mmi2022yfyizlf0q";
   };
 
   sourceRoot = "apache-arrow-${version}/cpp";
 
+  patches = [
+    # fix ARROW-3467
+    ./double-conversion_cmake.patch
+
+    # patch to fix python-test
+    ./darwin.patch
+    ];
+
   nativeBuildInputs = [ cmake ];
-  buildInputs = [ boost python.pkgs.python python.pkgs.numpy ];
+  buildInputs = [ boost double-conversion glog python.pkgs.python python.pkgs.numpy ];
 
   preConfigure = ''
+    substituteInPlace cmake_modules/FindThrift.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
     substituteInPlace cmake_modules/FindBrotli.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
+    substituteInPlace cmake_modules/FindGLOG.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
     substituteInPlace cmake_modules/FindLz4.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
     substituteInPlace cmake_modules/FindSnappy.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
+
+    patchShebangs build-support/
   '';
 
   BROTLI_HOME = symlinkJoin { name="brotli-wrap"; paths = [ brotli.lib brotli.dev ]; };
+  DOUBLE_CONVERSION_HOME = double-conversion;
   FLATBUFFERS_HOME = flatbuffers;
-  GTEST_HOME = gtest;
   GFLAGS_HOME = gflags;
+  GLOG_HOME = glog;
+  GTEST_HOME = gtest;
   LZ4_HOME = symlinkJoin { name="lz4-wrap"; paths = [ lz4 lz4.dev ]; };
   RAPIDJSON_HOME = rapidjson;
   SNAPPY_HOME = symlinkJoin { name="snappy-wrap"; paths = [ snappy snappy.dev ]; };
-  ZLIB_HOME = symlinkJoin { name="zlib-wrap"; paths = [ zlib.dev zlib.static ]; };
+  THRIFT_HOME = thrift;
+  ZLIB_HOME = symlinkJoin { name="zlib-wrap"; paths = [ zlib zlib.dev ]; };
   ZSTD_HOME = zstd;
 
   cmakeFlags = [
     "-DARROW_PYTHON=ON"
+    "-DARROW_PARQUET=ON"
   ];
 
+  doInstallCheck = true;
+  PARQUET_TEST_DATA = if doInstallCheck then "${parquet-testing}/data" else null;
+  installCheckInputs = [ perl which ];
+  installCheckPhase = (stdenv.lib.optionalString stdenv.isDarwin ''
+    for f in release/*-test; do
+      install_name_tool -add_rpath "$out"/lib  "$f"
+    done
+  '') + ''
+    ctest -L unittest -V
+  '';
+
   meta = {
     description = "A  cross-language development platform for in-memory data";
     homepage = https://arrow.apache.org/;
diff --git a/pkgs/development/libraries/arrow-cpp/double-conversion_cmake.patch b/pkgs/development/libraries/arrow-cpp/double-conversion_cmake.patch
new file mode 100644
index 000000000000..336fdde9e8fb
--- /dev/null
+++ b/pkgs/development/libraries/arrow-cpp/double-conversion_cmake.patch
@@ -0,0 +1,43 @@
+diff --git a/CMakeLists.txt b/cpp/CMakeLists.txt
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -615,7 +615,7 @@ endif(UNIX)
+ set(ARROW_LINK_LIBS)
+ 
+ # Libraries to link statically with libarrow.so
+-set(ARROW_STATIC_LINK_LIBS double-conversion)
++set(ARROW_STATIC_LINK_LIBS ${DOUBLE_CONVERSION_TARGET})
+ 
+ if (ARROW_WITH_BROTLI)
+   SET(ARROW_STATIC_LINK_LIBS
+@@ -694,7 +694,7 @@ else ()
+   set(ARROW_MIN_TEST_LIBS
+     arrow_shared
+     ${ARROW_LINK_LIBS}
+-    double-conversion
++    ${DOUBLE_CONVERSION_TARGET}
+     ${BOOST_SYSTEM_LIBRARY}
+     ${BOOST_FILESYSTEM_LIBRARY}
+     ${BOOST_REGEX_LIBRARY}
+diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
+--- a/cmake_modules/ThirdpartyToolchain.cmake
++++ b/cmake_modules/ThirdpartyToolchain.cmake
+@@ -469,14 +469,16 @@ if("${DOUBLE_CONVERSION_HOME}" STREQUAL "")
+   set(DOUBLE_CONVERSION_VENDORED 1)
+ else()
+   find_package(double-conversion REQUIRED)
++  set(DOUBLE_CONVERSION_TARGET double-conversion::double-conversion)
+   set(DOUBLE_CONVERSION_VENDORED 0)
+ endif()
+ 
+ include_directories(SYSTEM ${DOUBLE_CONVERSION_INCLUDE_DIR})
+-ADD_THIRDPARTY_LIB(double-conversion
+-  STATIC_LIB ${DOUBLE_CONVERSION_STATIC_LIB})
+ 
+ if (DOUBLE_CONVERSION_VENDORED)
++  ADD_THIRDPARTY_LIB(double-conversion
++    STATIC_LIB ${DOUBLE_CONVERSION_STATIC_LIB})
++  set(DOUBLE_CONVERSION_TARGET double-conversion)
+   add_dependencies(arrow_dependencies double-conversion_ep)
+ endif()
+ 
diff --git a/pkgs/development/libraries/atk/default.nix b/pkgs/development/libraries/atk/default.nix
index 813f8c3c9640..288bd9a9dd09 100644
--- a/pkgs/development/libraries/atk/default.nix
+++ b/pkgs/development/libraries/atk/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "1z7laf6qwv5zsqcnj222dm5f43c6f3liil0cgx4s4s62xjk1wfnd";
   };
 
diff --git a/pkgs/development/libraries/aubio/default.nix b/pkgs/development/libraries/aubio/default.nix
index adcb86cedf84..8c8fe25f5000 100644
--- a/pkgs/development/libraries/aubio/default.nix
+++ b/pkgs/development/libraries/aubio/default.nix
@@ -3,11 +3,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "aubio-0.4.6";
+  name = "aubio-0.4.7";
 
   src = fetchurl {
     url = "https://aubio.org/pub/${name}.tar.bz2";
-    sha256 = "1yvwskahx1bf3x2fvi6cwah1ay11iarh79fjlqz8s887y3hkpixx";
+    sha256 = "0hd0kzfmr46am00ygxar8alrldv92c5azqy701iilfmbqpz4mvfb";
   };
 
   nativeBuildInputs = [ pkgconfig python ];
diff --git a/pkgs/development/libraries/audio/zita-alsa-pcmi/default.nix b/pkgs/development/libraries/audio/zita-alsa-pcmi/default.nix
index e3c0f0394772..320fc41f76c5 100644
--- a/pkgs/development/libraries/audio/zita-alsa-pcmi/default.nix
+++ b/pkgs/development/libraries/audio/zita-alsa-pcmi/default.nix
@@ -2,16 +2,16 @@
 
 stdenv.mkDerivation rec {
   name = "zita-alsa-pcmi-${version}";
-  version = "0.2.0";
+  version = "0.3.2";
   src = fetchurl {
     url = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/${name}.tar.bz2";
-    sha256 = "1rgv332g82rrrlm4vdam6p2pyrisxbi7b3izfaa0pcjglafsy7j9";
+    sha256 = "12d7vdg74yh21w69qi0wg57iz4876j94qbiq09bvscih6xz9y78s";
   };
 
   buildInputs = [ alsaLib ];
 
   buildPhase = ''
-    cd libs
+    cd source
     make PREFIX="$out"
 
     # create lib link for building apps
@@ -19,8 +19,8 @@ stdenv.mkDerivation rec {
 
     # apps
     cd ../apps
-    CXXFLAGS+=" -I../libs" \
-    LDFLAGS+=" -L../libs" \
+    CXXFLAGS+=" -I../source" \
+    LDFLAGS+=" -L../source" \
     make PREFIX="$out"
   '';
 
@@ -30,9 +30,9 @@ stdenv.mkDerivation rec {
     mkdir "$out/include"
     mkdir "$out/bin"
 
-    cd ../libs
+    cd ../source
 
-    # libs
+    # source
     install -Dm755 libzita-alsa-pcmi.so.$version \
       "$out/lib/libzita-alsa-pcmi.so.$version"
 
@@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
     install -Dm755 ../apps/alsa_delay \
       "$out/bin/alsa_delay"
     install -Dm755 ../apps/alsa_loopback \
-      "$out/bin/alsa_delay"
+      "$out/bin/alsa_loopback"
   '';
 
   meta = {
diff --git a/pkgs/development/libraries/audio/zita-convolver/default.nix b/pkgs/development/libraries/audio/zita-convolver/default.nix
index 11a06d4f39ac..4fc5c12ccc4c 100644
--- a/pkgs/development/libraries/audio/zita-convolver/default.nix
+++ b/pkgs/development/libraries/audio/zita-convolver/default.nix
@@ -2,16 +2,16 @@
 
 stdenv.mkDerivation rec {
   name = "zita-convolver-${version}";
-  version = "4.0.0";
+  version = "4.0.3";
   src = fetchurl {
     url = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/${name}.tar.bz2";
-    sha256 = "0fx7f48ls0rlndqrmd4k7ifpnml39yxzc2f0n6xyysypgn06y673";
+    sha256 = "0prji66p86z2bzminywkwchr5bfgxcg2i8y803pydd1hzf2198cs";
   };
 
   buildInputs = [ fftwFloat ];
 
   patchPhase = ''
-    cd libs
+    cd source
     sed -e "s@ldconfig@@" -i Makefile
   '';
 
diff --git a/pkgs/development/libraries/audio/zita-resampler/default.nix b/pkgs/development/libraries/audio/zita-resampler/default.nix
index 00a0a5082137..e9cccab39f02 100644
--- a/pkgs/development/libraries/audio/zita-resampler/default.nix
+++ b/pkgs/development/libraries/audio/zita-resampler/default.nix
@@ -2,10 +2,10 @@
 
 stdenv.mkDerivation rec {
   name = "zita-resampler-${version}";
-  version = "1.6.0";
+  version = "1.6.2";
   src = fetchurl {
     url = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/${name}.tar.bz2";
-    sha256 = "1w48lp99jn4wh687cvbnbnjgaraqzkb4bgir16cp504x55v8v20h";
+    sha256 = "1my5k2dh2dkvjp6xjnf9qy6i7s28z13kw1n9pwa4a2cpwbzawfr3";
   };
 
   makeFlags = [
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   ];
 
   patchPhase = ''
-    cd libs
+    cd source
     sed -e "s@ldconfig@@" -i Makefile
   '';
 
diff --git a/pkgs/development/libraries/babl/default.nix b/pkgs/development/libraries/babl/default.nix
index 1e341d3124b4..027b86a97747 100644
--- a/pkgs/development/libraries/babl/default.nix
+++ b/pkgs/development/libraries/babl/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "babl-0.1.56";
+  name = "babl-0.1.58";
 
   src = fetchurl {
     url = "https://ftp.gtk.org/pub/babl/0.1/${name}.tar.bz2";
-    sha256 = "0a2dvihah1j7qi5dp1qzzlwklcqnndmxsm7lc7i78g7c2yknrlla";
+    sha256 = "0mgdii9v89ay0nra36cz9i0q7cqv8wi8hk01jsc4bf0rc1bsxjbr";
   };
 
   doCheck = true;
diff --git a/pkgs/development/libraries/boehm-gc/7.6.6.nix b/pkgs/development/libraries/boehm-gc/7.6.6.nix
new file mode 100644
index 000000000000..da71e40187f4
--- /dev/null
+++ b/pkgs/development/libraries/boehm-gc/7.6.6.nix
@@ -0,0 +1,74 @@
+{ lib, stdenv, fetchurl, fetchpatch, pkgconfig, libatomic_ops
+, enableLargeConfig ? false # doc: https://github.com/ivmai/bdwgc/blob/v7.6.6/doc/README.macros#L179
+}:
+
+stdenv.mkDerivation rec {
+  name = "boehm-gc-${version}";
+  version = "7.6.6";
+
+  src = fetchurl {
+    urls = [
+      "http://www.hboehm.info/gc/gc_source/gc-${version}.tar.gz"
+      "https://github.com/ivmai/bdwgc/releases/download/v${version}/gc-${version}.tar.gz"
+    ];
+    sha256 = "1p1r015a7jbpvkkbgzv1y8nxrbbp6dg0mq3ksi6ji0qdz3wfss79";
+  };
+
+  buildInputs = [ libatomic_ops ];
+  nativeBuildInputs = [ pkgconfig ];
+
+  outputs = [ "out" "dev" "doc" ];
+  separateDebugInfo = stdenv.isLinux;
+
+  preConfigure = stdenv.lib.optionalString (stdenv.hostPlatform.libc == "musl") ''
+    export NIX_CFLAGS_COMPILE+="-D_GNU_SOURCE -DUSE_MMAP -DHAVE_DL_ITERATE_PHDR"
+  '';
+
+  patches = [ (fetchpatch {
+    url = "https://gitweb.gentoo.org/proj/musl.git/plain/dev-libs/boehm-gc/files/boehm-gc-7.6.0-sys_select.patch";
+    sha256 = "1gydwlklvci30f5dpp5ccw2p2qpph5y41r55wx9idamjlq66fbb3";
+  }) ] ++
+    # https://github.com/ivmai/bdwgc/pull/208
+    lib.optional stdenv.hostPlatform.isRiscV ./riscv.patch;
+
+  configureFlags =
+    [ "--enable-cplusplus" ]
+    ++ lib.optional enableLargeConfig "--enable-large-config"
+    ++ lib.optional (stdenv.hostPlatform.libc == "musl") "--disable-static";
+
+  doCheck = true; # not cross;
+
+  # Don't run the native `strip' when cross-compiling.
+  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "The Boehm-Demers-Weiser conservative garbage collector for C and C++";
+
+    longDescription = ''
+      The Boehm-Demers-Weiser conservative garbage collector can be used as a
+      garbage collecting replacement for C malloc or C++ new.  It allows you
+      to allocate memory basically as you normally would, without explicitly
+      deallocating memory that is no longer useful.  The collector
+      automatically recycles memory when it determines that it can no longer
+      be otherwise accessed.
+
+      The collector is also used by a number of programming language
+      implementations that either use C as intermediate code, want to
+      facilitate easier interoperation with C libraries, or just prefer the
+      simple collector interface.
+
+      Alternatively, the garbage collector may be used as a leak detector for
+      C or C++ programs, though that is not its primary goal.
+    '';
+
+    homepage = http://hboehm.info/gc/;
+
+    # non-copyleft, X11-style license
+    license = http://hboehm.info/gc/license.txt;
+
+    maintainers = [ ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/boehm-gc/default.nix b/pkgs/development/libraries/boehm-gc/default.nix
index da71e40187f4..012c1d123b62 100644
--- a/pkgs/development/libraries/boehm-gc/default.nix
+++ b/pkgs/development/libraries/boehm-gc/default.nix
@@ -4,14 +4,14 @@
 
 stdenv.mkDerivation rec {
   name = "boehm-gc-${version}";
-  version = "7.6.6";
+  version = "7.6.8";
 
   src = fetchurl {
     urls = [
       "http://www.hboehm.info/gc/gc_source/gc-${version}.tar.gz"
       "https://github.com/ivmai/bdwgc/releases/download/v${version}/gc-${version}.tar.gz"
     ];
-    sha256 = "1p1r015a7jbpvkkbgzv1y8nxrbbp6dg0mq3ksi6ji0qdz3wfss79";
+    sha256 = "0n720a0i584ghcwmdsjiq6bl9ig0p9mrja29rp4cgsqvpz6wa2h4";
   };
 
   buildInputs = [ libatomic_ops ];
diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix
index 4131e5f7a27c..c79b874ecb69 100644
--- a/pkgs/development/libraries/boost/generic.nix
+++ b/pkgs/development/libraries/boost/generic.nix
@@ -101,21 +101,17 @@ stdenv.mkDerivation {
 
   inherit src;
 
-  patchFlags = optionalString (stdenv.hostPlatform.libc == "msvcrt") "-p0";
+  patchFlags = "";
+
   patches = patches
-    ++ optional stdenv.isDarwin ./darwin-no-system-python.patch
-    ++ optional (stdenv.hostPlatform.libc == "msvcrt") (fetchurl {
-      url = "https://svn.boost.org/trac/boost/raw-attachment/tickaet/7262/"
-          + "boost-mingw.patch";
-      sha256 = "0s32kwll66k50w6r5np1y5g907b7lcpsjhfgr7rsw7q5syhzddyj";
-    });
+    ++ optional stdenv.isDarwin ./darwin-no-system-python.patch;
 
   meta = {
     homepage = http://boost.org/;
     description = "Collection of C++ libraries";
     license = stdenv.lib.licenses.boost;
 
-    platforms = (if versionOlder version "1.59" then remove "aarch64-linux" else id) platforms.unix;
+    platforms = (if versionOlder version "1.59" then remove "aarch64-linux" else id) (platforms.unix ++ platforms.windows);
     maintainers = with maintainers; [ peti wkennington ];
   };
 
@@ -139,7 +135,8 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  nativeBuildInputs = [ which buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ which ];
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
   buildInputs = [ expat zlib bzip2 libiconv ]
     ++ optional (stdenv.hostPlatform == stdenv.buildPlatform) icu
     ++ optional stdenv.isDarwin fixDarwinDylibNames
@@ -171,7 +168,7 @@ stdenv.mkDerivation {
   postFixup = ''
     # Make boost header paths relative so that they are not runtime dependencies
     cd "$dev" && find include \( -name '*.hpp' -or -name '*.h' -or -name '*.ipp' \) \
-      -exec sed '1i#line 1 "{}"' -i '{}' \;
+      -exec sed '1s/^\xef\xbb\xbf//;1i#line 1 "{}"' -i '{}' \;
   '' + optionalString (stdenv.hostPlatform.libc == "msvcrt") ''
     $RANLIB "$out/lib/"*.a
   '';
diff --git a/pkgs/development/libraries/brigand/default.nix b/pkgs/development/libraries/brigand/default.nix
new file mode 100644
index 000000000000..b4a57396cc8b
--- /dev/null
+++ b/pkgs/development/libraries/brigand/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  name = "brigand-${version}";
+  version = "1.3.0";
+
+  src = fetchFromGitHub {
+    owner = "edouarda";
+    repo = "brigand";
+    rev = "4db9f665b4ece31b51aaf35b499b2c8e5811efa3";
+    sha256 = "14b8r3s24zq0l3addy3irzxs5cyqn3763y5s310lmzzswgj1v7r4";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with stdenv.lib; {
+    description = "Instant compile time C++ 11 metaprogramming library";
+    longDescription = ''
+      Brigand is a light-weight, fully functional, instant-compile time C++ 11 meta-programming library.
+      Everything you were doing with Boost.MPL can be done with Brigand. And if that's not the case, open an issue!'';
+    homepage = https://github.com/edouarda/brigand;
+    license = licenses.boost;
+    maintainers = with maintainers; [ pmiddend ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/c-ares/default.nix b/pkgs/development/libraries/c-ares/default.nix
index 1835356e627d..099d02c82639 100644
--- a/pkgs/development/libraries/c-ares/default.nix
+++ b/pkgs/development/libraries/c-ares/default.nix
@@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "0vnwmbvymw677k780kpb6sb8i3szdp89rzy8mz1fwg1657yw3ls5";
   };
 
+  configureFlags = if stdenv.hostPlatform.isWindows then [ "--disable-shared" "--enable-static" ] else null;
+
   # ares_android.h header is missing
   # see issue https://github.com/c-ares/c-ares/issues/216
   postPatch = if stdenv.hostPlatform.isAndroid then ''
diff --git a/pkgs/development/libraries/caf/default.nix b/pkgs/development/libraries/caf/default.nix
index 397e80961e06..09c1560d6f60 100644
--- a/pkgs/development/libraries/caf/default.nix
+++ b/pkgs/development/libraries/caf/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "actor-framework-${version}";
-  version = "0.15.7";
+  version = "0.16.0";
 
   src = fetchFromGitHub {
     owner = "actor-framework";
     repo = "actor-framework";
     rev = "${version}";
-    sha256 = "0qmb18k162xdvf8z03mybjazkwb2vqda5xd1qh5bwkvxracwq3sb";
+    sha256 = "01i6sclxwa7k91ngi7jw9vlss8wjpv1hz4y5934jq0lx8hdf7s02";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/cairo/default.nix b/pkgs/development/libraries/cairo/default.nix
index db46412ceb55..7c0664533b8f 100644
--- a/pkgs/development/libraries/cairo/default.nix
+++ b/pkgs/development/libraries/cairo/default.nix
@@ -10,14 +10,14 @@
 assert glSupport -> libGL != null;
 
 let
-  version = "1.15.12";
+  version = "1.15.14";
   inherit (stdenv.lib) optional optionals;
 in stdenv.mkDerivation rec {
   name = "cairo-${version}";
 
   src = fetchurl {
     url = "https://cairographics.org/${if stdenv.lib.mod (builtins.fromJSON (stdenv.lib.versions.minor version)) 2 == 0 then "releases" else "snapshots"}/${name}.tar.xz";
-    sha256 = "1jcl0mnqq6j2xip8p506g2cj54sfycm339rrd3p4g2jljhdhh8vn";
+    sha256 = "1399jfdpdhn4hf812hxlj1gyi3bznxwzhp2rnyq1nxjs05n6nmhn";
   };
 
   outputs = [ "out" "dev" "devdoc" ];
diff --git a/pkgs/development/libraries/cl/default.nix b/pkgs/development/libraries/cl/default.nix
index 7cb75d8de0f3..1890d2b25a0d 100644
--- a/pkgs/development/libraries/cl/default.nix
+++ b/pkgs/development/libraries/cl/default.nix
@@ -1,14 +1,14 @@
 {stdenv, fetchFromGitHub, rebar, erlang, opencl-headers, ocl-icd }:
 
 stdenv.mkDerivation rec {
-  version = "1.2.3";
+  version = "1.2.4";
   name = "cl-${version}";
 
   src = fetchFromGitHub {
     owner = "tonyrog";
     repo = "cl";
     rev = "cl-${version}";
-    sha256 = "1dk0k03z0ipxvrnn0kihph135hriw96jpnd31lbq44k6ckh6bm03";
+    sha256 = "1gwkjl305a0231hz3k0w448dsgbgdriaq764sizs5qfn59nzvinz";
   };
 
   buildInputs = [ erlang rebar opencl-headers ocl-icd ];
diff --git a/pkgs/development/libraries/clutter-gst/default.nix b/pkgs/development/libraries/clutter-gst/default.nix
index a06691d5c715..428114986d1b 100644
--- a/pkgs/development/libraries/clutter-gst/default.nix
+++ b/pkgs/development/libraries/clutter-gst/default.nix
@@ -7,7 +7,7 @@ in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "0fnblqm4igdx4rn3681bp1gm1y2i00if3iblhlm0zv6ck9nqlqfq";
   };
 
diff --git a/pkgs/development/libraries/clutter-gtk/default.nix b/pkgs/development/libraries/clutter-gtk/default.nix
index 9759e4904b29..6c8951165313 100644
--- a/pkgs/development/libraries/clutter-gtk/default.nix
+++ b/pkgs/development/libraries/clutter-gtk/default.nix
@@ -10,10 +10,12 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "01ibniy4ich0fgpam53q252idm7f4fn5xg5qvizcfww90gn9652j";
   };
 
+  outputs = [ "out" "dev" ];
+
   propagatedBuildInputs = [ clutter gtk3 ];
   nativeBuildInputs = [ meson ninja pkgconfig gobjectIntrospection ];
 
diff --git a/pkgs/development/libraries/clutter/default.nix b/pkgs/development/libraries/clutter/default.nix
index d8150fd11508..090f85554b66 100644
--- a/pkgs/development/libraries/clutter/default.nix
+++ b/pkgs/development/libraries/clutter/default.nix
@@ -11,10 +11,12 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "0mif1qnrpkgxi43h7pimim6w6zwywa16ixcliw0yjm9hk0a368z7";
   };
 
+  outputs = [ "out" "dev" ];
+
   buildInputs = [ gtk3 ];
   nativeBuildInputs = [ pkgconfig ];
   propagatedBuildInputs =
diff --git a/pkgs/development/libraries/cogl/default.nix b/pkgs/development/libraries/cogl/default.nix
index 085bab6475c2..f35335e4be7b 100644
--- a/pkgs/development/libraries/cogl/default.nix
+++ b/pkgs/development/libraries/cogl/default.nix
@@ -10,7 +10,7 @@ in stdenv.mkDerivation rec {
   version = "1.22.2";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "03f0ha3qk7ca0nnkkcr1garrm1n1vvfqhkz9lwjm592fnv6ii9rr";
   };
 
@@ -31,6 +31,8 @@ in stdenv.mkDerivation rec {
     })
   ];
 
+  outputs = [ "out" "dev" ];
+
   nativeBuildInputs = [ pkgconfig libintl ];
 
   configureFlags = [
diff --git a/pkgs/development/libraries/cpp-hocon/default.nix b/pkgs/development/libraries/cpp-hocon/default.nix
index 1f4b43db16c3..f08077a9a3cf 100644
--- a/pkgs/development/libraries/cpp-hocon/default.nix
+++ b/pkgs/development/libraries/cpp-hocon/default.nix
@@ -2,10 +2,10 @@
 
 stdenv.mkDerivation rec {
   name = "cpp-hocon-${version}";
-  version = "0.1.7";
+  version = "0.2.0";
 
   src = fetchFromGitHub {
-    sha256 = "0mfpz349c3arihvngw1a1gfhwlcw6wiwyc44bghjx1q109w7wm1m";
+    sha256 = "084vsn080z8mp5s54jaq0qdwlx0p62nbw1i0rffkag477h8vq68i";
     rev = version;
     repo = "cpp-hocon";
     owner = "puppetlabs";
diff --git a/pkgs/development/libraries/cyrus-sasl/default.nix b/pkgs/development/libraries/cyrus-sasl/default.nix
index 87752867c350..cec7e1a2d516 100644
--- a/pkgs/development/libraries/cyrus-sasl/default.nix
+++ b/pkgs/development/libraries/cyrus-sasl/default.nix
@@ -36,15 +36,15 @@ stdenv.mkDerivation rec {
 
   configureFlags = [
     "--with-openssl=${openssl.dev}"
+    "--with-plugindir=${placeholder "out"}/lib/sasl2"
+    "--with-saslauthd=/run/saslauthd"
+    "--enable-login"
+    "--enable-shared"
   ] ++ lib.optional enableLdap "--with-ldap=${openldap.dev}";
 
-  # Set this variable at build-time to make sure $out can be evaluated.
-  preConfigure = ''
-    configureFlagsArray=( --with-plugindir=$out/lib/sasl2
-                          --with-saslauthd=/run/saslauthd
-                          --enable-login
-                        )
-  '';
+  # Avoid triggering regenerating using broken autoconf/libtool bits.
+  # (many distributions carry patches to remove/replace, but this works for now)
+  dontUpdateAutotoolsGnuConfigScripts = if stdenv.hostPlatform.isMusl then true else null;
 
   installFlags = lib.optional stdenv.isDarwin [ "framedir=$(out)/Library/Frameworks/SASL2.framework" ];
 
@@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    homepage = http://cyrusimap.web.cmu.edu/;
+    homepage = https://www.cyrusimap.org/sasl;
     description = "Library for adding authentication support to connection-based protocols";
     platforms = platforms.unix;
     license = licenses.bsdOriginal;
diff --git a/pkgs/development/libraries/dbus-sharp-glib/dbus-sharp-glib-1.0.nix b/pkgs/development/libraries/dbus-sharp-glib/dbus-sharp-glib-1.0.nix
index 208288bfca1d..0f897d97467f 100644
--- a/pkgs/development/libraries/dbus-sharp-glib/dbus-sharp-glib-1.0.nix
+++ b/pkgs/development/libraries/dbus-sharp-glib/dbus-sharp-glib-1.0.nix
@@ -20,5 +20,6 @@ stdenv.mkDerivation rec {
   meta = with stdenv.lib; {
     description = "D-Bus for .NET: GLib integration module";
     platforms = platforms.linux;
+    license = licenses.mit;
   };
 }
diff --git a/pkgs/development/libraries/dbus-sharp-glib/default.nix b/pkgs/development/libraries/dbus-sharp-glib/default.nix
index ef1ddd9bfff5..cd020317f4c2 100644
--- a/pkgs/development/libraries/dbus-sharp-glib/default.nix
+++ b/pkgs/development/libraries/dbus-sharp-glib/default.nix
@@ -20,5 +20,6 @@ stdenv.mkDerivation rec {
   meta = with stdenv.lib; {
     description = "D-Bus for .NET: GLib integration module";
     platforms = platforms.linux;
+    license = licenses.mit;
   };
 }
diff --git a/pkgs/development/libraries/dbus-sharp/dbus-sharp-1.0.nix b/pkgs/development/libraries/dbus-sharp/dbus-sharp-1.0.nix
index 013913e52972..18ea3ad3ecb7 100644
--- a/pkgs/development/libraries/dbus-sharp/dbus-sharp-1.0.nix
+++ b/pkgs/development/libraries/dbus-sharp/dbus-sharp-1.0.nix
@@ -20,5 +20,6 @@ stdenv.mkDerivation rec {
   meta = with stdenv.lib; {
     description = "D-Bus for .NET";
     platforms = platforms.linux;
+    license = licenses.mit;
   };
 }
diff --git a/pkgs/development/libraries/dbus-sharp/default.nix b/pkgs/development/libraries/dbus-sharp/default.nix
index 855dd9f3832e..2704ef2de9fd 100644
--- a/pkgs/development/libraries/dbus-sharp/default.nix
+++ b/pkgs/development/libraries/dbus-sharp/default.nix
@@ -23,5 +23,6 @@ stdenv.mkDerivation rec {
   meta = with stdenv.lib; {
     description = "D-Bus for .NET";
     platforms = platforms.linux;
+    license = licenses.mit;
   };
 }
diff --git a/pkgs/development/libraries/dclxvi/default.nix b/pkgs/development/libraries/dclxvi/default.nix
index 47f3794f5ad5..1f8f9a4e69cc 100644
--- a/pkgs/development/libraries/dclxvi/default.nix
+++ b/pkgs/development/libraries/dclxvi/default.nix
@@ -31,5 +31,6 @@ stdenv.mkDerivation {
     description = "Naehrig, Niederhagen and Schwabe's pairings code, massaged into a shared library";
     maintainers = with maintainers; [ wkennington ];
     platforms = platforms.x86_64;
+    license = licenses.publicDomain;
   };
 }
diff --git a/pkgs/development/libraries/eccodes/default.nix b/pkgs/development/libraries/eccodes/default.nix
index 5cd004c8d136..01600f90f284 100644
--- a/pkgs/development/libraries/eccodes/default.nix
+++ b/pkgs/development/libraries/eccodes/default.nix
@@ -6,11 +6,11 @@
 with stdenv.lib; 
 stdenv.mkDerivation rec {
   name = "eccodes-${version}";
-  version = "2.8.2";
+  version = "2.9.0";
 
   src = fetchurl {
-    url = "https://software.ecmwf.int/wiki/download/attachments/45757960/eccodes-${version}-Source.tar.gz";
-    sha256 = "0aki7llrdfj6273yjy8yv0d027sdbv8xs3iv68fb69s0clyygrin";
+    url = "https://confluence.ecmwf.int/download/attachments/45757960/eccodes-${version}-Source.tar.gz";
+    sha256 = "1mh9zkfb5dj3j8fk3gdhz2bp6z13nik5pmynpf5l6qy3lhgyn17z";
   };
 
   nativeBuildInputs = [ cmake ];
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    homepage = https://software.ecmwf.int/wiki/display/ECC/;
+    homepage = https://confluence.ecmwf.int/display/ECC/;
     license = licenses.asl20;
     maintainers = with maintainers; [ knedlsepp ];
     platforms = platforms.unix;
diff --git a/pkgs/development/libraries/enchant/default.nix b/pkgs/development/libraries/enchant/default.nix
index c51475ecc2a9..a9446306d335 100644
--- a/pkgs/development/libraries/enchant/default.nix
+++ b/pkgs/development/libraries/enchant/default.nix
@@ -13,9 +13,10 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ aspell glib hunspell hspell ];
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Generic spell checking library";
     homepage = http://www.abisource.com/enchant;
-    platforms = stdenv.lib.platforms.unix;
+    platforms = platforms.unix;
+    license = licenses.lgpl21;
   };
 }
diff --git a/pkgs/development/libraries/epoxy/default.nix b/pkgs/development/libraries/epoxy/default.nix
index cc62b2776ede..7c3dd19a4795 100644
--- a/pkgs/development/libraries/epoxy/default.nix
+++ b/pkgs/development/libraries/epoxy/default.nix
@@ -6,13 +6,13 @@ with stdenv.lib;
 
 stdenv.mkDerivation rec {
   name = "epoxy-${version}";
-  version = "1.5.1";
+  version = "1.5.2";
 
   src = fetchFromGitHub {
     owner = "anholt";
     repo = "libepoxy";
     rev = "${version}";
-    sha256 = "1811agxr7g9wd832np8sw152j468kg3qydmfkc564v54ncfcgaci";
+    sha256 = "0frs42s7d3ff2wlw0jns6vb3myx2bhz9m5nkzbnfyn436s2qqls3";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/epoxy/libgl-path.patch b/pkgs/development/libraries/epoxy/libgl-path.patch
index 6f50b9d262b5..8f38ee27174b 100644
--- a/pkgs/development/libraries/epoxy/libgl-path.patch
+++ b/pkgs/development/libraries/epoxy/libgl-path.patch
@@ -1,20 +1,11 @@
-From 4046e0ac8ed93354c01de5f3b5cae790cce70404 Mon Sep 17 00:00:00 2001
-From: Will Dietz <w@wdtz.org>
-Date: Thu, 29 Mar 2018 07:21:02 -0500
-Subject: [PATCH] Explicitly search LIBGL_PATH as fallback, if defined.
-
----
- src/dispatch_common.c | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
 diff --git a/src/dispatch_common.c b/src/dispatch_common.c
-index bc2fb94..776237b 100644
+index b3e4f5f..303e8f5 100644
 --- a/src/dispatch_common.c
 +++ b/src/dispatch_common.c
-@@ -306,6 +306,18 @@ get_dlopen_handle(void **handle, const char *lib_name, bool exit_on_fail)
-     pthread_mutex_lock(&api.mutex);
-     if (!*handle) {
-         *handle = dlopen(lib_name, RTLD_LAZY | RTLD_LOCAL);
+@@ -310,6 +310,19 @@ get_dlopen_handle(void **handle, const char *lib_name, bool exit_on_fail, bool l
+             flags |= RTLD_NOLOAD;
+ 
+         *handle = dlopen(lib_name, flags);
 +#ifdef LIBGL_PATH
 +        if (!*handle) {
 +          char pathbuf[sizeof(LIBGL_PATH) + 1 + 1024 + 1];
@@ -24,12 +15,10 @@ index bc2fb94..776237b 100644
 +            fprintf(stderr, "Error prefixing library pathname\n");
 +            exit(1);
 +          }
-+          *handle = dlopen(pathbuf, RTLD_LAZY | RTLD_LOCAL);
++          *handle = dlopen(pathbuf, flags);
 +        }
 +#endif
++
          if (!*handle) {
              if (exit_on_fail) {
                  fprintf(stderr, "Couldn't open %s: %s\n", lib_name, dlerror());
--- 
-2.16.3
-
diff --git a/pkgs/development/libraries/farstream/default.nix b/pkgs/development/libraries/farstream/default.nix
index 020d04542864..924fb52b0900 100644
--- a/pkgs/development/libraries/farstream/default.nix
+++ b/pkgs/development/libraries/farstream/default.nix
@@ -24,10 +24,10 @@ in stdenv.mkDerivation rec {
     gst-plugins-good gst-plugins-bad gst-libav
   ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = https://www.freedesktop.org/wiki/Software/Farstream;
     description = "Audio/Video Communications Framework formely known as farsight";
-    maintainers = [ ];
-    platforms = stdenv.lib.platforms.linux;
+    platforms = platforms.linux;
+    license = licenses.lgpl21;
   };
 }
diff --git a/pkgs/development/libraries/fcppt/default.nix b/pkgs/development/libraries/fcppt/default.nix
index 660cdfa6414b..49e929821f7f 100644
--- a/pkgs/development/libraries/fcppt/default.nix
+++ b/pkgs/development/libraries/fcppt/default.nix
@@ -1,20 +1,20 @@
-{ stdenv, fetchFromGitHub, cmake, boost }:
+{ stdenv, fetchFromGitHub, cmake, boost, brigand }:
 
 stdenv.mkDerivation rec {
   name = "fcppt-${version}";
-  version = "2.5.0";
+  version = "2.9.0";
 
   src = fetchFromGitHub {
     owner = "freundlich";
     repo = "fcppt";
     rev = version;
-    sha256 = "0pjldwwxgnzjfd04cy29a9mn2szq4v2mjnw0367kxd141q2iglqi";
+    sha256 = "0zyqgmi1shjbwin1lx428v7vbi6jnywb1d47dascdn89r5gz6klv";
   };
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ boost ];
 
-  cmakeFlags = [ "-DENABLE_EXAMPLES=false" "-DENABLE_TEST=false" ];
+  cmakeFlags = [ "-DENABLE_EXAMPLES=false" "-DENABLE_TEST=false" "-DBrigand_INCLUDE_DIR=${brigand}/include" ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix
index 7d72de2a2ded..7c3b3447d613 100644
--- a/pkgs/development/libraries/ffmpeg/generic.nix
+++ b/pkgs/development/libraries/ffmpeg/generic.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, pkgconfig, perl, texinfo, yasm
 , alsaLib, bzip2, fontconfig, freetype, gnutls, libiconv, lame, libass, libogg
-, libtheora, libva, libvorbis, libvpx, lzma, libpulseaudio, soxr
-, x264, x265, xvidcore, zlib, libopus
+, libssh, libtheora, libva, libvorbis, libvpx, lzma, libpulseaudio, soxr
+, x264, x265, xvidcore, zlib, libopus, speex
 , openglSupport ? false, libGLU_combined ? null
 # Build options
 , runtimeCpuDetectBuild ? true # Detect CPU capabilities at runtime
@@ -128,6 +128,7 @@ stdenv.mkDerivation rec {
       "--enable-libmp3lame"
       (ifMinVer "1.2" "--enable-iconv")
       "--enable-libtheora"
+      (ifMinVer "2.1" "--enable-libssh")
       (ifMinVer "0.6" (enableFeature vaapiSupport "vaapi"))
       "--enable-vdpau"
       "--enable-libvorbis"
@@ -141,6 +142,7 @@ stdenv.mkDerivation rec {
       "--enable-libxvid"
       "--enable-zlib"
       (ifMinVer "2.8" "--enable-libopus")
+      "--enable-libspeex"
       (ifMinVer "2.8" "--enable-libx265")
     # Developer flags
       (enableFeature debugDeveloper "debug")
@@ -157,8 +159,8 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ perl pkgconfig texinfo yasm ];
 
   buildInputs = [
-    bzip2 fontconfig freetype gnutls libiconv lame libass libogg libtheora
-    libvdpau libvorbis lzma soxr x264 x265 xvidcore zlib libopus
+    bzip2 fontconfig freetype gnutls libiconv lame libass libogg libssh libtheora
+    libvdpau libvorbis lzma soxr x264 x265 xvidcore zlib libopus speex
   ] ++ optional openglSupport libGLU_combined
     ++ optional vpxSupport libvpx
     ++ optionals (!isDarwin && !isAarch32) [ libpulseaudio ] # Need to be fixed on Darwin and ARM
diff --git a/pkgs/development/libraries/fmt/default.nix b/pkgs/development/libraries/fmt/default.nix
new file mode 100644
index 000000000000..c120f7c9b43f
--- /dev/null
+++ b/pkgs/development/libraries/fmt/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub, cmake, enableShared ? true }:
+
+stdenv.mkDerivation rec {
+  version = "5.2.1";
+  name = "fmt-${version}";
+  src = fetchFromGitHub {
+    owner = "fmtlib";
+    repo = "fmt";
+    rev = "${version}";
+    sha256 = "1cd8yq8va457iir1hlf17ksx11fx2hlb8i4jml8gj1875pizm0pk";
+  };
+  nativeBuildInputs = [ cmake ];
+  doCheck = true;
+  # preCheckHook ensures the test binaries can find libfmt.so.5
+  preCheck = if enableShared
+             then "export LD_LIBRARY_PATH=\"$PWD\""
+             else "";
+  cmakeFlags = [ "-DFMT_TEST=yes"
+                 "-DBUILD_SHARED_LIBS=${if enableShared then "ON" else "OFF"}" ];
+  meta = with stdenv.lib; {
+    homepage = http://fmtlib.net/;
+    description = "Small, safe and fast formatting library";
+    longDescription = ''
+      fmt (formerly cppformat) is an open-source formatting library. It can be
+      used as a fast and safe alternative to printf and IOStreams.
+    '';
+    maintainers = [ maintainers.jdehaas ];
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/development/libraries/gdal/default.nix b/pkgs/development/libraries/gdal/default.nix
index f6d8cd6fa4c2..642063220b2c 100644
--- a/pkgs/development/libraries/gdal/default.nix
+++ b/pkgs/development/libraries/gdal/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, fetchpatch, unzip, libjpeg, libtiff, zlib
 , postgresql, mysql, libgeotiff, pythonPackages, proj, geos, openssl
 , libpng, sqlite, libspatialite, poppler, hdf4, qhull, giflib, expat
-, libiconv
+, libiconv, libxml2
 , netcdfSupport ? true, netcdf, hdf5, curl
 }:
 
@@ -9,15 +9,15 @@ with stdenv.lib;
 
 stdenv.mkDerivation rec {
   name = "gdal-${version}";
-  version = "2.3.1";
+  version = "2.3.2";
 
   src = fetchurl {
     url = "https://download.osgeo.org/gdal/${version}/${name}.tar.xz";
-    sha256 = "0nkjnznrp7dr41zsh8j923c9zpc3i5vj3wjfc2df9rrybb22ailw";
+    sha256 = "191jknma0vricrgdcdmwh8588rwly6a77lmynypxdl87i3z7hv9z";
   };
 
   buildInputs = [ unzip libjpeg libtiff libpng proj openssl sqlite
-    libspatialite poppler hdf4 qhull giflib expat ]
+    libspatialite poppler hdf4 qhull giflib expat libxml2 ]
   ++ (with pythonPackages; [ python numpy wrapPython ])
   ++ stdenv.lib.optional stdenv.isDarwin libiconv
   ++ stdenv.lib.optionals netcdfSupport [ netcdf hdf5 curl ];
@@ -38,6 +38,7 @@ stdenv.mkDerivation rec {
     "--with-proj=${proj}" # optional
     "--with-geos=${geos}/bin/geos-config"# optional
     "--with-hdf4=${hdf4.dev}" # optional
+    "--with-xml2=${libxml2.dev}/bin/xml2-config" # optional
     (if netcdfSupport then "--with-netcdf=${netcdf}" else "")
   ];
 
diff --git a/pkgs/development/libraries/gdbm/default.nix b/pkgs/development/libraries/gdbm/default.nix
index 685775e2918d..8d88dc04924b 100644
--- a/pkgs/development/libraries/gdbm/default.nix
+++ b/pkgs/development/libraries/gdbm/default.nix
@@ -1,13 +1,13 @@
 { stdenv, lib, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "gdbm-1.17";
-  # FIXME: remove on update to > 1.17
+  name = "gdbm-1.18";
+  # FIXME: remove on update to > 1.18
   NIX_CFLAGS_COMPILE = if stdenv.cc.isClang then "-Wno-error=return-type" else null;
 
   src = fetchurl {
     url = "mirror://gnu/gdbm/${name}.tar.gz";
-    sha256 = "0zcp2iv5dbab18859a5fvacg8lkp8k4pr9af13kfvami6lpcrn3w";
+    sha256 = "1kimnv12bzjjhaqk4c8w2j6chdj9c6bg21lchaf7abcyfss2r0mq";
   };
 
   doCheck = true; # not cross;
diff --git a/pkgs/development/libraries/gdk-pixbuf/default.nix b/pkgs/development/libraries/gdk-pixbuf/default.nix
index 3fb50e98c1c8..9fece4cb7a54 100644
--- a/pkgs/development/libraries/gdk-pixbuf/default.nix
+++ b/pkgs/development/libraries/gdk-pixbuf/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   # TODO: Change back once tests/bug753605-atsize.jpg is part of the dist tarball
   # src = fetchurl {
-  #   url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
+  #   url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
   #   sha256 = "0d534ysa6n9prd17wwzisq7mj6qkhwh8wcf8qgin1ar3hbs5ry7z";
   # };
   src = fetchFromGitLab {
diff --git a/pkgs/development/libraries/geos/default.nix b/pkgs/development/libraries/geos/default.nix
index c1b4c88aa479..2417af3dbfd8 100644
--- a/pkgs/development/libraries/geos/default.nix
+++ b/pkgs/development/libraries/geos/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, python }:
 
 stdenv.mkDerivation rec {
-  name = "geos-3.6.3";
+  name = "geos-3.7.0";
 
   src = fetchurl {
     url = "https://download.osgeo.org/geos/${name}.tar.bz2";
-    sha256 = "0jrypv61rbyp7vi9qpnnaiigjj8cgdqvyk8ymik8h1ppcw5am7mb";
+    sha256 = "1mrz778m6bd1x9k6sha5kld43kalhq79h2lynlx2jx7xjakl3gsg";
   };
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix
index 4531a5a01d4c..1b2f6bbc2225 100644
--- a/pkgs/development/libraries/gettext/default.nix
+++ b/pkgs/development/libraries/gettext/default.nix
@@ -51,6 +51,7 @@ stdenv.mkDerivation rec {
   gettextNeedsLdflags = stdenv.hostPlatform.libc != "glibc" && !stdenv.hostPlatform.isMusl;
 
   enableParallelBuilding = true;
+  enableParallelChecking = false; # fails sometimes
 
   meta = with lib; {
     description = "Well integrated set of translation tools and documentation";
diff --git a/pkgs/development/libraries/giflib/libungif.nix b/pkgs/development/libraries/giflib/libungif.nix
index 357ca751ccf1..6336d30aebad 100644
--- a/pkgs/development/libraries/giflib/libungif.nix
+++ b/pkgs/development/libraries/giflib/libungif.nix
@@ -9,7 +9,9 @@ stdenv.mkDerivation {
 
   hardeningDisable = [ "format" ];
 
-  meta = {
-    platforms = stdenv.lib.platforms.unix;
+  meta = with stdenv.lib; {
+    description = "Library and utilities for processing GIFs";
+    platforms = platforms.unix;
+    license = licenses.mit;
   };
 }
diff --git a/pkgs/development/libraries/git2/0.27.nix b/pkgs/development/libraries/git2/0.27.nix
index bafd6be37df6..db627449e1ba 100644
--- a/pkgs/development/libraries/git2/0.27.nix
+++ b/pkgs/development/libraries/git2/0.27.nix
@@ -4,14 +4,14 @@
 }:
 
 stdenv.mkDerivation rec {
-  version = "0.27.4";
+  version = "0.27.5";
   name = "libgit2-${version}";
 
   src = fetchFromGitHub {
     owner = "libgit2";
     repo = "libgit2";
     rev = "v${version}";
-    sha256 = "1cmc8ldhpyp62pswb7dmjjya3ng0ssaggcsxs1labvp6xyxjvp6s";
+    sha256 = "1f6jxgw4pf6jln439v1pj8a0kgym5sq5xry8x0gq18dr5gv3wims";
   };
 
   cmakeFlags = [ "-DTHREADSAFE=ON" ];
diff --git a/pkgs/development/libraries/glib-networking/default.nix b/pkgs/development/libraries/glib-networking/default.nix
index 3deaf28373dd..4ac6e87b9dd7 100644
--- a/pkgs/development/libraries/glib-networking/default.nix
+++ b/pkgs/development/libraries/glib-networking/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "14vw8xwajd7m31bpavg2psk693plhjikwpk8bzf3jl1fmsy11za7";
   };
 
diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix
index f03ddfc48b2e..508a012c6900 100644
--- a/pkgs/development/libraries/glib/default.nix
+++ b/pkgs/development/libraries/glib/default.nix
@@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
   name = "glib-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/glib/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/glib/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "1iqgi90fmpl3l23jm2iv44qp7hqsxvnv7978s18933bvx4bnxvzc";
   };
 
diff --git a/pkgs/development/libraries/gmm/default.nix b/pkgs/development/libraries/gmm/default.nix
index 7f8a2276ef25..6423e1fce981 100644
--- a/pkgs/development/libraries/gmm/default.nix
+++ b/pkgs/development/libraries/gmm/default.nix
@@ -2,16 +2,16 @@
 
 stdenv.mkDerivation rec {
   name = "gmm-${version}";
-  version = "5.1";
+  version = "5.3";
 
   src = fetchurl {
-    url ="http://download.gna.org/getfem/stable/${name}.tar.gz";
-    sha256 = "0di68vdn34kznf96rnwrpb3bbm3ahaczwxd306s9dx41kcqbzrlh";
+    url = "mirror://savannah/getfem/stable/${name}.tar.gz";
+    sha256 = "0lkjd3n0298w1dli446z320sn7mqdap8h9q31nydkbw2k7b4db46";
   };
 
   meta = with stdenv.lib; {
     description = "Generic C++ template library for sparse, dense and skyline matrices";
-    homepage = http://home.gna.org/getfem/gmm_intro.html;
+    homepage = http://getfem.org/gmm.html;
     license = licenses.lgpl21Plus;
     platforms = platforms.unix;
   };
diff --git a/pkgs/development/libraries/gobject-introspection/default.nix b/pkgs/development/libraries/gobject-introspection/default.nix
index f5ab5005bad4..482710f18df5 100644
--- a/pkgs/development/libraries/gobject-introspection/default.nix
+++ b/pkgs/development/libraries/gobject-introspection/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "1y50pbn5qqbcv2h9rkz96wvv5jls2gma9bkqjq6wapmaszx5jw0d";
   };
 
@@ -63,6 +63,7 @@ stdenv.mkDerivation rec {
     homepage    = http://live.gnome.org/GObjectIntrospection;
     maintainers = with maintainers; [ lovek323 lethalman ];
     platforms   = platforms.unix;
+    license = with licenses; [ gpl2 lgpl2 ];
 
     longDescription = ''
       GObject introspection is a middleware layer between C libraries (using
diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix
index 71fe23ea6b0d..44086538cd04 100644
--- a/pkgs/development/libraries/gpgme/default.nix
+++ b/pkgs/development/libraries/gpgme/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl, libgpgerror, gnupg, pkgconfig, glib, pth, libassuan
-, file, which
+, file, which, ncurses
 , autoreconfHook
 , git
-, texinfo5
+, texinfo
 , qtbase ? null
-, withPython ? false, swig2 ? null, python ? null
+, pythonSupport ? false, swig2 ? null, python ? null
 }:
 
 let
@@ -14,11 +14,11 @@ in
 
 stdenv.mkDerivation rec {
   name = "gpgme-${version}";
-  version = "1.11.1";
+  version = "1.12.0";
 
   src = fetchurl {
     url = "mirror://gnupg/gpgme/${name}.tar.bz2";
-    sha256 = "0vxx5xaag3rhp4g2arp5qm77gvz4kj0m3hnpvhkdvqyjfhbi26rd";
+    sha256 = "1n4c1q2ls7sqx1vpr3p5n8vbjkw6kqp8jxqa28p0x9j36wf9bp5l";
   };
 
   outputs = [ "out" "dev" "info" ];
@@ -28,8 +28,8 @@ stdenv.mkDerivation rec {
     [ libgpgerror glib libassuan pth ]
     ++ lib.optional (qtbase != null) qtbase;
 
-  nativeBuildInputs = [ file pkgconfig gnupg autoreconfHook git texinfo5 ]
-  ++ lib.optionals withPython [ python swig2 which ];
+  nativeBuildInputs = [ file pkgconfig gnupg autoreconfHook git texinfo ]
+  ++ lib.optionals pythonSupport [ python swig2 which ncurses ];
 
   postPatch =''
     substituteInPlace ./configure --replace /usr/bin/file ${file}/bin/file
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--enable-fixed-path=${gnupg}/bin"
     "--with-libgpg-error-prefix=${libgpgerror.dev}"
-  ] ++ lib.optional withPython "--enable-languages=python";
+  ] ++ lib.optional pythonSupport "--enable-languages=python";
 
   NIX_CFLAGS_COMPILE =
     # qgpgme uses Q_ASSERT which retains build inputs at runtime unless
@@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
 
   checkInputs = [ which ];
 
-  doCheck = false; # fails 8 out of 26 tests with "GPGME: Decryption failed". Spooky!
+  doCheck = true;
 
   meta = with stdenv.lib; {
     homepage = https://gnupg.org/software/gpgme/index.html;
diff --git a/pkgs/development/libraries/grantlee/5/default.nix b/pkgs/development/libraries/grantlee/5/default.nix
index aa670cd4c86b..52c087b19147 100644
--- a/pkgs/development/libraries/grantlee/5/default.nix
+++ b/pkgs/development/libraries/grantlee/5/default.nix
@@ -46,6 +46,7 @@ mkDerivation rec {
 
     homepage = http://gitorious.org/grantlee;
     maintainers = [ maintainers.ttuegel ];
+    license = licenses.lgpl21;
     inherit (qtbase.meta) platforms;
   };
 }
diff --git a/pkgs/development/libraries/grantlee/default.nix b/pkgs/development/libraries/grantlee/default.nix
index 9dde67b5c795..1446e339745e 100644
--- a/pkgs/development/libraries/grantlee/default.nix
+++ b/pkgs/development/libraries/grantlee/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
       and the design of Django is reused in Grantlee.'';
 
     homepage = http://gitorious.org/grantlee;
-    maintainers = [ ];
+    license = stdenv.lib.licenses.lgpl21;
     inherit (qt4.meta) platforms;
   };
 }
diff --git a/pkgs/development/libraries/gspell/default.nix b/pkgs/development/libraries/gspell/default.nix
index 051228aeb152..0145272c2819 100644
--- a/pkgs/development/libraries/gspell/default.nix
+++ b/pkgs/development/libraries/gspell/default.nix
@@ -10,7 +10,7 @@ in stdenv.mkDerivation rec {
   outputBin = "dev";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "1rdv873ixhwr15jwgc2z6k6y0hj353fqnwsy7zkh0c30qwiiv6l1";
   };
 
diff --git a/pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix b/pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix
index a9e7f9fcff3e..a099643061a1 100644
--- a/pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix
+++ b/pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix
@@ -25,7 +25,8 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = "-DUSE_QT_PLUGIN_DIR=OFF -DUSE_GST_PLUGIN_DIR=OFF";
 
-  meta = {
-    platforms = stdenv.lib.platforms.linux;
+  meta = with stdenv.lib; {
+    platforms = platforms.linux;
+    license = licenses.lgpl21;
   };
 }
diff --git a/pkgs/development/libraries/gtk+/3.x.nix b/pkgs/development/libraries/gtk+/3.x.nix
index 27052d1922f6..015843c05393 100644
--- a/pkgs/development/libraries/gtk+/3.x.nix
+++ b/pkgs/development/libraries/gtk+/3.x.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   name = "gtk+3-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/gtk+/${gnome3.versionBranch version}/gtk+-${version}.tar.xz";
+    url = "mirror://gnome/sources/gtk+/${stdenv.lib.versions.majorMinor version}/gtk+-${version}.tar.xz";
     sha256 = "0rv5k8fyi2i19k4zncai6vf429s6zy3kncr8vb6f3m034z0sb951";
   };
 
diff --git a/pkgs/development/libraries/gtk-sharp-beans/default.nix b/pkgs/development/libraries/gtk-sharp-beans/default.nix
index b92bbf64514e..7f35f088da2b 100644
--- a/pkgs/development/libraries/gtk-sharp-beans/default.nix
+++ b/pkgs/development/libraries/gtk-sharp-beans/default.nix
@@ -18,7 +18,8 @@ stdenv.mkDerivation rec {
   dontStrip = true;
 
   meta = with stdenv.lib; {
-    description = "gtk-sharp-beans binds some API from Gtk+ that isn't in Gtk# 2.12.x";
+    description = "Binds some API from Gtk+ that isn't in Gtk# 2.12.x";
     platforms = platforms.linux;
+    license = licenses.lgpl21;
   };
 }
diff --git a/pkgs/development/libraries/gtk-sharp/2.0.nix b/pkgs/development/libraries/gtk-sharp/2.0.nix
index 5b3ca828a3f8..c037db97c044 100644
--- a/pkgs/development/libraries/gtk-sharp/2.0.nix
+++ b/pkgs/development/libraries/gtk-sharp/2.0.nix
@@ -46,7 +46,10 @@ stdenv.mkDerivation {
     gtk = gtk2;
   };
 
-  meta = {
-    platforms = stdenv.lib.platforms.linux;
+  meta = with stdenv.lib; {
+    description = "Graphical User Interface Toolkit for mono and .Net";
+    homepage = https://www.mono-project.com/docs/gui/gtksharp;
+    platforms = platforms.linux;
+    license = licenses.gpl2;
   };
 }
diff --git a/pkgs/development/libraries/gtksourceview/3.x.nix b/pkgs/development/libraries/gtksourceview/3.x.nix
index fe81c97ab6eb..9e1bc5363a1f 100644
--- a/pkgs/development/libraries/gtksourceview/3.x.nix
+++ b/pkgs/development/libraries/gtksourceview/3.x.nix
@@ -8,7 +8,7 @@ in stdenv.mkDerivation rec {
   version = "3.24.6";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/gtksourceview/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/gtksourceview/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "7aa6bdfebcdc73a763dddeaa42f190c40835e6f8495bb9eb8f78587e2577c188";
   };
 
diff --git a/pkgs/development/libraries/gtksourceview/4.x.nix b/pkgs/development/libraries/gtksourceview/4.x.nix
index 2501e0253b39..7cd9de4b06b1 100644
--- a/pkgs/development/libraries/gtksourceview/4.x.nix
+++ b/pkgs/development/libraries/gtksourceview/4.x.nix
@@ -8,7 +8,7 @@ in stdenv.mkDerivation rec {
   version = "4.0.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/gtksourceview/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/gtksourceview/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "0amkspjsvxr3rjznmnwjwsgw030hayf6bw49ya4nligslwl7lp3f";
   };
 
diff --git a/pkgs/development/libraries/gtkspell/default.nix b/pkgs/development/libraries/gtkspell/default.nix
index 22094f3a3f64..14676be0dcb9 100644
--- a/pkgs/development/libraries/gtkspell/default.nix
+++ b/pkgs/development/libraries/gtkspell/default.nix
@@ -2,16 +2,19 @@
 
 stdenv.mkDerivation {
   name = "gtkspell-2.0.16";
-  
+
   src = fetchurl {
     url = mirror://sourceforge/gtkspell/gtkspell-2.0.16.tar.gz;
     sha256 = "00hdv28bp72kg1mq2jdz1sdw2b8mb9iclsp7jdqwpck705bdriwg";
   };
-  
+
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [aspell gtk2 enchant intltool];
 
-  meta = {
-    platforms = stdenv.lib.platforms.unix;
+  meta = with stdenv.lib; {
+    description = "Word-processor-style highlighting and replacement of misspelled words";
+    homepage = http://gtkspell.sourceforge.net;
+    platforms = platforms.unix;
+    license = licenses.gpl2;
   };
 }
diff --git a/pkgs/development/libraries/gvfs/default.nix b/pkgs/development/libraries/gvfs/default.nix
index 360c1fb41f4e..6bcf72b8a7e6 100644
--- a/pkgs/development/libraries/gvfs/default.nix
+++ b/pkgs/development/libraries/gvfs/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "1xq105596sk9yram5a143b369wpaiiwc9gz86n0j1kfr7nipkqn4";
   };
 
diff --git a/pkgs/development/libraries/harfbuzz/default.nix b/pkgs/development/libraries/harfbuzz/default.nix
index 383f7f60f9bf..130bc6f97bf0 100644
--- a/pkgs/development/libraries/harfbuzz/default.nix
+++ b/pkgs/development/libraries/harfbuzz/default.nix
@@ -8,7 +8,7 @@
 }:
 
 let
-  version = "1.8.8";
+  version = "1.9.0";
   inherit (stdenv.lib) optional optionals optionalString;
 in
 
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-${version}.tar.bz2";
-    sha256 = "1ag3scnm1fcviqgx2p4858y433mr0ndqw6zccnccrqcr9mpcird8";
+    sha256 = "004b4j812wgfv8pmcypyrlwrjfa6149lwpz5df6rnm5cy0msdv0i";
   };
 
   postPatch = ''
@@ -63,6 +63,7 @@ stdenv.mkDerivation {
     homepage = http://www.freedesktop.org/wiki/Software/HarfBuzz;
     downloadPage = "https://www.freedesktop.org/software/harfbuzz/release/";
     maintainers = [ maintainers.eelco ];
+    license = licenses.mit;
     platforms = with platforms; linux ++ darwin;
     inherit version;
     updateWalker = true;
diff --git a/pkgs/development/libraries/hiredis/default.nix b/pkgs/development/libraries/hiredis/default.nix
index 7ff8ed61cab3..0f68d7df2981 100644
--- a/pkgs/development/libraries/hiredis/default.nix
+++ b/pkgs/development/libraries/hiredis/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "hiredis-${version}";
-  version = "0.13.3";
+  version = "0.14.0";
 
   src = fetchFromGitHub {
     owner = "redis";
     repo = "hiredis";
     rev = "v${version}";
-    sha256 = "1qxiv61bsp6s847hhkxqj7vnbdlac089r2qdp3zgxhhckaflhb7r";
+    sha256 = "0ik38lwpmm780jqrry95ckf6flmvd172444p3q8d1k9n99jwij9c";
   };
 
   PREFIX = "\${out}";
diff --git a/pkgs/development/libraries/hspell/default.nix b/pkgs/development/libraries/hspell/default.nix
index 20dda589b9cc..32743e617970 100644
--- a/pkgs/development/libraries/hspell/default.nix
+++ b/pkgs/development/libraries/hspell/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     version = "1.1";
   };
 
-  PERL_USE_UNSAFE_INC = stdenv.lib.optionalString (stdenv.lib.versionAtLeast (stdenv.lib.getVersion perl) "5.26") "1";
+  PERL_USE_UNSAFE_INC = "1";
 
   src = fetchurl {
     url = "${meta.homepage}${name}.tar.gz";
@@ -18,10 +18,10 @@ stdenv.mkDerivation rec {
   patchPhase = ''patchShebangs .'';
   buildInputs = [ perl zlib ];
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Hebrew spell checker";
     homepage = http://hspell.ivrix.org.il/;
-    platforms = stdenv.lib.platforms.all;
-    maintainers = [ ];
+    platforms = platforms.all;
+    license = licenses.gpl2;
   };
 }
diff --git a/pkgs/development/libraries/hunspell/default.nix b/pkgs/development/libraries/hunspell/default.nix
index b3914a4438b3..62c3d79cf9a1 100644
--- a/pkgs/development/libraries/hunspell/default.nix
+++ b/pkgs/development/libraries/hunspell/default.nix
@@ -48,6 +48,7 @@ stdenv.mkDerivation rec {
         * Delphi, Java (JNA, JNI), Perl, .NET, Python, Ruby ([1], [2]), UNO.
     '';
     platforms = platforms.all;
+    license = with licenses; [ gpl2 lgpl21 mpl11 ];
     maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
   };
 }
diff --git a/pkgs/development/libraries/hwloc/default.nix b/pkgs/development/libraries/hwloc/default.nix
index 90a16bcf7f94..8f38170d87e4 100644
--- a/pkgs/development/libraries/hwloc/default.nix
+++ b/pkgs/development/libraries/hwloc/default.nix
@@ -7,15 +7,16 @@ assert x11Support -> libX11 != null && cairo != null;
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
-  name = "hwloc-1.11.10";
+  name = "hwloc-2.0.2";
 
   src = fetchurl {
-    url = "http://www.open-mpi.org/software/hwloc/v1.11/downloads/${name}.tar.bz2";
-    sha256 = "1ryibcng40xcq22lsj85fn2vcvrksdx9rr3wwxpq8dw37lw0is1b";
+    url = "http://www.open-mpi.org/software/hwloc/v2.0/downloads/${name}.tar.bz2";
+    sha256 = "1phc863d5b2fvwpyyq4mlh4rkjdslh6h0h197zmyk3prwrq7si8l";
   };
 
   configureFlags = [
     "--localstatedir=/var"
+    "--enable-netloc"
   ];
 
   # XXX: libX11 is not directly needed, but needed as a propagated dep of Cairo.
@@ -75,7 +76,7 @@ stdenv.mkDerivation rec {
     # http://www.open-mpi.org/projects/hwloc/license.php
     license = licenses.bsd3;
     homepage = https://www.open-mpi.org/projects/hwloc/;
-    maintainers = with maintainers; [ fpletz ];
+    maintainers = with maintainers; [ fpletz markuskowa ];
     platforms = platforms.all;
   };
 }
diff --git a/pkgs/development/libraries/hyena/default.nix b/pkgs/development/libraries/hyena/default.nix
index f99aa0b6f0cf..516e4184623a 100644
--- a/pkgs/development/libraries/hyena/default.nix
+++ b/pkgs/development/libraries/hyena/default.nix
@@ -36,5 +36,6 @@ stdenv.mkDerivation rec {
     '';
     platforms = platforms.all;
     maintainers = with maintainers; [ obadz ];
+    license = licenses.mit;
   };
 }
diff --git a/pkgs/development/libraries/id3lib/default.nix b/pkgs/development/libraries/id3lib/default.nix
index dda1435c1dac..ddce76b10f72 100644
--- a/pkgs/development/libraries/id3lib/default.nix
+++ b/pkgs/development/libraries/id3lib/default.nix
@@ -17,7 +17,10 @@ stdenv.mkDerivation {
 
   doCheck = false; # fails to compile
 
-  meta = {
-    platforms = stdenv.lib.platforms.unix;
+  meta = with stdenv.lib; {
+    description = "Library for reading, writing, and manipulating ID3v1 and ID3v2 tags";
+    homepage = http://id3lib.sourceforge.net;
+    platforms = platforms.unix;
+    license = licenses.lgpl2;
   };
 }
diff --git a/pkgs/development/libraries/java/commons/compress/default.nix b/pkgs/development/libraries/java/commons/compress/default.nix
index cf9c554d57f4..3c729f42320a 100644
--- a/pkgs/development/libraries/java/commons/compress/default.nix
+++ b/pkgs/development/libraries/java/commons/compress/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  version = "1.17";
+  version = "1.18";
   name    = "commons-compress-${version}";
 
   src = fetchurl {
     url    = "mirror://apache/commons/compress/binaries/${name}-bin.tar.gz";
-    sha256 = "1ydm6mhy0kja47mns674iyrhz5mqlhhnh2l8rglzxnq5iawpi2m0";
+    sha256 = "0ciwzq134rqh1fp7qba091rajf2pdagfb665rarni7glb2x4lha1";
   };
 
   installPhase = ''
diff --git a/pkgs/development/libraries/java/commons/math/default.nix b/pkgs/development/libraries/java/commons/math/default.nix
index d43dcd2a91d5..10c39f037890 100644
--- a/pkgs/development/libraries/java/commons/math/default.nix
+++ b/pkgs/development/libraries/java/commons/math/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  version = "3.3";
+  version = "3.6.1";
   name    = "commons-math-${version}";
 
   src = fetchurl {
     url    = "mirror://apache/commons/math/binaries/commons-math3-${version}-bin.tar.gz";
-    sha256 = "1xs71c4vbai6zr84982g4ggv6c18dhkilkzw9n1irjqnjbgm5kzc";
+    sha256 = "0x4nx5pngv2n4ga11c1s4w2mf6cwydwkgs7da6wwvcjraw57bhkz";
   };
 
   installPhase = ''
diff --git a/pkgs/development/libraries/leatherman/default.nix b/pkgs/development/libraries/leatherman/default.nix
index b01d902fd91a..259975815d8e 100644
--- a/pkgs/development/libraries/leatherman/default.nix
+++ b/pkgs/development/libraries/leatherman/default.nix
@@ -2,10 +2,10 @@
 
 stdenv.mkDerivation rec {
   name = "leatherman-${version}";
-  version = "1.5.0";
+  version = "1.5.2";
 
   src = fetchFromGitHub {
-    sha256 = "1plx111mfci8z33mwy56y54n597gi8965s7bmnribkk8bvdn10dy";
+    sha256 = "0drn8wdl4mwqz84lwc7cjmc6pxj2jwpx7n2dxwzwj43ps624zhbj";
     rev = version;
     repo = "leatherman";
     owner = "puppetlabs";
diff --git a/pkgs/development/libraries/lesstif/default.nix b/pkgs/development/libraries/lesstif/default.nix
index 04e8eab4d287..b678a0893867 100644
--- a/pkgs/development/libraries/lesstif/default.nix
+++ b/pkgs/development/libraries/lesstif/default.nix
@@ -14,12 +14,15 @@ stdenv.mkDerivation rec {
   # in Debian, so we assume they have been sent upstream.
   #
   patches = [
-    ./c-missing_xm_h.patch        
-    ./c-render_table_crash.patch 
+    ./c-missing_xm_h.patch
+    ./c-render_table_crash.patch
     ./c-xpmpipethrough.patch
     ];
 
-  meta = {
-    platforms = stdenv.lib.platforms.unix;
+  meta = with stdenv.lib; {
+    description = "An open source clone of the Motif widget set";
+    homepage = http://lesstif.sourceforge.net;
+    platforms = platforms.unix;
+    license = with licenses; [ gpl2 lgpl2 ];
   };
 }
diff --git a/pkgs/development/libraries/libHX/default.nix b/pkgs/development/libraries/libHX/default.nix
index 7de72ed73a65..39f493d821c3 100644
--- a/pkgs/development/libraries/libHX/default.nix
+++ b/pkgs/development/libraries/libHX/default.nix
@@ -16,14 +16,15 @@ stdenv.mkDerivation rec {
     sh autogen.sh
     '';
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://libhx.sourceforge.net/;
     longDescription = ''
       libHX is a C library (with some C++ bindings available) that provides data structures
       and functions commonly needed, such as maps, deques, linked lists, string formatting
       and autoresizing, option and config file parsing, type checking casts and more.
       '';
-    maintainers = [ stdenv.lib.maintainers.tstrobel ];
-    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ maintainers.tstrobel ];
+    platforms = platforms.linux;
+    license = with licenses; [ gpl3 lgpl21Plus wtfpl ];
   };
 }
diff --git a/pkgs/development/libraries/libaccounts-glib/default.nix b/pkgs/development/libraries/libaccounts-glib/default.nix
index 4bb806b91d8a..16e9f213ed48 100644
--- a/pkgs/development/libraries/libaccounts-glib/default.nix
+++ b/pkgs/development/libraries/libaccounts-glib/default.nix
@@ -25,7 +25,9 @@ stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; # since glib-2.46
 
-  meta = {
-    platforms = stdenv.lib.platforms.linux;
+  meta = with stdenv.lib; {
+    description = "Library for managing accounts which can be used from GLib applications";
+    platforms = platforms.linux;
+    license = licenses.lgpl21;
   };
 }
diff --git a/pkgs/development/libraries/libaom/default.nix b/pkgs/development/libraries/libaom/default.nix
index b94c845479aa..a08a1e335232 100644
--- a/pkgs/development/libraries/libaom/default.nix
+++ b/pkgs/development/libraries/libaom/default.nix
@@ -18,5 +18,6 @@ stdenv.mkDerivation rec {
     homepage    = https://aomedia.org/av1-features/get-started/;
     maintainers = with maintainers; [ kiloreux ];
     platforms   = platforms.all;
+    license = licenses.bsd2;
   };
 }
diff --git a/pkgs/development/libraries/libatomic_ops/default.nix b/pkgs/development/libraries/libatomic_ops/default.nix
index 0c0fc3861c9e..a887384f94da 100644
--- a/pkgs/development/libraries/libatomic_ops/default.nix
+++ b/pkgs/development/libraries/libatomic_ops/default.nix
@@ -2,14 +2,14 @@
 
 stdenv.mkDerivation rec {
   name = "libatomic_ops-${version}";
-  version = "7.6.4";
+  version = "7.6.6";
 
   src = fetchurl {
     urls = [
       "http://www.ivmaisoft.com/_bin/atomic_ops/libatomic_ops-${version}.tar.gz"
       "https://github.com/ivmai/libatomic_ops/releases/download/v${version}/libatomic_ops-${version}.tar.gz"
     ];
-    sha256 = "0knxncsjhbknlyy6lx7ycxhpzfk3sykhvicgxyp0rmsxd1d3v0jv";
+    sha256 = "0x7071z707msvyrv9dmgahd1sghbkw8fpbagvcag6xs8yp2spzlr";
   };
 
   outputs = [ "out" "dev" "doc" ];
diff --git a/pkgs/development/libraries/libbap/default.nix b/pkgs/development/libraries/libbap/default.nix
index 54fb89df0451..5153b63e91c5 100644
--- a/pkgs/development/libraries/libbap/default.nix
+++ b/pkgs/development/libraries/libbap/default.nix
@@ -20,10 +20,11 @@ stdenv.mkDerivation rec {
     mkdir -p $out/include
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = https://github.com/binaryanalysisplatform/bap-bindings;
     description = "A C library for interacting with BAP";
-    maintainers = [ stdenv.lib.maintainers.maurer ];
-    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ maintainers.maurer ];
+    platforms = platforms.unix;
+    license = licenses.mit;
   };
 }
diff --git a/pkgs/development/libraries/libblockdev/default.nix b/pkgs/development/libraries/libblockdev/default.nix
index 585f6f18bbab..b99a3c7059aa 100644
--- a/pkgs/development/libraries/libblockdev/default.nix
+++ b/pkgs/development/libraries/libblockdev/default.nix
@@ -4,7 +4,7 @@
 }:
 
 let
-  version = "2.19";
+  version = "2.20";
 in stdenv.mkDerivation rec {
   name = "libblockdev-${version}";
 
@@ -12,7 +12,7 @@ in stdenv.mkDerivation rec {
     owner = "storaged-project";
     repo = "libblockdev";
     rev = "${version}-1";
-    sha256 = "1ny31vaarzbpw0h863p2r5cvjsfs77d33nnisf8bhjc6ps6js3ys";
+    sha256 = "13xy8vx2dnnxczpnwapchc5ncigcxb2fhpmrmglbpkjqmhn2zbdj";
   };
 
   outputs = [ "out" "dev" "devdoc" ];
diff --git a/pkgs/development/libraries/libbsd/cdefs.patch b/pkgs/development/libraries/libbsd/cdefs.patch
deleted file mode 100644
index 81822654aeb4..000000000000
--- a/pkgs/development/libraries/libbsd/cdefs.patch
+++ /dev/null
@@ -1,222 +0,0 @@
-From 11ec8f1e5dfa1c10e0c9fb94879b6f5b96ba52dd Mon Sep 17 00:00:00 2001
-From: Guillem Jover <guillem@hadrons.org>
-Date: Tue, 6 Mar 2018 01:41:35 +0100
-Subject: Handle systems missing <sys/cdefs.h>
-
-This is a non-portable header, and we cannot expect it to be provided by
-the system libc (e.g. musl). We just need and rely on declaration that
-we have defined ourselves in our own <bsd/sys/cdefs.h>. So we switch to
-only ever assume that.
-
-Fixes: https://bugs.freedesktop.org/105281
----
- include/bsd/libutil.h        | 4 ++++
- include/bsd/md5.h            | 4 ++++
- include/bsd/nlist.h          | 4 ++++
- include/bsd/readpassphrase.h | 4 ++++
- include/bsd/stdlib.h         | 4 ++++
- include/bsd/string.h         | 4 ++++
- include/bsd/stringlist.h     | 5 +++++
- include/bsd/sys/queue.h      | 4 ++++
- include/bsd/sys/tree.h       | 4 ++++
- include/bsd/timeconv.h       | 4 ++++
- include/bsd/vis.h            | 4 ++++
- include/bsd/wchar.h          | 4 ++++
- 12 files changed, 49 insertions(+)
-
-diff --git a/include/bsd/libutil.h b/include/bsd/libutil.h
-index 45b3b15..ccca29a 100644
---- a/include/bsd/libutil.h
-+++ b/include/bsd/libutil.h
-@@ -40,7 +40,11 @@
- #define LIBBSD_LIBUTIL_H
- 
- #include <features.h>
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- #include <sys/types.h>
- #include <stdint.h>
- #include <stdio.h>
-diff --git a/include/bsd/md5.h b/include/bsd/md5.h
-index 5f3ae46..bf36a30 100644
---- a/include/bsd/md5.h
-+++ b/include/bsd/md5.h
-@@ -27,7 +27,11 @@ typedef struct MD5Context {
- 	uint8_t buffer[MD5_BLOCK_LENGTH];	/* input buffer */
- } MD5_CTX;
- 
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- #include <sys/types.h>
- 
- __BEGIN_DECLS
-diff --git a/include/bsd/nlist.h b/include/bsd/nlist.h
-index cb297e8..8767117 100644
---- a/include/bsd/nlist.h
-+++ b/include/bsd/nlist.h
-@@ -27,7 +27,11 @@
- #ifndef LIBBSD_NLIST_H
- #define LIBBSD_NLIST_H
- 
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- 
- struct nlist {
- 	union {
-diff --git a/include/bsd/readpassphrase.h b/include/bsd/readpassphrase.h
-index 14744b8..5eb8021 100644
---- a/include/bsd/readpassphrase.h
-+++ b/include/bsd/readpassphrase.h
-@@ -31,7 +31,11 @@
- #define RPP_SEVENBIT    0x10		/* Strip the high bit from input. */
- #define RPP_STDIN       0x20		/* Read from stdin, not /dev/tty */
- 
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- #include <sys/types.h>
- 
- __BEGIN_DECLS
-diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h
-index ebc9638..8d33d1f 100644
---- a/include/bsd/stdlib.h
-+++ b/include/bsd/stdlib.h
-@@ -42,7 +42,11 @@
- #ifndef LIBBSD_STDLIB_H
- #define LIBBSD_STDLIB_H
- 
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- #include <sys/stat.h>
- #include <stdint.h>
- 
-diff --git a/include/bsd/string.h b/include/bsd/string.h
-index 6798bf6..29097f6 100644
---- a/include/bsd/string.h
-+++ b/include/bsd/string.h
-@@ -33,7 +33,11 @@
- #ifndef LIBBSD_STRING_H
- #define LIBBSD_STRING_H
- 
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- #include <sys/types.h>
- 
- __BEGIN_DECLS
-diff --git a/include/bsd/stringlist.h b/include/bsd/stringlist.h
-index ff30cac..dd71496 100644
---- a/include/bsd/stringlist.h
-+++ b/include/bsd/stringlist.h
-@@ -31,7 +31,12 @@
- 
- #ifndef LIBBSD_STRINGLIST_H
- #define LIBBSD_STRINGLIST_H
-+
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- #include <sys/types.h>
- 
- /*
-diff --git a/include/bsd/sys/queue.h b/include/bsd/sys/queue.h
-index 4a94ea7..ac00026 100644
---- a/include/bsd/sys/queue.h
-+++ b/include/bsd/sys/queue.h
-@@ -33,7 +33,11 @@
- #ifndef LIBBSD_SYS_QUEUE_H
- #define LIBBSD_SYS_QUEUE_H
- 
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- 
- /*
-  * This file defines four types of data structures: singly-linked lists,
-diff --git a/include/bsd/sys/tree.h b/include/bsd/sys/tree.h
-index 628bec0..325b382 100644
---- a/include/bsd/sys/tree.h
-+++ b/include/bsd/sys/tree.h
-@@ -30,7 +30,11 @@
- #ifndef LIBBSD_SYS_TREE_H
- #define LIBBSD_SYS_TREE_H
- 
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- 
- /*
-  * This file defines data structures for different types of trees:
-diff --git a/include/bsd/timeconv.h b/include/bsd/timeconv.h
-index e2a2c55..a426bd3 100644
---- a/include/bsd/timeconv.h
-+++ b/include/bsd/timeconv.h
-@@ -41,7 +41,11 @@
- #ifndef LIBBSD_TIMECONV_H
- #define LIBBSD_TIMECONV_H
- 
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- #include <stdint.h>
- #include <time.h>
- 
-diff --git a/include/bsd/vis.h b/include/bsd/vis.h
-index 970dfdd..ab5430c 100644
---- a/include/bsd/vis.h
-+++ b/include/bsd/vis.h
-@@ -72,7 +72,11 @@
-  */
- #define	UNVIS_END	1	/* no more characters */
- 
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- 
- __BEGIN_DECLS
- char	*vis(char *, int, int, int);
-diff --git a/include/bsd/wchar.h b/include/bsd/wchar.h
-index 33a500e..7216503 100644
---- a/include/bsd/wchar.h
-+++ b/include/bsd/wchar.h
-@@ -40,7 +40,11 @@
- #define LIBBSD_WCHAR_H
- 
- #include <stddef.h>
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- #include <sys/types.h>
- 
- __BEGIN_DECLS
--- 
-cgit v1.1
-
diff --git a/pkgs/development/libraries/libbsd/darwin.patch b/pkgs/development/libraries/libbsd/darwin.patch
index 4bddec6b0ffd..0f9cc9aaf964 100644
--- a/pkgs/development/libraries/libbsd/darwin.patch
+++ b/pkgs/development/libraries/libbsd/darwin.patch
@@ -1,497 +1,103 @@
 diff --git a/configure.ac b/configure.ac
-index 88ccd91..0857782 100644
+index 55fcfe6..1e26c93 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -59,7 +59,7 @@ AS_CASE([$host_os],
- )
+@@ -51,15 +51,19 @@ AS_CASE([$host_os],
+     AC_SEARCH_LIBS([clock_gettime], [rt], [CLOCK_GETTIME_LIBS="-lrt"])
+     AC_SUBST([CLOCK_GETTIME_LIBS])
+     LIBS="$saved_LIBS"
++    AM_CONDITIONAL([BUILD_LINK_VERSION_SCRIPT], [1])
+   ],
+   [*-musl*], [
+     # Upstream refuses to define this, we will do it ourselves then.
+     AC_DEFINE([__MUSL__], [1], [Define to 1 if we are building for musl])
++    AM_CONDITIONAL([BUILD_LINK_VERSION_SCRIPT], [1])
+   ],
+-)
++  [
++  AM_CONDITIONAL([BUILD_LINK_VERSION_SCRIPT], [1])
++  ])
  
  # Checks for header files.
 -AC_CHECK_HEADERS([sys/ndir.h sys/dir.h ndir.h dirent.h])
-+AC_CHECK_HEADERS([sys/ndir.h sys/dir.h ndir.h dirent.h stdio_ext.h])
++AC_CHECK_HEADERS([sys/ndir.h sys/dir.h ndir.h dirent.h nlist.h])
  
  # Checks for typedefs, structures, and compiler characteristics.
  AC_C_INLINE
-@@ -146,6 +146,31 @@ AC_CHECK_FUNCS([clearenv dirfd fopencookie __fpurge \
-                 pstat_getproc sysconf])
+@@ -143,7 +147,8 @@ AC_LINK_IFELSE(
+ 
+ AC_CHECK_FUNCS([clearenv dirfd fopencookie __fpurge \
+                 getauxval getentropy getexecname getline \
+-                pstat_getproc sysconf])
++                pstat_getproc sysconf \
++		strlcpy strlcat strnstr strmode fpurge])
  AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xtrue"])
  
-+HostOS=`echo "$host" | sed 's/.*-//'`
-+os_is_macosx=false
-+nonLinuxOS=false
-+AC_SUBST(HostOS)
-+case ${HostOS} in
-+	darwin* | powerpc*-*-darwin* | freebsd* | netbsd* | openbsd*)
-+		os_is_macosx=true
-+		nonLinuxOS=true
-+		echo HostOS="$HostOS"
-+		;;
-+	*)
-+		echo host="$host"
-+		echo HostOS="$HostOS"
-+		os_is_macosx=false
-+		nonLinuxOS=false
-+		;;
-+esac		
-+AM_CONDITIONAL([IS_DARWIN], [test x$os_is_macosx = xtrue])
-+AM_COND_IF([IS_DARWIN],
-+	[AC_DEFINE([IS_DARWIN], [1], [Get HostOS Type is Darwin])])
-+
-+AM_CONDITIONAL([NON_LINUX], [test x$userdefine_gethostbyname_r = xtrue])
-+AM_COND_IF([NON_LINUX],
-+	[AC_DEFINE([NON_LINUX], [1], [Get HostOS Type])])
-+
  AC_CONFIG_FILES([
- 	Makefile
- 	include/Makefile
-diff --git a/include/bsd/libutil.h b/include/bsd/libutil.h
-index 45b3b15..d0d4043 100644
---- a/include/bsd/libutil.h
-+++ b/include/bsd/libutil.h
-@@ -39,7 +39,9 @@
- #ifndef LIBBSD_LIBUTIL_H
- #define LIBBSD_LIBUTIL_H
- 
-+#ifdef HAVE_FEATURES_H
- #include <features.h>
-+#endif
- #include <sys/cdefs.h>
- #include <sys/types.h>
- #include <stdint.h>
-diff --git a/include/bsd/stdio.h b/include/bsd/stdio.h
-index 4b69983..c75151b 100644
---- a/include/bsd/stdio.h
-+++ b/include/bsd/stdio.h
-@@ -48,12 +48,16 @@
- __BEGIN_DECLS
- const char *fmtcheck(const char *, const char *);
- 
-+#if !defined(darwin) && !defined(__APPLE__) && !defined(MACOSX)
- /* XXX: The function requires cooperation from the system libc to store the
-  * line buffer in the FILE struct itself. */
- char *fgetln(FILE *fp, size_t *lenp)
--	LIBBSD_DEPRECATED("This functions cannot be safely ported, "
--	                  "use getline(3) instead, as it is supported "
--	                  "by GNU and POSIX.1-2008.");
-+	__attribute__((deprecated("This functions cannot be safely ported, "
-+	                          "use getline(3) instead, as it is supported "
-+	                          "by GNU and POSIX.1-2008.")));
-+#else
-+char *fgetln(FILE *fp, size_t *lenp);
-+#endif
- 
- /*
-  * Note: We diverge from the FreeBSD, OpenBSD and DragonFlyBSD declarations,
-diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h
-index ebc9638..6cd7943 100644
---- a/include/bsd/stdlib.h
-+++ b/include/bsd/stdlib.h
-@@ -67,9 +67,11 @@ int sradixsort(const unsigned char **base, int nmemb,
-                const unsigned char *table, unsigned endbyte);
- 
- void *reallocf(void *ptr, size_t size);
--#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 26)
-+#if defined(_GNU_SOURCE) && defined(__GLIBC__) && defined(__GLIBC_PREREQ)
-+#if !__GLIBC_PREREQ(2, 26)
- void *reallocarray(void *ptr, size_t nmemb, size_t size);
- #endif
-+#endif
- 
- long long strtonum(const char *nptr, long long minval, long long maxval,
-                    const char **errstr);
 diff --git a/include/bsd/string.h b/include/bsd/string.h
-index 6798bf6..6baaa14 100644
+index f987fee..a1e17ed 100644
 --- a/include/bsd/string.h
 +++ b/include/bsd/string.h
-@@ -37,6 +37,12 @@
+@@ -41,10 +41,21 @@
  #include <sys/types.h>
  
  __BEGIN_DECLS
-+#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
-+size_t bsd_strlcpy(char *dst, const char *src, size_t siz);
-+size_t bsd_strlcat(char *dst, const char *src, size_t siz);
-+char *bsd_strnstr(const char *str, const char *find, size_t str_len);
-+void bsd_strmode(mode_t mode, char *str);
-+#else
++#if !HAVE_STRLCPY
  size_t strlcpy(char *dst, const char *src, size_t siz);
++#endif
++
++#if !HAVE_STRLCAT
  size_t strlcat(char *dst, const char *src, size_t siz);
++#endif
++
++#if !HAVE_STRNSTR
  char *strnstr(const char *str, const char *find, size_t str_len);
-@@ -45,6 +51,7 @@ void strmode(mode_t mode, char *str);
- #if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 25)
- void explicit_bzero(void *buf, size_t len);
- #endif
 +#endif
- __END_DECLS
++
++#if !HAVE_STRMODE
+ void strmode(mode_t mode, char *str);
++#endif
  
- #endif
+ #if !defined(__GLIBC__) || \
+     (defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 25) || !defined(_GNU_SOURCE)))
 diff --git a/src/Makefile.am b/src/Makefile.am
-index ad83dbf..0f2a7ee 100644
+index f3cc0fa..3aaecd4 100644
 --- a/src/Makefile.am
 +++ b/src/Makefile.am
-@@ -54,17 +54,21 @@ libbsd_la_DEPENDENCIES = \
- 	libbsd.map
+@@ -56,8 +56,10 @@ libbsd_la_DEPENDENCIES = \
  libbsd_la_LIBADD = \
  	$(CLOCK_GETTIME_LIBS)
-+
-+if IS_DARWIN
-+libbsd_la_LDFLAGS = \
-+	-Wl \
-+	-version-number $(LIBBSD_ABI)
-+else
  libbsd_la_LDFLAGS = \
- 	-Wl,--version-script=$(srcdir)/libbsd.map \
+-	-Wl,--version-script=$(srcdir)/libbsd.map \
  	-version-number $(LIBBSD_ABI)
++if BUILD_LINK_VERSION_SCRIPT
++libbsd_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libbsd.map
 +endif
-+
  libbsd_la_SOURCES = \
  	arc4random.c \
--	arc4random.h \
--	arc4random_unix.h \
--	arc4random_openbsd.h \
- 	arc4random_uniform.c \
- 	bsd_getopt.c \
--	chacha_private.h \
- 	closefrom.c \
- 	dehumanize_number.c \
- 	err.c \
-@@ -117,6 +121,15 @@ libbsd_la_SOURCES += \
- 	$(nil)
- endif
- 
-+noinst_HEADERS = \
-+	arc4random.h \
-+	arc4random_bsd.h \
-+	arc4random_linux.h \
-+	arc4random_unix.h \
-+	arc4random_osx.h \
-+	arc4random_openbsd.h \
-+	chacha_private.h
-+
- libbsd_ctor_a_SOURCES = \
- 	setproctitle_ctor.c \
- 	$(nil)
-diff --git a/src/arc4random_bsd.h b/src/arc4random_bsd.h
-new file mode 100644
-index 0000000..ece2f85
---- /dev/null
-+++ b/src/arc4random_bsd.h
-@@ -0,0 +1,86 @@
-+/*	$OpenBSD: arc4random_freebsd.h,v 1.2 2015/01/15 06:57:18 deraadt Exp $	*/
-+
-+/*
-+ * Copyright (c) 1996, David Mazieres <dm@uun.org>
-+ * Copyright (c) 2008, Damien Miller <djm@openbsd.org>
-+ * Copyright (c) 2013, Markus Friedl <markus@openbsd.org>
-+ * Copyright (c) 2014, Theo de Raadt <deraadt@openbsd.org>
-+ *
-+ * Permission to use, copy, modify, and distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+
-+/*
-+ * Stub functions for portability.
-+ */
-+
-+#include <sys/mman.h>
-+
-+#include <pthread.h>
-+#include <signal.h>
-+
-+static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER;
-+#define _ARC4_LOCK()   pthread_mutex_lock(&arc4random_mtx)
-+#define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx)
-+
-+/*
-+ * Unfortunately, pthread_atfork() is broken on FreeBSD (at least 9 and 10) if
-+ * a program does not link to -lthr. Callbacks registered with pthread_atfork()
-+ * appear to fail silently. So, it is not always possible to detect a PID
-+ * wraparound.
-+ */
-+#define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f))
-+
-+static inline void
-+_getentropy_fail(void)
-+{
-+	raise(SIGKILL);
-+}
-+
-+static volatile sig_atomic_t _rs_forked;
-+
-+static inline void
-+_rs_forkhandler(void)
-+{
-+	_rs_forked = 1;
-+}
-+
-+static inline void
-+_rs_forkdetect(void)
-+{
-+	static pid_t _rs_pid = 0;
-+	pid_t pid = getpid();
-+
-+	if (_rs_pid == 0 || _rs_pid != pid || _rs_forked) {
-+		_rs_pid = pid;
-+		_rs_forked = 0;
-+		if (rs)
-+			memset(rs, 0, sizeof(*rs));
-+	}
-+}
-+
-+static inline int
-+_rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
-+{
-+	if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE,
-+	    MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
-+		return (-1);
-+
-+	if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE,
-+	    MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) {
-+		munmap(*rsp, sizeof(**rsp));
-+		return (-1);
-+	}
-+
-+	_ARC4_ATFORK(_rs_forkhandler);
-+	return (0);
-+}
-diff --git a/src/arc4random_linux.h b/src/arc4random_linux.h
-new file mode 100644
-index 0000000..d61a8db
---- /dev/null
-+++ b/src/arc4random_linux.h
-@@ -0,0 +1,86 @@
-+/*	$OpenBSD: arc4random_linux.h,v 1.8 2014/08/13 06:04:10 deraadt Exp $	*/
-+
-+/*
-+ * Copyright (c) 1996, David Mazieres <dm@uun.org>
-+ * Copyright (c) 2008, Damien Miller <djm@openbsd.org>
-+ * Copyright (c) 2013, Markus Friedl <markus@openbsd.org>
-+ * Copyright (c) 2014, Theo de Raadt <deraadt@openbsd.org>
-+ *
-+ * Permission to use, copy, modify, and distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+
-+/*
-+ * Stub functions for portability.
-+ */
-+
-+#include <sys/mman.h>
-+
-+#include <pthread.h>
-+#include <signal.h>
-+
-+static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER;
-+#define _ARC4_LOCK()   pthread_mutex_lock(&arc4random_mtx)
-+#define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx)
-+
-+#ifdef __GLIBC__
-+extern void *__dso_handle;
-+extern int __register_atfork(void (*)(void), void(*)(void), void (*)(void), void *);
-+#define _ARC4_ATFORK(f) __register_atfork(NULL, NULL, (f), __dso_handle)
-+#else
-+#define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f))
-+#endif
-+
-+static inline void
-+_getentropy_fail(void)
-+{
-+	raise(SIGKILL);
-+}
-+
-+static volatile sig_atomic_t _rs_forked;
-+
-+static inline void
-+_rs_forkhandler(void)
-+{
-+	_rs_forked = 1;
-+}
-+
-+static inline void
-+_rs_forkdetect(void)
-+{
-+	static pid_t _rs_pid = 0;
-+	pid_t pid = getpid();
-+
-+	if (_rs_pid == 0 || _rs_pid != pid || _rs_forked) {
-+		_rs_pid = pid;
-+		_rs_forked = 0;
-+		if (rs)
-+			memset(rs, 0, sizeof(*rs));
-+	}
-+}
-+
-+static inline int
-+_rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
-+{
-+	if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE,
-+	    MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
-+		return (-1);
-+
-+	if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE,
-+	    MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) {
-+		munmap(*rsp, sizeof(**rsp));
-+		return (-1);
-+	}
-+
-+	_ARC4_ATFORK(_rs_forkhandler);
-+	return (0);
-+}
-diff --git a/src/arc4random_osx.h b/src/arc4random_osx.h
-new file mode 100644
-index 0000000..14771a6
---- /dev/null
-+++ b/src/arc4random_osx.h
-@@ -0,0 +1,82 @@
-+/*	$OpenBSD: arc4random_osx.h,v 1.10 2015/09/11 11:52:55 deraadt Exp $	*/
-+
-+/*
-+ * Copyright (c) 1996, David Mazieres <dm@uun.org>
-+ * Copyright (c) 2008, Damien Miller <djm@openbsd.org>
-+ * Copyright (c) 2013, Markus Friedl <markus@openbsd.org>
-+ * Copyright (c) 2014, Theo de Raadt <deraadt@openbsd.org>
-+ *
-+ * Permission to use, copy, modify, and distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+
-+/*
-+ * Stub functions for portability.
-+ */
-+
-+#include <sys/mman.h>
-+
-+#include <unistd.h>
-+#include <pthread.h>
-+#include <signal.h>
-+
-+static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER;
-+#define _ARC4_LOCK()   pthread_mutex_lock(&arc4random_mtx)
-+#define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx)
-+
-+#define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f))
-+
-+static inline void
-+_getentropy_fail(void)
-+{
-+	raise(SIGKILL);
-+}
-+
-+static volatile sig_atomic_t _rs_forked;
-+
-+static inline void
-+_rs_forkhandler(void)
-+{
-+	_rs_forked = 1;
-+}
-+
-+static inline void
-+_rs_forkdetect(void)
-+{
-+	static pid_t _rs_pid = 0;
-+	pid_t pid = getpid();
-+
-+	if (_rs_pid == 0 || _rs_pid != pid || _rs_forked) {
-+		_rs_pid = pid;
-+		_rs_forked = 0;
-+		if (rs)
-+			memset(rs, 0, sizeof(*rs));
-+	}
-+}
-+
-+static inline int
-+_rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
-+{
-+	if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE,
-+	    MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
-+		return (-1);
-+
-+	if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE,
-+	    MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) {
-+		munmap(*rsp, sizeof(**rsp));
-+		*rsp = NULL;
-+		return (-1);
-+	}
-+
-+	_ARC4_ATFORK(_rs_forkhandler);
-+	return (0);
-+}
-diff --git a/src/fgetln.c b/src/fgetln.c
-index 4d1726e..9c73788 100644
---- a/src/fgetln.c
-+++ b/src/fgetln.c
-@@ -30,7 +30,9 @@
- #include <sys/types.h>
- #include <string.h>
- 
-+#if !defined(darwin) && !defined(__APPLE__) && !defined(MACOSX)
- #include "local-link.h"
-+#endif
- 
- #ifdef HAVE_GETLINE
- struct filebuf {
-@@ -75,9 +77,11 @@ fgetln(FILE *stream, size_t *len)
- 		return fb->buf;
- 	}
- }
-+#if !defined(darwin) && !defined(__APPLE__) && !defined(MACOSX)
- libbsd_link_warning(fgetln,
-                     "This functions cannot be safely ported, use getline(3) "
-                     "instead, as it is supported by GNU and POSIX.1-2008.")
-+#endif
- #else
- #error "Function fgetln() needs to be ported."
- #endif
+ 	arc4random.h \
 diff --git a/src/fpurge.c b/src/fpurge.c
-index 462535a..e7eb46f 100644
+index 462535a..a8941db 100644
 --- a/src/fpurge.c
 +++ b/src/fpurge.c
-@@ -26,9 +26,11 @@
+@@ -26,9 +26,10 @@
  
  #include <errno.h>
  #include <stdio.h>
-+#if HAVE___FPURGE
- #include <stdio_ext.h>
-+#endif
+-#include <stdio_ext.h>
  
--#ifdef HAVE___FPURGE
-+#ifdef HAVE___FPURGE                   /* glibc >= 2.2, Haiku, Solaris >= 7 */
+ #ifdef HAVE___FPURGE
++#include <stdio_ext.h>
++
  int
  fpurge(FILE *fp)
  {
-@@ -42,5 +44,55 @@ fpurge(FILE *fp)
+@@ -41,6 +42,36 @@ fpurge(FILE *fp)
+ 
  	return 0;
  }
- #else
--#error "Function fpurge() needs to be ported."
-+#define fp_ fp
-+//#error "Function fpurge() needs to be ported."
-+//#elif HAVE_FPURGE                   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin 1.7 */
++/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin 1.7 */
++#elif HAVE_FPURGE
 +int
 +fpurge(FILE *fp)
 +{
@@ -501,12 +107,13 @@ index 462535a..e7eb46f 100644
 +	}
 +
 +  /* Call the system's fpurge function.  */
-+# undef fpurge
-+# if !HAVE_DECL_FPURGE
++#undef fpurge
++#if !HAVE_DECL_FPURGE
 +  extern int fpurge (FILE *);
-+# endif
++#endif
 +  int result = fpurge (fp);
-+# if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
++/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
++#if defined(__sferror) || defined(__DragonFly__)
 +  if (result == 0)
 +    /* Correct the invariants that fpurge broke.
 +       <stdio.h> on BSD systems says:
@@ -514,69 +121,35 @@ index 462535a..e7eb46f 100644
 +       If this invariant is not fulfilled and the stream is read-write but
 +       currently reading, subsequent putc or fputc calls will write directly
 +       into the buffer, although they shouldn't be allowed to.  */
-+    if ((fp_->_flags & __SRD) != 0)
-+      fp_->_w = 0;
++    if ((fp->_flags & __SRD) != 0)
++      fp->_w = 0;
 +#endif
 +  return result;
 +}
-+//#endif
-+#endif
-+
-+#ifdef TEST
-+int
-+main()
-+{
-+	static FILE fp_bad;
-+	FILE *fp;
-+
-+	if (fpurge(&fp_bad) == 0)
-+		return 1;
-+
-+	fp = fopen("/dev/zero", "r");
-+	if (fpurge(fp) < 0)
-+		return 1;
-+
-+	fclose(fp);
-+
-+	return 0;
-+}
+ #else
+ #error "Function fpurge() needs to be ported."
  #endif
 diff --git a/src/funopen.c b/src/funopen.c
-index 1e05c7e..75e61ea 100644
+index 1e05c7e..65ba5a8 100644
 --- a/src/funopen.c
 +++ b/src/funopen.c
 @@ -143,6 +143,7 @@ funopen(const void *cookie,
   * they will not add the needed support to implement it. Just ignore this
   * interface there, as it has never been provided anyway.
   */
-+#elif defined(darwin) || defined(__APPLE__) || defined(MACOSX)
++#elif defined(__MACH__)
  #else
  #error "Function funopen() needs to be ported or disabled."
  #endif
-diff --git a/src/getentropy.c b/src/getentropy.c
-index 3f11a1e..8a23a07 100644
---- a/src/getentropy.c
-+++ b/src/getentropy.c
-@@ -28,9 +28,7 @@
- #include "getentropy_linux.c"
- #elif defined(__GNU__)
- #include "getentropy_hurd.c"
--#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
--#include "getentropy_bsd.c"
--#elif defined(__NetBSD__)
-+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
- #include "getentropy_bsd.c"
- #elif defined(__sun)
- #include "getentropy_solaris.c"
 diff --git a/src/hash/sha512.h b/src/hash/sha512.h
-index 4f368a1..ab22fc1 100644
+index 4f368a1..7632e25 100644
 --- a/src/hash/sha512.h
 +++ b/src/hash/sha512.h
 @@ -29,7 +29,11 @@
  #ifndef _SHA512_H_
  #define _SHA512_H_
  
-+#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
++#ifdef __MACH__
 +#include <stdint.h>
 +#else
  #include <sys/types.h>
@@ -585,16 +158,15 @@ index 4f368a1..ab22fc1 100644
  #define SHA512_DIGEST_LENGTH		64
  
 diff --git a/src/hash/sha512c.c b/src/hash/sha512c.c
-index b3c8d5e..f69013d 100644
+index b3c8d5e..602f54e 100644
 --- a/src/hash/sha512c.c
 +++ b/src/hash/sha512c.c
-@@ -25,7 +25,13 @@
+@@ -25,7 +25,12 @@
   */
  
  #include <sys/cdefs.h>
-+__FBSDID("$FreeBSD$");
 +
-+#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
++#ifdef __MACH__
 +#include <machine/endian.h>
 +#else
  #include <sys/endian.h>
@@ -602,102 +174,188 @@ index b3c8d5e..f69013d 100644
  #include <sys/types.h>
  
  #include <string.h>
+diff --git a/src/local-link.h b/src/local-link.h
+index d518dcf..84694a2 100644
+--- a/src/local-link.h
++++ b/src/local-link.h
+@@ -27,7 +27,11 @@
+ #ifndef LIBBSD_LOCAL_LINK_H
+ #define LIBBSD_LOCAL_LINK_H
+ 
++#ifdef __MACH__
++#define libbsd_link_warning(symbol, msg)
++#else
+ #define libbsd_link_warning(symbol, msg) \
+ 	static const char libbsd_emit_link_warning_##symbol[] \
+ 		__attribute__((used,section(".gnu.warning." #symbol))) = msg;
+ #endif
++#endif
 diff --git a/src/nlist.c b/src/nlist.c
-index 0932f59..598a329 100644
+index 0932f59..4502048 100644
 --- a/src/nlist.c
 +++ b/src/nlist.c
-@@ -27,6 +27,10 @@
-  * SUCH DAMAGE.
-  */
+@@ -41,6 +41,7 @@
+ #include <unistd.h>
+ #include <nlist.h>
  
-+#if !defined(darwin) && !defined(__APPLE__) && !defined(MACOSX)
-+#if defined(LIBC_SCCS) && !defined(lint)
-+static char sccsid[] = "@(#)nlist.c	8.1 (Berkeley) 6/4/93";
-+#endif /* LIBC_SCCS and not lint */
- #include <sys/cdefs.h>
++#if !HAVE_NLIST_H
+ #include "local-elf.h"
  
- #include <sys/param.h>
-@@ -265,3 +269,4 @@ nlist(const char *name, struct nlist *list)
+ #define SIZE_T_MAX 0xffffffffU
+@@ -265,3 +266,4 @@ nlist(const char *name, struct nlist *list)
  	(void)close(fd);
  	return (n);
  }
-+#endif /* _NLIST_DO_ELF */
++#endif
+diff --git a/src/readpassphrase.c b/src/readpassphrase.c
+index f9f6195..2bc5fb4 100644
+--- a/src/readpassphrase.c
++++ b/src/readpassphrase.c
+@@ -36,6 +36,14 @@
+ #define TCSASOFT 0
+ #endif
+ 
++#ifndef _SIGMAX
++#define	_SIGMAX	64
++#endif
++
++#ifndef _NSIG
++#define _NSIG (_SIGMAX + 1)
++#endif
++
+ static volatile sig_atomic_t signo[_NSIG];
+ 
+ static void handler(int);
 diff --git a/src/setproctitle.c b/src/setproctitle.c
-index 038ac7d..d0ef01b 100644
+index 038ac7d..e9ee09c 100644
 --- a/src/setproctitle.c
 +++ b/src/setproctitle.c
-@@ -32,6 +32,11 @@
+@@ -32,6 +32,10 @@
  #include <unistd.h>
  #include <string.h>
  
-+#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
-+#define __asm__(x)
++#ifdef __MACH__
 +extern char **environ;
 +#endif
 +
  static struct {
  	/* Original value. */
  	const char *arg0;
-@@ -287,7 +292,14 @@ __asm__(".symver setproctitle_impl,setproctitle@@LIBBSD_0.5");
+@@ -280,16 +284,22 @@ setproctitle_impl(const char *fmt, ...)
+ 		*++nul = '\0';
+ 	}
+ }
++#ifndef __MACH__
+ __asm__(".symver setproctitle_impl,setproctitle@@LIBBSD_0.5");
++#endif
+ 
+ /* The original function introduced in 0.2 was a stub, it only got implemented
+  * in 0.5, make the implementation available in the old version as an alias
   * for code linking against that version, and change the default to use the
   * new version, so that new code depends on the implemented version. */
- #ifdef HAVE_TYPEOF
-+#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
-+//
-+// HACK: even weak aliasing breaks in clang so just comment this out for now
-+//
-+// extern typeof(setproctitle_impl) setproctitle_stub __attribute__((weak, alias("setproctitle_impl")));
-+#else
+-#ifdef HAVE_TYPEOF
++#ifdef __MACH__
++void setproctitle_stub(const char *fmt, ...);
++#elif HAVE_TYPEOF
  extern typeof(setproctitle_impl) setproctitle_stub __attribute__((alias("setproctitle_impl")));
-+#endif
  #else
  void setproctitle_stub(const char *fmt, ...)
  	__attribute__((alias("setproctitle_impl")));
+ #endif
++#ifndef __MACH__
+ __asm__(".symver setproctitle_stub,setproctitle@LIBBSD_0.2");
++#endif
 diff --git a/src/strlcat.c b/src/strlcat.c
-index 14c53a1..e01cb60 100644
+index 14c53a1..5961c17 100644
 --- a/src/strlcat.c
 +++ b/src/strlcat.c
-@@ -27,7 +27,11 @@
+@@ -26,6 +26,7 @@
+  * Returns strlen(src) + MIN(dsize, strlen(initial dst)).
   * If retval >= dsize, truncation occurred.
   */
++#if !HAVE_STRLCAT
  size_t
-+#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
-+bsd_strlcat(char *dst, const char *src, size_t dsize)
-+#else
  strlcat(char *dst, const char *src, size_t dsize)
-+#endif
  {
- 	const char *odst = dst;
- 	const char *osrc = src;
+@@ -53,3 +54,4 @@ strlcat(char *dst, const char *src, size_t dsize)
+ 
+ 	return(dlen + (src - osrc));	/* count does not include NUL */
+ }
++#endif
 diff --git a/src/strlcpy.c b/src/strlcpy.c
-index e9a7fe4..10a855f 100644
+index e9a7fe4..5137acb 100644
 --- a/src/strlcpy.c
 +++ b/src/strlcpy.c
-@@ -25,7 +25,11 @@
+@@ -24,6 +24,7 @@
+  * chars will be copied.  Always NUL terminates (unless dsize == 0).
   * Returns strlen(src); if retval >= dsize, truncation occurred.
   */
++#if !HAVE_STRLCPY
  size_t
-+#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
-+bsd_strlcpy(char *dst, const char *src, size_t dsize)
-+#else
  strlcpy(char *dst, const char *src, size_t dsize)
-+#endif
  {
- 	const char *osrc = src;
- 	size_t nleft = dsize;
+@@ -48,3 +49,4 @@ strlcpy(char *dst, const char *src, size_t dsize)
+ 
+ 	return(src - osrc - 1);	/* count does not include NUL */
+ }
++#endif
 diff --git a/src/strmode.c b/src/strmode.c
-index e6afde5..c463243 100644
+index e6afde5..da680c9 100644
 --- a/src/strmode.c
 +++ b/src/strmode.c
-@@ -33,7 +33,11 @@
+@@ -32,6 +32,7 @@
+ #include <sys/stat.h>
  #include <string.h>
  
++#if !HAVE_STRMODE
  void
-+#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
-+bsd_strmode(mode_t mode, char *p)
-+#else
  strmode(mode_t mode, char *p)
+ {
+@@ -141,3 +142,4 @@ strmode(mode_t mode, char *p)
+ 	*p++ = ' ';		/* will be a '+' if ACL's implemented */
+ 	*p = '\0';
+ }
++#endif
+diff --git a/src/unvis.c b/src/unvis.c
+index 94e3e7a..fba4c66 100644
+--- a/src/unvis.c
++++ b/src/unvis.c
+@@ -565,11 +565,15 @@ strnunvis_openbsd(char *dst, const char *src, size_t dlen)
+ {
+ 	return strnunvisx(dst, dlen, src, 0);
+ }
++#ifndef __MACH__
+ __asm__(".symver strnunvis_openbsd,strnunvis@@LIBBSD_0.2");
++#endif
+ 
+ int
+ strnunvis_netbsd(char *dst, size_t dlen, const char *src)
+ {
+ 	return strnunvisx(dst, dlen, src, 0);
+ }
++#ifndef __MACH__
+ __asm__(".symver strnunvis_netbsd,strnunvis@LIBBSD_0.9.1");
 +#endif
+diff --git a/src/vis.c b/src/vis.c
+index c2cd2d8..2d84330 100644
+--- a/src/vis.c
++++ b/src/vis.c
+@@ -723,14 +723,18 @@ strnvis_openbsd(char *mbdst, const char *mbsrc, size_t dlen, int flags)
  {
- 	 /* print type */
- 	switch (mode & S_IFMT) {
+ 	return istrsenvisxl(&mbdst, &dlen, mbsrc, flags, "", NULL);
+ }
++#ifndef __MACH__
+ __asm__(".symver strnvis_openbsd,strnvis@@LIBBSD_0.2");
++#endif
+ 
+ int
+ strnvis_netbsd(char *mbdst, size_t dlen, const char *mbsrc, int flags)
+ {
+ 	return istrsenvisxl(&mbdst, &dlen, mbsrc, flags, "", NULL);
+ }
++#ifndef __MACH__
+ __asm__(".symver strnvis_netbsd,strnvis@LIBBSD_0.9.1");
++#endif
+ 
+ int
+ stravis(char **mbdstp, const char *mbsrc, int flags)
diff --git a/pkgs/development/libraries/libbsd/default.nix b/pkgs/development/libraries/libbsd/default.nix
index 36410e842a5d..a8d1925e5c0d 100644
--- a/pkgs/development/libraries/libbsd/default.nix
+++ b/pkgs/development/libraries/libbsd/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "libbsd-${version}";
-  version = "0.8.7";
+  version = "0.9.1";
 
   src = fetchurl {
     url = "https://libbsd.freedesktop.org/releases/${name}.tar.xz";
-    sha256 = "0c9bl49zs0xdddcwj5dh0lay9sxi2m1yi74848g8p87mb87g2j7m";
+    sha256 = "1957w2wi7iqar978qlfsm220dwywnrh5m58nrnn9zmi74ds3bn2n";
   };
 
   # darwin changes configure.ac which means we need to regenerate
@@ -14,15 +14,8 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ autoreconfHook ];
 
   patches = stdenv.lib.optional stdenv.isDarwin ./darwin.patch
-    # Suitable for all, but limited to musl to avoid rebuilds
-    ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
-      # https://cgit.freedesktop.org/libbsd/commit/?id=1f8a3f7bccfc84b195218ad0086ebd57049c3490
-      ./non-glibc.patch
-      # https://cgit.freedesktop.org/libbsd/commit/?id=11ec8f1e5dfa1c10e0c9fb94879b6f5b96ba52dd
-      ./cdefs.patch
-      # https://cgit.freedesktop.org/libbsd/commit/?id=b20272f5a966333b49fdf2bda797e2a9f0227404
-      ./features.patch
-  ];
+    # Suitable for all but limited to musl to avoid rebuild
+    ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./musl.patch;
 
   meta = with stdenv.lib; {
     description = "Common functions found on BSD systems";
diff --git a/pkgs/development/libraries/libbsd/features.patch b/pkgs/development/libraries/libbsd/features.patch
deleted file mode 100644
index 66bd1e9232ba..000000000000
--- a/pkgs/development/libraries/libbsd/features.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From b20272f5a966333b49fdf2bda797e2a9f0227404 Mon Sep 17 00:00:00 2001
-From: Guillem Jover <guillem@hadrons.org>
-Date: Tue, 6 Mar 2018 01:42:52 +0100
-Subject: Remove <features.h> inclusion from <bsd/libutil.h>
-
-This is a non-portable header, and we should not assume it is present.
-Let the first system header pull it in if needed.
----
- include/bsd/libutil.h | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/include/bsd/libutil.h b/include/bsd/libutil.h
-index ccca29a..e5f148a 100644
---- a/include/bsd/libutil.h
-+++ b/include/bsd/libutil.h
-@@ -39,7 +39,6 @@
- #ifndef LIBBSD_LIBUTIL_H
- #define LIBBSD_LIBUTIL_H
- 
--#include <features.h>
- #ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
- #else
--- 
-cgit v1.1
-
diff --git a/pkgs/development/libraries/libbsd/musl.patch b/pkgs/development/libraries/libbsd/musl.patch
new file mode 100644
index 000000000000..fc07cfb6e855
--- /dev/null
+++ b/pkgs/development/libraries/libbsd/musl.patch
@@ -0,0 +1,14 @@
+Source: maxice8
+Upstream: no
+Reason: fixes compilation
+
+--- a/src/flopen.c
++++ b/src/flopen.c
+@@ -34,6 +34,7 @@
+ #include <errno.h>
+ #include <stdarg.h>
+ #include <unistd.h>
++#include <fcntl.h>
+ 
+ #include <libutil.h>
+ 
diff --git a/pkgs/development/libraries/libbsd/non-glibc.patch b/pkgs/development/libraries/libbsd/non-glibc.patch
deleted file mode 100644
index f61e0d242943..000000000000
--- a/pkgs/development/libraries/libbsd/non-glibc.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 1f8a3f7bccfc84b195218ad0086ebd57049c3490 Mon Sep 17 00:00:00 2001
-From: Guillem Jover <guillem@hadrons.org>
-Date: Tue, 6 Mar 2018 01:39:45 +0100
-Subject: Fix function declaration protection for glibc already providing them
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-On non-glibc based systems we cannot unconditionally use the
-__GLIBC_PREREQ macro as it gets expanded before evaluation. Instead,
-if it is undefined, define it to 0.
-
-We should also always declare these functions on non-glibc based
-systems. And on systems with a new enough glibc, which provides these
-functions, we should still provide the declarations if _GNU_SOURCE
-is *not* defined.
-
-Reported-by: Jörg Krause <joerg.krause@embedded.rocks>
----
- include/bsd/stdlib.h    | 3 ++-
- include/bsd/string.h    | 3 ++-
- include/bsd/sys/cdefs.h | 8 ++++++++
- 3 files changed, 12 insertions(+), 2 deletions(-)
-
-diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h
-index 8d33d1f..a5b063c 100644
---- a/include/bsd/stdlib.h
-+++ b/include/bsd/stdlib.h
-@@ -71,7 +71,8 @@ int sradixsort(const unsigned char **base, int nmemb,
-                const unsigned char *table, unsigned endbyte);
- 
- void *reallocf(void *ptr, size_t size);
--#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 26)
-+#if !defined(__GLIBC__) || \
-+    (defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 26) || !defined(_GNU_SOURCE)))
- void *reallocarray(void *ptr, size_t nmemb, size_t size);
- #endif
- 
-diff --git a/include/bsd/string.h b/include/bsd/string.h
-index 29097f6..f987fee 100644
---- a/include/bsd/string.h
-+++ b/include/bsd/string.h
-@@ -46,7 +46,8 @@ size_t strlcat(char *dst, const char *src, size_t siz);
- char *strnstr(const char *str, const char *find, size_t str_len);
- void strmode(mode_t mode, char *str);
- 
--#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 25)
-+#if !defined(__GLIBC__) || \
-+    (defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 25) || !defined(_GNU_SOURCE)))
- void explicit_bzero(void *buf, size_t len);
- #endif
- __END_DECLS
-diff --git a/include/bsd/sys/cdefs.h b/include/bsd/sys/cdefs.h
-index b4c8f30..d1cc419 100644
---- a/include/bsd/sys/cdefs.h
-+++ b/include/bsd/sys/cdefs.h
-@@ -59,6 +59,14 @@
- #endif
- 
- /*
-+ * On non-glibc based systems, we cannot unconditionally use the
-+ * __GLIBC_PREREQ macro as it gets expanded before evaluation.
-+ */
-+#ifndef __GLIBC_PREREQ
-+#define __GLIBC_PREREQ(maj, min) 0
-+#endif
-+
-+/*
-  * Some kFreeBSD headers expect those macros to be set for sanity checks.
-  */
- #ifndef _SYS_CDEFS_H_
--- 
-cgit v1.1
-
diff --git a/pkgs/development/libraries/libcacard/default.nix b/pkgs/development/libraries/libcacard/default.nix
new file mode 100644
index 000000000000..f116360474e4
--- /dev/null
+++ b/pkgs/development/libraries/libcacard/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, pkgconfig, glib, nss }:
+
+stdenv.mkDerivation rec {
+  name = "libcacard-${version}";
+  version = "2.6.1";
+
+  src = fetchurl {
+    url = "https://www.spice-space.org/download/libcacard/${name}.tar.xz";
+    sha256 = "1w6y0kiakhg7dgyf8yqpm4jj6jiv17zhy9lp3d7z32q1pniccxk2";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ glib nss ];
+
+  meta = with stdenv.lib; {
+    description = "Smart card emulation library";
+    homepage = https://gitlab.freedesktop.org/spice/libcacard;
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ yegortimoshenko ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/development/libraries/libcanberra/default.nix b/pkgs/development/libraries/libcanberra/default.nix
index 8addb6128f0c..460a58a19a70 100644
--- a/pkgs/development/libraries/libcanberra/default.nix
+++ b/pkgs/development/libraries/libcanberra/default.nix
@@ -1,6 +1,7 @@
 { stdenv, lib, fetchurl, fetchpatch, pkgconfig, libtool
 , gtk ? null
 , libpulseaudio, gst_all_1, libvorbis, libcap
+, CoreServices
 , withAlsa ? stdenv.isLinux, alsaLib }:
 
 stdenv.mkDerivation rec {
@@ -15,6 +16,7 @@ stdenv.mkDerivation rec {
   buildInputs = [
     libpulseaudio libvorbis gtk
   ] ++ (with gst_all_1; [ gstreamer gst-plugins-base ])
+    ++ lib.optional stdenv.isDarwin CoreServices
     ++ lib.optional stdenv.isLinux libcap
     ++ lib.optional withAlsa alsaLib;
 
diff --git a/pkgs/development/libraries/libchamplain/default.nix b/pkgs/development/libraries/libchamplain/default.nix
index e4864aded279..95b1ad074b05 100644
--- a/pkgs/development/libraries/libchamplain/default.nix
+++ b/pkgs/development/libraries/libchamplain/default.nix
@@ -9,10 +9,12 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "13chvc2n074i0jw5jlb8i7cysda4yqx58ca6y3mrlrl9g37k2zja";
   };
 
+  outputs = [ "out" "dev" ];
+
   nativeBuildInputs = [ pkgconfig gobjectIntrospection ];
 
   propagatedBuildInputs = [ glib gtk3 cairo clutter-gtk sqlite libsoup ];
diff --git a/pkgs/development/libraries/libclthreads/default.nix b/pkgs/development/libraries/libclthreads/default.nix
index 6d37eb19c712..a2f6858a05c9 100644
--- a/pkgs/development/libraries/libclthreads/default.nix
+++ b/pkgs/development/libraries/libclthreads/default.nix
@@ -2,20 +2,17 @@
 
 stdenv.mkDerivation rec {
   name = "libclthreads-${version}";
-  version = "2.4.0";
+  version = "2.4.2";
 
   src = fetchurl {
     url = "https://kokkinizita.linuxaudio.org/linuxaudio/downloads/clthreads-${version}.tar.bz2";
-    sha256 = "1s8xx99z6llv46cvkllmd72v2pkzbfl5gngcql85mf14mxkdb7x6";
+    sha256 = "0cbs1w89q8wfjrrhvxf6xk0y02nkjl5hd0yb692c8ma01i6b2nf6";
   };
 
   patchPhase = ''
-    # Fix hardcoded paths to executables
-    sed -e "s@/usr/bin/install@install@" -i ./Makefile
-    sed -e "s@/sbin/ldconfig@ldconfig@" -i ./Makefile
-
-    # Remove useless symlink: /lib64 -> /lib
-    sed -e '/ln -sf \$(CLTHREADS_MIN) \$(PREFIX)\/\$(LIBDIR)\/\$(CLTHREADS_SO)/d' -i ./Makefile
+    cd source
+    # don't run ldconfig:
+    sed -e "/ldconfig/d" -i ./Makefile
   '';
 
   makeFlags = [
@@ -24,12 +21,13 @@ stdenv.mkDerivation rec {
   ];
 
   preInstall = ''
-    # The Makefile does not create the include directory
+    # The Makefile does not create the include and lib directories
     mkdir -p $out/include
+    mkdir -p $out/lib
   '';
 
   postInstall = ''
-    ln -s $out/lib/libclthreads.so.${version} $out/lib/libclthreads.so
+    ln $out/lib/libclthreads.so $out/lib/libclthreads.so.2
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/libclxclient/default.nix b/pkgs/development/libraries/libclxclient/default.nix
index ce67a8efa80e..6e6ca647fc0f 100644
--- a/pkgs/development/libraries/libclxclient/default.nix
+++ b/pkgs/development/libraries/libclxclient/default.nix
@@ -1,20 +1,28 @@
-{ stdenv, fetchurl, libclthreads, libX11, libXft, xorg }:
+{ stdenv, fetchurl, libclthreads, libX11, libXft, xorg, pkgconfig }:
 
 stdenv.mkDerivation rec {
   name = "libclxclient-${version}";
-  version = "3.9.0";
+  version = "3.9.2";
 
   src = fetchurl {
     url = "https://kokkinizita.linuxaudio.org/linuxaudio/downloads/clxclient-${version}.tar.bz2";
-    sha256 = "14l7xrh964gllymraq4n5pgax94p5jsfjslqi5c6637zc4lmgnl0";
+    sha256 = "10bq6fy8d3pr1x2x3xx9qhf2hdxrwdgvg843a2y6lx70y1jfj0c5";
   };
 
   buildInputs = [ libclthreads libX11 libXft xorg.xproto ];
 
+  nativeBuildInputs = [ pkgconfig ];
+
   NIX_CFLAGS_COMPILE = "-I${xorg.xproto}/include -I${libXft.dev}/include";
 
   patchPhase = ''
-    sed -e "s@ldconfig@@" -i Makefile
+    cd source
+    # use pkg-config instead of pkgcon:
+    sed -e 's/pkgconf/pkg-config/g' -i ./Makefile
+    # don't run ldconfig:
+    sed -e "/ldconfig/d" -i ./Makefile
+    # make sure it can find clxclient.h:
+    sed -e 's/<clxclient.h>/"clxclient.h"/' -i ./enumip.cc
   '';
 
   makeFlags = [
diff --git a/pkgs/development/libraries/libcouchbase/default.nix b/pkgs/development/libraries/libcouchbase/default.nix
index 4da0738fde5e..e3d5c7d6424e 100644
--- a/pkgs/development/libraries/libcouchbase/default.nix
+++ b/pkgs/development/libraries/libcouchbase/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "libcouchbase-${version}";
-  version = "2.9.4";
+  version = "2.9.5";
 
   src = fetchFromGitHub {
     owner = "couchbase";
     repo = "libcouchbase";
     rev = version;
-    sha256 = "0d6lmnr5yfpkzr1yr6f2ilxprl6v9r4r7917k4iz0wc3jlcndwl3";
+    sha256 = "18l3579b47l8d6nhv0xls8pybkqdmdkw8jg4inalnx3g7ydqfn00";
   };
 
   cmakeFlags = "-DLCB_NO_MOCK=ON";
diff --git a/pkgs/development/libraries/libdaemon/default.nix b/pkgs/development/libraries/libdaemon/default.nix
index 59e576fd3923..5dc153dd5ccc 100644
--- a/pkgs/development/libraries/libdaemon/default.nix
+++ b/pkgs/development/libraries/libdaemon/default.nix
@@ -1,6 +1,6 @@
 {stdenv, fetchurl}:
 
-stdenv.mkDerivation (rec {
+stdenv.mkDerivation rec {
   name = "libdaemon-0.14";
 
   src = fetchurl {
@@ -8,6 +8,8 @@ stdenv.mkDerivation (rec {
     sha256 = "0d5qlq5ab95wh1xc87rqrh1vx6i8lddka1w3f1zcqvcqdxgyn8zx";
   };
 
+  patches = [ ./fix-includes.patch ];
+
   configureFlags = [ "--disable-lynx" ]
     ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
     [ # Can't run this test while cross-compiling
@@ -16,16 +18,8 @@ stdenv.mkDerivation (rec {
 
   meta = {
     description = "Lightweight C library that eases the writing of UNIX daemons";
-
     homepage = http://0pointer.de/lennart/projects/libdaemon/;
-
     license = stdenv.lib.licenses.lgpl2Plus;
-
     platforms = stdenv.lib.platforms.unix;
-    maintainers = [ ];
   };
-} // stdenv.lib.optionalAttrs stdenv.hostPlatform.isMusl {
-  # This patch should be applied unconditionally, but doing so will cause mass rebuild.
-  patches = ./fix-includes.patch;
-})
-
+}
diff --git a/pkgs/development/libraries/libdap/default.nix b/pkgs/development/libraries/libdap/default.nix
index 5a0006ad6c6e..d399998455e1 100644
--- a/pkgs/development/libraries/libdap/default.nix
+++ b/pkgs/development/libraries/libdap/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, bison, libuuid, curl, libxml2, flex }:
 
 stdenv.mkDerivation rec {
-  version = "3.19.1";
+  version = "3.20.0";
   name = "libdap-${version}";
 
   nativeBuildInputs = [ bison flex ];
@@ -9,12 +9,12 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "https://www.opendap.org/pub/source/${name}.tar.gz";
-    sha256 = "0gnki93z3kkzp65x7n1kancy7bd503j4qja5fhzvm1gkmi5l65aj";
+    sha256 = "0cr3d7dlzq583dqqrkbs1bkcrwag4hp7hwrx5c0mjk7q4vrslh92";
   };
 
   meta = with stdenv.lib; {
     description = "A C++ SDK which contains an implementation of DAP";
-    homepage = https://www.opendap.org/download/libdap;
+    homepage = https://www.opendap.org/software/libdap;
     license = licenses.lgpl2;
     maintainers = [ maintainers.bzizou ];
     platforms = platforms.linux;
diff --git a/pkgs/development/libraries/libdbusmenu-qt/default.nix b/pkgs/development/libraries/libdbusmenu-qt/default.nix
index 1342ee6773f7..72c3ca0e2b05 100644
--- a/pkgs/development/libraries/libdbusmenu-qt/default.nix
+++ b/pkgs/development/libraries/libdbusmenu-qt/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
   meta = with stdenv.lib; {
     description = "Provides a Qt implementation of the DBusMenu spec";
     inherit homepage;
-    maintainers = [ ];
     inherit (qt4.meta) platforms;
+    license = licenses.lgpl2;
   };
 }
diff --git a/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix b/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix
index 9c25757efb03..60572e7676b2 100644
--- a/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix
+++ b/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix
@@ -19,5 +19,6 @@ stdenv.mkDerivation {
     description = "Provides a Qt implementation of the DBusMenu spec";
     maintainers = [ maintainers.ttuegel ];
     inherit (qtbase.meta) platforms;
+    license = licenses.lgpl2;
   };
 }
diff --git a/pkgs/development/libraries/libdrm/default.nix b/pkgs/development/libraries/libdrm/default.nix
index 5107d8898d46..761216f420bb 100644
--- a/pkgs/development/libraries/libdrm/default.nix
+++ b/pkgs/development/libraries/libdrm/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, libpthreadstubs, libpciaccess, valgrind-light }:
 
 stdenv.mkDerivation rec {
-  name = "libdrm-2.4.93";
+  name = "libdrm-2.4.94";
 
   src = fetchurl {
     url = "https://dri.freedesktop.org/libdrm/${name}.tar.bz2";
-    sha256 = "0g6d9wsnb7lx8r1m4kq8js0wsc5jl20cz1csnlh6z9s8jpfd313f";
+    sha256 = "1ghn3l1dv1rsp9z6jpmy4ryna1s8rm4xx0ds532041bnlfq5jg5p";
   };
 
   outputs = [ "out" "dev" "bin" ];
diff --git a/pkgs/development/libraries/libexttextcat/default.nix b/pkgs/development/libraries/libexttextcat/default.nix
index 8d264c929a5b..7b3df42c24c3 100644
--- a/pkgs/development/libraries/libexttextcat/default.nix
+++ b/pkgs/development/libraries/libexttextcat/default.nix
@@ -8,9 +8,10 @@ stdenv.mkDerivation rec {
     sha256 = "1j6sjwkyhqvsgyw938bxxfwkzzi1mahk66g5342lv6j89jfvrz8k";
   };
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "An N-Gram-Based Text Categorization library primarily intended for language guessing";
     homepage = https://wiki.documentfoundation.org/Libexttextcat;
-    platforms = stdenv.lib.platforms.all;
+    platforms = platforms.all;
+    license = licenses.bsd3;
   };
 }
diff --git a/pkgs/development/libraries/libgdiplus/default.nix b/pkgs/development/libraries/libgdiplus/default.nix
index 5e94d00dcdb7..d54f9203d23d 100644
--- a/pkgs/development/libraries/libgdiplus/default.nix
+++ b/pkgs/development/libraries/libgdiplus/default.nix
@@ -34,7 +34,10 @@ stdenv.mkDerivation rec {
     ln -s $out/lib/libgdiplus.0.dylib $out/lib/libgdiplus.so
   '';
 
-  meta = {
-    platforms = stdenv.lib.platforms.unix;
+  meta = with stdenv.lib; {
+    description = "Mono library that provides a GDI+-compatible API on non-Windows operating systems";
+    homepage = https://www.mono-project.com/docs/gui/libgdiplus/;
+    platforms = platforms.unix;
+    license = licenses.mit;
   };
 }
diff --git a/pkgs/development/libraries/libgnome-keyring/default.nix b/pkgs/development/libraries/libgnome-keyring/default.nix
index e7157afbaee5..8dcbab95e976 100644
--- a/pkgs/development/libraries/libgnome-keyring/default.nix
+++ b/pkgs/development/libraries/libgnome-keyring/default.nix
@@ -16,5 +16,6 @@ stdenv.mkDerivation {
 
   meta = {
     inherit (glib.meta) platforms maintainers;
+    license = with stdenv.lib.licenses; [ gpl2 lgpl2 ];
   };
 }
diff --git a/pkgs/development/libraries/libgnurl/default.nix b/pkgs/development/libraries/libgnurl/default.nix
index 33276b424e7c..752d2ce5a1e7 100644
--- a/pkgs/development/libraries/libgnurl/default.nix
+++ b/pkgs/development/libraries/libgnurl/default.nix
@@ -33,5 +33,6 @@ stdenv.mkDerivation rec {
     homepage    = https://gnunet.org/gnurl;
     maintainers = with maintainers; [ falsifian vrthra ];
     platforms = platforms.linux;
+    license = with licenses; [ bsdOriginal mit ];
   };
 }
diff --git a/pkgs/development/libraries/libgsf/default.nix b/pkgs/development/libraries/libgsf/default.nix
index 20a08885142a..bcd37396bf7f 100644
--- a/pkgs/development/libraries/libgsf/default.nix
+++ b/pkgs/development/libraries/libgsf/default.nix
@@ -2,11 +2,11 @@
 , python, perl, gdk_pixbuf, libiconv, libintl }:
 
 stdenv.mkDerivation rec {
-  name = "libgsf-1.14.42";
+  name = "libgsf-1.14.44";
 
   src = fetchurl {
     url    = "mirror://gnome/sources/libgsf/1.14/${name}.tar.xz";
-    sha256 = "1hhdz0ymda26q6bl5ygickkgrh998lxqq4z9i8dzpcvqna3zpzr9";
+    sha256 = "1ppzfk3zmmgrg9jh8vc4dacddbfngjslq2wpj94pcr3i0c8dxgk8";
   };
 
   nativeBuildInputs = [ pkgconfig intltool libintl ];
diff --git a/pkgs/development/libraries/libgtop/default.nix b/pkgs/development/libraries/libgtop/default.nix
index d0be9e25b87e..bab7ede2d6e8 100644
--- a/pkgs/development/libraries/libgtop/default.nix
+++ b/pkgs/development/libraries/libgtop/default.nix
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "04mnxgzyb26wqk6qij4iw8cxwl82r8pcsna5dg8vz2j3pdi0wv2g";
   };
 
diff --git a/pkgs/development/libraries/libgudev/default.nix b/pkgs/development/libraries/libgudev/default.nix
index 54760549a164..e07622eb13af 100644
--- a/pkgs/development/libraries/libgudev/default.nix
+++ b/pkgs/development/libraries/libgudev/default.nix
@@ -9,7 +9,7 @@ in stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "ee4cb2b9c573cdf354f6ed744f01b111d4b5bed3503ffa956cefff50489c7860";
   };
 
diff --git a/pkgs/development/libraries/libguestfs/default.nix b/pkgs/development/libraries/libguestfs/default.nix
index 6001946cb970..aad6365e4c2d 100644
--- a/pkgs/development/libraries/libguestfs/default.nix
+++ b/pkgs/development/libraries/libguestfs/default.nix
@@ -11,11 +11,11 @@ assert javaSupport -> jdk != null;
 
 stdenv.mkDerivation rec {
   name = "libguestfs-${version}";
-  version = "1.38.4";
+  version = "1.38.6";
 
   src = fetchurl {
     url = "http://libguestfs.org/download/1.38-stable/libguestfs-${version}.tar.gz";
-    sha256 = "1xsazw6yrbgmc647j8l896fzv534157sqmdzac09rxkxwiy0wm16";
+    sha256 = "1v2mggx2jlaq4m3p5shc46gzf7vmaayha6r0nwdnyzd7x6q0is7p";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/libharu/default.nix b/pkgs/development/libraries/libharu/default.nix
index 5d120f61e086..0830b45b308b 100644
--- a/pkgs/development/libraries/libharu/default.nix
+++ b/pkgs/development/libraries/libharu/default.nix
@@ -15,6 +15,6 @@ stdenv.mkDerivation {
     homepage = http://libharu.org/;
     license = stdenv.lib.licenses.zlib;
     maintainers = [ stdenv.lib.maintainers.marcweber ];
-    platforms = stdenv.lib.platforms.linux;
+    platforms = stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/libhttpseverywhere/default.nix b/pkgs/development/libraries/libhttpseverywhere/default.nix
index 91e8e2d50f19..81e5f0fe73ea 100644
--- a/pkgs/development/libraries/libhttpseverywhere/default.nix
+++ b/pkgs/development/libraries/libhttpseverywhere/default.nix
@@ -8,7 +8,7 @@ in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "1jmn6i4vsm89q1axlq4ajqkzqmlmjaml9xhw3h9jnal46db6y00w";
   };
 
diff --git a/pkgs/development/libraries/libicns/default.nix b/pkgs/development/libraries/libicns/default.nix
index 08d80bcf9856..298d6124505c 100644
--- a/pkgs/development/libraries/libicns/default.nix
+++ b/pkgs/development/libraries/libicns/default.nix
@@ -10,7 +10,10 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libpng jasper ];
 
-  meta = {
-    platforms = stdenv.lib.platforms.unix;
+  meta = with stdenv.lib; {
+    description = "Library for manipulation of the Mac OS icns resource format";
+    homepage = https://icns.sourceforge.io;
+    license = with licenses; [ gpl2 lgpl2 lgpl21 ];
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/libimagequant/default.nix b/pkgs/development/libraries/libimagequant/default.nix
new file mode 100644
index 000000000000..d232e268f309
--- /dev/null
+++ b/pkgs/development/libraries/libimagequant/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchFromGitHub, unzip }:
+
+with stdenv;
+
+let
+  version = "2.12.1";
+in
+  mkDerivation {
+    name = "libimagequant-${version}";
+    src = fetchFromGitHub {
+      owner = "ImageOptim";
+      repo = "libimagequant";
+      rev = "${version}";
+      sha256 = "0r7zgsnhqci2rjilh9bzw43miwp669k6b7q16hdjzrq4nr0xpvbl";
+    };
+
+    preConfigure = ''
+      patchShebangs ./configure
+    '';
+
+    meta = {
+      homepage = https://pngquant.org/lib/;
+      description = "Image quantization library";
+      longDescription = "Small, portable C library for high-quality conversion of RGBA images to 8-bit indexed-color (palette) images.";
+      license = lib.licenses.gpl3Plus;
+      platforms = lib.platforms.unix;
+      maintainers = with lib.maintainers; [ ma9e ];
+    };
+  }
diff --git a/pkgs/development/libraries/libinput/default.nix b/pkgs/development/libraries/libinput/default.nix
index d42bd315d22f..e2d7d09b259c 100644
--- a/pkgs/development/libraries/libinput/default.nix
+++ b/pkgs/development/libraries/libinput/default.nix
@@ -16,11 +16,11 @@ in
 with stdenv.lib;
 stdenv.mkDerivation rec {
   name = "libinput-${version}";
-  version = "1.11.3";
+  version = "1.12.1";
 
   src = fetchurl {
     url = "https://www.freedesktop.org/software/libinput/${name}.tar.xz";
-    sha256 = "01nb1shnl871d939wgfd7nc9svclcnfjfhlq64b4yns2dvcr24gk";
+    sha256 = "14l6bvgq76ls63qc9c448r435q9xiig0rv8ilx6rnjvlgg64h32p";
   };
 
   outputs = [ "bin" "out" "dev" ];
@@ -46,12 +46,6 @@ stdenv.mkDerivation rec {
 
   patches = [ ./udev-absolute-path.patch ];
 
-   preBuild = ''
-    # meson setup-hook changes the directory so the files are located one level up
-    patchShebangs ../udev/parse_hwdb.py
-    patchShebangs ../test/symbols-leak-test.in
-  '';
-
   doCheck = testsSupport;
 
   meta = {
diff --git a/pkgs/development/libraries/libinput/udev-absolute-path.patch b/pkgs/development/libraries/libinput/udev-absolute-path.patch
index fb22fea40e80..5c85b8639486 100644
--- a/pkgs/development/libraries/libinput/udev-absolute-path.patch
+++ b/pkgs/development/libraries/libinput/udev-absolute-path.patch
@@ -5,7 +5,7 @@
  
  udev_rules_config = configuration_data()
 -udev_rules_config.set('UDEV_TEST_PATH', '')
-+udev_rules_config.set('UDEV_TEST_PATH', udev_dir + '/')
++udev_rules_config.set('UDEV_TEST_PATH', dir_udev + '/')
  configure_file(input : 'udev/80-libinput-device-groups.rules.in',
  	       output : '80-libinput-device-groups.rules',
  	       install : true,
diff --git a/pkgs/development/libraries/libiodbc/default.nix b/pkgs/development/libraries/libiodbc/default.nix
index 738c11161955..faa070b3468c 100644
--- a/pkgs/development/libraries/libiodbc/default.nix
+++ b/pkgs/development/libraries/libiodbc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, gtk2, useGTK ? false }:
+{ stdenv, fetchurl, pkgconfig, gtk2, Carbon, useGTK ? false }:
 
 stdenv.mkDerivation rec {
   name = "libiodbc-3.52.12";
@@ -9,16 +9,18 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = stdenv.lib.optionals useGTK [ gtk2 ];
+  buildInputs = stdenv.lib.optionals useGTK [ gtk2 ]
+                ++ stdenv.lib.optional stdenv.isDarwin Carbon;
 
   preBuild =
     ''
       export NIX_LDFLAGS_BEFORE="-rpath $out/lib"
     '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "iODBC driver manager";
     homepage = http://www.iodbc.org;
-    platforms = stdenv.lib.platforms.linux;
+    platforms = platforms.unix;
+    license = licenses.bsd3;
   };
 }
diff --git a/pkgs/development/libraries/libisoburn/default.nix b/pkgs/development/libraries/libisoburn/default.nix
index 6e7764176091..ce2028e805dc 100644
--- a/pkgs/development/libraries/libisoburn/default.nix
+++ b/pkgs/development/libraries/libisoburn/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "libisoburn-${version}";
-  version = "1.4.8";
+  version = "1.5.0";
 
   src = fetchurl {
     url = "http://files.libburnia-project.org/releases/${name}.tar.gz";
-    sha256 = "19d53j17pn18vfxxqqlqwam5lm21ljyp8nai5434068g7x3m1kwi";
+    sha256 = "1r8xbhw21bmcp3jhfmvadivh0fa7f4k6larv8lvg4ka0kiigbhfs";
   };
 
   buildInputs = [ attr zlib libburn libisofs ];
diff --git a/pkgs/development/libraries/libite/default.nix b/pkgs/development/libraries/libite/default.nix
index 7580c1b092e2..0b00cf90ba00 100644
--- a/pkgs/development/libraries/libite/default.nix
+++ b/pkgs/development/libraries/libite/default.nix
@@ -31,6 +31,7 @@ stdenv.mkDerivation rec {
     '';
     platforms = platforms.unix;
     maintainers = with maintainers; [ fpletz ];
+    license = with licenses; [ mit isc bsd2 bsd3 ];
   };
 }
 
diff --git a/pkgs/development/libraries/libjson/default.nix b/pkgs/development/libraries/libjson/default.nix
index a53918fd5f77..c83143dd6b13 100644
--- a/pkgs/development/libraries/libjson/default.nix
+++ b/pkgs/development/libraries/libjson/default.nix
@@ -11,10 +11,17 @@ in stdenv.mkDerivation rec {
   buildInputs = [ unzip ];
   makeFlags = [ "prefix=$(out)" ];
   preInstall = "mkdir -p $out/lib";
-  meta = {
+
+  meta = with stdenv.lib; {
     homepage = http://libjson.sourceforge.net/;
     description = "A JSON reader and writer";
-    longDescription = "A JSON reader and writer which is super-effiecient and usually runs circles around other JSON libraries. It's highly customizable to optimize for your particular project, and very lightweight. For Windows, OSX, or Linux. Works in any language.";
-    platforms = stdenv.lib.platforms.unix;
+    longDescription = ''
+      A JSON reader and writer which is super-efficient and
+      usually runs circles around other JSON libraries.
+      It's highly customizable to optimize for your particular project, and
+      very lightweight. For Windows, OSX, or Linux. Works in any language.
+    '';
+    platforms = platforms.unix;
+    license = licenses.bsd2;
   };
 }
diff --git a/pkgs/development/libraries/libkate/default.nix b/pkgs/development/libraries/libkate/default.nix
index 6c7e5881a784..7eff302397aa 100644
--- a/pkgs/development/libraries/libkate/default.nix
+++ b/pkgs/development/libraries/libkate/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libogg libpng ];
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "A library for encoding and decoding Kate streams";
     longDescription = ''
       This is libkate, the reference implementation of a codec for the Kate
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
       in an Ogg container. It can carry Unicode text, images, and animate
       them.'';
     homepage = https://code.google.com/archive/p/libkate/;
-    maintainers = [ ];
-    platforms = stdenv.lib.platforms.unix;
+    platforms = platforms.unix;
+    license = licenses.bsd3;
   };
 }
diff --git a/pkgs/development/libraries/liblastfm/default.nix b/pkgs/development/libraries/liblastfm/default.nix
index 331422dd8929..b7d90100837c 100644
--- a/pkgs/development/libraries/liblastfm/default.nix
+++ b/pkgs/development/libraries/liblastfm/default.nix
@@ -18,11 +18,12 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig which cmake ];
   buildInputs = stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.SystemConfiguration;
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = https://github.com/lastfm/liblastfm;
     repositories.git = git://github.com/lastfm/liblastfm.git;
     description = "Official LastFM library";
     inherit (qt4.meta) platforms;
-    maintainers = with stdenv.lib.maintainers; [ phreedom ];
+    maintainers =  [ maintainers.phreedom ];
+    license = licenses.gpl3;
   };
 }
diff --git a/pkgs/development/libraries/liblastfmSF/default.nix b/pkgs/development/libraries/liblastfmSF/default.nix
index 73d996c5ec86..d9f460d44e8c 100644
--- a/pkgs/development/libraries/liblastfmSF/default.nix
+++ b/pkgs/development/libraries/liblastfmSF/default.nix
@@ -15,5 +15,6 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://liblastfm.sourceforge.net;
     description = "Unofficial C lastfm library";
+    license = stdenv.lib.licenses.gpl3;
   };
 }
diff --git a/pkgs/development/libraries/liblinear/default.nix b/pkgs/development/libraries/liblinear/default.nix
index ea05df45169f..5f295009b994 100644
--- a/pkgs/development/libraries/liblinear/default.nix
+++ b/pkgs/development/libraries/liblinear/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "liblinear-${version}";
-  version = "2.20";
+  version = "2.21";
 
   src = fetchurl {
     url = "https://www.csie.ntu.edu.tw/~cjlin/liblinear/liblinear-${version}.tar.gz";
-    sha256 = "13q48azqy9pd8jyhk0c2hzj5xav1snbdrj8pp38vwrv2wwhfz7rz";
+    sha256 = "0jp0z3s32czf748i6dnlabs1psqx1dcn9w96c56m24xq5l789chs";
   };
 
   buildPhase = ''
diff --git a/pkgs/development/libraries/liblqr-1/default.nix b/pkgs/development/libraries/liblqr-1/default.nix
index 4b445c93175f..aa6922ea3421 100644
--- a/pkgs/development/libraries/liblqr-1/default.nix
+++ b/pkgs/development/libraries/liblqr-1/default.nix
@@ -15,6 +15,6 @@ stdenv.mkDerivation rec {
     homepage = http://liblqr.wikidot.com;
     description = "Seam-carving C/C++ library called Liquid Rescaling";
     platforms = platforms.all;
-    maintainers = [ ];
+    license = with licenses; [ gpl3 lgpl3 ];
   };
 }
diff --git a/pkgs/development/libraries/libmesode/default.nix b/pkgs/development/libraries/libmesode/default.nix
index 1becd0ee8ef6..e46eb9208de6 100644
--- a/pkgs/development/libraries/libmesode/default.nix
+++ b/pkgs/development/libraries/libmesode/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "libmesode-${version}";
-  version = "0.9.1";
+  version = "0.9.2";
 
   src = fetchFromGitHub {
     owner = "boothj5";
     repo = "libmesode";
     rev = version;
-    sha256 = "1zb1x422zkpnxrz9d2b7pmi8ms60lbw49yh78mydqfypsmj2iyfh";
+    sha256 = "06f5nfaypvxrbsinxa1k2vrxrs7kqmg38g4wwwk5d63hpn1pj8ak";
   };
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
diff --git a/pkgs/development/libraries/libmilter/default.nix b/pkgs/development/libraries/libmilter/default.nix
index bd0cd9fe9041..7e3c45634d9e 100644
--- a/pkgs/development/libraries/libmilter/default.nix
+++ b/pkgs/development/libraries/libmilter/default.nix
@@ -37,5 +37,6 @@ stdenv.mkDerivation rec {
     description = "Sendmail Milter mail filtering API library";
     platforms = platforms.unix;
     maintainers = with maintainers; [ fpletz ];
+    license = licenses.sendmail;
   };
 }
diff --git a/pkgs/development/libraries/libmms/default.nix b/pkgs/development/libraries/libmms/default.nix
index d1dd7860de4e..7f73fb09cd16 100644
--- a/pkgs/development/libraries/libmms/default.nix
+++ b/pkgs/development/libraries/libmms/default.nix
@@ -12,9 +12,10 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig ];
 
-  meta = {
+  meta = with stdenv.lib; {
+    description = "Library for downloading (streaming) media files using the mmst and mmsh protocols";
     homepage = http://libmms.sourceforge.net;
-    maintainers = [ ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = platforms.all;
+    license = licenses.lgpl21;
   };
 }
diff --git a/pkgs/development/libraries/libmp3splt/default.nix b/pkgs/development/libraries/libmp3splt/default.nix
index af8297e98549..52072000115c 100644
--- a/pkgs/development/libraries/libmp3splt/default.nix
+++ b/pkgs/development/libraries/libmp3splt/default.nix
@@ -19,5 +19,6 @@ stdenv.mkDerivation rec {
     description = "Utility to split mp3, ogg vorbis and FLAC files without decoding";
     maintainers = with maintainers; [ bosu ];
     platforms   = platforms.unix;
+    license = licenses.gpl2;
   };
 }
diff --git a/pkgs/development/libraries/libmtp/default.nix b/pkgs/development/libraries/libmtp/default.nix
index c3061626a6ae..1d8dd7e20f14 100644
--- a/pkgs/development/libraries/libmtp/default.nix
+++ b/pkgs/development/libraries/libmtp/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   # tried to install files to /lib/udev, hopefully OK
   configureFlags = [ "--with-udev=$$bin/lib/udev" ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://libmtp.sourceforge.net;
     description = "An implementation of Microsoft's Media Transfer Protocol";
     longDescription = ''
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
       in the form of a library suitable primarily for POSIX compliant operating
       systems. We implement MTP Basic, the stuff proposed for standardization.
       '';
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = [ ];
+    platforms = platforms.unix;
+    license = licenses.lgpl21;
   };
 }
diff --git a/pkgs/development/libraries/libmusicbrainz/5.x.nix b/pkgs/development/libraries/libmusicbrainz/5.x.nix
index f197d5bcef98..2b59adf8f922 100644
--- a/pkgs/development/libraries/libmusicbrainz/5.x.nix
+++ b/pkgs/development/libraries/libmusicbrainz/5.x.nix
@@ -16,14 +16,14 @@ stdenv.mkDerivation rec {
 
   dontUseCmakeBuildDir=true;
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://musicbrainz.org/doc/libmusicbrainz;
     description = "MusicBrainz Client Library (5.x version)";
     longDescription = ''
       The libmusicbrainz (also known as mb_client or MusicBrainz Client
       Library) is a development library geared towards developers who wish to
       add MusicBrainz lookup capabilities to their applications.'';
-    maintainers = [ ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = platforms.all;
+    license = licenses.lgpl21;
   };
 }
diff --git a/pkgs/development/libraries/libmusicbrainz/default.nix b/pkgs/development/libraries/libmusicbrainz/default.nix
index 596399c4fa8f..5335b6577f0a 100644
--- a/pkgs/development/libraries/libmusicbrainz/default.nix
+++ b/pkgs/development/libraries/libmusicbrainz/default.nix
@@ -10,14 +10,14 @@ stdenv.mkDerivation rec {
     sha256 = "1i9qly13bwwmgj68vma766hgvsd1m75236haqsp9zgh5znlmkm3z";
   };
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://musicbrainz.org/doc/libmusicbrainz;
     description = "MusicBrainz Client Library (3.x version)";
     longDescription = ''
       The libmusicbrainz (also known as mb_client or MusicBrainz Client
       Library) is a development library geared towards developers who wish to
       add MusicBrainz lookup capabilities to their applications.'';
-    maintainers = [ ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = platforms.all;
+    license = licenses.lgpl21;
   };
 }
diff --git a/pkgs/development/libraries/libnatspec/default.nix b/pkgs/development/libraries/libnatspec/default.nix
index 9b692e9e3b2e..db4f6f5d4688 100644
--- a/pkgs/development/libraries/libnatspec/default.nix
+++ b/pkgs/development/libraries/libnatspec/default.nix
@@ -12,11 +12,11 @@ stdenv.mkDerivation (rec {
 
   buildInputs = [ popt ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://natspec.sourceforge.net/ ;
     description = "A library intended to smooth national specificities in using of programs";
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = [ ];
+    platforms = platforms.unix;
+    license = licenses.lgpl21;
   };
 } // stdenv.lib.optionalAttrs (!stdenv.isLinux) {
   propagatedBuildInputs = [ libiconv ];
diff --git a/pkgs/development/libraries/libnetfilter_queue/default.nix b/pkgs/development/libraries/libnetfilter_queue/default.nix
index 12a45d088ef6..94b3dc90a0b6 100644
--- a/pkgs/development/libraries/libnetfilter_queue/default.nix
+++ b/pkgs/development/libraries/libnetfilter_queue/default.nix
@@ -12,10 +12,10 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ libmnl libnfnetlink ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://www.netfilter.org/projects/libnetfilter_queue/;
     description = "Userspace API to packets queued by the kernel packet filter";
-
-    platforms = stdenv.lib.platforms.linux;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/libnice/default.nix b/pkgs/development/libraries/libnice/default.nix
index 1f58545574cd..8582dc4e1d90 100644
--- a/pkgs/development/libraries/libnice/default.nix
+++ b/pkgs/development/libraries/libnice/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # fails with "fatal error: nice/agent.h: No such file or directory"
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = https://nice.freedesktop.org/wiki/;
     description = "The GLib ICE implementation";
     longDescription = ''
@@ -24,6 +24,7 @@ stdenv.mkDerivation rec {
 
       It provides a GLib-based library, libnice and a Glib-free library,
       libstun as well as GStreamer elements.'';
-    platforms = stdenv.lib.platforms.linux;
+    platforms = platforms.linux;
+    license = with licenses; [ lgpl21 mpl11 ];
   };
 }
diff --git a/pkgs/development/libraries/libnotify/default.nix b/pkgs/development/libraries/libnotify/default.nix
index fbde49a54d08..11f2731eb725 100644
--- a/pkgs/development/libraries/libnotify/default.nix
+++ b/pkgs/development/libraries/libnotify/default.nix
@@ -17,9 +17,10 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig autoreconfHook gobjectIntrospection ];
   buildInputs = [ glib gdk_pixbuf ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = https://developer.gnome.org/notification-spec/;
     description = "A library that sends desktop notifications to a notification daemon";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = platforms.unix;
+    license = licenses.lgpl21;
   };
 }
diff --git a/pkgs/development/libraries/libnova/default.nix b/pkgs/development/libraries/libnova/default.nix
index a66a1a88c743..cb70d803ac0c 100644
--- a/pkgs/development/libraries/libnova/default.nix
+++ b/pkgs/development/libraries/libnova/default.nix
@@ -2,15 +2,16 @@
 
 stdenv.mkDerivation rec {
   name = "libnova-0.12.3";
-	
+
   src = fetchurl {
     url = "mirror://sourceforge/libnova/${name}.tar.gz";
     sha256 = "18mkx79gyhccp5zqhf6k66sbhv97s7839sg15534ijajirkhw9dc";
   };
-  
-  meta = {
+
+  meta = with stdenv.lib; {
     description = "Celestial Mechanics, Astrometry and Astrodynamics Library";
     homepage = http://libnova.sf.net;
-    platforms = stdenv.lib.platforms.unix;
+    platforms = platforms.unix;
+    license = licenses.gpl2;
   };
 }
diff --git a/pkgs/development/libraries/liboauth/default.nix b/pkgs/development/libraries/liboauth/default.nix
index 855d921206e9..ea792b007bae 100644
--- a/pkgs/development/libraries/liboauth/default.nix
+++ b/pkgs/development/libraries/liboauth/default.nix
@@ -25,6 +25,7 @@ stdenv.mkDerivation rec {
     description = "C library implementing the OAuth secure authentication protocol";
     homepage = http://liboauth.sourceforge.net/;
     repositories.git = https://github.com/x42/liboauth.git;
+    license = licenses.mit;
   };
 
 }
diff --git a/pkgs/development/libraries/libofa/default.nix b/pkgs/development/libraries/libofa/default.nix
index 531e30ba7552..8131420cfd65 100644
--- a/pkgs/development/libraries/libofa/default.nix
+++ b/pkgs/development/libraries/libofa/default.nix
@@ -27,12 +27,13 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ expat curl fftw ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = https://code.google.com/archive/p/musicip-libofa/;
     description = "Library Open Fingerprint Architecture";
     longDescription = ''
       LibOFA (Library Open Fingerprint Architecture) is an open-source audio
       fingerprint created and provided by MusicIP'';
-    platforms = stdenv.lib.platforms.linux;
+    platforms = platforms.linux;
+    license = licenses.gpl2;
   };
 }
diff --git a/pkgs/development/libraries/liboggz/default.nix b/pkgs/development/libraries/liboggz/default.nix
index f6fe9ecd03a0..d7c3b747924a 100644
--- a/pkgs/development/libraries/liboggz/default.nix
+++ b/pkgs/development/libraries/liboggz/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = https://xiph.org/oggz/;
     description = "A C library and tools for manipulating with Ogg files and streams";
     longDescription = ''
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
       interleaving data container developed by Monty at Xiph.Org, originally to
       support the Ogg Vorbis audio format but now used for many free codecs
       including Dirac, FLAC, Speex and Theora.'';
-    maintainers = [ ];
-    platforms = stdenv.lib.platforms.unix;
+    platforms = platforms.unix;
+    license = licenses.bsd3;
   };
 }
diff --git a/pkgs/development/libraries/libpcap/default.nix b/pkgs/development/libraries/libpcap/default.nix
index f94f327ea02e..267859cb217c 100644
--- a/pkgs/development/libraries/libpcap/default.nix
+++ b/pkgs/development/libraries/libpcap/default.nix
@@ -50,5 +50,6 @@ stdenv.mkDerivation rec {
     description = "Packet Capture Library";
     platforms = platforms.unix;
     maintainers = with maintainers; [ fpletz ];
+    license = licenses.bsd3;
   };
 }
diff --git a/pkgs/development/libraries/libpqxx/default.nix b/pkgs/development/libraries/libpqxx/default.nix
index 5afed2b2a2f5..fbee81ab677a 100644
--- a/pkgs/development/libraries/libpqxx/default.nix
+++ b/pkgs/development/libraries/libpqxx/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "libpqxx-${version}";
-  version = "6.2.4";
+  version = "6.2.5";
 
   src = fetchFromGitHub {
     owner = "jtv";
     repo = "libpqxx";
     rev = version;
-    sha256 = "18fkyfa3a917ljmarf3jy8ycdhqzpc47cj87542sjpxnpaj9hy59";
+    sha256 = "15x9xlj2v66w81j90cb438qkrrcqaq4dqrvhllwyqfz4lprqnhh9";
   };
 
   nativeBuildInputs = [ gnused python2 ];
diff --git a/pkgs/development/libraries/libqalculate/default.nix b/pkgs/development/libraries/libqalculate/default.nix
index 377d9fe50be7..2c25d4181196 100644
--- a/pkgs/development/libraries/libqalculate/default.nix
+++ b/pkgs/development/libraries/libqalculate/default.nix
@@ -42,6 +42,7 @@ stdenv.mkDerivation rec {
     description = "An advanced calculator library";
     homepage = http://qalculate.github.io;
     maintainers = with maintainers; [ gebner ];
+    license = licenses.gpl2Plus;
     platforms = platforms.all;
   };
 }
diff --git a/pkgs/development/libraries/libqtav/default.nix b/pkgs/development/libraries/libqtav/default.nix
index b291ec2fdf0b..048ba48bb674 100644
--- a/pkgs/development/libraries/libqtav/default.nix
+++ b/pkgs/development/libraries/libqtav/default.nix
@@ -1,6 +1,6 @@
 { mkDerivation, lib, fetchFromGitHub, extra-cmake-modules
 , qtbase, qtmultimedia, qtquick1, qttools
-, libGLU_combined, libX11
+, libGL, libX11
 , libass, openal, ffmpeg, libuchardet
 , alsaLib, libpulseaudio, libva
 }:
@@ -14,7 +14,7 @@ mkDerivation rec {
   nativeBuildInputs = [ extra-cmake-modules qttools ];
   buildInputs = [
     qtbase qtmultimedia qtquick1
-    libGLU_combined libX11
+    libGL libX11
     libass openal ffmpeg libuchardet
     alsaLib libpulseaudio libva
   ];
@@ -27,18 +27,20 @@ mkDerivation rec {
     fetchSubmodules = true;
   };
 
-  # Make sure libqtav finds its libGL dependancy at both link and run time
-  # by adding libGLU_combined to rpath. Not sure why it wasn't done automatically like
-  # the other libraries as `libGLU_combined` is part of our `buildInputs`.
-  NIX_CFLAGS_LINK = [ "-Wl,-rpath,${libGLU_combined}/lib"];
+  # Make sure libqtav finds its libGL dependency at both link and run time
+  # by adding libGL to rpath. Not sure why it wasn't done automatically like
+  # the other libraries as `libGL` is part of our `buildInputs`.
+  NIX_CFLAGS_LINK = [ "-Wl,-rpath,${libGL}/lib"];
 
   preFixup = ''
     mkdir -p "$out/bin"
     cp -a "./bin/"* "$out/bin"
   '';
 
+  stripDebugList = [ "lib" "libexec" "bin" "qml" ];
+
   meta = {
-    description = "A multimedia playback framework based on Qt + FFmpeg.";
+    description = "A multimedia playback framework based on Qt + FFmpeg";
     #license = licenses.lgpl21; # For the libraries / headers only.
     license = licenses.gpl3; # With the examples (under bin) and most likely some of the optional dependencies used.
     homepage = http://www.qtav.org/;
diff --git a/pkgs/development/libraries/libraw/default.nix b/pkgs/development/libraries/libraw/default.nix
index 9803e09610e6..e009a9f920b1 100644
--- a/pkgs/development/libraries/libraw/default.nix
+++ b/pkgs/development/libraries/libraw/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "libraw-${version}";
-  version = "0.18.12";
+  version = "0.19.0";
 
   src = fetchurl {
     url = "https://www.libraw.org/data/LibRaw-${version}.tar.gz";
-    sha256 = "1m2khr2cij8z6lawgbmdksjn14fpnjsy8ad4qahnpqapm1slsxap";
+    sha256 = "0nfj7s7qmgfy1cl8s3ck7dxjvprfq5glfi6iidmvmy8r7gl52gz8";
   };
 
   outputs = [ "out" "lib" "dev" "doc" ];
diff --git a/pkgs/development/libraries/librdf/redland.nix b/pkgs/development/libraries/librdf/redland.nix
index 422ace462a94..30d8d8a94e9d 100644
--- a/pkgs/development/libraries/librdf/redland.nix
+++ b/pkgs/development/libraries/librdf/redland.nix
@@ -38,8 +38,10 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # fails 1 out of 17 tests with a segmentation fault
 
-  meta = {
+  meta = with stdenv.lib; {
+    description = "C libraries that provide support for the Resource Description Framework (RDF)";
     homepage = http://librdf.org/;
-    platforms = stdenv.lib.platforms.unix;
+    platforms = platforms.unix;
+    license = licenses.asl20;
   };
 }
diff --git a/pkgs/development/libraries/librealsense/default.nix b/pkgs/development/libraries/librealsense/default.nix
index ea24c9da88b9..f91fa192c034 100644
--- a/pkgs/development/libraries/librealsense/default.nix
+++ b/pkgs/development/libraries/librealsense/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "librealsense-${version}";
-  version = "2.15.0";
+  version = "2.16.1";
 
   src = fetchFromGitHub {
     owner = "IntelRealSense";
     repo = "librealsense";
     rev = "v${version}";
-    sha256 = "12918gcn0w5h6bqgx6s44w44bs1x2pcndn2833xzya69rddkdv6x";
+    sha256 = "0vs2vcfmsb574bvdqrfgdmam0p631c738apk0w9mjdqk59zy1bz2";
   };
 
   buildInputs = [
diff --git a/pkgs/development/libraries/libressl/default.nix b/pkgs/development/libraries/libressl/default.nix
index e30f2b0af5d5..1ac4a7185122 100644
--- a/pkgs/development/libraries/libressl/default.nix
+++ b/pkgs/development/libraries/libressl/default.nix
@@ -46,7 +46,7 @@ in {
   };
 
   libressl_2_8 = generic {
-    version = "2.8.0";
-    sha256 = "1hwxg14d6a9wgk360dvi0wfzw7b327a95wf6xqc3a1h6bfbblaxg";
+    version = "2.8.1";
+    sha256 = "0hnga8j7svdbwcy01mh5pxssk7rxq4g5fc5vxrzhid0x1w2zfjrk";
   };
 }
diff --git a/pkgs/development/libraries/librsvg/default.nix b/pkgs/development/libraries/librsvg/default.nix
index 76b7e7ccaee9..7c94919f344a 100644
--- a/pkgs/development/libraries/librsvg/default.nix
+++ b/pkgs/development/libraries/librsvg/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "1qsd0j7s97ab5fzy5b5gix5b7hbw57cr46ia8pkcrr4ylsi80li2";
   };
 
diff --git a/pkgs/development/libraries/libsecret/default.nix b/pkgs/development/libraries/libsecret/default.nix
index fde3c7a7b30e..4fc0d6688d4e 100644
--- a/pkgs/development/libraries/libsecret/default.nix
+++ b/pkgs/development/libraries/libsecret/default.nix
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "1cychxc3ff8fp857iikw0n2s13s2mhw2dn1mr632f7w3sn6vvrww";
   };
 
diff --git a/pkgs/development/libraries/libsndfile/default.nix b/pkgs/development/libraries/libsndfile/default.nix
index a68b5b2b6d5e..b150dd0f59c3 100644
--- a/pkgs/development/libraries/libsndfile/default.nix
+++ b/pkgs/development/libraries/libsndfile/default.nix
@@ -36,6 +36,11 @@ stdenv.mkDerivation rec {
       url = "https://github.com/erikd/libsndfile/commit/85c877d5072866aadbe8ed0c3e0590fbb5e16788.patch";
       sha256 = "0kc7vp22qsxidhvmlc6nfamw7k92n0hcfpmwhb3gaksjamwhb2df";
     })
+    (fetchurl {
+      name = "CVE-2018-13139.patch";
+      url = "https://github.com/erikd/libsndfile/commit/aaea680337267bfb6d2544da878890ee7f1c5077.patch";
+      sha256 = "01q3m7pa3xqkh05ijmfgv064v8flkg4p24bgy9wxnc6wfcdifggx";
+    })
   ];
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/libsoup/default.nix b/pkgs/development/libraries/libsoup/default.nix
index 2804486e2f0a..9849e2600bb0 100644
--- a/pkgs/development/libraries/libsoup/default.nix
+++ b/pkgs/development/libraries/libsoup/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   version = "2.62.2";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "1dkrz1iwsswscayfmjxqv2q00b87snlq9nxdccn5vck0vbinylwy";
   };
 
diff --git a/pkgs/development/libraries/libssh/default.nix b/pkgs/development/libraries/libssh/default.nix
index 9b5c3d530ebf..1ec15e88f13d 100644
--- a/pkgs/development/libraries/libssh/default.nix
+++ b/pkgs/development/libraries/libssh/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, fetchpatch, pkgconfig, cmake, zlib, openssl, libsodium }:
 
 stdenv.mkDerivation rec {
-  name = "libssh-0.7.5";
+  name = "libssh-0.7.6";
 
   src = fetchurl {
-    url = "https://red.libssh.org/attachments/download/218/${name}.tar.xz";
-    sha256 = "15bh6dm9c50ndddzh3gqcgw7axp3ghrspjpkb1z3dr90vkanvs2l";
+    url = "https://www.libssh.org/files/0.7/libssh-0.7.6.tar.xz";
+    sha256 = "14hhdpn2hflywsi9d5bz2pfjxqkyi07znjij89cpakr7b4w7sq0x";
   };
 
   patches = [
diff --git a/pkgs/development/libraries/libssh2/default.nix b/pkgs/development/libraries/libssh2/default.nix
index a6802a7f5183..b050dede8c61 100644
--- a/pkgs/development/libraries/libssh2/default.nix
+++ b/pkgs/development/libraries/libssh2/default.nix
@@ -13,10 +13,11 @@ stdenv.mkDerivation rec {
   buildInputs = [ openssl zlib ]
     ++ stdenv.lib.optional stdenv.hostPlatform.isMinGW windows.mingw_w64;
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "A client-side C library implementing the SSH2 protocol";
     homepage = https://www.libssh2.org;
-    platforms = stdenv.lib.platforms.all;
+    platforms = platforms.all;
+    license = licenses.bsd3;
     maintainers = [ ];
   };
 }
diff --git a/pkgs/development/libraries/libtap/default.nix b/pkgs/development/libraries/libtap/default.nix
index 2671199ab0e0..99e0ab0a4767 100644
--- a/pkgs/development/libraries/libtap/default.nix
+++ b/pkgs/development/libraries/libtap/default.nix
@@ -14,16 +14,16 @@ stdenv.mkDerivation rec{
   nativeBuildInputs = [ pkgconfig ];
   propagatedBuildInputs = [ cmake perl ];
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "A library to implement a test protocol";
     longDescription = ''
       libtap is a library to implement the Test Anything Protocol for
       C originally created by Nik Clayton. This is a maintenance
       branch by Shlomi Fish.
     '';
-    homepage = http://www.shlomifish.org/open-source/projects/libtap/;
+    homepage = https://www.shlomifish.org/open-source/projects/libtap/;
     license = licenses.bsd3;
     maintainers = [ maintainers.AndersonTorres ];
-    platforms = stdenv.lib.platforms.unix;
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/libtiger/default.nix b/pkgs/development/libraries/libtiger/default.nix
index bd0084dbaaf7..7a72fa2b7a31 100644
--- a/pkgs/development/libraries/libtiger/default.nix
+++ b/pkgs/development/libraries/libtiger/default.nix
@@ -16,6 +16,7 @@ stdenv.mkDerivation rec {
     homepage = https://code.google.com/archive/p/libtiger/;
     description = "A rendering library for Kate streams using Pango and Cairo";
     platforms = lib.platforms.unix;
+    license = lib.licenses.lgpl21Plus;
     maintainers = with lib.maintainers; [ matthewbauer ];
   };
 }
diff --git a/pkgs/development/libraries/libtorrent-rasterbar/default.nix b/pkgs/development/libraries/libtorrent-rasterbar/default.nix
index f19e9d274313..6b5182fa992f 100644
--- a/pkgs/development/libraries/libtorrent-rasterbar/default.nix
+++ b/pkgs/development/libraries/libtorrent-rasterbar/default.nix
@@ -3,7 +3,7 @@
 }:
 
 let
-  version = "1.1.9";
+  version = "1.1.10";
   formattedVersion = lib.replaceChars ["."] ["_"] version;
 
   # Make sure we override python, so the correct version is chosen
@@ -17,7 +17,7 @@ in stdenv.mkDerivation {
     owner = "arvidn";
     repo = "libtorrent";
     rev = "libtorrent-${formattedVersion}";
-    sha256 = "04w3pjzd6q9wplj1dcphylxn1i2b2x0iw1l0ma58ymh14swdah7a";
+    sha256 = "0qj1rz52jk95m43cr7l3fi9jmf4pwxncp5mq4hi2vzacfnf79yms";
   };
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/libtoxcore/default.nix b/pkgs/development/libraries/libtoxcore/default.nix
index b3636eef2621..4a8dfc40d4a1 100644
--- a/pkgs/development/libraries/libtoxcore/default.nix
+++ b/pkgs/development/libraries/libtoxcore/default.nix
@@ -49,7 +49,7 @@ in rec {
   };
 
   libtoxcore_0_2 = generic {
-    version = "0.2.3";
-    sha256 = "1z8638cmxssc4jvbf64x549m84pz28729xbxc4c4ss1k792x30ya";
+    version = "0.2.8";
+    sha256 = "0xgnraysz25fbws5zwjk92mwnl8k1yih701qam8kgm3rxh50kyhm";
   };
 }
diff --git a/pkgs/development/libraries/libtxc_dxtn/default.nix b/pkgs/development/libraries/libtxc_dxtn/default.nix
index 21e3a15449c2..b0be3cb3c12d 100644
--- a/pkgs/development/libraries/libtxc_dxtn/default.nix
+++ b/pkgs/development/libraries/libtxc_dxtn/default.nix
@@ -13,9 +13,10 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ autoreconfHook ];
   buildInputs = [ libGLU_combined ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://dri.freedesktop.org/wiki/S3TC;
     repositories.git = git://people.freedesktop.org/~mareko/libtxc_dxtn;
-    platforms = stdenv.lib.platforms.unix;
+    license = licenses.mit;
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/libui/default.nix b/pkgs/development/libraries/libui/default.nix
index b1e6938a1494..9eb2fe04fe68 100644
--- a/pkgs/development/libraries/libui/default.nix
+++ b/pkgs/development/libraries/libui/default.nix
@@ -49,9 +49,10 @@ in
       install_name_tool -id $out/lib/${shortName}.A.dylib $out/lib/${shortName}.A.dylib
     '';
 
-    meta = {
+    meta = with stdenv.lib; {
       homepage    = https://github.com/andlabs/libui;
       description = "Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.";
-      platforms   = stdenv.lib.platforms.unix;
+      license     = licenses.mit;
+      platforms   = platforms.unix;
     };
   }
diff --git a/pkgs/development/libraries/libunistring/default.nix b/pkgs/development/libraries/libunistring/default.nix
index 24da3a8e2c7d..312a5c118103 100644
--- a/pkgs/development/libraries/libunistring/default.nix
+++ b/pkgs/development/libraries/libunistring/default.nix
@@ -19,7 +19,19 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  enableParallelBuilding = true;
+  /* This seems to cause several random failures like these, which I assume
+     is because of bad or missing target dependencies in their build system:
+
+        ./unistdio/test-u16-vasnprintf2.sh: line 16: ./test-u16-vasnprintf1: No such file or directory
+        FAIL unistdio/test-u16-vasnprintf2.sh (exit status: 1)
+
+        FAIL: unistdio/test-u16-vasnprintf3.sh
+        ======================================
+
+        ./unistdio/test-u16-vasnprintf3.sh: line 16: ./test-u16-vasnprintf1: No such file or directory
+        FAIL unistdio/test-u16-vasnprintf3.sh (exit status: 1)
+  */
+  enableParallelBuilding = false;
 
   meta = {
     homepage = http://www.gnu.org/software/libunistring/;
diff --git a/pkgs/development/libraries/libusb/default.nix b/pkgs/development/libraries/libusb/default.nix
index 4704a1e5c331..adf354c45f2e 100644
--- a/pkgs/development/libraries/libusb/default.nix
+++ b/pkgs/development/libraries/libusb/default.nix
@@ -16,7 +16,15 @@ stdenv.mkDerivation {
 
   patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ./fix-headers.patch;
 
-  meta = {
-    platforms = stdenv.lib.platforms.unix;
+  meta = with stdenv.lib; {
+    homepage = "https://libusb.info/";
+    repositories.git = "https://github.com/libusb/libusb-compat-0.1";
+    description = "cross-platform user-mode USB device library";
+    longDescription = ''
+      libusb is a cross-platform user-mode library that provides access to USB devices.
+      The current API is of 1.0 version (libusb-1.0 API), this library is a wrapper exposing the legacy API.
+    '';
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/libusb1/default.nix b/pkgs/development/libraries/libusb1/default.nix
index 7ec714f02237..ac5c38a34f11 100644
--- a/pkgs/development/libraries/libusb1/default.nix
+++ b/pkgs/development/libraries/libusb1/default.nix
@@ -21,10 +21,15 @@ stdenv.mkDerivation rec {
     sed 's,-ludev,-L${systemd.lib}/lib -ludev,' -i $out/lib/libusb-1.0.la
   '';
 
-  meta = {
-    homepage = http://www.libusb.info;
-    description = "User-space USB library";
-    platforms = stdenv.lib.platforms.all;
+  meta = with stdenv.lib; {
+    homepage = "https://libusb.info/";
+    repositories.git = "https://github.com/libusb/libusb";
+    description = "cross-platform user-mode USB device library";
+    longDescription = ''
+      libusb is a cross-platform user-mode library that provides access to USB devices.
+    '';
+    platforms = platforms.all;
+    license = licenses.lgpl21Plus;
     maintainers = [ ];
   };
 }
diff --git a/pkgs/development/libraries/libuv/default.nix b/pkgs/development/libraries/libuv/default.nix
index 067f8fb432d5..e608ea300d1a 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 }:
 
 stdenv.mkDerivation rec {
-  version = "1.23.0";
+  version = "1.23.1";
   name = "libuv-${version}";
 
   src = fetchFromGitHub {
     owner = "libuv";
     repo = "libuv";
     rev = "v${version}";
-    sha256 = "1yfx99f7qnq3qvcgbnih27dgwfg6c51xw6n6n2c3c1wb3mh95im0";
+    sha256 = "14h8dcyx81sbckbgmqhagncyz8s6z6qzpx0fy8p79whq5hb3f4jg";
   };
 
   patches = [
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
         "tcp_open" "tcp_write_queue_order" "tcp_try_write" "tcp_writealot"
         "multiple_listen" "delayed_accept"
         "shutdown_close_tcp" "shutdown_eof" "shutdown_twice" "callback_stack"
-        "tty_pty"
+        "tty_pty" "condvar_5"
       ] ++ stdenv.lib.optionals stdenv.isAarch32 [
         # I observe this test failing with some regularity on ARMv7:
         # https://github.com/libuv/libuv/issues/1871
diff --git a/pkgs/development/libraries/libwacom/default.nix b/pkgs/development/libraries/libwacom/default.nix
index cc3f19ab7d31..67563e41d01f 100644
--- a/pkgs/development/libraries/libwacom/default.nix
+++ b/pkgs/development/libraries/libwacom/default.nix
@@ -14,7 +14,8 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     platforms = platforms.linux;
-    homepage = https://sourceforge.net/projects/linuxwacom/;
+    homepage = https://linuxwacom.github.io/;
     description = "Libraries, configuration, and diagnostic tools for Wacom tablets running under Linux";
+    license = licenses.mit;
   };
 }
diff --git a/pkgs/development/libraries/libwnck/3.x.nix b/pkgs/development/libraries/libwnck/3.x.nix
index f2d05d14d693..3137ac2c8f2b 100644
--- a/pkgs/development/libraries/libwnck/3.x.nix
+++ b/pkgs/development/libraries/libwnck/3.x.nix
@@ -7,7 +7,7 @@ in stdenv.mkDerivation rec{
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "010zk9zvydggxqnxfml3scml5yxmpjy90irpqcayrzw26lldr9mg";
   };
 
diff --git a/pkgs/development/libraries/lirc/default.nix b/pkgs/development/libraries/lirc/default.nix
index ad6d2df1d8bd..13fbe2b55b67 100644
--- a/pkgs/development/libraries/lirc/default.nix
+++ b/pkgs/development/libraries/lirc/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, alsaLib, help2man, pkgconfig, xlibsWrapper, python3
-, libxslt, systemd, libusb, libftdi1 }:
+{ stdenv, fetchurl, fetchpatch, autoreconfHook, pkgconfig, help2man, python3,
+  alsaLib, xlibsWrapper, libxslt, systemd, libusb, libftdi1 }:
 
 stdenv.mkDerivation rec {
   name = "lirc-0.10.1";
@@ -9,6 +9,12 @@ stdenv.mkDerivation rec {
     sha256 = "1whlyifvvc7w04ahq07nnk1h18wc8j7c6wnvlb6mszravxh3qxcb";
   };
 
+  # Fix installation of Python bindings
+  patches = [ (fetchpatch {
+    url = "https://sourceforge.net/p/lirc/tickets/339/attachment/0001-Fix-Python-bindings.patch";
+    sha256 = "088a39x8c1qd81qwvbiqd6crb2lk777wmrs8rdh1ga06lglyvbly";
+  }) ];
+
   postPatch = ''
     patchShebangs .
 
@@ -24,17 +30,17 @@ stdenv.mkDerivation rec {
     touch lib/lirc/input_map.inc
   '';
 
-  nativeBuildInputs = [ pkgconfig help2man ];
+  nativeBuildInputs = [ autoreconfHook pkgconfig help2man
+    (python3.withPackages (p: with p; [ pyyaml setuptools ])) ];
 
-  buildInputs = [ alsaLib xlibsWrapper libxslt systemd libusb libftdi1 ]
-  ++ (with python3.pkgs; [ python pyyaml setuptools ]);
+  buildInputs = [ alsaLib xlibsWrapper libxslt systemd libusb libftdi1 ];
 
   configureFlags = [
     "--sysconfdir=/etc"
     "--localstatedir=/var"
     "--with-systemdsystemunitdir=$(out)/lib/systemd/system"
-    "--enable-uinput" # explicite activation because build env has no uinput
-    "--enable-devinput" # explicite activation because build env has not /dev/input
+    "--enable-uinput" # explicit activation because build env has no uinput
+    "--enable-devinput" # explicit activation because build env has no /dev/input
   ];
 
   installFlags = [
diff --git a/pkgs/development/libraries/mapnik/default.nix b/pkgs/development/libraries/mapnik/default.nix
index ebae2a6c3be0..693260af1c76 100644
--- a/pkgs/development/libraries/mapnik/default.nix
+++ b/pkgs/development/libraries/mapnik/default.nix
@@ -8,12 +8,12 @@
 
 stdenv.mkDerivation rec {
   name = "mapnik-${version}";
-  version = "3.0.20";
+  version = "3.0.21";
 
   src = fetchzip {
     # this one contains all git submodules and is cheaper than fetchgit
     url = "https://github.com/mapnik/mapnik/releases/download/v${version}/mapnik-v${version}.tar.bz2";
-    sha256 = "05a2hvvk5s4x3wjvh4spd717vd5ri7h0sql7aarpi9jpc5h6xicc";
+    sha256 = "0cq2gbmf1sssg72sq4b5s3x1z6wvl1pzxliymm06flw5bpim5as2";
   };
 
   # a distinct dev output makes python-mapnik fail
diff --git a/pkgs/development/libraries/mesa-darwin/default.nix b/pkgs/development/libraries/mesa-darwin/default.nix
deleted file mode 100644
index 2bfdb679156c..000000000000
--- a/pkgs/development/libraries/mesa-darwin/default.nix
+++ /dev/null
@@ -1,73 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, flex, bison
-, python, libxml2Python, expat, makedepend, xorg, llvm, libffi, libvdpau
-, OpenGL, apple_sdk, Xplugin
-}:
-
-let
-  version = "8.0.5";
-  self = stdenv.mkDerivation rec {
-    name = "mesa-${version}";
-
-    src =  fetchurl {
-      url = "ftp://ftp.freedesktop.org/pub/mesa/older-versions/8.x/${version}/MesaLib-${version}.tar.bz2";
-      sha256 = "0pjs8x51c0i6mawgd4w03lxpyx5fnx7rc8plr8jfsscf9yiqs6si";
-    };
-
-    nativeBuildInputs = [ pkgconfig python makedepend flex bison ];
-
-    buildInputs = with xorg; [
-      glproto dri2proto libXfixes libXi libXmu
-      intltool expat libxml2Python llvm
-      presentproto
-      libX11 libXext libxcb libXt libxshmfence
-      libffi libvdpau
-    ] ++ stdenv.lib.optionals stdenv.isDarwin [ OpenGL apple_sdk.sdk Xplugin ];
-
-    propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ OpenGL ];
-
-    postUnpack = ''
-      ln -s darwin $sourceRoot/configs/current
-    '';
-
-    preBuild = stdenv.lib.optionalString stdenv.isDarwin ''
-      substituteInPlace bin/mklib --replace g++ clang++
-    '';
-
-    patches = [
-      ./patches/0003-mesa-fix-per-level-max-texture-size-error-checking.patch
-      ./patches/0008-glsl-initialise-const-force-glsl-extension-warning-i.patch
-      ./patches/0009-mesa-test-for-GL_EXT_framebuffer_sRGB-in-glPopAttrib.patch
-      ./patches/0011-Apple-glFlush-is-not-needed-with-CGLFlushDrawable.patch
-      ./patches/0012-glapi-Avoid-heap-corruption-in-_glapi_table.patch
-      ./patches/0013-darwin-Fix-test-for-kCGLPFAOpenGLProfile-support-at-.patch
-      ./patches/1001-appleglx-Improve-error-reporting-if-CGLChoosePixelFo.patch
-      ./patches/1002-darwin-Write-errors-in-choosing-the-pixel-format-to-.patch
-      ./patches/1003-darwin-Guard-Core-Profile-usage-behind-a-testing-env.patch
-      ./patches/patch-src-mapi-vgapi-Makefile.diff
-    ];
-
-    postPatch = "patchShebangs .";
-
-    configurePhase = ":";
-
-    configureFlags = [
-      # NOTE: Patents expired on June 17 2018.
-      # For details see: https://www.phoronix.com/scan.php?page=news_item&px=OpenGL-Texture-Float-Freed
-      "texture-float"
-    ];
-
-    makeFlags = "INSTALL_DIR=\${out} CC=cc CXX=c++";
-
-    enableParallelBuilding = true;
-
-    passthru = { inherit version; };
-
-    meta = {
-      description = "An open source implementation of OpenGL";
-      homepage = http://www.mesa3d.org/;
-      license = "bsd";
-      platforms = stdenv.lib.platforms.darwin;
-      maintainers = with stdenv.lib.maintainers; [ cstrahan ];
-    };
-  };
-in self // { driverLink = self; }
diff --git a/pkgs/development/libraries/mesa-darwin/patches/0003-mesa-fix-per-level-max-texture-size-error-checking.patch b/pkgs/development/libraries/mesa-darwin/patches/0003-mesa-fix-per-level-max-texture-size-error-checking.patch
deleted file mode 100644
index 5466ffc90858..000000000000
--- a/pkgs/development/libraries/mesa-darwin/patches/0003-mesa-fix-per-level-max-texture-size-error-checking.patch
+++ /dev/null
@@ -1,147 +0,0 @@
-From 9cf1afbf8ae87ddbb29b24a0f9f2724e9e2935c1 Mon Sep 17 00:00:00 2001
-From: Brian Paul <brianp@vmware.com>
-Date: Tue, 4 Sep 2012 20:17:15 -0600
-Subject: [PATCH 03/13] mesa: fix per-level max texture size error checking
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This is a long-standing omission in Mesa's texture image size checking.
-We need to take the mipmap level into consideration when checking if the
-width, height and depth are too large.
-
-Fixes the new piglit max-texture-size-level test.
-Thanks to Stéphane Marchesin for finding this problem.
-
-Note: This is a candidate for the stable branches.
-
-Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
-(cherry picked from commit 771e7b6d884bb4294a89f276a904d90b28efb90a)
----
- src/mesa/main/teximage.c | 36 +++++++++++++++++++++---------------
- 1 file changed, 21 insertions(+), 15 deletions(-)
-
-diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
-index 3aecc0f..ed22fa9 100644
---- a/src/mesa/main/teximage.c
-+++ b/src/mesa/main/teximage.c
-@@ -1251,11 +1251,12 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
- 
-    switch (target) {
-    case GL_PROXY_TEXTURE_1D:
--      maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
--      if (width < 2 * border || width > 2 * border + maxSize)
--         return GL_FALSE;
-       if (level >= ctx->Const.MaxTextureLevels)
-          return GL_FALSE;
-+      maxSize = 1 << (ctx->Const.MaxTextureLevels - 1); /* level zero size */
-+      maxSize >>= level;  /* level size */
-+      if (width < 2 * border || width > 2 * border + maxSize)
-+         return GL_FALSE;
-       if (!ctx->Extensions.ARB_texture_non_power_of_two) {
-          if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
-             return GL_FALSE;
-@@ -1263,13 +1264,14 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
-       return GL_TRUE;
- 
-    case GL_PROXY_TEXTURE_2D:
-+      if (level >= ctx->Const.MaxTextureLevels)
-+         return GL_FALSE;
-       maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
-+      maxSize >>= level;
-       if (width < 2 * border || width > 2 * border + maxSize)
-          return GL_FALSE;
-       if (height < 2 * border || height > 2 * border + maxSize)
-          return GL_FALSE;
--      if (level >= ctx->Const.MaxTextureLevels)
--         return GL_FALSE;
-       if (!ctx->Extensions.ARB_texture_non_power_of_two) {
-          if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
-             return GL_FALSE;
-@@ -1279,15 +1281,16 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
-       return GL_TRUE;
- 
-    case GL_PROXY_TEXTURE_3D:
-+      if (level >= ctx->Const.Max3DTextureLevels)
-+         return GL_FALSE;
-       maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1);
-+      maxSize >>= level;
-       if (width < 2 * border || width > 2 * border + maxSize)
-          return GL_FALSE;
-       if (height < 2 * border || height > 2 * border + maxSize)
-          return GL_FALSE;
-       if (depth < 2 * border || depth > 2 * border + maxSize)
-          return GL_FALSE;
--      if (level >= ctx->Const.Max3DTextureLevels)
--         return GL_FALSE;
-       if (!ctx->Extensions.ARB_texture_non_power_of_two) {
-          if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
-             return GL_FALSE;
-@@ -1299,23 +1302,24 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
-       return GL_TRUE;
- 
-    case GL_PROXY_TEXTURE_RECTANGLE_NV:
-+      if (level != 0)
-+         return GL_FALSE;
-       maxSize = ctx->Const.MaxTextureRectSize;
-       if (width < 0 || width > maxSize)
-          return GL_FALSE;
-       if (height < 0 || height > maxSize)
-          return GL_FALSE;
--      if (level != 0)
--         return GL_FALSE;
-       return GL_TRUE;
- 
-    case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
-+      if (level >= ctx->Const.MaxCubeTextureLevels)
-+         return GL_FALSE;
-       maxSize = 1 << (ctx->Const.MaxCubeTextureLevels - 1);
-+      maxSize >>= level;
-       if (width < 2 * border || width > 2 * border + maxSize)
-          return GL_FALSE;
-       if (height < 2 * border || height > 2 * border + maxSize)
-          return GL_FALSE;
--      if (level >= ctx->Const.MaxCubeTextureLevels)
--         return GL_FALSE;
-       if (!ctx->Extensions.ARB_texture_non_power_of_two) {
-          if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
-             return GL_FALSE;
-@@ -1325,13 +1329,14 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
-       return GL_TRUE;
- 
-    case GL_PROXY_TEXTURE_1D_ARRAY_EXT:
-+      if (level >= ctx->Const.MaxTextureLevels)
-+         return GL_FALSE;
-       maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
-+      maxSize >>= level;
-       if (width < 2 * border || width > 2 * border + maxSize)
-          return GL_FALSE;
-       if (height < 1 || height > ctx->Const.MaxArrayTextureLayers)
-          return GL_FALSE;
--      if (level >= ctx->Const.MaxTextureLevels)
--         return GL_FALSE;
-       if (!ctx->Extensions.ARB_texture_non_power_of_two) {
-          if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
-             return GL_FALSE;
-@@ -1339,15 +1344,16 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
-       return GL_TRUE;
- 
-    case GL_PROXY_TEXTURE_2D_ARRAY_EXT:
-+      if (level >= ctx->Const.MaxTextureLevels)
-+         return GL_FALSE;
-       maxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
-+      maxSize >>= level;
-       if (width < 2 * border || width > 2 * border + maxSize)
-          return GL_FALSE;
-       if (height < 2 * border || height > 2 * border + maxSize)
-          return GL_FALSE;
-       if (depth < 1 || depth > ctx->Const.MaxArrayTextureLayers)
-          return GL_FALSE;
--      if (level >= ctx->Const.MaxTextureLevels)
--         return GL_FALSE;
-       if (!ctx->Extensions.ARB_texture_non_power_of_two) {
-          if (width > 0 && !_mesa_is_pow_two(width - 2 * border))
-             return GL_FALSE;
--- 
-1.9.2
-
diff --git a/pkgs/development/libraries/mesa-darwin/patches/0008-glsl-initialise-const-force-glsl-extension-warning-i.patch b/pkgs/development/libraries/mesa-darwin/patches/0008-glsl-initialise-const-force-glsl-extension-warning-i.patch
deleted file mode 100644
index ff933b2ec284..000000000000
--- a/pkgs/development/libraries/mesa-darwin/patches/0008-glsl-initialise-const-force-glsl-extension-warning-i.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From db8cb2250335a93cad6e877e634116e5cd6b42fc Mon Sep 17 00:00:00 2001
-From: Dave Airlie <airlied@redhat.com>
-Date: Tue, 13 Mar 2012 14:53:25 +0000
-Subject: [PATCH 08/13] glsl: initialise const force glsl extension warning in
- fake ctx
-
-valgrind complained about an uninitialised value being used in
-glsl_parser_extras.cpp, and this was the one it was giving out about.
-
-Just initialise the value in the fakectx.
-
-Signed-off-by: Dave Airlie <airlied@redhat.com>
-Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48057
-(cherry picked from commit b78a77f979b21a84aecb6fa4f19a2ed51a48c306)
----
- src/glsl/builtins/tools/generate_builtins.py | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/glsl/builtins/tools/generate_builtins.py b/src/glsl/builtins/tools/generate_builtins.py
-index 72d12bb..bd15c4d 100755
---- a/src/glsl/builtins/tools/generate_builtins.py
-+++ b/src/glsl/builtins/tools/generate_builtins.py
-@@ -156,6 +156,7 @@ read_builtins(GLenum target, const char *protos, const char **functions, unsigne
-    fakeCtx.API = API_OPENGL;
-    fakeCtx.Const.GLSLVersion = 130;
-    fakeCtx.Extensions.ARB_ES2_compatibility = true;
-+   fakeCtx.Const.ForceGLSLExtensionsWarn = false;
-    gl_shader *sh = _mesa_new_shader(NULL, 0, target);
-    struct _mesa_glsl_parse_state *st =
-       new(sh) _mesa_glsl_parse_state(&fakeCtx, target, sh);
--- 
-1.9.2
-
diff --git a/pkgs/development/libraries/mesa-darwin/patches/0009-mesa-test-for-GL_EXT_framebuffer_sRGB-in-glPopAttrib.patch b/pkgs/development/libraries/mesa-darwin/patches/0009-mesa-test-for-GL_EXT_framebuffer_sRGB-in-glPopAttrib.patch
deleted file mode 100644
index 919443045e46..000000000000
--- a/pkgs/development/libraries/mesa-darwin/patches/0009-mesa-test-for-GL_EXT_framebuffer_sRGB-in-glPopAttrib.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 2286bd68a832a4d4908d50e1a4496853e1f3305a Mon Sep 17 00:00:00 2001
-From: Brian Paul <brianp@vmware.com>
-Date: Mon, 27 Aug 2012 21:52:07 -0600
-Subject: [PATCH 09/13] mesa: test for GL_EXT_framebuffer_sRGB in glPopAttrib()
-
-To avoid spurious GL_INVALID_ENUM errors if the extension isn't supported.
-(cherry picked from commit 1aee8803f83f7ae24d9c2150c70afff2b1ee4c2f)
----
- src/mesa/main/attrib.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
-index 225ac89..cc384c7 100644
---- a/src/mesa/main/attrib.c
-+++ b/src/mesa/main/attrib.c
-@@ -993,7 +993,8 @@ _mesa_PopAttrib(void)
-                _mesa_ClampColorARB(GL_CLAMP_READ_COLOR_ARB, color->ClampReadColor);
- 
-                /* GL_ARB_framebuffer_sRGB / GL_EXT_framebuffer_sRGB */
--               _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB, color->sRGBEnabled);
-+               if (ctx->Extensions.EXT_framebuffer_sRGB)
-+                  _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB, color->sRGBEnabled);
-             }
-             break;
-          case GL_CURRENT_BIT:
--- 
-1.9.2
-
diff --git a/pkgs/development/libraries/mesa-darwin/patches/0011-Apple-glFlush-is-not-needed-with-CGLFlushDrawable.patch b/pkgs/development/libraries/mesa-darwin/patches/0011-Apple-glFlush-is-not-needed-with-CGLFlushDrawable.patch
deleted file mode 100644
index 565d5e6c2737..000000000000
--- a/pkgs/development/libraries/mesa-darwin/patches/0011-Apple-glFlush-is-not-needed-with-CGLFlushDrawable.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 9c50093adff0c7531ab32a7ec9ce3b91712b4d20 Mon Sep 17 00:00:00 2001
-From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-Date: Sat, 20 Jul 2013 10:25:28 -0700
-Subject: [PATCH 11/13] Apple: glFlush() is not needed with CGLFlushDrawable()
-
-<rdar://problem/14496373>
-
-Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-(cherry picked from commit fa5ed99d8e809fb86e486a40273a4a6971055398)
----
- src/glx/apple/apple_glx.c | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/src/glx/apple/apple_glx.c b/src/glx/apple/apple_glx.c
-index 56cff64..4e2aa33 100644
---- a/src/glx/apple/apple_glx.c
-+++ b/src/glx/apple/apple_glx.c
-@@ -132,8 +132,6 @@ apple_glx_swap_buffers(void *ptr)
- {
-    struct apple_glx_context *ac = ptr;
- 
--   /* This may not be needed with CGLFlushDrawable: */
--   glFlush();
-    apple_cgl.flush_drawable(ac->context_obj);
- }
- 
--- 
-1.9.2
-
diff --git a/pkgs/development/libraries/mesa-darwin/patches/0012-glapi-Avoid-heap-corruption-in-_glapi_table.patch b/pkgs/development/libraries/mesa-darwin/patches/0012-glapi-Avoid-heap-corruption-in-_glapi_table.patch
deleted file mode 100644
index 58ac66bd5511..000000000000
--- a/pkgs/development/libraries/mesa-darwin/patches/0012-glapi-Avoid-heap-corruption-in-_glapi_table.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 629600450b3845a768c0edc92ea3f444d03a2738 Mon Sep 17 00:00:00 2001
-From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-Date: Tue, 20 May 2014 01:37:58 -0700
-Subject: [PATCH 12/13] glapi: Avoid heap corruption in _glapi_table
-
-Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-Reviewed-by: Chia-I Wu <olv@lunarg.com>
-(cherry picked from commit ff5456d1acf6f627a6837be3f3f37c6a268c9e8e)
----
- src/mapi/glapi/gen/gl_gentable.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/mapi/glapi/gen/gl_gentable.py b/src/mapi/glapi/gen/gl_gentable.py
-index 5657e32..0d0a02d 100644
---- a/src/mapi/glapi/gen/gl_gentable.py
-+++ b/src/mapi/glapi/gen/gl_gentable.py
-@@ -111,7 +111,7 @@ __glapi_gentable_set_remaining_noop(struct _glapi_table *disp) {
- 
- struct _glapi_table *
- _glapi_create_table_from_handle(void *handle, const char *symbol_prefix) {
--    struct _glapi_table *disp = calloc(1, sizeof(struct _glapi_table));
-+    struct _glapi_table *disp = calloc(1, _glapi_get_dispatch_table_size() * sizeof(_glapi_proc));
-     char symboln[512];
- 
-     if(!disp)
--- 
-1.9.2
-
diff --git a/pkgs/development/libraries/mesa-darwin/patches/0013-darwin-Fix-test-for-kCGLPFAOpenGLProfile-support-at-.patch b/pkgs/development/libraries/mesa-darwin/patches/0013-darwin-Fix-test-for-kCGLPFAOpenGLProfile-support-at-.patch
deleted file mode 100644
index 5ec0d9024eff..000000000000
--- a/pkgs/development/libraries/mesa-darwin/patches/0013-darwin-Fix-test-for-kCGLPFAOpenGLProfile-support-at-.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From ba59a779ed41e08fa16805c1c60da39885546d0e Mon Sep 17 00:00:00 2001
-From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-Date: Tue, 20 May 2014 10:53:00 -0700
-Subject: [PATCH 13/13] darwin: Fix test for kCGLPFAOpenGLProfile support at
- runtime
-
-Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-(cherry picked from commit 7a109268ab5b3544e7f7b99e84ef1fdf54023fb4)
----
- src/glx/apple/apple_visual.c | 14 +++++++++-----
- 1 file changed, 9 insertions(+), 5 deletions(-)
-
-diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c
-index 282934f..238c248 100644
---- a/src/glx/apple/apple_visual.c
-+++ b/src/glx/apple/apple_visual.c
-@@ -73,11 +73,15 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m
-    GLint vsref = 0;
-    CGLError error = 0;
- 
--   /* Request an OpenGL 3.2 profile if one is available */
--   if(apple_cgl.version_major > 1 || (apple_cgl.version_major == 1 && apple_cgl.version_minor >= 3)) {
--      attr[numattr++] = kCGLPFAOpenGLProfile;
--      attr[numattr++] = kCGLOGLPVersion_3_2_Core;
--   }
-+   /* Request an OpenGL 3.2 profile if one is available and supported */
-+   attr[numattr++] = kCGLPFAOpenGLProfile;
-+   attr[numattr++] = kCGLOGLPVersion_3_2_Core;
-+
-+   /* Test for kCGLPFAOpenGLProfile support at runtime and roll it out if not supported */
-+   attr[numattr] = 0;
-+   error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref);
-+   if (error == kCGLBadAttribute)
-+      numattr -= 2;
- 
-    if (offscreen) {
-       apple_glx_diagnostic
--- 
-1.9.2
-
diff --git a/pkgs/development/libraries/mesa-darwin/patches/1001-appleglx-Improve-error-reporting-if-CGLChoosePixelFo.patch b/pkgs/development/libraries/mesa-darwin/patches/1001-appleglx-Improve-error-reporting-if-CGLChoosePixelFo.patch
deleted file mode 100644
index 372ce4a27a39..000000000000
--- a/pkgs/development/libraries/mesa-darwin/patches/1001-appleglx-Improve-error-reporting-if-CGLChoosePixelFo.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From f0702d6e631bb912a230c081463bb51a0dde1bff Mon Sep 17 00:00:00 2001
-From: Jon TURNEY <jon.turney@dronecode.org.uk>
-Date: Mon, 12 May 2014 15:38:26 +0100
-Subject: [PATCH 1001/1003] appleglx: Improve error reporting if
- CGLChoosePixelFormat() didn't find any matching pixel formats.
-
-Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
-Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-(cherry picked from commit 002a3a74273b81dfb226e1c3f0a8c18525ed0af4)
----
- src/glx/apple/apple_visual.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c
-index 238c248..c6ede51 100644
---- a/src/glx/apple/apple_visual.c
-+++ b/src/glx/apple/apple_visual.c
-@@ -167,4 +167,9 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m
-       fprintf(stderr, "error: %s\n", apple_cgl.error_string(error));
-       abort();
-    }
-+
-+   if (!*pfobj) {
-+      fprintf(stderr, "No matching pixelformats found, perhaps try using LIBGL_ALLOW_SOFTWARE\n");
-+      abort();
-+   }
- }
--- 
-1.9.2 (Apple Git-49)
-
diff --git a/pkgs/development/libraries/mesa-darwin/patches/1002-darwin-Write-errors-in-choosing-the-pixel-format-to-.patch b/pkgs/development/libraries/mesa-darwin/patches/1002-darwin-Write-errors-in-choosing-the-pixel-format-to-.patch
deleted file mode 100644
index 4818ee63d4c9..000000000000
--- a/pkgs/development/libraries/mesa-darwin/patches/1002-darwin-Write-errors-in-choosing-the-pixel-format-to-.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 1b2f877c8ef052b183c1f20ece6c6e4a7bfd237c Mon Sep 17 00:00:00 2001
-From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-Date: Sat, 24 May 2014 14:13:33 -0700
-Subject: [PATCH 1002/1003] darwin: Write errors in choosing the pixel format
- to the crash log
-
-Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-(cherry picked from commit 9eb1d36c978a9b15ae2e999c630492dfffd7f165)
----
- src/glx/apple/apple_visual.c | 18 ++++++++++++++++--
- 1 file changed, 16 insertions(+), 2 deletions(-)
-
-diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c
-index c6ede51..951b213 100644
---- a/src/glx/apple/apple_visual.c
-+++ b/src/glx/apple/apple_visual.c
-@@ -63,6 +63,16 @@ enum
-    MAX_ATTR = 60
- };
- 
-+static char __crashreporter_info_buff__[4096] = { 0 };
-+static const char *__crashreporter_info__ __attribute__((__used__)) =
-+    &__crashreporter_info_buff__[0];
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
-+// This is actually a toolchain requirement, but I'm not sure the correct check,
-+// but it should be fine to just only include it for Leopard and later.  This line
-+// just tells the linker to never strip this symbol (such as for space optimization)
-+__asm__ (".desc ___crashreporter_info__, 0x10");
-+#endif
-+
- void
- apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * mode,
-                           bool * double_buffered, bool * uses_stereo,
-@@ -164,12 +174,16 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m
-    error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref);
- 
-    if (error) {
--      fprintf(stderr, "error: %s\n", apple_cgl.error_string(error));
-+      snprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__),
-+               "CGLChoosePixelFormat error: %s\n", apple_cgl.error_string(error));
-+      fprintf(stderr, "%s", __crashreporter_info_buff__);
-       abort();
-    }
- 
-    if (!*pfobj) {
--      fprintf(stderr, "No matching pixelformats found, perhaps try using LIBGL_ALLOW_SOFTWARE\n");
-+      snprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__),
-+               "No matching pixelformats found, perhaps try using LIBGL_ALLOW_SOFTWARE\n");
-+      fprintf(stderr, "%s", __crashreporter_info_buff__);
-       abort();
-    }
- }
--- 
-1.9.2 (Apple Git-49)
-
diff --git a/pkgs/development/libraries/mesa-darwin/patches/1003-darwin-Guard-Core-Profile-usage-behind-a-testing-env.patch b/pkgs/development/libraries/mesa-darwin/patches/1003-darwin-Guard-Core-Profile-usage-behind-a-testing-env.patch
deleted file mode 100644
index 72841e2a2cce..000000000000
--- a/pkgs/development/libraries/mesa-darwin/patches/1003-darwin-Guard-Core-Profile-usage-behind-a-testing-env.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From 9d6e12eb6b06202519e48a7321f32944d7a34b0f Mon Sep 17 00:00:00 2001
-From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-Date: Sat, 24 May 2014 14:08:16 -0700
-Subject: [PATCH 1003/1003] darwin: Guard Core Profile usage behind a testing
- envvar
-
-Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-(cherry picked from commit 04ce3be4010305902cc5ae81e8e0c8550d043a1e)
----
- src/glx/apple/apple_visual.c | 30 ++++++++++++++++++++----------
- 1 file changed, 20 insertions(+), 10 deletions(-)
-
-diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c
-index 951b213..046581b 100644
---- a/src/glx/apple/apple_visual.c
-+++ b/src/glx/apple/apple_visual.c
-@@ -82,16 +82,7 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m
-    int numattr = 0;
-    GLint vsref = 0;
-    CGLError error = 0;
--
--   /* Request an OpenGL 3.2 profile if one is available and supported */
--   attr[numattr++] = kCGLPFAOpenGLProfile;
--   attr[numattr++] = kCGLOGLPVersion_3_2_Core;
--
--   /* Test for kCGLPFAOpenGLProfile support at runtime and roll it out if not supported */
--   attr[numattr] = 0;
--   error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref);
--   if (error == kCGLBadAttribute)
--      numattr -= 2;
-+   bool use_core_profile = getenv("LIBGL_PROFILE_CORE");
- 
-    if (offscreen) {
-       apple_glx_diagnostic
-@@ -167,12 +158,31 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * m
-       attr[numattr++] = mode->samples;
-    }
- 
-+   /* Debugging support for Core profiles to support newer versions of OpenGL */
-+   if (use_core_profile) {
-+      attr[numattr++] = kCGLPFAOpenGLProfile;
-+      attr[numattr++] = kCGLOGLPVersion_3_2_Core;
-+   }
-+
-    attr[numattr++] = 0;
- 
-    assert(numattr < MAX_ATTR);
- 
-    error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref);
- 
-+   if ((error == kCGLBadAttribute || vsref == 0) && use_core_profile) {
-+      apple_glx_diagnostic
-+         ("Trying again without CoreProfile: error=%s, vsref=%d\n", apple_cgl.error_string(error), vsref);
-+
-+      if (!error)
-+         apple_cgl.destroy_pixel_format(*pfobj);
-+
-+      numattr -= 3;
-+      attr[numattr++] = 0;
-+
-+      error = apple_cgl.choose_pixel_format(attr, pfobj, &vsref);
-+   }
-+
-    if (error) {
-       snprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__),
-                "CGLChoosePixelFormat error: %s\n", apple_cgl.error_string(error));
--- 
-1.9.2 (Apple Git-49)
-
diff --git a/pkgs/development/libraries/mesa-darwin/patches/patch-src-mapi-vgapi-Makefile.diff b/pkgs/development/libraries/mesa-darwin/patches/patch-src-mapi-vgapi-Makefile.diff
deleted file mode 100644
index e29a8464076d..000000000000
--- a/pkgs/development/libraries/mesa-darwin/patches/patch-src-mapi-vgapi-Makefile.diff
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/mapi/vgapi/Makefile	2012-11-30 12:06:24.000000000 -0500
-+++ b/src/mapi/vgapi/Makefile	2012-11-30 12:06:52.000000000 -0500
-@@ -75,6 +75,8 @@
- install-headers:
- 	$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/VG
- 	$(INSTALL) -m 644 $(TOP)/include/VG/*.h $(DESTDIR)$(INSTALL_INC_DIR)/VG
-+	$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/KHR
-+	$(INSTALL) -m 644 $(TOP)/include/KHR/*.h $(DESTDIR)$(INSTALL_INC_DIR)/KHR
- 
- install: default install-headers install-pc
- 	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
diff --git a/pkgs/development/libraries/mesa/darwin-clock-gettime.patch b/pkgs/development/libraries/mesa/darwin-clock-gettime.patch
new file mode 100644
index 000000000000..94e90a1c5871
--- /dev/null
+++ b/pkgs/development/libraries/mesa/darwin-clock-gettime.patch
@@ -0,0 +1,76 @@
+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 0a8a3c75a1c0..ff45162c5a89 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -8,6 +8,8 @@
 , galliumDrivers ? null
 , driDrivers ? null
 , vulkanDrivers ? null
+, eglPlatforms ? [ "x11" ] ++ lib.optionals stdenv.isLinux [ "wayland" "drm" ]
+, OpenGL, Xplugin
 }:
 
 /** Packaging design:
@@ -29,19 +31,21 @@ else
 
 let
   defaultGalliumDrivers =
-    if stdenv.isAarch32
+    optionals (builtins.elem "drm" eglPlatforms)
+    (if stdenv.isAarch32
     then ["virgl" "nouveau" "freedreno" "vc4" "etnaviv" "imx"]
     else if stdenv.isAarch64
     then ["virgl" "nouveau" "vc4" ]
-    else ["virgl" "svga" "i915" "r300" "r600" "radeonsi" "nouveau"];
+    else ["virgl" "svga" "i915" "r300" "r600" "radeonsi" "nouveau"]);
   defaultDriDrivers =
-    if (stdenv.isAarch32 || stdenv.isAarch64)
+    optionals (builtins.elem "drm" eglPlatforms)
+    (if (stdenv.isAarch32 || stdenv.isAarch64)
     then ["nouveau"]
-    else ["i915" "i965" "nouveau" "radeon" "r200"];
+    else ["i915" "i965" "nouveau" "radeon" "r200"]);
   defaultVulkanDrivers =
-    if (stdenv.isAarch32 || stdenv.isAarch64)
+    optionals stdenv.isLinux (if (stdenv.isAarch32 || stdenv.isAarch64)
     then []
-    else ["intel"] ++ lib.optional enableRadv "radeon";
+    else ["intel"] ++ lib.optional enableRadv "radeon");
 in
 
 let gallium_ = galliumDrivers; dri_ = driDrivers; vulkan_ = vulkanDrivers; in
@@ -51,11 +55,11 @@ let
     (if gallium_ == null
           then defaultGalliumDrivers
           else gallium_)
-    ++ ["swrast" "virgl"];
+    ++ lib.optional stdenv.isLinux "swrast";
   driDrivers =
     (if dri_ == null
-      then defaultDriDrivers
-      else dri_) ++ ["swrast"];
+      then optionals (elem "drm" eglPlatforms) defaultDriDrivers
+      else dri_) ++ lib.optional stdenv.isLinux "swrast";
   vulkanDrivers =
     if vulkan_ == null
     then defaultVulkanDrivers
@@ -63,7 +67,7 @@ let
 in
 
 let
-  version = "18.1.7";
+  version = "18.2.2";
   branch  = head (splitString "." version);
 in
 
@@ -77,7 +81,7 @@ let self = stdenv.mkDerivation {
       "ftp://ftp.freedesktop.org/pub/mesa/older-versions/${branch}.x/${version}/mesa-${version}.tar.xz"
       "https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz"
     ];
-    sha256 = "655e3b32ce3bdddd5e6e8768596e5d4bdef82d0dd37067c324cc4b2daa207306";
+    sha256 = "1i3ky3d210vi3f5hlr9la1kspdyv093npndxsbzdklw95aqq5fn3";
   };
 
   prePatch = "patchShebangs .";
@@ -89,9 +93,10 @@ 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" "osmesa" ];
+  outputs = [ "out" "dev" "drivers" ]
+            ++ lib.optional (elem "swrast" galliumDrivers) "osmesa";
 
   # TODO: Figure out how to enable opencl without having a runtime dependency on clang
   configureFlags = [
@@ -99,19 +104,11 @@ let self = stdenv.mkDerivation {
     "--localstatedir=/var"
     "--with-dri-driverdir=$(drivers)/lib/dri"
     "--with-dri-searchpath=${libglvnd.driverLink}/lib/dri"
-    "--with-platforms=x11,wayland,drm"
+    "--with-platforms=${concatStringsSep "," eglPlatforms}"
+    "--with-gallium-drivers=${concatStringsSep "," galliumDrivers}"
+    "--with-dri-drivers=${concatStringsSep "," driDrivers}"
+    "--with-vulkan-drivers=${concatStringsSep "," vulkanDrivers}"
     "--enable-texture-float"
-  ]
-  ++ (optional (galliumDrivers != [])
-      ("--with-gallium-drivers=" +
-        builtins.concatStringsSep "," galliumDrivers))
-  ++ (optional (driDrivers != [])
-      ("--with-dri-drivers=" +
-        builtins.concatStringsSep "," driDrivers))
-  ++ (optional (vulkanDrivers != [])
-      ("--with-vulkan-drivers=" +
-        builtins.concatStringsSep "," vulkanDrivers))
-  ++ [
     (enableFeature stdenv.isLinux "dri3")
     (enableFeature stdenv.isLinux "nine") # Direct3D in Wine
     "--enable-libglvnd"
@@ -122,17 +119,18 @@ let self = stdenv.mkDerivation {
     "--enable-glx"
     # https://bugs.freedesktop.org/show_bug.cgi?id=35268
     (enableFeature (!stdenv.hostPlatform.isMusl) "glx-tls")
-    "--enable-gallium-osmesa" # used by wine
+    # used by wine
+    (enableFeature (elem "swrast" galliumDrivers) "gallium-osmesa")
     "--enable-llvm"
-    "--enable-egl"
-    "--enable-xa" # used in vmware driver
-    "--enable-gbm"
+    (enableFeature stdenv.isLinux "egl")
+    (enableFeature stdenv.isLinux "xa") # used in vmware driver
+    (enableFeature stdenv.isLinux "gbm")
     "--enable-xvmc"
     "--enable-vdpau"
     "--enable-shared-glapi"
     "--enable-llvm-shared-libs"
-    "--enable-omx-bellagio"
-    "--enable-va"
+    (enableFeature stdenv.isLinux "omx-bellagio")
+    (enableFeature stdenv.isLinux "va")
     "--disable-opencl"
   ];
 
@@ -140,16 +138,18 @@ let self = stdenv.mkDerivation {
 
   propagatedBuildInputs = with xorg;
     [ libXdamage libXxf86vm ]
-    ++ optional stdenv.isLinux libdrm;
+    ++ optional stdenv.isLinux libdrm
+    ++ optionals stdenv.isDarwin [ OpenGL Xplugin ];
 
   buildInputs = with xorg; [
     expat llvmPackages.llvm libglvnd
     glproto dri2proto dri3proto presentproto
-    libX11 libXext libxcb libXt libXfixes libxshmfence
-    libffi wayland wayland-protocols libvdpau libelf libXvMC
-    libomxil-bellagio libva-minimal libpthreadstubs openssl/*or another sha1 provider*/
+    libX11 libXext libxcb libXt libXfixes libxshmfence libXrandr
+    libffi libvdpau libelf libXvMC
+    libpthreadstubs openssl/*or another sha1 provider*/
     valgrind-light python2 python2.pkgs.Mako
-  ];
+  ] ++ lib.optionals stdenv.isLinux [ wayland wayland-protocols
+                                      libomxil-bellagio libva-minimal ];
 
   enableParallelBuilding = true;
   doCheck = false;
@@ -161,7 +161,7 @@ let self = stdenv.mkDerivation {
   ];
 
   # TODO: probably not all .la files are completely fixed, but it shouldn't matter;
-  postInstall = ''
+  postInstall = optionalString (galliumDrivers != []) ''
     # move gallium-related stuff to $drivers, so $out doesn't depend on LLVM
     mv -t "$drivers/lib/"    \
       $out/lib/libXvMC*      \
@@ -215,7 +215,7 @@ let self = stdenv.mkDerivation {
   # TODO:
   #  check $out doesn't depend on llvm: builder failures are ignored
   #  for some reason grep -qv '${llvmPackages.llvm}' -R "$out";
-  postFixup = ''
+  postFixup = optionalString (galliumDrivers != []) ''
     # add RPATH so the drivers can find the moved libgallium and libdricore9
     # moved here to avoid problems with stripping patchelfed files
     for lib in $drivers/lib/*.so* $drivers/lib/*/*.so*; do
@@ -235,7 +235,9 @@ let self = stdenv.mkDerivation {
 
       # Use stub libraries from libglvnd and headers from Mesa.
       buildCommand = ''
-        ln -s ${libglvnd.out} $out
+        mkdir -p $out/nix-support
+        ln -s ${libglvnd.out}/lib $out/lib
+
         mkdir -p $dev/{,lib/pkgconfig,nix-support}
         echo "$out" > $dev/nix-support/propagated-build-inputs
         ln -s ${self.dev}/include $dev/include
@@ -257,6 +259,8 @@ let self = stdenv.mkDerivation {
         genPkgConfig egl EGL
         genPkgConfig glesv1_cm GLESv1_CM
         genPkgConfig glesv2 GLESv2
+      '' + lib.optionalString stdenv.isDarwin ''
+        echo ${OpenGL} > $out/nix-support/propagated-build-inputs
       '';
     };
   };
@@ -265,7 +269,7 @@ let self = stdenv.mkDerivation {
     description = "An open source implementation of OpenGL";
     homepage = https://www.mesa3d.org/;
     license = licenses.mit; # X11 variant, in most files
-    platforms = platforms.linux;
+    platforms = platforms.linux ++ platforms.darwin;
     maintainers = with maintainers; [ vcunat ];
   };
 };
diff --git a/pkgs/development/libraries/mesa/missing-includes.patch b/pkgs/development/libraries/mesa/missing-includes.patch
index feb6ffe428c0..18e7d5437b15 100644
--- a/pkgs/development/libraries/mesa/missing-includes.patch
+++ b/pkgs/development/libraries/mesa/missing-includes.patch
@@ -32,16 +32,6 @@
  #include <unistd.h>
  #include <fcntl.h>
  #else
---- ./src/mesa/drivers/dri/i965/brw_bufmgr.h
-+++ ./src/mesa/drivers/dri/i965/brw_bufmgr.h
-@@ -37,6 +37,7 @@
- #include <stdbool.h>
- #include <stdint.h>
- #include <stdio.h>
-+#include <time.h>
- #include "util/u_atomic.h"
- #include "util/list.h"
-
 --- ./src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
 +++ ./src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
 @@ -28,6 +28,8 @@
diff --git a/pkgs/development/libraries/msgpack/generic.nix b/pkgs/development/libraries/msgpack/generic.nix
index 306becf0c180..de277329961b 100644
--- a/pkgs/development/libraries/msgpack/generic.nix
+++ b/pkgs/development/libraries/msgpack/generic.nix
@@ -15,8 +15,6 @@ stdenv.mkDerivation rec {
   cmakeFlags = []
     ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
                            "-DMSGPACK_BUILD_EXAMPLES=OFF"
-    ++ stdenv.lib.optional (stdenv.hostPlatform.libc == "msvcrt")
-                           "-DCMAKE_SYSTEM_NAME=Windows"
     ;
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/nanoflann/default.nix b/pkgs/development/libraries/nanoflann/default.nix
index b5d4ea0f4ebf..f29fb9564f31 100644
--- a/pkgs/development/libraries/nanoflann/default.nix
+++ b/pkgs/development/libraries/nanoflann/default.nix
@@ -1,14 +1,14 @@
 {stdenv, fetchFromGitHub, cmake}:
 
 stdenv.mkDerivation rec {
-  version = "1.2.3";
+  version = "1.3.0";
   name = "nanoflann-${version}";
   
   src = fetchFromGitHub {
     owner = "jlblancoc";
     repo = "nanoflann";
     rev = "v${version}";
-    sha256 = "1jrh73kjvdv7s7zc1sc3z254i17lpvn77b19wx32nvzsfxs4g44i";
+    sha256 = "1bwdmrz1qygp9qy2nzrp1axa1i4nvm0ljkn6mnhlcvbfsyvhzigv";
   };
 
   buildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/newt/default.nix b/pkgs/development/libraries/newt/default.nix
index a10f52462a8e..1a5656b7ca16 100644
--- a/pkgs/development/libraries/newt/default.nix
+++ b/pkgs/development/libraries/newt/default.nix
@@ -22,10 +22,9 @@ stdenv.mkDerivation rec {
     unset CPP
   '';
 
-  # Use `lib.optionalString` next mass rebuild.
-  makeFlags = if stdenv.buildPlatform == stdenv.hostPlatform
-              then null
-              else "CROSS_COMPILE=${stdenv.cc.targetPrefix}";
+  makeFlags = stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+    "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
+  ];
 
   meta = with stdenv.lib; {
     homepage = https://fedorahosted.org/newt/;
diff --git a/pkgs/development/libraries/nghttp2/default.nix b/pkgs/development/libraries/nghttp2/default.nix
index 68bffd4032d2..471684ea7ddc 100644
--- a/pkgs/development/libraries/nghttp2/default.nix
+++ b/pkgs/development/libraries/nghttp2/default.nix
@@ -6,6 +6,7 @@
 , enableAsioLib ? false, boost ? null
 , enableGetAssets ? false, libxml2 ? null
 , enableJemalloc ? false, jemalloc ? null
+, enableApp ? !stdenv.hostPlatform.isWindows
 }:
 
 assert enableHpack -> jansson != null;
@@ -35,8 +36,12 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  configureFlags = [ "--with-spdylay=no" "--disable-examples" "--disable-python-bindings" "--enable-app" ]
-    ++ optional enableAsioLib "--enable-asio-lib --with-boost-libdir=${boost}/lib";
+  configureFlags = [
+    "--with-spdylay=no"
+    "--disable-examples"
+    "--disable-python-bindings"
+    (stdenv.lib.enableFeature enableApp "app")
+  ] ++ optional enableAsioLib "--enable-asio-lib --with-boost-libdir=${boost}/lib";
 
   #doCheck = true;  # requires CUnit ; currently failing at test_util_localtime_date in util_test.cc
 
diff --git a/pkgs/development/libraries/nlohmann_json/default.nix b/pkgs/development/libraries/nlohmann_json/default.nix
index 15bdbb1b48e8..25d4386cec2c 100644
--- a/pkgs/development/libraries/nlohmann_json/default.nix
+++ b/pkgs/development/libraries/nlohmann_json/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   name = "nlohmann_json-${version}";
-  version = "3.2.0";
+  version = "3.3.0";
 
   src = fetchFromGitHub {
     owner = "nlohmann";
     repo = "json";
     rev = "v${version}";
-    sha256 = "0585r6ai9x1bhspffn5w5620wxfl1q1gj476brsnaf7wwnr60hwk";
+    sha256 = "1plg9l1avnjsg6khrd88yj9cbzbbkwzpc5synmicqndb35wndn5h";
   };
 
   nativeBuildInputs = [ cmake ];
@@ -18,8 +18,6 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [
     "-DBuildTests=${if doCheck then "ON" else "OFF"}"
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform.libc == "msvcrt") [
-    "-DCMAKE_SYSTEM_NAME=Windows"
   ];
 
   doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
diff --git a/pkgs/development/libraries/nspr/default.nix b/pkgs/development/libraries/nspr/default.nix
index ce18498ee858..9cb7d701b9da 100644
--- a/pkgs/development/libraries/nspr/default.nix
+++ b/pkgs/development/libraries/nspr/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl
 , CoreServices ? null }:
 
-let version = "4.19"; in
+let version = "4.20"; in
 
 stdenv.mkDerivation {
   name = "nspr-${version}";
 
   src = fetchurl {
     url = "mirror://mozilla/nspr/releases/v${version}/src/nspr-${version}.tar.gz";
-    sha256 = "0agpv3f17h8kmzi0ifibaaxc1k3xc0q61wqw3l6r2xr2z8bmkn9f";
+    sha256 = "0vjms4j75zvv5b2siyafg7hh924ysx2cwjad8spzp7x87n8n929c";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix
index dd87fa932604..64aa11e17634 100644
--- a/pkgs/development/libraries/opencv/3.x.nix
+++ b/pkgs/development/libraries/opencv/3.x.nix
@@ -165,6 +165,11 @@ stdenv.mkDerivation rec {
       ${installExtraFiles face}
     '');
 
+  postConfigure = ''
+    [ -e modules/core/version_string.inc ]
+    echo '"(build info elided)"' > modules/core/version_string.inc
+  '';
+
   buildInputs =
        [ zlib pcre hdf5 glog boost google-gflags protobuf ]
     ++ lib.optional enablePython pythonPackages.python
diff --git a/pkgs/development/libraries/p11-kit/default.nix b/pkgs/development/libraries/p11-kit/default.nix
index e0e0b59a9a9f..b4bdd200211c 100644
--- a/pkgs/development/libraries/p11-kit/default.nix
+++ b/pkgs/development/libraries/p11-kit/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   name = "p11-kit-${version}";
-  version = "0.23.13";
+  version = "0.23.14";
 
   src = fetchFromGitHub {
     owner = "p11-glue";
     repo = "p11-kit";
     rev = version;
-    sha256 = "1z2rbw2qbwj64i88llc1mkf0263qa0kxc2350kg25r7mghxbw1y6";
+    sha256 = "0zmrw1ciybhnxjlsfb07wnf11ak5vrmy8y8fnz3mwm8v3w8dzlvw";
   };
 
   outputs = [ "out" "dev"];
diff --git a/pkgs/development/libraries/parquet-cpp/api.patch b/pkgs/development/libraries/parquet-cpp/api.patch
new file mode 100644
index 000000000000..3fd567ea098f
--- /dev/null
+++ b/pkgs/development/libraries/parquet-cpp/api.patch
@@ -0,0 +1,12 @@
+diff --git a/src/parquet/arrow/reader.cc b/src/parquet/arrow/reader.cc
+--- a/src/parquet/arrow/reader.cc
++++ b/src/parquet/arrow/reader.cc
+@@ -1421,7 +1421,7 @@ Status StructImpl::DefLevelsToNullArray(std::shared_ptr<Buffer>* null_bitmap_out
+   const int16_t* def_levels_data;
+   size_t def_levels_length;
+   RETURN_NOT_OK(GetDefLevels(&def_levels_data, &def_levels_length));
+-  RETURN_NOT_OK(AllocateEmptyBitmap(pool_, def_levels_length, &null_bitmap));
++  RETURN_NOT_OK(GetEmptyBitmap(pool_, def_levels_length, &null_bitmap));
+   uint8_t* null_bitmap_ptr = null_bitmap->mutable_data();
+   for (size_t i = 0; i < def_levels_length; i++) {
+     if (def_levels_data[i] < struct_def_level_) {
diff --git a/pkgs/development/libraries/parquet-cpp/default.nix b/pkgs/development/libraries/parquet-cpp/default.nix
deleted file mode 100644
index e281e604380b..000000000000
--- a/pkgs/development/libraries/parquet-cpp/default.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-{ stdenv, symlinkJoin, fetchurl, arrow-cpp, boost, cmake, gtest, snappy, thrift, zlib }:
-
-stdenv.mkDerivation rec {
-  name = "parquet-cpp-${version}";
-  version = "1.4.0";
-
-  src = fetchurl {
-    url = "https://github.com/apache/parquet-cpp/archive/apache-${name}.tar.gz";
-    sha256 = "1kn7pjzi5san5f05qbl8l8znqsa3f9cq9bflfr4s2jfwr7k9p2aj";
-  };
-
-  nativeBuildInputs = [ cmake ];
-  buildInputs = [ boost ];
-
-  preConfigure = ''
-    substituteInPlace cmake_modules/FindThrift.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
-    substituteInPlace cmake_modules/FindSnappy.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
-  '';
-
-  ARROW_HOME = arrow-cpp;
-  THRIFT_HOME = thrift;
-  GTEST_HOME = gtest;
-  SNAPPY_HOME = symlinkJoin { name="snappy-wrap"; paths = [ snappy snappy.dev ]; };
-  ZLIB_HOME = symlinkJoin { name="zlib-wrap"; paths = [ zlib.dev zlib.static ]; };
-
-  cmakeFlags = [
-    "-DPARQUET_BUILD_BENCHMARKS=OFF"
-  ];
-
-  meta = {
-    description = "A C++ library to read and write the Apache Parquet columnar data format";
-    homepage = http://parquet.apache.org;
-    license = stdenv.lib.licenses.asl20;
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ veprbl ];
-  };
-}
diff --git a/pkgs/development/libraries/physics/apfel/default.nix b/pkgs/development/libraries/physics/apfel/default.nix
new file mode 100644
index 000000000000..3eb4ddaab693
--- /dev/null
+++ b/pkgs/development/libraries/physics/apfel/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchFromGitHub, gfortran, lhapdf, python2 }:
+
+stdenv.mkDerivation rec {
+  name = "apfel-${version}";
+  version = "3.0.3";
+
+  src = fetchFromGitHub {
+    owner = "scarrazza";
+    repo = "apfel";
+    rev = version;
+    sha256 = "13dvcc5ba6djflrcy5zf5ikaw8s78zd8ac6ickc0hxhbmx1gjb4j";
+  };
+
+  buildInputs = [ gfortran lhapdf python2 ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A PDF Evolution Library";
+    license     = licenses.gpl3;
+    homepage    = http://apfel.mi.infn.it/;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/pkgs/development/libraries/physics/apfelgrid/default.nix b/pkgs/development/libraries/physics/apfelgrid/default.nix
new file mode 100644
index 000000000000..6509b04f0113
--- /dev/null
+++ b/pkgs/development/libraries/physics/apfelgrid/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, apfel, applgrid, lhapdf, root }:
+
+stdenv.mkDerivation rec {
+  name = "apfelgrid-${version}";
+  version = "1.0.1";
+
+  src = fetchFromGitHub {
+    owner = "nhartland";
+    repo = "APFELgrid";
+    rev = "v${version}";
+    sha256 = "0l0cyxd00kmb5aggzwsxg83ah0qiwav0shbxkxwrz3dvw78n89jk";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ apfel applgrid lhapdf root ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Ultra-fast theory predictions for collider observables";
+    license     = licenses.mit;
+    homepage    = http://nhartland.github.io/APFELgrid/;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/pkgs/development/libraries/physics/applgrid/bad_code.patch b/pkgs/development/libraries/physics/applgrid/bad_code.patch
new file mode 100644
index 000000000000..c1c8f618fbb3
--- /dev/null
+++ b/pkgs/development/libraries/physics/applgrid/bad_code.patch
@@ -0,0 +1,39 @@
+diff --git a/appl_grid/appl_grid.h b/appl_grid/appl_grid.h
+index 5059622..a0651c9 100644
+--- a/appl_grid/appl_grid.h
++++ b/appl_grid/appl_grid.h
+@@ -56,7 +56,7 @@ public:
+   class exception : public std::exception { 
+   public:
+     exception(const std::string& s) { std::cerr << what() << " " << s << std::endl; }; 
+-    exception(std::ostream& s)      { std::cerr << what() << " " << s << std::endl; }; 
++    exception(std::ostream& s)      { s << what() << " " << std::endl; }; 
+     virtual const char* what() const throw() { return "appl::grid::exception"; }
+   };
+ 
+diff --git a/appl_grid/appl_pdf.h b/appl_grid/appl_pdf.h
+index c71fd84..2525527 100644
+--- a/appl_grid/appl_pdf.h
++++ b/appl_grid/appl_pdf.h
+@@ -51,7 +51,7 @@ public:
+   class exception : public std::exception { 
+   public: 
+     exception(const std::string& s="") { std::cerr << what() << " " << s << std::endl; }; 
+-    exception(std::ostream& s)         { std::cerr << what() << " " << s << std::endl; }; 
++    exception(std::ostream& s)         { s << " " << std::endl; }; 
+     const char* what() const throw() { return "appl::appl_pdf::exception "; }
+   };
+   
+diff --git a/src/appl_igrid.h b/src/appl_igrid.h
+index d25288e..be354df 100644
+--- a/src/appl_igrid.h
++++ b/src/appl_igrid.h
+@@ -52,7 +52,7 @@ private:
+   class exception { 
+   public:
+     exception(const std::string& s) { std::cerr << s << std::endl; }; 
+-    exception(std::ostream& s)      { std::cerr << s << std::endl; }; 
++    exception(std::ostream& s)      { s << std::endl; }; 
+   };
+ 
+   typedef double (igrid::*transform_t)(double) const;
diff --git a/pkgs/development/libraries/physics/applgrid/default.nix b/pkgs/development/libraries/physics/applgrid/default.nix
new file mode 100644
index 000000000000..1ad5dcb8b25b
--- /dev/null
+++ b/pkgs/development/libraries/physics/applgrid/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, gfortran, hoppet, lhapdf, root5 }:
+
+stdenv.mkDerivation rec {
+  name = "applgrid-${version}";
+  version = "1.4.70";
+
+  src = fetchurl {
+    url = "https://www.hepforge.org/archive/applgrid/${name}.tgz";
+    sha256 = "1yw9wrk3vjv84kd3j4s1scfhinirknwk6xq0hvj7x2srx3h93q9p";
+  };
+
+  buildInputs = [ gfortran hoppet lhapdf root5 ];
+
+  patches = [
+    ./bad_code.patch
+  ];
+
+  preConfigure = ''
+    substituteInPlace src/Makefile.in \
+      --replace "-L\$(subst /libgfortran.a, ,\$(FRTLIB) )" "-L${gfortran.cc.lib}/lib"
+  '' + (if stdenv.isDarwin then ''
+    substituteInPlace src/Makefile.in \
+      --replace "gfortran -print-file-name=libgfortran.a" "gfortran -print-file-name=libgfortran.dylib"
+  '' else "");
+
+  enableParallelBuilding = false; # broken
+
+  # Install private headers required by APFELgrid
+  postInstall = ''
+    for header in src/*.h; do
+      install -Dm644 "$header" "$out"/include/appl_grid/"`basename $header`"
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "The APPLgrid project provides a fast and flexible way to reproduce the results of full NLO calculations with any input parton distribution set in only a few milliseconds rather than the weeks normally required to gain adequate statistics";
+    license     = licenses.gpl3;
+    homepage    = http://applgrid.hepforge.org;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/pkgs/development/libraries/physics/hoppet/default.nix b/pkgs/development/libraries/physics/hoppet/default.nix
new file mode 100644
index 000000000000..55714afbdce9
--- /dev/null
+++ b/pkgs/development/libraries/physics/hoppet/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, gfortran }:
+
+stdenv.mkDerivation rec {
+  name = "hoppet-${version}";
+  version = "1.2.0";
+
+  src = fetchurl {
+    url = "https://hoppet.hepforge.org/downloads/${name}.tgz";
+    sha256 = "0j7437rh4xxbfzmkjr22ry34xm266gijzj6mvrq193fcsfzipzdz";
+  };
+
+  buildInputs = [ gfortran ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Higher Order Perturbative Parton Evolution Toolkit";
+    license     = licenses.gpl2;
+    homepage    = https://hoppet.hepforge.org;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/pkgs/development/libraries/physics/mela/default.nix b/pkgs/development/libraries/physics/mela/default.nix
new file mode 100644
index 000000000000..a608a7f6b0f7
--- /dev/null
+++ b/pkgs/development/libraries/physics/mela/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchFromGitHub, gfortran }:
+
+stdenv.mkDerivation rec {
+  name = "mela-${version}";
+  version = "2.0.1";
+
+  src = fetchFromGitHub {
+    owner = "vbertone";
+    repo = "MELA";
+    rev = version;
+    sha256 = "01sgd4mwx4n58x95brphp4dskqkkx8434bvsr38r5drg9na5nc9y";
+  };
+
+  buildInputs = [ gfortran ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "a Mellin Evolution LibrAry";
+    license     = licenses.gpl3;
+    homepage    = https://github.com/vbertone/MELA;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/pkgs/development/libraries/physics/qcdnum/default.nix b/pkgs/development/libraries/physics/qcdnum/default.nix
new file mode 100644
index 000000000000..1a3334562641
--- /dev/null
+++ b/pkgs/development/libraries/physics/qcdnum/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, gfortran }:
+
+stdenv.mkDerivation rec {
+  name = "QCDNUM-${version}";
+  version = "17-01-14";
+
+  src = fetchurl {
+    url = "http://www.nikhef.nl/user/h24/qcdnum-files/download/qcdnum${builtins.replaceStrings ["-"] [""] version}.tar.gz";
+    sha256 = "199s6kgmszxgjzd9214mpx3kyplq2q6987sii67s5xkg10ynyv31";
+  };
+
+  nativeBuildInputs = [ gfortran ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "QCDNUM is a very fast QCD evolution program written in FORTRAN77";
+    license     = stdenv.lib.licenses.gpl3;
+    homepage    = https://www.nikhef.nl/~h24/qcdnum/index.html;
+    platforms   = stdenv.lib.platforms.unix;
+    maintainers = with stdenv.lib.maintainers; [ veprbl ];
+  };
+}
diff --git a/pkgs/development/libraries/postgis/default.nix b/pkgs/development/libraries/postgis/default.nix
index 0da66acbde2a..04fdeea1fa0b 100644
--- a/pkgs/development/libraries/postgis/default.nix
+++ b/pkgs/development/libraries/postgis/default.nix
@@ -42,8 +42,8 @@
 
 
 let
-  version = "2.4.5";
-  sha256 = "0saxj3w7j9yb9sa1ig3ccxvh2pk0bj47hp7m6199p1a1fpfjgrrg";
+  version = "2.5.0";
+  sha256 = "1m9n1shhqhjrhbq6fd9fyfccxcgpng37s3lffhlmyrp98zbsnwxy";
 in stdenv.mkDerivation rec {
   name = "postgis-${version}";
 
diff --git a/pkgs/development/libraries/proj/default.nix b/pkgs/development/libraries/proj/default.nix
index 0ebf299a8bfb..55af1d8573a1 100644
--- a/pkgs/development/libraries/proj/default.nix
+++ b/pkgs/development/libraries/proj/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation {
-  name = "proj-4.9.3";
+  name = "proj-5.2.0";
 
   src = fetchurl {
-    url = https://download.osgeo.org/proj/proj-4.9.3.tar.gz;
-    sha256 = "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139";
+    url = https://download.osgeo.org/proj/proj-5.2.0.tar.gz;
+    sha256 = "0q3ydh2j8qhwlxmnac72pg69rw2znbi5b6k5wama8qmwzycr94gg";
   };
 
   doCheck = stdenv.is64bit;
diff --git a/pkgs/development/libraries/qpdf/default.nix b/pkgs/development/libraries/qpdf/default.nix
index 79deb482161f..456c28503e81 100644
--- a/pkgs/development/libraries/qpdf/default.nix
+++ b/pkgs/development/libraries/qpdf/default.nix
@@ -14,14 +14,6 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ zlib libjpeg ];
 
-  patches = [
-    (fetchpatch {
-      name = "CVE-2018-9918.patch";
-      url = "https://github.com/qpdf/qpdf/commit/b4d6cf6836ce025ba1811b7bbec52680c7204223";
-      sha256 = "0mdqa9w1p6cmli6976v4wi0sw9r4p5prkj7lzfd1877wk11c9c73";
-    })
-  ];
-
   postPatch = ''
     patchShebangs qpdf/fix-qdf
   '';
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 f7ddf8ff780c..8715aaaa44d0 100644
--- a/pkgs/development/libraries/qt-4.x/4.8/default.nix
+++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix
@@ -68,6 +68,7 @@ stdenv.mkDerivation rec {
       ./parallel-configure.patch
       ./clang-5-darwin.patch
       ./qt-4.8.7-unixmake-darwin.patch
+      ./kill-legacy-darwin-apis.patch
       (substituteAll {
         src = ./dlopen-absolute-paths.diff;
         cups = if cups != null then lib.getLib cups else null;
diff --git a/pkgs/development/libraries/qt-4.x/4.8/kill-legacy-darwin-apis.patch b/pkgs/development/libraries/qt-4.x/4.8/kill-legacy-darwin-apis.patch
new file mode 100644
index 000000000000..c1338e98d851
--- /dev/null
+++ b/pkgs/development/libraries/qt-4.x/4.8/kill-legacy-darwin-apis.patch
@@ -0,0 +1,330 @@
+diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
+index 4a9049b..c0ac9db 100644
+--- a/src/corelib/io/qfilesystemengine_unix.cpp
++++ b/src/corelib/io/qfilesystemengine_unix.cpp
+@@ -242,9 +242,8 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry,
+ #else
+     char *ret = 0;
+ # if defined(Q_OS_MAC) && !defined(Q_OS_IOS)
+-    // When using -mmacosx-version-min=10.4, we get the legacy realpath implementation,
+-    // which does not work properly with the realpath(X,0) form. See QTBUG-28282.
+-    if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) {
++    // In Nix-on-Darwin, we don't support ancient macOS anyway, and the deleted branch relies on
++    // a symbol that's been deprecated for years and that our CF doesn't have
+         ret = (char*)malloc(PATH_MAX + 1);
+         if (ret && realpath(entry.nativeFilePath().constData(), (char*)ret) == 0) {
+             const int savedErrno = errno; // errno is checked below, and free() might change it
+@@ -252,19 +251,6 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry,
+             errno = savedErrno;
+             ret = 0;
+         }
+-    } else {
+-        // on 10.5 we can use FSRef to resolve the file path.
+-        QString path = QDir::cleanPath(entry.filePath());
+-        FSRef fsref;
+-        if (FSPathMakeRef((const UInt8 *)path.toUtf8().data(), &fsref, 0) == noErr) {
+-            CFURLRef urlref = CFURLCreateFromFSRef(NULL, &fsref);
+-            CFStringRef canonicalPath = CFURLCopyFileSystemPath(urlref, kCFURLPOSIXPathStyle);
+-            QString ret = QCFString::toQString(canonicalPath);
+-            CFRelease(canonicalPath);
+-            CFRelease(urlref);
+-            return QFileSystemEntry(ret);
+-        }
+-    }
+ # else
+ #  if _POSIX_VERSION >= 200801L
+     ret = realpath(entry.nativeFilePath().constData(), (char*)0);
+diff --git a/src/3rdparty/webkit/Source/WebCore/platform/mac/WebCoreNSStringExtras.h b/src/3rdparty/webkit/Source/WebCore/platform/mac/WebCoreNSStringExtras.h
+index 3bf7342..b6bcfc0 100644
+--- a/src/3rdparty/webkit/Source/WebCore/platform/mac/WebCoreNSStringExtras.h
++++ b/src/3rdparty/webkit/Source/WebCore/platform/mac/WebCoreNSStringExtras.h
+@@ -43,7 +43,6 @@ BOOL stringIsCaseInsensitiveEqualToString(NSString *first, NSString *second);
+ BOOL hasCaseInsensitiveSuffix(NSString *string, NSString *suffix);
+ BOOL hasCaseInsensitiveSubstring(NSString *string, NSString *substring);
+ NSString *filenameByFixingIllegalCharacters(NSString *string);
+-CFStringEncoding stringEncodingForResource(Handle resource);
+ 
+ #ifdef __cplusplus
+ }
+diff --git a/src/3rdparty/webkit/Source/WebCore/platform/mac/WebCoreNSStringExtras.mm b/src/3rdparty/webkit/Source/WebCore/platform/mac/WebCoreNSStringExtras.mm
+index d6c3f0c..c88ca76 100644
+--- a/src/3rdparty/webkit/Source/WebCore/platform/mac/WebCoreNSStringExtras.mm
++++ b/src/3rdparty/webkit/Source/WebCore/platform/mac/WebCoreNSStringExtras.mm
+@@ -68,45 +68,4 @@ BOOL hasCaseInsensitiveSubstring(NSString *string, NSString *substring)
+     return filename;
+ }
+ 
+-CFStringEncoding stringEncodingForResource(Handle resource)
+-{
+-    short resRef = HomeResFile(resource);
+-    if (ResError() != noErr)
+-        return NSMacOSRomanStringEncoding;
+-    
+-    // Get the FSRef for the current resource file
+-    FSRef fref;
+-    OSStatus error = FSGetForkCBInfo(resRef, 0, NULL, NULL, NULL, &fref, NULL);
+-    if (error != noErr)
+-        return NSMacOSRomanStringEncoding;
+-    
+-    RetainPtr<CFURLRef> url(AdoptCF, CFURLCreateFromFSRef(NULL, &fref));
+-    if (!url)
+-        return NSMacOSRomanStringEncoding;
+-
+-    NSString *path = [(NSURL *)url.get() path];
+-
+-    // Get the lproj directory name
+-    path = [path stringByDeletingLastPathComponent];
+-    if (!stringIsCaseInsensitiveEqualToString([path pathExtension], @"lproj"))
+-        return NSMacOSRomanStringEncoding;
+-    
+-    NSString *directoryName = [[path stringByDeletingPathExtension] lastPathComponent];
+-    RetainPtr<CFStringRef> locale(AdoptCF, CFLocaleCreateCanonicalLocaleIdentifierFromString(NULL, (CFStringRef)directoryName));
+-    if (!locale)
+-        return NSMacOSRomanStringEncoding;
+-
+-    LangCode lang;
+-    RegionCode region;
+-    error = LocaleStringToLangAndRegionCodes([(NSString *)locale.get() UTF8String], &lang, &region);
+-    if (error != noErr)
+-        return NSMacOSRomanStringEncoding;
+-
+-    TextEncoding encoding;
+-    error = UpgradeScriptInfoToTextEncoding(kTextScriptDontCare, lang, region, NULL, &encoding);
+-    if (error != noErr)
+-        return NSMacOSRomanStringEncoding;
+-    
+-    return encoding;
+-}
+ 
+diff --git a/src/3rdparty/webkit/Source/WebCore/plugins/mac/PluginPackageMac.cpp b/src/3rdparty/webkit/Source/WebCore/plugins/mac/PluginPackageMac.cpp
+index 865ea32..20bda8d 100644
+--- a/src/3rdparty/webkit/Source/WebCore/plugins/mac/PluginPackageMac.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/plugins/mac/PluginPackageMac.cpp
+@@ -101,33 +101,6 @@ static WTF::RetainPtr<CFDictionaryRef> readPListFile(CFStringRef fileName, bool
+     return map;
+ }
+ 
+-static Vector<String> stringListFromResourceId(SInt16 id)
+-{
+-    Vector<String> list;
+-
+-    Handle handle = Get1Resource('STR#', id);
+-    if (!handle)
+-        return list;
+-
+-    CFStringEncoding encoding = stringEncodingForResource(handle);
+-
+-    unsigned char* p = (unsigned char*)*handle;
+-    if (!p)
+-        return list;
+-
+-    SInt16 count = *(SInt16*)p;
+-    p += sizeof(SInt16);
+-
+-    for (SInt16 i = 0; i < count; ++i) {
+-        unsigned char length = *p;
+-        WTF::RetainPtr<CFStringRef> str = CFStringCreateWithPascalString(0, p, encoding);
+-        list.append(str.get());
+-        p += 1 + length;
+-    }
+-
+-    return list;
+-}
+-
+ bool PluginPackage::fetchInfo()
+ {
+     if (!load())
+@@ -202,36 +175,8 @@ bool PluginPackage::fetchInfo()
+         m_description = (CFStringRef)CFBundleGetValueForInfoDictionaryKey(m_module, CFSTR("WebPluginDescription"));
+ 
+     } else {
+-        int resFile = CFBundleOpenBundleResourceMap(m_module);
+-
+-        UseResFile(resFile);
+-
+-        Vector<String> mimes = stringListFromResourceId(MIMEListStringStringNumber);
+-
+-        if (mimes.size() % 2 != 0)
+-            return false;
+-
+-        Vector<String> descriptions = stringListFromResourceId(MIMEDescriptionStringNumber);
+-        if (descriptions.size() != mimes.size() / 2)
+-            return false;
+-
+-        for (size_t i = 0;  i < mimes.size(); i += 2) {
+-            String mime = mimes[i].lower();
+-            Vector<String> extensions;
+-            mimes[i + 1].lower().split(UChar(','), extensions);
+-
+-            m_mimeToExtensions.set(mime, extensions);
+-
+-            m_mimeToDescriptions.set(mime, descriptions[i / 2]);
+-        }
+-
+-        Vector<String> names = stringListFromResourceId(PluginNameOrDescriptionStringNumber);
+-        if (names.size() == 2) {
+-            m_description = names[0];
+-            m_name = names[1];
+-        }
+-
+-        CFBundleCloseBundleResourceMap(m_module, resFile);
++        LOG(Plugins, "Nix removed ancient code that relies on long-deprecated functionality that we don't want to support!");
++        return false;
+     }
+ 
+     LOG(Plugins, "PluginPackage::fetchInfo(): Found plug-in '%s'", m_name.utf8().data());
+diff --git a/src/3rdparty/webkit/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm b/src/3rdparty/webkit/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm
+index b206e48..669d442 100644
+--- a/src/3rdparty/webkit/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm
++++ b/src/3rdparty/webkit/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm
+@@ -26,7 +26,6 @@
+ #import "config.h"
+ #import "NetscapePluginModule.h"
+ 
+-#import <WebCore/WebCoreNSStringExtras.h>
+ #import <wtf/HashSet.h>
+ 
+ using namespace WebCore;
+@@ -196,132 +195,6 @@ static bool getPluginInfoFromPropertyLists(CFBundleRef bundle, PluginInfo& plugi
+     return true;    
+ }
+ 
+-class ResourceMap {
+-public:
+-    explicit ResourceMap(CFBundleRef bundle)
+-        : m_bundle(bundle)
+-        , m_currentResourceFile(CurResFile())
+-        , m_bundleResourceMap(CFBundleOpenBundleResourceMap(m_bundle))
+-    {
+-        UseResFile(m_bundleResourceMap);
+-    }
+-
+-    ~ResourceMap()
+-    {
+-        // Close the resource map.
+-        CFBundleCloseBundleResourceMap(m_bundle, m_bundleResourceMap);
+-        
+-        // And restore the old resource.
+-        UseResFile(m_currentResourceFile);
+-    }
+-
+-    bool isValid() const { return m_bundleResourceMap != -1; }
+-
+-private:
+-    CFBundleRef m_bundle;
+-    ResFileRefNum m_currentResourceFile;
+-    ResFileRefNum m_bundleResourceMap;
+-};
+-
+-static bool getStringListResource(ResID resourceID, Vector<String>& stringList) {
+-    Handle stringListHandle = Get1Resource('STR#', resourceID);
+-    if (!stringListHandle || !*stringListHandle)
+-        return false;
+-
+-    // Get the string list size.
+-    Size stringListSize = GetHandleSize(stringListHandle);
+-    if (stringListSize < static_cast<Size>(sizeof(UInt16)))
+-        return false;
+-
+-    CFStringEncoding stringEncoding = stringEncodingForResource(stringListHandle);
+-
+-    unsigned char* ptr = reinterpret_cast<unsigned char*>(*stringListHandle);
+-    unsigned char* end = ptr + stringListSize;
+-    
+-    // Get the number of strings in the string list.
+-    UInt16 numStrings = *reinterpret_cast<UInt16*>(ptr);
+-    ptr += sizeof(UInt16);
+-
+-    for (UInt16 i = 0; i < numStrings; ++i) {
+-        // We're past the end of the string, bail.
+-        if (ptr >= end)
+-            return false;
+-
+-        // Get the string length.
+-        unsigned char stringLength = *ptr++;
+-
+-        RetainPtr<CFStringRef> cfString(AdoptCF, CFStringCreateWithBytesNoCopy(kCFAllocatorDefault, ptr, stringLength, stringEncoding, false, kCFAllocatorNull));
+-        if (!cfString.get())
+-            return false;
+-
+-        stringList.append(cfString.get());
+-        ptr += stringLength;
+-    }
+-
+-    if (ptr != end)
+-        return false;
+-
+-    return true;
+-}
+-
+-static const ResID PluginNameOrDescriptionStringNumber = 126;
+-static const ResID MIMEDescriptionStringNumber = 127;
+-static const ResID MIMEListStringStringNumber = 128;
+-
+-static bool getPluginInfoFromCarbonResources(CFBundleRef bundle, PluginInfo& pluginInfo)
+-{
+-    ResourceMap resourceMap(bundle);
+-    if (!resourceMap.isValid())
+-        return false;
+-
+-    // Get the description and name string list.
+-    Vector<String> descriptionAndName;
+-    if (!getStringListResource(PluginNameOrDescriptionStringNumber, descriptionAndName))
+-        return false;
+-
+-    // Get the MIME types and extensions string list. This list needs to be a multiple of two.
+-    Vector<String> mimeTypesAndExtensions;
+-    if (!getStringListResource(MIMEListStringStringNumber, mimeTypesAndExtensions))
+-        return false;
+-
+-    if (mimeTypesAndExtensions.size() % 2)
+-        return false;
+-
+-    // Now get the MIME type descriptions string list. This string list needs to be the same length as the number of MIME types.
+-    Vector<String> mimeTypeDescriptions;
+-    if (!getStringListResource(MIMEDescriptionStringNumber, mimeTypeDescriptions))
+-        return false;
+-
+-    // Add all MIME types.
+-    for (size_t i = 0; i < mimeTypesAndExtensions.size() / 2; ++i) {
+-        MimeClassInfo mimeClassInfo;
+-        
+-        const String& mimeType = mimeTypesAndExtensions[i * 2];
+-        String description;
+-        if (i < mimeTypeDescriptions.size())
+-            description = mimeTypeDescriptions[i];
+-        
+-        mimeClassInfo.type = mimeType.lower();
+-        mimeClassInfo.desc = description;
+-        
+-        Vector<String> extensions;
+-        mimeTypesAndExtensions[i * 2 + 1].split(',', extensions);
+-        
+-        for (size_t i = 0; i < extensions.size(); ++i)
+-            mimeClassInfo.extensions.append(extensions[i].lower());
+-
+-        pluginInfo.mimes.append(mimeClassInfo);
+-    }
+-
+-    // Set the description and name if they exist.
+-    if (descriptionAndName.size() > 0)
+-        pluginInfo.desc = descriptionAndName[0];
+-    if (descriptionAndName.size() > 1)
+-        pluginInfo.name = descriptionAndName[1];
+-
+-    return true;
+-}
+-
+ bool NetscapePluginModule::getPluginInfo(const String& pluginPath, PluginInfoStore::Plugin& plugin)
+ {
+     RetainPtr<CFStringRef> bundlePath(AdoptCF, pluginPath.createCFString());
+@@ -344,8 +217,7 @@ static bool getPluginInfoFromCarbonResources(CFBundleRef bundle, PluginInfo& plu
+         return false;
+     
+     // Check that there's valid info for this plug-in.
+-    if (!getPluginInfoFromPropertyLists(bundle.get(), plugin.info) &&
+-        !getPluginInfoFromCarbonResources(bundle.get(), plugin.info))
++    if (!getPluginInfoFromPropertyLists(bundle.get(), plugin.info))
+         return false;
+     
+     plugin.path = pluginPath;
diff --git a/pkgs/development/libraries/qt-5/modules/qtgraphicaleffects.nix b/pkgs/development/libraries/qt-5/modules/qtgraphicaleffects.nix
index 888f627baab8..d0be6ae77694 100644
--- a/pkgs/development/libraries/qt-5/modules/qtgraphicaleffects.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtgraphicaleffects.nix
@@ -3,5 +3,5 @@
 qtModule {
   name = "qtgraphicaleffects";
   qtInputs = [ qtdeclarative ];
-  outputs = [ "out" ];
+  outputs = [ "out" "dev" ];
 }
diff --git a/pkgs/development/libraries/range-v3/default.nix b/pkgs/development/libraries/range-v3/default.nix
index cdb5297a6d87..7fe4b504a992 100644
--- a/pkgs/development/libraries/range-v3/default.nix
+++ b/pkgs/development/libraries/range-v3/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "range-v3-${version}";
-  version = "0.3.7";
+  version = "0.4.0";
 
   src = fetchFromGitHub {
     owner = "ericniebler";
     repo = "range-v3";
     rev = version;
-    sha256 = "1zhsz1i4jy97idydg7ay3wazp7v2353vckkli5w9g51jka43h5x2";
+    sha256 = "1s5gj799aa94nfg3r24whq7ck69g0zypf70w14wx64pgwg0424vf";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/rapidcheck/default.nix b/pkgs/development/libraries/rapidcheck/default.nix
new file mode 100644
index 000000000000..9d8ce8cef202
--- /dev/null
+++ b/pkgs/development/libraries/rapidcheck/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, cmake, fetchFromGitHub }:
+
+stdenv.mkDerivation rec{
+  name = "rapidcheck-${version}";
+  version = "unstable-2018-09-27";
+
+  src = fetchFromGitHub {
+    owner = "emil-e";
+    repo  = "rapidcheck";
+    rev   = "de54478fa35c0d9cea14ec0c5c9dfae906da524c";
+    sha256 = "0n8l0mlq9xqmpkgcj5xicicd1my2cfwxg25zdy8347dqkl1ppgbs";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  postInstall = ''
+    cp ../extras/boost_test/include/rapidcheck/boost_test.h $out/include/rapidcheck
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A C++ framework for property based testing inspired by QuickCheck";
+    inherit (src.meta) homepage;
+    maintainers = with maintainers; [ jb55 ];
+    license = licenses.bsd2;
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/rarian/default.nix b/pkgs/development/libraries/rarian/default.nix
index 4446226fedef..d0a15e866f7a 100644
--- a/pkgs/development/libraries/rarian/default.nix
+++ b/pkgs/development/libraries/rarian/default.nix
@@ -6,7 +6,7 @@ in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.gz";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.gz";
     sha256 = "aafe886d46e467eb3414e91fa9e42955bd4b618c3e19c42c773026b205a84577";
   };
 
diff --git a/pkgs/development/libraries/rlog/default.nix b/pkgs/development/libraries/rlog/default.nix
index f96addffb1ae..f8268b5eb7cd 100644
--- a/pkgs/development/libraries/rlog/default.nix
+++ b/pkgs/development/libraries/rlog/default.nix
@@ -12,5 +12,6 @@ stdenv.mkDerivation {
     homepage = http://www.arg0.net/rlog;
     description = "A C++ logging library used in encfs";
     platforms = stdenv.lib.platforms.linux;
+    license = stdenv.lib.licenses.lgpl3;
   };
 }
diff --git a/pkgs/development/libraries/sbc/default.nix b/pkgs/development/libraries/sbc/default.nix
index 0dc9c1afd2b4..b9830b65ffb7 100644
--- a/pkgs/development/libraries/sbc/default.nix
+++ b/pkgs/development/libraries/sbc/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, libsndfile }:
 
 stdenv.mkDerivation rec {
-  name = "sbc-1.3";
+  name = "sbc-1.4";
 
   src = fetchurl {
     url = "http://www.kernel.org/pub/linux/bluetooth/${name}.tar.xz";
-    sha256 = "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476";
+    sha256 = "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/science/math/ipopt/default.nix b/pkgs/development/libraries/science/math/ipopt/default.nix
index 4a6aabb447f3..7e58a4c7c982 100644
--- a/pkgs/development/libraries/science/math/ipopt/default.nix
+++ b/pkgs/development/libraries/science/math/ipopt/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "ipopt-${version}";
-  version = "3.12.10";
+  version = "3.12.11";
 
   src = fetchurl {
     url = "https://www.coin-or.org/download/source/Ipopt/Ipopt-${version}.zip";
-    sha256 = "004pd90knnnzcx727knb7ffkabb1ggbskb8s607bfvfgdd7wlli9";
+    sha256 = "1qihlwwqsqpbwpp6zqfa7nrmb55dndppzmdy98897aiknaa2650h";
   };
 
   CXXDEFS = [ "-DHAVE_RAND" "-DHAVE_CSTRING" "-DHAVE_CSTDIO" ];
diff --git a/pkgs/development/libraries/science/math/mkl/default.nix b/pkgs/development/libraries/science/math/mkl/default.nix
new file mode 100644
index 000000000000..37814047f975
--- /dev/null
+++ b/pkgs/development/libraries/science/math/mkl/default.nix
@@ -0,0 +1,85 @@
+{ stdenvNoCC, writeText, fetchurl, rpmextract, undmg }:
+/*
+  Some (but not all) mkl functions require openmp, but Intel does not add these
+  to SO_NEEDED and instructs users to put openmp on their LD_LIBRARY_PATH. If
+  you are using mkl and your library/application is using some of the functions
+  that require openmp, add a setupHook like this to your package:
+
+  setupHook = writeText "setup-hook.sh" ''
+    addOpenmp() {
+        addToSearchPath LD_LIBRARY_PATH ${openmp}/lib
+    }
+    addEnvHooks "$targetOffset" addOpenmp
+  '';
+
+  We do not add the setup hook here, because avoiding it allows this large
+  package to be a fixed-output derivation with better cache efficiency.
+ */
+
+stdenvNoCC.mkDerivation rec {
+  name = "mkl-${version}";
+  version = "${date}.${rel}";
+  date = "2019.0";
+  rel = "117";
+
+  src = if stdenvNoCC.isDarwin
+    then
+      (fetchurl {
+        url = "http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/13565/m_mkl_${version}.dmg";
+        sha256 = "1f1jppac7vqwn00hkws0p4njx38ajh0n25bsjyb5d7jcacwfvm02";
+      })
+    else
+      (fetchurl {
+        url = "http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/13575/l_mkl_${version}.tgz";
+        sha256 = "1bf7i54iqlf7x7fn8kqwmi06g30sxr6nq3ac0r871i6g0p3y47sf";
+      });
+
+  buildInputs = if stdenvNoCC.isDarwin then [ undmg ] else [ rpmextract ];
+
+  buildPhase = if stdenvNoCC.isDarwin then ''
+      for f in Contents/Resources/pkg/*.tgz; do
+          tar xzvf $f
+      done
+  '' else ''
+    rpmextract rpm/intel-mkl-common-c-${date}-${rel}-${date}-${rel}.noarch.rpm
+    rpmextract rpm/intel-mkl-core-rt-${date}-${rel}-${date}-${rel}.x86_64.rpm
+  '';
+
+  installPhase = if stdenvNoCC.isDarwin then ''
+      mkdir -p $out/lib
+      cp -r compilers_and_libraries_${version}/mac/mkl/include $out/
+      cp -r compilers_and_libraries_${version}/mac/mkl/lib/* $out/lib/
+      cp -r compilers_and_libraries_${version}/licensing/mkl/en/license.txt $out/lib/
+  '' else ''
+      mkdir -p $out/lib
+      cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/include $out/
+      cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/lib/intel64_lin/* $out/lib/
+      cp license.txt $out/lib/
+  '';
+
+  # Per license agreement, do not modify the binary
+  dontStrip = true;
+  dontPatchELF = true;
+
+  # Since these are unmodified binaries from Intel, they do not depend on stdenv
+  # and we can make them fixed-output derivations for cache efficiency.
+  outputHashAlgo = "sha256";
+  outputHashMode = "recursive";
+  outputHash = if stdenvNoCC.isDarwin
+    then "1224dln7n8px1rk8biiggf77wjhxh8mzw0hd8zlyjm8i6j8w7i12"
+    else "0d8ai0wi8drp071acqkm1wv6vyg12010y843y56zzi1pql81xqvx";
+
+  meta = with stdenvNoCC.lib; {
+    description = "Intel Math Kernel Library";
+    longDescription = ''
+      Intel Math Kernel Library (Intel MKL) optimizes code with minimal effort
+      for future generations of Intel processors. It is compatible with your
+      choice of compilers, languages, operating systems, and linking and
+      threading models.
+    '';
+    homepage = https://software.intel.com/en-us/mkl;
+    license = [ licenses.issl licenses.unfreeRedistributable ];
+    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+    maintainers = [ maintainers.bhipple ];
+  };
+}
diff --git a/pkgs/development/libraries/science/math/openblas/default.nix b/pkgs/development/libraries/science/math/openblas/default.nix
index ecb27facfa02..b050a19db37b 100644
--- a/pkgs/development/libraries/science/math/openblas/default.nix
+++ b/pkgs/development/libraries/science/math/openblas/default.nix
@@ -79,12 +79,12 @@ let
 in
 stdenv.mkDerivation rec {
   name = "openblas-${version}";
-  version = "0.3.1";
+  version = "0.3.3";
   src = fetchFromGitHub {
     owner = "xianyi";
     repo = "OpenBLAS";
     rev = "v${version}";
-    sha256 = "1dkwp4gz1hzpmhzks9y9ipb4c5h0r6c7yff62x3s8x9z6f8knaqc";
+    sha256 = "0cpkvfvc14xm9mifrm919rp8vrq70gpl7r2sww4f0izrl39wklwx";
   };
 
   inherit blas64;
@@ -118,20 +118,7 @@ stdenv.mkDerivation rec {
     ] ++ stdenv.lib.optional (stdenv.hostPlatform.libc == "musl") "NO_AFFINITY=1"
     ++ mapAttrsToList (var: val: var + "=" + val) config;
 
-    patches = [
-      # Backport of https://github.com/xianyi/OpenBLAS/pull/1667, which
-      # is causing problems and was already accepted upstream.
-      (fetchpatch {
-        url = "https://github.com/xianyi/OpenBLAS/commit/5f2a3c05cd0e3872be3c5686b9da6b627658eeb7.patch";
-        sha256 = "1qvxhk92likrshw6z6hjqxvkblwzgsbzis2b2f71bsvx9174qfk1";
-      })
-      # Double "MAX_ALLOCATING_THREADS", fix with Go and Octave
-      # https://github.com/xianyi/OpenBLAS/pull/1663 (see also linked issue)
-      (fetchpatch {
-        url = "https://github.com/xianyi/OpenBLAS/commit/a49203b48c4a3d6f86413fc8c4b1fbfaa1946463.patch";
-        sha256 = "0v6kjkbgbw7hli6xkism48wqpkypxmcqvxpx564snll049l2xzq2";
-      })
-    ];
+    patches = [];
 
   doCheck = true;
   checkTarget = "tests";
diff --git a/pkgs/development/libraries/science/math/zn_poly/default.nix b/pkgs/development/libraries/science/math/zn_poly/default.nix
index 19d63d89834e..ad4d4c017376 100644
--- a/pkgs/development/libraries/science/math/zn_poly/default.nix
+++ b/pkgs/development/libraries/science/math/zn_poly/default.nix
@@ -1,17 +1,25 @@
 { stdenv
-, fetchurl
+, lib
+, fetchFromGitLab
+, fetchpatch
 , gmp
 , python2
+, tune ? false # tune to hardware, impure
 }:
 
 stdenv.mkDerivation rec {
-  version = "0.9";
+  version = "0.9.1";
   pname = "zn_poly";
   name = "${pname}-${version}";
 
-  src = fetchurl {
-    url = "http://web.maths.unsw.edu.au/~davidharvey/code/zn_poly/releases/zn_poly-${version}.tar.gz";
-    sha256 = "1kxl25av7i3v68k32hw5bayrfcvmahmqvs97mlh9g238gj4qb851";
+  # sage has picked up the maintenance (bug fixes and building, not development)
+  # from the original, now unmaintained project which can be found at
+  # http://web.maths.unsw.edu.au/~davidharvey/code/zn_poly/
+  src = fetchFromGitLab {
+    owner = "sagemath";
+    repo = "zn_poly";
+    rev = version;
+    sha256 = "0ra5vy585bqq7g3317iw6fp44iqgqvds3j0l1va6mswimypq4vxb";
   };
 
   buildInputs = [
@@ -22,27 +30,42 @@ stdenv.mkDerivation rec {
     python2 # needed by ./configure to create the makefile
   ];
 
-  libname = "libzn_poly${stdenv.targetPlatform.extensions.sharedLibrary}";
+  # name of library file ("libzn_poly.so")
+  libbasename = "libzn_poly";
+  libext = "${stdenv.targetPlatform.extensions.sharedLibrary}";
 
   makeFlags = [ "CC=cc" ];
 
   # Tuning (either autotuning or with hand-written paramters) is possible
   # but not implemented here.
   # It seems buggy anyways (see homepage).
-  buildFlags = [ "all" libname ];
+  buildFlags = [ "all" "${libbasename}${libext}" ];
 
+  configureFlags = lib.optionals (!tune) [
+    "--disable-tuning"
+  ];
+
+  patches = [
+    # fix format-security by not passing variables directly to printf
+    # https://gitlab.com/sagemath/zn_poly/merge_requests/1
+    (fetchpatch {
+      name = "format-security.patch";
+      url = "https://gitlab.com/timokau/zn_poly/commit/1950900a80ec898d342b8bcafa148c8027649766.patch";
+      sha256 = "1gks9chvsfpc6sg5h3nqqfia4cgvph7jmj9dw67k7dk7kv9y0rk1";
+    })
+  ];
 
   # `make install` fails to install some header files and the lib file.
   installPhase = ''
     mkdir -p "$out/include/zn_poly"
     mkdir -p "$out/lib"
-    cp "${libname}" "$out/lib"
+    cp "${libbasename}"*"${libext}" "$out/lib"
     cp include/*.h "$out/include/zn_poly"
   '';
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = http://web.maths.unsw.edu.au/~davidharvey/code/zn_poly/;
     description = "Polynomial arithmetic over Z/nZ";
     license = with licenses; [ gpl3 ];
diff --git a/pkgs/development/libraries/spice/default.nix b/pkgs/development/libraries/spice/default.nix
index ba3791a8a8bd..e9b12d169849 100644
--- a/pkgs/development/libraries/spice/default.nix
+++ b/pkgs/development/libraries/spice/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, pkgconfig, pixman, celt, alsaLib
 , openssl, libXrandr, libXfixes, libXext, libXrender, libXinerama
 , libjpeg, zlib, spice-protocol, python, pyparsing, glib, cyrus_sasl
-, lz4 }:
+, libcacard, lz4 }:
 
 with stdenv.lib;
 
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ pixman celt alsaLib openssl libjpeg zlib
                   libXrandr libXfixes libXrender libXext libXinerama
-                  python pyparsing glib cyrus_sasl lz4 ];
+                  python pyparsing glib cyrus_sasl libcacard lz4 ];
 
   nativeBuildInputs = [ pkgconfig spice-protocol ];
 
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [
     "--with-sasl"
-    "--disable-smartcard"
+    "--enable-smartcard"
     "--enable-client"
     "--enable-lz4"
   ];
diff --git a/pkgs/development/libraries/sqlite/default.nix b/pkgs/development/libraries/sqlite/default.nix
index 166ea39493bf..92574091558a 100644
--- a/pkgs/development/libraries/sqlite/default.nix
+++ b/pkgs/development/libraries/sqlite/default.nix
@@ -79,6 +79,6 @@ stdenv.mkDerivation rec {
     homepage = http://www.sqlite.org/;
     license = licenses.publicDomain;
     maintainers = with maintainers; [ eelco np ];
-    platforms = platforms.unix;
+    platforms = platforms.unix ++ platforms.windows;
   };
 }
diff --git a/pkgs/development/libraries/sundials/default.nix b/pkgs/development/libraries/sundials/default.nix
index fc9abdc24c7c..c903b041fd4d 100644
--- a/pkgs/development/libraries/sundials/default.nix
+++ b/pkgs/development/libraries/sundials/default.nix
@@ -3,12 +3,12 @@
 stdenv.mkDerivation rec {
 
   pname = "sundials";
-  version = "3.1.2";
+  version = "3.2.0";
   name = "${pname}-${version}";
 
   src = fetchurl {
   url = "https://computation.llnl.gov/projects/${pname}/download/${pname}-${version}.tar.gz";
-  sha256 = "05p19y3vv0vi3nggrvy6ymqkvhab2dxncl044qj0xnaix2qmp658";
+  sha256 = "1yck1qjw5pw5i58x762vc0adg4g53lsan9xv92hbby5dxjpr1dnj";
   };
 
   preConfigure = ''
diff --git a/pkgs/development/libraries/termbox/default.nix b/pkgs/development/libraries/termbox/default.nix
new file mode 100644
index 000000000000..0898289978a2
--- /dev/null
+++ b/pkgs/development/libraries/termbox/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchFromGitHub, python3 }:
+
+stdenv.mkDerivation rec {
+  name = "termbox-${version}";
+  version = "1.1.2";
+  src = fetchFromGitHub {
+    owner = "nsf";
+    repo = "termbox";
+    rev = "v${version}";
+    sha256 = "08yqxzb8fny8806p7x8a6f3phhlbfqdd7dhkv25calswj7w1ssvs";
+  };
+  nativeBuildInputs = [ python3 ];
+  configurePhase = "python3 ./waf configure --prefix=$out";
+  buildPhase = "python3 ./waf build";
+  installPhase = "python3 ./waf install --destdir=$out";
+  meta = with stdenv.lib; {
+    description = "Library for writing text-based user interfaces";
+    license = licenses.mit;
+    homepage = "https://github.com/nsf/termbox#readme";
+    downloadPage = "https://github.com/nsf/termbox/releases";
+    maintainers = with maintainers; [ fgaz ];
+  };
+}
+
diff --git a/pkgs/development/libraries/ti-rpc/default.nix b/pkgs/development/libraries/ti-rpc/default.nix
index 77c0b4a1a460..c139b5be1027 100644
--- a/pkgs/development/libraries/ti-rpc/default.nix
+++ b/pkgs/development/libraries/ti-rpc/default.nix
@@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
     sha256 = "07anqypf7c719x9y683qz65cxllmzlgmlab2hlahrqcj4bq2k99c";
   };
 
+  outputs = [ "out" "dev" ];
+
   postPatch = ''
     sed '1i#include <stdint.h>' -i src/xdr_sizeof.c
   '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
diff --git a/pkgs/development/libraries/tnt/default.nix b/pkgs/development/libraries/tnt/default.nix
index 23ef997e5ce1..229e4cfaa6c0 100644
--- a/pkgs/development/libraries/tnt/default.nix
+++ b/pkgs/development/libraries/tnt/default.nix
@@ -19,6 +19,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = https://math.nist.gov/tnt/;
     description = "Template Numerical Toolkit: C++ headers for array and matrices";
+    license = stdenv.lib.licenses.publicDomain;
     platforms = stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/v8/6_x.nix b/pkgs/development/libraries/v8/6_x.nix
index adebedbf2ac1..85d0c0d91bb5 100644
--- a/pkgs/development/libraries/v8/6_x.nix
+++ b/pkgs/development/libraries/v8/6_x.nix
@@ -13,82 +13,102 @@ let
               else "ia32";
   git_url = "https://chromium.googlesource.com";
 
+  # This data is from the DEPS file in the root of a V8 checkout
   deps = {
     "base/trace_event/common" = fetchgit {
-      url = "${git_url}/chromium/src/base/trace_event/common.git";
-      rev = "65d1d42a5df6c0a563a6fdfa58a135679185e5d9";
-      sha256 = "0ikk0dj12adzr0138jrmwzhx8n9sl5qzs86a3mc3gva08a8wc84p";
+      url    = "${git_url}/chromium/src/base/trace_event/common.git";
+      rev    = "211b3ed9d0481b4caddbee1322321b86a483ca1f";
+      sha256 = "080sya1dg32hi5gj7zr3r5l18r6w8g0imajyf3xfvnz67a2i8dd7";
     };
     "build" = fetchgit {
-      url = "${git_url}/chromium/src/build.git";
-      rev = "48a2b7b39debc7c77c868c9ddb0a360af1ebc367";
-      sha256 = "0aj554dfdbwnikwaapznfq55wkwbvg4114h7qamixy8ryjkaiy0k";
+      url    = "${git_url}/chromium/src/build.git";
+      rev    = "7315579e388589b62236ad933f09afd1e838d234";
+      sha256 = "14gsigyjfm03kfzmz0v6429b6qnycvzx0yj3vwaks8may26aiv71";
     };
     "buildtools" = fetchgit {
-      url = "${git_url}/chromium/buildtools.git";
-      rev = "5af0a3a8b89827a8634132080a39ab4b63dee489";
-      sha256 = "1841803m40w1hmnmm7qzdpk4b6q1m8cb7q4hsflqfpddpf4lp3v1";
+      url    = "${git_url}/chromium/buildtools.git";
+      rev    = "0dd5c6f980d22be96b728155249df2da355989d9";
+      sha256 = "0m1fh0qjcx9c69khnqcsqvrnqs7ji6wfxns9vv9mknj20sph5ydr";
     };
     "test/benchmarks/data" = fetchgit {
-      url = "${git_url}/v8/deps/third_party/benchmarks.git";
-      rev = "05d7188267b4560491ff9155c5ee13e207ecd65f";
+      url    = "${git_url}/v8/deps/third_party/benchmarks.git";
+      rev    = "05d7188267b4560491ff9155c5ee13e207ecd65f";
       sha256 = "0ad2ay14bn67d61ks4dmzadfnhkj9bw28r4yjdjjyzck7qbnzchl";
     };
     "test/mozilla/data" = fetchgit {
-      url = "${git_url}/v8/deps/third_party/mozilla-tests.git";
-      rev = "f6c578a10ea707b1a8ab0b88943fe5115ce2b9be";
+      url    = "${git_url}/v8/deps/third_party/mozilla-tests.git";
+      rev    = "f6c578a10ea707b1a8ab0b88943fe5115ce2b9be";
       sha256 = "0rfdan76yfawqxbwwb35aa57b723j3z9fx5a2w16nls02yk2kqyn";
     };
     "test/test262/data" = fetchgit {
-      url = "${git_url}/external/github.com/tc39/test262.git";
-      rev = "1b911a8f8abf4cb63882cfbe72dcd4c82bb8ad91";
-      sha256 = "1hbp7vv41k7jka8azc78hhw4qng7gckr6dz1van7cyd067znwvr4";
+      url    = "${git_url}/external/github.com/tc39/test262.git";
+      rev    = "a6c1d05ac4fed084fa047e4c52ab2a8c9c2a8aef";
+      sha256 = "1cy3val2ih6r4sbaxd1v9fir87mrlw1kr54s64g68gnch53ck9s3";
     };
     "test/test262/harness" = fetchgit {
-      url = "${git_url}/external/github.com/test262-utils/test262-harness-py.git";
-      rev = "0f2acdd882c84cff43b9d60df7574a1901e2cdcd";
+      url    = "${git_url}/external/github.com/test262-utils/test262-harness-py.git";
+      rev    = "0f2acdd882c84cff43b9d60df7574a1901e2cdcd";
       sha256 = "00brj5avp43yamc92kinba2mg3a2x1rcd7wnm7z093l73idprvkp";
     };
     "test/wasm-js" = fetchgit {
-      url = "${git_url}/external/github.com/WebAssembly/spec.git";
-      rev = "17b4a4d98c80b1ec736649d5a73496a0e6d12d4c";
-      sha256 = "03nyrrqffzj6xrmqi1v7f9m9395bdk53x301fy5mcq4hhpq6rsjr";
+      url    = "${git_url}/external/github.com/WebAssembly/spec.git";
+      rev    = "2113ea7e106f8a964e0445ba38f289d2aa845edd";
+      sha256 = "07aw7x2xzmzk905mqf8gbbb1bi1a5kv99g8iv6x2p07d3zns7xzx";
     };
-    "testing/gmock" = fetchgit {
-      url = "${git_url}/external/googlemock.git";
-      rev = "0421b6f358139f02e102c9c332ce19a33faf75be";
-      sha256 = "1xiky4v98maxs8fg1avcd56y0alv3hw8qyrlpd899zgzbq2k10pp";
+    "third_party/depot_tools" = fetchgit {
+      url    = "${git_url}/chromium/tools/depot_tools.git";
+      rev    = "fb734036f4b5ae6d5afc63cbfc41d3a5d1c29a82";
+      sha256 = "1738y7xgfnn0hfdr8g5jw7555841ycxbn580mdffwv4jnbn7120s";
     };
-    "testing/gtest" = fetchgit {
-      url = "${git_url}/external/github.com/google/googletest.git";
-      rev = "6f8a66431cb592dad629028a50b3dd418a408c87";
-      sha256 = "0bdba2lr6pg15bla9600zg0r0vm4lnrx0wqz84p376wfdxra24vw";
+    "third_party/googletest/src" = fetchgit {
+      url    = "${git_url}/external/github.com/google/googletest.git";
+      rev    = "ce468a17c434e4e79724396ee1b51d86bfc8a88b";
+      sha256 = "0nik8wb1b0zk2sslawgp5h211r5bc4x7m962dgnmbk11ccvsmr23";
     };
     "third_party/icu" = fetchgit {
-      url = "${git_url}/chromium/deps/icu.git";
-      rev = "08cb956852a5ccdba7f9c941728bb833529ba3c6";
-      sha256 = "0vn2iv068kmcjqqx5cgyha80x9iraz11hpx3q4n3rkvrlvbb3d7b";
+      url    = "${git_url}/chromium/deps/icu.git";
+      rev    = "a9a2bd3ee4f1d313651c5272252aaf2a3e7ed529";
+      sha256 = "1bfyxakgv9z0rxbqsy5csi85kg8dqy7i6zybmng5wyzag9cns4f9";
     };
     "third_party/instrumented_libraries" = fetchgit {
-      url = "${git_url}/chromium/src/third_party/instrumented_libraries.git";
-      rev = "644afd349826cb68204226a16c38bde13abe9c3c";
-      sha256 = "0d1vkwilgv1a4ghazn623gwmm7h51padpfi94qrmig1y748xfwfa";
+      url    = "${git_url}/chromium/src/third_party/instrumented_libraries.git";
+      rev    = "323cf32193caecbf074d1a0cb5b02b905f163e0f";
+      sha256 = "0q3n3ivqva28qpn67ds635521pwzpc9apcyagz65i9j17bb1k231";
     };
-    # templates of code generator require jinja2 2.8 (while nixpkgs has 2.9.5, which breaks the template)
     "third_party/jinja2" = fetchgit {
-      url = "${git_url}/chromium/src/third_party/jinja2.git";
-      rev = "d34383206fa42d52faa10bb9931d6d538f3a57e0";
-      sha256 = "0d9hyw0bvp3p0dbwy833cm9vdqxcam0qbm9jc561ynphddxlkmgd";
+      url    = "${git_url}/chromium/src/third_party/jinja2.git";
+      rev    = "b41863e42637544c2941b574c7877d3e1f663e25";
+      sha256 = "1qgilclkav67m6cl2xq2kmzkswrkrb2axc2z8mw58fnch4j1jf1r";
     };
     "third_party/markupsafe" = fetchgit {
-      url = "${git_url}/chromium/src/third_party/markupsafe.git";
-      rev = "8f45f5cfa0009d2a70589bcda0349b8cb2b72783";
+      url    = "${git_url}/chromium/src/third_party/markupsafe.git";
+      rev    = "8f45f5cfa0009d2a70589bcda0349b8cb2b72783";
       sha256 = "168ppjmicfdh4i1l0l25s86mdbrz9fgxmiq1rx33x79mph41scfz";
     };
+    "third_party/proguard" = fetchgit {
+      url    = "${git_url}/chromium/src/third_party/proguard.git";
+      rev    = "eba7a98d98735b2cc65c54d36baa5c9b46fe4f8e";
+      sha256 = "1yx86z2p243b0ykixgqz6nlqfp8swa6n0yl5fgb29fa4jvsjz3d1";
+    };
     "tools/clang" = fetchgit {
-      url = "${git_url}/chromium/src/tools/clang.git";
-      rev = "40f69660bf3cd407e72b8ae240fdd6c513dddbfe";
-      sha256 = "1plkb9dcn34yd6lad7w59s9vqwmcc592dasgdk232spkafpg8qcf";
+      url    = "${git_url}/chromium/src/tools/clang.git";
+      rev    = "c0b1d892b2bc1291eb287d716ca239c1b03fb215";
+      sha256 = "1mz1pqzr2b37mymbkqkmpmj48j7a8ig0ibaw3dfilbx5nbl4wd2z";
+    };
+    "tools/gyp" = fetchgit {
+      url    = "${git_url}/external/gyp.git";
+      rev    = "d61a9397e668fa9843c4aa7da9e79460fe590bfb";
+      sha256 = "1z081h72mjy285jb1kj5xd0pb4p12n9blvsimsavyn3ldmswv0r0";
+    };
+    "tools/luci-go" = fetchgit {
+      url    = "${git_url}/chromium/src/tools/luci-go.git";
+      rev    = "abcd908f74fdb155cc8870f5cae48dff1ece7c3c";
+      sha256 = "07c8vanc31wal6aw8v0s499l7ifrgvdvi2sx4ln3nyha5ngxinld";
+    };
+    "tools/swarming_client" = fetchgit {
+      url    = "${git_url}/infra/luci/client-py.git";
+      rev    = "9a518d097dca20b7b00ce3bdfc5d418ccc79893a";
+      sha256 = "1d8nly7rp24gx7q0m01jvsc15nw5fahayfczwd40gzzzkmvhjazi";
     };
   };
 
@@ -96,7 +116,7 @@ in
 
 stdenv.mkDerivation rec {
   name = "v8-${version}";
-  version = "6.2.414.27";
+  version = "6.9.427.14";
 
   inherit doCheck;
 
@@ -104,7 +124,7 @@ stdenv.mkDerivation rec {
     owner = "v8";
     repo = "v8";
     rev = version;
-    sha256 = "15zrb9bcpnhljhrilqnjaak3a4xnhj8li6ra12g3gkrw3fzir9a2";
+    sha256 = "13d50iz87qh7v8l8kjky8wqs9rvz02pgw74q8crqi5ywnvvill1x";
   };
 
   postUnpack = ''
@@ -133,11 +153,13 @@ stdenv.mkDerivation rec {
 
   configurePhase = ''
     tools/dev/v8gen.py -vv ${arch}.release -- \
-        is_component_build=true \
-        ${if snapshot then "v8_use_external_startup_data=false" else "v8_use_snapshot=false" } \
-        is_clang=false \
-        linux_use_bundled_binutils=false \
-        treat_warnings_as_errors=false
+        is_component_build=true               \
+        ${if snapshot then "v8_use_external_startup_data=false" else "v8_use_snapshot=false"} \
+        is_clang=false                        \
+        linux_use_bundled_binutils=false      \
+        treat_warnings_as_errors=false        \
+        use_custom_libcxx=false               \
+        use_custom_libcxx_for_host=false
   '';
 
   nativeBuildInputs = [ gn ninja pkgconfig ];
diff --git a/pkgs/development/libraries/vc/default.nix b/pkgs/development/libraries/vc/default.nix
index e2a2af615b88..7f46702c2e8c 100644
--- a/pkgs/development/libraries/vc/default.nix
+++ b/pkgs/development/libraries/vc/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "Vc-${version}";
-  version = "1.3.3";
+  version = "1.4.0";
 
   src = fetchFromGitHub {
     owner = "VcDevel";
     repo = "Vc";
     rev = version;
-    sha256 = "0y4riz2kiw6a9w2zydj6x0vhy2qc9v17wspq3n2q88nbas72yd2m";
+    sha256 = "1jwwp3g8pqngdakqy3dxy3vgzh0gla5wvwqqlfvqdgsw6455xhm7";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/vigra/default.nix b/pkgs/development/libraries/vigra/default.nix
index 12c166beacbd..fb69d4bf63e7 100644
--- a/pkgs/development/libraries/vigra/default.nix
+++ b/pkgs/development/libraries/vigra/default.nix
@@ -15,6 +15,12 @@ in stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR";
 
+  # Fixes compilation with clang (on darwin) see https://github.com/ukoethe/vigra/issues/414
+  patches =
+    let clangPatch = fetchurl { url = "https://github.com/ukoethe/vigra/commit/81958d302494e137f98a8b1d7869841532f90388.patch";
+                                sha256 = "1i1w6smijgb5z8bg9jaq84ccy00k2sxm87s37lgjpyix901gjlgi"; };
+    in [ clangPatch ];
+
   buildInputs = [ boost cmake fftw fftwSinglePrec hdf5 ilmbase libjpeg libpng
                   libtiff numpy openexr python ];
 
@@ -34,6 +40,6 @@ in stdenv.mkDerivation rec {
     homepage = https://hci.iwr.uni-heidelberg.de/vigra;
     license = licenses.mit;
     maintainers = [ maintainers.viric ];
-    platforms = platforms.linux;
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/vulkan-headers/default.nix b/pkgs/development/libraries/vulkan-headers/default.nix
index 2a07eba261b7..c93ba1b12909 100644
--- a/pkgs/development/libraries/vulkan-headers/default.nix
+++ b/pkgs/development/libraries/vulkan-headers/default.nix
@@ -1,15 +1,15 @@
 { stdenv, fetchFromGitHub, cmake }:
 stdenv.mkDerivation rec {
   name = "vulkan-headers-${version}";
-  version = "1.1.82.0";
+  version = "1.1.85";
 
   buildInputs = [ cmake ];
 
   src = fetchFromGitHub {
     owner = "KhronosGroup";
     repo = "Vulkan-Headers";
-    rev = "sdk-${version}";
-    sha256 = "1pp0kmgd89g8rz6qqfqmdmv209s0d6hbsshrzrlwrdm6dc25f20p";
+    rev = "2fd5a24ec4a6df303b2155b3f85b6b8c1d56f6c0";
+    sha256 = "0cj4bd396qddh3nxvr7grnpfz89g3sbvm21cx4k3ga52sp1rslpb";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/vulkan-loader/default.nix b/pkgs/development/libraries/vulkan-loader/default.nix
index 5ffdc4375373..6f720857f7cf 100644
--- a/pkgs/development/libraries/vulkan-loader/default.nix
+++ b/pkgs/development/libraries/vulkan-loader/default.nix
@@ -1,6 +1,10 @@
-{ stdenv, fetchFromGitHub, cmake, python3, vulkan-headers, pkgconfig,
-  xlibsWrapper, libxcb, libXrandr, libXext, wayland, libGL_driver }:
-let version = "1.1.82.0"; in
+{ stdenv, fetchFromGitHub, cmake, python3, vulkan-headers, pkgconfig
+, xlibsWrapper, libxcb, libXrandr, libXext, wayland, libGL_driver }:
+
+let
+  version = "1.1.85";
+in
+
 assert version == vulkan-headers.version;
 stdenv.mkDerivation rec {
   name = "vulkan-loader-${version}";
@@ -9,8 +13,8 @@ stdenv.mkDerivation rec {
   src = fetchFromGitHub {
     owner = "KhronosGroup";
     repo = "Vulkan-Loader";
-    rev = "sdk-${version}";
-    sha256 = "16i4s1adfh822ahj3ywp279lv6szwd2sn2q5pmvpg2kk6mbh410d";
+    rev = "b02f64293680c484e1d7ff6ecb88f89277c0dc8c";
+    sha256 = "1n4vjyxlmi2ygx34srwbvalc5gz95gcsrmdw0k10353xja755gmj";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/wcslib/default.nix b/pkgs/development/libraries/wcslib/default.nix
index 7c4d275e05fe..636021f1368e 100644
--- a/pkgs/development/libraries/wcslib/default.nix
+++ b/pkgs/development/libraries/wcslib/default.nix
@@ -1,14 +1,14 @@
 { fetchurl,  stdenv, flex }:
 
 stdenv.mkDerivation rec {
-  version = "5.19.1";
+  version = "5.20";
   name = "wcslib-${version}";
 
   buildInputs = [ flex ];
 
   src = fetchurl {
     url = "ftp://ftp.atnf.csiro.au/pub/software/wcslib/${name}.tar.bz2";
-    sha256 ="160gvz9xk4hvliwb75ry770qdf899kc89ij6r0y7fh60lbjz1far";
+    sha256 ="1c8g9kv4dxrnawnqi4spi2p10s2xs7x75pdfxhbqxgcc97dkgh0b";
   };
 
   prePatch = ''
diff --git a/pkgs/development/libraries/webkitgtk/2.22.nix b/pkgs/development/libraries/webkitgtk/2.22.nix
new file mode 100644
index 000000000000..7eae5819daf1
--- /dev/null
+++ b/pkgs/development/libraries/webkitgtk/2.22.nix
@@ -0,0 +1,83 @@
+{ stdenv, fetchurl, perl, python2, ruby, bison, gperf, cmake, ninja
+, pkgconfig, gettext, gobjectIntrospection, libnotify, gnutls, libgcrypt
+, gtk3, wayland, libwebp, enchant2, xorg, libxkbcommon, epoxy, at-spi2-core
+, libxml2, libsoup, libsecret, libxslt, harfbuzz, libpthreadstubs, pcre, nettle, libtasn1, p11-kit
+, libidn, libedit, readline, libGLU_combined, libintl
+, enableGeoLocation ? true, geoclue2, sqlite
+, enableGtk2Plugins ? false, gtk2 ? null
+, gst-plugins-base, gst-plugins-bad, woff2
+}:
+
+assert enableGeoLocation -> geoclue2 != null;
+assert enableGtk2Plugins -> gtk2 != null;
+assert stdenv.isDarwin -> !enableGtk2Plugins;
+
+with stdenv.lib;
+stdenv.mkDerivation rec {
+  name = "webkitgtk-${version}";
+  version = "2.22.2";
+
+  meta = {
+    description = "Web content rendering engine, GTK+ port";
+    homepage = https://webkitgtk.org/;
+    license = licenses.bsd2;
+    platforms = platforms.linux;
+    hydraPlatforms = [];
+    maintainers = with maintainers; [ ];
+  };
+
+  src = fetchurl {
+    url = "https://webkitgtk.org/releases/${name}.tar.xz";
+    sha256 = "1flrbr8pzbrlwv09b4pmgh6vklw7jghd2lgrhcb72vl9s7a8fm1l";
+  };
+
+  patches = optionals stdenv.isDarwin [
+    ## TODO add necessary patches for Darwin
+  ];
+
+  postPatch = ''
+    patchShebangs .
+  '';
+
+  cmakeFlags = [
+  "-DPORT=GTK"
+  "-DUSE_LIBHYPHEN=0"
+  "-DENABLE_INTROSPECTION=ON"
+  ]
+  ++ optional (!enableGtk2Plugins) "-DENABLE_PLUGIN_PROCESS_GTK2=OFF"
+  ++ optional stdenv.isLinux "-DENABLE_GLES2=ON"
+  ++ optionals stdenv.isDarwin [
+  "-DUSE_SYSTEM_MALLOC=ON"
+  "-DUSE_ACCELERATE=0"
+  "-DENABLE_MINIBROWSER=OFF"
+  "-DENABLE_VIDEO=ON"
+  "-DENABLE_QUARTZ_TARGET=ON"
+  "-DENABLE_X11_TARGET=OFF"
+  "-DENABLE_OPENGL=OFF"
+  "-DENABLE_WEB_AUDIO=OFF"
+  "-DENABLE_WEBGL=OFF"
+  "-DENABLE_GRAPHICS_CONTEXT_3D=OFF"
+  "-DENABLE_GTKDOC=OFF"
+  ];
+
+  nativeBuildInputs = [
+    cmake ninja perl python2 ruby bison gperf
+    pkgconfig gettext gobjectIntrospection
+  ];
+
+  buildInputs = [
+    libintl libwebp enchant2 libnotify gnutls pcre nettle libidn libgcrypt woff2
+    libxml2 libsecret libxslt harfbuzz libpthreadstubs libtasn1 p11-kit
+    sqlite gst-plugins-base gst-plugins-bad libxkbcommon epoxy at-spi2-core
+  ] ++ optional enableGeoLocation geoclue2
+    ++ optional enableGtk2Plugins gtk2
+    ++ (with xorg; [ libXdmcp libXt libXtst libXdamage ])
+    ++ optionals stdenv.isDarwin [ libedit readline libGLU_combined ]
+    ++ optional stdenv.isLinux wayland;
+
+  propagatedBuildInputs = [
+    libsoup gtk3
+  ];
+
+  outputs = [ "out" "dev" ];
+}
diff --git a/pkgs/development/libraries/wolfssl/default.nix b/pkgs/development/libraries/wolfssl/default.nix
index 30291a180226..8f57a0bf1b71 100644
--- a/pkgs/development/libraries/wolfssl/default.nix
+++ b/pkgs/development/libraries/wolfssl/default.nix
@@ -29,6 +29,7 @@ stdenv.mkDerivation rec {
     description = "A small, fast, portable implementation of TLS/SSL for embedded devices";
     homepage    = "https://www.wolfssl.com/";
     platforms   = platforms.all;
+    license = stdenv.lib.licenses.gpl2;
     maintainers = with maintainers; [ mcmtroffaes ];
   };
 }
diff --git a/pkgs/development/libraries/xdg-desktop-portal/default.nix b/pkgs/development/libraries/xdg-desktop-portal/default.nix
index 171ef68cf569..9cdada9bf3b2 100644
--- a/pkgs/development/libraries/xdg-desktop-portal/default.nix
+++ b/pkgs/development/libraries/xdg-desktop-portal/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libxml2, glib, pipewire, fuse }:
 
 let
-  version = "1.0.2";
+  version = "1.0.3";
 in stdenv.mkDerivation rec {
   name = "xdg-desktop-portal-${version}";
 
@@ -11,7 +11,7 @@ in stdenv.mkDerivation rec {
     owner = "flatpak";
     repo = "xdg-desktop-portal";
     rev = version;
-    sha256 = "1vl0150gz20x106di9yfa6l3zjw0nd2lr44rkq2147n2a254p79p";
+    sha256 = "113k5sr4l58rm8sgp4qbjrhyjg37c5ad54i58njsm98knb5r2ppv";
   };
 
   patches = [
diff --git a/pkgs/development/libraries/yojimbo/default.nix b/pkgs/development/libraries/yojimbo/default.nix
new file mode 100644
index 000000000000..9a3416a368bb
--- /dev/null
+++ b/pkgs/development/libraries/yojimbo/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchFromGitHub, premake5, doxygen, libsodium, mbedtls }:
+
+stdenv.mkDerivation rec {
+  name = "yojimbo";
+  version = "1.1";
+
+  src = fetchFromGitHub {
+    owner = "networkprotocol";
+    repo = "yojimbo";
+    rev = "e02219c102d9b440290539036992d77608eab3b0";
+    sha256 = "0jn25ddv73hwjals883a910m66kwj6glxxhnmn96bpzsvsaimnkr";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ premake5 doxygen ];
+  propagatedBuildInputs = [ libsodium mbedtls ];
+
+  buildPhase = ''
+    premake5 gmake
+    make all
+    premake5 docs
+  '';
+
+  installPhase = ''
+    install -Dm555 -t $out/lib bin/libyojimbo.a
+    install -Dm444 -t $out/include yojimbo.h
+    mkdir -p $out/share/doc/yojimbo
+    cp -r docs/html $out/share/doc/yojimbo
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A network library for client/server games with dedicated servers";
+    longDescription = ''
+      yojimbo is a network library for client/server games with dedicated servers.
+      It's designed around the networking requirements of competitive multiplayer games like first person shooters.
+      As such it provides a time critical networking layer on top of UDP, with a client/server architecture supporting up to 64 players per-dedicated server instance.
+    '';
+    homepage = https://github.com/networkprotocol/yojimbo;
+    license = licenses.bsd3;
+    platforms = platforms.x86_64;
+    maintainers = with maintainers; [ paddygord ];
+  };
+}
diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix
index d348f877f722..fe1c275aeda5 100644
--- a/pkgs/development/libraries/zlib/default.nix
+++ b/pkgs/development/libraries/zlib/default.nix
@@ -82,4 +82,6 @@ stdenv.mkDerivation (rec {
   preConfigure = ''
     export CHOST=${stdenv.hostPlatform.config}
   '';
+} // stdenv.lib.optionalAttrs (stdenv.hostPlatform.libc == "msvcrt") {
+  configurePhase = ":";
 })