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/SDL/default.nix7
-rw-r--r--pkgs/development/libraries/SDL2/default.nix4
-rw-r--r--pkgs/development/libraries/acl/default.nix11
-rw-r--r--pkgs/development/libraries/appstream-glib/default.nix45
-rw-r--r--pkgs/development/libraries/appstream-glib/paths.patch11
-rw-r--r--pkgs/development/libraries/appstream/default.nix50
-rw-r--r--pkgs/development/libraries/appstream/qt.nix25
-rw-r--r--pkgs/development/libraries/aspell/default.nix17
-rw-r--r--pkgs/development/libraries/aspell/dictionaries.nix152
-rw-r--r--pkgs/development/libraries/attr/default.nix15
-rw-r--r--pkgs/development/libraries/attr/fix-headers-musl.patch54
-rw-r--r--pkgs/development/libraries/aws-sdk-cpp/default.nix10
-rw-r--r--pkgs/development/libraries/bctoolbox/default.nix4
-rw-r--r--pkgs/development/libraries/belcard/default.nix24
-rw-r--r--pkgs/development/libraries/belle-sip/default.nix4
-rw-r--r--pkgs/development/libraries/belr/default.nix24
-rw-r--r--pkgs/development/libraries/boehm-gc/default.nix20
-rw-r--r--pkgs/development/libraries/boehm-gc/riscv.patch53
-rw-r--r--pkgs/development/libraries/boost/generic.nix2
-rw-r--r--pkgs/development/libraries/bzrtp/default.nix24
-rw-r--r--pkgs/development/libraries/cpp-gsl/default.nix29
-rw-r--r--pkgs/development/libraries/cutee/default.nix2
-rw-r--r--pkgs/development/libraries/dbus-cplusplus/default.nix25
-rw-r--r--pkgs/development/libraries/ffmpeg-full/default.nix4
-rw-r--r--pkgs/development/libraries/ffmpeg/3.4.nix4
-rw-r--r--pkgs/development/libraries/fftw/default.nix2
-rw-r--r--pkgs/development/libraries/fontconfig/make-fonts-cache.nix4
-rw-r--r--pkgs/development/libraries/gamin/default.nix9
-rw-r--r--pkgs/development/libraries/gcab/default.nix18
-rw-r--r--pkgs/development/libraries/geis/default.nix27
-rw-r--r--pkgs/development/libraries/getdns/default.nix41
-rw-r--r--pkgs/development/libraries/glibc/2.27.nix101
-rw-r--r--pkgs/development/libraries/glibc/common-2.27.nix210
-rw-r--r--pkgs/development/libraries/glibc/common.nix2
-rw-r--r--pkgs/development/libraries/glibc/dont-use-system-ld-so-cache-2.27.patch46
-rw-r--r--pkgs/development/libraries/glibc/locales.nix4
-rw-r--r--pkgs/development/libraries/glibc/nix-locale-archive-2.27.patch118
-rw-r--r--pkgs/development/libraries/gnutls-kdh/generic.nix2
-rw-r--r--pkgs/development/libraries/granite/default.nix50
-rw-r--r--pkgs/development/libraries/grpc/default.nix41
-rw-r--r--pkgs/development/libraries/hunspell/default.nix4
-rw-r--r--pkgs/development/libraries/hwloc/default.nix5
-rw-r--r--pkgs/development/libraries/icu/60.nix4
-rw-r--r--pkgs/development/libraries/icu/base.nix2
-rw-r--r--pkgs/development/libraries/isl/0.11.1.nix2
-rw-r--r--pkgs/development/libraries/java/libmatthew-java/default.nix2
-rw-r--r--pkgs/development/libraries/json-c/0.11.nix3
-rw-r--r--pkgs/development/libraries/json-c/default.nix3
-rw-r--r--pkgs/development/libraries/kde-frameworks/fetch.sh2
-rw-r--r--pkgs/development/libraries/kde-frameworks/kglobalaccel.nix4
-rw-r--r--pkgs/development/libraries/kde-frameworks/plasma-framework.nix3
-rw-r--r--pkgs/development/libraries/kde-frameworks/srcs.nix624
-rw-r--r--pkgs/development/libraries/kyotocabinet/default.nix2
-rw-r--r--pkgs/development/libraries/libassuan/default.nix13
-rw-r--r--pkgs/development/libraries/libatomic_ops/default.nix5
-rw-r--r--pkgs/development/libraries/libatomic_ops/riscv.patch40
-rw-r--r--pkgs/development/libraries/libav/default.nix7
-rw-r--r--pkgs/development/libraries/libbfd/default.nix14
-rw-r--r--pkgs/development/libraries/libbsd/darwin.patch87
-rw-r--r--pkgs/development/libraries/libclc/default.nix18
-rw-r--r--pkgs/development/libraries/libdaemon/default.nix8
-rw-r--r--pkgs/development/libraries/libdaemon/fix-includes.patch13
-rw-r--r--pkgs/development/libraries/libexecinfo/default.nix46
-rw-r--r--pkgs/development/libraries/libffi/default.nix25
-rw-r--r--pkgs/development/libraries/libgcrypt/default.nix3
-rw-r--r--pkgs/development/libraries/libgpg-error/default.nix6
-rw-r--r--pkgs/development/libraries/libiconv/default.nix2
-rw-r--r--pkgs/development/libraries/libidn/default.nix3
-rw-r--r--pkgs/development/libraries/libksba/default.nix3
-rw-r--r--pkgs/development/libraries/libmemcached/default.nix5
-rw-r--r--pkgs/development/libraries/libmemcached/musl-fixes.patch58
-rw-r--r--pkgs/development/libraries/libmpc/default.nix9
-rw-r--r--pkgs/development/libraries/libmwaw/default.nix8
-rw-r--r--pkgs/development/libraries/libnet/default.nix2
-rw-r--r--pkgs/development/libraries/libnet/fix-includes.patch29
-rw-r--r--pkgs/development/libraries/libnfnetlink/Use-stdlib-uint-instead-of-u_int.patch499
-rw-r--r--pkgs/development/libraries/libnfnetlink/default.nix4
-rw-r--r--pkgs/development/libraries/libnsl/cdefs.patch30
-rw-r--r--pkgs/development/libraries/libnsl/default.nix2
-rw-r--r--pkgs/development/libraries/libnsl/nis_h.patch45
-rw-r--r--pkgs/development/libraries/libproxy/default.nix12
-rw-r--r--pkgs/development/libraries/librevenge/default.nix5
-rw-r--r--pkgs/development/libraries/librsvg/default.nix16
-rw-r--r--pkgs/development/libraries/libtasn1/default.nix12
-rw-r--r--pkgs/development/libraries/libunique/default.nix5
-rw-r--r--pkgs/development/libraries/libunique/gcc7-bug.patch18
-rw-r--r--pkgs/development/libraries/libunistring/default.nix2
-rw-r--r--pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch45
-rw-r--r--pkgs/development/libraries/libunwind/default.nix1
-rw-r--r--pkgs/development/libraries/libusb/default.nix2
-rw-r--r--pkgs/development/libraries/libusb/fix-headers.patch10
-rw-r--r--pkgs/development/libraries/libuv/default.nix4
-rw-r--r--pkgs/development/libraries/libwps/default.nix2
-rw-r--r--pkgs/development/libraries/libxml2/default.nix3
-rw-r--r--pkgs/development/libraries/libyaml-cpp/default.nix12
-rw-r--r--pkgs/development/libraries/mbedtls/darwin_dylib.patch28
-rw-r--r--pkgs/development/libraries/mbedtls/default.nix24
-rw-r--r--pkgs/development/libraries/mediastreamer/default.nix15
-rw-r--r--pkgs/development/libraries/mesa/default.nix2
-rw-r--r--pkgs/development/libraries/mesa/musl-fixes.patch22
-rw-r--r--pkgs/development/libraries/mimetic/default.nix2
-rw-r--r--pkgs/development/libraries/mp4v2/default.nix12
-rw-r--r--pkgs/development/libraries/mpfr/default.nix10
-rw-r--r--pkgs/development/libraries/ncurses/default.nix25
-rw-r--r--pkgs/development/libraries/ncurses/gcc-5.patch46
-rw-r--r--pkgs/development/libraries/nettle/generic.nix5
-rw-r--r--pkgs/development/libraries/nix-plugins/default.nix10
-rw-r--r--pkgs/development/libraries/npth/default.nix2
-rw-r--r--pkgs/development/libraries/nspr/default.nix3
-rw-r--r--pkgs/development/libraries/nss/default.nix9
-rw-r--r--pkgs/development/libraries/ocl-icd/default.nix6
-rw-r--r--pkgs/development/libraries/opencl-headers/default.nix14
-rw-r--r--pkgs/development/libraries/openmpi/default.nix44
-rw-r--r--pkgs/development/libraries/openssl/default.nix10
-rw-r--r--pkgs/development/libraries/ortp/default.nix4
-rw-r--r--pkgs/development/libraries/pcre/default.nix3
-rw-r--r--pkgs/development/libraries/pipewire/default.nix47
-rw-r--r--pkgs/development/libraries/pipewire/fix-paths.patch8
-rw-r--r--pkgs/development/libraries/pixman/default.nix17
-rw-r--r--pkgs/development/libraries/polkit/default.nix16
-rw-r--r--pkgs/development/libraries/ppl/default.nix8
-rw-r--r--pkgs/development/libraries/psol/default.nix4
-rw-r--r--pkgs/development/libraries/qpdf/default.nix4
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/clang-5-darwin.patch13
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/default.nix24
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/patch-qthread-stacksize.diff54
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/qsettings-recursive-global-mutex.patch17
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/qt-musl-iconv-no-bom.patch11
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/qt-musl.patch14
-rw-r--r--pkgs/development/libraries/qt-5/5.10/default.nix7
-rw-r--r--pkgs/development/libraries/qt-5/5.10/qtbase-darwin.patch13
-rw-r--r--pkgs/development/libraries/qt-5/5.6/default.nix2
-rw-r--r--pkgs/development/libraries/qt-5/5.9/default.nix11
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qtbase-darwin.patch48
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtwebkit.nix3
-rw-r--r--pkgs/development/libraries/qt-5/qt-env.nix6
-rw-r--r--pkgs/development/libraries/qtscriptgenerator/qt-4.8.patch2
-rw-r--r--pkgs/development/libraries/quickder/default.nix53
-rw-r--r--pkgs/development/libraries/rocksdb/default.nix26
-rw-r--r--pkgs/development/libraries/science/biology/htslib/default.nix4
-rw-r--r--pkgs/development/libraries/science/math/caffe2/default.nix140
-rw-r--r--pkgs/development/libraries/science/math/caffe2/update_clang_cvtsh_bugfix.patch55
-rw-r--r--pkgs/development/libraries/science/math/openblas/default.nix11
-rw-r--r--pkgs/development/libraries/spice/default.nix4
-rw-r--r--pkgs/development/libraries/stfl/default.nix3
-rw-r--r--pkgs/development/libraries/tbb/default.nix2
-rw-r--r--pkgs/development/libraries/tbb/glibc-struct-mallinfo.patch43
-rw-r--r--pkgs/development/libraries/ti-rpc/default.nix8
-rw-r--r--pkgs/development/libraries/tinyxml-2/default.nix4
-rw-r--r--pkgs/development/libraries/udunits/default.nix4
-rw-r--r--pkgs/development/libraries/unibilium/default.nix8
-rw-r--r--pkgs/development/libraries/uriparser/default.nix4
-rw-r--r--pkgs/development/libraries/usbredir/default.nix3
-rw-r--r--pkgs/development/libraries/webkitgtk/2.4.nix2
-rw-r--r--pkgs/development/libraries/webkitgtk/fix-execinfo.patch20
-rw-r--r--pkgs/development/libraries/webrtc-audio-processing/default.nix2
-rw-r--r--pkgs/development/libraries/wildmidi/default.nix4
157 files changed, 3355 insertions, 758 deletions
diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix
index e71ad14b11fd..82051854799c 100644
--- a/pkgs/development/libraries/SDL/default.nix
+++ b/pkgs/development/libraries/SDL/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, pkgconfig, audiofile, libcap
+{ stdenv, fetchurl, fetchpatch, pkgconfig, audiofile, libcap, libiconv
 , openglSupport ? false, mesa_noglu, mesa_glu
 , alsaSupport ? true, alsaLib
 , x11Support ? hostPlatform == buildPlatform, libXext, libICE, libXrandr
@@ -40,7 +40,8 @@ stdenv.mkDerivation rec {
   buildInputs = let
     notMingw = !hostPlatform.isMinGW;
   in optional notMingw audiofile
-  ++ optionals stdenv.isDarwin [ OpenGL CoreAudio CoreServices AudioUnit Kernel ];
+  ++ optionals stdenv.isDarwin [ OpenGL CoreAudio CoreServices AudioUnit Kernel ]
+  ++ [ libiconv ];
 
   # XXX: By default, SDL wants to dlopen() PulseAudio, in which case
   # we must arrange to add it to its RPATH; however, `patchelf' seems
@@ -78,7 +79,7 @@ stdenv.mkDerivation rec {
     # Ticket: https://bugs.freedesktop.org/show_bug.cgi?id=27222
     (fetchpatch {
       name = "SDL_SetGamma.patch";
-      url = "http://pkgs.fedoraproject.org/cgit/rpms/SDL.git/plain/SDL-1.2.15-x11-Bypass-SetGammaRamp-when-changing-gamma.patch?id=04a3a7b1bd88c2d5502292fad27e0e02d084698d";
+      url = "http://src.fedoraproject.org/cgit/rpms/SDL.git/plain/SDL-1.2.15-x11-Bypass-SetGammaRamp-when-changing-gamma.patch?id=04a3a7b1bd88c2d5502292fad27e0e02d084698d";
       sha256 = "0x52s4328kilyq43i7psqkqg7chsfwh0aawr50j566nzd7j51dlv";
     })
     # Fix a build failure on OS X Mavericks
diff --git a/pkgs/development/libraries/SDL2/default.nix b/pkgs/development/libraries/SDL2/default.nix
index d75aea726e10..6b6c9599c282 100644
--- a/pkgs/development/libraries/SDL2/default.nix
+++ b/pkgs/development/libraries/SDL2/default.nix
@@ -8,6 +8,7 @@
 , ibusSupport ? false, ibus
 , pulseaudioSupport ? true, libpulseaudio
 , AudioUnit, Cocoa, CoreAudio, CoreServices, ForceFeedback, OpenGL
+, libiconv
 }:
 
 # OSS is no longer supported, for it's much crappier than ALSA and
@@ -41,7 +42,8 @@ stdenv.mkDerivation rec {
   # Since `libpulse*.la' contain `-lgdbm', PulseAudio must be propagated.
   propagatedBuildInputs = lib.optionals x11Support [ libICE libXi libXScrnSaver libXcursor libXinerama libXext libXrandr libXxf86vm ] ++
     lib.optionals waylandSupport [ wayland wayland-protocols libxkbcommon ] ++
-    lib.optional pulseaudioSupport libpulseaudio;
+    lib.optional pulseaudioSupport libpulseaudio
+    ++ [ libiconv ];
 
   buildInputs = [ audiofile ] ++
     lib.optional openglSupport mesa_noglu ++
diff --git a/pkgs/development/libraries/acl/default.nix b/pkgs/development/libraries/acl/default.nix
index dc9e4e6ff18b..3c6f42e5cbf8 100644
--- a/pkgs/development/libraries/acl/default.nix
+++ b/pkgs/development/libraries/acl/default.nix
@@ -20,13 +20,14 @@ stdenv.mkDerivation rec {
     sed -e '/^\/\//d' -i include/acl.h
   '';
 
-  configureFlags = "MAKE=make MSGFMT=msgfmt MSGMERGE=msgmerge XGETTEXT=xgettext ZIP=gzip ECHO=echo SED=sed AWK=gawk";
+  configureFlags = [ "MAKE=make" "MSGFMT=msgfmt" "MSGMERGE=msgmerge" "XGETTEXT=xgettext" "ZIP=gzip" "ECHO=echo" "SED=sed" "AWK=gawk" ];
 
-  installTargets = "install install-lib install-dev";
+  installTargets = [ "install" "install-lib" "install-dev" ];
 
-  meta = {
-    homepage = http://savannah.nongnu.org/projects/acl;
+  meta = with stdenv.lib; {
+    homepage = "http://savannah.nongnu.org/projects/acl";
     description = "Library and tools for manipulating access control lists";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = platforms.linux;
+    license = licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/development/libraries/appstream-glib/default.nix b/pkgs/development/libraries/appstream-glib/default.nix
index d177c3acfa71..dc5de2b382a1 100644
--- a/pkgs/development/libraries/appstream-glib/default.nix
+++ b/pkgs/development/libraries/appstream-glib/default.nix
@@ -1,30 +1,49 @@
-{ stdenv, fetchFromGitHub, pkgconfig, gettext, gtk3, glib
-, gtk_doc, libarchive, gobjectIntrospection
-, sqlite, libsoup, gcab, attr, acl, docbook_xsl
+{ stdenv, fetchFromGitHub, substituteAll, pkgconfig, gettext, gtk3, glib
+, gtk_doc, libarchive, gobjectIntrospection, libxslt, pngquant
+, sqlite, libsoup, gcab, attr, acl, docbook_xsl, docbook_xml_dtd_42
 , libuuid, json_glib, meson, gperf, ninja
 }:
 stdenv.mkDerivation rec {
-  name = "appstream-glib-0.7.2";
+  name = "appstream-glib-0.7.6";
+
+  outputs = [ "out" "dev" "man" ];
+  outputBin = "dev";
 
   src = fetchFromGitHub {
     owner = "hughsie";
     repo = "appstream-glib";
     rev = stdenv.lib.replaceStrings ["." "-"] ["_" "_"] name;
-    sha256 = "1jvwfida12d2snc8p9lpbpqzrixw2naaiwfmsrldwkrxsj3i19pl";
+    sha256 = "1nzm6w9n7fb2m06w88gwszaqf74bnip87ay0ca59wajq6y4mpfgv";
   };
 
-  nativeBuildInputs = [ meson pkgconfig ninja ];
-  buildInputs = [ glib gtk_doc gettext sqlite libsoup
-                  gcab attr acl docbook_xsl libuuid json_glib
-                  libarchive gobjectIntrospection gperf ];
+  nativeBuildInputs = [
+    meson pkgconfig ninja gtk_doc libxslt docbook_xsl docbook_xml_dtd_42
+  ];
+  buildInputs = [
+    glib gettext sqlite libsoup
+    gcab attr acl libuuid json_glib
+    libarchive gobjectIntrospection gperf
+  ];
   propagatedBuildInputs = [ gtk3 ];
-  mesonFlags = [ "-Denable-rpm=false" "-Denable-stemmer=false" "-Denable-dep11=false" ];
+
+  patches = [
+    (substituteAll {
+      src = ./paths.patch;
+      pngquant= "${pngquant}/bin/pngquant";
+    })
+  ];
+
+  mesonFlags = [
+    "-Drpm=false"
+    "-Dstemmer=false"
+    "-Ddep11=false"
+  ];
 
   meta = with stdenv.lib; {
     description = "Objects and helper methods to read and write AppStream metadata";
-    homepage    = https://github.com/hughsie/appstream-glib;
-    license     = licenses.lgpl21Plus;
-    platforms   = platforms.linux;
+    homepage = https://people.freedesktop.org/~hughsient/appstream-glib/;
+    license = licenses.lgpl2Plus;
+    platforms = platforms.linux;
     maintainers = with maintainers; [ lethalman matthewbauer ];
   };
 }
diff --git a/pkgs/development/libraries/appstream-glib/paths.patch b/pkgs/development/libraries/appstream-glib/paths.patch
new file mode 100644
index 000000000000..5c6396988a17
--- /dev/null
+++ b/pkgs/development/libraries/appstream-glib/paths.patch
@@ -0,0 +1,11 @@
+--- a/libappstream-builder/asb-utils.c
++++ b/libappstream-builder/asb-utils.c
+@@ -294,7 +294,7 @@
+ {
+ 	g_autofree gchar *standard_error = NULL;
+ 	gint exit_status = 0;
+-	const gchar *argv[] = { "/usr/bin/pngquant", "--skip-if-larger",
++	const gchar *argv[] = { "@pngquant@", "--skip-if-larger",
+ 				"--strip", "--ext", ".png",
+ 				"--force", "--speed", "1", filename, NULL };
+ 	if (!g_file_test (argv[0], G_FILE_TEST_IS_EXECUTABLE))
diff --git a/pkgs/development/libraries/appstream/default.nix b/pkgs/development/libraries/appstream/default.nix
index b79f274b9c3a..61ee182ce627 100644
--- a/pkgs/development/libraries/appstream/default.nix
+++ b/pkgs/development/libraries/appstream/default.nix
@@ -1,37 +1,55 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig, gettext, intltool
-, xmlto, docbook_xsl, docbook_xml_dtd_45
-, glib, xapian, libxml2, libyaml, gobjectIntrospection
+{ stdenv, fetchpatch, fetchFromGitHub, meson, ninja, pkgconfig, gettext
+, xmlto, docbook_xsl, docbook_xml_dtd_45, libxslt
+, libstemmer, glib, xapian, libxml2, libyaml, gobjectIntrospection
 , pcre, itstool
 }:
 
 stdenv.mkDerivation rec {
   name = "appstream-${version}";
-  version = "0.10.6";
+  version = "0.11.8";
 
   src = fetchFromGitHub {
-    owner = "ximion";
-    repo = "appstream";
-    rev = "APPSTREAM_0_10_6";
-    sha256 = "1fg7zxx2qhkyj7fmcpwbf80b72d16kyi8dadi111kf00sgzfbiyy";
+    owner  = "ximion";
+    repo   = "appstream";
+    rev    = "APPSTREAM_${stdenv.lib.replaceStrings ["."] ["_"] version}";
+    sha256 = "07vzz57g1p5byj2jfg17y5n3il0g07d9wkiynzwra71mcxar1p08";
   };
 
+  patches = [
+    # drop this in version 0.11.9 and above
+    (fetchpatch {
+      name   = "define-location-and-soname.patch";
+      url    = "https://github.com/ximion/appstream/commit/3e58f9c9.patch";
+      sha256 = "1ffgbdfg80yq5vahjrvdd4f8xsp32ksm9vyasfmc7hzhx294s78w";
+    })
+  ];
+
   nativeBuildInputs = [
-    cmake pkgconfig gettext intltool
-    xmlto docbook_xsl docbook_xml_dtd_45
+    meson ninja pkgconfig gettext
+    libxslt xmlto docbook_xsl docbook_xml_dtd_45
     gobjectIntrospection itstool
   ];
 
-  buildInputs = [ pcre glib xapian libxml2 libyaml ];
+  buildInputs = [ libstemmer pcre glib xapian libxml2 libyaml ];
 
-  cmakeFlags = ''
-    -DSTEMMING=off
-    '';
+  prePatch = ''
+    substituteInPlace meson.build \
+      --replace /usr/include ${libstemmer}/include
+
+    substituteInPlace data/meson.build \
+      --replace /etc $out/etc
+  '';
+
+  mesonFlags = [
+    "-Dapidocs=false"
+    "-Ddocs=false"
+    "-Dgir=false"
+  ];
 
   meta = with stdenv.lib; {
     description = "Software metadata handling library";
     homepage    = https://www.freedesktop.org/wiki/Distributions/AppStream/;
-    longDescription =
-    ''
+    longDescription = ''
       AppStream is a cross-distro effort for building Software-Center applications
       and enhancing metadata provided by software components.  It provides
       specifications for meta-information which is shipped by upstream projects and
diff --git a/pkgs/development/libraries/appstream/qt.nix b/pkgs/development/libraries/appstream/qt.nix
new file mode 100644
index 000000000000..beff83f2365b
--- /dev/null
+++ b/pkgs/development/libraries/appstream/qt.nix
@@ -0,0 +1,25 @@
+{ stdenv, appstream, qtbase, qttools }:
+
+stdenv.mkDerivation rec {
+  name = "appstream-qt-${version}";
+  inherit (appstream) version src patches prePatch;
+
+  buildInputs = appstream.buildInputs ++ [ appstream qtbase ];
+
+  nativeBuildInputs = appstream.nativeBuildInputs ++ [ qttools ];
+
+  mesonFlags = appstream.mesonFlags ++ [ "-Dqt=true" ];
+
+  postInstall = ''
+    rm -rf $out/{bin,etc,include/appstream,lib/pkgconfig,lib/libappstream.so*,share}
+  '';
+
+  preFixup = ''
+    patchelf --add-needed ${appstream}/lib/libappstream.so.4 \
+      $out/lib/libAppStreamQt.so
+  '';
+
+  meta = appstream.meta // {
+    description = "Software metadata handling library - Qt";
+ };
+}
diff --git a/pkgs/development/libraries/aspell/default.nix b/pkgs/development/libraries/aspell/default.nix
index cccd93e5d4dd..d0e93337a390 100644
--- a/pkgs/development/libraries/aspell/default.nix
+++ b/pkgs/development/libraries/aspell/default.nix
@@ -1,5 +1,6 @@
-{stdenv, fetchurl, perl
-, searchNixProfiles ? true}:
+{ stdenv, fetchurl, fetchpatch, perl
+, searchNixProfiles ? true
+}:
 
 stdenv.mkDerivation rec {
   name = "aspell-0.60.6.1";
@@ -9,10 +10,16 @@ stdenv.mkDerivation rec {
     sha256 = "1qgn5psfyhbrnap275xjfrzppf5a83fb67gpql0kfqv37al869gm";
   };
 
-  patchPhase = ''
+  patches = [
+    (fetchpatch { # remove in >= 0.60.7
+      name = "gcc-7.patch";
+      url = "https://github.com/GNUAspell/aspell/commit/8089fa02122fed0a.diff";
+      sha256 = "1b3p1zy2lqr2fknddckm58hyk95hw4scf6hzjny1v9iaic2p37ix";
+    })
+  ] ++ stdenv.lib.optional searchNixProfiles ./data-dirs-from-nix-profiles.patch;
+
+  postPatch = ''
     patch interfaces/cc/aspell.h < ${./clang.patch}
-  '' + stdenv.lib.optionalString searchNixProfiles ''
-    patch -p1 < ${./data-dirs-from-nix-profiles.patch}
   '';
 
   nativeBuildInputs = [ perl ];
diff --git a/pkgs/development/libraries/aspell/dictionaries.nix b/pkgs/development/libraries/aspell/dictionaries.nix
index 8d97d6db2f1c..096ac80e5a70 100644
--- a/pkgs/development/libraries/aspell/dictionaries.nix
+++ b/pkgs/development/libraries/aspell/dictionaries.nix
@@ -1,32 +1,113 @@
-{stdenv, fetchurl, aspell, which}:
+{lib, stdenv, fetchurl, aspell, which}:
+
+with lib;
+
+/* HOWTO:
+
+   * Add some of these to your profile or systemPackages.
+
+     ~~~~
+     environment.systemPackages = [
+       aspell
+       aspellDicts.en
+       aspellDicts.en-computers
+       aspellDicts.en-science
+     ];
+     ~~~~
+
+   * Rebuild and switch to the new profile.
+   * Add something like
+
+     ~~~~
+     master en_US
+     extra-dicts en-computers.rws
+     add-extra-dicts en_US-science.rws
+     ~~~~
+
+     to `/etc/aspell.conf` or `~/.aspell.conf`.
+   * Check that `aspell -a` starts without errors.
+   * (optional) Check your config with `aspell dump config | grep -vE '^(#|$)'`.
+   * Enjoy.
+
+*/
 
 let
 
   /* Function to compile an Aspell dictionary.  Fortunately, they all
      build in the exact same way. */
   buildDict =
-    {shortName, fullName, src, postInstall ? ""}:
+    {shortName, fullName, ...}@args:
 
-    stdenv.mkDerivation {
+    stdenv.mkDerivation ({
       name = "aspell-dict-${shortName}";
 
-      inherit src;
-
       buildInputs = [aspell which];
 
       dontAddPrefix = true;
 
       preBuild = "makeFlagsArray=(dictdir=$out/lib/aspell datadir=$out/lib/aspell)";
 
-      inherit postInstall;
-
       meta = {
         description = "Aspell dictionary for ${fullName}";
         platforms = stdenv.lib.platforms.all;
-      };
-    };
-
-in {
+      } // (args.meta or {});
+    } // removeAttrs args [ "meta" ]);
+
+  /* Function to compile txt dict files into Aspell dictionaries. */
+  buildTxtDict =
+    {langInputs ? [], ...}@args:
+    buildDict ({
+      propagatedUserEnvPackages = langInputs;
+
+      preBuild = ''
+        # Aspell can't handle multiple data-dirs
+        # Copy everything we might possibly need
+        ${concatMapStringsSep "\n" (p: ''
+          cp -a ${p}/lib/aspell/* .
+        '') ([ aspell ] ++ langInputs)}
+        export ASPELL_CONF="data-dir $(pwd)"
+
+        aspell-create() {
+          target=$1
+          shift
+          echo building $target
+          aspell create "$@" master ./$target.rws
+        }
+
+        words-only() {
+          awk -F'\t' '{print $1}' | sort | uniq
+        }
+
+        # drop comments
+        aspell-affix() {
+          words-only \
+            | grep -v '#' \
+            | aspell-create "$@"
+        }
+
+        # Hack: drop comments and words with affixes
+        aspell-plain() {
+          words-only \
+            | grep -v '#' \
+            | grep -v '/' \
+            | aspell-create "$@"
+        }
+
+        aspell-install() {
+          install -d $out/lib/aspell
+          for a in "$@"; do
+            echo installing $a
+            install -t $out/lib/aspell $a.rws
+          done
+        }
+      '';
+
+      phases = [ "preBuild" "buildPhase" "installPhase" ];
+    } // args);
+
+in rec {
+
+  ### Languages
 
   ca = buildDict {
     shortName = "ca-2.1.5-1";
@@ -230,4 +311,53 @@ in {
     };
   };
 
+  ### Jargons
+
+  en-computers = buildTxtDict rec {
+    shortName = "en-computers";
+    fullName = "English Computer Jargon";
+
+    src = fetchurl {
+      url = https://mrsatterly.com/computer.dic;
+      sha256 = "1vzk7cdvcm9r1c6mgxpabrdcpvghdv9mjmnf6iq5wllcif5nsw2b";
+    };
+
+    langInputs = [ en ];
+
+    buildPhase = "cat $src | aspell-affix en-computers --dont-validate-words --lang=en";
+    installPhase = "aspell-install en-computers";
+
+    meta = {
+      homepage = https://mrsatterly.com/spelling.html;
+    };
+  };
+
+  en-science = buildTxtDict rec {
+    shortName = "en-science";
+    fullName = "English Scientific Jargon";
+
+    src1 = fetchurl {
+      url = http://jpetrie.net/wp-content/uploads/custom_scientific_US.txt;
+      sha256 = "1psqm094zl4prk2f8h18jv0d471hxykzd1zdnrlx7gzrzy6pz5r3";
+    };
+
+    src2 = fetchurl {
+      url = http://jpetrie.net/wp-content/uploads/custom_scientific_UK.txt;
+      sha256 = "17ss1sdr3k70zbyx2z9xf74345slrp41gbkpih8axrmg4x92fgm1";
+    };
+
+    langInputs = [ en ];
+
+    buildPhase = ''
+      cat $src1 | aspell-plain en_US-science --dont-validate-words --lang=en
+      cat $src2 | aspell-plain en_GB-science --dont-validate-words --lang=en
+    '';
+    installPhase = "aspell-install en_US-science en_GB-science";
+
+    meta = {
+      homepage = http://www.jpetrie.net/scientific-word-list-for-spell-checkersspelling-dictionaries/;
+    };
+
+  };
+
 }
diff --git a/pkgs/development/libraries/attr/default.nix b/pkgs/development/libraries/attr/default.nix
index 6a94cb0c0e23..0bfeaf81a81d 100644
--- a/pkgs/development/libraries/attr/default.nix
+++ b/pkgs/development/libraries/attr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gettext }:
+{ stdenv, fetchurl, gettext, hostPlatform }:
 
 stdenv.mkDerivation rec {
   name = "attr-2.4.47";
@@ -12,13 +12,16 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ gettext ];
 
-  configureFlags = "MAKE=make MSGFMT=msgfmt MSGMERGE=msgmerge XGETTEXT=xgettext ECHO=echo SED=sed AWK=gawk";
+  configureFlags = [ "MAKE=make" "MSGFMT=msgfmt" "MSGMERGE=msgmerge" "XGETTEXT=xgettext" "ECHO=echo" "SED=sed" "AWK=gawk" ];
 
-  installTargets = "install install-lib install-dev";
+  installTargets = [ "install" "install-lib" "install-dev" ];
 
-  meta = {
-    homepage = http://savannah.nongnu.org/projects/attr/;
+  patches = if (hostPlatform.libc == "musl") then [ ./fix-headers-musl.patch ] else null;
+
+  meta = with stdenv.lib; {
+    homepage = "http://savannah.nongnu.org/projects/attr/";
     description = "Library and tools for manipulating extended attributes";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = platforms.linux;
+    license = licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/development/libraries/attr/fix-headers-musl.patch b/pkgs/development/libraries/attr/fix-headers-musl.patch
new file mode 100644
index 000000000000..e969f640eeef
--- /dev/null
+++ b/pkgs/development/libraries/attr/fix-headers-musl.patch
@@ -0,0 +1,54 @@
+--- attr-2.4.47/include/xattr.h
++++ attr-2.4.47/include/xattr.h
+@@ -31,33 +31,37 @@
+ #define XATTR_REPLACE 0x2       /* set value, fail if attr does not exist */
+ 
+ 
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ 
+ extern int setxattr (const char *__path, const char *__name,
+-		      const void *__value, size_t __size, int __flags) __THROW;
++		      const void *__value, size_t __size, int __flags);
+ extern int lsetxattr (const char *__path, const char *__name,
+-		      const void *__value, size_t __size, int __flags) __THROW;
++		      const void *__value, size_t __size, int __flags);
+ extern int fsetxattr (int __filedes, const char *__name,
+-		      const void *__value, size_t __size, int __flags) __THROW;
++		      const void *__value, size_t __size, int __flags);
+ 
+ extern ssize_t getxattr (const char *__path, const char *__name,
+-				void *__value, size_t __size) __THROW;
++				void *__value, size_t __size);
+ extern ssize_t lgetxattr (const char *__path, const char *__name,
+-				void *__value, size_t __size) __THROW;
++				void *__value, size_t __size);
+ extern ssize_t fgetxattr (int __filedes, const char *__name,
+-				void *__value, size_t __size) __THROW;
++				void *__value, size_t __size);
+ 
+ extern ssize_t listxattr (const char *__path, char *__list,
+-				size_t __size) __THROW;
++				size_t __size);
+ extern ssize_t llistxattr (const char *__path, char *__list,
+-				size_t __size) __THROW;
++				size_t __size);
+ extern ssize_t flistxattr (int __filedes, char *__list,
+-				size_t __size) __THROW;
++				size_t __size);
+ 
+-extern int removexattr (const char *__path, const char *__name) __THROW;
+-extern int lremovexattr (const char *__path, const char *__name) __THROW;
+-extern int fremovexattr (int __filedes,   const char *__name) __THROW;
++extern int removexattr (const char *__path, const char *__name);
++extern int lremovexattr (const char *__path, const char *__name);
++extern int fremovexattr (int __filedes,   const char *__name);
+ 
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+ 
+ #endif	/* __XATTR_H__ */
diff --git a/pkgs/development/libraries/aws-sdk-cpp/default.nix b/pkgs/development/libraries/aws-sdk-cpp/default.nix
index 47d9e7dba4ce..cd42652e091a 100644
--- a/pkgs/development/libraries/aws-sdk-cpp/default.nix
+++ b/pkgs/development/libraries/aws-sdk-cpp/default.nix
@@ -3,6 +3,7 @@
   apis ? ["*"]
 , # Whether to enable AWS' custom memory management.
   customMemoryManagement ? true
+, darwin
 }:
 
 let
@@ -29,10 +30,15 @@ in stdenv.mkDerivation rec {
   separateDebugInfo = stdenv.isLinux;
 
   nativeBuildInputs = [ cmake curl ];
-  buildInputs = [ zlib curl openssl ];
+  buildInputs = [ zlib curl openssl ]
+    ++ lib.optionals (stdenv.isDarwin &&
+                        ((builtins.elem "text-to-speech" apis) ||
+                         (builtins.elem "*" apis)))
+         (with darwin.apple_sdk.frameworks; [ CoreAudio AudioToolbox ]);
 
   cmakeFlags =
     lib.optional (!customMemoryManagement) "-DCUSTOM_MEMORY_MANAGEMENT=0"
+    ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "-DENABLE_TESTING=OFF"
     ++ lib.optional (apis != ["*"])
       "-DBUILD_ONLY=${lib.concatStringsSep ";" apis}";
 
@@ -52,6 +58,8 @@ in stdenv.mkDerivation rec {
       rm aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp
     '';
 
+  NIX_CFLAGS_COMPILE = [ "-Wno-error=noexcept-type" ];
+
   meta = {
     description = "A C++ interface for Amazon Web Services";
     homepage = https://github.com/awslabs/aws-sdk-cpp;
diff --git a/pkgs/development/libraries/bctoolbox/default.nix b/pkgs/development/libraries/bctoolbox/default.nix
index 69faf913abfe..5439c7657e08 100644
--- a/pkgs/development/libraries/bctoolbox/default.nix
+++ b/pkgs/development/libraries/bctoolbox/default.nix
@@ -2,13 +2,13 @@
 stdenv.mkDerivation rec {
   name = "${baseName}-${version}";
   baseName = "bctoolbox";
-  version = "0.2.0";
+  version = "0.6.0";
   buildInputs = [cmake mbedtls bcunit srtp];
   src = fetchFromGitHub {
     owner = "BelledonneCommunications";
     repo = "${baseName}";
     rev = "${version}";
-    sha256 = "09mjqdfjxy4jy1z68b2i99hgkbnhhk7vnbfhj9sdpd1p3jk2ha33";
+    sha256 = "1cxx243wyzkd4xnvpyqf97n0rjhfckpvw1vhwnbwshq3q6fra909";
   };
 
   meta = {
diff --git a/pkgs/development/libraries/belcard/default.nix b/pkgs/development/libraries/belcard/default.nix
new file mode 100644
index 000000000000..8805dc74a26c
--- /dev/null
+++ b/pkgs/development/libraries/belcard/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, cmake, fetchFromGitHub, bctoolbox, belr }:
+
+stdenv.mkDerivation rec {
+  baseName = "belcard";
+  version = "1.0.2";
+  name = "${baseName}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "BelledonneCommunications";
+    repo = "${baseName}";
+    rev = "${version}";
+    sha256 = "1pwji83vpsdrfma24rnj3rz1x0a0g6zk3v4xjnip7zf2ys3zcnlk";
+  };
+
+  buildInputs = [ bctoolbox belr ];
+  nativeBuildInputs = [ cmake ];
+
+  meta = with stdenv.lib;{
+    description = "Belcard is a C++ library to manipulate VCard standard format";
+    homepage = https://github.com/BelledonneCommunications/belcard;
+    license = licenses.lgpl21;
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/belle-sip/default.nix b/pkgs/development/libraries/belle-sip/default.nix
index b055b2358a54..003fce0ea8c3 100644
--- a/pkgs/development/libraries/belle-sip/default.nix
+++ b/pkgs/development/libraries/belle-sip/default.nix
@@ -4,14 +4,14 @@
 
 stdenv.mkDerivation rec {
   baseName = "belle-sip";
-  version = "1.5.0";
+  version = "1.6.3";
   name = "${baseName}-${version}";
 
   src = fetchFromGitHub {
     owner = "BelledonneCommunications";
     repo = "${baseName}";
     rev = "${version}";
-    sha256 = "0hnm64hwgq003wicz6c485fryjfhi820fgin8ndknq60kvwxsrzn";
+    sha256 = "0q70db1klvhca1af29bm9paka3gyii5hfbzrj4178gclsg7cj8fk";
   };
 
   nativeBuildInputs = [ jre cmake ];
diff --git a/pkgs/development/libraries/belr/default.nix b/pkgs/development/libraries/belr/default.nix
new file mode 100644
index 000000000000..214abb21f2cd
--- /dev/null
+++ b/pkgs/development/libraries/belr/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, cmake, fetchFromGitHub, bctoolbox }:
+
+stdenv.mkDerivation rec {
+  baseName = "belr";
+  version = "0.1.3";
+  name = "${baseName}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "BelledonneCommunications";
+    repo = "${baseName}";
+    rev = "${version}";
+    sha256 = "0mf8lsyq1z3b5p47c00lnwc8n7v9nzs1fd2g9c9hnz6fjd2ka44w";
+  };
+
+  buildInputs = [ bctoolbox ];
+  nativeBuildInputs = [ cmake ];
+
+  meta = with stdenv.lib;{
+    description = "Belr is Belledonne Communications' language recognition library";
+    homepage = https://github.com/BelledonneCommunications/belr;
+    license = licenses.lgpl21;
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/boehm-gc/default.nix b/pkgs/development/libraries/boehm-gc/default.nix
index b79900288c97..d4e91deb7449 100644
--- a/pkgs/development/libraries/boehm-gc/default.nix
+++ b/pkgs/development/libraries/boehm-gc/default.nix
@@ -1,17 +1,17 @@
-{ lib, stdenv, fetchurl, pkgconfig, libatomic_ops, enableLargeConfig ? false
+{ lib, stdenv, fetchurl, fetchpatch, pkgconfig, libatomic_ops, enableLargeConfig ? false
 , buildPlatform, hostPlatform
 }:
 
 stdenv.mkDerivation rec {
   name = "boehm-gc-${version}";
-  version = "7.6.2";
+  version = "7.6.4";
 
   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 = "07nli9hgdzc09qzw169sn7gchkrn5kqgyniv2rspcy1xaq2j04dx";
+    sha256 = "076dzsqqyxd3nlzs0z277vvhqjp8nv5dqi763s0m90zr6ljiyk5r";
   };
 
   buildInputs = [ libatomic_ops ];
@@ -20,9 +20,21 @@ stdenv.mkDerivation rec {
   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://raw.githubusercontent.com/gentoo/musl/85b6a600996bdd71162b357e9ba93d8559342432/dev-libs/boehm-gc/files/boehm-gc-7.6.0-sys_select.patch";
+    sha256 = "1gydwlklvci30f5dpp5ccw2p2qpph5y41r55wx9idamjlq66fbb3";
+  }) ] ++
+    # https://github.com/ivmai/bdwgc/pull/208
+    lib.optional hostPlatform.isRiscV ./riscv.patch;
+
   configureFlags =
     [ "--enable-cplusplus" ]
-    ++ lib.optional enableLargeConfig "--enable-large-config";
+    ++ lib.optional enableLargeConfig "--enable-large-config"
+    ++ lib.optional (stdenv.hostPlatform.libc == "musl") "--disable-static";
 
   doCheck = true; # not cross;
 
diff --git a/pkgs/development/libraries/boehm-gc/riscv.patch b/pkgs/development/libraries/boehm-gc/riscv.patch
new file mode 100644
index 000000000000..249137d0a0dc
--- /dev/null
+++ b/pkgs/development/libraries/boehm-gc/riscv.patch
@@ -0,0 +1,53 @@
+diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
+index a8e55dd2..439cc88d 100644
+--- a/include/private/gcconfig.h
++++ b/include/private/gcconfig.h
+@@ -650,6 +650,15 @@
+ #   endif
+ #   define mach_type_known
+ # endif
++# if defined(__riscv) && defined(LINUX)
++#   if __riscv_xlen == 32
++#     define RISCV32
++#     define mach_type_known
++#   elif __riscv_xlen == 64
++#     define RISCV64
++#     define mach_type_known
++#   endif
++# endif
+ 
+ # if defined(SN_TARGET_PSP2)
+ #   define mach_type_known
+@@ -2970,6 +2979,32 @@
+ #   endif
+ # endif
+ 
++# ifdef RISCV32
++#   define CPP_WORDSZ 32
++#   define MACH_TYPE "RISC-V 32"
++#   define ALIGNMENT 4
++#   ifdef LINUX
++#     define OS_TYPE "LINUX"
++      extern int __data_start[];
++#     define DATASTART ((ptr_t)__data_start)
++#     define LINUX_STACKBOTTOM
++#     define DYNAMIC_LOADING
++#   endif
++# endif
++
++# ifdef RISCV64
++#   define CPP_WORDSZ 64
++#   define MACH_TYPE "RISC-V 64"
++#   define ALIGNMENT 8
++#   ifdef LINUX
++#     define OS_TYPE "LINUX"
++      extern int __data_start[];
++#     define DATASTART ((ptr_t)__data_start)
++#     define LINUX_STACKBOTTOM
++#     define DYNAMIC_LOADING
++#   endif
++# endif
++
+ #if defined(__GLIBC__) && !defined(DONT_USE_LIBC_PRIVATES)
+   /* Use glibc's stack-end marker. */
+ # define USE_LIBC_PRIVATES
diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix
index c2a59431ac04..14ea512afbd2 100644
--- a/pkgs/development/libraries/boost/generic.nix
+++ b/pkgs/development/libraries/boost/generic.nix
@@ -144,7 +144,7 @@ stdenv.mkDerivation {
 
   postFixup = ''
     # Make boost header paths relative so that they are not runtime dependencies
-    find "$dev/include" \( -name '*.hpp' -or -name '*.h' -or -name '*.ipp' \) \
+    cd "$dev" && find include \( -name '*.hpp' -or -name '*.h' -or -name '*.ipp' \) \
       -exec sed '1i#line 1 "{}"' -i '{}' \;
   '' + optionalString (hostPlatform.libc == "msvcrt") ''
     $RANLIB "$out/lib/"*.a
diff --git a/pkgs/development/libraries/bzrtp/default.nix b/pkgs/development/libraries/bzrtp/default.nix
new file mode 100644
index 000000000000..cdc660ca3f32
--- /dev/null
+++ b/pkgs/development/libraries/bzrtp/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, cmake, fetchFromGitHub, bctoolbox, sqlite }:
+
+stdenv.mkDerivation rec {
+  baseName = "bzrtp";
+  version = "1.0.6";
+  name = "${baseName}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "BelledonneCommunications";
+    repo = "${baseName}";
+    rev = "${version}";
+    sha256 = "0438zzxp82bj5fmvqnwlljkgrz9ab5qm5lgpwwgmg1cp78bp2l45";
+  };
+
+  buildInputs = [ bctoolbox sqlite ];
+  nativeBuildInputs = [ cmake ];
+
+  meta = with stdenv.lib; {
+    description = "BZRTP is an opensource implementation of ZRTP keys exchange protocol";
+    homepage = https://github.com/BelledonneCommunications/bzrtp;
+    license = licenses.lgpl21;
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/cpp-gsl/default.nix b/pkgs/development/libraries/cpp-gsl/default.nix
new file mode 100644
index 000000000000..ecd86354ee82
--- /dev/null
+++ b/pkgs/development/libraries/cpp-gsl/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchFromGitHub, cmake, catch }:
+
+stdenv.mkDerivation rec {
+  pname = "GSL-unstable";
+  version = "2017-02-15";
+  name = "${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "Microsoft";
+    repo = "GSL";
+    rev = "c87c123d1b3e64ae2cf725584f0c004da4d90f1c";
+    sha256 = "0h8py468bvxnydkjs352d7a9s8hk0ihc7msjkcnzj2d7nzp5nsc1";
+  };
+
+  nativeBuildInputs = [ cmake catch ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/Microsoft/GSL;
+    description = "C++ Core Guideline support library";
+    longDescription = ''
+     The Guideline Support Library (GSL) contains functions and types that are suggested for
+     use by the C++ Core Guidelines maintained by the Standard C++ Foundation.
+     This package contains Microsoft's implementation of GSL.
+    '';
+    platforms = stdenv.lib.platforms.unix;
+    license = licenses.mit;
+    maintainers = with maintainers; [ yuriaisaka ];
+  };
+}
diff --git a/pkgs/development/libraries/cutee/default.nix b/pkgs/development/libraries/cutee/default.nix
index eb19283caeaf..ba1d02380e29 100644
--- a/pkgs/development/libraries/cutee/default.nix
+++ b/pkgs/development/libraries/cutee/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "C++ Unit Testing Easy Environment";
-    homepage    = http://codesink.org/cutee_unit_testing.html;
+    homepage    = http://www.codesink.org/cutee_unit_testing.html;
     license     = licenses.gpl2Plus;
     maintainers = with maintainers; [ leenaars];
     platforms = platforms.linux;
diff --git a/pkgs/development/libraries/dbus-cplusplus/default.nix b/pkgs/development/libraries/dbus-cplusplus/default.nix
index ee7afbbf2522..051405811438 100644
--- a/pkgs/development/libraries/dbus-cplusplus/default.nix
+++ b/pkgs/development/libraries/dbus-cplusplus/default.nix
@@ -10,11 +10,26 @@ stdenv.mkDerivation rec {
     sha256 = "0qafmy2i6dzx4n1dqp6pygyy6gjljnb7hwjcj2z11c1wgclsq4dw";
   };
 
-  patches = [( fetchurl {
-    url = http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/dbus-c%2B%2B/files/dbus-c%2B%2B-0.9.0-gcc-4.7.patch;
-    name = "gcc-4.7.patch";
-    sha256 = "0rwcz9pvc13b3yfr0lkifnfz0vb5q6dg240bzgf37ni4s8rpc72g";
-  })];
+  patches = [
+    (fetchurl {
+      name = "gcc-4.7.patch";
+      url = "http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/"
+          + "dbus-c%2B%2B/files/dbus-c%2B%2B-0.9.0-gcc-4.7.patch";
+      sha256 = "0rwcz9pvc13b3yfr0lkifnfz0vb5q6dg240bzgf37ni4s8rpc72g";
+    })
+    (fetchurl {
+      name = "writechar.patch"; # since gcc7
+      url = "https://src.fedoraproject.org/cgit/rpms/dbus-c++.git/plain/"
+          + "dbus-c++-writechar.patch?id=7f371172f5c";
+      sha256 = "1kkg4gbpm4hp87l25zw2a3r9c58g7vvgzcqgiman734i66zsbb9l";
+    })
+    (fetchurl {
+      name = "threading.patch"; # since gcc7
+      url = "https://src.fedoraproject.org/cgit/rpms/dbus-c++.git/plain/"
+          + "dbus-c++-threading.patch?id=7f371172f5c";
+      sha256 = "1h362anx3wyxm5lq0v8girmip1jmkdbijrmbrq7k5pp47zkhwwrq";
+    })
+  ];
 
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ dbus glib expat ];
diff --git a/pkgs/development/libraries/ffmpeg-full/default.nix b/pkgs/development/libraries/ffmpeg-full/default.nix
index 780008c95001..689b13a394dc 100644
--- a/pkgs/development/libraries/ffmpeg-full/default.nix
+++ b/pkgs/development/libraries/ffmpeg-full/default.nix
@@ -231,11 +231,11 @@ assert nvenc -> nvidia-video-sdk != null && nonfreeLicensing;
 
 stdenv.mkDerivation rec {
   name = "ffmpeg-full-${version}";
-  version = "3.4.1";
+  version = "3.4.2";
 
   src = fetchurl {
     url = "https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz";
-    sha256 = "1h4iz7q10wj04awr2wvmp60n7b09pfwrgwbbw9sgl7klcf52fxss";
+    sha256 = "0h6prjn1ijkzzhkyj8mazp0wpx7m0n9ycadjxagf9czqirbyk4ib";
   };
 
   prePatch = ''
diff --git a/pkgs/development/libraries/ffmpeg/3.4.nix b/pkgs/development/libraries/ffmpeg/3.4.nix
index f4cda16424c3..98cbfdf43f6c 100644
--- a/pkgs/development/libraries/ffmpeg/3.4.nix
+++ b/pkgs/development/libraries/ffmpeg/3.4.nix
@@ -6,7 +6,7 @@
 
 callPackage ./generic.nix (args // rec {
   version = "${branch}";
-  branch = "3.4.1";
-  sha256 = "0b2aaxx8l7g3pvs4zd3mzig44cc73savrxzfm6w0lnaa2lh3wi7k";
+  branch = "3.4.2";
+  sha256 = "0nkq4451masmzlx3p4vprqwc0sl2iwqxbzjrngmvj29q4azp00zb";
   darwinFrameworks = [ Cocoa CoreMedia ];
 })
diff --git a/pkgs/development/libraries/fftw/default.nix b/pkgs/development/libraries/fftw/default.nix
index 36c824c75287..701209971074 100644
--- a/pkgs/development/libraries/fftw/default.nix
+++ b/pkgs/development/libraries/fftw/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     # all x86_64 have sse2
     # however, not all float sizes fit
     ++ optional (stdenv.isx86_64 && (precision == "single" || precision == "double") )  "--enable-sse2"
-    ++ optional stdenv.cc.isGNU "--enable-openmp"
+    ++ optional (stdenv.cc.isGNU && !stdenv.hostPlatform.isMusl) "--enable-openmp"
     # doc generation causes Fortran wrapper generation which hard-codes gcc
     ++ optional (!withDoc) "--disable-doc";
 
diff --git a/pkgs/development/libraries/fontconfig/make-fonts-cache.nix b/pkgs/development/libraries/fontconfig/make-fonts-cache.nix
index 9aa1a905ec98..8b534edd2498 100644
--- a/pkgs/development/libraries/fontconfig/make-fonts-cache.nix
+++ b/pkgs/development/libraries/fontconfig/make-fonts-cache.nix
@@ -24,4 +24,8 @@ runCommand "fc-cache"
 
     mkdir -p $out
     fc-cache -sv
+
+    # This is not a cache dir in the normal sense -- it won't be automatically
+    # recreated.
+    rm "$out/CACHEDIR.TAG"
   ''
diff --git a/pkgs/development/libraries/gamin/default.nix b/pkgs/development/libraries/gamin/default.nix
index e6b1875a9e0c..2dd32b6f1100 100644
--- a/pkgs/development/libraries/gamin/default.nix
+++ b/pkgs/development/libraries/gamin/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python, pkgconfig, glib }:
+{ stdenv, fetchurl, fetchpatch, python, pkgconfig, glib }:
 
 stdenv.mkDerivation (rec {
   name = "gamin-0.1.10";
@@ -18,7 +18,12 @@ stdenv.mkDerivation (rec {
 
   patches = [ ./deadlock.patch ]
     ++ map fetchurl (import ./debian-patches.nix)
-    ++ stdenv.lib.optional stdenv.cc.isClang ./returnval.patch;
+    ++ stdenv.lib.optional stdenv.cc.isClang ./returnval.patch
+    ++ stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
+      name = "fix-pthread-mutex.patch";
+      url = "https://git.alpinelinux.org/cgit/aports/plain/main/gamin/fix-pthread-mutex.patch?h=3.4-stable&id=a1a836b089573752c1b0da7d144c0948b04e8ea8";
+      sha256 = "13igdbqsxb3sz0h417k6ifmq2n4siwqspj6slhc7fdl5wd1fxmdz";
+    });
 
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/gcab/default.nix b/pkgs/development/libraries/gcab/default.nix
index 38a36fc4e546..0758d1252274 100644
--- a/pkgs/development/libraries/gcab/default.nix
+++ b/pkgs/development/libraries/gcab/default.nix
@@ -1,16 +1,24 @@
-{ stdenv, fetchurl, intltool, gobjectIntrospection, pkgconfig }:
+{ stdenv, fetchurl, gettext, gobjectIntrospection, pkgconfig, meson, ninja, glibcLocales, git, vala, glib, zlib }:
 
 stdenv.mkDerivation rec {
   name = "gcab-${version}";
-  version = "0.7";
+  version = "1.1";
+
+  LC_ALL = "en_US.UTF-8";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gcab/${version}/${name}.tar.xz";
-    sha256 = "1vxdsiky3492zlyrym02sdwf09y19rl2z5h5iin7qm0wizw5wvm1";
+    sha256 = "0l19sr6pg0cfcddmi5n79d08mjjbhn427ip5jlsy9zddq9r24aqr";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ intltool gobjectIntrospection ];
+  nativeBuildInputs = [ meson ninja glibcLocales git pkgconfig vala gettext gobjectIntrospection ];
+
+  buildInputs = [ glib zlib ];
+
+  mesonFlags = [
+    "-Ddocs=false"
+    "-Dtests=false"
+  ];
 
   meta = with stdenv.lib; {
     platforms = platforms.linux;
diff --git a/pkgs/development/libraries/geis/default.nix b/pkgs/development/libraries/geis/default.nix
index 6e043f5994df..5796425e4385 100644
--- a/pkgs/development/libraries/geis/default.nix
+++ b/pkgs/development/libraries/geis/default.nix
@@ -1,14 +1,20 @@
 { stdenv, fetchurl
 , pkgconfig
-, python3
+, python3Packages
+, wrapGAppsHook
+, atk
 , dbus_libs
 , evemu
 , frame
+, gdk_pixbuf
+, gobjectIntrospection
 , grail
+, gtk3
 , libX11
 , libXext
 , libXi
 , libXtst
+, pango
 , xorgserver
 }:
 
@@ -25,8 +31,23 @@ stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = "-Wno-format -Wno-misleading-indentation -Wno-error";
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ python3 dbus_libs evemu frame grail libX11 libXext libXi libXtst xorgserver ];
+  pythonPath = with python3Packages;
+    [ pygobject3  ];
+
+  nativeBuildInputs = [ pkgconfig wrapGAppsHook python3Packages.wrapPython];
+  buildInputs = [ atk dbus_libs evemu frame gdk_pixbuf gobjectIntrospection grail
+    gtk3 libX11 libXext libXi libXtst pango python3Packages.python xorgserver
+  ];
+
+  patchPhase = ''
+    substituteInPlace python/geis/geis_v2.py --replace \
+      "ctypes.util.find_library(\"geis\")" "'$out/lib/libgeis.so'"
+  '';
+
+  preFixup = ''
+    buildPythonPath "$out $pythonPath"
+    gappsWrapperArgs+=(--set PYTHONPATH "$program_PYTHONPATH")
+  '';
 
   meta = {
     description = "A library for input gesture recognition";
diff --git a/pkgs/development/libraries/getdns/default.nix b/pkgs/development/libraries/getdns/default.nix
new file mode 100644
index 000000000000..382bdb17247c
--- /dev/null
+++ b/pkgs/development/libraries/getdns/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, libtool, unbound, libidn, m4, file
+, openssl, doxygen, autoreconfHook, automake }:
+
+stdenv.mkDerivation rec {
+  pname = "getdns";
+  name = "${pname}-${version}";
+  version = "1.3.0";
+
+  src = fetchurl {
+    url = "https://getdnsapi.net/releases/${pname}-1-3-0/${pname}-${version}.tar.gz";
+    sha256 = "920fa2e07c72fd0e5854db1820fa777108009fc5cb702f9aa5155ef58b12adb1";
+  };
+
+  nativeBuildInputs = [ libtool m4 autoreconfHook automake file ];
+
+  buildInputs = [ unbound libidn openssl doxygen ];
+
+  patchPhase = ''
+    substituteInPlace m4/acx_openssl.m4 \
+      --replace /usr/local/ssl ${openssl.dev}
+    '';
+
+  meta = with stdenv.lib; {
+    description = "A modern asynchronous DNS API";
+    longDescription = ''
+      getdns is an implementation of a modern asynchronous DNS API; the
+      specification was originally edited by Paul Hoffman. It is intended to make all
+      types of DNS information easily available to application developers and non-DNS
+      experts. DNSSEC offers a unique global infrastructure for establishing and
+      enhancing cryptographic trust relations. With the development of this API the
+      developers intend to offer application developers a modern and flexible
+      interface that enables end-to-end trust in the DNS architecture, and which will
+      inspire application developers to implement innovative security solutions in
+      their applications.
+'';
+    homepage = https://getdnsapi.net;
+    maintainers = with maintainers; [ leenaars ];
+    license = licenses.bsd3;
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/glibc/2.27.nix b/pkgs/development/libraries/glibc/2.27.nix
new file mode 100644
index 000000000000..bb057ae899e7
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.27.nix
@@ -0,0 +1,101 @@
+{ stdenv, callPackage
+, withLinuxHeaders ? true
+, installLocales ? true
+, profilingLibraries ? false
+, withGd ? false
+}:
+
+assert stdenv.cc.isGNU;
+
+callPackage ./common-2.27.nix { inherit stdenv; } {
+    name = "glibc" + stdenv.lib.optionalString withGd "-gd";
+
+    inherit withLinuxHeaders profilingLibraries installLocales withGd;
+
+    NIX_NO_SELF_RPATH = true;
+
+    postConfigure = ''
+      # Hack: get rid of the `-static' flag set by the bootstrap stdenv.
+      # This has to be done *after* `configure' because it builds some
+      # test binaries.
+      export NIX_CFLAGS_LINK=
+      export NIX_LDFLAGS_BEFORE=
+
+      export NIX_DONT_SET_RPATH=1
+      unset CFLAGS
+
+      # Apparently --bindir is not respected.
+      makeFlagsArray+=("bindir=$bin/bin" "sbindir=$bin/sbin" "rootsbindir=$bin/sbin")
+    '';
+
+    # The stackprotector and fortify hardening flags are autodetected by glibc
+    # and enabled by default if supported. Setting it for every gcc invocation
+    # does not work.
+    hardeningDisable = [ "stackprotector" "fortify" ];
+
+    # When building glibc from bootstrap-tools, we need libgcc_s at RPATH for
+    # any program we run, because the gcc will have been placed at a new
+    # store path than that determined when built (as a source for the
+    # bootstrap-tools tarball)
+    # Building from a proper gcc staying in the path where it was installed,
+    # libgcc_s will not be at {gcc}/lib, and gcc's libgcc will be found without
+    # any special hack.
+    preInstall = ''
+      if [ -f ${stdenv.cc.cc}/lib/libgcc_s.so.1 ]; then
+          mkdir -p $out/lib
+          cp ${stdenv.cc.cc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
+          # the .so It used to be a symlink, but now it is a script
+          cp -a ${stdenv.cc.cc}/lib/libgcc_s.so $out/lib/libgcc_s.so
+      fi
+    '';
+
+    postInstall = ''
+      if test -n "$installLocales"; then
+          make -j''${NIX_BUILD_CORES:-1} -l''${NIX_BUILD_CORES:-1} localedata/install-locales
+      fi
+
+      test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache
+
+      if test -n "$linuxHeaders"; then
+          # Include the Linux kernel headers in Glibc, except the `scsi'
+          # subdirectory, which Glibc provides itself.
+          (cd $dev/include && \
+           ln -sv $(ls -d $linuxHeaders/include/* | grep -v scsi\$) .)
+      fi
+
+      # Fix for NIXOS-54 (ldd not working on x86_64).  Make a symlink
+      # "lib64" to "lib".
+      if test -n "$is64bit"; then
+          ln -s lib $out/lib64
+      fi
+
+      # Get rid of more unnecessary stuff.
+      rm -rf $out/var $bin/bin/sln
+
+      # For some reason these aren't stripped otherwise and retain reference
+      # to bootstrap-tools; on cross-arm this stripping would break objects.
+      if [ -z "$crossConfig" ]; then
+        for i in "$out"/lib/*.a; do
+            [ "$i" = "$out/lib/libm.a" ] || strip -S "$i"
+        done
+      fi
+
+      # Put libraries for static linking in a separate output.  Note
+      # that libc_nonshared.a and libpthread_nonshared.a are required
+      # for dynamically-linked applications.
+      mkdir -p $static/lib
+      mv $out/lib/*.a $static/lib
+      mv $static/lib/lib*_nonshared.a $out/lib
+      # Some of *.a files are linker scripts where moving broke the paths.
+      sed "/^GROUP/s|$out/lib/lib|$static/lib/lib|g" \
+        -i "$static"/lib/*.a
+
+      # Work around a Nix bug: hard links across outputs cause a build failure.
+      cp $bin/bin/getconf $bin/bin/getconf_
+      mv $bin/bin/getconf_ $bin/bin/getconf
+    '';
+
+    separateDebugInfo = true;
+
+    meta.description = "The GNU C Library";
+  }
diff --git a/pkgs/development/libraries/glibc/common-2.27.nix b/pkgs/development/libraries/glibc/common-2.27.nix
new file mode 100644
index 000000000000..6c443ebbb932
--- /dev/null
+++ b/pkgs/development/libraries/glibc/common-2.27.nix
@@ -0,0 +1,210 @@
+/* Build configuration used to build glibc, Info files, and locale
+   information.  */
+
+{ stdenv, lib
+, buildPlatform, hostPlatform
+, buildPackages
+, fetchurl
+, linuxHeaders ? null
+, gd ? null, libpng ? null
+, bison
+}:
+
+{ name
+, withLinuxHeaders ? false
+, profilingLibraries ? false
+, installLocales ? false
+, withGd ? false
+, meta
+, ...
+} @ args:
+
+let
+  version = "2.27";
+  patchSuffix = "";
+  sha256 = "0wpwq7gsm7sd6ysidv0z575ckqdg13cr2njyfgrbgh4f65adwwji";
+  cross = if buildPlatform != hostPlatform then hostPlatform else null;
+in
+
+assert withLinuxHeaders -> linuxHeaders != null;
+assert withGd -> gd != null && libpng != null;
+
+stdenv.mkDerivation ({
+  inherit  installLocales;
+  linuxHeaders = if withLinuxHeaders then linuxHeaders else null;
+
+  # The host/target system.
+  crossConfig = if cross != null then cross.config else null;
+
+  inherit (stdenv) is64bit;
+
+  enableParallelBuilding = true;
+
+  patches =
+    [
+      /* Have rpcgen(1) look for cpp(1) in $PATH.  */
+      ./rpcgen-path.patch
+
+      /* Allow NixOS and Nix to handle the locale-archive. */
+      ./nix-locale-archive-2.27.patch
+
+      /* Don't use /etc/ld.so.cache, for non-NixOS systems.  */
+      ./dont-use-system-ld-so-cache-2.27.patch
+
+      /* Don't use /etc/ld.so.preload, but /etc/ld-nix.so.preload.  */
+      ./dont-use-system-ld-so-preload.patch
+
+      /* The command "getconf CS_PATH" returns the default search path
+         "/bin:/usr/bin", which is inappropriate on NixOS machines. This
+         patch extends the search path by "/run/current-system/sw/bin". */
+      ./fix_path_attribute_in_getconf.patch
+
+      /* Allow running with RHEL 6 -like kernels.  The patch adds an exception
+        for glibc to accept 2.6.32 and to tag the ELFs as 2.6.32-compatible
+        (otherwise the loader would refuse libc).
+        Note that glibc will fully work only on their heavily patched kernels
+        and we lose early mismatch detection on 2.6.32.
+
+        On major glibc updates we should check that the patched kernel supports
+        all the required features.  ATM it's verified up to glibc-2.26-131.
+        # HOWTO: check glibc sources for changes in kernel requirements
+        git log -p glibc-2.25.. sysdeps/unix/sysv/linux/x86_64/kernel-features.h sysdeps/unix/sysv/linux/kernel-features.h
+        # get kernel sources (update the URL)
+        mkdir tmp && cd tmp
+        curl http://vault.centos.org/6.9/os/Source/SPackages/kernel-2.6.32-696.el6.src.rpm | rpm2cpio - | cpio -idmv
+        tar xf linux-*.bz2
+        # check syscall presence, for example
+        less linux-*?/arch/x86/kernel/syscall_table_32.S
+       */
+      ./allow-kernel-2.6.32.patch
+    ]
+    ++ lib.optional stdenv.isx86_64 ./fix-x64-abi.patch;
+
+  postPatch =
+    ''
+      # Needed for glibc to build with the gnumake 3.82
+      # http://comments.gmane.org/gmane.linux.lfs.support/31227
+      sed -i 's/ot \$/ot:\n\ttouch $@\n$/' manual/Makefile
+
+      # nscd needs libgcc, and we don't want it dynamically linked
+      # because we don't want it to depend on bootstrap-tools libs.
+      echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile
+    '';
+
+  configureFlags =
+    [ "-C"
+      "--enable-add-ons"
+      "--enable-obsolete-nsl"
+      "--enable-obsolete-rpc"
+      "--sysconfdir=/etc"
+      "--enable-stackguard-randomization"
+      (if withLinuxHeaders
+       then "--with-headers=${linuxHeaders}/include"
+       else "--without-headers")
+      (if profilingLibraries
+       then "--enable-profile"
+       else "--disable-profile")
+    ] ++ lib.optionals withLinuxHeaders [
+      "--enable-kernel=3.2.0" # can't get below with glibc >= 2.26
+    ] ++ lib.optionals (cross != null) [
+      (if cross ? float && cross.float == "soft" then "--without-fp" else "--with-fp")
+    ] ++ lib.optionals (cross != null) [
+      "--with-__thread"
+    ] ++ lib.optionals (cross == null && stdenv.isArm) [
+      "--host=arm-linux-gnueabi"
+      "--build=arm-linux-gnueabi"
+
+      # To avoid linking with -lgcc_s (dynamic link)
+      # so the glibc does not depend on its compiler store path
+      "libc_cv_as_needed=no"
+    ] ++ lib.optional withGd "--with-gd";
+
+  installFlags = [ "sysconfdir=$(out)/etc" ];
+
+  outputs = [ "out" "bin" "dev" "static" ];
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ bison ];
+  buildInputs = lib.optionals withGd [ gd libpng ];
+
+  # Needed to install share/zoneinfo/zone.tab.  Set to impure /bin/sh to
+  # prevent a retained dependency on the bootstrap tools in the stdenv-linux
+  # bootstrap.
+  BASH_SHELL = "/bin/sh";
+}
+
+// (removeAttrs args [ "withLinuxHeaders" "withGd" ]) //
+
+{
+  name = name + "-${version}${patchSuffix}";
+
+  src = fetchurl {
+    url = "mirror://gnu/glibc/glibc-${version}.tar.xz";
+    inherit sha256;
+  };
+
+  # Remove absolute paths from `configure' & co.; build out-of-tree.
+  preConfigure = ''
+    export PWD_P=$(type -tP pwd)
+    for i in configure io/ftwtest-sh; do
+        # Can't use substituteInPlace here because replace hasn't been
+        # built yet in the bootstrap.
+        sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
+    done
+
+    mkdir ../build
+    cd ../build
+
+    configureScript="`pwd`/../$sourceRoot/configure"
+
+    ${lib.optionalString (stdenv.cc.libc != null)
+      ''makeFlags="$makeFlags BUILD_LDFLAGS=-Wl,-rpath,${stdenv.cc.libc}/lib"''
+    }
+
+
+  '' + lib.optionalString (cross != null) ''
+    sed -i s/-lgcc_eh//g "../$sourceRoot/Makeconfig"
+
+    cat > config.cache << "EOF"
+    libc_cv_forced_unwind=yes
+    libc_cv_c_cleanup=yes
+    libc_cv_gnu89_inline=yes
+    EOF
+  '';
+
+  preBuild = lib.optionalString withGd "unset NIX_DONT_SET_RPATH";
+
+  meta = {
+    homepage = http://www.gnu.org/software/libc/;
+    description = "The GNU C Library";
+
+    longDescription =
+      '' Any Unix-like operating system needs a C library: the library which
+         defines the "system calls" and other basic facilities such as
+         open, malloc, printf, exit...
+
+         The GNU C library is used as the C library in the GNU system and
+         most systems with the Linux kernel.
+      '';
+
+    license = lib.licenses.lgpl2Plus;
+
+    maintainers = [ lib.maintainers.eelco ];
+    platforms = lib.platforms.linux;
+  } // meta;
+
+  passthru = { inherit version; };
+}
+
+// lib.optionalAttrs (cross != null) {
+  preInstall = null; # clobber the native hook
+
+  dontStrip = true;
+
+  separateDebugInfo = false; # this is currently broken for crossDrv
+
+  # To avoid a dependency on the build system 'bash'.
+  preFixup = ''
+    rm -f $bin/bin/{ldd,tzselect,catchsegv,xtrace}
+  '';
+})
diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix
index b17d4effb1eb..d40733adf874 100644
--- a/pkgs/development/libraries/glibc/common.nix
+++ b/pkgs/development/libraries/glibc/common.nix
@@ -222,6 +222,6 @@ stdenv.mkDerivation ({
 
   # To avoid a dependency on the build system 'bash'.
   preFixup = ''
-    rm $bin/bin/{ldd,tzselect,catchsegv,xtrace}
+    rm -f $bin/bin/{ldd,tzselect,catchsegv,xtrace}
   '';
 })
diff --git a/pkgs/development/libraries/glibc/dont-use-system-ld-so-cache-2.27.patch b/pkgs/development/libraries/glibc/dont-use-system-ld-so-cache-2.27.patch
new file mode 100644
index 000000000000..f84b1049adf8
--- /dev/null
+++ b/pkgs/development/libraries/glibc/dont-use-system-ld-so-cache-2.27.patch
@@ -0,0 +1,46 @@
+diff -Naur glibc-2.27-orig/elf/ldconfig.c glibc-2.27/elf/ldconfig.c
+--- glibc-2.27-orig/elf/ldconfig.c	2018-02-01 11:17:18.000000000 -0500
++++ glibc-2.27/elf/ldconfig.c	2018-02-17 22:43:17.232175182 -0500
+@@ -51,7 +51,7 @@
+ #endif
+ 
+ #ifndef LD_SO_CONF
+-# define LD_SO_CONF SYSCONFDIR "/ld.so.conf"
++# define LD_SO_CONF PREFIX "/etc/ld.so.conf"
+ #endif
+ 
+ /* Get libc version number.  */
+diff -Naur glibc-2.27-orig/elf/Makefile glibc-2.27/elf/Makefile
+--- glibc-2.27-orig/elf/Makefile	2018-02-01 11:17:18.000000000 -0500
++++ glibc-2.27/elf/Makefile	2018-02-17 22:44:50.334006750 -0500
+@@ -559,13 +559,13 @@
+ 
+ $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
+ 
+-SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
+-CFLAGS-ldconfig.c += $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
++PREFIX-FLAGS := -D'PREFIX="$(prefix)"'
++CFLAGS-ldconfig.c += $(PREFIX-FLAGS) -D'LIBDIR="$(libdir)"' \
+ 		    -D'SLIBDIR="$(slibdir)"'
+ libof-ldconfig = ldconfig
+-CFLAGS-dl-cache.c += $(SYSCONF-FLAGS)
+-CFLAGS-cache.c += $(SYSCONF-FLAGS)
+-CFLAGS-rtld.c += $(SYSCONF-FLAGS)
++CFLAGS-dl-cache.c += $(PREFIX-FLAGS)
++CFLAGS-cache.c += $(PREFIX-FLAGS)
++CFLAGS-rtld.c += $(PREFIX-FLAGS)
+ 
+ cpp-srcs-left := $(all-rtld-routines:=.os)
+ lib := rtld
+diff -Naur glibc-2.27-orig/sysdeps/generic/dl-cache.h glibc-2.27/sysdeps/generic/dl-cache.h
+--- glibc-2.27-orig/sysdeps/generic/dl-cache.h	2018-02-01 11:17:18.000000000 -0500
++++ glibc-2.27/sysdeps/generic/dl-cache.h	2018-02-17 22:45:20.471598816 -0500
+@@ -28,7 +28,7 @@
+ #endif
+ 
+ #ifndef LD_SO_CACHE
+-# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache"
++# define LD_SO_CACHE PREFIX "/etc/ld.so.cache"
+ #endif
+ 
+ #ifndef add_system_dir
diff --git a/pkgs/development/libraries/glibc/locales.nix b/pkgs/development/libraries/glibc/locales.nix
index debd7b39c86a..7090c5ceceec 100644
--- a/pkgs/development/libraries/glibc/locales.nix
+++ b/pkgs/development/libraries/glibc/locales.nix
@@ -6,7 +6,7 @@
    https://sourceware.org/git/?p=glibc.git;a=blob;f=localedata/SUPPORTED
 */
 
-{ stdenv, callPackage, writeText
+{ stdenv, buildPackages, callPackage, writeText
 , allLocales ? true, locales ? [ "en_US.UTF-8/UTF-8" ]
 }:
 
@@ -26,7 +26,7 @@ callPackage ./common.nix { inherit stdenv; } {
   # $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive.
   buildPhase =
     ''
-      mkdir -p $TMPDIR/"${stdenv.cc.libc.out}/lib/locale"
+      mkdir -p $TMPDIR/"${buildPackages.stdenv.cc.libc.out}/lib/locale"
 
       # Hack to allow building of the locales (needed since glibc-2.12)
       sed -i -e 's,^$(rtld-prefix) $(common-objpfx)locale/localedef,localedef --prefix='$TMPDIR',' ../glibc-2*/localedata/Makefile
diff --git a/pkgs/development/libraries/glibc/nix-locale-archive-2.27.patch b/pkgs/development/libraries/glibc/nix-locale-archive-2.27.patch
new file mode 100644
index 000000000000..1b3590db4fdd
--- /dev/null
+++ b/pkgs/development/libraries/glibc/nix-locale-archive-2.27.patch
@@ -0,0 +1,118 @@
+diff -Naur glibc-2.27-orig/locale/loadarchive.c glibc-2.27/locale/loadarchive.c
+--- glibc-2.27-orig/locale/loadarchive.c	2018-02-01 11:17:18.000000000 -0500
++++ glibc-2.27/locale/loadarchive.c	2018-02-17 22:32:25.680169462 -0500
+@@ -123,6 +123,23 @@
+   return MAX (namehash_end, MAX (string_end, locrectab_end));
+ }
+ 
++static int
++open_locale_archive (void)
++{
++  int fd = -1;
++  char *versioned_path = getenv ("LOCAL_ARCHIVE_2_27");
++  char *path = getenv ("LOCAL_ARCHIVE");
++  if (versioned_path)
++    fd = __open_nocancel (versioned_path, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
++  if (path && fd < 0)
++    fd = __open_nocancel (path, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
++  if (fd < 0)
++    fd = __open_nocancel (archfname, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
++  if (fd < 0)
++    fd = __open_nocancel ("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE|O_CLOEXEC);
++  return fd;
++}
++
+ 
+ /* Find the locale *NAMEP in the locale archive, and return the
+    internalized data structure for its CATEGORY data.  If this locale has
+@@ -202,7 +219,7 @@
+       archmapped = &headmap;
+ 
+       /* The archive has never been opened.  */
+-      fd = __open_nocancel (archfname, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
++      fd = open_locale_archive ();
+       if (fd < 0)
+ 	/* Cannot open the archive, for whatever reason.  */
+ 	return NULL;
+@@ -397,8 +414,7 @@
+ 	  if (fd == -1)
+ 	    {
+ 	      struct stat64 st;
+-	      fd = __open_nocancel (archfname,
+-				    O_RDONLY|O_LARGEFILE|O_CLOEXEC);
++	      fd = open_locale_archive ();
+ 	      if (fd == -1)
+ 		/* Cannot open the archive, for whatever reason.  */
+ 		return NULL;
+diff -Naur glibc-2.27-orig/locale/programs/locale.c glibc-2.27/locale/programs/locale.c
+--- glibc-2.27-orig/locale/programs/locale.c	2018-02-01 11:17:18.000000000 -0500
++++ glibc-2.27/locale/programs/locale.c	2018-02-17 22:36:39.726293213 -0500
+@@ -633,6 +633,24 @@
+ 
+ 
+ static int
++open_locale_archive (void)
++{
++  int fd = -1;
++  char *versioned_path = getenv ("LOCAL_ARCHIVE_2_27");
++  char *path = getenv ("LOCAL_ARCHIVE");
++  if (versioned_path)
++    fd = open64 (versioned_path, O_RDONLY);
++  if (path && fd < 0)
++    fd = open64 (path, O_RDONLY);
++  if (fd < 0)
++    fd = open64 (ARCHIVE_NAME, O_RDONLY);
++  if (fd < 0)
++    fd = open64 ("/usr/lib/locale/locale-archive", O_RDONLY);
++  return fd;
++}
++
++
++static int
+ write_archive_locales (void **all_datap, char *linebuf)
+ {
+   struct stat64 st;
+@@ -644,7 +662,7 @@
+   int fd, ret = 0;
+   uint32_t cnt;
+ 
+-  fd = open64 (ARCHIVE_NAME, O_RDONLY);
++  fd = open_locale_archive ();
+   if (fd < 0)
+     return 0;
+ 
+diff -Naur glibc-2.27-orig/locale/programs/locarchive.c glibc-2.27/locale/programs/locarchive.c
+--- glibc-2.27-orig/locale/programs/locarchive.c	2018-02-01 11:17:18.000000000 -0500
++++ glibc-2.27/locale/programs/locarchive.c	2018-02-17 22:40:51.245293975 -0500
+@@ -117,6 +117,22 @@
+ }
+ 
+ 
++static int
++open_locale_archive (const char * archivefname, int flags)
++{
++  int fd = -1;
++  char *versioned_path = getenv ("LOCAL_ARCHIVE_2_27");
++  char *path = getenv ("LOCAL_ARCHIVE");
++  if (versioned_path)
++    fd = open64 (versioned_path, flags);
++  if (path && fd < 0)
++    fd = open64 (path, flags);
++  if (fd < 0)
++    fd = open64 (archivefname, flags);
++  return fd;
++}
++
++
+ static void
+ create_archive (const char *archivefname, struct locarhandle *ah)
+ {
+@@ -578,7 +594,7 @@
+   while (1)
+     {
+       /* Open the archive.  We must have exclusive write access.  */
+-      fd = open64 (archivefname, readonly ? O_RDONLY : O_RDWR);
++      fd = open_locale_archive (archivefname, readonly ? O_RDONLY : O_RDWR);
+       if (fd == -1)
+ 	{
+ 	  /* Maybe the file does not yet exist? If we are opening
diff --git a/pkgs/development/libraries/gnutls-kdh/generic.nix b/pkgs/development/libraries/gnutls-kdh/generic.nix
index 0e8457a8c54b..e7e0672490d0 100644
--- a/pkgs/development/libraries/gnutls-kdh/generic.nix
+++ b/pkgs/development/libraries/gnutls-kdh/generic.nix
@@ -84,7 +84,7 @@ stdenv.mkDerivation {
        layer. It adds TLS-KDH ciphers: Kerberos + Diffie-Hellman.
     '';
 
-    homepage = http://www.gnu.org/software/gnutls://github.com/arpa2/gnutls-kdh;
+    homepage = https://github.com/arpa2/gnutls-kdh;
     license = licenses.lgpl21Plus;
     maintainers = with maintainers; [ leenaars ];
     platforms = platforms.all;
diff --git a/pkgs/development/libraries/granite/default.nix b/pkgs/development/libraries/granite/default.nix
index 4e41545687a9..8243775c6bc1 100644
--- a/pkgs/development/libraries/granite/default.nix
+++ b/pkgs/development/libraries/granite/default.nix
@@ -1,22 +1,42 @@
-{ stdenv, fetchurl, perl, cmake, vala, pkgconfig, gobjectIntrospection, glib, gtk3, gnome3, gettext }:
+{ stdenv, fetchFromGitHub, perl, cmake, ninja, vala, pkgconfig, gobjectIntrospection, glib, gtk3, gnome3, gettext }:
 
 stdenv.mkDerivation rec {
-  majorVersion = "0.4";
-  minorVersion = "1";
-  name = "granite-${majorVersion}.${minorVersion}";
-  src = fetchurl {
-    url = "https://launchpad.net/granite/${majorVersion}/${majorVersion}.${minorVersion}/+download/${name}.tar.xz";
-    sha256 = "177h5h1q4qd7g99mzbczvz78j8c9jf4f1gwdj9f6imbc7r913d4b";
+  name = "granite-${version}";
+  version = "0.5";
+
+  src = fetchFromGitHub {
+    owner = "elementary";
+    repo = "granite";
+    rev = version;
+    sha256 = "15l8z1jkqhvappnr8jww27lfy3dwqybgsxk5iccyvnvzpjdh2s0h";
   };
-  cmakeFlags = "-DINTROSPECTION_GIRDIR=share/gir-1.0/ -DINTROSPECTION_TYPELIBDIR=lib/girepository-1.0";
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [perl cmake vala gobjectIntrospection glib gtk3 gnome3.libgee gettext];
-  meta = {
+
+  cmakeFlags = [
+    "-DINTROSPECTION_GIRDIR=share/gir-1.0/"
+    "-DINTROSPECTION_TYPELIBDIR=lib/girepository-1.0"
+  ];
+
+  nativeBuildInputs = [
+    vala
+    pkgconfig
+    cmake
+    ninja
+    perl
+    gettext
+    gobjectIntrospection
+  ];
+  buildInputs = [
+    glib
+    gtk3
+    gnome3.libgee
+  ];
+
+  meta = with stdenv.lib; {
     description = "An extension to GTK+ used by elementary OS";
     longDescription = "An extension to GTK+ that provides several useful widgets and classes to ease application development. Designed for elementary OS.";
-    homepage = https://launchpad.net/granite;
-    license = stdenv.lib.licenses.lgpl3;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.vozz ];
+    homepage = https://github.com/elementary/granite;
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.vozz ];
   };
 }
diff --git a/pkgs/development/libraries/grpc/default.nix b/pkgs/development/libraries/grpc/default.nix
index 4e6fe783dc2c..f33e52867c56 100644
--- a/pkgs/development/libraries/grpc/default.nix
+++ b/pkgs/development/libraries/grpc/default.nix
@@ -1,19 +1,26 @@
 { stdenv, fetchurl, cmake, zlib, c-ares, pkgconfig, openssl, protobuf, gflags }:
 
-stdenv.mkDerivation rec
-  { name = "grpc-1.8.3";
-    src = fetchurl
-      { url = "https://github.com/grpc/grpc/archive/v1.8.3.tar.gz";
-        sha256 = "14ichjllvhkbv8sjh9j5njnagpqw2sl12n41ga90jnj7qvfwwjy1";
-      };
-    nativeBuildInputs = [ cmake pkgconfig ];
-    buildInputs = [ zlib c-ares c-ares.cmake-config openssl protobuf gflags ];
-    cmakeFlags =
-      [ "-DgRPC_ZLIB_PROVIDER=package"
-        "-DgRPC_CARES_PROVIDER=package"
-        "-DgRPC_SSL_PROVIDER=package"
-        "-DgRPC_PROTOBUF_PROVIDER=package"
-        "-DgRPC_GFLAGS_PROVIDER=package"
-      ];
-    enableParallelBuilds = true;
-  }
+stdenv.mkDerivation rec {
+  version = "1.9.1";
+  name = "grpc-${version}";
+  src = fetchurl {
+    url = "https://github.com/grpc/grpc/archive/v${version}.tar.gz";
+    sha256 = "0h2w0dckxydngva9kl7dpilif8k9zi2ajnlanscr7s5kkza3dhps";
+  };
+  nativeBuildInputs = [ cmake pkgconfig ];
+  buildInputs = [ zlib c-ares c-ares.cmake-config openssl protobuf gflags ];
+  cmakeFlags =
+    [ "-DgRPC_ZLIB_PROVIDER=package"
+      "-DgRPC_CARES_PROVIDER=package"
+      "-DgRPC_SSL_PROVIDER=package"
+      "-DgRPC_PROTOBUF_PROVIDER=package"
+      "-DgRPC_GFLAGS_PROVIDER=package"
+    ];
+  enableParallelBuilds = true;
+
+  meta = with stdenv.lib; {
+    description = "The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)";
+    license = licenses.asl20;
+    homepage = https://grpc.io/;
+  };
+}
diff --git a/pkgs/development/libraries/hunspell/default.nix b/pkgs/development/libraries/hunspell/default.nix
index dfb45aa598d7..ecbfbb7da0b8 100644
--- a/pkgs/development/libraries/hunspell/default.nix
+++ b/pkgs/development/libraries/hunspell/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, ncurses, readline, autoreconfHook }:
 
 stdenv.mkDerivation rec {
-  version = "1.6.1";
+  version = "1.6.2";
   name = "hunspell-${version}";
 
   src = fetchurl {
     url = "https://github.com/hunspell/hunspell/archive/v${version}.tar.gz";
-    sha256 = "0j9c20sj7bgd6f77193g1ihy8w905byk2gdhdc0r9dsh7irr7x9h";
+    sha256 = "1i7lsv2cm0713ia3j5wjkcrhpfp3lqpjpwp4d3v18n7ycaqcxn9w";
   };
 
   outputs = [ "bin" "dev" "out" "man" ];
diff --git a/pkgs/development/libraries/hwloc/default.nix b/pkgs/development/libraries/hwloc/default.nix
index c0745cb9e687..ad39a4fde319 100644
--- a/pkgs/development/libraries/hwloc/default.nix
+++ b/pkgs/development/libraries/hwloc/default.nix
@@ -1,8 +1,9 @@
 { stdenv, fetchurl, pkgconfig, expat, ncurses, pciutils, numactl
-, cairo, libX11
-, x11Support ? (!stdenv.isCygwin)
+, x11Support ? false, libX11 ? null, cairo ? null
 }:
 
+assert x11Support -> libX11 != null && cairo != null;
+
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
diff --git a/pkgs/development/libraries/icu/60.nix b/pkgs/development/libraries/icu/60.nix
new file mode 100644
index 000000000000..e56135b15c62
--- /dev/null
+++ b/pkgs/development/libraries/icu/60.nix
@@ -0,0 +1,4 @@
+import ./base.nix {
+  version = "60.2";
+  sha256 = "065l3n0q9wqaw8dz20x82srshhm6i987fr9ync5xf9mr6n7ylwzh";
+}
diff --git a/pkgs/development/libraries/icu/base.nix b/pkgs/development/libraries/icu/base.nix
index 6d9a9725cc2e..2c8392c8bac8 100644
--- a/pkgs/development/libraries/icu/base.nix
+++ b/pkgs/development/libraries/icu/base.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
   '';
 
   # https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27
-  postPatch = if stdenv ? glibc
+  postPatch = if (stdenv.hostPlatform.libc == "glibc" || stdenv.hostPlatform.libc == "musl")
     then "substituteInPlace i18n/digitlst.cpp --replace '<xlocale.h>' '<locale.h>'"
     else null; # won't find locale_t on darwin
 
diff --git a/pkgs/development/libraries/isl/0.11.1.nix b/pkgs/development/libraries/isl/0.11.1.nix
index 63140dba37f7..e2d7d7ffd034 100644
--- a/pkgs/development/libraries/isl/0.11.1.nix
+++ b/pkgs/development/libraries/isl/0.11.1.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
   name = "isl-0.11.1"; # CLooG 0.16.3 fails to build with ISL 0.08.
 
   src = fetchurl {
-    url = "http://pkgs.fedoraproject.org/repo/pkgs/gcc/isl-0.11.1.tar.bz2/bce1586384d8635a76d2f017fb067cd2/isl-0.11.1.tar.bz2";
+    url = "http://src.fedoraproject.org/repo/pkgs/gcc/isl-0.11.1.tar.bz2/bce1586384d8635a76d2f017fb067cd2/isl-0.11.1.tar.bz2";
     sha256 = "13d9cqa5rzhbjq0xf0b2dyxag7pqa72xj9dhsa03m8ccr1a4npq9";
   };
 
diff --git a/pkgs/development/libraries/java/libmatthew-java/default.nix b/pkgs/development/libraries/java/libmatthew-java/default.nix
index df4a19efd2c4..3b28c3a2bd57 100644
--- a/pkgs/development/libraries/java/libmatthew-java/default.nix
+++ b/pkgs/development/libraries/java/libmatthew-java/default.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation {
   name = "libmatthew-java-0.8";
   src = fetchurl {
-    url = http://pkgs.fedoraproject.org/repo/pkgs/libmatthew-java/libmatthew-java-0.8.tar.gz/8455b8751083ce25c99c2840609271f5/libmatthew-java-0.8.tar.gz;
+    url = http://src.fedoraproject.org/repo/pkgs/libmatthew-java/libmatthew-java-0.8.tar.gz/8455b8751083ce25c99c2840609271f5/libmatthew-java-0.8.tar.gz;
     sha256 = "1yldkhsdzm0a41a0i881bin2jklhp85y3ah245jd6fz3npcx7l85";
   };
   JAVA_HOME=jdk;
diff --git a/pkgs/development/libraries/json-c/0.11.nix b/pkgs/development/libraries/json-c/0.11.nix
index 029921ee08c0..8c4eab9ede6e 100644
--- a/pkgs/development/libraries/json-c/0.11.nix
+++ b/pkgs/development/libraries/json-c/0.11.nix
@@ -6,6 +6,9 @@ stdenv.mkDerivation rec {
     url    = "https://github.com/json-c/json-c/archive/json-c-0.11-20130402.tar.gz";
     sha256 = "1m8fy7lbahv1r7yqbhw4pl057sxmmgjihm1fsvc3h66710s2i24r";
   };
+
+  NIX_CFLAGS_COMPILE = [ "-Wno-error=implicit-fallthrough" ];
+
   meta = with stdenv.lib; {
     description = "A JSON implementation in C";
     homepage    = https://github.com/json-c/json-c/wiki;
diff --git a/pkgs/development/libraries/json-c/default.nix b/pkgs/development/libraries/json-c/default.nix
index b8c72d9669e0..7317efc53f86 100644
--- a/pkgs/development/libraries/json-c/default.nix
+++ b/pkgs/development/libraries/json-c/default.nix
@@ -11,6 +11,9 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook ]; # won't configure without it, no idea why
 
+  # probably OK after update: https://github.com/json-c/json-c/pull/365
+  NIX_CFLAGS_COMPILE = [ "-Wno-error=implicit-fallthrough" ];
+
   # compatibility hack (for mypaint at least)
   postInstall = ''
     ln -s json-c.pc "$dev/lib/pkgconfig/json.pc"
diff --git a/pkgs/development/libraries/kde-frameworks/fetch.sh b/pkgs/development/libraries/kde-frameworks/fetch.sh
index 119abbe9f530..d4901ba4233b 100644
--- a/pkgs/development/libraries/kde-frameworks/fetch.sh
+++ b/pkgs/development/libraries/kde-frameworks/fetch.sh
@@ -1 +1 @@
-WGET_ARGS=( https://download.kde.org/stable/frameworks/5.42/ -A '*.tar.xz' )
+WGET_ARGS=( https://download.kde.org/stable/frameworks/5.43/ -A '*.tar.xz' )
diff --git a/pkgs/development/libraries/kde-frameworks/kglobalaccel.nix b/pkgs/development/libraries/kde-frameworks/kglobalaccel.nix
index 05fde45f17d2..ae945ab73384 100644
--- a/pkgs/development/libraries/kde-frameworks/kglobalaccel.nix
+++ b/pkgs/development/libraries/kde-frameworks/kglobalaccel.nix
@@ -13,8 +13,4 @@ mkDerivation {
     qtx11extras
   ];
   propagatedBuildInputs = [ qtbase ];
-  postPatch = ''
-    sed -i src/runtime/org.kde.kglobalaccel.service.in \
-        -e "s|@CMAKE_INSTALL_PREFIX@|''${!outputBin}|"
-  '';
 }
diff --git a/pkgs/development/libraries/kde-frameworks/plasma-framework.nix b/pkgs/development/libraries/kde-frameworks/plasma-framework.nix
index a2a90e448d49..44005ec7d282 100644
--- a/pkgs/development/libraries/kde-frameworks/plasma-framework.nix
+++ b/pkgs/development/libraries/kde-frameworks/plasma-framework.nix
@@ -4,7 +4,7 @@
   kactivities, karchive, kconfig, kconfigwidgets, kcoreaddons, kdbusaddons,
   kdeclarative, kglobalaccel, kguiaddons, ki18n, kiconthemes, kio,
   knotifications, kpackage, kservice, kwayland, kwindowsystem, kxmlgui,
-  qtbase, qtdeclarative, qtscript, qtx11extras, kirigami2
+  qtbase, qtdeclarative, qtscript, qtx11extras, kirigami2, qtquickcontrols2
 }:
 
 mkDerivation {
@@ -15,6 +15,7 @@ mkDerivation {
     kactivities karchive kconfig kconfigwidgets kcoreaddons kdbusaddons
     kdeclarative kglobalaccel kguiaddons ki18n kiconthemes kio knotifications
     kwayland kwindowsystem kxmlgui qtdeclarative qtscript qtx11extras kirigami2
+    qtquickcontrols2
   ];
   propagatedBuildInputs = [ kpackage kservice qtbase ];
 }
diff --git a/pkgs/development/libraries/kde-frameworks/srcs.nix b/pkgs/development/libraries/kde-frameworks/srcs.nix
index f8d4bcf5c8f9..af01f6faef64 100644
--- a/pkgs/development/libraries/kde-frameworks/srcs.nix
+++ b/pkgs/development/libraries/kde-frameworks/srcs.nix
@@ -3,611 +3,627 @@
 
 {
   attica = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/attica-5.42.0.tar.xz";
-      sha256 = "0icjsk5sbri6nwybb2301wc6ysc1h4p35rxqp0adifyksq8akyxd";
-      name = "attica-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/attica-5.43.0.tar.xz";
+      sha256 = "1vvf5d0dnfm69gahrhndy9jqxk7hkh5vj6z9pyprpl3zp5z1ki1a";
+      name = "attica-5.43.0.tar.xz";
     };
   };
   baloo = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/baloo-5.42.0.tar.xz";
-      sha256 = "18yknkcls1ypsp8n5l254bhlffiq4as5w1wgcjzhnf49cacys8nl";
-      name = "baloo-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/baloo-5.43.0.tar.xz";
+      sha256 = "095z6w5qyq4z2hkdxq0vizfgv1v6g9w960wrh78b6bi1bf4ig2np";
+      name = "baloo-5.43.0.tar.xz";
     };
   };
   bluez-qt = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/bluez-qt-5.42.0.tar.xz";
-      sha256 = "0pbb0nn70hbsnp9q8jvqr3s85gh4bnnh1mp8xfkia2hp4c63ws9f";
-      name = "bluez-qt-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/bluez-qt-5.43.0.tar.xz";
+      sha256 = "04bsrp0biyn7b630hywk82rwn8kl8c2rwh8iwhjz35b51jjqm2b5";
+      name = "bluez-qt-5.43.0.tar.xz";
     };
   };
   breeze-icons = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/breeze-icons-5.42.0.tar.xz";
-      sha256 = "0mrj0b022yfy669qqby09k4ij6aqyky23gpnjcp85df9saq0x44r";
-      name = "breeze-icons-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/breeze-icons-5.43.0.tar.xz";
+      sha256 = "19yy6pcqjfbjxlkkf4g1hcgl3lv4m640sl26nblrydn9qyj5iniy";
+      name = "breeze-icons-5.43.0.tar.xz";
     };
   };
   extra-cmake-modules = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/extra-cmake-modules-5.42.0.tar.xz";
-      sha256 = "1ml6s3ssr5izm3vnzlg5gn2nkcbz5l5nmapvyr4ml7n0089b43a3";
-      name = "extra-cmake-modules-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/extra-cmake-modules-5.43.0.tar.xz";
+      sha256 = "1zgzjh5q1ppgfzj4mhprgd4848iwjnzqsnilb0dk5rgdrvfsamsp";
+      name = "extra-cmake-modules-5.43.0.tar.xz";
     };
   };
   frameworkintegration = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/frameworkintegration-5.42.0.tar.xz";
-      sha256 = "17fyny3c5chv7bipr19ayfjmd1amp2nms4ba5r7mwjp97xkphry7";
-      name = "frameworkintegration-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/frameworkintegration-5.43.0.tar.xz";
+      sha256 = "0qjpk4lslpxqj5aisczm5kl201g4z3grgjhx38r1ih4hyp805vw0";
+      name = "frameworkintegration-5.43.0.tar.xz";
     };
   };
   kactivities = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kactivities-5.42.0.tar.xz";
-      sha256 = "0z0ac426npq99s1b8yzrqkjjjc34nbxlpw8pw388yj7fa41hw21r";
-      name = "kactivities-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kactivities-5.43.0.tar.xz";
+      sha256 = "0rmmyjfgz8ybvdgpbqndsn0gxizxpmwhvglnnl8ia1s4sna6sjby";
+      name = "kactivities-5.43.0.tar.xz";
     };
   };
   kactivities-stats = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kactivities-stats-5.42.0.tar.xz";
-      sha256 = "0si70hayf4brr83jzdjdsfvp8nc1sb7vdk0q532liafhf8hw9mq8";
-      name = "kactivities-stats-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kactivities-stats-5.43.0.tar.xz";
+      sha256 = "1rrn1dxsiyvyf3pa5fyxa0sfbamv5c6g95s4f144xwrx2b130rh1";
+      name = "kactivities-stats-5.43.0.tar.xz";
     };
   };
   kapidox = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kapidox-5.42.0.tar.xz";
-      sha256 = "0izyd66p5403gl09l7irzy97mb9b14n4zyjrwap800zjlpwh41pz";
-      name = "kapidox-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kapidox-5.43.0.tar.xz";
+      sha256 = "0c358ply0qzg269vxyg6py6l8z5j8l4h6apqcynyql4dbbbm8941";
+      name = "kapidox-5.43.0.tar.xz";
     };
   };
   karchive = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/karchive-5.42.0.tar.xz";
-      sha256 = "1vq2ngdxmdl6hzjwdcrv66ban8v9s5jiqwy1mgdqv4ak14l31qbi";
-      name = "karchive-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/karchive-5.43.0.tar.xz";
+      sha256 = "1f3pqhpdgn00ni05iflyydkmsf3vd403ma5f42zj00kh30l9lqqf";
+      name = "karchive-5.43.0.tar.xz";
     };
   };
   kauth = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kauth-5.42.0.tar.xz";
-      sha256 = "04kqb2hhr9lkpkxiaqlnyk0kmk6p89z5fgp5i5g83hsi8maz7swi";
-      name = "kauth-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kauth-5.43.0.tar.xz";
+      sha256 = "05w8vx45mrf32kzcyjmay1k9dw3j8axbrrp6infg0hhfsgk04w1f";
+      name = "kauth-5.43.0.tar.xz";
     };
   };
   kbookmarks = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kbookmarks-5.42.0.tar.xz";
-      sha256 = "08q413mr5ib04gwnqznvm9vkkfmnh16rgf6rqdvclnci9w7ml5x2";
-      name = "kbookmarks-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kbookmarks-5.43.0.tar.xz";
+      sha256 = "0i7rfahn32m6xpbwra5m5nnpgq8l56jm0ijsq6f80cx8ww3nkcq5";
+      name = "kbookmarks-5.43.0.tar.xz";
     };
   };
   kcmutils = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kcmutils-5.42.0.tar.xz";
-      sha256 = "1q67b0m6w3xvm22kq8b0b0rib1jzf25gf6dz7h286987zfbbs5n7";
-      name = "kcmutils-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kcmutils-5.43.0.tar.xz";
+      sha256 = "1dshx859k64yp00s5xx7z6x0wlawxyq41rg795nqizhk2s76agr2";
+      name = "kcmutils-5.43.0.tar.xz";
     };
   };
   kcodecs = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kcodecs-5.42.0.tar.xz";
-      sha256 = "0b19z432r9dnyjknvwffhcmrg969yhydjvy4qrkrf22026f4smwc";
-      name = "kcodecs-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kcodecs-5.43.0.tar.xz";
+      sha256 = "0ncrzxvy2l324yvlzha9hkyp5qq75wfb9cbnxb5mygispxhrgh2v";
+      name = "kcodecs-5.43.0.tar.xz";
     };
   };
   kcompletion = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kcompletion-5.42.0.tar.xz";
-      sha256 = "0yqci2v0dk5v1mz4n3gca599a7mpihy563zc6sl8hsa30ld8li0f";
-      name = "kcompletion-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kcompletion-5.43.0.tar.xz";
+      sha256 = "065nzw26ps367lf3m1j6x95swk0f6grap71wjjv688gablcaz699";
+      name = "kcompletion-5.43.0.tar.xz";
     };
   };
   kconfig = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kconfig-5.42.0.tar.xz";
-      sha256 = "08gg0d20c09j7hyxm8ydpzk2yf30c87g9ag7a9nfykrmi6cqirdq";
-      name = "kconfig-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kconfig-5.43.0.tar.xz";
+      sha256 = "1na1b2dsajl9b9rn2990fd8cqqaj2iwddrxjacbf0ib5mray1sr2";
+      name = "kconfig-5.43.0.tar.xz";
     };
   };
   kconfigwidgets = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kconfigwidgets-5.42.0.tar.xz";
-      sha256 = "191zm24q2n001b65hcnfh2639k4iqhxwdmgdw29php3n2648xq4z";
-      name = "kconfigwidgets-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kconfigwidgets-5.43.0.tar.xz";
+      sha256 = "1qxv8m614y0j687gwcsqqkwcdwsbbwc7ivwx6l9djll4r7r1d43w";
+      name = "kconfigwidgets-5.43.0.tar.xz";
     };
   };
   kcoreaddons = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kcoreaddons-5.42.0.tar.xz";
-      sha256 = "17qv7r6z72mm9a0hyx5dgk90ikhhgm41bkvnq2hjal0py2lsnrs9";
-      name = "kcoreaddons-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kcoreaddons-5.43.0.tar.xz";
+      sha256 = "10pgja1v2x5q6jyajld3yq116g1m90djnbf6p35i6n9ng65h0zy6";
+      name = "kcoreaddons-5.43.0.tar.xz";
     };
   };
   kcrash = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kcrash-5.42.0.tar.xz";
-      sha256 = "049y0xdyw37y0qid3d3plj8szfys5gw98j7lhcakiini8mn5cins";
-      name = "kcrash-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kcrash-5.43.0.tar.xz";
+      sha256 = "1hvfhr3s0igc1n37w5fxx0jivsgvcdvpa5iywnkk4g1r1l6snx1b";
+      name = "kcrash-5.43.0.tar.xz";
     };
   };
   kdbusaddons = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kdbusaddons-5.42.0.tar.xz";
-      sha256 = "1613pc3r70jnzvpwm1xjdbdsmcpx28jwvcs2qq9swlywr5qr9hbd";
-      name = "kdbusaddons-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kdbusaddons-5.43.0.tar.xz";
+      sha256 = "1h4m6ra1cangvqyzmkxkh1fld4rlvxnzz8wny53drgbyrsq2xxv5";
+      name = "kdbusaddons-5.43.0.tar.xz";
     };
   };
   kdeclarative = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kdeclarative-5.42.0.tar.xz";
-      sha256 = "1w604jy6vg2247vggz0ivl7wy2h5iapkz2z86mah3aw99f7dqa22";
-      name = "kdeclarative-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kdeclarative-5.43.0.tar.xz";
+      sha256 = "0jbm2ih9hzpnfaqc867fvwr414q78f9jjk6yyf1cjgq8vx8rmjq1";
+      name = "kdeclarative-5.43.0.tar.xz";
     };
   };
   kded = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kded-5.42.0.tar.xz";
-      sha256 = "0w25dl4pnvby28gz0yvij32vi9n3p8si4nm4x45j7zsi2cb70j4l";
-      name = "kded-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kded-5.43.0.tar.xz";
+      sha256 = "1kfli2f4hxc9a0hk75kgln3x374y4av6hfajhncwyq37zd4wxq3r";
+      name = "kded-5.43.0.tar.xz";
     };
   };
   kdelibs4support = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/portingAids/kdelibs4support-5.42.0.tar.xz";
-      sha256 = "0aiig8akn6bdxrqdl96xjjy2pxw8hhfrsalbkkzyhh06j794snfb";
-      name = "kdelibs4support-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/portingAids/kdelibs4support-5.43.0.tar.xz";
+      sha256 = "1rwk436vpny3sq12bjqwapjicc3inyrq6dn34a6mr6gjcd5p2mch";
+      name = "kdelibs4support-5.43.0.tar.xz";
     };
   };
   kdesignerplugin = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kdesignerplugin-5.42.0.tar.xz";
-      sha256 = "004axa1fkj954d65x7l9z8dmw04209hb368rwa4gjzb8naf13ib6";
-      name = "kdesignerplugin-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kdesignerplugin-5.43.0.tar.xz";
+      sha256 = "0pk95vsgj67jw0qaalcrfvzkr9flxh6shkkmlaxclrz6yhnf9axz";
+      name = "kdesignerplugin-5.43.0.tar.xz";
     };
   };
   kdesu = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kdesu-5.42.0.tar.xz";
-      sha256 = "0402p1h7wifk6sppg7ca9w0zfjllbhc1j5gsxj7ypq55g94np7hx";
-      name = "kdesu-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kdesu-5.43.0.tar.xz";
+      sha256 = "1mll18ms5zk7i4lpkj6qdcxwaf0h52h9mi47y882hzqkvvbnk4d6";
+      name = "kdesu-5.43.0.tar.xz";
     };
   };
   kdewebkit = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kdewebkit-5.42.0.tar.xz";
-      sha256 = "1csd4p996im7ygxc5rfdkzgdpngjgzyqakj12rl9rnfbsd15i8kb";
-      name = "kdewebkit-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kdewebkit-5.43.0.tar.xz";
+      sha256 = "0yi7dv77flz7z1yjzlvrfvlybp7knz808hpfbr6hxgrp1gwi7h6b";
+      name = "kdewebkit-5.43.0.tar.xz";
     };
   };
   kdnssd = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kdnssd-5.42.0.tar.xz";
-      sha256 = "1k1rz62h3mafliik5n0k98dc56b5v2v6qyqj40696mcyc2d1yvll";
-      name = "kdnssd-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kdnssd-5.43.0.tar.xz";
+      sha256 = "0d58aaii1r2x3nmw9s2hnk178sr54yvrqi22ry3xm3v7yvx9jr3b";
+      name = "kdnssd-5.43.0.tar.xz";
     };
   };
   kdoctools = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kdoctools-5.42.0.tar.xz";
-      sha256 = "1bby3avdllch1mji0mxzcix8q5yir5a0i6wpjs5lwckv1glh6kmz";
-      name = "kdoctools-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kdoctools-5.43.0.tar.xz";
+      sha256 = "1llif166p17ffjwsgvb0n9lq8ip3if0hqma9zm9jpghm5j21q1jh";
+      name = "kdoctools-5.43.0.tar.xz";
     };
   };
   kemoticons = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kemoticons-5.42.0.tar.xz";
-      sha256 = "0f6an1bwxnga41a2b35b2pdcni4p0hh76k4jvanl3g046v07f2wr";
-      name = "kemoticons-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kemoticons-5.43.0.tar.xz";
+      sha256 = "161n9xg82gxvl4a4by328llxz0x4w643vcxi88414zg1bm1z1cfb";
+      name = "kemoticons-5.43.0.tar.xz";
     };
   };
   kfilemetadata = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kfilemetadata-5.42.0.tar.xz";
-      sha256 = "03wk38q3sq354ykz9dwbgykn73ldf94ryx6hxvpr66bq3a59jmwz";
-      name = "kfilemetadata-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kfilemetadata-5.43.0.tar.xz";
+      sha256 = "1lxbj8fnaf6sybxgyq6h1qnic65l0mdhhxlw1djd16c7ih7ghrnq";
+      name = "kfilemetadata-5.43.0.tar.xz";
     };
   };
   kglobalaccel = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kglobalaccel-5.42.0.tar.xz";
-      sha256 = "0nlza73i0qd79yhwhpnvgbh2xa9lvd1n2xg25p3bvfzwidcfdxg6";
-      name = "kglobalaccel-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kglobalaccel-5.43.0.tar.xz";
+      sha256 = "00ygkszkklaz7k4hkshcb5gfynha8rncwvj7z9jvhd9chmwkiffc";
+      name = "kglobalaccel-5.43.0.tar.xz";
     };
   };
   kguiaddons = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kguiaddons-5.42.0.tar.xz";
-      sha256 = "193i8b4f13dkgp88m3pk9wzi0dhx7qmsnmpizxia3457gg016wn7";
-      name = "kguiaddons-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kguiaddons-5.43.0.tar.xz";
+      sha256 = "0z6sf4pr4ykhlzdckyfap2f41y2chrl2kwlrb4djflfxf7q2xcqr";
+      name = "kguiaddons-5.43.0.tar.xz";
+    };
+  };
+  kholidays = {
+    version = "5.43.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.43/kholidays-5.43.0.tar.xz";
+      sha256 = "0zkjh7y0gdwakil6dj0z8yi2zzczzvdfhmnsd54s5yn0fvv37xbk";
+      name = "kholidays-5.43.0.tar.xz";
     };
   };
   khtml = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/portingAids/khtml-5.42.0.tar.xz";
-      sha256 = "1bfslndxvad0zgzr22w2mz1xwavix9bh5qrrv8dpshlh043bwr3l";
-      name = "khtml-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/portingAids/khtml-5.43.0.tar.xz";
+      sha256 = "034aycdi7i6pvwkwz632nzk3vp8040hlvmzpp38nsy4idl4klh46";
+      name = "khtml-5.43.0.tar.xz";
     };
   };
   ki18n = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/ki18n-5.42.0.tar.xz";
-      sha256 = "1rpriflb2a48j94zxgh63l6rzq4nlnlkvy89ns1vkdw42bnqrjx9";
-      name = "ki18n-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/ki18n-5.43.0.tar.xz";
+      sha256 = "1zspxv6z4a3rarrn9n38g7rp0gc48bl4kih91m3r2nkap83jb04a";
+      name = "ki18n-5.43.0.tar.xz";
     };
   };
   kiconthemes = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kiconthemes-5.42.0.tar.xz";
-      sha256 = "1nbxxpf8bv835xl35b17rk8s3zs110bh31078kqqh7dhvwzlxic7";
-      name = "kiconthemes-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kiconthemes-5.43.0.tar.xz";
+      sha256 = "105c892d4np4lshmd5f5x74m1ib3fbmvwgjzf6j317mq261r3rsw";
+      name = "kiconthemes-5.43.0.tar.xz";
     };
   };
   kidletime = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kidletime-5.42.0.tar.xz";
-      sha256 = "019r41r28pcrcn1kwxsll53za705jkc9n23b6sr2lplgjk05bcxh";
-      name = "kidletime-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kidletime-5.43.0.tar.xz";
+      sha256 = "1jm2rdbzffnw0fv1pzfyz5lvzaa3x2pfp12zm9kl7skyj39z5vbj";
+      name = "kidletime-5.43.0.tar.xz";
     };
   };
   kimageformats = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kimageformats-5.42.0.tar.xz";
-      sha256 = "1k67yrmszx7azjzrg478rimbz991lghx4d6dmg22p6dknajd78a6";
-      name = "kimageformats-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kimageformats-5.43.0.tar.xz";
+      sha256 = "1bn4rx5xx68m101n3ba774pd8qddaw3bwf2bc7zp7gi6d8bprh9i";
+      name = "kimageformats-5.43.0.tar.xz";
     };
   };
   kinit = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kinit-5.42.0.tar.xz";
-      sha256 = "05vpac41pw1n8y58l2z08vyknzv950x8dxxw66dnymm2v31w07ia";
-      name = "kinit-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kinit-5.43.0.tar.xz";
+      sha256 = "1jrzr4kv84rvf214wszd2zdnvlx2qxvr1ah9f564h23vvdrg79gd";
+      name = "kinit-5.43.0.tar.xz";
     };
   };
   kio = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kio-5.42.0.tar.xz";
-      sha256 = "1526a89x11ank55dp3rfp7xd04w8x7prjg3y6i7n2q9nabwhw7gc";
-      name = "kio-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kio-5.43.0.tar.xz";
+      sha256 = "1mbjld1kh5hhslfm4rx9nddghkcgrxbw2pf39c7niq0r1llx5v76";
+      name = "kio-5.43.0.tar.xz";
     };
   };
   kirigami2 = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kirigami2-5.42.0.tar.xz";
-      sha256 = "11gqn7amp0r9bgh8ldgisfc2lrkzkn5mq2a1madf24nvjbkvqnqv";
-      name = "kirigami2-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kirigami2-5.43.0.tar.xz";
+      sha256 = "0vshabb1q5pjscw0g57l7lpaal69g1mdpf01w0yskmbiqnzzpjl0";
+      name = "kirigami2-5.43.0.tar.xz";
     };
   };
   kitemmodels = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kitemmodels-5.42.0.tar.xz";
-      sha256 = "0mcdzdqwmvf9pwirsrnjbhrgqphnfmanbl9zij4qsmin8n866mhc";
-      name = "kitemmodels-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kitemmodels-5.43.0.tar.xz";
+      sha256 = "1yw7h7g0knlljizsf9cir196v22cqhlaazmrbm6jqz198g47sqdd";
+      name = "kitemmodels-5.43.0.tar.xz";
     };
   };
   kitemviews = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kitemviews-5.42.0.tar.xz";
-      sha256 = "1j1q0b08f8mnfc3r2a7rplyb2nv9f0aq5a3fxskinvg70c6y248w";
-      name = "kitemviews-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kitemviews-5.43.0.tar.xz";
+      sha256 = "19w6xhhxr7w40baw6i6lfq0fd7bahxfzr7pj10mrwb5i6bcbsk1h";
+      name = "kitemviews-5.43.0.tar.xz";
     };
   };
   kjobwidgets = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kjobwidgets-5.42.0.tar.xz";
-      sha256 = "1m3csdl7wh18ywv5p0qpbjpixvflgjcq3yvk3vlvh0sxxlwcz8k4";
-      name = "kjobwidgets-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kjobwidgets-5.43.0.tar.xz";
+      sha256 = "1kri6z737abwsglh29bh4kckbf1ici8n162lcyvw8b3w91l4dyc6";
+      name = "kjobwidgets-5.43.0.tar.xz";
     };
   };
   kjs = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/portingAids/kjs-5.42.0.tar.xz";
-      sha256 = "1m26sb2qyrcgmpkw76k2yv5my2pkhld96vw6aaqm77q90faw734g";
-      name = "kjs-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/portingAids/kjs-5.43.0.tar.xz";
+      sha256 = "1jdqdy1kxarv6k31yd0k280jyfy7y3qwgd9c7is7aya1ns46nx59";
+      name = "kjs-5.43.0.tar.xz";
     };
   };
   kjsembed = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/portingAids/kjsembed-5.42.0.tar.xz";
-      sha256 = "10w4w4ncwr245bv1ii4sh154w91ghfz0l60k89j50lsydpcqcp3a";
-      name = "kjsembed-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/portingAids/kjsembed-5.43.0.tar.xz";
+      sha256 = "11hcwwhkrl7sns4s36nxnp550n9xvky1rkrissm0mqh76309g6hy";
+      name = "kjsembed-5.43.0.tar.xz";
     };
   };
   kmediaplayer = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/portingAids/kmediaplayer-5.42.0.tar.xz";
-      sha256 = "1k1pjc0cz36gs0pl2pxw8f9f82xkbqyy320nfyhan5waxbl1qd5n";
-      name = "kmediaplayer-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/portingAids/kmediaplayer-5.43.0.tar.xz";
+      sha256 = "1q1s5v3fqnmxx58ixgdhkhrgkrdxy8mq8hg4ll7l6038lgycfsxf";
+      name = "kmediaplayer-5.43.0.tar.xz";
     };
   };
   knewstuff = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/knewstuff-5.42.0.tar.xz";
-      sha256 = "0i2gmyp67xzf2m5wnv7v574q3gsp1yxfflv1jgl0wy57vchwn9g6";
-      name = "knewstuff-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/knewstuff-5.43.0.tar.xz";
+      sha256 = "1v3wzydi1jqb9an2bnxzfhwxhlb2lj8l735mdhym4859njj8x7w7";
+      name = "knewstuff-5.43.0.tar.xz";
     };
   };
   knotifications = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/knotifications-5.42.0.tar.xz";
-      sha256 = "0awmwypmd104vhaj2v9k83niflxj26d4mbl6mzfcj75lgka6kffc";
-      name = "knotifications-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/knotifications-5.43.0.tar.xz";
+      sha256 = "0kgn5h38z9xd5a210w989j3z0khs4l9ahf19lqfara1ziwl4gaiv";
+      name = "knotifications-5.43.0.tar.xz";
     };
   };
   knotifyconfig = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/knotifyconfig-5.42.0.tar.xz";
-      sha256 = "1h07bjj71611v6912m5ajli6qszh9w925zqbk3vih8rn6pd2s3mc";
-      name = "knotifyconfig-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/knotifyconfig-5.43.0.tar.xz";
+      sha256 = "0nrjxs263sp64h9pmrmr7fjkbpkalzr6crpyq0aqclciwfjpj326";
+      name = "knotifyconfig-5.43.0.tar.xz";
     };
   };
   kpackage = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kpackage-5.42.0.tar.xz";
-      sha256 = "10amhh07x8d0jkyylb19cyzjs71k8dq1y8isfahqzb2kd43vijqa";
-      name = "kpackage-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kpackage-5.43.0.tar.xz";
+      sha256 = "1nr7zkqp7zbvyrhc7iqznyqnfhmnqhhaqs30ig4gwsagq3x2a02b";
+      name = "kpackage-5.43.0.tar.xz";
     };
   };
   kparts = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kparts-5.42.0.tar.xz";
-      sha256 = "1mb5gp2ckmmrb4ym7cqvyl81wnp7cryk85gmizl7cnn69svlf40h";
-      name = "kparts-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kparts-5.43.0.tar.xz";
+      sha256 = "09i2ds6xgkbm9k9nd9yj1p3qw9xl3a25lh97ln9c39ccx32i32wd";
+      name = "kparts-5.43.0.tar.xz";
     };
   };
   kpeople = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kpeople-5.42.0.tar.xz";
-      sha256 = "050km3rpx58acx2341si46lxc2hywa59m8rwd849c2dnsxw3w1hm";
-      name = "kpeople-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kpeople-5.43.0.tar.xz";
+      sha256 = "0xi6sxprqvmjc30cw1rfpryahid9dswql6b1wrdv5wsmci8k4xmq";
+      name = "kpeople-5.43.0.tar.xz";
     };
   };
   kplotting = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kplotting-5.42.0.tar.xz";
-      sha256 = "109b9grshrwralyp8ilkbf1k0akaggygqh6wafqdf0ris0ps13l9";
-      name = "kplotting-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kplotting-5.43.0.tar.xz";
+      sha256 = "0d5mf5xaysw837ninvdx1hfra8qjaxd9lcm28fyjfm506iq8v09f";
+      name = "kplotting-5.43.0.tar.xz";
     };
   };
   kpty = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kpty-5.42.0.tar.xz";
-      sha256 = "07s16zxs03ixy7yxy9fda83yqhcgqzx42gnvwjwkyc8q05njmma6";
-      name = "kpty-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kpty-5.43.0.tar.xz";
+      sha256 = "09m02ramzk6jc9scnsvcm2sgnia2vmnnfgmjsddspc2kp1aj2km8";
+      name = "kpty-5.43.0.tar.xz";
     };
   };
   kross = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/portingAids/kross-5.42.0.tar.xz";
-      sha256 = "1aqqwby6jslimpvx42d4n6gjsjc8l82gmsq5ajpv9zkkk91dqfqi";
-      name = "kross-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/portingAids/kross-5.43.0.tar.xz";
+      sha256 = "05px64msss6as0pbrpl6l4y2n97kayphxqhwfilgsj9yjmyhm46h";
+      name = "kross-5.43.0.tar.xz";
     };
   };
   krunner = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/krunner-5.42.0.tar.xz";
-      sha256 = "0xh9kss67l09am1ilsr9zyx1yhlmaq3g9x60hw0sx7h7wrl6zsw6";
-      name = "krunner-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/krunner-5.43.0.tar.xz";
+      sha256 = "1wiaaz7wc2ls0gxyyws7cw6gmphkzayhdz1xxsyn4bzrc1h3z7dw";
+      name = "krunner-5.43.0.tar.xz";
     };
   };
   kservice = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kservice-5.42.0.tar.xz";
-      sha256 = "0z8zfpd00ndvkm1klp8l4mrcksshhyg280zgmg3gffz5rgh3gwri";
-      name = "kservice-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kservice-5.43.0.tar.xz";
+      sha256 = "1mdxd8kxawlhrsnd9lrx6cx9p8gvvsr9mx2d1s0bi90kapfqyqi3";
+      name = "kservice-5.43.0.tar.xz";
     };
   };
   ktexteditor = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/ktexteditor-5.42.0.tar.xz";
-      sha256 = "020y3j6vm15sfpiwainr3qsx9i93j15mrvq523wmbmdj1z36yrh2";
-      name = "ktexteditor-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/ktexteditor-5.43.0.tar.xz";
+      sha256 = "1rhw1y0js2vjjp7c9f539lvqvci4nrgdicaypw3p5ndg8vsw2xag";
+      name = "ktexteditor-5.43.0.tar.xz";
     };
   };
   ktextwidgets = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/ktextwidgets-5.42.0.tar.xz";
-      sha256 = "088azbv95ycwxmxxw4l63i2l14fmn8l473pb4djh2mvz1ypfqayk";
-      name = "ktextwidgets-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/ktextwidgets-5.43.0.tar.xz";
+      sha256 = "0h5bxf1a9mik2p2xhnm7nnr0r54s6zf4cby4qd8nlwl292dyf8gy";
+      name = "ktextwidgets-5.43.0.tar.xz";
     };
   };
   kunitconversion = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kunitconversion-5.42.0.tar.xz";
-      sha256 = "0219pna4l3vvhyf5acsc87n48jzdnws6kwyhaiy3hy1pzrilv32l";
-      name = "kunitconversion-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kunitconversion-5.43.0.tar.xz";
+      sha256 = "14syfc9vybmaais740xmb79g7ffpyanwkb2blar88zm810dpshqd";
+      name = "kunitconversion-5.43.0.tar.xz";
     };
   };
   kwallet = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kwallet-5.42.0.tar.xz";
-      sha256 = "1kv3v7593srfn0wd7qp4rhvb30rxp7d2qmlwi0n4nc9s6v59pabn";
-      name = "kwallet-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kwallet-5.43.0.tar.xz";
+      sha256 = "01mxl06nbpgkp6dva1kvqcbhjahgjqkbql6rhwgdyhb4asabnsmj";
+      name = "kwallet-5.43.0.tar.xz";
     };
   };
   kwayland = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kwayland-5.42.0.tar.xz";
-      sha256 = "0wr6ygppahxsx3dh71h2wmybv7z7iyqdv7wn80cxb0mp4zpyinh7";
-      name = "kwayland-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kwayland-5.43.0.tar.xz";
+      sha256 = "0glp9bnv53jjycwni0ywd7apr0jps3j0hpzs14y2v9bp4mwjgaji";
+      name = "kwayland-5.43.0.tar.xz";
     };
   };
   kwidgetsaddons = {
-    version = "5.42.1";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kwidgetsaddons-5.42.1.tar.xz";
-      sha256 = "0h0vfrfl5zi01fpvmd825kazzlyawz3i66qrfkymdrnvqmfzcmlg";
-      name = "kwidgetsaddons-5.42.1.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kwidgetsaddons-5.43.0.tar.xz";
+      sha256 = "15x7k953jj6vqmb2bbw4wad2n10akkg4i5n0gmkj4fsaiag359sr";
+      name = "kwidgetsaddons-5.43.0.tar.xz";
     };
   };
   kwindowsystem = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kwindowsystem-5.42.0.tar.xz";
-      sha256 = "15k6x0f93qxka3mz7qfzak2ibdd88q77pz6akil8s3g41zsg2dqv";
-      name = "kwindowsystem-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kwindowsystem-5.43.0.tar.xz";
+      sha256 = "0zcrls3m9np2a9r5n7fry03ll6vrj36abjh2sajm531z657xmxjd";
+      name = "kwindowsystem-5.43.0.tar.xz";
     };
   };
   kxmlgui = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kxmlgui-5.42.0.tar.xz";
-      sha256 = "0kfxjx8wrhkys5bydnv84nqxc2jqvv92zb2l6zpi0km5ggmia5y0";
-      name = "kxmlgui-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kxmlgui-5.43.0.tar.xz";
+      sha256 = "1jncpyfvanyl02zx8zi2mmwbx86yaq9k7k40vh716dswbh2idzd3";
+      name = "kxmlgui-5.43.0.tar.xz";
     };
   };
   kxmlrpcclient = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/kxmlrpcclient-5.42.0.tar.xz";
-      sha256 = "0ciip27ilsfk9s3gslpbi06v8i6ipdbmcig2jf43z3amsxpq0ncn";
-      name = "kxmlrpcclient-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/kxmlrpcclient-5.43.0.tar.xz";
+      sha256 = "0c99wq7kqaqvafppcai47q8w9n21ncfmrc562cvhyqnx9qr9n5vn";
+      name = "kxmlrpcclient-5.43.0.tar.xz";
     };
   };
   modemmanager-qt = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/modemmanager-qt-5.42.0.tar.xz";
-      sha256 = "0q6qzn60z55h0gyc9xwdfaq45mjpk3zrr6d4qqjjfkqsr3866sfx";
-      name = "modemmanager-qt-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/modemmanager-qt-5.43.0.tar.xz";
+      sha256 = "16h8af046jlhn31dg1y3ajpniidkijf0wy0qa7z6bpqw01vj4l6w";
+      name = "modemmanager-qt-5.43.0.tar.xz";
     };
   };
   networkmanager-qt = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/networkmanager-qt-5.42.0.tar.xz";
-      sha256 = "03hhvx8d52mfgbhd4gn0vhsk9k1fv1pvq24ixxdgs2mw44v884xq";
-      name = "networkmanager-qt-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/networkmanager-qt-5.43.0.tar.xz";
+      sha256 = "0pkm02bg201xcxyn2cbw1w3gag9ig4g5yz4wbd2db6qzvficmfqc";
+      name = "networkmanager-qt-5.43.0.tar.xz";
     };
   };
   oxygen-icons5 = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/oxygen-icons5-5.42.0.tar.xz";
-      sha256 = "0pnav9h0xmvbaamzpcyznjjv25slz8maszshx7sj7h07b5a23x46";
-      name = "oxygen-icons5-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/oxygen-icons5-5.43.0.tar.xz";
+      sha256 = "13c80jnc6h2z9bbwwzq1b8jsn80n4bs0zzr2xsbzsfbl5sw0hwpc";
+      name = "oxygen-icons5-5.43.0.tar.xz";
     };
   };
   plasma-framework = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/plasma-framework-5.42.0.tar.xz";
-      sha256 = "079c8h0lmbkfr3srj5m8a40b50kyrxbgmy1n66329l8js9xrvaah";
-      name = "plasma-framework-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/plasma-framework-5.43.0.tar.xz";
+      sha256 = "1v7far0jz0b0rvx4jzqsq2pp1diny5c2qz67jyxnqlfgsba8y466";
+      name = "plasma-framework-5.43.0.tar.xz";
     };
   };
   prison = {
-    version = "5.42.0";
+    version = "5.43.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.43/prison-5.43.0.tar.xz";
+      sha256 = "018kj3xgl5wr3nhrasxmwvk6fh63fdwlz78z1rzyd78jx95wpaqc";
+      name = "prison-5.43.0.tar.xz";
+    };
+  };
+  purpose = {
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/prison-5.42.0.tar.xz";
-      sha256 = "0bhg2fjdwsv7mk16jh1nc3miwggz1dl9l99l2f20xvi75hn7rryg";
-      name = "prison-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/purpose-5.43.0.tar.xz";
+      sha256 = "1vk796f3w2arqaql16yy012211vxgz6awa8kg0p1zrxbid43x757";
+      name = "purpose-5.43.0.tar.xz";
     };
   };
   qqc2-desktop-style = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/qqc2-desktop-style-5.42.0.tar.xz";
-      sha256 = "1arlfhcshfs11pgf87jzjgln1p711zlx0v0q014740mbzb9g5wnk";
-      name = "qqc2-desktop-style-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/qqc2-desktop-style-5.43.0.tar.xz";
+      sha256 = "0q6v1si1c8dlvq5f303dd4n1qqrn9kw0r51dl37px6rvy2n16d0w";
+      name = "qqc2-desktop-style-5.43.0.tar.xz";
     };
   };
   solid = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/solid-5.42.0.tar.xz";
-      sha256 = "10lr8paaq6vaiqn833kzcdc3kkyv8j9fdchy7h8pvi9ajjjwq0lq";
-      name = "solid-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/solid-5.43.0.tar.xz";
+      sha256 = "0q62z23dml6rndgmkg6r09gsi0in8c4gbgv66dw47v02spsnp7v9";
+      name = "solid-5.43.0.tar.xz";
     };
   };
   sonnet = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/sonnet-5.42.0.tar.xz";
-      sha256 = "1r3amddmy0nm8klw0jzvb8bl1l9hkrx50d8j0zq2lbjy36h3yliw";
-      name = "sonnet-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/sonnet-5.43.0.tar.xz";
+      sha256 = "0i5vxaw124093fi7fi8gjyi08xgxpkpb68lrpsxqdikadvx6nwaa";
+      name = "sonnet-5.43.0.tar.xz";
     };
   };
   syntax-highlighting = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/syntax-highlighting-5.42.0.tar.xz";
-      sha256 = "1iwiym50859jki4x41rfdmbd14jiq5lr2hdg46pjkyw17njdjd60";
-      name = "syntax-highlighting-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/syntax-highlighting-5.43.0.tar.xz";
+      sha256 = "0a1xrpk3wavcq6d3cld33l05g5xlhz635vwcc6i1092gsgdns7k1";
+      name = "syntax-highlighting-5.43.0.tar.xz";
     };
   };
   threadweaver = {
-    version = "5.42.0";
+    version = "5.43.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.42/threadweaver-5.42.0.tar.xz";
-      sha256 = "1isqlpnfxzxyz7mdm7yfrafgnx09mcndicdgdw3mi4r4misbrrbn";
-      name = "threadweaver-5.42.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.43/threadweaver-5.43.0.tar.xz";
+      sha256 = "0mmnf6lirvqwlrijpn5vqd8l9pk74dpsbr81y6kyfmx31mj36jjx";
+      name = "threadweaver-5.43.0.tar.xz";
     };
   };
 }
diff --git a/pkgs/development/libraries/kyotocabinet/default.nix b/pkgs/development/libraries/kyotocabinet/default.nix
index 57eaf74d2908..935f52eeb71c 100644
--- a/pkgs/development/libraries/kyotocabinet/default.nix
+++ b/pkgs/development/libraries/kyotocabinet/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   patches = [(fetchurl {
     name = "gcc6.patch";
-    url = "http://pkgs.fedoraproject.org/rpms/kyotocabinet/raw/master/f/kyotocabinet-1.2.76-gcc6.patch";
+    url = "http://src.fedoraproject.org/rpms/kyotocabinet/raw/master/f/kyotocabinet-1.2.76-gcc6.patch";
     sha256 = "1h5k38mkiq7lz8nd2gbn7yvimcz49g3z7phn1cr560bzjih8rz23";
   })];
 
diff --git a/pkgs/development/libraries/libassuan/default.nix b/pkgs/development/libraries/libassuan/default.nix
index 94369449ff3d..827d3de79ea8 100644
--- a/pkgs/development/libraries/libassuan/default.nix
+++ b/pkgs/development/libraries/libassuan/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, pth, libgpgerror }:
+{ fetchurl, stdenv, gettext, pth, libgpgerror }:
 
 stdenv.mkDerivation rec {
   name = "libassuan-2.5.1";
@@ -11,7 +11,8 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "info" ];
   outputBin = "dev"; # libassuan-config
 
-  buildInputs = [ libgpgerror pth ];
+  buildInputs = [ libgpgerror pth ]
+    ++ stdenv.lib.optional stdenv.isDarwin gettext;
 
   doCheck = true;
 
@@ -20,18 +21,16 @@ stdenv.mkDerivation rec {
     sed -i 's,#include <gpg-error.h>,#include "${libgpgerror.dev}/include/gpg-error.h",g' $dev/include/assuan.h
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "IPC library used by GnuPG and related software";
-
     longDescription = ''
       Libassuan is a small library implementing the so-called Assuan
       protocol.  This protocol is used for IPC between most newer
       GnuPG components.  Both, server and client side functions are
       provided.
     '';
-
     homepage = http://gnupg.org;
-    license = stdenv.lib.licenses.lgpl2Plus;
-    platforms = stdenv.lib.platforms.all;
+    license = licenses.lgpl2Plus;
+    platforms = platforms.all;
   };
 }
diff --git a/pkgs/development/libraries/libatomic_ops/default.nix b/pkgs/development/libraries/libatomic_ops/default.nix
index 3aae754be405..714e9361440c 100644
--- a/pkgs/development/libraries/libatomic_ops/default.nix
+++ b/pkgs/development/libraries/libatomic_ops/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoconf, automake, libtool }:
+{ stdenv, fetchurl, autoconf, automake, libtool, hostPlatform }:
 
 stdenv.mkDerivation rec {
   name = "libatomic_ops-${version}";
@@ -12,6 +12,9 @@ stdenv.mkDerivation rec {
     sha256 ="1rif2hjscq5mh639nsnjhb90c01gnmy1sbmj6x6hsn1xmpnj95r1";
   };
 
+  # https://github.com/ivmai/libatomic_ops/pull/32
+  patches = if hostPlatform.isRiscV then [ ./riscv.patch ] else null;
+
   nativeBuildInputs = stdenv.lib.optionals stdenv.isCygwin [ autoconf automake libtool ];
 
   preConfigure = stdenv.lib.optionalString stdenv.isCygwin ''
diff --git a/pkgs/development/libraries/libatomic_ops/riscv.patch b/pkgs/development/libraries/libatomic_ops/riscv.patch
new file mode 100644
index 000000000000..27f2408c34c6
--- /dev/null
+++ b/pkgs/development/libraries/libatomic_ops/riscv.patch
@@ -0,0 +1,40 @@
+diff -Naur libatomic_ops-7.6.2-orig/src/atomic_ops/sysdeps/gcc/riscv.h libatomic_ops-7.6.2/src/atomic_ops/sysdeps/gcc/riscv.h
+--- libatomic_ops-7.6.2-orig/src/atomic_ops/sysdeps/gcc/riscv.h	1969-12-31 19:00:00.000000000 -0500
++++ libatomic_ops-7.6.2/src/atomic_ops/sysdeps/gcc/riscv.h	2018-02-18 00:48:53.581721375 -0500
+@@ -0,0 +1 @@
++#include "generic.h"
+diff -Naur libatomic_ops-7.6.2-orig/src/atomic_ops.h libatomic_ops-7.6.2/src/atomic_ops.h
+--- libatomic_ops-7.6.2-orig/src/atomic_ops.h	2017-12-24 03:31:12.000000000 -0500
++++ libatomic_ops-7.6.2/src/atomic_ops.h	2018-02-18 00:48:53.580721359 -0500
+@@ -352,6 +352,9 @@
+ # if defined(__tile__)
+ #   include "atomic_ops/sysdeps/gcc/tile.h"
+ # endif
++# if defined(__riscv)
++#   include "atomic_ops/sysdeps/gcc/riscv.h"
++# endif
+ #endif /* __GNUC__ && !AO_USE_PTHREAD_DEFS */
+ 
+ #if (defined(__IBMC__) || defined(__IBMCPP__)) && !defined(__GNUC__) \
+diff -Naur libatomic_ops-7.6.2-orig/src/Makefile.am libatomic_ops-7.6.2/src/Makefile.am
+--- libatomic_ops-7.6.2-orig/src/Makefile.am	2017-12-24 03:31:12.000000000 -0500
++++ libatomic_ops-7.6.2/src/Makefile.am	2018-02-18 00:48:53.579721342 -0500
+@@ -92,6 +92,7 @@
+           atomic_ops/sysdeps/gcc/mips.h \
+           atomic_ops/sysdeps/gcc/nios2.h \
+           atomic_ops/sysdeps/gcc/powerpc.h \
++          atomic_ops/sysdeps/gcc/riscv.h \
+           atomic_ops/sysdeps/gcc/s390.h \
+           atomic_ops/sysdeps/gcc/sh.h \
+           atomic_ops/sysdeps/gcc/sparc.h \
+diff -Naur libatomic_ops-7.6.2-orig/src/Makefile.in libatomic_ops-7.6.2/src/Makefile.in
+--- libatomic_ops-7.6.2-orig/src/Makefile.in	2017-12-24 03:32:23.000000000 -0500
++++ libatomic_ops-7.6.2/src/Makefile.in	2018-02-18 00:49:14.005062121 -0500
+@@ -446,6 +446,7 @@
+           atomic_ops/sysdeps/gcc/mips.h \
+           atomic_ops/sysdeps/gcc/nios2.h \
+           atomic_ops/sysdeps/gcc/powerpc.h \
++          atomic_ops/sysdeps/gcc/riscv.h \
+           atomic_ops/sysdeps/gcc/s390.h \
+           atomic_ops/sysdeps/gcc/sh.h \
+           atomic_ops/sysdeps/gcc/sparc.h \
diff --git a/pkgs/development/libraries/libav/default.nix b/pkgs/development/libraries/libav/default.nix
index 6a80a856df3c..a069894f6c8c 100644
--- a/pkgs/development/libraries/libav/default.nix
+++ b/pkgs/development/libraries/libav/default.nix
@@ -28,9 +28,9 @@ let inherit (stdenv.lib) optional optionals hasPrefix; in
 let
   result = {
     # e.g. https://libav.org/releases/libav-11.11.tar.xz.sha1
-    libav_0_8 = libavFun "0.8.20" "0c7a2417c3a01eb74072691bb93ce802ae1be08f";
-    libav_11  = libavFun "11.11"  "d7444fa4f135bdd7347cc962ab4b5228796b0f23";
-    libav_12  = libavFun "12.2"   "3784b15f88076ca0ab8fb6b0377e975b83a5c9f5";
+    libav_0_8 = libavFun "0.8.21" "d858f65128dad0bac1a8c3a51e5cbb27a7c79b3f";
+    libav_11  = libavFun "11.12"  "61d5dcab5fde349834af193a572b12a5fd6a4d42";
+    libav_12  = libavFun "12.3"   "386c18c8b857f23dfcf456ce40370716130211d9";
   };
 
   libavFun = version : sha1 : stdenv.mkDerivation rec {
@@ -125,7 +125,6 @@ let
       license = with licenses; if enableUnfree then unfree #ToDo: redistributable or not?
         else if enableGPL then gpl2Plus else lgpl21Plus;
       platforms = with platforms; linux ++ darwin;
-      maintainers = [ maintainers.vcunat ];
     };
   }; # libavFun
 
diff --git a/pkgs/development/libraries/libbfd/default.nix b/pkgs/development/libraries/libbfd/default.nix
index 5bcf243155b0..018239a3e778 100644
--- a/pkgs/development/libraries/libbfd/default.nix
+++ b/pkgs/development/libraries/libbfd/default.nix
@@ -1,5 +1,5 @@
 { stdenv
-, fetchurl, autoreconfHook264, bison, binutils-raw
+, fetchurl, fetchpatch, gnu-config, autoreconfHook264, bison, binutils-raw
 , libiberty, zlib
 }:
 
@@ -11,6 +11,10 @@ stdenv.mkDerivation rec {
 
   patches = binutils-raw.bintools.patches ++ [
     ../../tools/misc/binutils/build-components-separately.patch
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/mxe/mxe/e1d4c144ee1994f70f86cf7fd8168fe69bd629c6/src/bfd-1-disable-subdir-doc.patch";
+      sha256 = "0pzb3i74d1r7lhjan376h59a7kirw15j7swwm8pz3zy9lkdqkj6q";
+    })
   ];
 
   # We just want to build libbfd
@@ -18,6 +22,14 @@ stdenv.mkDerivation rec {
     cd bfd
   '';
 
+  postAutoreconf = ''
+    echo "Updating config.guess and config.sub from ${gnu-config}"
+    cp -f ${gnu-config}/config.{guess,sub} ../
+  '';
+
+  # We update these ourselves
+  dontUpdateAutotoolsGnuConfigScripts = true;
+
   nativeBuildInputs = [ autoreconfHook264 bison ];
   buildInputs = [ libiberty zlib ];
 
diff --git a/pkgs/development/libraries/libbsd/darwin.patch b/pkgs/development/libraries/libbsd/darwin.patch
index a9ac414e93df..4bddec6b0ffd 100644
--- a/pkgs/development/libraries/libbsd/darwin.patch
+++ b/pkgs/development/libraries/libbsd/darwin.patch
@@ -1,5 +1,5 @@
 diff --git a/configure.ac b/configure.ac
-index c909878..60c540e 100644
+index 88ccd91..0857782 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -59,7 +59,7 @@ AS_CASE([$host_os],
@@ -31,7 +31,7 @@ index c909878..60c540e 100644
 +		os_is_macosx=false
 +		nonLinuxOS=false
 +		;;
-+esac
++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])])
@@ -58,7 +58,7 @@ index 45b3b15..d0d4043 100644
  #include <sys/types.h>
  #include <stdint.h>
 diff --git a/include/bsd/stdio.h b/include/bsd/stdio.h
-index 4b69983..8e2ac75 100644
+index 4b69983..c75151b 100644
 --- a/include/bsd/stdio.h
 +++ b/include/bsd/stdio.h
 @@ -48,12 +48,16 @@
@@ -69,37 +69,60 @@ index 4b69983..8e2ac75 100644
  /* 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.");
+-	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 ee2f953..a3ab077 100644
+index 6798bf6..6baaa14 100644
 --- a/include/bsd/string.h
 +++ b/include/bsd/string.h
-@@ -37,11 +37,14 @@
+@@ -37,6 +37,12 @@
  #include <sys/types.h>
  
  __BEGIN_DECLS
--size_t strlcpy(char *dst, const char *src, size_t siz);
--size_t strlcat(char *dst, const char *src, size_t siz);
- char *strnstr(const char *str, const char *find, size_t str_len);
 +#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
- void strmode(mode_t mode, char *str);
--
-+#endif
+ size_t strlcpy(char *dst, const char *src, size_t siz);
+ size_t strlcat(char *dst, const char *src, size_t siz);
+ 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
  
+ #endif
 diff --git a/src/Makefile.am b/src/Makefile.am
 index ad83dbf..0f2a7ee 100644
 --- a/src/Makefile.am
@@ -519,18 +542,17 @@ index 462535a..e7eb46f 100644
 +}
  #endif
 diff --git a/src/funopen.c b/src/funopen.c
-index 1e05c7e..ed8ce85 100644
+index 1e05c7e..75e61ea 100644
 --- a/src/funopen.c
 +++ b/src/funopen.c
-@@ -137,7 +137,7 @@ funopen(const void *cookie,
- 
- 	return fopencookie(cookiewrap, mode, funcswrap);
- }
--#elif defined(__MUSL__)
-+#elif defined(__MUSL__) || defined(darwin) || defined(__APPLE__) || defined(MACOSX)
- /*
-  * This is unimplementable on musl based systems, and upstream has stated
+@@ -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)
+ #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
@@ -563,13 +585,15 @@ index 4f368a1..ab22fc1 100644
  #define SHA512_DIGEST_LENGTH		64
  
 diff --git a/src/hash/sha512c.c b/src/hash/sha512c.c
-index b3c8d5e..4fade0f 100644
+index b3c8d5e..f69013d 100644
 --- a/src/hash/sha512c.c
 +++ b/src/hash/sha512c.c
-@@ -25,7 +25,11 @@
+@@ -25,7 +25,13 @@
   */
  
  #include <sys/cdefs.h>
++__FBSDID("$FreeBSD$");
++
 +#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
 +#include <machine/endian.h>
 +#else
@@ -579,24 +603,25 @@ index b3c8d5e..4fade0f 100644
  
  #include <string.h>
 diff --git a/src/nlist.c b/src/nlist.c
-index 0932f59..a3ba2be 100644
+index 0932f59..598a329 100644
 --- a/src/nlist.c
 +++ b/src/nlist.c
-@@ -27,6 +27,8 @@
+@@ -27,6 +27,10 @@
   * SUCH DAMAGE.
   */
  
 +#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>
  
  #include <sys/param.h>
-@@ -265,3 +267,5 @@ nlist(const char *name, struct nlist *list)
+@@ -265,3 +269,4 @@ nlist(const char *name, struct nlist *list)
  	(void)close(fd);
  	return (n);
  }
-+
-+#endif
++#endif /* _NLIST_DO_ELF */
 diff --git a/src/setproctitle.c b/src/setproctitle.c
 index 038ac7d..d0ef01b 100644
 --- a/src/setproctitle.c
diff --git a/pkgs/development/libraries/libclc/default.nix b/pkgs/development/libraries/libclc/default.nix
index c5ba65e7b6d7..a83a3c672c0f 100644
--- a/pkgs/development/libraries/libclc/default.nix
+++ b/pkgs/development/libraries/libclc/default.nix
@@ -1,16 +1,22 @@
-{ stdenv, fetchFromGitHub, python2, llvm_4, clang }:
+{ stdenv, fetchFromGitHub, python, llvmPackages }:
+
+let
+  llvm = llvmPackages.llvm;
+  clang = llvmPackages.clang;
+in
 
 stdenv.mkDerivation {
-  name = "libclc-2017-02-25";
+  name = "libclc-2017-11-29";
 
   src = fetchFromGitHub {
     owner = "llvm-mirror";
     repo = "libclc";
-    rev = "17648cd846390e294feafef21c32c7106eac1e24";
-    sha256 = "1c20jyh3sdwd9r37zs4vvppmsx8vhf2xbx0cxsrc27bhx5245p0s";
+    rev = "d6384415ab854c68777dd77451aa2bc0d959da99";
+    sha256 = "10fqrlnqlknh58x7pfsbg9r07fblfg2mgq2m4fr1jbb836ncn3wh";
   };
 
-  buildInputs = [ python2 llvm_4 clang ];
+  nativeBuildInputs = [ python ];
+  buildInputs = [ llvm clang ];
 
   postPatch = ''
     sed -i 's,llvm_clang =.*,llvm_clang = "${clang}/bin/clang",' configure.py
@@ -18,7 +24,7 @@ stdenv.mkDerivation {
   '';
 
   configurePhase = ''
-    ${python2.interpreter} ./configure.py --prefix=$out
+    ${python.interpreter} ./configure.py --prefix=$out
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/libdaemon/default.nix b/pkgs/development/libraries/libdaemon/default.nix
index af832a70a73b..59e576fd3923 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 {
@@ -24,4 +24,8 @@ stdenv.mkDerivation rec {
     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/libdaemon/fix-includes.patch b/pkgs/development/libraries/libdaemon/fix-includes.patch
new file mode 100644
index 000000000000..51c5133afede
--- /dev/null
+++ b/pkgs/development/libraries/libdaemon/fix-includes.patch
@@ -0,0 +1,13 @@
+--- libdaemon-0.14.orig/examples/testd.c
++++ libdaemon-0.14/examples/testd.c
+@@ -21,9 +21,9 @@
+ #include <signal.h>
+ #include <errno.h>
+ #include <string.h>
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+-#include <sys/unistd.h>
+ #include <sys/select.h>
+ 
+ #include <libdaemon/dfork.h>
diff --git a/pkgs/development/libraries/libexecinfo/default.nix b/pkgs/development/libraries/libexecinfo/default.nix
new file mode 100644
index 000000000000..a61d51aa6b72
--- /dev/null
+++ b/pkgs/development/libraries/libexecinfo/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchurl, fetchpatch }:
+
+stdenv.mkDerivation rec {
+  name = "libexecinfo-${version}";
+  version = "1.1";
+
+  src = fetchurl {
+    url = "http://distcache.freebsd.org/local-distfiles/itetcu/${name}.tar.bz2";
+    sha256 = "07wvlpc1jk1sj4k5w53ml6wagh0zm9kv2l1jngv8xb7xww9ik8n9";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "10-execinfo.patch";
+      url = https://git.alpinelinux.org/cgit/aports/plain/main/libexecinfo/10-execinfo.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1;
+      sha256 = "0lnphrad4vspyljnvmm62dyxj98vgp3wabj4w3vfzfph7j8piw7g";
+    })
+    (fetchpatch {
+      name = "20-define-gnu-source.patch";
+      url = https://git.alpinelinux.org/cgit/aports/plain/main/libexecinfo/20-define-gnu-source.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1;
+      sha256 = "1mp8mc639b0h2s69m5z6s2h3q3n1zl298j9j0plzj7f979j76302";
+    })
+    (fetchpatch {
+      name = "30-linux-makefile.patch";
+      url = https://git.alpinelinux.org/cgit/aports/plain/main/libexecinfo/30-linux-makefile.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1;
+      sha256 = "1jwjz22z5cjy5h2bfghn62yl9ar8jiqhdvbwrcfavv17ihbhwcaf";
+    })
+  ];
+
+  makeFlags = [ "CC:=$(CC)" "AR:=$(AR)" ];
+
+  patchFlags = "-p0";
+
+  installPhase = ''
+    install -Dm644 execinfo.h stacktraverse.h -t $out/include
+    install -Dm755 libexecinfo.{a,so.1} -t $out/lib
+    ln -s $out/lib/libexecinfo.so{.1,}
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Quick-n-dirty BSD licensed clone of the GNU libc backtrace facility";
+    license = licenses.bsd2;
+    homepage = https://www.freshports.org/devel/libexecinfo;
+    maintainers = with maintainers; [ dtzWill ];
+  };
+}
diff --git a/pkgs/development/libraries/libffi/default.nix b/pkgs/development/libraries/libffi/default.nix
index e48db6c9928b..1339be451c29 100644
--- a/pkgs/development/libraries/libffi/default.nix
+++ b/pkgs/development/libraries/libffi/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, dejagnu, doCheck ? false
+{ stdenv, fetchurl, fetchpatch,  dejagnu, doCheck ? false
 , buildPlatform, hostPlatform
 }:
 
@@ -10,11 +10,28 @@ stdenv.mkDerivation rec {
     sha256 = "0dya49bnhianl0r65m65xndz6ls2jn1xngyn72gd28ls3n7bnvnh";
   };
 
-  patches = stdenv.lib.optional stdenv.isCygwin ./3.2.1-cygwin.patch ++
-    stdenv.lib.optional stdenv.isAarch64 (fetchurl {
+  patches = stdenv.lib.optional stdenv.isCygwin ./3.2.1-cygwin.patch
+    ++ stdenv.lib.optional stdenv.isAarch64 (fetchpatch {
       url = https://src.fedoraproject.org/rpms/libffi/raw/ccffc1700abfadb0969495a6e51b964117fc03f6/f/libffi-aarch64-rhbz1174037.patch;
       sha256 = "1vpirrgny43hp0885rswgv3xski8hg7791vskpbg3wdjdpb20wbc";
-    });
+    })
+    ++ stdenv.lib.optional hostPlatform.isMusl (fetchpatch {
+      name = "gnu-linux-define.patch";
+      url = "https://git.alpinelinux.org/cgit/aports/plain/main/libffi/gnu-linux-define.patch?id=bb024fd8ec6f27a76d88396c9f7c5c4b5800d580";
+      sha256 = "11pvy3xkhyvnjfyy293v51f1xjy3x0azrahv1nw9y9mw8bifa2j2";
+    })
+    ++ stdenv.lib.optionals stdenv.isMips [
+      (fetchpatch {
+        name = "0001-mips-Use-compiler-internal-define-for-linux.patch";
+        url = "http://cgit.openembedded.org/openembedded-core/plain/meta/recipes-support/libffi/libffi/0001-mips-Use-compiler-internal-define-for-linux.patch?id=318e33a708378652edcf61ce7d9d7f3a07743000";
+        sha256 = "1gc53lw90p6hc0cmhj3csrwincfz7va5ss995ksw5gm0yrr9mrvb";
+      })
+      (fetchpatch {
+        name = "0001-mips-fix-MIPS-softfloat-build-issue.patch";
+        url = "http://cgit.openembedded.org/openembedded-core/plain/meta/recipes-support/libffi/libffi/0001-mips-fix-MIPS-softfloat-build-issue.patch?id=318e33a708378652edcf61ce7d9d7f3a07743000";
+        sha256 = "0l8xgdciqalg4z9rcwyk87h8fdxpfv4hfqxwsy2agpnpszl5jjdq";
+      })
+    ];
 
   outputs = [ "out" "dev" "man" "info" ];
 
diff --git a/pkgs/development/libraries/libgcrypt/default.nix b/pkgs/development/libraries/libgcrypt/default.nix
index 397000fc7d24..45564d64861d 100644
--- a/pkgs/development/libraries/libgcrypt/default.nix
+++ b/pkgs/development/libraries/libgcrypt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libgpgerror, enableCapabilities ? false, libcap }:
+{ stdenv, fetchurl, gettext, libgpgerror, enableCapabilities ? false, libcap }:
 
 assert enableCapabilities -> stdenv.isLinux;
 
@@ -20,6 +20,7 @@ stdenv.mkDerivation rec {
   hardeningDisable = stdenv.lib.optional stdenv.cc.isClang "fortify";
 
   buildInputs = [ libgpgerror ]
+    ++ stdenv.lib.optional stdenv.isDarwin gettext
     ++ stdenv.lib.optional enableCapabilities libcap;
 
   # Make sure libraries are correct for .pc and .la files
diff --git a/pkgs/development/libraries/libgpg-error/default.nix b/pkgs/development/libraries/libgpg-error/default.nix
index 9faf7a404585..e6cb62330c4e 100644
--- a/pkgs/development/libraries/libgpg-error/default.nix
+++ b/pkgs/development/libraries/libgpg-error/default.nix
@@ -9,7 +9,11 @@ stdenv.mkDerivation rec {
     sha256 = "1li95ni122fzinzlmxbln63nmgij63irxfvi52ws4zfbzv3am4sg";
   };
 
-  postPatch = "sed '/BUILD_TIMESTAMP=/s/=.*/=1970-01-01T00:01+0000/' -i ./configure";
+  postPatch = ''
+    sed '/BUILD_TIMESTAMP=/s/=.*/=1970-01-01T00:01+0000/' -i ./configure
+  '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+    ln -s lock-obj-pub.x86_64-pc-linux-musl.h src/syscfg/lock-obj-pub.linux-musl.h
+  '';
 
   outputs = [ "out" "dev" "info" ];
   outputBin = "dev"; # deps want just the lib, most likely
diff --git a/pkgs/development/libraries/libiconv/default.nix b/pkgs/development/libraries/libiconv/default.nix
index 899465124100..21abf7f8c079 100644
--- a/pkgs/development/libraries/libiconv/default.nix
+++ b/pkgs/development/libraries/libiconv/default.nix
@@ -2,7 +2,7 @@
 , buildPlatform, hostPlatform
 }:
 
-assert !stdenv.isLinux || hostPlatform != buildPlatform; # TODO: improve on cross
+# assert !stdenv.isLinux || hostPlatform != buildPlatform; # TODO: improve on cross
 
 stdenv.mkDerivation rec {
   name = "libiconv-${version}";
diff --git a/pkgs/development/libraries/libidn/default.nix b/pkgs/development/libraries/libidn/default.nix
index df92693de5a6..54d669f1913b 100644
--- a/pkgs/development/libraries/libidn/default.nix
+++ b/pkgs/development/libraries/libidn/default.nix
@@ -10,7 +10,8 @@ stdenv.mkDerivation rec {
 
   outputs = [ "bin" "dev" "out" "info" "devdoc" ];
 
-  doCheck = (stdenv.buildPlatform == stdenv.hostPlatform) && !stdenv.isDarwin;
+  # broken with gcc-7
+  #doCheck = !stdenv.isDarwin && !stdenv.hostPlatform.isMusl;
 
   hardeningDisable = [ "format" ];
 
diff --git a/pkgs/development/libraries/libksba/default.nix b/pkgs/development/libraries/libksba/default.nix
index 8bff5a21cd09..3f7a4bed9cc9 100644
--- a/pkgs/development/libraries/libksba/default.nix
+++ b/pkgs/development/libraries/libksba/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libgpgerror }:
+{ stdenv, fetchurl, gettext, libgpgerror }:
 
 stdenv.mkDerivation rec {
   name = "libksba-1.3.5";
@@ -10,6 +10,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "info" ];
 
+  buildInputs = stdenv.lib.optional stdenv.isDarwin gettext;
   propagatedBuildInputs = [ libgpgerror ];
 
   postInstall = ''
diff --git a/pkgs/development/libraries/libmemcached/default.nix b/pkgs/development/libraries/libmemcached/default.nix
index 086ba8f32d21..15e642832df6 100644
--- a/pkgs/development/libraries/libmemcached/default.nix
+++ b/pkgs/development/libraries/libmemcached/default.nix
@@ -17,11 +17,14 @@ stdenv.mkDerivation rec {
     ++ stdenv.lib.optional stdenv.isDarwin (fetchpatch {
       url = "https://raw.githubusercontent.com/Homebrew/homebrew/bfd4a0a4626b61c2511fdf573bcbbc6bbe86340e/Library/Formula/libmemcached.rb";
       sha256 = "1gjf3vd7hiyzxjvlg2zfc3y2j0lyr6nhbws4xb5dmin3csyp8qb8";
-    });
+    })
+    ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./musl-fixes.patch;
 
   buildInputs = [ libevent ];
   propagatedBuildInputs = [ cyrus_sasl ];
 
+  NIX_CFLAGS_COMPILE = [ "-fpermissive"/*gcc7*/ ];
+
   meta = with stdenv.lib; {
     homepage = http://libmemcached.org;
     description = "Open source C/C++ client library and tools for the memcached server";
diff --git a/pkgs/development/libraries/libmemcached/musl-fixes.patch b/pkgs/development/libraries/libmemcached/musl-fixes.patch
new file mode 100644
index 000000000000..eb2a6bc980eb
--- /dev/null
+++ b/pkgs/development/libraries/libmemcached/musl-fixes.patch
@@ -0,0 +1,58 @@
+diff --git a/libhashkit/fnv_64.cc b/libhashkit/fnv_64.cc
+index 68e4dd0..64656b7 100644
+--- a/libhashkit/fnv_64.cc
++++ b/libhashkit/fnv_64.cc
+@@ -37,8 +37,9 @@
+ 
+ 
+ #include <libhashkit/common.h>
++#include <limits.h>
+ 
+-#if __WORDSIZE == 64 && defined(HAVE_FNV64_HASH)
++#if (LONG_BITS == 64) && defined(HAVE_FNV64_HASH)
+ 
+ /* FNV hash'es lifted from Dustin Sallings work */
+ static uint64_t FNV_64_INIT= 0xcbf29ce484222325;
+diff --git a/libhashkit/has.cc b/libhashkit/has.cc
+index 843e32e..4153e5e 100644
+--- a/libhashkit/has.cc
++++ b/libhashkit/has.cc
+@@ -37,6 +37,7 @@
+ 
+ 
+ #include <libhashkit/common.h>
++#include <limits.h>
+ 
+ bool libhashkit_has_algorithm(const hashkit_hash_algorithm_t algo)
+ {
+@@ -44,7 +45,7 @@ bool libhashkit_has_algorithm(const hashkit_hash_algorithm_t algo)
+   {
+   case HASHKIT_HASH_FNV1_64:
+   case HASHKIT_HASH_FNV1A_64:
+-#if __WORDSIZE == 64 && defined(HAVE_FNV64_HASH)
++#if (LONG_BITS == 64) && defined(HAVE_FNV64_HASH)
+     return true;
+ #else
+     return false;
+diff --git a/libtest/cmdline.cc b/libtest/cmdline.cc
+index 29a22de..161c646 100644
+--- a/libtest/cmdline.cc
++++ b/libtest/cmdline.cc
+@@ -61,7 +61,7 @@ using namespace libtest;
+ #include <algorithm>
+ #include <stdexcept>
+ 
+-#ifndef __USE_GNU
++#ifndef _GNU_SOURCE
+ static char **environ= NULL;
+ #endif
+ 
+@@ -201,7 +201,7 @@ Application::error_t Application::run(const char *args[])
+ 
+   fatal_assert(posix_spawnattr_setsigmask(&spawnattr, &mask) == 0);
+ 
+-#if defined(POSIX_SPAWN_USEVFORK) || defined(__linux__)
++#if defined(POSIX_SPAWN_USEVFORK) || defined(__GLIBC__)
+   // Use USEVFORK on linux
+   flags |= POSIX_SPAWN_USEVFORK;
+ #endif
diff --git a/pkgs/development/libraries/libmpc/default.nix b/pkgs/development/libraries/libmpc/default.nix
index 97366d24c36e..106f6fe6c37c 100644
--- a/pkgs/development/libraries/libmpc/default.nix
+++ b/pkgs/development/libraries/libmpc/default.nix
@@ -1,23 +1,20 @@
 { stdenv, fetchurl
 , gmp, mpfr
-, buildPlatform, hostPlatform
 }:
 
 let
-  version = "1.0.3";
+  version = "1.1.0";
 in
 stdenv.mkDerivation rec {
   name = "libmpc-${version}"; # to avoid clash with the MPD client
 
   src = fetchurl {
-    url = "https://ftp.gnu.org/gnu/mpc/mpc-${version}.tar.gz";
-    sha256 = "1hzci2zrrd7v3g1jk35qindq05hbl0bhjcyyisq9z209xb3fqzb1";
+    url = "mirror://gnu/mpc/mpc-${version}.tar.gz";
+    sha256 = "0biwnhjm3rx3hc0rfpvyniky4lpzsvdcwhmcn7f0h4iw2hwcb1b9";
   };
 
   buildInputs = [ gmp mpfr ];
 
-  CFLAGS = "-I${gmp.dev}/include";
-
   doCheck = true; # not cross;
 
   meta = {
diff --git a/pkgs/development/libraries/libmwaw/default.nix b/pkgs/development/libraries/libmwaw/default.nix
index e1ac659683c9..35137a09cd9c 100644
--- a/pkgs/development/libraries/libmwaw/default.nix
+++ b/pkgs/development/libraries/libmwaw/default.nix
@@ -3,11 +3,11 @@ let
   s = # Generated upstream information
   rec {
     baseName="libmwaw";
-    version="0.3.10";
+    version="0.3.13";
     name="${baseName}-${version}";
-    hash="087j6kx03ggvqwpl944nnf75qkvi9bag8b0z59phg66gbz0s0imj";
-    url="https://netcologne.dl.sourceforge.net/project/libmwaw/libmwaw/libmwaw-0.3.10/libmwaw-0.3.10.tar.xz";
-    sha256="087j6kx03ggvqwpl944nnf75qkvi9bag8b0z59phg66gbz0s0imj";
+    hash="1sjs3nc39im232h5bf81w3il8ivd7w2bc2qssxf7k74g8hlcfmfv";
+    url="mirror://sourceforge/libmwaw/libmwaw/libmwaw-0.3.13/libmwaw-0.3.13.tar.xz";
+    sha256="1sjs3nc39im232h5bf81w3il8ivd7w2bc2qssxf7k74g8hlcfmfv";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/libnet/default.nix b/pkgs/development/libraries/libnet/default.nix
index a93c16d784de..f642ad5ccfab 100644
--- a/pkgs/development/libraries/libnet/default.nix
+++ b/pkgs/development/libraries/libnet/default.nix
@@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "0qsapqa7dzq9f6lb19kzilif0pj82b64fjv5bq086hflb9w81hvj";
   };
 
+  patches = [ ./fix-includes.patch ];
+
   meta = with stdenv.lib; {
     homepage = https://github.com/sam-github/libnet;
     description = "Portable framework for low-level network packet construction";
diff --git a/pkgs/development/libraries/libnet/fix-includes.patch b/pkgs/development/libraries/libnet/fix-includes.patch
new file mode 100644
index 000000000000..5eb86bc37b79
--- /dev/null
+++ b/pkgs/development/libraries/libnet/fix-includes.patch
@@ -0,0 +1,29 @@
+--- libnet-1.1.6.orig/src/libnet_link_linux.c
++++ libnet-1.1.6/src/libnet_link_linux.c
+@@ -30,26 +30,15 @@
+ #include <sys/time.h>
+ 
+ #include <net/if.h>
+-#if (__GLIBC__)
+ #include <netinet/if_ether.h>
+ #include <net/if_arp.h>
+-#else
+-#include <linux/if_arp.h>
+-#include <linux/if_ether.h>
+-#endif
+ 
+ #if (HAVE_PACKET_SOCKET)
+ #ifndef SOL_PACKET
+ #define SOL_PACKET 263
+ #endif  /* SOL_PACKET */
+-#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
+ #include <netpacket/packet.h>
+ #include <net/ethernet.h>     /* the L2 protocols */
+-#else
+-#include <asm/types.h>
+-#include <linux/if_packet.h>
+-#include <linux/if_ether.h>   /* The L2 protocols */
+-#endif
+ #endif  /* HAVE_PACKET_SOCKET */
+ 
+ #include "../include/libnet.h"
diff --git a/pkgs/development/libraries/libnfnetlink/Use-stdlib-uint-instead-of-u_int.patch b/pkgs/development/libraries/libnfnetlink/Use-stdlib-uint-instead-of-u_int.patch
new file mode 100644
index 000000000000..074bef42b97a
--- /dev/null
+++ b/pkgs/development/libraries/libnfnetlink/Use-stdlib-uint-instead-of-u_int.patch
@@ -0,0 +1,499 @@
+From patchwork Fri Apr  3 22:04:46 2015
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: Use stdlib uint* instead of u_int*
+From: Nathan McSween <nwmcsween@gmail.com>
+X-Patchwork-Id: 458131
+X-Patchwork-Delegate: pablo@netfilter.org
+Message-Id: <1428098686-17843-1-git-send-email-nwmcsween@gmail.com>
+To: netfilter-devel@vger.kernel.org
+Cc: Nathan McSween <nwmcsween@gmail.com>
+Date: Fri,  3 Apr 2015 22:04:46 +0000
+
+Signed-off-by: Nathan McSween <nwmcsween@gmail.com>
+---
+ include/libnfnetlink/libnfnetlink.h           | 25 +++++-----
+ include/libnfnetlink/linux_nfnetlink.h        | 11 +++--
+ include/libnfnetlink/linux_nfnetlink_compat.h |  6 ++-
+ src/iftable.c                                 |  9 ++--
+ src/iftable.h                                 |  6 ++-
+ src/libnfnetlink.c                            | 71 ++++++++++++++-------------
+ src/rtnl.c                                    |  5 +-
+ src/rtnl.h                                    |  3 +-
+ 8 files changed, 73 insertions(+), 63 deletions(-)
+
+diff --git a/include/libnfnetlink/libnfnetlink.h b/include/libnfnetlink/libnfnetlink.h
+index 1d8c49d..cd0be3d 100644
+--- a/include/libnfnetlink/libnfnetlink.h
++++ b/include/libnfnetlink/libnfnetlink.h
+@@ -15,6 +15,7 @@
+ #define aligned_u64 unsigned long long __attribute__((aligned(8)))
+ #endif
+ 
++#include <stdint.h>
+ #include <sys/socket.h>	/* for sa_family_t */
+ #include <linux/netlink.h>
+ #include <libnfnetlink/linux_nfnetlink.h>
+@@ -55,7 +56,7 @@ struct nfnlhdr {
+ struct nfnl_callback {
+ 	int (*call)(struct nlmsghdr *nlh, struct nfattr *nfa[], void *data);
+ 	void *data;
+-	u_int16_t attr_count;
++	uint16_t attr_count;
+ };
+ 
+ struct nfnl_handle;
+@@ -69,7 +70,7 @@ extern struct nfnl_handle *nfnl_open(void);
+ extern int nfnl_close(struct nfnl_handle *);
+ 
+ extern struct nfnl_subsys_handle *nfnl_subsys_open(struct nfnl_handle *, 
+-						   u_int8_t, u_int8_t, 
++						   uint8_t, uint8_t,
+ 						   unsigned int);
+ extern void nfnl_subsys_close(struct nfnl_subsys_handle *);
+ 
+@@ -88,8 +89,8 @@ extern int nfnl_sendiov(const struct nfnl_handle *nfnlh,
+ 			const struct iovec *iov, unsigned int num,
+ 			unsigned int flags);
+ extern void nfnl_fill_hdr(struct nfnl_subsys_handle *, struct nlmsghdr *,
+-			  unsigned int, u_int8_t, u_int16_t, u_int16_t,
+-			  u_int16_t);
++			  unsigned int, uint8_t, uint16_t, uint16_t,
++			  uint16_t);
+ extern __attribute__((deprecated)) int
+ nfnl_talk(struct nfnl_handle *, struct nlmsghdr *, pid_t,
+           unsigned, struct nlmsghdr *,
+@@ -103,8 +104,8 @@ nfnl_listen(struct nfnl_handle *,
+ /* receiving */
+ extern ssize_t nfnl_recv(const struct nfnl_handle *h, unsigned char *buf, size_t len);
+ extern int nfnl_callback_register(struct nfnl_subsys_handle *,
+-				  u_int8_t type, struct nfnl_callback *cb);
+-extern int nfnl_callback_unregister(struct nfnl_subsys_handle *, u_int8_t type);
++				  uint8_t type, struct nfnl_callback *cb);
++extern int nfnl_callback_unregister(struct nfnl_subsys_handle *, uint8_t type);
+ extern int nfnl_handle_packet(struct nfnl_handle *, char *buf, int len);
+ 
+ /* parsing */
+@@ -180,12 +181,12 @@ extern int nfnl_query(struct nfnl_handle *h, struct nlmsghdr *nlh);
+ 
+ /* nfnl attribute handling functions */
+ extern int nfnl_addattr_l(struct nlmsghdr *, int, int, const void *, int);
+-extern int nfnl_addattr8(struct nlmsghdr *, int, int, u_int8_t);
+-extern int nfnl_addattr16(struct nlmsghdr *, int, int, u_int16_t);
+-extern int nfnl_addattr32(struct nlmsghdr *, int, int, u_int32_t);
++extern int nfnl_addattr8(struct nlmsghdr *, int, int, uint8_t);
++extern int nfnl_addattr16(struct nlmsghdr *, int, int, uint16_t);
++extern int nfnl_addattr32(struct nlmsghdr *, int, int, uint32_t);
+ extern int nfnl_nfa_addattr_l(struct nfattr *, int, int, const void *, int);
+-extern int nfnl_nfa_addattr16(struct nfattr *, int, int, u_int16_t);
+-extern int nfnl_nfa_addattr32(struct nfattr *, int, int, u_int32_t);
++extern int nfnl_nfa_addattr16(struct nfattr *, int, int, uint16_t);
++extern int nfnl_nfa_addattr32(struct nfattr *, int, int, uint32_t);
+ extern int nfnl_parse_attr(struct nfattr **, int, struct nfattr *, int);
+ #define nfnl_parse_nested(tb, max, nfa) \
+ 	nfnl_parse_attr((tb), (max), NFA_DATA((nfa)), NFA_PAYLOAD((nfa)))
+@@ -197,7 +198,7 @@ extern int nfnl_parse_attr(struct nfattr **, int, struct nfattr *, int);
+ ({	(tail)->nfa_len = (void *) NLMSG_TAIL(nlh) - (void *) tail; })
+ 
+ extern void nfnl_build_nfa_iovec(struct iovec *iov, struct nfattr *nfa, 
+-				 u_int16_t type, u_int32_t len,
++				 uint16_t type, uint32_t len,
+ 				 unsigned char *val);
+ extern unsigned int nfnl_rcvbufsiz(const struct nfnl_handle *h, 
+ 				   unsigned int size);
+diff --git a/include/libnfnetlink/linux_nfnetlink.h b/include/libnfnetlink/linux_nfnetlink.h
+index 76a8550..7b843c6 100644
+--- a/include/libnfnetlink/linux_nfnetlink.h
++++ b/include/libnfnetlink/linux_nfnetlink.h
+@@ -1,5 +1,6 @@
+ #ifndef _NFNETLINK_H
+ #define _NFNETLINK_H
++#include <stdint.h>
+ #include <linux/types.h>
+ #include <libnfnetlink/linux_nfnetlink_compat.h>
+ 
+@@ -25,9 +26,9 @@ enum nfnetlink_groups {
+ /* General form of address family dependent message.
+  */
+ struct nfgenmsg {
+-	u_int8_t  nfgen_family;		/* AF_xxx */
+-	u_int8_t  version;		/* nfnetlink version */
+-	u_int16_t    res_id;		/* resource id */
++	uint8_t  nfgen_family;		/* AF_xxx */
++	uint8_t  version;		/* nfnetlink version */
++	uint16_t    res_id;		/* resource id */
+ };
+ 
+ #define NFNETLINK_V0	0
+@@ -59,7 +60,7 @@ struct nfnl_callback
+ 	int (*call)(struct sock *nl, struct sk_buff *skb, 
+ 		struct nlmsghdr *nlh, struct nlattr *cda[]);
+ 	const struct nla_policy *policy;	/* netlink attribute policy */
+-	const u_int16_t attr_count;		/* number of nlattr's */
++	const uint16_t attr_count;		/* number of nlattr's */
+ };
+ 
+ struct nfnetlink_subsystem
+@@ -76,7 +77,7 @@ extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n);
+ extern int nfnetlink_has_listeners(unsigned int group);
+ extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, 
+ 			  int echo);
+-extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags);
++extern int nfnetlink_unicast(struct sk_buff *skb, uint32_t pid, int flags);
+ 
+ #define MODULE_ALIAS_NFNL_SUBSYS(subsys) \
+ 	MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys))
+diff --git a/include/libnfnetlink/linux_nfnetlink_compat.h b/include/libnfnetlink/linux_nfnetlink_compat.h
+index e145176..cd094fc 100644
+--- a/include/libnfnetlink/linux_nfnetlink_compat.h
++++ b/include/libnfnetlink/linux_nfnetlink_compat.h
+@@ -3,6 +3,8 @@
+ #ifndef __KERNEL__
+ /* Old nfnetlink macros for userspace */
+ 
++#include <stdint.h>
++
+ /* nfnetlink groups: Up to 32 maximum */
+ #define NF_NETLINK_CONNTRACK_NEW 		0x00000001
+ #define NF_NETLINK_CONNTRACK_UPDATE		0x00000002
+@@ -20,8 +22,8 @@
+ 
+ struct nfattr
+ {
+-	u_int16_t nfa_len;
+-	u_int16_t nfa_type;	/* we use 15 bits for the type, and the highest
++	uint16_t nfa_len;
++	uint16_t nfa_type;	/* we use 15 bits for the type, and the highest
+ 				 * bit to indicate whether the payload is nested */
+ };
+ 
+diff --git a/src/iftable.c b/src/iftable.c
+index 5976ed8..3411c4c 100644
+--- a/src/iftable.c
++++ b/src/iftable.c
+@@ -9,6 +9,7 @@
+ /* IFINDEX handling */
+ 
+ #include <unistd.h>
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+@@ -27,10 +28,10 @@
+ struct ifindex_node {
+ 	struct list_head head;
+ 
+-	u_int32_t	index;
+-	u_int32_t	type;
+-	u_int32_t	alen;
+-	u_int32_t	flags;
++	uint32_t	index;
++	uint32_t	type;
++	uint32_t	alen;
++	uint32_t	flags;
+ 	char		addr[8];
+ 	char		name[16];
+ };
+diff --git a/src/iftable.h b/src/iftable.h
+index 8df7f24..0cc5335 100644
+--- a/src/iftable.h
++++ b/src/iftable.h
+@@ -1,8 +1,10 @@
+ #ifndef _IFTABLE_H
+ #define _IFTABLE_H
+ 
+-int iftable_delete(u_int32_t dst, u_int32_t mask, u_int32_t gw, u_int32_t oif);
+-int iftable_insert(u_int32_t dst, u_int32_t mask, u_int32_t gw, u_int32_t oif);
++#include <stdint.h>
++
++int iftable_delete(uint32_t dst, uint32_t mask, uint32_t gw, uint32_t oif);
++int iftable_insert(uint32_t dst, uint32_t mask, uint32_t gw, uint32_t oif);
+ 
+ int iftable_init(void);
+ void iftable_fini(void);
+diff --git a/src/libnfnetlink.c b/src/libnfnetlink.c
+index 398b7d7..b8958dc 100644
+--- a/src/libnfnetlink.c
++++ b/src/libnfnetlink.c
+@@ -36,6 +36,7 @@
+  * 	minor cleanups
+  */
+ 
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <unistd.h>
+@@ -72,9 +73,9 @@
+ 
+ struct nfnl_subsys_handle {
+ 	struct nfnl_handle 	*nfnlh;
+-	u_int32_t		subscriptions;
+-	u_int8_t		subsys_id;
+-	u_int8_t		cb_count;
++	uint32_t		subscriptions;
++	uint8_t		subsys_id;
++	uint8_t		cb_count;
+ 	struct nfnl_callback 	*cb;	/* array of callbacks */
+ };
+ 
+@@ -86,11 +87,11 @@ struct nfnl_handle {
+ 	int			fd;
+ 	struct sockaddr_nl	local;
+ 	struct sockaddr_nl	peer;
+-	u_int32_t		subscriptions;
+-	u_int32_t		seq;
+-	u_int32_t		dump;
+-	u_int32_t		rcv_buffer_size;	/* for nfnl_catch */
+-	u_int32_t		flags;
++	uint32_t		subscriptions;
++	uint32_t		seq;
++	uint32_t		dump;
++	uint32_t		rcv_buffer_size;	/* for nfnl_catch */
++	uint32_t		flags;
+ 	struct nlmsghdr 	*last_nlhdr;
+ 	struct nfnl_subsys_handle subsys[NFNL_MAX_SUBSYS+1];
+ };
+@@ -145,7 +146,7 @@ unsigned int nfnl_portid(const struct nfnl_handle *h)
+ static int recalc_rebind_subscriptions(struct nfnl_handle *nfnlh)
+ {
+ 	int i, err;
+-	u_int32_t new_subscriptions = nfnlh->subscriptions;
++	uint32_t new_subscriptions = nfnlh->subscriptions;
+ 
+ 	for (i = 0; i < NFNL_MAX_SUBSYS; i++)
+ 		new_subscriptions |= nfnlh->subsys[i].subscriptions;
+@@ -273,8 +274,8 @@ void nfnl_set_rcv_buffer_size(struct nfnl_handle *h, unsigned int size)
+  * a valid address that points to a nfnl_subsys_handle structure is returned.
+  */
+ struct nfnl_subsys_handle *
+-nfnl_subsys_open(struct nfnl_handle *nfnlh, u_int8_t subsys_id,
+-		 u_int8_t cb_count, u_int32_t subscriptions)
++nfnl_subsys_open(struct nfnl_handle *nfnlh, uint8_t subsys_id,
++		 uint8_t cb_count, uint32_t subscriptions)
+ {
+ 	struct nfnl_subsys_handle *ssh;
+ 
+@@ -435,10 +436,10 @@ int nfnl_sendiov(const struct nfnl_handle *nfnlh, const struct iovec *iov,
+  */
+ void nfnl_fill_hdr(struct nfnl_subsys_handle *ssh,
+ 		    struct nlmsghdr *nlh, unsigned int len, 
+-		    u_int8_t family,
+-		    u_int16_t res_id,
+-		    u_int16_t msg_type,
+-		    u_int16_t msg_flags)
++		    uint8_t family,
++		    uint16_t res_id,
++		    uint16_t msg_type,
++		    uint16_t msg_flags)
+ {
+ 	assert(ssh);
+ 	assert(nlh);
+@@ -849,14 +850,14 @@ int nfnl_nfa_addattr_l(struct nfattr *nfa, int maxlen, int type,
+ }
+ 
+ /**
+- * nfnl_addattr8 - Add u_int8_t attribute to nlmsghdr
++ * nfnl_addattr8 - Add uint8_t attribute to nlmsghdr
+  *
+  * @n: netlink message header to which attribute is to be added
+  * @maxlen: maximum length of netlink message header
+  * @type: type of new attribute
+  * @data: content of new attribute
+  */
+-int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data)
++int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, uint8_t data)
+ {
+ 	assert(n);
+ 	assert(maxlen > 0);
+@@ -866,7 +867,7 @@ int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data)
+ }
+ 
+ /**
+- * nfnl_nfa_addattr16 - Add u_int16_t attribute to struct nfattr 
++ * nfnl_nfa_addattr16 - Add uint16_t attribute to struct nfattr
+  *
+  * @nfa: struct nfattr
+  * @maxlen: maximal length of nfattr buffer
+@@ -875,7 +876,7 @@ int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data)
+  *
+  */
+ int nfnl_nfa_addattr16(struct nfattr *nfa, int maxlen, int type, 
+-		       u_int16_t data)
++		       uint16_t data)
+ {
+ 	assert(nfa);
+ 	assert(maxlen > 0);
+@@ -885,7 +886,7 @@ int nfnl_nfa_addattr16(struct nfattr *nfa, int maxlen, int type,
+ }
+ 
+ /**
+- * nfnl_addattr16 - Add u_int16_t attribute to nlmsghdr
++ * nfnl_addattr16 - Add uint16_t attribute to nlmsghdr
+  *
+  * @n: netlink message header to which attribute is to be added
+  * @maxlen: maximum length of netlink message header
+@@ -894,7 +895,7 @@ int nfnl_nfa_addattr16(struct nfattr *nfa, int maxlen, int type,
+  *
+  */
+ int nfnl_addattr16(struct nlmsghdr *n, int maxlen, int type,
+-		   u_int16_t data)
++		   uint16_t data)
+ {
+ 	assert(n);
+ 	assert(maxlen > 0);
+@@ -904,7 +905,7 @@ int nfnl_addattr16(struct nlmsghdr *n, int maxlen, int type,
+ }
+ 
+ /**
+- * nfnl_nfa_addattr32 - Add u_int32_t attribute to struct nfattr 
++ * nfnl_nfa_addattr32 - Add uint32_t attribute to struct nfattr
+  *
+  * @nfa: struct nfattr
+  * @maxlen: maximal length of nfattr buffer
+@@ -913,7 +914,7 @@ int nfnl_addattr16(struct nlmsghdr *n, int maxlen, int type,
+  *
+  */
+ int nfnl_nfa_addattr32(struct nfattr *nfa, int maxlen, int type, 
+-		       u_int32_t data)
++		       uint32_t data)
+ {
+ 	assert(nfa);
+ 	assert(maxlen > 0);
+@@ -923,7 +924,7 @@ int nfnl_nfa_addattr32(struct nfattr *nfa, int maxlen, int type,
+ }
+ 
+ /**
+- * nfnl_addattr32 - Add u_int32_t attribute to nlmsghdr
++ * nfnl_addattr32 - Add uint32_t attribute to nlmsghdr
+  *
+  * @n: netlink message header to which attribute is to be added
+  * @maxlen: maximum length of netlink message header
+@@ -932,7 +933,7 @@ int nfnl_nfa_addattr32(struct nfattr *nfa, int maxlen, int type,
+  *
+  */
+ int nfnl_addattr32(struct nlmsghdr *n, int maxlen, int type,
+-		   u_int32_t data)
++		   uint32_t data)
+ {
+ 	assert(n);
+ 	assert(maxlen > 0);
+@@ -980,7 +981,7 @@ int nfnl_parse_attr(struct nfattr *tb[], int max, struct nfattr *nfa, int len)
+  *
+  */ 
+ void nfnl_build_nfa_iovec(struct iovec *iov, struct nfattr *nfa, 
+-			  u_int16_t type, u_int32_t len, unsigned char *val)
++			  uint16_t type, uint32_t len, unsigned char *val)
+ {
+ 	assert(iov);
+ 	assert(nfa);
+@@ -1115,7 +1116,7 @@ struct nlmsghdr *nfnl_get_msg_next(struct nfnl_handle *h,
+  * appropiately.
+  */
+ int nfnl_callback_register(struct nfnl_subsys_handle *ssh,
+-			   u_int8_t type, struct nfnl_callback *cb)
++			   uint8_t type, struct nfnl_callback *cb)
+ {
+ 	assert(ssh);
+ 	assert(cb);
+@@ -1138,7 +1139,7 @@ int nfnl_callback_register(struct nfnl_subsys_handle *ssh,
+  * On sucess, 0 is returned. On error, -1 is returned and errno is
+  * set appropiately.
+  */
+-int nfnl_callback_unregister(struct nfnl_subsys_handle *ssh, u_int8_t type)
++int nfnl_callback_unregister(struct nfnl_subsys_handle *ssh, uint8_t type)
+ {
+ 	assert(ssh);
+ 
+@@ -1161,8 +1162,8 @@ int nfnl_check_attributes(const struct nfnl_handle *h,
+ 	assert(nfa);
+ 
+ 	int min_len;
+-	u_int8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
+-	u_int8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
++	uint8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
++	uint8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
+ 	const struct nfnl_subsys_handle *ssh;
+ 	struct nfnl_callback *cb;
+ 
+@@ -1212,8 +1213,8 @@ static int __nfnl_handle_msg(struct nfnl_handle *h, struct nlmsghdr *nlh,
+ 			     int len)
+ {
+ 	struct nfnl_subsys_handle *ssh;
+-	u_int8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
+-	u_int8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
++	uint8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
++	uint8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
+ 	int err = 0;
+ 
+ 	if (subsys_id > NFNL_MAX_SUBSYS)
+@@ -1243,7 +1244,7 @@ int nfnl_handle_packet(struct nfnl_handle *h, char *buf, int len)
+ {
+ 
+ 	while (len >= NLMSG_SPACE(0)) {
+-		u_int32_t rlen;
++		uint32_t rlen;
+ 		struct nlmsghdr *nlh = (struct nlmsghdr *)buf;
+ 
+ 		if (nlh->nlmsg_len < sizeof(struct nlmsghdr)
+@@ -1285,8 +1286,8 @@ static int nfnl_is_error(struct nfnl_handle *h, struct nlmsghdr *nlh)
+ static int nfnl_step(struct nfnl_handle *h, struct nlmsghdr *nlh)
+ {
+ 	struct nfnl_subsys_handle *ssh;
+-	u_int8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
+-	u_int8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
++	uint8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
++	uint8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
+ 
+ 	/* Is this an error message? */
+ 	if (nfnl_is_error(h, nlh)) {
+diff --git a/src/rtnl.c b/src/rtnl.c
+index 7b4ac7d..34802fe 100644
+--- a/src/rtnl.c
++++ b/src/rtnl.c
+@@ -11,6 +11,7 @@
+ /* rtnetlink - routing table netlink interface */
+ 
+ #include <unistd.h>
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <errno.h>
+@@ -30,7 +31,7 @@
+ #define rtnl_log(x, ...)
+ 
+ static inline struct rtnl_handler *
+-find_handler(struct rtnl_handle *rtnl_handle, u_int16_t type)
++find_handler(struct rtnl_handle *rtnl_handle, uint16_t type)
+ {
+ 	struct rtnl_handler *h;
+ 	for (h = rtnl_handle->handlers; h; h = h->next) {
+@@ -41,7 +42,7 @@ find_handler(struct rtnl_handle *rtnl_handle, u_int16_t type)
+ }
+ 
+ static int call_handler(struct rtnl_handle *rtnl_handle,
+-			u_int16_t type,
++			uint16_t type,
+ 			struct nlmsghdr *hdr)
+ {
+ 	struct rtnl_handler *h = find_handler(rtnl_handle, type);
+diff --git a/src/rtnl.h b/src/rtnl.h
+index 0c403dc..9858ae5 100644
+--- a/src/rtnl.h
++++ b/src/rtnl.h
+@@ -1,13 +1,14 @@
+ #ifndef _RTNL_H
+ #define _RTNL_H
+ 
++#include <stdint.h>
+ #include <linux/types.h>
+ #include <linux/rtnetlink.h>
+ 
+ struct rtnl_handler {
+ 	struct rtnl_handler *next;
+ 
+-	u_int16_t	nlmsg_type;
++	uint16_t	nlmsg_type;
+ 	int		(*handlefn)(struct nlmsghdr *h, void *arg);
+ 	void		*arg;
+ };
diff --git a/pkgs/development/libraries/libnfnetlink/default.nix b/pkgs/development/libraries/libnfnetlink/default.nix
index be60612a4ff2..5395b5b2e99c 100644
--- a/pkgs/development/libraries/libnfnetlink/default.nix
+++ b/pkgs/development/libraries/libnfnetlink/default.nix
@@ -8,6 +8,10 @@ stdenv.mkDerivation rec {
     sha256 = "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j";
   };
 
+  patches = [
+    ./Use-stdlib-uint-instead-of-u_int.patch
+  ];
+
   meta = {
     description = "Low-level library for netfilter related kernel/userspace communication";
     longDescription = ''
diff --git a/pkgs/development/libraries/libnsl/cdefs.patch b/pkgs/development/libraries/libnsl/cdefs.patch
new file mode 100644
index 000000000000..dbbe800a3479
--- /dev/null
+++ b/pkgs/development/libraries/libnsl/cdefs.patch
@@ -0,0 +1,30 @@
+--- a/src/rpcsvc/nislib.h
++++ b/src/rpcsvc/nislib.h
+@@ -19,6 +19,7 @@
+ #ifndef	__RPCSVC_NISLIB_H__
+ #define	__RPCSVC_NISLIB_H__
+ 
++#include <sys/cdefs.h>
+ #include <features.h>
+ 
+ __BEGIN_DECLS
+--- a/src/rpcsvc/ypclnt.h
++++ b/src/rpcsvc/ypclnt.h
+@@ -20,6 +20,7 @@
+ #ifndef	__RPCSVC_YPCLNT_H__
+ #define	__RPCSVC_YPCLNT_H__
+ 
++#include <sys/cdefs.h>
+ #include <features.h>
+ 
+ /* Some defines */
+--- a/src/rpcsvc/ypupd.h
++++ b/src/rpcsvc/ypupd.h
+@@ -33,6 +33,7 @@
+ #ifndef __RPCSVC_YPUPD_H__
+ #define __RPCSVC_YPUPD_H__
+ 
++#include <sys/cdefs.h>
+ #include <features.h>
+ 
+ #include <rpc/rpc.h>
diff --git a/pkgs/development/libraries/libnsl/default.nix b/pkgs/development/libraries/libnsl/default.nix
index d4af280c3cd8..9e8a46b2e6b3 100644
--- a/pkgs/development/libraries/libnsl/default.nix
+++ b/pkgs/development/libraries/libnsl/default.nix
@@ -14,6 +14,8 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
   buildInputs = [ libtirpc ];
 
+  patches = stdenv.lib.optionals stdenv.hostPlatform.isMusl [ ./cdefs.patch ./nis_h.patch ];
+
   meta = with stdenv.lib; {
     description = "Client interface library for NIS(YP) and NIS+";
     homepage = https://github.com/thkukuk/libnsl;
diff --git a/pkgs/development/libraries/libnsl/nis_h.patch b/pkgs/development/libraries/libnsl/nis_h.patch
new file mode 100644
index 000000000000..199259df2e8d
--- /dev/null
+++ b/pkgs/development/libraries/libnsl/nis_h.patch
@@ -0,0 +1,45 @@
+--- a/src/rpcsvc/nis.h
++++ b/src/rpcsvc/nis.h
+@@ -32,6 +32,7 @@
+ #ifndef _RPCSVC_NIS_H
+ #define _RPCSVC_NIS_H 1
+ 
++#include <sys/cdefs.h>
+ #include <features.h>
+ #include <rpc/rpc.h>
+ #include <rpcsvc/nis_tags.h>
+@@ -56,6 +57,34 @@
+  *                                              <kukuk@suse.de>
+  */
+ 
++#ifndef rawmemchr
++#define rawmemchr(s,c) memchr((s),(size_t)-1,(c))
++#endif
++
++#ifndef __asprintf
++#define __asprintf asprintf
++#endif
++
++#ifndef __mempcpy
++#define __mempcpy mempcpy
++#endif
++
++#ifndef __strtok_r
++#define __strtok_r strtok_r
++#endif
++
++#ifndef __always_inline
++#define __always_inline __attribute__((__always_inline__))
++#endif
++
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(exp) ({ \
++typeof (exp) _rc; \
++ do { \
++  _rc = (exp); \
++ } while (_rc == -1 && errno == EINTR); \
++ _rc; })
++#endif
+ 
+ #ifndef __nis_object_h
+ #define __nis_object_h
diff --git a/pkgs/development/libraries/libproxy/default.nix b/pkgs/development/libraries/libproxy/default.nix
index 614890e929f7..bf9e2d079cd6 100644
--- a/pkgs/development/libraries/libproxy/default.nix
+++ b/pkgs/development/libraries/libproxy/default.nix
@@ -1,5 +1,6 @@
-{ stdenv, lib, fetchFromGitHub, pkgconfig, cmake
-, dbus, networkmanager, spidermonkey_38, pcre, python2, python3 }:
+{ stdenv, lib, fetchFromGitHub, pkgconfig, cmake, zlib
+, dbus, networkmanager, spidermonkey_38, pcre, python2, python3
+, SystemConfiguration, CoreFoundation, JavaScriptCore }:
 
 stdenv.mkDerivation rec {
   name = "libproxy-${version}";
@@ -16,7 +17,10 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig cmake ];
 
-  buildInputs = [ dbus networkmanager spidermonkey_38 pcre python2 python3 ];
+  buildInputs = [ pcre python2 python3 zlib ]
+        ++ (if stdenv.hostPlatform.isDarwin
+            then [ SystemConfiguration CoreFoundation JavaScriptCore ]
+            else [ spidermonkey_38 dbus networkmanager ]);
 
   preConfigure = ''
     cmakeFlagsArray+=(
@@ -27,7 +31,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with stdenv.lib; {
-    platforms = platforms.linux;
+    platforms = platforms.linux ++ platforms.darwin;
     license = licenses.lgpl21;
     homepage = http://libproxy.github.io/libproxy/;
     description = "A library that provides automatic proxy configuration management";
diff --git a/pkgs/development/libraries/librevenge/default.nix b/pkgs/development/libraries/librevenge/default.nix
index 3523eb5c37bc..2c6e792ae8ce 100644
--- a/pkgs/development/libraries/librevenge/default.nix
+++ b/pkgs/development/libraries/librevenge/default.nix
@@ -21,11 +21,10 @@ stdenv.mkDerivation {
     inherit (s) url sha256;
   };
 
-  # Clang generates warnings in Boost's header files
+  # Clang and gcc-7 generate warnings, and
   # -Werror causes these warnings to be interpreted as errors
   # Simplest solution: disable -Werror
-  configureFlags = if stdenv.cc.isClang
-    then [ "--disable-werror" ] else null;
+  configureFlags = [ "--disable-werror" ];
 
   # Fix an issue with boost 1.59
   # This is fixed upstream so please remove this when updating
diff --git a/pkgs/development/libraries/librsvg/default.nix b/pkgs/development/libraries/librsvg/default.nix
index 09a0f4444b54..cf43bb951929 100644
--- a/pkgs/development/libraries/librsvg/default.nix
+++ b/pkgs/development/libraries/librsvg/default.nix
@@ -1,16 +1,22 @@
 { lib, stdenv, fetchurl, pkgconfig, glib, gdk_pixbuf, pango, cairo, libxml2, libgsf
-, bzip2, libcroco, libintlOrEmpty, darwin
+, bzip2, libcroco, libintlOrEmpty, darwin, rust
 , withGTK ? false, gtk3 ? null
 , gobjectIntrospection ? null, enableIntrospection ? false }:
 
 # no introspection by default, it's too big
 
+let
+  version = "2.42.2";
+  releaseVersion = (lib.concatStringsSep "." (lib.lists.take 2
+    (lib.splitString "." version)));
+
+in
 stdenv.mkDerivation rec {
-  name = "librsvg-2.40.19";
+  name = "librsvg-${version}";
 
   src = fetchurl {
-    url    = "mirror://gnome/sources/librsvg/2.40/librsvg-2.40.18.tar.xz";
-    sha256 = "0k2nbd4g31qinkdfd8r5c5ih2ixl85fbkgkqqh9747lwr24c9j5z";
+    url    = "mirror://gnome/sources/librsvg/${releaseVersion}/${name}.tar.xz";
+    sha256 = "0c550a0bffef768a436286116c03d9f6cd3f97f5021c13e7f093b550fac12562";
   };
 
   NIX_LDFLAGS = if stdenv.isDarwin then "-lintl" else null;
@@ -22,7 +28,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ glib gdk_pixbuf cairo ] ++ lib.optional withGTK gtk3;
 
-  nativeBuildInputs = [ pkgconfig ]
+  nativeBuildInputs = [ pkgconfig rust.rustc rust.cargo ]
     ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
       ApplicationServices
     ]);
diff --git a/pkgs/development/libraries/libtasn1/default.nix b/pkgs/development/libraries/libtasn1/default.nix
index ccdc3aba6118..cc5b19f7a595 100644
--- a/pkgs/development/libraries/libtasn1/default.nix
+++ b/pkgs/development/libraries/libtasn1/default.nix
@@ -1,21 +1,13 @@
 { stdenv, fetchurl, perl, texinfo }:
 
 stdenv.mkDerivation rec {
-  name = "libtasn1-4.12";
+  name = "libtasn1-4.13";
 
   src = fetchurl {
     url = "mirror://gnu/libtasn1/${name}.tar.gz";
-    sha256 = "0ls7jdq3y5fnrwg0pzhq11m21r8pshac2705bczz6mqjc8pdllv7";
+    sha256 = "1jlc1iahj8k3haz28j55nzg7sgni5h41vqy461i1bpbx6668wlky";
   };
 
-  patches = [
-    (fetchurl {
-      name = "CVE-2017-10790.patch";
-      url = "https://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=patch;h=d8d805e1f2e6799bb2dff4871a8598dc83088a39";
-      sha256 = "1v5w0dazp9qc2v7pc8b6g7s4dz5ak10hzrn35hx66q76yzrrzp7i";
-    })
-  ];
-
   outputs = [ "out" "dev" "devdoc" ];
   outputBin = "dev";
 
diff --git a/pkgs/development/libraries/libunique/default.nix b/pkgs/development/libraries/libunique/default.nix
index a5adaa9ac179..1bef76836542 100644
--- a/pkgs/development/libraries/libunique/default.nix
+++ b/pkgs/development/libraries/libunique/default.nix
@@ -13,7 +13,8 @@ stdenv.mkDerivation rec {
     ./1.1.6-fix-test.patch
     ./1.1.6-G_CONST_RETURN.patch
     ./1.1.6-include-terminator.patch
-  ];
+  ]
+    ++ [ ./gcc7-bug.patch ];
 
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ glib gtk2 dbus_glib ];
@@ -24,7 +25,7 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   meta = {
-    homepage = http://live.gnome.org/LibUnique;
+    homepage = https://wiki.gnome.org/Attic/LibUnique;
     description = "A library for writing single instance applications";
     license = stdenv.lib.licenses.lgpl21;
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/development/libraries/libunique/gcc7-bug.patch b/pkgs/development/libraries/libunique/gcc7-bug.patch
new file mode 100644
index 000000000000..2b0587510bc0
--- /dev/null
+++ b/pkgs/development/libraries/libunique/gcc7-bug.patch
@@ -0,0 +1,18 @@
+gcc-7 newly detects this class of bugs.
+In this particular case it's clear that the inention was
+to detect if the string is non-NULL *and* non-empty.
+
+
+diff --git a/unique/uniqueapp.c b/unique/uniqueapp.c
+index b40a86c..66a7226 100644
+--- a/unique/uniqueapp.c
++++ b/unique/uniqueapp.c
+@@ -176,7 +176,7 @@ set_startup_id (UniqueBackend *backend,
+ {
+   gchar *id;
+ 
+-  if (startup_id && startup_id != '\0')
++  if (startup_id && *startup_id != '\0')
+     id = g_strdup (startup_id);
+   else
+     {
diff --git a/pkgs/development/libraries/libunistring/default.nix b/pkgs/development/libraries/libunistring/default.nix
index e1b8c04b4ce5..8d1f5115bdf0 100644
--- a/pkgs/development/libraries/libunistring/default.nix
+++ b/pkgs/development/libraries/libunistring/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     "--with-libiconv-prefix=${libiconv}"
   ];
 
-  doCheck = true;
+  doCheck = !stdenv.hostPlatform.isMusl;
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch b/pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch
new file mode 100644
index 000000000000..5fcaa72c0c01
--- /dev/null
+++ b/pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch
@@ -0,0 +1,45 @@
+From 04437142399662b576bd55a85485c6dcc14d0812 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem at gmail.com>
+Date: Thu, 31 Dec 2015 06:44:07 +0000
+Subject: [PATCH] backtrace: Use only with glibc and uclibc
+
+backtrace API is glibc specific not linux specific
+so make it behave so.
+
+Signed-off-by: Khem Raj <raj.khem at gmail.com>
+---
+Upstream-Status: Pending
+
+ tests/test-coredump-unwind.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/tests/test-coredump-unwind.c b/tests/test-coredump-unwind.c
+index 5254708..8767b42 100644
+--- a/tests/test-coredump-unwind.c
++++ b/tests/test-coredump-unwind.c
+@@ -57,7 +57,9 @@
+ #include <grp.h>
+ 
+ /* For SIGSEGV handler code */
++#ifdef __GLIBC__
+ #include <execinfo.h>
++#endif
+ #include <sys/ucontext.h>
+ 
+ #include <libunwind-coredump.h>
+@@ -238,11 +240,11 @@ void handle_sigsegv(int sig, siginfo_t *info, void *ucontext)
+ 			ip);
+ 
+   {
++#ifdef __GLIBC__
+     /* glibc extension */
+     void *array[50];
+     int size;
+     size = backtrace(array, 50);
+-#ifdef __linux__
+     backtrace_symbols_fd(array, size, 2);
+ #endif
+   }
+-- 
+2.6.4
+
diff --git a/pkgs/development/libraries/libunwind/default.nix b/pkgs/development/libraries/libunwind/default.nix
index 8565bc75ff9f..6afdac3fdf5c 100644
--- a/pkgs/development/libraries/libunwind/default.nix
+++ b/pkgs/development/libraries/libunwind/default.nix
@@ -11,6 +11,7 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./version-1.2.1.patch
+    ./backtrace-only-with-glibc.patch
   ];
 
   nativeBuildInputs = [ autoreconfHook ];
diff --git a/pkgs/development/libraries/libusb/default.nix b/pkgs/development/libraries/libusb/default.nix
index 1fd3cb39bbff..4704a1e5c331 100644
--- a/pkgs/development/libraries/libusb/default.nix
+++ b/pkgs/development/libraries/libusb/default.nix
@@ -14,6 +14,8 @@ stdenv.mkDerivation {
     sha256 = "0nn5icrfm9lkhzw1xjvaks9bq3w6mjg86ggv3fn7kgi4nfvg8kj0";
   };
 
+  patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ./fix-headers.patch;
+
   meta = {
     platforms = stdenv.lib.platforms.unix;
   };
diff --git a/pkgs/development/libraries/libusb/fix-headers.patch b/pkgs/development/libraries/libusb/fix-headers.patch
new file mode 100644
index 000000000000..ea9cbc34978e
--- /dev/null
+++ b/pkgs/development/libraries/libusb/fix-headers.patch
@@ -0,0 +1,10 @@
+--- libusb-compat-0.1.5.orig/libusb/usb.h
++++ libusb-compat-0.1.5/libusb/usb.h
+@@ -25,6 +25,7 @@
+ #ifndef __USB_H__
+ #define __USB_H__
+ 
++#include <sys/types.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <limits.h>
diff --git a/pkgs/development/libraries/libuv/default.nix b/pkgs/development/libraries/libuv/default.nix
index 4075505f8dd8..59fd95eefeee 100644
--- a/pkgs/development/libraries/libuv/default.nix
+++ b/pkgs/development/libraries/libuv/default.nix
@@ -2,14 +2,14 @@
 , ApplicationServices, CoreServices }:
 
 stdenv.mkDerivation rec {
-  version = "1.18.0";
+  version = "1.19.1";
   name = "libuv-${version}";
 
   src = fetchFromGitHub {
     owner = "libuv";
     repo = "libuv";
     rev = "v${version}";
-    sha256 = "0s71c2y4ll3vp463hsdk74q4hr7wprkxc2a4agw3za2hhzcb95pd";
+    sha256 = "020jap4xvjns1rgb2kvpf1nib3f2d5fyqh04afgkk32hiag0kn66";
   };
 
   postPatch = let
diff --git a/pkgs/development/libraries/libwps/default.nix b/pkgs/development/libraries/libwps/default.nix
index 73fe5b55ab45..37ff9d098c5c 100644
--- a/pkgs/development/libraries/libwps/default.nix
+++ b/pkgs/development/libraries/libwps/default.nix
@@ -12,6 +12,8 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ boost librevenge zlib ];
 
+  NIX_CFLAGS_COMPILE = [ "-Wno-error=implicit-fallthrough" ]; # newly detected by gcc-7
+
   meta = with stdenv.lib; {
     homepage = http://libwps.sourceforge.net/;
     description = "Microsoft Works document format import filter library";
diff --git a/pkgs/development/libraries/libxml2/default.nix b/pkgs/development/libraries/libxml2/default.nix
index b19f4a2953f1..c4f3ff1efdd5 100644
--- a/pkgs/development/libraries/libxml2/default.nix
+++ b/pkgs/development/libraries/libxml2/default.nix
@@ -36,7 +36,8 @@ in stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  doCheck = (stdenv.hostPlatform == stdenv.buildPlatform) && !stdenv.isDarwin;
+  doCheck = (stdenv.hostPlatform == stdenv.buildPlatform) && !stdenv.isDarwin &&
+    hostPlatform.libc != "musl";
 
   crossAttrs = lib.optionalAttrs (hostPlatform.libc == "msvcrt") {
     # creating the DLL is broken ATM
diff --git a/pkgs/development/libraries/libyaml-cpp/default.nix b/pkgs/development/libraries/libyaml-cpp/default.nix
index f02843707265..fc4c280d47c2 100644
--- a/pkgs/development/libraries/libyaml-cpp/default.nix
+++ b/pkgs/development/libraries/libyaml-cpp/default.nix
@@ -2,28 +2,26 @@
 
 stdenv.mkDerivation rec {
   name = "libyaml-cpp-${version}";
-  version = "0.5.3";
+  version = "0.6.1";
 
   src = fetchFromGitHub {
     owner = "jbeder";
     repo = "yaml-cpp";
-    rev = "release-${version}";
-    sha256 = "0qr286q8mwbr4cxz0y0rf045zc071qh3cb804by6w1ydlqciih8a";
+    rev = "yaml-cpp-${version}";
+    sha256 = "16x53p9gfch7gpyg865j7m1zhqsixx2hbbd206ffjv0ip8cjipjf";
   };
 
   outputs = [ "out" "dev" ];
 
-  buildInputs = [ cmake boost ];
+  nativeBuildInputs = [ cmake ];
 
   cmakeFlags = "-DBUILD_SHARED_LIBS=ON";
 
-  enableParallelBuilding = true;
-
   meta = with stdenv.lib; {
     inherit (src.meta) homepage;
     description = "A YAML parser and emitter for C++";
     license = licenses.mit;
     platforms = platforms.unix;
-    maintainers = with maintainers; [ wkennington ];
+    maintainers = with maintainers; [ andir ];
   };
 }
diff --git a/pkgs/development/libraries/mbedtls/darwin_dylib.patch b/pkgs/development/libraries/mbedtls/darwin_dylib.patch
new file mode 100644
index 000000000000..bc6992d6e779
--- /dev/null
+++ b/pkgs/development/libraries/mbedtls/darwin_dylib.patch
@@ -0,0 +1,28 @@
+diff --git a/library/Makefile b/library/Makefile
+index 28f9231..ad9cc32 100644
+--- a/library/Makefile
++++ b/library/Makefile
+@@ -103,9 +103,9 @@ libmbedtls.so: libmbedtls.$(SOEXT_TLS)
+ 	echo "  LN    $@ -> $<"
+ 	ln -sf $< $@
+ 
+-libmbedtls.dylib: $(OBJS_TLS)
++libmbedtls.dylib: $(OBJS_TLS) libmbedx509.dylib
+ 	echo "  LD    $@"
+-	$(CC) -dynamiclib $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS_TLS)
++	$(CC) -dynamiclib -L. -lmbedcrypto -lmbedx509 $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS_TLS)
+ 
+ libmbedtls.dll: $(OBJS_TLS) libmbedx509.dll
+ 	echo "  LD    $@"
+@@ -126,9 +126,9 @@ libmbedx509.so: libmbedx509.$(SOEXT_X509)
+ 	echo "  LN    $@ -> $<"
+ 	ln -sf $< $@
+ 
+-libmbedx509.dylib: $(OBJS_X509)
++libmbedx509.dylib: $(OBJS_X509) libmbedcrypto.dylib
+ 	echo "  LD    $@"
+-	$(CC) -dynamiclib $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS_X509)
++	$(CC) -dynamiclib -L. -lmbedcrypto  $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ $(OBJS_X509)
+ 
+ libmbedx509.dll: $(OBJS_X509) libmbedcrypto.dll
+ 	echo "  LD    $@"
diff --git a/pkgs/development/libraries/mbedtls/default.nix b/pkgs/development/libraries/mbedtls/default.nix
index 82d867fedf04..f84e00dfadf7 100644
--- a/pkgs/development/libraries/mbedtls/default.nix
+++ b/pkgs/development/libraries/mbedtls/default.nix
@@ -12,19 +12,21 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ perl ];
 
-  patchPhase = stdenv.lib.optionalString stdenv.isDarwin ''
+  patches = stdenv.lib.optionals stdenv.isDarwin [ ./darwin_dylib.patch ];
+
+  postPatch = ''
+    patchShebangs .
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
     substituteInPlace library/Makefile --replace "-soname" "-install_name"
     substituteInPlace tests/scripts/run-test-suites.pl --replace "LD_LIBRARY_PATH" "DYLD_LIBRARY_PATH"
     # Necessary for install_name_tool below
     echo "LOCAL_LDFLAGS += -headerpad_max_install_names" >> programs/Makefile
   '';
 
-  postPatch = ''
-    patchShebangs .
-  '';
-
   makeFlags = [
     "SHARED=1"
+  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+    "DLEXT=dylib"
   ];
 
   installFlags = [
@@ -32,14 +34,14 @@ stdenv.mkDerivation rec {
   ];
 
   postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
-      install_name_tool -change libmbedcrypto.so.0 $out/lib/libmbedcrypto.so.0 $out/lib/libmbedtls.so.10
-      install_name_tool -change libmbedcrypto.so.0 $out/lib/libmbedcrypto.so.0 $out/lib/libmbedx509.so.0
-      install_name_tool -change libmbedx509.so.0 $out/lib/libmbedx509.so.0 $out/lib/libmbedtls.so.10
+      install_name_tool -change libmbedcrypto.dylib $out/lib/libmbedcrypto.dylib $out/lib/libmbedtls.dylib
+      install_name_tool -change libmbedcrypto.dylib $out/lib/libmbedcrypto.dylib $out/lib/libmbedx509.dylib
+      install_name_tool -change libmbedx509.dylib $out/lib/libmbedx509.dylib $out/lib/libmbedtls.dylib
 
       for exe in $out/bin/*; do
-          install_name_tool -change libmbedtls.so.10 $out/lib/libmbedtls.so.10 $exe
-          install_name_tool -change libmbedx509.so.0 $out/lib/libmbedx509.so.0 $exe
-          install_name_tool -change libmbedcrypto.so.0 $out/lib/libmbedcrypto.so.0 $exe
+          install_name_tool -change libmbedtls.dylib $out/lib/libmbedtls.dylib $exe
+          install_name_tool -change libmbedx509.dylib $out/lib/libmbedx509.dylib $exe
+          install_name_tool -change libmbedcrypto.dylib $out/lib/libmbedcrypto.dylib $exe
       done
   '';
 
diff --git a/pkgs/development/libraries/mediastreamer/default.nix b/pkgs/development/libraries/mediastreamer/default.nix
index 06cc53abb564..90f154367643 100644
--- a/pkgs/development/libraries/mediastreamer/default.nix
+++ b/pkgs/development/libraries/mediastreamer/default.nix
@@ -1,22 +1,29 @@
 { stdenv, fetchurl, pkgconfig, intltool, alsaLib, libpulseaudio, speex, gsm
 , libopus, ffmpeg, libX11, libXv, mesa, glew, libtheora, libvpx, SDL, libupnp
 , ortp, libv4l, libpcap, srtp, fetchFromGitHub, cmake, bctoolbox, doxygen
-, python, libXext, libmatroska, openssl
+, python, libXext, libmatroska, openssl, fetchpatch
 }:
 
 stdenv.mkDerivation rec {
   baseName = "mediastreamer2";
-  version = "2.14.0";
+  version = "2.16.1";
   name = "${baseName}-${version}";
 
   src = fetchFromGitHub {
     owner = "BelledonneCommunications";
     repo = "${baseName}";
     rev = "${version}";
-    sha256 = "1b59rzsaw54mhy4pz9hndmim4rgidkn7s6c4iyl34mz58lwxpmqp";
+    sha256 = "02745bzl2r1jqvdqzyv94fjd4w92zr976la4c4nfvsy52waqah7j";
   };
 
-  patches = [ ./plugins_dir.patch ];
+  patches = [
+    (fetchpatch {
+      name = "allow-build-without-git.patch";
+      url = "https://github.com/BelledonneCommunications/mediastreamer2/commit/de3a24b795d7a78e78eab6b974e7ec5abf2259ac.patch";
+      sha256 = "1zqkrab42n4dha0knfsyj4q0wc229ma125gk9grj67ps7r7ipscy";
+    })
+    ./plugins_dir.patch
+  ];
 
   nativeBuildInputs = [ pkgconfig intltool cmake doxygen python ];
 
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index 8df248e3e461..fa3336c4cea0 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -92,7 +92,7 @@ stdenv.mkDerivation {
   patches = [
     ./glx_ro_text_segm.patch # fix for grsecurity/PaX
     ./symlink-drivers.patch
-  ];
+  ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./musl-fixes.patch;
 
   outputs = [ "out" "dev" "drivers" "osmesa" ];
 
diff --git a/pkgs/development/libraries/mesa/musl-fixes.patch b/pkgs/development/libraries/mesa/musl-fixes.patch
new file mode 100644
index 000000000000..60140d445ae8
--- /dev/null
+++ b/pkgs/development/libraries/mesa/musl-fixes.patch
@@ -0,0 +1,22 @@
+--- ./src/gallium/winsys/svga/drm/vmw_screen.h.orig
++++ ./src/gallium/winsys/svga/drm/vmw_screen.h
+@@ -34,7 +34,7 @@
+ #ifndef VMW_SCREEN_H_
+ #define VMW_SCREEN_H_
+ 
+-
++#include <sys/stat.h>
+ #include "pipe/p_compiler.h"
+ #include "pipe/p_state.h"
+ 
+--- a/src/util/u_endian.h.orig	2016-11-04 12:16:00.480356454 +0100
++++ b/src/util/u_endian.h	2016-11-04 12:16:11.984347944 +0100
+@@ -27,7 +27,7 @@
+ #ifndef U_ENDIAN_H
+ #define U_ENDIAN_H
+ 
+-#if defined(__GLIBC__) || defined(ANDROID) || defined(__CYGWIN__)
++#if defined(__linux__) || defined(ANDROID) || defined(__CYGWIN__)
+ #include <endian.h>
+ 
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
diff --git a/pkgs/development/libraries/mimetic/default.nix b/pkgs/development/libraries/mimetic/default.nix
index fc48c85f23c7..7a06f9277c95 100644
--- a/pkgs/development/libraries/mimetic/default.nix
+++ b/pkgs/development/libraries/mimetic/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "MIME handling library";
-    homepage    = http://codesink.org/mimetic_mime_library.html;
+    homepage    = http://www.codesink.org/mimetic_mime_library.html;
     license     = licenses.mit;
     maintainers = with maintainers; [ leenaars];
     platforms = platforms.linux;
diff --git a/pkgs/development/libraries/mp4v2/default.nix b/pkgs/development/libraries/mp4v2/default.nix
index 736c31b442a5..a5542ebb659a 100644
--- a/pkgs/development/libraries/mp4v2/default.nix
+++ b/pkgs/development/libraries/mp4v2/default.nix
@@ -8,11 +8,19 @@ stdenv.mkDerivation rec {
     sha256 = "0f438bimimsvxjbdp4vsr8hjw2nwggmhaxgcw07g2z361fkbj683";
   };
 
-  # From Handbrake
-  # mp4v2 doesn't seem to be actively maintained any more :-/
   patches = [
+    # From Handbrake
+    # mp4v2 doesn't seem to be actively maintained any more :-/
     ./A02-meaningful-4gb-warning.patch
+
+    (fetchurl {
+      name = "gcc-7.patch";
+      url = "https://src.fedoraproject.org/cgit/rpms/libmp4v2.git/plain/"
+          + "0004-Fix-GCC7-build.patch?id=d7aeedabb";
+      sha256 = "0sbn0il7lmk77yrjyb4f0a3z3h8gsmdkscvz5n9hmrrrhrwf672w";
+    })
   ];
+
   # `faac' expects `mp4.h'.
   postInstall = "ln -s mp4v2/mp4v2.h $out/include/mp4.h";
 
diff --git a/pkgs/development/libraries/mpfr/default.nix b/pkgs/development/libraries/mpfr/default.nix
index fe364f22f9a3..4aac5a927092 100644
--- a/pkgs/development/libraries/mpfr/default.nix
+++ b/pkgs/development/libraries/mpfr/default.nix
@@ -1,17 +1,15 @@
 { stdenv, fetchurl, gmp
-, buildPlatform, hostPlatform
+, hostPlatform
 }:
 
 stdenv.mkDerivation rec {
-  name = "mpfr-3.1.3";
+  name = "mpfr-3.1.6";
 
   src = fetchurl {
-    url = "mirror://gnu/mpfr/${name}.tar.bz2";
-    sha256 = "1z8akfw9wbmq91vrx04bw86mmnxw2sw5qm5cr8ix5b3w2mcv8fzn";
+    url = "mirror://gnu/mpfr/${name}.tar.xz";
+    sha256 = "0l598h9klpgkz2bp0rxiqb90mkqh9f2f81n5rpy191j00hdaqqks";
   };
 
-  patches = [ ./upstream.patch ];
-
   outputs = [ "out" "dev" "doc" "info" ];
 
   # mpfr.h requires gmp.h
diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix
index 0dd7b37e1a66..d63536e75f06 100644
--- a/pkgs/development/libraries/ncurses/default.nix
+++ b/pkgs/development/libraries/ncurses/default.nix
@@ -11,23 +11,21 @@
 }:
 
 stdenv.mkDerivation rec {
-  version = if abiVersion == "5" then "5.9" else "6.0-20171125";
-  name = "ncurses-${version}";
+  version = "6.0-20171125";
+  name = "ncurses-${version}" + lib.optionalString (abiVersion == "5") "-abi5-compat";
 
-  src = fetchurl (if abiVersion == "5" then {
-    url = "mirror://gnu/ncurses/${name}.tar.gz";
-    sha256 = "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh";
-  } else {
+  src = fetchurl {
     urls = [
-      "ftp://ftp.invisible-island.net/ncurses/current/${name}.tgz"
-      "https://invisible-mirror.net/archives/ncurses/current/${name}.tgz"
+      # Remove this mirror on next upgrade, it's only needed because upstream took ncurses-6.0-20171125.tgz down!
+      "http://bld1.alpinelinux.org/distfiles/v3.5/ncurses-${version}.tgz"
+
+      "ftp://ftp.invisible-island.net/ncurses/current/ncurses-${version}.tgz"
+      "https://invisible-mirror.net/archives/ncurses/current/ncurses-${version}.tgz"
     ];
     sha256 = "11adzj0k82nlgpfrflabvqn2m7fmhp2y6pd7ivmapynxqb9vvb92";
-  });
+  };
 
-  # Unnecessarily complicated in order to avoid mass-rebuilds
-  patches = lib.optional (!stdenv.cc.isClang || abiVersion == "5") ./clang.patch
-    ++ lib.optional (stdenv.cc.isGNU && abiVersion == "5") ./gcc-5.patch;
+  patches = lib.optional (!stdenv.cc.isClang) ./clang.patch;
 
   outputs = [ "out" "dev" "man" ];
   setOutputFlags = false; # some aren't supported
@@ -37,7 +35,8 @@ stdenv.mkDerivation rec {
     "--without-debug"
     "--enable-pc-files"
     "--enable-symlinks"
-  ] ++ lib.optional unicode "--enable-widec";
+  ] ++ lib.optional unicode "--enable-widec"
+    ++ lib.optional (abiVersion == "5") "--with-abi-version=5";
 
   # Only the C compiler, and explicitly not C++ compiler needs this flag on solaris:
   CFLAGS = lib.optionalString stdenv.isSunOS "-D_XOPEN_SOURCE_EXTENDED";
diff --git a/pkgs/development/libraries/ncurses/gcc-5.patch b/pkgs/development/libraries/ncurses/gcc-5.patch
deleted file mode 100644
index 2448229b88e1..000000000000
--- a/pkgs/development/libraries/ncurses/gcc-5.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-https://bugs.gentoo.org/545114
-
-extracted from the upstream change (which had many unrelated commits in one)
-
-From 97bb4678dc03e753290b39bbff30ba2825df9517 Mon Sep 17 00:00:00 2001
-From: "Thomas E. Dickey" <dickey@invisible-island.net>
-Date: Sun, 7 Dec 2014 03:10:09 +0000
-Subject: [PATCH] ncurses 5.9 - patch 20141206
-
-+ modify MKlib_gen.sh to work around change in development version of
-  gcc introduced here:
-	  https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
-	  https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00236.html
-  (reports by Marcus Shawcroft, Maohui Lei).
-
-diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh
-index d8cc3c9..b91398c 100755
---- a/ncurses/base/MKlib_gen.sh
-+++ b/ncurses/base/MKlib_gen.sh
-@@ -474,11 +474,22 @@ sed -n -f $ED1 \
- 	-e 's/gen_$//' \
- 	-e 's/  / /g' >>$TMP
- 
-+cat >$ED1 <<EOF
-+s/  / /g
-+s/^ //
-+s/ $//
-+s/P_NCURSES_BOOL/NCURSES_BOOL/g
-+EOF
-+
-+# A patch discussed here:
-+#	https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
-+# introduces spurious #line markers.  Work around that by ignoring the system's
-+# attempt to define "bool" and using our own symbol here.
-+sed -e 's/bool/P_NCURSES_BOOL/g' $TMP > $ED2
-+cat $ED2 >$TMP
-+
- $preprocessor $TMP 2>/dev/null \
--| sed \
--	-e 's/  / /g' \
--	-e 's/^ //' \
--	-e 's/_Bool/NCURSES_BOOL/g' \
-+| sed -f $ED1 \
- | $AWK -f $AW2 \
- | sed -f $ED3 \
- | sed \
diff --git a/pkgs/development/libraries/nettle/generic.nix b/pkgs/development/libraries/nettle/generic.nix
index 9633dacd68f2..3af93469cf16 100644
--- a/pkgs/development/libraries/nettle/generic.nix
+++ b/pkgs/development/libraries/nettle/generic.nix
@@ -1,4 +1,4 @@
-{ stdenv, gmp, gnum4
+{ stdenv, buildPackages, gmp, gnum4
 
 # Version specific args
 , version, src
@@ -12,7 +12,8 @@ stdenv.mkDerivation (rec {
   outputs = [ "out" "dev" ];
   outputBin = "dev";
 
-  buildInputs = [ gnum4 ];
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ gnum4 ];
   propagatedBuildInputs = [ gmp ];
 
   doCheck = (stdenv.system != "i686-cygwin" && !stdenv.isDarwin);
diff --git a/pkgs/development/libraries/nix-plugins/default.nix b/pkgs/development/libraries/nix-plugins/default.nix
index 2dcc7e9a53dd..8ccaf726e6b0 100644
--- a/pkgs/development/libraries/nix-plugins/default.nix
+++ b/pkgs/development/libraries/nix-plugins/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchFromGitHub, nix, boehmgc }:
-let version = "2.0.7"; in
+{ stdenv, fetchFromGitHub, nix, cmake, pkgconfig }:
+let version = "3.0.1"; in
 stdenv.mkDerivation {
   name = "nix-plugins-${version}";
 
@@ -7,12 +7,12 @@ stdenv.mkDerivation {
     owner = "shlevy";
     repo = "nix-plugins";
     rev = version;
-    sha256 = "1q4ydp2w114wbfm41m4qgrabha7ifa17xyz5dr137vvnj6njp4vs";
+    sha256 = "1pmk2m0kc6a3jqygm5cy1fl5gbcy0ghc2xs4ww0gh20walrys82r";
   };
 
-  buildFlags = [ "NIX_INCLUDE=${nix.dev}/include" "GC_INCLUDE=${boehmgc.dev}/include" ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
-  installFlags = [ "PREFIX=$(out)" ];
+  buildInputs = [ nix ];
 
   meta = {
     description = "Collection of miscellaneous plugins for the nix expression language";
diff --git a/pkgs/development/libraries/npth/default.nix b/pkgs/development/libraries/npth/default.nix
index dc4f4926e9d5..a600938cdbb2 100644
--- a/pkgs/development/libraries/npth/default.nix
+++ b/pkgs/development/libraries/npth/default.nix
@@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
     sha256 = "1hmkkp6vzyrh8v01c2ynzf9vwikyagp7p1lxhbnr4ysk3w66jji9";
   };
 
+  doCheck = true;
+
   meta = with stdenv.lib; {
     description = "The New GNU Portable Threads Library";
     longDescription = ''
diff --git a/pkgs/development/libraries/nspr/default.nix b/pkgs/development/libraries/nspr/default.nix
index 2930de508e99..ccb04024f643 100644
--- a/pkgs/development/libraries/nspr/default.nix
+++ b/pkgs/development/libraries/nspr/default.nix
@@ -16,6 +16,9 @@ stdenv.mkDerivation {
 
   preConfigure = ''
     cd nspr
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    substituteInPlace configure --replace '@executable_path/' "$out/lib/"
+    substituteInPlace configure.in --replace '@executable_path/' "$out/lib/"
   '';
 
   configureFlags = [
diff --git a/pkgs/development/libraries/nss/default.nix b/pkgs/development/libraries/nss/default.nix
index 8d799e2c13a0..a8f36af5df58 100644
--- a/pkgs/development/libraries/nss/default.nix
+++ b/pkgs/development/libraries/nss/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, nspr, perl, zlib, sqlite }:
+{ stdenv, fetchurl, nspr, perl, zlib, sqlite, fixDarwinDylibNames }:
 
 let
 
@@ -16,7 +16,8 @@ in stdenv.mkDerivation rec {
     sha256 = "186x33wsk4mzjz7dzbn8p0py9a0nzkgzpfkdv4rlyy5gghv5vhd3";
   };
 
-  buildInputs = [ perl zlib sqlite ];
+  buildInputs = [ perl zlib sqlite ]
+    ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
   propagatedBuildInputs = [ nspr ];
 
@@ -33,6 +34,10 @@ in stdenv.mkDerivation rec {
 
   patchFlags = "-p0";
 
+  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+    substituteInPlace nss/coreconf/Darwin.mk --replace '@executable_path/$(notdir $@)' "$out/lib/\$(notdir \$@)"
+  '';
+
   outputs = [ "out" "dev" "tools" ];
 
   preConfigure = "cd nss";
diff --git a/pkgs/development/libraries/ocl-icd/default.nix b/pkgs/development/libraries/ocl-icd/default.nix
index 6c3a77cfaf5e..75dda07494d9 100644
--- a/pkgs/development/libraries/ocl-icd/default.nix
+++ b/pkgs/development/libraries/ocl-icd/default.nix
@@ -9,14 +9,16 @@ stdenv.mkDerivation rec {
     sha256 = "0f14gpa13sdm0kzqv5yycp4pschbmi6n5fj7wl4ilspzsrqcgqr2";
   };
 
-  buildInputs = [ ruby opencl-headers ];
+  nativeBuildInputs = [ ruby ];
+
+  buildInputs = [ opencl-headers ];
 
   postPatch = ''
     sed -i 's,"/etc/OpenCL/vendors","${mesa_noglu.driverLink}/etc/OpenCL/vendors",g' ocl_icd_loader.c
   '';
 
   meta = with stdenv.lib; {
-    description = "OpenCL ICD Loader";
+    description = "OpenCL ICD Loader for ${opencl-headers.name}";
     homepage    = https://forge.imag.fr/projects/ocl-icd/;
     license     = licenses.bsd2;
     platforms = platforms.linux;
diff --git a/pkgs/development/libraries/opencl-headers/default.nix b/pkgs/development/libraries/opencl-headers/default.nix
index 717bb5ad0eed..9ce8bb618bf9 100644
--- a/pkgs/development/libraries/opencl-headers/default.nix
+++ b/pkgs/development/libraries/opencl-headers/default.nix
@@ -1,22 +1,24 @@
-{ stdenv, fetchFromGitHub }:
+{ stdenv, fetchFromGitHub
+, version # "12" for "1.2", "22" for "2.2" and so on
+}:
 
 stdenv.mkDerivation rec {
-  name = "opencl-headers-2.1-2016-11-29";
+  name = "opencl-headers-${version}-2017-07-18";
 
   src = fetchFromGitHub {
     owner = "KhronosGroup";
     repo = "OpenCL-Headers";
-    rev = "abb29588550c77f8340a6c3683531407013bf26b";
-    sha256 = "0zjznq65i4b2h4k36qfbbzq1acf2jdd9vygjv5az1yk7qgsp4jj7";
+    rev = "f039db6764d52388658ef15c30b2237bbda49803";
+    sha256 = "0z04i330zr8czak2624q71aajdcq7ly8mb5bgala5m235qjpsrh7";
   };
 
   installPhase = ''
     mkdir -p $out/include/CL
-    cp * $out/include/CL
+    cp opencl${version}/CL/* $out/include/CL
   '';
 
   meta = with stdenv.lib; {
-    description = "Khronos OpenCL headers";
+    description = "Khronos OpenCL headers version ${version}";
     homepage = https://www.khronos.org/registry/cl/;
     license = licenses.mit;
     platforms = platforms.unix;
diff --git a/pkgs/development/libraries/openmpi/default.nix b/pkgs/development/libraries/openmpi/default.nix
index c2f79753bd19..9aca076c5dcb 100644
--- a/pkgs/development/libraries/openmpi/default.nix
+++ b/pkgs/development/libraries/openmpi/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, gfortran, perl, rdma-core
+{ stdenv, fetchurl, gfortran, perl, libnl, rdma-core, zlib
 
 # Enable the Sun Grid Engine bindings
 , enableSGE ? false
@@ -7,44 +7,48 @@
 , enablePrefix ? false
 }:
 
-with stdenv.lib;
-
 let
-  majorVersion = "1.10";
+  majorVersion = "3.0";
+  minorVersion = "0";
 
 in stdenv.mkDerivation rec {
-  name = "openmpi-${majorVersion}.7";
+  name = "openmpi-${majorVersion}.${minorVersion}";
 
   src = fetchurl {
     url = "http://www.open-mpi.org/software/ompi/v${majorVersion}/downloads/${name}.tar.bz2";
-    sha256 = "142s1vny9gllkq336yafxayjgcirj2jv0ddabj879jgya7hyr2d0";
+    sha256 = "1mw2d94k6mp4scg1wnkj50vdh734fy5m2ygyrj65s4mh3prbz6gn";
   };
 
-  buildInputs = [ gfortran ]
-    ++ optional (stdenv.isLinux || stdenv.isFreeBSD) rdma-core;
+  postPatch = ''
+    patchShebangs ./
+  '';
+
+  buildInputs = with stdenv; [ gfortran zlib ]
+    ++ lib.optional isLinux libnl
+    ++ lib.optional (isLinux || isFreeBSD) rdma-core;
 
   nativeBuildInputs = [ perl ];
 
-  configureFlags = []
-    ++ optional enableSGE "--with-sge"
-    ++ optional enablePrefix "--enable-mpirun-prefix-by-default"
+  configureFlags = with stdenv; [ "--disable-mca-dso" ]
+    ++ lib.optional isLinux  "--with-libnl=${libnl.dev}"
+    ++ lib.optional enableSGE "--with-sge"
+    ++ lib.optional enablePrefix "--enable-mpirun-prefix-by-default"
     ;
 
   enableParallelBuilding = true;
 
-  preBuild = ''
-    patchShebangs ompi/mpi/fortran/base/gen-mpi-sizeof.pl
-  '';
-
   postInstall = ''
-		rm -f $out/lib/*.la
+    rm -f $out/lib/*.la
    '';
 
-  meta = {
+  doCheck = true;
+
+  meta = with stdenv.lib; {
     homepage = http://www.open-mpi.org/;
-    description = "Open source MPI-2 implementation";
-    longDescription = "The Open MPI Project is an open source MPI-2 implementation that is developed and maintained by a consortium of academic, research, and industry partners. Open MPI is therefore able to combine the expertise, technologies, and resources from all across the High Performance Computing community in order to build the best MPI library available. Open MPI offers advantages for system and software vendors, application developers and computer science researchers.";
-    maintainers = [ ];
+    description = "Open source MPI-3 implementation";
+    longDescription = "The Open MPI Project is an open source MPI-3 implementation that is developed and maintained by a consortium of academic, research, and industry partners. Open MPI is therefore able to combine the expertise, technologies, and resources from all across the High Performance Computing community in order to build the best MPI library available. Open MPI offers advantages for system and software vendors, application developers and computer science researchers.";
+    maintainers = with maintainers; [ markuskowa ];
+    license = licenses.bsd3;
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix
index 775e6056dffc..af6a540b97c0 100644
--- a/pkgs/development/libraries/openssl/default.nix
+++ b/pkgs/development/libraries/openssl/default.nix
@@ -24,6 +24,12 @@ let
       ++ optional (versionOlder version "1.0.2" && hostPlatform.isDarwin)
            ./darwin-arch.patch;
 
+  postPatch = if (versionAtLeast version "1.1.0" && stdenv.hostPlatform.isMusl) then ''
+    substituteInPlace crypto/async/arch/async_posix.h \
+      --replace '!defined(__ANDROID__) && !defined(__OpenBSD__)' \
+                '!defined(__ANDROID__) && !defined(__OpenBSD__) && 0'
+  '' else null;
+
     outputs = [ "bin" "dev" "out" "man" ];
     setOutputFlags = false;
     separateDebugInfo = hostPlatform.isLinux;
@@ -49,6 +55,10 @@ let
     # TODO(@Ericson2314): Make unconditional on mass rebuild
     ${if buildPlatform != hostPlatform then "configurePlatforms" else null} = [];
 
+    preConfigure = ''
+      patchShebangs Configure
+    '';
+
     configureFlags = [
       "shared"
       "--libdir=lib"
diff --git a/pkgs/development/libraries/ortp/default.nix b/pkgs/development/libraries/ortp/default.nix
index f05811f34813..5dc5df8e95b9 100644
--- a/pkgs/development/libraries/ortp/default.nix
+++ b/pkgs/development/libraries/ortp/default.nix
@@ -2,14 +2,14 @@
 
 stdenv.mkDerivation rec {
   baseName = "ortp";
-  version = "0.27.0";
+  version = "1.0.2";
   name = "${baseName}-${version}";
 
   src = fetchFromGitHub {
     owner = "BelledonneCommunications";
     repo = "${baseName}";
     rev = "${version}";
-    sha256 = "0gjaaph4pamay9gn1yn7ky5wyzhj93r53rwak7h8s48vf08fqyv7";
+    sha256 = "12cwv593bsdnxs0zfcp07vwyk7ghlz2wv7vdbs1ksv293w3vj2rv";
   };
 
   buildInputs = [ bctoolbox ];
diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix
index b34c9ff31f2c..2ea5e923bad0 100644
--- a/pkgs/development/libraries/pcre/default.nix
+++ b/pkgs/development/libraries/pcre/default.nix
@@ -24,8 +24,7 @@ in stdenv.mkDerivation rec {
 
   outputs = [ "bin" "dev" "out" "doc" "man" ];
 
-  configureFlags = [
-    "--enable-jit"
+  configureFlags = optional (!hostPlatform.isRiscV) "--enable-jit" ++ [
     "--enable-unicode-properties"
     "--disable-cpp"
   ]
diff --git a/pkgs/development/libraries/pipewire/default.nix b/pkgs/development/libraries/pipewire/default.nix
new file mode 100644
index 000000000000..3bd94c977e84
--- /dev/null
+++ b/pkgs/development/libraries/pipewire/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig, doxygen, graphviz, valgrind
+, glib, dbus, gst_all_1, v4l_utils, alsaLib, ffmpeg, libjack2, libudev, libva, xlibs
+, sbc, SDL2
+}:
+
+let
+  version = "0.1.8";
+in stdenv.mkDerivation rec {
+  name = "pipewire-${version}";
+
+  src = fetchFromGitHub {
+    owner = "PipeWire";
+    repo = "pipewire";
+    rev = version;
+    sha256 = "1nim8d1lsf6yxk97piwmsz686w84b09lk6cagbyjr9m3k2hwybqn";
+  };
+
+  outputs = [ "out" "dev" "doc" ];
+
+  nativeBuildInputs = [
+    meson ninja pkgconfig doxygen graphviz valgrind
+  ];
+  buildInputs = [
+    glib dbus gst_all_1.gst-plugins-base gst_all_1.gstreamer v4l_utils
+    alsaLib ffmpeg libjack2 libudev libva xlibs.libX11 sbc SDL2
+  ];
+
+  patches = [
+    ./fix-paths.patch
+  ];
+
+  mesonFlags = [
+    "-Denable_docs=true"
+    "-Denable_gstreamer=true"
+  ];
+
+  doCheck = true;
+  checkPhase = "meson test";
+
+  meta = with stdenv.lib; {
+    description = "Server and user space API to deal with multimedia pipelines";
+    homepage = http://pipewire.org/;
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ jtojnar ];
+  };
+}
diff --git a/pkgs/development/libraries/pipewire/fix-paths.patch b/pkgs/development/libraries/pipewire/fix-paths.patch
new file mode 100644
index 000000000000..5a07c6271e14
--- /dev/null
+++ b/pkgs/development/libraries/pipewire/fix-paths.patch
@@ -0,0 +1,8 @@
+--- a/src/daemon/systemd/user/meson.build
++++ b/src/daemon/systemd/user/meson.build
+@@ -1,4 +1,4 @@
+-systemd_user_services_dir = systemd.get_pkgconfig_variable('systemduserunitdir')
++systemd_user_services_dir = join_paths(get_option('prefix'), 'etc', 'systemd', 'user')
+ 
+ install_data(sources : 'pipewire.socket', install_dir : systemd_user_services_dir)
+ 
diff --git a/pkgs/development/libraries/pixman/default.nix b/pkgs/development/libraries/pixman/default.nix
index dc378711d36b..6b891bdb38c2 100644
--- a/pkgs/development/libraries/pixman/default.nix
+++ b/pkgs/development/libraries/pixman/default.nix
@@ -1,16 +1,25 @@
-{ fetchurl, stdenv, pkgconfig, libpng, glib /*just passthru*/ }:
+{ stdenv, fetchurl, fetchpatch, autoconf, automake, libtool, pkgconfig, libpng, glib /*just passthru*/ }:
 
 stdenv.mkDerivation rec {
-  name = "pixman-0.34.0";
+  name = "pixman-${version}";
+  version = "0.34.0";
 
   src = fetchurl {
     url = "mirror://xorg/individual/lib/${name}.tar.bz2";
     sha256 = "184lazwdpv67zrlxxswpxrdap85wminh1gmq1i5lcz6iycw39fir";
   };
 
-  patches = [];
+  patches = stdenv.lib.optionals stdenv.cc.isClang [
+    (fetchpatch {
+      name = "builtin-shuffle.patch";
+      url = https://patchwork.freedesktop.org/patch/177506/raw;
+      sha256 = "0rvraq93769dy2im2m022rz99fcdxprgc2fbmasnddcwrqy1x3xr";
+    })
+  ];
+
+  nativeBuildInputs = [ pkgconfig ]
+    ++ stdenv.lib.optionals stdenv.cc.isClang [ autoconf automake libtool ];
 
-  nativeBuildInputs = [ pkgconfig ];
   buildInputs = stdenv.lib.optional doCheck libpng;
 
   configureFlags = stdenv.lib.optional stdenv.isArm "--disable-arm-iwmmxt";
diff --git a/pkgs/development/libraries/polkit/default.nix b/pkgs/development/libraries/polkit/default.nix
index aef627f8f1fe..6bf9bcb954c1 100644
--- a/pkgs/development/libraries/polkit/default.nix
+++ b/pkgs/development/libraries/polkit/default.nix
@@ -26,18 +26,26 @@ stdenv.mkDerivation rec {
 
   patches = [
     (fetchpatch {
-      url = "http://pkgs.fedoraproject.org/cgit/rpms/polkit.git/plain/polkit-0.113-agent-leaks.patch?id=fa6fd575804de92886c95d3bc2b7eb2abcd13760";
+      url = "http://src.fedoraproject.org/cgit/rpms/polkit.git/plain/polkit-0.113-agent-leaks.patch?id=fa6fd575804de92886c95d3bc2b7eb2abcd13760";
       sha256 = "1cxnhj0y30g7ldqq1y6zwsbdwcx7h97d3mpd3h5jy7dhg3h9ym91";
     })
     (fetchpatch {
-      url = "http://pkgs.fedoraproject.org/cgit/rpms/polkit.git/plain/polkit-0.113-polkitpermission-leak.patch?id=fa6fd575804de92886c95d3bc2b7eb2abcd13760";
+      url = "http://src.fedoraproject.org/cgit/rpms/polkit.git/plain/polkit-0.113-polkitpermission-leak.patch?id=fa6fd575804de92886c95d3bc2b7eb2abcd13760";
       sha256 = "1h1rkd4avqyyr8q6836zzr3w10jf521gcqnvhrhzwdpgp1ay4si7";
     })
     (fetchpatch {
-      url = "http://pkgs.fedoraproject.org/cgit/rpms/polkit.git/plain/polkit-0.113-itstool.patch?id=fa6fd575804de92886c95d3bc2b7eb2abcd13760";
+      url = "http://src.fedoraproject.org/cgit/rpms/polkit.git/plain/polkit-0.113-itstool.patch?id=fa6fd575804de92886c95d3bc2b7eb2abcd13760";
       sha256 = "0bxmjwp8ahy1y5g1l0kxmld0l3mlvb2l0i5n1qabia3d5iyjkyfh";
     })
-  ];
+  ]
+  # Could be applied uncondtionally but don't want to trigger rebuild
+  # https://bugs.freedesktop.org/show_bug.cgi?id=50145
+  ++ stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
+    name = "netgroup-optional.patch";
+    url = "https://bugs.freedesktop.org/attachment.cgi?id=118753";
+    sha256 = "1zq51dhmqi9zi86bj9dq4i4pxlxm41k3k4a091j07bd78cjba038";
+  });
+
 
   outputs = [ "bin" "dev" "out" ]; # small man pages in $bin
 
diff --git a/pkgs/development/libraries/ppl/default.nix b/pkgs/development/libraries/ppl/default.nix
index 73eda630e449..566d88dcdb56 100644
--- a/pkgs/development/libraries/ppl/default.nix
+++ b/pkgs/development/libraries/ppl/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, gmpxx, perl, gnum4 }:
+{ fetchurl, fetchpatch, stdenv, gmpxx, perl, gnum4 }:
 
 let version = "1.2"; in
 
@@ -10,6 +10,12 @@ stdenv.mkDerivation rec {
     sha256 = "1wgxcbgmijgk11df43aiqfzv31r3bkxmgb4yl68g21194q60nird";
   };
 
+  patches = [(fetchpatch {
+    name = "ppl.patch";
+    url = "http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=patch;h=c39f6a07b51f89e365b05ba4147aa2aa448febd7";
+    sha256 = "1zj90hm25pkgvk4jlkfzh18ak9b98217gbidl3731fdccbw6hr87";
+  })];
+
   nativeBuildInputs = [ perl gnum4 ];
   propagatedBuildInputs = [ gmpxx ];
 
diff --git a/pkgs/development/libraries/psol/default.nix b/pkgs/development/libraries/psol/default.nix
index dd6037e68329..270c24dc01f4 100644
--- a/pkgs/development/libraries/psol/default.nix
+++ b/pkgs/development/libraries/psol/default.nix
@@ -1,5 +1,5 @@
 { callPackage }:
 callPackage ./generic.nix {} {
-  version = "1.13.35.1"; # Latest beta, 2017-11-08
-  sha256  = "126823gpr3rdqakwixmr887rbvwhksr3xg14jnyzlp84q4hg1p0n";
+  version = "1.13.35.2"; # Latest stable, 2018-02-05
+  sha256  = "0xi2srf9gx0x2sz9r45zb35k2n0iv457if1lqzvbanls3f935cmr";
 }
diff --git a/pkgs/development/libraries/qpdf/default.nix b/pkgs/development/libraries/qpdf/default.nix
index e2c80e445e76..42c4b028aa83 100644
--- a/pkgs/development/libraries/qpdf/default.nix
+++ b/pkgs/development/libraries/qpdf/default.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, libjpeg, zlib, perl }:
 
-let version = "7.0.0";
+let version = "7.1.1";
 in
 stdenv.mkDerivation rec {
   name = "qpdf-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/qpdf/qpdf/${version}/${name}.tar.gz";
-    sha256 = "0py6p27fx4qrwq9mvcybna42b0bdi359x38lzmggxl5a9khqvl7y";
+    sha256 = "1ypjxm74dhn9c4mj027zzkh0z4kpw9xiqwh3pjmmghm502hby3ca";
   };
 
   nativeBuildInputs = [ perl ];
diff --git a/pkgs/development/libraries/qt-4.x/4.8/clang-5-darwin.patch b/pkgs/development/libraries/qt-4.x/4.8/clang-5-darwin.patch
new file mode 100644
index 000000000000..7b181f3ad896
--- /dev/null
+++ b/pkgs/development/libraries/qt-4.x/4.8/clang-5-darwin.patch
@@ -0,0 +1,13 @@
+diff --git a/src/gui/text/qfontengine_coretext.mm b/src/gui/text/qfontengine_coretext.mm
+index 204d685..e05179e 100644
+--- a/src/gui/text/qfontengine_coretext.mm
++++ b/src/gui/text/qfontengine_coretext.mm
+@@ -886,7 +886,7 @@ void QCoreTextFontEngine::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, gl
+ 
+ QFixed QCoreTextFontEngine::emSquareSize() const
+ {
+-    return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));
++    return QFixed(int(CTFontGetUnitsPerEm(ctfont)));
+ }
+ 
+ QFontEngine *QCoreTextFontEngine::cloneWithSize(qreal pixelSize) const
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 488306fc1ce2..8b3fd8c66781 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 {
     [ ./glib-2.32.patch
       ./libressl.patch
       ./parallel-configure.patch
+      ./clang-5-darwin.patch
       ./qt-4.8.7-unixmake-darwin.patch
       (substituteAll {
         src = ./dlopen-absolute-paths.diff;
@@ -106,7 +107,13 @@ stdenv.mkDerivation rec {
     ++ stdenv.lib.optional stdenv.isAarch64 (fetchpatch {
         url = "https://src.fedoraproject.org/rpms/qt/raw/ecf530486e0fb7fe31bad26805cde61115562b2b/f/qt-aarch64.patch";
         sha256 = "1fbjh78nmafqmj7yk67qwjbhl3f6ylkp6x33b1dqxfw9gld8b3gl";
-      });
+      })
+    ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
+        ./qt-musl.patch
+        ./qt-musl-iconv-no-bom.patch
+        ./patch-qthread-stacksize.diff
+        ./qsettings-recursive-global-mutex.patch
+      ];
 
   preConfigure = ''
     export LD_LIBRARY_PATH="`pwd`/lib:$LD_LIBRARY_PATH"
@@ -169,13 +176,14 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   NIX_CFLAGS_COMPILE =
-    optionalString stdenv.isLinux "-std=gnu++98" # gnu++ in (Obj)C flags is no good on Darwin
-    + optionalString (stdenv.isFreeBSD || stdenv.isDarwin)
-      " -I${glib.dev}/include/glib-2.0 -I${glib.out}/lib/glib-2.0/include"
-    + optionalString stdenv.isDarwin " -I${libcxx}/include/c++/v1";
-
-  NIX_LDFLAGS = optionalString (stdenv.isFreeBSD || stdenv.isDarwin)
-    "-lglib-2.0";
+    # with gcc7 the warnings blow the log over Hydra's limit
+    [ "-Wno-expansion-to-defined" "-Wno-unused-local-typedefs" ]
+    ++ optional stdenv.isLinux "-std=gnu++98" # gnu++ in (Obj)C flags is no good on Darwin
+    ++ optionals (stdenv.isFreeBSD || stdenv.isDarwin)
+      [ "-I${glib.dev}/include/glib-2.0" "-I${glib.out}/lib/glib-2.0/include" ]
+    ++ optional stdenv.isDarwin "-I${libcxx}/include/c++/v1";
+
+  NIX_LDFLAGS = optionalString (stdenv.isFreeBSD || stdenv.isDarwin) "-lglib-2.0";
 
   preBuild = optionalString stdenv.isDarwin ''
     # resolve "extra qualification on member" error
diff --git a/pkgs/development/libraries/qt-4.x/4.8/patch-qthread-stacksize.diff b/pkgs/development/libraries/qt-4.x/4.8/patch-qthread-stacksize.diff
new file mode 100644
index 000000000000..53a4c70ac3ae
--- /dev/null
+++ b/pkgs/development/libraries/qt-4.x/4.8/patch-qthread-stacksize.diff
@@ -0,0 +1,54 @@
+--- a/src/corelib/thread/qthread_unix.cpp.orig	2015-11-23 19:05:40.000000000 +0100
++++ b/src/corelib/thread/qthread_unix.cpp	2015-11-24 11:22:31.000000000 +0100
+@@ -79,6 +79,7 @@
+ #endif
+ 
++#include <sys/resource.h> // getrlimit/setrlimit
+ #if defined(Q_OS_MAC)
+ # ifdef qDebug
+ #   define old_qDebug qDebug
+ #   undef qDebug
+@@ -649,6 +650,43 @@
+ #endif // QT_HAS_THREAD_PRIORITY_SCHEDULING
+ 
+ 
++    if (d->stackSize == 0) {
++        // Fix the default (too small) stack size for threads on OS X,
++        // which also affects the thread pool.
++        // See also:
++        // https://bugreports.qt.io/browse/QTBUG-2568
++        // This fix can also be found in Chromium:
++        // https://chromium.googlesource.com/chromium/src.git/+/master/base/threading/platform_thread_mac.mm#186
++
++        // The Mac OS X default for a pthread stack size is 512kB.
++        // Libc-594.1.4/pthreads/pthread.c's pthread_attr_init uses
++        // DEFAULT_STACK_SIZE for this purpose.
++        //
++        // 512kB isn't quite generous enough for some deeply recursive threads that
++        // otherwise request the default stack size by specifying 0. Here, adopt
++        // glibc's behavior as on Linux, which is to use the current stack size
++        // limit (ulimit -s) as the default stack size. See
++        // glibc-2.11.1/nptl/nptl-init.c's __pthread_initialize_minimal_internal. To
++        // avoid setting the limit below the Mac OS X default or the minimum usable
++        // stack size, these values are also considered. If any of these values
++        // can't be determined, or if stack size is unlimited (ulimit -s unlimited),
++        // stack_size is left at 0 to get the system default.
++        //
++        // Mac OS X normally only applies ulimit -s to the main thread stack. On
++        // contemporary OS X and Linux systems alike, this value is generally 8MB
++        // or in that neighborhood.
++        size_t default_stack_size = 0;
++        struct rlimit stack_rlimit;
++        if (pthread_attr_getstacksize(&attr, &default_stack_size) == 0 &&
++            getrlimit(RLIMIT_STACK, &stack_rlimit) == 0 &&
++            stack_rlimit.rlim_cur != RLIM_INFINITY) {
++            default_stack_size =
++                    std::max(std::max(default_stack_size,
++                                      static_cast<size_t>(PTHREAD_STACK_MIN)),
++                             static_cast<size_t>(stack_rlimit.rlim_cur));
++        }
++        d->stackSize = default_stack_size;
++    }
+     if (d->stackSize > 0) {
+ #if defined(_POSIX_THREAD_ATTR_STACKSIZE) && (_POSIX_THREAD_ATTR_STACKSIZE-0 > 0)
+         int code = pthread_attr_setstacksize(&attr, d->stackSize);
diff --git a/pkgs/development/libraries/qt-4.x/4.8/qsettings-recursive-global-mutex.patch b/pkgs/development/libraries/qt-4.x/4.8/qsettings-recursive-global-mutex.patch
new file mode 100644
index 000000000000..229123c54f76
--- /dev/null
+++ b/pkgs/development/libraries/qt-4.x/4.8/qsettings-recursive-global-mutex.patch
@@ -0,0 +1,17 @@
+Calling qsettings before constructing qapplications causes a dead-lock.
+
+http://sourceforge.net/tracker/?func=detail&aid=3168620&group_id=4932&atid=104932
+http://developer.qt.nokia.com/forums/viewthread/10365
+
+
+--- ./src/corelib/io/qsettings.cpp.orig
++++ ./src/corelib/io/qsettings.cpp
+@@ -122,7 +122,7 @@
+ Q_GLOBAL_STATIC(ConfFileCache, unusedCacheFunc)
+ Q_GLOBAL_STATIC(PathHash, pathHashFunc)
+ Q_GLOBAL_STATIC(CustomFormatVector, customFormatVectorFunc)
+-Q_GLOBAL_STATIC(QMutex, globalMutex)
++Q_GLOBAL_STATIC_WITH_ARGS(QMutex, globalMutex, (QMutex::Recursive))
+ static QSettings::Format globalDefaultFormat = QSettings::NativeFormat;
+ 
+ #ifndef Q_OS_WIN
diff --git a/pkgs/development/libraries/qt-4.x/4.8/qt-musl-iconv-no-bom.patch b/pkgs/development/libraries/qt-4.x/4.8/qt-musl-iconv-no-bom.patch
new file mode 100644
index 000000000000..35380ad6714d
--- /dev/null
+++ b/pkgs/development/libraries/qt-4.x/4.8/qt-musl-iconv-no-bom.patch
@@ -0,0 +1,11 @@
+--- qt-everywhere-opensource-src-4.8.5/src/corelib/codecs/qiconvcodec.cpp.orig
++++ qt-everywhere-opensource-src-4.8.5/src/corelib/codecs/qiconvcodec.cpp
+@@ -62,7 +62,7 @@
+ #elif defined(Q_OS_AIX)
+ #  define NO_BOM
+ #  define UTF16 "UCS-2"
+-#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
++#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC) || (defined(Q_OS_LINUX) && !defined(__GLIBC__))
+ #  define NO_BOM
+ #  if Q_BYTE_ORDER == Q_BIG_ENDIAN
+ #    define UTF16 "UTF-16BE"
diff --git a/pkgs/development/libraries/qt-4.x/4.8/qt-musl.patch b/pkgs/development/libraries/qt-4.x/4.8/qt-musl.patch
new file mode 100644
index 000000000000..90b9ccda08c9
--- /dev/null
+++ b/pkgs/development/libraries/qt-4.x/4.8/qt-musl.patch
@@ -0,0 +1,14 @@
+--- qt-everywhere-opensource-src-4.8.5/mkspecs/linux-g++/qplatformdefs.h.orig
++++ qt-everywhere-opensource-src-4.8.5/mkspecs/linux-g++/qplatformdefs.h
+@@ -86,11 +86,7 @@
+ 
+ #undef QT_SOCKLEN_T
+ 
+-#if defined(__GLIBC__) && (__GLIBC__ >= 2)
+ #define QT_SOCKLEN_T            socklen_t
+-#else
+-#define QT_SOCKLEN_T            int
+-#endif
+ 
+ #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
+ #define QT_SNPRINTF		::snprintf
diff --git a/pkgs/development/libraries/qt-5/5.10/default.nix b/pkgs/development/libraries/qt-5/5.10/default.nix
index cf66e60d5696..eeff34568332 100644
--- a/pkgs/development/libraries/qt-5/5.10/default.nix
+++ b/pkgs/development/libraries/qt-5/5.10/default.nix
@@ -101,10 +101,11 @@ let
       qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {};
 
       env = callPackage ../qt-env.nix {};
-      full = env "qt-${qtbase.version}" ([
+      full = env "qt-full-${qtbase.version}" ([
         qtcharts qtconnectivity qtdeclarative qtdoc qtgraphicaleffects
-        qtimageformats qtlocation qtmultimedia qtquickcontrols qtscript
-        qtsensors qtserialport qtsvg qttools qttranslations qtwebsockets
+        qtimageformats qtlocation qtmultimedia qtquickcontrols qtquickcontrols2
+        qtscript qtsensors qtserialport qtsvg qttools qttranslations
+        qtvirtualkeyboard qtwebchannel qtwebengine qtwebkit qtwebsockets
         qtx11extras qtxmlpatterns
       ] ++ optional (!stdenv.isDarwin) qtwayland
         ++ optional (stdenv.isDarwin) qtmacextras);
diff --git a/pkgs/development/libraries/qt-5/5.10/qtbase-darwin.patch b/pkgs/development/libraries/qt-5/5.10/qtbase-darwin.patch
index e85a284f3bb6..fa389fe55c2f 100644
--- a/pkgs/development/libraries/qt-5/5.10/qtbase-darwin.patch
+++ b/pkgs/development/libraries/qt-5/5.10/qtbase-darwin.patch
@@ -1,3 +1,16 @@
+diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+index 66baf16..89794ef 100644
+--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
++++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+@@ -830,7 +830,7 @@ void QCoreTextFontEngine::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, gl
+ 
+ QFixed QCoreTextFontEngine::emSquareSize() const
+ {
+-    return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));
++    return QFixed(int(CTFontGetUnitsPerEm(ctfont)));
+ }
+ 
+ QFontEngine *QCoreTextFontEngine::cloneWithSize(qreal pixelSize) const
 diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
 index 341d3bccf2..3368234c26 100644
 --- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
diff --git a/pkgs/development/libraries/qt-5/5.6/default.nix b/pkgs/development/libraries/qt-5/5.6/default.nix
index 1200884a30ce..8793b2bb9f01 100644
--- a/pkgs/development/libraries/qt-5/5.6/default.nix
+++ b/pkgs/development/libraries/qt-5/5.6/default.nix
@@ -113,7 +113,7 @@ let
       qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {};
 
       env = callPackage ../qt-env.nix {};
-      full = env "qt-${qtbase.version}" [
+      full = env "qt-full-${qtbase.version}" [
         qtconnectivity qtdeclarative qtdoc qtgraphicaleffects qtimageformats
         qtlocation qtmultimedia qtquickcontrols qtquickcontrols2 qtscript
         qtsensors qtserialport qtsvg qttools qttranslations qtwayland
diff --git a/pkgs/development/libraries/qt-5/5.9/default.nix b/pkgs/development/libraries/qt-5/5.9/default.nix
index 9afa818c36e3..5afcdaa430e5 100644
--- a/pkgs/development/libraries/qt-5/5.9/default.nix
+++ b/pkgs/development/libraries/qt-5/5.9/default.nix
@@ -37,7 +37,7 @@ let
   srcs = import ./srcs.nix { inherit fetchurl; inherit mirror; };
 
   patches = {
-    qtbase = [ ./qtbase.patch ];
+    qtbase = [ ./qtbase.patch ] ++ optional stdenv.isDarwin ./qtbase-darwin.patch;
     qtdeclarative = [ ./qtdeclarative.patch ];
     qtscript = [ ./qtscript.patch ];
     qtserialport = [ ./qtserialport.patch ];
@@ -101,11 +101,12 @@ let
       qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {};
 
       env = callPackage ../qt-env.nix {};
-      full = env "qt-${qtbase.version}" ([
+      full = env "qt-full-${qtbase.version}" ([
         qtcharts qtconnectivity qtdeclarative qtdoc qtgraphicaleffects
-        qtimageformats qtlocation qtmultimedia qtquickcontrols qtscript
-        qtsensors qtserialport qtsvg qttools qttranslations qtwebsockets
-        qtx11extras qtxmlpatterns qtvirtualkeyboard
+        qtimageformats qtlocation qtmultimedia qtquickcontrols qtquickcontrols2
+        qtscript qtsensors qtserialport qtsvg qttools qttranslations
+        qtvirtualkeyboard qtwebchannel qtwebengine qtwebkit qtwebsockets
+        qtx11extras qtxmlpatterns
       ] ++ optional (!stdenv.isDarwin) qtwayland
         ++ optional (stdenv.isDarwin) qtmacextras);
 
diff --git a/pkgs/development/libraries/qt-5/5.9/qtbase-darwin.patch b/pkgs/development/libraries/qt-5/5.9/qtbase-darwin.patch
new file mode 100644
index 000000000000..1c3a9b05cb24
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.9/qtbase-darwin.patch
@@ -0,0 +1,48 @@
+diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+index 66baf16..89794ef 100644
+--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
++++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+@@ -830,7 +830,7 @@ void QCoreTextFontEngine::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, gl
+ 
+ QFixed QCoreTextFontEngine::emSquareSize() const
+ {
+-    return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));
++    return QFixed(int(CTFontGetUnitsPerEm(ctfont)));
+ }
+ 
+ QFontEngine *QCoreTextFontEngine::cloneWithSize(qreal pixelSize) const
+diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
+index 341d3bc..3368234 100644
+--- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
++++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm
+@@ -287,7 +287,7 @@ void QScanThread::getUserConfigurations()
+     QMacAutoReleasePool pool;
+     userProfiles.clear();
+ 
+-    NSArray<NSString *> *wifiInterfaces = [CWWiFiClient interfaceNames];
++    NSArray *wifiInterfaces = [CWWiFiClient interfaceNames];
+     for (NSString *ifName in wifiInterfaces) {
+ 
+         CWInterface *wifiInterface = [[CWWiFiClient sharedWiFiClient] interfaceWithName:ifName];
+@@ -602,7 +602,7 @@ void QCoreWlanEngine::doRequestUpdate()
+ 
+     QMacAutoReleasePool pool;
+ 
+-    NSArray<NSString *> *wifiInterfaces = [CWWiFiClient interfaceNames];
++    NSArray *wifiInterfaces = [CWWiFiClient interfaceNames];
+     for (NSString *ifName in wifiInterfaces) {
+             scanThread->interfaceName = QString::fromNSString(ifName);
+             scanThread->start();
+diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
+index 5cd4beb..84919e6 100644
+--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
++++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
+@@ -320,7 +320,7 @@ static void qt_closePopups()
+ + (void)applicationActivationChanged:(NSNotification*)notification
+ {
+     const id sender = self;
+-    NSEnumerator<NSWindow*> *windowEnumerator = nullptr;
++    NSEnumerator *windowEnumerator = nullptr;
+     NSApplication *application = [NSApplication sharedApplication];
+ 
+ #if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12)
diff --git a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
index 4dce9c4e22e5..6834b7ce87b6 100644
--- a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
@@ -31,7 +31,8 @@ qtModule {
   '';
 
   NIX_CFLAGS_COMPILE =
-    optionals flashplayerFix
+    [ "-Wno-expansion-to-defined" ] # with gcc7 this warning blows the log over Hydra's limit
+    ++ optionals flashplayerFix
       [
         ''-DNIXPKGS_LIBGTK2="${getLib gtk2}/lib/libgtk-x11-2.0"''
         ''-DNIXPKGS_LIBGDK2="${getLib gdk_pixbuf}/lib/libgdk-x11-2.0"''
diff --git a/pkgs/development/libraries/qt-5/qt-env.nix b/pkgs/development/libraries/qt-5/qt-env.nix
index 728761689b42..49585f601d14 100644
--- a/pkgs/development/libraries/qt-5/qt-env.nix
+++ b/pkgs/development/libraries/qt-5/qt-env.nix
@@ -13,9 +13,9 @@ buildEnv {
     cat >"$out/bin/qt.conf" <<EOF
     [Paths]
     Prefix = $out
-    Plugins = $qtPluginPrefix
-    Qml2Imports = $qtQmlPrefix
-    Documentation = $qtDocPrefix
+    Plugins = ${qtbase.qtPluginPrefix}
+    Qml2Imports = ${qtbase.qtQmlPrefix}
+    Documentation = ${qtbase.qtDocPrefix}
     EOF
   '';
 }
diff --git a/pkgs/development/libraries/qtscriptgenerator/qt-4.8.patch b/pkgs/development/libraries/qtscriptgenerator/qt-4.8.patch
index 0b02b0097252..8fe643e2c98f 100644
--- a/pkgs/development/libraries/qtscriptgenerator/qt-4.8.patch
+++ b/pkgs/development/libraries/qtscriptgenerator/qt-4.8.patch
@@ -1,4 +1,4 @@
-Origin: http://pkgs.fedoraproject.org/gitweb/?p=qtscriptgenerator.git;a=blob_plain;f=qtscriptgenerator-src-0.1.0-no_QFileOpenEvent.patch;h=f397b5ab13bcfc268e6d7b7ba4c6bc66ae38b5c0;hb=HEAD
+Origin: http://src.fedoraproject.org/gitweb/?p=qtscriptgenerator.git;a=blob_plain;f=qtscriptgenerator-src-0.1.0-no_QFileOpenEvent.patch;h=f397b5ab13bcfc268e6d7b7ba4c6bc66ae38b5c0;hb=HEAD
 diff -up qtscriptgenerator-src-0.1.0/generator/typesystem_gui-common.xml.no_QFileOpenEvent qtscriptgenerator-src-0.1.0/generator/typesystem_gui-common.xml
 --- qtscriptgenerator-src-0.1.0/generator/typesystem_gui-common.xml.no_QFileOpenEvent	2011-12-22 11:34:52.615149619 -0600
 +++ qtscriptgenerator-src-0.1.0/generator/typesystem_gui-common.xml	2011-12-22 11:35:31.808659632 -0600
diff --git a/pkgs/development/libraries/quickder/default.nix b/pkgs/development/libraries/quickder/default.nix
index 73bd9e863cde..77e76ad638ab 100644
--- a/pkgs/development/libraries/quickder/default.nix
+++ b/pkgs/development/libraries/quickder/default.nix
@@ -1,32 +1,53 @@
-{ stdenv, fetchFromGitHub, fetchurl, hexio, python, which, asn2quickder, bash }:
+{ stdenv, fetchFromGitHub, fetchurl, python2Packages, hexio
+, which, cmake, bash, arpa2cm, git, asn2quickder, pkgconfig }:
 
 stdenv.mkDerivation rec {
   pname = "quickder";
   name = "${pname}-${version}";
-  version = "1.0-RC2";
+  version = "1.2-6";
 
   src = fetchFromGitHub {
-    sha256 = "1nzk8x6qzpvli8bf74dc2qya63nlppqjrnkaxvjxr2dbqb8qcrqd";
+    sha256 = "00wifjydgmqw2i5vmr049visc3shjqccgzqynkmmhkjhs86ghzr6";
     rev = "version-${version}";
     owner = "vanrein";
     repo = "quick-der";
   };
 
-  buildInputs = [ which asn2quickder bash ];
+  buildInputs = with python2Packages; [
+    arpa2cm
+    asn1ate
+    bash
+    cmake
+    git
+    hexio
+    pyparsing
+    python
+    six
+    which
+    asn1ate
+    asn2quickder
+    pkgconfig
+  ];
 
-  patchPhase = ''
-    substituteInPlace Makefile \
-      --replace 'lib tool test rfc' 'lib test rfc'
-    substituteInPlace ./rfc/Makefile \
-      --replace 'ASN2QUICKDER_CMD = ' 'ASN2QUICKDER_CMD = ${asn2quickder}/bin/asn2quickder #'
-    '';
+  postPatch = ''
+    substituteInPlace ./CMakeLists.txt \
+      --replace "get_version_from_git" "set (Quick-DER_VERSION 1.2) #"
+    substituteInPlace ./CMakeLists.txt \
+      --replace \$\{ARPA2CM_TOOLCHAIN_DIR} "$out/share/ARPA2CM/toolchain/"
+    patchShebangs python/scripts/
+  '';
 
-  installFlags = "ASN2QUICKDER_DIR=${asn2quickder}/bin ASN2QUICKDER_CMD=${asn2quickder}/bin/asn2quickder";
-  installPhase = ''
-    mkdir -p $out/lib $out/man
-    make DESTDIR=$out PREFIX=/ all
-    make DESTDIR=$out PREFIX=/ install
-    '';
+  cmakeFlags = [
+    "-DNO_TESTING=ON"
+    "-DARPA2CM_TOOLCHAIN_DIR=$out/share/ARPA2CM/toolchain/"
+    "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
+    "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
+    "-DPACKAGE_NO_PACKAGE_REGISTRY=ON"
+  ];
+
+  preConfigure = ''
+    export PREFIX=$out
+  '';
 
   meta = with stdenv.lib; {
     description = "Quick (and Easy) DER, a Library for parsing ASN.1";
diff --git a/pkgs/development/libraries/rocksdb/default.nix b/pkgs/development/libraries/rocksdb/default.nix
index a791c8994856..b37a9bc04c39 100644
--- a/pkgs/development/libraries/rocksdb/default.nix
+++ b/pkgs/development/libraries/rocksdb/default.nix
@@ -1,4 +1,7 @@
-{ stdenv, fetchFromGitHub, fixDarwinDylibNames
+{ stdenv
+, fetchFromGitHub
+, fixDarwinDylibNames
+, which, perl
 
 # Optional Arguments
 , snappy ? null, google-gflags ? null, zlib ? null, bzip2 ? null, lz4 ? null
@@ -15,15 +18,16 @@ let
 in
 stdenv.mkDerivation rec {
   name = "rocksdb-${version}";
-  version = "5.1.2";
+  version = "5.10.2";
 
   src = fetchFromGitHub {
     owner = "facebook";
     repo = "rocksdb";
     rev = "v${version}";
-    sha256 = "1smahz67gcd86nkdqaml78lci89dza131mlj5472r4sxjdxsx277";
+    sha256 = "00qnd56v4qyzxg0b3ya3flf2jhbbfaibj1y53bd5ciaw3af6zxnd";
   };
-
+  
+  nativeBuildInputs = [ which perl ];
   buildInputs = [ snappy google-gflags zlib bzip2 lz4 malloc fixDarwinDylibNames ];
 
   postPatch = ''
@@ -39,16 +43,20 @@ stdenv.mkDerivation rec {
 
   ${if enableLite then "LIBNAME" else null} = "librocksdb_lite";
   ${if enableLite then "CXXFLAGS" else null} = "-DROCKSDB_LITE=1";
-
-  buildFlags = [
+  
+  buildAndInstallFlags = [
+    "USE_RTTI=1"
     "DEBUG_LEVEL=0"
+    "DISABLE_WARNING_AS_ERROR=1"     
+  ];
+
+  buildFlags = buildAndInstallFlags ++ [
     "shared_lib"
     "static_lib"
   ];
 
-  installFlags = [
+  installFlags = buildAndInstallFlags ++ [
     "INSTALL_PATH=\${out}"
-    "DEBUG_LEVEL=0"
     "install-shared"
     "install-static"
   ];
@@ -66,6 +74,6 @@ stdenv.mkDerivation rec {
     description = "A library that provides an embeddable, persistent key-value store for fast storage";
     license = licenses.bsd3;
     platforms = platforms.allBut [ "i686-linux" ];
-    maintainers = with maintainers; [ wkennington ];
+    maintainers = with maintainers; [ adev wkennington ];
   };
 }
diff --git a/pkgs/development/libraries/science/biology/htslib/default.nix b/pkgs/development/libraries/science/biology/htslib/default.nix
index b3c6d9f26d47..2144a7f78935 100644
--- a/pkgs/development/libraries/science/biology/htslib/default.nix
+++ b/pkgs/development/libraries/science/biology/htslib/default.nix
@@ -3,11 +3,11 @@
 stdenv.mkDerivation rec {
   name = "${pname}-${version}";
   pname = "htslib";
-  version = "1.6";
+  version = "1.7";
 
   src = fetchurl {
     url = "https://github.com/samtools/htslib/releases/download/${version}/${name}.tar.bz2";
-    sha256 = "1jsca3hg4rbr6iqq6imkj4lsvgl8g9768bcmny3hlff2w25vx24m";
+    sha256 = "be3d4e25c256acdd41bebb8a7ad55e89bb18e2fc7fc336124b1e2c82ae8886c6";
   };
 
   # perl is only used during the check phase.
diff --git a/pkgs/development/libraries/science/math/caffe2/default.nix b/pkgs/development/libraries/science/math/caffe2/default.nix
new file mode 100644
index 000000000000..b055acba9f15
--- /dev/null
+++ b/pkgs/development/libraries/science/math/caffe2/default.nix
@@ -0,0 +1,140 @@
+{ stdenv, lib, config, fetchFromGitHub
+, cmake
+, glog, google-gflags, gtest
+, protobuf, snappy
+, python, future, six, python-protobuf, numpy, pydot
+, eigen3
+, doxygen
+, useCuda ? (config.cudaSupport or false), cudatoolkit ? null
+, useCudnn ? (config.cudnnSupport or false), cudnn ? null
+, useOpenmp ? false, openmp ? null
+, useOpencv3 ? true, opencv3 ? null
+, useLeveldb ? false, leveldb ? null
+, useLmdb ? true, lmdb ? null
+, useRocksdb ? false, rocksdb ? null
+, useZeromq ? false, zeromq ? null
+, useMpi ? false, mpi ? null
+# TODO: distributed computations
+#, useGloo ? false
+#, useNccl ? false
+#, useNnpack ? false
+}:
+
+assert useCuda -> cudatoolkit != null;
+assert useCudnn -> (useCuda && cudnn != null);
+assert useOpencv3 -> opencv3 != null;
+assert useLeveldb -> leveldb != null;
+assert useLmdb -> lmdb != null;
+assert useRocksdb -> rocksdb != null;
+assert useZeromq -> zeromq != null;
+assert useMpi -> mpi != null;
+
+let
+  # Third party modules that caffe2 holds as git submodules.
+  # Download them and create symlinks from caffe2/third_party.
+  installExtraSrc = extra: ''
+    rmdir "third_party/${extra.dst}"
+    ln -s "${extra.src}" "third_party/${extra.dst}"
+  '';
+
+  cub = {
+    src = fetchFromGitHub rec {
+      owner  = "NVlabs";
+      repo   = "cub";
+      rev    = "v1.7.4";
+      sha256 = "0ksd5n1lxqhm5l5cd2lps4cszhjkf6gmzahaycs7nxb06qci8c66";
+    };
+    dst = "cub";
+  };
+
+  pybind11 = {
+    src = fetchFromGitHub {
+      owner  = "pybind";
+      repo   = "pybind11";
+      rev    = "86e2ad4f77442c3350f9a2476650da6bee253c52";
+      sha256 = "05gi58dirvc8fgm0avpydvidzsbh2zrzgfaq671ym09f6dz0bcgz";
+    };
+    dst = "pybind11";
+  };
+in
+
+stdenv.mkDerivation rec {
+  name = "caffe2-${version}";
+  version = "0.8.1";
+  src = fetchFromGitHub {
+    owner = "caffe2";
+    repo = "caffe2";
+    rev = "v${version}";
+    sha256 = "18y7zjc69j6n5642l9caddl641b0djf3pjn4wacdsc1wk1jiyqk8";
+  };
+
+  nativeBuildInputs = [ cmake doxygen gtest ];
+  outputs = [ "bin" "out" ];
+  propagatedBuildOutputs = [ ]; # otherwise propagates out -> bin cycle
+
+  buildInputs = [ glog google-gflags protobuf snappy eigen3 ]
+    ++ lib.optional useCuda cudatoolkit
+    ++ lib.optional useCudnn cudnn
+    ++ lib.optional useOpenmp openmp
+    ++ lib.optional useOpencv3 opencv3
+    ++ lib.optional useLeveldb leveldb
+    ++ lib.optional useLmdb lmdb
+    ++ lib.optional useRocksdb rocksdb
+    ++ lib.optional useZeromq zeromq
+  ;
+  propagatedBuildInputs = [ numpy future six python-protobuf pydot ];
+
+  patches = lib.optional stdenv.cc.isClang [ ./update_clang_cvtsh_bugfix.patch ];
+
+  cmakeFlags = [ ''-DBUILD_TEST=OFF''
+                 ''-DBUILD_PYTHON=ON''
+                 ''-DUSE_CUDA=${if useCuda then ''ON''else ''OFF''}''
+                 ''-DUSE_OPENMP=${if useOpenmp then ''ON''else ''OFF''}''
+                 ''-DUSE_OPENCV=${if useOpencv3 then ''ON''else ''OFF''}''
+                 ''-DUSE_MPI=${if useMpi then ''ON''else ''OFF''}''
+                 ''-DUSE_LEVELDB=${if useLeveldb then ''ON''else ''OFF''}''
+                 ''-DUSE_LMDB=${if useLmdb then ''ON''else ''OFF''}''
+                 ''-DUSE_ROCKSDB=${if useRocksdb then ''ON''else ''OFF''}''
+                 ''-DUSE_ZMQ=${if useZeromq  then ''ON''else ''OFF''}''
+                 ''-DUSE_GLOO=OFF''
+                 ''-DUSE_NNPACK=OFF''
+                 ''-DUSE_NCCL=OFF''
+                 ''-DUSE_REDIS=OFF''
+                 ''-DUSE_FFMPEG=OFF''
+               ]
+               ++ lib.optional useCuda [
+                 ''-DCUDA_TOOLKIT_ROOT_DIR=${cudatoolkit}''
+                 ''-DCUDA_FAST_MATH=ON''
+                 ''-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/gcc''
+               ];
+
+  preConfigure = ''
+    ${installExtraSrc cub}
+    ${installExtraSrc pybind11}
+    # XXX hack
+    export NIX_CFLAGS_COMPILE="-I ${eigen3}/include/eigen3/ $NIX_CFLAGS_COMPILE"
+  '';
+
+  postInstall = ''
+    moveToOutput "bin" "$bin"
+    mkdir -p $out/lib/${python.libPrefix}
+    ln -s $out/ $out/${python.sitePackages}
+  '';
+
+  doCheck = false;
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = https://caffe2.ai/;
+    description = "A new lightweight, modular, and scalable deep learning framework";
+    longDescription = ''
+      Caffe2 aims to provide an easy and straightforward way for you to experiment
+      with deep learning and leverage community contributions of new models and
+      algorithms. You can bring your creations to scale using the power of GPUs in the
+      cloud or to the masses on mobile with Caffe2's cross-platform libraries.
+    '';
+    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    license = stdenv.lib.licenses.asl20;
+    maintainers = with stdenv.lib.maintainers; [ yuriaisaka ];
+  };
+}
diff --git a/pkgs/development/libraries/science/math/caffe2/update_clang_cvtsh_bugfix.patch b/pkgs/development/libraries/science/math/caffe2/update_clang_cvtsh_bugfix.patch
new file mode 100644
index 000000000000..d908cb6ba80b
--- /dev/null
+++ b/pkgs/development/libraries/science/math/caffe2/update_clang_cvtsh_bugfix.patch
@@ -0,0 +1,55 @@
+diff --git a/caffe2/perfkernels/cvtsh_ss_bugfix.h b/caffe2/perfkernels/cvtsh_ss_bugfix.h
+index bd06681..00172b7 100644
+--- a/caffe2/perfkernels/cvtsh_ss_bugfix.h
++++ b/caffe2/perfkernels/cvtsh_ss_bugfix.h
+@@ -1,10 +1,36 @@
++/**
++ * Copyright (c) 2016-present, Facebook, Inc.
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ *     http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
+ #pragma once
+ 
+-#if defined(__APPLE__) && (__clang_major__ < 8)
++// Apple clang was fixed in 8.1
++#if defined(__apple_build_version__) && ((__clang_major__ < 8) || ((__clang_major__ == 8) && (__clang_minor__ < 1)))
++#define __APPLE_NEED_FIX 1
++#endif
++
++// Regular clang was fixed in 3.9
++#if defined(__clang__) && (__clang_major__ < 4) && (__clang_minor__ < 9)
++#define __CLANG_NEED_FIX 1
++#endif
++
++#if __APPLE_NEED_FIX || __CLANG_NEED_FIX
+ 
+ #include <emmintrin.h>
+ 
+-// This version of apple clang has a bug that _cvtsh_ss is not defined, see
++// This version of clang has a bug that _cvtsh_ss is not defined, see
+ // https://reviews.llvm.org/D16177
+ static __inline float
+     __attribute__((__always_inline__, __nodebug__, __target__("f16c")))
+@@ -15,7 +41,10 @@ _cvtsh_ss(unsigned short a)
+   return r[0];
+ }
+ 
+-#endif // defined(__APPLE__) && (__clang_major__ < 8)
++#endif // __APPLE_NEED_FIX || __CLANG_NEED_FIX
++
++#undef __APPLE_NEED_FIX
++#undef __CLANG_NEED_FIX
+ 
+ #ifdef _MSC_VER
+ 
diff --git a/pkgs/development/libraries/science/math/openblas/default.nix b/pkgs/development/libraries/science/math/openblas/default.nix
index 42eaf71942e7..07d2a04c5e20 100644
--- a/pkgs/development/libraries/science/math/openblas/default.nix
+++ b/pkgs/development/libraries/science/math/openblas/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gfortran, perl, which, config, coreutils
+{ stdenv, fetchurl, fetchpatch, gfortran, perl, which, config, coreutils
 # Most packages depending on openblas expect integer width to match
 # pointer width, but some expect to use 32-bit integers always
 # (for compatibility with reference BLAS).
@@ -115,9 +115,16 @@ stdenv.mkDerivation {
       "NUM_THREADS=64"
       "INTERFACE64=${if blas64 then "1" else "0"}"
       "NO_STATIC=1"
-    ]
+    ] ++ stdenv.lib.optional (stdenv.hostPlatform.libc == "musl") "NO_AFFINITY=1"
     ++ mapAttrsToList (var: val: var + "=" + val) config;
 
+  patches = stdenv.lib.optional (stdenv.hostPlatform.libc != "glibc")
+    # https://github.com/xianyi/OpenBLAS/pull/1247
+    (fetchpatch {
+      url = "https://github.com/xianyi/OpenBLAS/commit/88a35ff457f55e527e0e8a503a0dc61976c1846d.patch";
+      sha256 = "1a3qrhvl5hp06c53fjqghq4zgf6ls7narm06l0shcvs57hznh09n";
+    });
+
   doCheck = true;
   checkTarget = "tests";
 
diff --git a/pkgs/development/libraries/spice/default.nix b/pkgs/development/libraries/spice/default.nix
index 808bfd4f811d..c8e98d3d28ed 100644
--- a/pkgs/development/libraries/spice/default.nix
+++ b/pkgs/development/libraries/spice/default.nix
@@ -17,12 +17,12 @@ stdenv.mkDerivation rec {
     # the following three patches fix CVE-2016-9577 and CVE-2016-9578
     (fetchpatch {
       name = "0001-Prevent-possible-DoS-attempts-during-protocol-handsh.patch";
-      url = "http://pkgs.fedoraproject.org/cgit/rpms/spice.git/plain/0001-Prevent-possible-DoS-attempts-during-protocol-handsh.patch?id=d919d639ae5f83a9735a04d843eed675f9357c0d";
+      url = "http://src.fedoraproject.org/cgit/rpms/spice.git/plain/0001-Prevent-possible-DoS-attempts-during-protocol-handsh.patch?id=d919d639ae5f83a9735a04d843eed675f9357c0d";
       sha256 = "11x5566lx5zyl7f39glwsgpzkxb7hpcshx8va5ab3imrns07130q";
     })
     (fetchpatch {
       name = "0002-Prevent-integer-overflows-in-capability-checks.patch";
-      url = "http://pkgs.fedoraproject.org/cgit/rpms/spice.git/plain/0002-Prevent-integer-overflows-in-capability-checks.patch?id=d919d639ae5f83a9735a04d843eed675f9357c0d";
+      url = "http://src.fedoraproject.org/cgit/rpms/spice.git/plain/0002-Prevent-integer-overflows-in-capability-checks.patch?id=d919d639ae5f83a9735a04d843eed675f9357c0d";
       sha256 = "1r1bhq98w93cvvrlrz6jwdfsy261xl3xqs0ppchaa2igyxvxv5z5";
     })
     (fetchpatch {
diff --git a/pkgs/development/libraries/stfl/default.nix b/pkgs/development/libraries/stfl/default.nix
index 1430c3aa9c29..8a8680a498a0 100644
--- a/pkgs/development/libraries/stfl/default.nix
+++ b/pkgs/development/libraries/stfl/default.nix
@@ -13,8 +13,9 @@ stdenv.mkDerivation rec {
   buildPhase = ''
     sed -i s/gcc/cc/g Makefile
     sed -i s%ncursesw/ncurses.h%ncurses.h% stfl_internals.h
-  '' + ( stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + stdenv.lib.optionalString (stdenv.hostPlatform.libc != "glibc") ''
     sed -i 's/LDLIBS += -lncursesw/LDLIBS += -lncursesw -liconv/' Makefile
+  '' + ( stdenv.lib.optionalString stdenv.isDarwin ''
     sed -i s/-soname/-install_name/ Makefile
   '' ) + ''
     make
diff --git a/pkgs/development/libraries/tbb/default.nix b/pkgs/development/libraries/tbb/default.nix
index 13b1970866e7..182fbb35d499 100644
--- a/pkgs/development/libraries/tbb/default.nix
+++ b/pkgs/development/libraries/tbb/default.nix
@@ -16,6 +16,8 @@ with stdenv.lib; stdenv.mkDerivation rec {
     optional (stdver != null) "stdver=${stdver}"
   );
 
+  patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ./glibc-struct-mallinfo.patch;
+
   installPhase = ''
     mkdir -p $out/{lib,share/doc}
     cp "build/"*release*"/"*${stdenv.hostPlatform.extensions.sharedLibrary}* $out/lib/
diff --git a/pkgs/development/libraries/tbb/glibc-struct-mallinfo.patch b/pkgs/development/libraries/tbb/glibc-struct-mallinfo.patch
new file mode 100644
index 000000000000..64056ecb1462
--- /dev/null
+++ b/pkgs/development/libraries/tbb/glibc-struct-mallinfo.patch
@@ -0,0 +1,43 @@
+From b577153a10c98f4e13405dc93ea2ab1a7b990e07 Mon Sep 17 00:00:00 2001
+From: David Huffman <storedbox+alpine@outlook.com>
+Date: Wed, 6 Jan 2016 07:09:30 -0500
+Subject: [PATCH] hard-code glibc's definition of struct mallinfo
+
+---
+ src/tbbmalloc/proxy.h | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/src/tbbmalloc/proxy.h b/src/tbbmalloc/proxy.h
+index 781cadc..e1ea1ae 100644
+--- a/src/tbbmalloc/proxy.h
++++ b/src/tbbmalloc/proxy.h
+@@ -32,6 +32,26 @@
+ 
+ #include <stddef.h>
+ 
++// The following definition was taken from /usr/include/malloc.h as provided by
++// the glibc-devel-2.19-17.4.x86_64 package on openSUSE Leap 42.1; it is
++// made available under the GNU Lesser General Public License v2.1 or later.
++// See <https://www.gnu.org/licenses>.
++//
++// Copyright (C) 1996-2014 Free Software Foundation, Inc.
++struct mallinfo
++{
++  int arena;    /* non-mmapped space allocated from system */
++  int ordblks;  /* number of free chunks */
++  int smblks;   /* number of fastbin blocks */
++  int hblks;    /* number of mmapped regions */
++  int hblkhd;   /* space in mmapped regions */
++  int usmblks;  /* maximum total allocated space */
++  int fsmblks;  /* space available in freed fastbin blocks */
++  int uordblks; /* total allocated space */
++  int fordblks; /* total free space */
++  int keepcost; /* top-most, releasable (via malloc_trim) space */
++};
++
+ extern "C" {
+     void * scalable_malloc(size_t size);
+     void * scalable_calloc(size_t nobj, size_t size);
+-- 
+2.6.2
+
diff --git a/pkgs/development/libraries/ti-rpc/default.nix b/pkgs/development/libraries/ti-rpc/default.nix
index 0156c64306c7..d34a6dca7832 100644
--- a/pkgs/development/libraries/ti-rpc/default.nix
+++ b/pkgs/development/libraries/ti-rpc/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, autoreconfHook, libkrb5 }:
+{ fetchurl, fetchpatch, stdenv, autoreconfHook, libkrb5 }:
 
 stdenv.mkDerivation rec {
   name = "libtirpc-1.0.2";
@@ -8,6 +8,12 @@ stdenv.mkDerivation rec {
     sha256 = "1xchbxy0xql7yl7z4n1icj8r7dmly46i22fvm00vdjq64zlmqg3j";
   };
 
+  patches = stdenv.lib.optional stdenv.hostPlatform.isMusl
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/openembedded/openembedded-core/2be873301420ec6ca2c70d899b7c49a7e2b0954d/meta/recipes-extended/libtirpc/libtirpc/0001-replace-__bzero-with-memset-API.patch";
+      sha256 = "1jmbn0j2bnjp0j9z5vzz5xiwyv3kd28w5pixbqsy2lz6q8nii7cf";
+    });
+
   postPatch = ''
     sed '1i#include <stdint.h>' -i src/xdr_sizeof.c
   '';
diff --git a/pkgs/development/libraries/tinyxml-2/default.nix b/pkgs/development/libraries/tinyxml-2/default.nix
index 9011d33e9222..7f1b3ebcbf5b 100644
--- a/pkgs/development/libraries/tinyxml-2/default.nix
+++ b/pkgs/development/libraries/tinyxml-2/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "tinyxml-2-${version}";
-  version = "4.0.1";
+  version = "6.0.0";
 
   src = fetchFromGitHub {
     repo = "tinyxml2";
     owner = "leethomason";
     rev = version;
-    sha256 = "1a0skfi8rzk53qcxbv88qlvhlqzvsvg4hm20dnx4zw7vrn6anr9y";
+    sha256 = "031fmhpah449h3rkyamzzdpzccrrfrvjb4qn6vx2vjm47jwc54qv";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/udunits/default.nix b/pkgs/development/libraries/udunits/default.nix
index b8ffc16f9052..b02ac8852371 100644
--- a/pkgs/development/libraries/udunits/default.nix
+++ b/pkgs/development/libraries/udunits/default.nix
@@ -3,10 +3,10 @@
 }:
 
 stdenv.mkDerivation rec {
-    name = "udunits-2.2.24";
+    name = "udunits-2.2.26";
     src = fetchurl {
         url = "ftp://ftp.unidata.ucar.edu/pub/udunits/${name}.tar.gz";
-        sha256 = "15bz2wv46wiwdzai8770gzy05prgj120x6j2hmihavv5y89cbfi0";
+        sha256 = "0v9mqw4drnkzkm57331ail6yvs9485jmi37s40lhvmf7r5lli3rn";
     };
 
     nativeBuildInputs = [ bison flex file ];
diff --git a/pkgs/development/libraries/unibilium/default.nix b/pkgs/development/libraries/unibilium/default.nix
index 53207f855418..7c92e7224f9e 100644
--- a/pkgs/development/libraries/unibilium/default.nix
+++ b/pkgs/development/libraries/unibilium/default.nix
@@ -1,21 +1,21 @@
-{ stdenv, lib, fetchFromGitHub, libtool, pkgconfig }:
+{ stdenv, lib, fetchFromGitHub, libtool, pkgconfig, perl }:
 
 stdenv.mkDerivation rec {
   name = "unibilium-${version}";
 
-  version = "1.2.1";
+  version = "2.0.0";
 
   src = fetchFromGitHub {
     owner = "mauke";
     repo = "unibilium";
     rev = "v${version}";
-    sha256 = "11mbfijdrvbmdlmxs8j4vij78ki0vna89yg3r9n9g1i6j45hiq2r";
+    sha256 = "1wa9a32wzqnxqh1jh554afj13dzjr6mw2wzqzw8d08nza9pg2ra2";
   };
 
   makeFlags = [ "PREFIX=$(out)" ]
     ++ stdenv.lib.optional stdenv.isDarwin "LIBTOOL=${libtool}/bin/libtool";
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig perl ];
   buildInputs = [ libtool ];
 
   meta = with lib; {
diff --git a/pkgs/development/libraries/uriparser/default.nix b/pkgs/development/libraries/uriparser/default.nix
index 6b5c48a6105d..9b4e3a74afe1 100644
--- a/pkgs/development/libraries/uriparser/default.nix
+++ b/pkgs/development/libraries/uriparser/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "uriparser-${version}";
-  version = "0.8.4";
+  version = "0.8.5";
 
   src = fetchurl {
     url = "mirror://sourceforge/project/uriparser/Sources/${version}/${name}.tar.bz2";
-    sha256 = "08vvcmg4mcpi2gyrq043c9mfcy3mbrw6lhp86698hx392fjcsz6f";
+    sha256 = "1p9c6lr39rjl4bbzi7wl2nsg72gcz8qhicxh9v043qyr0dfcvsjq";
   };
 
 
diff --git a/pkgs/development/libraries/usbredir/default.nix b/pkgs/development/libraries/usbredir/default.nix
index 4735375de1f9..507c494ea27d 100644
--- a/pkgs/development/libraries/usbredir/default.nix
+++ b/pkgs/development/libraries/usbredir/default.nix
@@ -10,7 +10,8 @@ stdenv.mkDerivation rec {
   };
 
   # Works around bunch of "format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint64_t {aka long long unsigned int}'" warnings
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!stdenv.is64bit) "-Wno-error=format";
+  NIX_CFLAGS_COMPILE = stdenv.lib.optional (!stdenv.is64bit) "-Wno-error=format"
+    ++ [ "-Wno-error=format-truncation" ]; # newly detected with gcc-7
 
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ libusb ];
diff --git a/pkgs/development/libraries/webkitgtk/2.4.nix b/pkgs/development/libraries/webkitgtk/2.4.nix
index 6669b562400f..18d20bf9c780 100644
--- a/pkgs/development/libraries/webkitgtk/2.4.nix
+++ b/pkgs/development/libraries/webkitgtk/2.4.nix
@@ -53,6 +53,8 @@ stdenv.mkDerivation rec {
     ./quartz-webcore.patch
     ./libc++.patch
     ./plugin-none.patch
+  ] ++ optionals stdenv.hostPlatform.isMusl [
+    ./fix-execinfo.patch
   ];
 
   configureFlags = with stdenv.lib; [
diff --git a/pkgs/development/libraries/webkitgtk/fix-execinfo.patch b/pkgs/development/libraries/webkitgtk/fix-execinfo.patch
new file mode 100644
index 000000000000..eb825312f3be
--- /dev/null
+++ b/pkgs/development/libraries/webkitgtk/fix-execinfo.patch
@@ -0,0 +1,20 @@
+--- webkitgtk-2.2.0.orig/Source/WTF/wtf/Assertions.cpp
++++ webkitgtk-2.2.0/Source/WTF/wtf/Assertions.cpp
+@@ -64,7 +64,7 @@
+ #include <windows.h>
+ #endif
+ 
+-#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
++#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__))
+ #include <cxxabi.h>
+ #include <dlfcn.h>
+ #include <execinfo.h>
+@@ -242,7 +242,7 @@
+ 
+ void WTFGetBacktrace(void** stack, int* size)
+ {
+-#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
++#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__))
+     *size = backtrace(stack, *size);
+ #elif OS(WINDOWS) && !OS(WINCE)
+     // The CaptureStackBackTrace function is available in XP, but it is not defined
diff --git a/pkgs/development/libraries/webrtc-audio-processing/default.nix b/pkgs/development/libraries/webrtc-audio-processing/default.nix
index f5d49290484f..b5a3aed91d90 100644
--- a/pkgs/development/libraries/webrtc-audio-processing/default.nix
+++ b/pkgs/development/libraries/webrtc-audio-processing/default.nix
@@ -12,6 +12,8 @@ stdenv.mkDerivation rec {
   # signal_processing/filter_ar_fast_q12_armv7.S:88: Error: selected processor does not support `sbfx r11,r6,#12,#16' in ARM mode
   patchPhase = stdenv.lib.optionalString stdenv.isArm ''
     substituteInPlace configure --replace 'armv7*|armv8*' 'disabled'
+  '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+    substituteInPlace webrtc/base/checks.cc --replace 'defined(__UCLIBC__)' 1
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/wildmidi/default.nix b/pkgs/development/libraries/wildmidi/default.nix
index 9d22833e1c04..06a4e48827ed 100644
--- a/pkgs/development/libraries/wildmidi/default.nix
+++ b/pkgs/development/libraries/wildmidi/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, cmake, alsaLib, freepats }:
 
 stdenv.mkDerivation rec {
-  name = "wildmidi-0.3.9";
+  name = "wildmidi-0.4.2";
 
   src = fetchurl {
     url = "https://github.com/Mindwerks/wildmidi/archive/${name}.tar.gz";
-    sha256 = "1fbcsvzn8akvvy7vg6vmnikcc8gh405b4gp1r016bq7yginljwwp";
+    sha256 = "178hm2wh5h7apkcb1a0dyla2ia8569php8ikz62rh0g6dp5l67am";
   };
 
   nativeBuildInputs = [ cmake ];