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.nix28
-rw-r--r--pkgs/development/libraries/SDL/find-headers.patch16
-rw-r--r--pkgs/development/libraries/SDL/setup-hook.sh11
-rw-r--r--pkgs/development/libraries/SDL2/default.nix69
-rw-r--r--pkgs/development/libraries/SDL2/find-headers.patch26
-rw-r--r--pkgs/development/libraries/SDL2/setup-hook.sh11
-rw-r--r--pkgs/development/libraries/SDL2_gfx/default.nix37
-rw-r--r--pkgs/development/libraries/SDL2_image/default.nix19
-rw-r--r--pkgs/development/libraries/SDL2_mixer/default.nix17
-rw-r--r--pkgs/development/libraries/SDL2_net/default.nix13
-rw-r--r--pkgs/development/libraries/SDL2_ttf/default.nix15
-rw-r--r--pkgs/development/libraries/SDL_gfx/default.nix24
-rw-r--r--pkgs/development/libraries/SDL_image/default.nix14
-rw-r--r--pkgs/development/libraries/SDL_mixer/default.nix8
-rw-r--r--pkgs/development/libraries/SDL_net/default.nix19
-rw-r--r--pkgs/development/libraries/SDL_sound/default.nix13
-rw-r--r--pkgs/development/libraries/SDL_stretch/default.nix13
-rw-r--r--pkgs/development/libraries/apache-activemq/default.nix4
-rw-r--r--pkgs/development/libraries/appstream-glib/default.nix4
-rw-r--r--pkgs/development/libraries/armadillo/default.nix7
-rw-r--r--pkgs/development/libraries/armadillo/use-OpenBLAS-as-LAPACK.patch14
-rw-r--r--pkgs/development/libraries/cairo/default.nix13
-rw-r--r--pkgs/development/libraries/cppzmq/default.nix6
-rw-r--r--pkgs/development/libraries/cxx-prettyprint/default.nix29
-rw-r--r--pkgs/development/libraries/cxxtools/default.nix21
-rw-r--r--pkgs/development/libraries/czmq/default.nix8
-rw-r--r--pkgs/development/libraries/fftw/default.nix4
-rw-r--r--pkgs/development/libraries/folly/default.nix12
-rw-r--r--pkgs/development/libraries/fontconfig-ultimate/confd.nix40
-rw-r--r--pkgs/development/libraries/fontconfig-ultimate/default.nix45
-rw-r--r--pkgs/development/libraries/fontconfig-ultimate/rendering.nix212
-rw-r--r--pkgs/development/libraries/fontconfig/default.nix2
-rw-r--r--pkgs/development/libraries/fontconfig/make-fonts-conf.xsl2
-rw-r--r--pkgs/development/libraries/freetype/default.nix64
-rw-r--r--pkgs/development/libraries/gdbm/default.nix2
-rw-r--r--pkgs/development/libraries/gdcm/default.nix4
-rw-r--r--pkgs/development/libraries/gegl/3.0.nix4
-rw-r--r--pkgs/development/libraries/glib/default.nix4
-rw-r--r--pkgs/development/libraries/glibc/common.nix12
-rw-r--r--pkgs/development/libraries/glibc/cve-2016-1234.patch372
-rw-r--r--pkgs/development/libraries/glibc/cve-2016-3075.patch35
-rw-r--r--pkgs/development/libraries/glibc/cve-2016-3706.patch181
-rw-r--r--pkgs/development/libraries/glibc/default.nix2
-rw-r--r--pkgs/development/libraries/glibc/fix_warnings.patch36
-rw-r--r--pkgs/development/libraries/glibc/glob-simplify-interface.patch216
-rw-r--r--pkgs/development/libraries/gnutls/3.3.nix4
-rw-r--r--pkgs/development/libraries/gnutls/3.4.nix11
-rw-r--r--pkgs/development/libraries/gnutls/3.5.nix11
-rw-r--r--pkgs/development/libraries/granite/default.nix4
-rw-r--r--pkgs/development/libraries/gtk+/3.x.nix4
-rw-r--r--pkgs/development/libraries/gusb/default.nix4
-rw-r--r--pkgs/development/libraries/icu/default.nix4
-rw-r--r--pkgs/development/libraries/jemalloc/default.nix5
-rw-r--r--pkgs/development/libraries/kdevplatform/default.nix5
-rw-r--r--pkgs/development/libraries/kdevplatform/dependency.patch12
-rw-r--r--pkgs/development/libraries/libappindicator/default.nix4
-rw-r--r--pkgs/development/libraries/libbsd/default.nix6
-rw-r--r--pkgs/development/libraries/libdbusmenu/default.nix4
-rw-r--r--pkgs/development/libraries/libdynd/default.nix28
-rw-r--r--pkgs/development/libraries/libfm/default.nix4
-rw-r--r--pkgs/development/libraries/libgcrypt/1.5.nix4
-rw-r--r--pkgs/development/libraries/libgcrypt/default.nix4
-rw-r--r--pkgs/development/libraries/libindicate/default.nix4
-rw-r--r--pkgs/development/libraries/libircclient/default.nix31
-rw-r--r--pkgs/development/libraries/libosinfo/default.nix4
-rw-r--r--pkgs/development/libraries/libraw/default.nix4
-rw-r--r--pkgs/development/libraries/libsecret/default.nix4
-rw-r--r--pkgs/development/libraries/libsidplayfp/default.nix39
-rw-r--r--pkgs/development/libraries/libsoup/default.nix4
-rw-r--r--pkgs/development/libraries/libunity/default.nix4
-rw-r--r--pkgs/development/libraries/libvdpau-va-gl/default.nix4
-rw-r--r--pkgs/development/libraries/libvirt/default.nix8
-rw-r--r--pkgs/development/libraries/mlt/default.nix21
-rw-r--r--pkgs/development/libraries/mlt/qt-4.nix39
-rw-r--r--pkgs/development/libraries/mlt/qt-5.nix4
-rw-r--r--pkgs/development/libraries/pcl/default.nix13
-rw-r--r--pkgs/development/libraries/phonon/backends/gstreamer.nix2
-rw-r--r--pkgs/development/libraries/physics/geant4/g4py/default.nix22
-rw-r--r--pkgs/development/libraries/poppler/datadir_env.patch13
-rw-r--r--pkgs/development/libraries/poppler/default.nix22
-rw-r--r--pkgs/development/libraries/protobuf/3.0.0-beta-2.nix43
-rw-r--r--pkgs/development/libraries/protobuf/3.0.nix4
-rw-r--r--pkgs/development/libraries/protobuf/generic.nix3
-rwxr-xr-xpkgs/development/libraries/qt-5/5.5/fetchsrcs.sh15
-rw-r--r--pkgs/development/libraries/qt-5/5.5/qtbase/default.nix2
-rw-r--r--pkgs/development/libraries/qt-5/5.5/qtbase/setup-hook.sh5
-rw-r--r--pkgs/development/libraries/qt-5/5.5/qtwebkit/default.nix8
-rw-r--r--pkgs/development/libraries/qt-5/5.5/srcs.nix250
-rw-r--r--pkgs/development/libraries/qt-5/5.6/default.nix1
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/default.nix2
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/setup-hook.sh5
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebkit/0001-dlopen-webkit-nsplugin.patch53
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebkit/0002-dlopen-webkit-gtk.patch25
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebkit/0003-dlopen-webkit-udev.patch31
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebkit/default.nix35
-rw-r--r--pkgs/development/libraries/qt-5/5.6/srcs.nix254
-rw-r--r--pkgs/development/libraries/qt-5/5.7/default.nix1
-rw-r--r--pkgs/development/libraries/qt-5/5.7/qtbase/default.nix2
-rw-r--r--pkgs/development/libraries/qt-5/5.7/qtbase/setup-hook.sh5
-rw-r--r--pkgs/development/libraries/qt-5/5.7/qtwebkit/0001-dlopen-webkit-nsplugin.patch53
-rw-r--r--pkgs/development/libraries/qt-5/5.7/qtwebkit/0002-dlopen-webkit-gtk.patch25
-rw-r--r--pkgs/development/libraries/qt-5/5.7/qtwebkit/0003-dlopen-webkit-udev.patch31
-rw-r--r--pkgs/development/libraries/qt-5/5.7/qtwebkit/default.nix35
-rw-r--r--pkgs/development/libraries/qt-5/5.7/srcs.nix24
-rw-r--r--pkgs/development/libraries/qtwebkit-plugins/default.nix29
-rw-r--r--pkgs/development/libraries/science/math/clblas/cuda/default.nix6
-rw-r--r--pkgs/development/libraries/science/math/ipopt/default.nix8
-rw-r--r--pkgs/development/libraries/sqlcipher/default.nix26
-rw-r--r--pkgs/development/libraries/talloc/default.nix4
-rw-r--r--pkgs/development/libraries/telepathy/glib/default.nix4
-rw-r--r--pkgs/development/libraries/telepathy/qt/default.nix10
-rw-r--r--pkgs/development/libraries/tntdb/default.nix22
-rw-r--r--pkgs/development/libraries/tntnet/default.nix22
-rw-r--r--pkgs/development/libraries/torch/default.nix28
-rw-r--r--pkgs/development/libraries/torch/src.json6
-rw-r--r--pkgs/development/libraries/vtk/default.nix15
-rw-r--r--pkgs/development/libraries/wt/cmake.patch10
-rw-r--r--pkgs/development/libraries/wt/default.nix40
-rw-r--r--pkgs/development/libraries/xgboost/default.nix8
-rw-r--r--pkgs/development/libraries/zeitgeist/default.nix4
120 files changed, 1447 insertions, 1775 deletions
diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix
index 6c3920ff8aa..ca0bbd6a01c 100644
--- a/pkgs/development/libraries/SDL/default.nix
+++ b/pkgs/development/libraries/SDL/default.nix
@@ -1,8 +1,8 @@
 { stdenv, fetchurl, fetchpatch, pkgconfig, audiofile, libcap
-, openglSupport ? false, mesa ? null
-, alsaSupport ? true, alsaLib ? null
-, x11Support ? true, xlibsWrapper ? null, libXrandr ? null
-, pulseaudioSupport ? true, libpulseaudio ? null
+, openglSupport ? false, mesa_noglu
+, alsaSupport ? true, alsaLib
+, x11Support ? true, libXext, libICE, libXrandr
+, pulseaudioSupport ? true, libpulseaudio
 , OpenGL, CoreAudio, CoreServices, AudioUnit, Kernel, Cocoa
 }:
 
@@ -10,17 +10,12 @@
 # PulseAudio.
 assert (stdenv.isLinux && !(stdenv ? cross)) -> alsaSupport || pulseaudioSupport;
 
-assert openglSupport -> (mesa != null && x11Support);
-assert x11Support -> (xlibsWrapper != null && libXrandr != null);
-assert alsaSupport -> alsaLib != null;
-assert pulseaudioSupport -> libpulseaudio != null;
-
 let
   inherit (stdenv.lib) optional optionals;
 in
 stdenv.mkDerivation rec {
-  version = "1.2.15";
   name    = "SDL-${version}";
+  version = "1.2.15";
 
   src = fetchurl {
     url    = "http://www.libsdl.org/release/${name}.tar.gz";
@@ -34,10 +29,10 @@ stdenv.mkDerivation rec {
 
   # Since `libpulse*.la' contain `-lgdbm', PulseAudio must be propagated.
   propagatedBuildInputs =
-    optionals x11Support [ xlibsWrapper libXrandr ] ++
+    optionals x11Support [ libXext libICE libXrandr ] ++
     optional alsaSupport alsaLib ++
     optional stdenv.isLinux libcap ++
-    optional openglSupport mesa ++
+    optional openglSupport mesa_noglu ++
     optional pulseaudioSupport libpulseaudio ++
     optional stdenv.isDarwin Cocoa;
 
@@ -57,9 +52,9 @@ stdenv.mkDerivation rec {
     "--enable-rpath"
     "--disable-pulseaudio-shared"
     "--disable-osmesa-shared"
-  ] ++ stdenv.lib.optionals (stdenv ? cross) ([
+  ] ++ optionals (stdenv ? cross) ([
     "--without-x"
-  ] ++ stdenv.lib.optional alsaSupport "--with-alsa-prefix=${alsaLib.out}/lib");
+  ] ++ optional alsaSupport "--with-alsa-prefix=${alsaLib.out}/lib");
 
   patches = [
     # Fix window resizing issues, e.g. for xmonad
@@ -95,15 +90,18 @@ stdenv.mkDerivation rec {
       url = "http://hg.libsdl.org/SDL/raw-rev/bbfb41c13a87";
       sha256 = "1336g7waaf1c8yhkz11xbs500h8bmvabh4h437ax8l1xdwcppfxv";
     })
+    ./find-headers.patch
   ];
 
   postFixup = ''moveToOutput share/aclocal "$dev" '';
 
+  setupHook = ./setup-hook.sh;
+
   passthru = { inherit openglSupport; };
 
   meta = with stdenv.lib; {
     description = "A cross-platform multimedia library";
-    homepage    = http://www.libsdl.org/;
+    homepage    = "http://www.libsdl.org/";
     maintainers = with maintainers; [ lovek323 ];
     platforms   = platforms.unix;
     license     = licenses.lgpl21;
diff --git a/pkgs/development/libraries/SDL/find-headers.patch b/pkgs/development/libraries/SDL/find-headers.patch
new file mode 100644
index 00000000000..5f75ae9e830
--- /dev/null
+++ b/pkgs/development/libraries/SDL/find-headers.patch
@@ -0,0 +1,16 @@
+diff -ru3 SDL-1.2.15/sdl-config.in SDL-1.2.15-new/sdl-config.in
+--- SDL-1.2.15/sdl-config.in	2012-01-19 10:30:06.000000000 +0400
++++ SDL-1.2.15-new/sdl-config.in	2016-08-22 05:32:52.716397920 +0300
+@@ -42,7 +42,11 @@
+       echo @SDL_VERSION@
+       ;;
+     --cflags)
+-      echo -I@includedir@/SDL @SDL_CFLAGS@
++      SDL_CFLAGS=""
++      for i in @includedir@/SDL $SDL_PATH; do
++        SDL_CFLAGS="$SDL_CFLAGS -I$i"
++      done
++      echo $SDL_CFLAGS @SDL_CFLAGS@
+       ;;
+ @ENABLE_SHARED_TRUE@    --libs)
+ @ENABLE_SHARED_TRUE@      echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@
diff --git a/pkgs/development/libraries/SDL/setup-hook.sh b/pkgs/development/libraries/SDL/setup-hook.sh
new file mode 100644
index 00000000000..3696e743a07
--- /dev/null
+++ b/pkgs/development/libraries/SDL/setup-hook.sh
@@ -0,0 +1,11 @@
+addSDLPath () {
+  if [ -e "$1/include/SDL" ]; then
+    export SDL_PATH="$SDL_PATH $1/include/SDL"
+  fi
+}
+
+if test -n "$crossConfig"; then
+  crossEnvHooks+=(addSDLPath)
+else
+  envHooks+=(addSDLPath)
+fi
diff --git a/pkgs/development/libraries/SDL2/default.nix b/pkgs/development/libraries/SDL2/default.nix
index 1c260c2ba91..16aa4f6c2f7 100644
--- a/pkgs/development/libraries/SDL2/default.nix
+++ b/pkgs/development/libraries/SDL2/default.nix
@@ -1,8 +1,11 @@
-{ stdenv, fetchurl, pkgconfig, audiofile
-, openglSupport ? false, mesa ? null
-, alsaSupport ? true, alsaLib ? null
-, x11Support ? true, xlibsWrapper ? null, libXrandr ? null
-, pulseaudioSupport ? true, libpulseaudio ? null
+{ stdenv, lib, fetchurl, pkgconfig, audiofile
+, openglSupport ? false, mesa_noglu
+, alsaSupport ? true, alsaLib
+, x11Support ? true, libICE, libXi, libXScrnSaver, libXcursor, libXinerama, libXext, libXxf86vm, libXrandr
+, dbusSupport ? false, dbus
+, udevSupport ? false, udev
+, ibusSupport ? false, ibus
+, pulseaudioSupport ? true, libpulseaudio
 , AudioUnit, Cocoa, CoreAudio, CoreServices, ForceFeedback, OpenGL
 }:
 
@@ -10,35 +13,39 @@
 # PulseAudio.
 assert !stdenv.isDarwin -> alsaSupport || pulseaudioSupport;
 
-assert openglSupport -> (stdenv.isDarwin || mesa != null && x11Support);
-assert x11Support -> (xlibsWrapper != null && libXrandr != null);
-assert alsaSupport -> alsaLib != null;
-assert pulseaudioSupport -> libpulseaudio != null;
+assert openglSupport -> (stdenv.isDarwin || mesa_noglu != null && x11Support);
 
 let
-  configureFlagsFun = attrs: ''
-        --disable-oss --disable-x11-shared
-        --disable-pulseaudio-shared --disable-alsa-shared
-        ${if alsaSupport then "--with-alsa-prefix=${attrs.alsaLib.out}/lib" else ""}
-        ${if (!x11Support) then "--without-x" else ""}
-      '';
+  configureFlagsFun = attrs: [
+      "--disable-oss" "--disable-x11-shared"
+      "--disable-pulseaudio-shared" "--disable-alsa-shared"
+    ] ++ lib.optional alsaSupport "--with-alsa-prefix=${attrs.alsaLib.out}/lib"
+      ++ lib.optional (!x11Support) "--without-x";
 in
 stdenv.mkDerivation rec {
-  name = "SDL2-2.0.3";
+  name = "SDL2-${version}";
+  version = "2.0.4";
 
   src = fetchurl {
     url = "http://www.libsdl.org/release/${name}.tar.gz";
-    sha256 = "0369ngvb46x6c26h8zva4x22ywgy6mvn0wx87xqwxg40pxm9m9m5";
+    sha256 = "0jqp46mxxbh9lhpx1ih6sp93k752j2smhpc0ad0q4cb3px0famfs";
   };
 
+  patches = [ ./find-headers.patch ];
+
+  nativeBuildInputs = [ pkgconfig ];
+
   # Since `libpulse*.la' contain `-lgdbm', PulseAudio must be propagated.
-  propagatedBuildInputs = stdenv.lib.optionals x11Support [ xlibsWrapper libXrandr ] ++
-    stdenv.lib.optional pulseaudioSupport libpulseaudio;
+  propagatedBuildInputs = lib.optionals x11Support [ libICE libXi libXScrnSaver libXcursor libXinerama libXext libXrandr libXxf86vm ] ++
+    lib.optional pulseaudioSupport libpulseaudio;
 
-  buildInputs = [ pkgconfig audiofile ] ++
-    stdenv.lib.optional openglSupport mesa ++
-    stdenv.lib.optional alsaSupport alsaLib ++
-    stdenv.lib.optionals stdenv.isDarwin [ AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL ];
+  buildInputs = [ audiofile ] ++
+    lib.optional openglSupport mesa_noglu ++
+    lib.optional alsaSupport alsaLib ++
+    lib.optional dbusSupport dbus ++
+    lib.optional udevSupport udev ++
+    lib.optional ibusSupport ibus ++
+    lib.optionals stdenv.isDarwin [ AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL ];
 
   # https://bugzilla.libsdl.org/show_bug.cgi?id=1431
   dontDisableStatic = true;
@@ -49,20 +56,22 @@ stdenv.mkDerivation rec {
   configureFlags = configureFlagsFun { inherit alsaLib; };
 
   crossAttrs = {
-      configureFlags = configureFlagsFun { alsaLib = alsaLib.crossDrv; };
+    configureFlags = configureFlagsFun { alsaLib = alsaLib.crossDrv; };
   };
 
   postInstall = ''
     rm $out/lib/*.a
   '';
 
-  passthru = {inherit openglSupport;};
+  setupHook = ./setup-hook.sh;
+
+  passthru = { inherit openglSupport; };
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "A cross-platform multimedia library";
-    homepage = http://www.libsdl.org/;
-    license = stdenv.lib.licenses.zlib;
-    platforms = stdenv.lib.platforms.all;
-    maintainers = [ stdenv.lib.maintainers.page ];
+    homepage = "http://www.libsdl.org/";
+    license = licenses.zlib;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ page ];
   };
 }
diff --git a/pkgs/development/libraries/SDL2/find-headers.patch b/pkgs/development/libraries/SDL2/find-headers.patch
new file mode 100644
index 00000000000..a6114901055
--- /dev/null
+++ b/pkgs/development/libraries/SDL2/find-headers.patch
@@ -0,0 +1,26 @@
+diff -ru3 SDL2-2.0.4/sdl2-config.cmake.in SDL2-2.0.4-new/sdl2-config.cmake.in
+--- SDL2-2.0.4/sdl2-config.cmake.in	2016-01-02 22:56:31.000000000 +0300
++++ SDL2-2.0.4-new/sdl2-config.cmake.in	2016-08-22 05:26:42.420397323 +0300
+@@ -6,5 +6,5 @@
+ set(SDL2_PREFIX "@prefix@")
+ set(SDL2_EXEC_PREFIX "@prefix@")
+ set(SDL2_LIBDIR "@libdir@")
+-set(SDL2_INCLUDE_DIRS "@includedir@/SDL2")
++set(SDL2_INCLUDE_DIRS "@includedir@/SDL2" $ENV{SDL2_PATH})
+ set(SDL2_LIBRARIES "-L${SDL2_LIBDIR} @SDL_RLD_FLAGS@ @SDL_LIBS@")
+diff -ru3 SDL2-2.0.4/sdl2-config.in SDL2-2.0.4-new/sdl2-config.in
+--- SDL2-2.0.4/sdl2-config.in	2016-01-02 22:56:31.000000000 +0300
++++ SDL2-2.0.4-new/sdl2-config.in	2016-08-22 05:32:02.256397839 +0300
+@@ -42,7 +42,11 @@
+       echo @SDL_VERSION@
+       ;;
+     --cflags)
+-      echo -I@includedir@/SDL2 @SDL_CFLAGS@
++      SDL_CFLAGS=""
++      for i in @includedir@/SDL2 $SDL2_PATH; do
++        SDL_CFLAGS="$SDL_CFLAGS -I$i"
++      done
++      echo $SDL_CFLAGS @SDL_CFLAGS@
+       ;;
+ @ENABLE_SHARED_TRUE@    --libs)
+ @ENABLE_SHARED_TRUE@      echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@
diff --git a/pkgs/development/libraries/SDL2/setup-hook.sh b/pkgs/development/libraries/SDL2/setup-hook.sh
new file mode 100644
index 00000000000..5a26440f37b
--- /dev/null
+++ b/pkgs/development/libraries/SDL2/setup-hook.sh
@@ -0,0 +1,11 @@
+addSDL2Path () {
+  if [ -e "$1/include/SDL2" ]; then
+    export SDL2_PATH="$SDL2_PATH $1/include/SDL2"
+  fi
+}
+
+if test -n "$crossConfig"; then
+  crossEnvHooks+=(addSDL2Path)
+else
+  envHooks+=(addSDL2Path)
+fi
diff --git a/pkgs/development/libraries/SDL2_gfx/default.nix b/pkgs/development/libraries/SDL2_gfx/default.nix
index 23a0924ad3b..1d26fed805e 100644
--- a/pkgs/development/libraries/SDL2_gfx/default.nix
+++ b/pkgs/development/libraries/SDL2_gfx/default.nix
@@ -1,30 +1,19 @@
-{stdenv, fetchsvn, SDL2}:
+{ stdenv, fetchurl, SDL2 }:
 
-let rev = 5; in
 stdenv.mkDerivation rec {
-  name = "SDL2_gfx-${toString rev}";
+  name = "SDL2_gfx-${version}";
+  version = "1.0.1";
 
-  src = fetchsvn {
-    url = http://svn.code.sf.net/p/sdl2gfx/code/trunk;
-    inherit rev;
-    sha256 = "1hzilbn1412m2b44mygrbdfh1gvks4v5p0kmafz248jf9ifsvmzp";
+  src = fetchurl {
+    url = "mirror://sourceforge/sdl2gfx/${name}.tar.gz";
+    sha256 = "16jrijzdp095qf416zvj9gs2fqqn6zkyvlxs5xqybd0ip37cp6yn";
   };
 
-  buildInputs = [ SDL2 ] ;
+  buildInputs = [ SDL2 ];
 
-  configureFlags = "--disable-mmx";
+  configureFlags = [ "--enable-mmx" ];
 
-  postInstall = ''
-    sed -i -e 's,"SDL.h",<SDL2/SDL.h>,' \
-      $out/include/SDL2/*.h
-
-    ln -s $out/include/SDL2/SDL2_framerate.h $out/include/SDL2/SDL_framerate.h;
-    ln -s $out/include/SDL2/SDL2_gfxPrimitives.h $out/include/SDL2/SDL_gfxPrimitives.h;
-    ln -s $out/include/SDL2/SDL2_rotozoom.h $out/include/SDL2/SDL_rotozoom.h;
-    ln -s $out/include/SDL2/*.h $out/include/;
-  '';
-
-  meta = {
+  meta = with stdenv.lib; {
     description = "SDL graphics drawing primitives and support functions";
 
     longDescription = ''
@@ -45,10 +34,10 @@ stdenv.mkDerivation rec {
       code. Its is written in plain C and can be used in C++ code.
     '';
 
-    homepage = https://sourceforge.net/projects/sdlgfx/;
-    license = stdenv.lib.licenses.lgpl2Plus;
+    homepage = "https://sourceforge.net/projects/sdlgfx/";
+    license = licenses.zlib;
 
-    maintainers = [ stdenv.lib.maintainers.bjg ];
-    platforms = stdenv.lib.platforms.linux;
+    maintainers = with maintainers; [ bjg ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/SDL2_image/default.nix b/pkgs/development/libraries/SDL2_image/default.nix
index 7253fc7b4da..22282e1a10c 100644
--- a/pkgs/development/libraries/SDL2_image/default.nix
+++ b/pkgs/development/libraries/SDL2_image/default.nix
@@ -1,27 +1,20 @@
 { stdenv, fetchurl, SDL2, libpng, libjpeg, libtiff, libungif, libXpm, zlib }:
 
 stdenv.mkDerivation rec {
-  name = "SDL2_image-2.0.1";
+  name = "SDL2_image-${version}";
+  version = "2.0.1";
 
   src = fetchurl {
     url = "http://www.libsdl.org/projects/SDL_image/release/${name}.tar.gz";
     sha256 = "0r3z1l7fdn76qkpy7snpkcjqz8dkv2zp6lsqpq25q4m5xsyaygis";
   };
 
-  buildInputs = [SDL2 libpng libjpeg libtiff libungif libXpm zlib];
+  buildInputs = [ SDL2 libpng libjpeg libtiff libungif libXpm zlib ];
 
-  postInstall = ''
-    sed -i -e 's,"SDL.h",<SDL2/SDL.h>,' \
-      -e 's,"SDL_version.h",<SDL2/SDL_version.h>,' \
-      -e 's,"begin_code.h",<SDL2/begin_code.h>,' \
-      -e 's,"close_code.h",<SDL2/close_code.h>,' \
-      $out/include/SDL2/SDL_image.h
-    ln -sv SDL2/SDL_image.h $out/include/SDL_image.h
-  '';
-
-  meta = {
+  meta = with stdenv.lib; {
     description = "SDL image library";
     homepage = "http://www.libsdl.org/projects/SDL_image/";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = platforms.linux;
+    license = licenses.zlib;
   };
 }
diff --git a/pkgs/development/libraries/SDL2_mixer/default.nix b/pkgs/development/libraries/SDL2_mixer/default.nix
index 1a7ce841d0c..0919970543c 100644
--- a/pkgs/development/libraries/SDL2_mixer/default.nix
+++ b/pkgs/development/libraries/SDL2_mixer/default.nix
@@ -1,21 +1,22 @@
-{ stdenv, fetchurl, SDL2, libogg, libvorbis, enableNativeMidi ? false }:
+{ stdenv, lib, fetchurl, SDL2, libogg, libvorbis, enableNativeMidi ? false }:
 
 stdenv.mkDerivation rec {
-  name = "SDL2_mixer-2.0.1";
+  name = "SDL2_mixer-${version}";
+  version = "2.0.1";
 
   src = fetchurl {
     url = "http://www.libsdl.org/projects/SDL_mixer/release/${name}.tar.gz";
     sha256 = "0pv9jzjpcjlbiaybvwrb4avmv46qk7iqxlnqrd2dfj82c4mgc92s";
   };
 
-  propagatedBuildInputs = [SDL2 libogg libvorbis];
+  propagatedBuildInputs = [ SDL2 libogg libvorbis ];
 
-  configureFlags = "--disable-music-ogg-shared" + stdenv.lib.optionalString enableNativeMidi "--enable-music-native-midi-gpl";
+  configureFlags = [ "--disable-music-ogg-shared" ] ++ lib.optional enableNativeMidi "--enable-music-native-midi-gpl";
 
-  postInstall = "ln -s $out/include/SDL2/SDL_mixer.h $out/include/";
-
-  meta = {
+  meta = with stdenv.lib; {
     description = "SDL multi-channel audio mixer library";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = platforms.linux;
+    homepage = "https://www.libsdl.org/projects/SDL_mixer/";
+    license = licenses.zlib;
   };
 }
diff --git a/pkgs/development/libraries/SDL2_net/default.nix b/pkgs/development/libraries/SDL2_net/default.nix
index 6f096577819..15a3305c7f4 100644
--- a/pkgs/development/libraries/SDL2_net/default.nix
+++ b/pkgs/development/libraries/SDL2_net/default.nix
@@ -1,22 +1,21 @@
 { stdenv, fetchurl, SDL2 }:
 
 stdenv.mkDerivation rec {
-  name = "SDL2_net-2.0.0";
+  name = "SDL2_net-${version}";
+  version = "2.0.1";
 
   src = fetchurl {
     url = "http://www.libsdl.org/projects/SDL_net/release/${name}.tar.gz";
-    sha256 = "d715be30783cc99e541626da52079e308060b21d4f7b95f0224b1d06c1faacab";
+    sha256 = "08cxc1bicmyk89kiks7izw1rlx5ng5n6xpy8fy0zxni3b9z8mkhm";
   };
 
-  propagatedBuildInputs = [SDL2];
-
-  postInstall = "ln -s $out/include/SDL2/SDL_net.h $out/include/";
+  propagatedBuildInputs = [ SDL2 ];
 
   meta = with stdenv.lib; {
     description = "SDL multiplatform networking library";
-    homepage = https://www.libsdl.org/projects/SDL_net;
+    homepage = "https://www.libsdl.org/projects/SDL_net";
     license = licenses.zlib;
-    maintainers = [ maintainers.MP2E ];
+    maintainers = with maintainers; [ MP2E ];
     platforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/SDL2_ttf/default.nix b/pkgs/development/libraries/SDL2_ttf/default.nix
index 84944c0aa66..71aeecb3a80 100644
--- a/pkgs/development/libraries/SDL2_ttf/default.nix
+++ b/pkgs/development/libraries/SDL2_ttf/default.nix
@@ -1,19 +1,20 @@
-{ stdenv, fetchurl, SDL2, freetype }:
+{ stdenv, fetchurl, SDL2, freetype, mesa_noglu }:
 
 stdenv.mkDerivation rec {
-  name = "SDL2_ttf-2.0.14";
+  name = "SDL2_ttf-${version}";
+  version = "2.0.14";
 
   src = fetchurl {
     url = "https://www.libsdl.org/projects/SDL_ttf/release/${name}.tar.gz";
     sha256 = "0xljwcpvd2knrjdfag5b257xqayplz55mqlszrqp0kpnphh5xnrl";
   };
 
-  buildInputs = [SDL2 freetype];
+  buildInputs = [ SDL2 freetype mesa_noglu ];
 
-  postInstall = "ln -s $out/include/SDL2/SDL_ttf.h $out/include/";
-
-  meta = {
+  meta = with stdenv.lib; {
     description = "SDL TrueType library";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = platforms.linux;
+    license = licenses.zlib;
+    homepage = "https://www.libsdl.org/projects/SDL_ttf/";
   };
 }
diff --git a/pkgs/development/libraries/SDL_gfx/default.nix b/pkgs/development/libraries/SDL_gfx/default.nix
index 7bff348b754..ff8c081af93 100644
--- a/pkgs/development/libraries/SDL_gfx/default.nix
+++ b/pkgs/development/libraries/SDL_gfx/default.nix
@@ -1,7 +1,8 @@
-{stdenv, fetchurl, SDL} :
+{ stdenv, fetchurl, SDL }:
 
 stdenv.mkDerivation rec {
-  name = "SDL_gfx-2.0.25";
+  name = "SDL_gfx-${version}";
+  version = "2.0.25";
 
   src = fetchurl {
     url = "http://www.ferzkopp.net/Software/SDL_gfx-2.0/${name}.tar.gz";
@@ -10,16 +11,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ SDL ] ;
 
-  configureFlags = "--disable-mmx";
+  configureFlags = [ "--disable-mmx" ];
 
-  postInstall = ''
-    sed -i -e 's,"SDL.h",<SDL/SDL.h>,' \
-      $out/include/SDL/*.h
-    
-    ln -s $out/include/SDL/*.h $out/include/;
-  '';
-
-  meta = {
+  meta = with stdenv.lib; {
     description = "SDL graphics drawing primitives and support functions";
 
     longDescription =
@@ -40,10 +34,10 @@ stdenv.mkDerivation rec {
          code. Its is written in plain C and can be used in C++ code.
        '';
 
-    homepage = https://sourceforge.net/projects/sdlgfx/;
-    license = stdenv.lib.licenses.lgpl2Plus;
+    homepage = "https://sourceforge.net/projects/sdlgfx/";
+    license = licenses.zlib;
 
-    maintainers = [ stdenv.lib.maintainers.bjg ];
-    platforms = stdenv.lib.platforms.unix;
+    maintainers = with maintainers; [ bjg ];
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/SDL_image/default.nix b/pkgs/development/libraries/SDL_image/default.nix
index a1d83950477..62af47807cc 100644
--- a/pkgs/development/libraries/SDL_image/default.nix
+++ b/pkgs/development/libraries/SDL_image/default.nix
@@ -1,7 +1,8 @@
 { stdenv, fetchurl, SDL, libpng, libjpeg, libtiff, libungif, libXpm }:
 
 stdenv.mkDerivation rec {
-  name = "SDL_image-1.2.12";
+  name = "SDL_image-${version}";
+  version = "1.2.12";
 
   src = fetchurl {
     url    = "http://www.libsdl.org/projects/SDL_image/release/${name}.tar.gz";
@@ -10,18 +11,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ SDL libpng libjpeg libtiff libungif libXpm ];
 
-  postInstall = ''
-    sed -i -e 's,"SDL.h",<SDL/SDL.h>,' \
-      -e 's,"SDL_version.h",<SDL/SDL_version.h>,' \
-      -e 's,"begin_code.h",<SDL/begin_code.h>,' \
-      -e 's,"close_code.h",<SDL/close_code.h>,' \
-      $out/include/SDL/SDL_image.h
-    ln -sv SDL/SDL_image.h $out/include/SDL_image.h
-  '';
-
   meta = with stdenv.lib; {
     description = "SDL image library";
-    homepage    = http://www.libsdl.org/projects/SDL_image/;
+    homepage    = "http://www.libsdl.org/projects/SDL_image/";
     maintainers = with maintainers; [ lovek323 ];
     platforms   = platforms.unix;
   };
diff --git a/pkgs/development/libraries/SDL_mixer/default.nix b/pkgs/development/libraries/SDL_mixer/default.nix
index 22a67b13e0b..d3d57947464 100644
--- a/pkgs/development/libraries/SDL_mixer/default.nix
+++ b/pkgs/development/libraries/SDL_mixer/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, SDL, libogg, libvorbis, smpeg, enableNativeMidi ? false, fluidsynth ? null }:
+{ stdenv, lib, fetchurl, SDL, libogg, libvorbis, smpeg, enableNativeMidi ? false, fluidsynth ? null }:
 
 stdenv.mkDerivation rec {
   pname   = "SDL_mixer";
@@ -10,11 +10,9 @@ stdenv.mkDerivation rec {
     sha256 = "0alrhqgm40p4c92s26mimg9cm1y7rzr6m0p49687jxd9g6130i0n";
   };
 
-  buildInputs = [SDL libogg libvorbis fluidsynth smpeg];
+  buildInputs = [ SDL libogg libvorbis fluidsynth smpeg ];
 
-  configureFlags = "--disable-music-ogg-shared" + stdenv.lib.optionalString enableNativeMidi " --enable-music-native-midi-gpl";
-
-  postInstall = "ln -s $out/include/SDL/SDL_mixer.h $out/include/";
+  configureFlags = [ "--disable-music-ogg-shared" ] ++ lib.optional enableNativeMidi " --enable-music-native-midi-gpl";
 
   meta = with stdenv.lib; {
     description = "SDL multi-channel audio mixer library";
diff --git a/pkgs/development/libraries/SDL_net/default.nix b/pkgs/development/libraries/SDL_net/default.nix
index 045ad8925d9..b151d0ee83e 100644
--- a/pkgs/development/libraries/SDL_net/default.nix
+++ b/pkgs/development/libraries/SDL_net/default.nix
@@ -11,21 +11,12 @@ stdenv.mkDerivation rec {
     sha256 = "1d5c9xqlf4s1c01gzv6cxmg0r621pq9kfgxcg3197xw4p25pljjz";
   };
 
-  propagatedBuildInputs = [SDL];
+  propagatedBuildInputs = [ SDL ];
 
-  postInstall = ''
-    sed -i -e 's,"SDL.h",<SDL/SDL.h>,' \
-    -e 's,"SDL_endian.h",<SDL/SDL_endian.h>,' \
-    -e 's,"SDL_version.h",<SDL/SDL_version.h>,' \
-    -e 's,"begin_code.h",<SDL/begin_code.h>,' \
-    -e 's,"close_code.h",<SDL/close_code.h>,' \
-      $out/include/SDL/SDL_net.h
-
-    ln -sv $out/include/SDL/SDL_net.h $out/include/
-  '';
-
-  meta = {
+  meta = with stdenv.lib; {
     description = "SDL networking library";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = platforms.unix;
+    license = licenses.zlib;
+    homepage = "https://www.libsdl.org/projects/SDL_net/release-1.2.html";
   };
 }
diff --git a/pkgs/development/libraries/SDL_sound/default.nix b/pkgs/development/libraries/SDL_sound/default.nix
index 5ca64730f51..8d088b6bbf4 100644
--- a/pkgs/development/libraries/SDL_sound/default.nix
+++ b/pkgs/development/libraries/SDL_sound/default.nix
@@ -1,7 +1,8 @@
-{stdenv, fetchurl, SDL, libvorbis, flac, libmikmod}:
+{ stdenv, fetchurl, SDL, libvorbis, flac, libmikmod }:
 
 stdenv.mkDerivation rec {
-  name = "SDL_sound-1.0.3";
+  name = "SDL_sound-${version}";
+  version = "1.0.3";
 
   src = fetchurl {
     url = "http://icculus.org/SDL_sound/downloads/${name}.tar.gz";
@@ -10,10 +11,10 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ SDL libvorbis flac libmikmod ];
 
-  postInstall = "ln -s $out/include/SDL/SDL_sound.h $out/include/";
-
-  meta = {
+  meta = with stdenv.lib; {
     description = "SDL sound library";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = platforms.linux;
+    license = licenses.lgpl21;
+    homepage = "https://www.icculus.org/SDL_sound/";
   };
 }
diff --git a/pkgs/development/libraries/SDL_stretch/default.nix b/pkgs/development/libraries/SDL_stretch/default.nix
index 52c43da9d16..2a4ddac524c 100644
--- a/pkgs/development/libraries/SDL_stretch/default.nix
+++ b/pkgs/development/libraries/SDL_stretch/default.nix
@@ -1,19 +1,20 @@
 { stdenv, fetchurl, SDL }:
 
-stdenv.mkDerivation {
-  name = "SDL_stretch-0.3.1";
+stdenv.mkDerivation rec {
+  name = "SDL_stretch-${version}";
+  version = "0.3.1";
 
   src = fetchurl {
-    url = "mirror://sourceforge/sdl-stretch/0.3.1/SDL_stretch-0.3.1.tar.bz2";
+    url = "mirror://sourceforge/sdl-stretch/${version}/${name}.tar.bz2";
     sha256 = "1mzw68sn4yxbp8429jg2h23h8xw2qjid51z1f5pdsghcn3x0pgvw";
   };
 
   buildInputs = [ SDL ];
 
-  meta = {
+  meta = with stdenv.lib; {
      description = "Stretch Functions For SDL";
      homepage = "http://sdl-stretch.sourceforge.net/";
-     license = stdenv.lib.licenses.lgpl2;
-     platforms = stdenv.lib.platforms.linux;
+     license = licenses.lgpl2;
+     platforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/apache-activemq/default.nix b/pkgs/development/libraries/apache-activemq/default.nix
index 04938868d10..c71dced918a 100644
--- a/pkgs/development/libraries/apache-activemq/default.nix
+++ b/pkgs/development/libraries/apache-activemq/default.nix
@@ -2,10 +2,10 @@
 
 stdenv.mkDerivation rec {
   name = "apache-activemq-${version}";
-  version = "5.13.2";
+  version = "5.13.4";
 
   src = fetchurl {
-    sha256 = "0vrgny8fw973xvr3w4wc1s44z50b0c2hgcqa91s8fbx2yjmqn5xy";
+    sha256 = "0sp806bmv9vs19zbzlv71ag09p1jbl2wn2wpxfwa20mndri8lsmz";
     url = "mirror://apache/activemq/${version}/${name}-bin.tar.gz";
   };
 
diff --git a/pkgs/development/libraries/appstream-glib/default.nix b/pkgs/development/libraries/appstream-glib/default.nix
index e6051552ab7..8450def0845 100644
--- a/pkgs/development/libraries/appstream-glib/default.nix
+++ b/pkgs/development/libraries/appstream-glib/default.nix
@@ -5,13 +5,13 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "appstream-glib-0.5.11";
+  name = "appstream-glib-0.5.12";
 
   src = fetchFromGitHub {
     owner = "hughsie";
     repo = "appstream-glib";
     rev = stdenv.lib.replaceStrings ["." "-"] ["_" "_"] name;
-    sha256 = "1rvfncm9z29h70pd718j73cd263g6yyxkxrg7zfzy0gj6wwzvhkh";
+    sha256 = "00b0441f409vzgy0znn42k093w7hwv3495qvsakxnhvk1h1ws23s";
   };
 
   nativeBuildInputs = [ autoconf automake libtool pkgconfig intltool ];
diff --git a/pkgs/development/libraries/armadillo/default.nix b/pkgs/development/libraries/armadillo/default.nix
index 937275b6528..62b5ddf8011 100644
--- a/pkgs/development/libraries/armadillo/default.nix
+++ b/pkgs/development/libraries/armadillo/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, openblasCompat, superlu, hdf5 }:
+{ stdenv, fetchurl, cmake, openblasCompat, superlu, hdf5-cpp }:
 
 stdenv.mkDerivation rec {
   version = "7.200.2";
@@ -9,12 +9,11 @@ stdenv.mkDerivation rec {
     sha256 = "1yvx75caks477jqwx5gspi6946jialddk00wdvg6dnh5wdi2xasm";
   };
 
-  buildInputs = [ cmake openblasCompat superlu hdf5 ];
+  buildInputs = [ cmake openblasCompat superlu hdf5-cpp ];
 
   cmakeFlags = [ "-DDETECT_HDF5=ON" ];
 
-  patches = [ ./use-unix-config-on-OS-X.patch
-              ./use-OpenBLAS-as-LAPACK.patch ];
+  patches = [ ./use-unix-config-on-OS-X.patch ];
   
   meta = with stdenv.lib; {
     description = "C++ linear algebra library";
diff --git a/pkgs/development/libraries/armadillo/use-OpenBLAS-as-LAPACK.patch b/pkgs/development/libraries/armadillo/use-OpenBLAS-as-LAPACK.patch
deleted file mode 100644
index e4c77d2cc2e..00000000000
--- a/pkgs/development/libraries/armadillo/use-OpenBLAS-as-LAPACK.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/cmake_aux/Modules/ARMA_FindLAPACK.cmake b/cmake_aux/Modules/ARMA_FindLAPACK.cmake
-index 5395afb..a203c93 100644
---- a/cmake_aux/Modules/ARMA_FindLAPACK.cmake
-+++ b/cmake_aux/Modules/ARMA_FindLAPACK.cmake
-@@ -5,7 +5,7 @@
- # also defined, but not for general use are
- #  LAPACK_LIBRARY, where to find the LAPACK library.
- 
--SET(LAPACK_NAMES ${LAPACK_NAMES} lapack)
-+SET(LAPACK_NAMES ${LAPACK_NAMES} openblas)
- FIND_LIBRARY(LAPACK_LIBRARY
-   NAMES ${LAPACK_NAMES}
-   PATHS /usr/lib64/atlas /usr/lib/atlas /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib
-
diff --git a/pkgs/development/libraries/cairo/default.nix b/pkgs/development/libraries/cairo/default.nix
index f6f0a0d3af7..1f38f69eb0c 100644
--- a/pkgs/development/libraries/cairo/default.nix
+++ b/pkgs/development/libraries/cairo/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, pkgconfig, libiconv, libintlOrEmpty
+{ stdenv, fetchurl, fetchFromGitHub, pkgconfig, libiconv, libintlOrEmpty
 , expat, zlib, libpng, pixman, fontconfig, freetype, xorg
 , gobjectSupport ? true, glib
 , xcbSupport ? true # no longer experimental since 1.12
@@ -19,6 +19,17 @@ stdenv.mkDerivation rec {
     sha256 = "0lmjlzmghmr27y615px9hkm552x7ap6pmq9mfbzr6smp8y2b6g31";
   };
 
+  infinality = fetchFromGitHub {
+    owner = "bohoomil";
+    repo = "fontconfig-ultimate";
+    rev = "730f5e77580677e86522c1f2119aa78803741759";
+    sha256 = "1hbrdpm6xcczs2c2iid7by8h7dsd0jcf7an88s150njyqnjzxjg7";
+  };
+
+  prePatch = ''
+    patches="$patches $(echo $infinality/*_cairo-iu/*.patch)"
+  '';
+
   outputs = [ "dev" "out" "docdev" ];
   outputBin = "dev"; # very small
 
diff --git a/pkgs/development/libraries/cppzmq/default.nix b/pkgs/development/libraries/cppzmq/default.nix
index 62563cfb968..9da83ca913e 100644
--- a/pkgs/development/libraries/cppzmq/default.nix
+++ b/pkgs/development/libraries/cppzmq/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "cppzmq-${version}";
-  version = "2016-01-20";
+  version = "2016-07-18";
 
   src = fetchFromGitHub {
     owner = "zeromq";
     repo = "cppzmq";
-    rev = "68a7b09cfce01c4c279fba2cf91686fcfc566848";
-    sha256 = "00dsqqlm8mxhm8kfdspxfln0wzwkyywscnf264afw02k6xf28ndm";
+    rev = "92d2af6def80a01b76d5e73f073c439ad00ab757";
+    sha256 = "0lnwh314hh5ifad2sa2nz1g1ld1jc4vplm7clyvx304sjjvbvl27";
   };
 
   installPhase = ''
diff --git a/pkgs/development/libraries/cxx-prettyprint/default.nix b/pkgs/development/libraries/cxx-prettyprint/default.nix
new file mode 100644
index 00000000000..8be68a314e3
--- /dev/null
+++ b/pkgs/development/libraries/cxx-prettyprint/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  name = "cxx-prettyprint-unstable-${version}";
+  version = "2016-04-30";
+  rev = "9ab26d228f2960f50b38ad37fe0159b7381f7533";
+
+  src = fetchFromGitHub {
+    owner = "louisdx";
+    repo = "cxx-prettyprint";
+    inherit rev;
+    sha256 = "1bp25yw8fb0mi432f72ihfxfj887gi36b36fpv677gawm786l7p1";
+  };
+
+  installPhase = ''
+    mkdir -p "$out/include"
+    cp prettyprint.hpp "$out/include"
+  '';
+
+  meta = with stdenv.lib; {
+    description    = "Header only C++ library for pretty printing standard containers";
+    homepage       = https://github.com/louisdx/cxx-prettyprint;
+    license        = stdenv.lib.licenses.boost;
+    platforms      = platforms.all;
+
+    # This is a header-only library, no point in hydra building it:
+    hydraPlatforms = [];
+  };
+}
diff --git a/pkgs/development/libraries/cxxtools/default.nix b/pkgs/development/libraries/cxxtools/default.nix
new file mode 100644
index 00000000000..c677ae6d867
--- /dev/null
+++ b/pkgs/development/libraries/cxxtools/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  version = "2.2.1";
+  name = "cxxtools";
+
+  src = fetchurl {
+    url = "http://www.tntnet.org/download/${name}-${version}.tar.gz";
+    sha256 = "0hp3qkyhidxkdf8qgkwrnqq5bpahink55mf0yz23rjd7rpbbdswc";
+  };
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "http://www.tntnet.org/cxxtools.html";
+    description = "Comprehensive C++ class library for Unix and Linux";
+    platforms = stdenv.lib.platforms.linux ;
+    license = stdenv.lib.licenses.lgpl21;
+    maintainers = [ stdenv.lib.maintainers.juliendehos ];
+  };
+}
diff --git a/pkgs/development/libraries/czmq/default.nix b/pkgs/development/libraries/czmq/default.nix
index 5e2081e750d..69b64629bd8 100644
--- a/pkgs/development/libraries/czmq/default.nix
+++ b/pkgs/development/libraries/czmq/default.nix
@@ -1,15 +1,17 @@
 { stdenv, fetchurl, zeromq }:
 
 stdenv.mkDerivation rec {
-  baseName="czmq";
-  version="3.0.2";
-  name="${baseName}-${version}";
+  version = "3.0.2";
+  name = "czmq-${version}";
 
   src = fetchurl {
     url = "http://download.zeromq.org/${name}.tar.gz";
     sha256 = "16k9awrhdsymx7dnmvqcnkaq8lz8x8zppy6sh7ls8prpd6mkkjlb";
   };
 
+  # Fix build on Glibc 2.24.
+  NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
+
   # Needs to be propagated for the .pc file to work
   propagatedBuildInputs = [ zeromq ];
 
diff --git a/pkgs/development/libraries/fftw/default.nix b/pkgs/development/libraries/fftw/default.nix
index 6b92848fd0f..68d1e62244c 100644
--- a/pkgs/development/libraries/fftw/default.nix
+++ b/pkgs/development/libraries/fftw/default.nix
@@ -35,7 +35,9 @@ 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 "--enable-openmp"
+    # doc generation causes Fortran wrapper generation which hard-codes gcc
+    ++ optional (!stdenv.cc.isGNU) "--disable-doc";
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/folly/default.nix b/pkgs/development/libraries/folly/default.nix
index dc07c481b10..f4ab12e3c7f 100644
--- a/pkgs/development/libraries/folly/default.nix
+++ b/pkgs/development/libraries/folly/default.nix
@@ -1,18 +1,18 @@
-{ stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, boost, libevent, double_conversion, glog
-, google-gflags, python, libiberty, openssl }:
+{ stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, pkgconfig, boost, libevent
+, double_conversion, glog, google-gflags, python, libiberty, openssl }:
 
 stdenv.mkDerivation rec {
   name = "folly-${version}";
-  version = "2016-04-29";
+  version = "2016.08.08.00";
 
   src = fetchFromGitHub {
     owner = "facebook";
     repo = "folly";
-    rev = "b31eb722e444ab0293a73fe9de3f94e657ca6de9";
-    sha256 = "0s95y0wnz4xbrkzbiksnb0n0d0qrkcsbssznng57kwlq8jlfka24";
+    rev = "v${version}";
+    sha256 = "0f9xdi8w2mbn6gxjfvpzh8i22ca8p11a2ss6qkw31yhdgd3s9087";
   };
 
-  nativeBuildInputs = [ autoreconfHook python ];
+  nativeBuildInputs = [ autoreconfHook python pkgconfig ];
   buildInputs = [ libiberty boost libevent double_conversion glog google-gflags openssl ];
 
   postPatch = "cd folly";
diff --git a/pkgs/development/libraries/fontconfig-ultimate/confd.nix b/pkgs/development/libraries/fontconfig-ultimate/confd.nix
deleted file mode 100644
index 160fef5f07e..00000000000
--- a/pkgs/development/libraries/fontconfig-ultimate/confd.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ stdenv, fetchFromGitHub }:
-
-let version = "2015-12-06"; in
-stdenv.mkDerivation {
-  name = "fontconfig-ultimate-${version}";
-
-  src = fetchFromGitHub {
-    sha256 = "02a811szxkq4q088nxfpdzp6rv0brvgkdhwigk09qffygxd776g6";
-    rev = version;
-    repo = "fontconfig-ultimate";
-    owner = "bohoomil";
-  };
-
-  phases = "$prePhases unpackPhase installPhase $postPhases";
-
-  installPhase = ''
-    mkdir -p $out/etc/fonts/conf.d
-    cp conf.d.infinality/*.conf $out/etc/fonts/conf.d
-
-    # Base rendering settings will be determined by NixOS module
-    rm $out/etc/fonts/conf.d/10-base-rendering.conf
-
-    # Options controlled by NixOS module
-    rm $out/etc/fonts/conf.d/35-repl-custom.conf
-    rm $out/etc/fonts/conf.d/38-repl-*.conf
-    rm $out/etc/fonts/conf.d/82-*.conf
-    rm $out/etc/fonts/conf.d/83-*.conf
-
-    # Inclusion of local and user configs handled by global configuration
-    rm $out/etc/fonts/conf.d/29-local.conf
-    rm $out/etc/fonts/conf.d/28-user.conf
-
-    cp fontconfig_patches/fonts-settings/*.conf $out/etc/fonts/conf.d
-
-    mkdir -p $out/etc/fonts/presets/{combi,free,ms}
-    cp fontconfig_patches/combi/*.conf $out/etc/fonts/presets/combi
-    cp fontconfig_patches/free/*.conf $out/etc/fonts/presets/free
-    cp fontconfig_patches/ms/*.conf $out/etc/fonts/presets/ms
-  '';
-}
diff --git a/pkgs/development/libraries/fontconfig-ultimate/default.nix b/pkgs/development/libraries/fontconfig-ultimate/default.nix
index aa799d850d7..efef59cad3b 100644
--- a/pkgs/development/libraries/fontconfig-ultimate/default.nix
+++ b/pkgs/development/libraries/fontconfig-ultimate/default.nix
@@ -1,6 +1,43 @@
-{ callPackage }:
+{ stdenv, fetchFromGitHub }:
 
-{
-  confd = callPackage ./confd.nix {};
-  rendering = callPackage ./rendering.nix {};
+let version = "2016-04-23"; in
+stdenv.mkDerivation {
+  name = "fontconfig-ultimate-${version}";
+
+  src = fetchFromGitHub {
+    sha256 = "1rd2n60l8bamx84q3l91pd9a0wz9h7p6ajvx1dw22qn8rah4h498";
+    rev = version;
+    repo = "fontconfig-ultimate";
+    owner = "bohoomil";
+  };
+
+  phases = "$prePhases unpackPhase installPhase $postPhases";
+
+  installPhase = ''
+    mkdir -p $out/etc/fonts/conf.d
+    cp conf.d.infinality/*.conf $out/etc/fonts/conf.d
+
+    # Base rendering settings will be determined by NixOS module
+    rm $out/etc/fonts/conf.d/10-base-rendering.conf
+
+    # Options controlled by NixOS module
+    rm $out/etc/fonts/conf.d/35-repl-custom.conf
+    rm $out/etc/fonts/conf.d/38-repl-*.conf
+    rm $out/etc/fonts/conf.d/82-*.conf
+    rm $out/etc/fonts/conf.d/83-*.conf
+
+    # Inclusion of local and user configs handled by global configuration
+    rm $out/etc/fonts/conf.d/29-local.conf
+    rm $out/etc/fonts/conf.d/28-user.conf
+
+    cp fontconfig_patches/fonts-settings/*.conf $out/etc/fonts/conf.d
+
+    # fix font priority issue https://github.com/bohoomil/fontconfig-ultimate/issues/173
+    mv $out/etc/fonts/conf.d/{43,60}-wqy-zenhei-sharp.conf
+
+    mkdir -p $out/etc/fonts/presets/{combi,free,ms}
+    cp fontconfig_patches/combi/*.conf $out/etc/fonts/presets/combi
+    cp fontconfig_patches/free/*.conf $out/etc/fonts/presets/free
+    cp fontconfig_patches/ms/*.conf $out/etc/fonts/presets/ms
+  '';
 }
diff --git a/pkgs/development/libraries/fontconfig-ultimate/rendering.nix b/pkgs/development/libraries/fontconfig-ultimate/rendering.nix
deleted file mode 100644
index b1de43b49b2..00000000000
--- a/pkgs/development/libraries/fontconfig-ultimate/rendering.nix
+++ /dev/null
@@ -1,212 +0,0 @@
-{}:
-
-rec {
-  default = {
-    INFINALITY_FT_FILTER_PARAMS="11 22 38 22 11";
-    INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH="0";
-    INFINALITY_FT_FRINGE_FILTER_STRENGTH="0";
-    INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH="10";
-    INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH="25";
-    INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="10";
-    INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH="0";
-    INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="25";
-    INFINALITY_FT_STEM_FITTING_STRENGTH="25";
-    INFINALITY_FT_GAMMA_CORRECTION="0 100";
-    INFINALITY_FT_BRIGHTNESS="0";
-    INFINALITY_FT_CONTRAST="0";
-    INFINALITY_FT_USE_VARIOUS_TWEAKS="true";
-    INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="true";
-    INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT="100";
-    INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="40";
-    INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS="true";
-    INFINALITY_FT_GLOBAL_EMBOLDEN_X_VALUE="0";
-    INFINALITY_FT_GLOBAL_EMBOLDEN_Y_VALUE="0";
-    INFINALITY_FT_BOLD_EMBOLDEN_X_VALUE="0";
-    INFINALITY_FT_BOLD_EMBOLDEN_Y_VALUE="0";
-  };
-
-  osx = default // {
-    INFINALITY_FT_FILTER_PARAMS="03 32 38 32 03";
-    INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH="25";
-    INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="0";
-    INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="0";
-    INFINALITY_FT_STEM_FITTING_STRENGTH="0";
-    INFINALITY_FT_GAMMA_CORRECTION="1000 80";
-    INFINALITY_FT_BRIGHTNESS="10";
-    INFINALITY_FT_CONTRAST="20";
-    INFINALITY_FT_USE_VARIOUS_TWEAKS="false";
-    INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false";
-    INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT="0";
-    INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="0";
-    INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS="false";
-    INFINALITY_FT_GLOBAL_EMBOLDEN_Y_VALUE="8";
-    INFINALITY_FT_BOLD_EMBOLDEN_X_VALUE="16";
-  };
-
-  ipad = default // {
-    INFINALITY_FT_FILTER_PARAMS="00 00 100 00 00";
-    INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH="100";
-    INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH="0";
-    INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH="0";
-    INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="0";
-    INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="0";
-    INFINALITY_FT_STEM_FITTING_STRENGTH="0";
-    INFINALITY_FT_GAMMA_CORRECTION="1000 80";
-    INFINALITY_FT_USE_VARIOUS_TWEAKS="false";
-    INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false";
-    INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT="0";
-    INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="0";
-    INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS="false";
-  };
-
-  ubuntu = default // {
-    INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="0";
-    INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="0";
-    INFINALITY_FT_STEM_FITTING_STRENGTH="0";
-    INFINALITY_FT_GAMMA_CORRECTION="1000 80";
-    INFINALITY_FT_BRIGHTNESS="-10";
-    INFINALITY_FT_CONTRAST="15";
-    INFINALITY_FT_USE_VARIOUS_TWEAKS="false";
-    INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false";
-    INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT="0";
-    INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="0";
-    INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS="false";
-  };
-
-  linux = default // {
-    INFINALITY_FT_FILTER_PARAMS="06 25 44 25 06";
-    INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="0";
-    INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="0";
-    INFINALITY_FT_STEM_FITTING_STRENGTH="0";
-    INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false";
-    INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT="100";
-    INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS="false";
-  };
-
-  winxplight = default // {
-    INFINALITY_FT_FILTER_PARAMS="06 25 44 25 06";
-    INFINALITY_FT_FRINGE_FILTER_STRENGTH="100";
-    INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="65";
-    INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="15";
-    INFINALITY_FT_STEM_FITTING_STRENGTH="15";
-    INFINALITY_FT_GAMMA_CORRECTION="1000 120";
-    INFINALITY_FT_BRIGHTNESS="20";
-    INFINALITY_FT_CONTRAST="30";
-    INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false";
-    INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="30";
-  };
-
-  win7light = default // {
-    INFINALITY_FT_FILTER_PARAMS="20 25 38 25 05";
-    INFINALITY_FT_FRINGE_FILTER_STRENGTH="100";
-    INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="100";
-    INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="0";
-    INFINALITY_FT_STEM_FITTING_STRENGTH="0";
-    INFINALITY_FT_GAMMA_CORRECTION="1000 160";
-    INFINALITY_FT_CONTRAST="20";
-    INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false";
-    INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="30";
-  };
-
-  winxp = default // {
-    INFINALITY_FT_FILTER_PARAMS="06 25 44 25 06";
-    INFINALITY_FT_FRINGE_FILTER_STRENGTH="100";
-    INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="65";
-    INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="15";
-    INFINALITY_FT_STEM_FITTING_STRENGTH="15";
-    INFINALITY_FT_GAMMA_CORRECTION="1000 120";
-    INFINALITY_FT_BRIGHTNESS="10";
-    INFINALITY_FT_CONTRAST="20";
-    INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false";
-    INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="30";
-  };
-
-  win7 = default // {
-    INFINALITY_FT_FILTER_PARAMS="20 25 42 25 06";
-    INFINALITY_FT_FRINGE_FILTER_STRENGTH="100";
-    INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="65";
-    INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="0";
-    INFINALITY_FT_STEM_FITTING_STRENGTH="0";
-    INFINALITY_FT_GAMMA_CORRECTION="1000 120";
-    INFINALITY_FT_BRIGHTNESS="10";
-    INFINALITY_FT_CONTRAST="20";
-    INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false";
-    INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="0";
-  };
-
-  vanilla = default // {
-    INFINALITY_FT_FILTER_PARAMS="06 25 38 25 06";
-    INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH="0";
-    INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH="0";
-    INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="0";
-    INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="0";
-    INFINALITY_FT_STEM_FITTING_STRENGTH="0";
-    INFINALITY_FT_USE_VARIOUS_TWEAKS="false";
-    INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false";
-    INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT="0";
-    INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="0";
-    INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS="false";
-  };
-
-  classic = default // {
-    INFINALITY_FT_FILTER_PARAMS="06 25 38 25 06";
-    INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH="0";
-    INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH="0";
-    INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="0";
-    INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="0";
-    INFINALITY_FT_STEM_FITTING_STRENGTH="0";
-    INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="0";
-    INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS="false";
-  };
-
-  nudge = default // {
-    INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="0";
-    INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="30";
-    INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS="false";
-  };
-
-  push = default // {
-    INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="0";
-    INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="75";
-    INFINALITY_FT_STEM_FITTING_STRENGTH="50";
-    INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="30";
-  };
-
-  infinality = default // {
-    INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="5";
-  };
-
-  shove = default // {
-    INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="0";
-    INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="100";
-    INFINALITY_FT_STEM_FITTING_STRENGTH="100";
-    INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="0";
-  };
-
-  sharpened = default // {
-    INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="65";
-  };
-
-  ultimate = {
-    INFINALITY_FT_FILTER_PARAMS="08 24 36 24 08";
-    INFINALITY_FT_FRINGE_FILTER_STRENGTH="50";
-    INFINALITY_FT_USE_VARIOUS_TWEAKS="true";
-    INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH="20";
-  };
-
-  ultimate-lighter = ultimate // {
-    INFINALITY_FT_FILTER_PARAMS="06 22 36 22 06";
-  };
-
-  ultimate-lightest = ultimate // {
-    INFINALITY_FT_FILTER_PARAMS="04 22 38 22 04";
-  };
-
-  ultimate-darker = ultimate // {
-    INFINALITY_FT_FILTER_PARAMS="10 25 37 25 10";
-  };
-
-  ultimate-darkest = ultimate // {
-    INFINALITY_FT_FILTER_PARAMS="12 28 42 28 12";
-  };
-}
diff --git a/pkgs/development/libraries/fontconfig/default.nix b/pkgs/development/libraries/fontconfig/default.nix
index 6acf1ebce29..74048afe731 100644
--- a/pkgs/development/libraries/fontconfig/default.nix
+++ b/pkgs/development/libraries/fontconfig/default.nix
@@ -66,9 +66,7 @@ stdenv.mkDerivation rec {
 
   postInstall = ''
     cd "$out/etc/fonts"
-    rm conf.d/{50-user,51-local}.conf
     "${libxslt.bin}/bin/xsltproc" --stringparam fontDirectories "${fontbhttf}" \
-      --stringparam fontconfig "$out" \
       --stringparam fontconfigConfigVersion "${configVersion}" \
       --path $out/share/xml/fontconfig \
       ${./make-fonts-conf.xsl} $out/etc/fonts/fonts.conf \
diff --git a/pkgs/development/libraries/fontconfig/make-fonts-conf.xsl b/pkgs/development/libraries/fontconfig/make-fonts-conf.xsl
index b59fcd0187b..dddbbe9e516 100644
--- a/pkgs/development/libraries/fontconfig/make-fonts-conf.xsl
+++ b/pkgs/development/libraries/fontconfig/make-fonts-conf.xsl
@@ -28,8 +28,6 @@
       <!-- /var/cache/fontconfig is useful for non-nixos systems -->
       <cachedir>/var/cache/fontconfig</cachedir>
 
-      <!-- fontconfig distribution conf.d -->
-      <include><xsl:value-of select="$fontconfig" />/etc/fonts/conf.d</include>
       <!-- versioned system-wide config -->
       <include ignore_missing="yes">/etc/fonts/<xsl:value-of select="$fontconfigConfigVersion" />/conf.d</include>
 
diff --git a/pkgs/development/libraries/freetype/default.nix b/pkgs/development/libraries/freetype/default.nix
index 0548d1433b7..8ef51172f94 100644
--- a/pkgs/development/libraries/freetype/default.nix
+++ b/pkgs/development/libraries/freetype/default.nix
@@ -1,40 +1,55 @@
-{ stdenv, fetchurl, fetchpatch, pkgconfig, which, zlib, bzip2, libpng, gnumake
+{ stdenv, fetchurl, fetchFromGitHub, pkgconfig, which, zlib, bzip2, libpng, gnumake
 , glib /* passthru only */
 
   # FreeType supports sub-pixel rendering.  This is patented by
   # Microsoft, so it is disabled by default.  This option allows it to
   # be enabled.  See http://www.freetype.org/patents.html.
 , useEncumberedCode ? true
+, useInfinality ? true
 }:
 
+assert useInfinality -> useEncumberedCode;
+
 let
-  version = "2.6.2";
+  version = "2.6.5";
 
-  # Don't use fetchpatch. It mangles them. That's an hour I'll never get back.
-  fetchbohoomil = name: sha256: fetchurl {
-    url = https://raw.githubusercontent.com/bohoomil/fontconfig-ultimate/254b688f96d4a37f78fb594303a43160fc15c7cd/freetype/ + name;
-    inherit sha256;
+  infinality = fetchFromGitHub {
+    owner = "archfan";
+    repo = "infinality_bundle";
+    rev = "5c0949a477bf43d2ac4e57b4fc39bcc3331002ee";
+    sha256 = "17389aqm6rlxl4b5mv1fx4b22x2v2n60hfhixfxqxpd8ialsdi6l";
   };
+
 in
 with { inherit (stdenv.lib) optional optionals optionalString; };
 stdenv.mkDerivation rec {
   name = "freetype-${version}";
 
   src = fetchurl {
-    url = "mirror://sourceforge/freetype/${name}.tar.bz2";
-    sha256 = "14mqrfgl18q2by1yzv6vcxi97zjy4kppcgsqf312mhfwgkpvvxms";
+    url = "mirror://savannah/freetype/${name}.tar.bz2";
+    sha256 = "1w5c87s4rpx9af5b3mk5cjd1yny3c4dq5p9iv3ixb3vr00a6w2p2";
   };
 
-  patches = []
-    # mingw: these patches use `strcasestr` which isn't available on windows
-    ++ optionals (useEncumberedCode && stdenv.cross.libc or null != "msvcrt" ) [
-      (fetchbohoomil "01-freetype-2.6.2-enable-valid.patch"
-        "1szq0zha7n41f4pq179wgfkam034mp2xn0xc36sdl5sjp9s9hv08")
-      (fetchbohoomil "02-upstream-2015.12.05.patch"
-        "0781r9n35kpn8db8nma0l47cpkzh0hbp84ziii5sald90dnrqdj4")
-      (fetchbohoomil "03-infinality-2.6.2-2015.12.05.patch"
-        "0wcjf9hiymplgqm3szla633i417pb57vpzzs2dyl1dnmcxgqa2y8")
-    ];
+  patches = [
+    # Patch for validation of OpenType and GX/AAT tables.
+    (fetchurl {
+      name = "freetype-2.2.1-enable-valid.patch";
+      url = "http://pkgs.fedoraproject.org/cgit/rpms/freetype.git/plain/freetype-2.2.1-enable-valid.patch?id=9a81147af83b1166a5f301e379f85927cc610990";
+      sha256 = "0zkgqhws2s0j8ywksclf391iijhidb1a406zszd7xbdjn28kmj2l";
+    })
+  ] ++ optionals (!useInfinality && useEncumberedCode) [
+    # Patch to enable subpixel rendering.
+    # See https://www.freetype.org/freetype2/docs/reference/ft2-lcd_filtering.html.
+    (fetchurl {
+      name = "freetype-2.3.0-enable-spr.patch";
+      url = http://pkgs.fedoraproject.org/cgit/rpms/freetype.git/plain/freetype-2.3.0-enable-spr.patch?id=9a81147af83b1166a5f301e379f85927cc610990;
+      sha256 = "13ni9n5q3nla38wjmxd4f8cy29gp62kjx2l6y6nqhdyiqp8fz8nd";
+    })
+  ];
+
+  prePatch = optionalString useInfinality ''
+    patches="$patches $(ls ${infinality}/*_freetype2-iu/*-infinality-*.patch)"
+  '';
 
   outputs = [ "dev" "out" ];
 
@@ -44,10 +59,8 @@ stdenv.mkDerivation rec {
     # FreeType requires GNU Make, which is not part of stdenv on FreeBSD.
     ++ optional (!stdenv.isLinux) gnumake;
 
-  configureFlags = "--disable-static --bindir=$(dev)/bin";
+  configureFlags = [ "--disable-static" "--bindir=$(dev)/bin" ];
 
-  # from Gentoo, see https://bugzilla.redhat.com/show_bug.cgi?id=506840
-  NIX_CFLAGS_COMPILE = "-fno-strict-aliasing";
   # The asm for armel is written with the 'asm' keyword.
   CFLAGS = optionalString stdenv.isArm "-std=gnu99";
 
@@ -66,7 +79,14 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "A font rendering engine";
-    homepage = http://www.freetype.org/;
+    longDescription = ''
+      FreeType is a portable and efficient library for rendering fonts. It
+      supports TrueType, Type 1, CFF fonts, and WOFF, PCF, FNT, BDF and PFR
+      fonts. It has a bytecode interpreter and has an automatic hinter called
+      autofit which can be used instead of hinting instructions included in
+      fonts.
+    '';
+    homepage = https://www.freetype.org/;
     license = licenses.gpl2Plus; # or the FreeType License (BSD + advertising clause)
     #ToDo: encumbered = useEncumberedCode;
     platforms = platforms.all;
diff --git a/pkgs/development/libraries/gdbm/default.nix b/pkgs/development/libraries/gdbm/default.nix
index bd5ee16eb67..71b65131015 100644
--- a/pkgs/development/libraries/gdbm/default.nix
+++ b/pkgs/development/libraries/gdbm/default.nix
@@ -10,6 +10,8 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
+  configureFlags = [ "--enable-libgdbm-compat" ];
+
   meta = with stdenv.lib; {
     description = "GNU dbm key/value database library";
 
diff --git a/pkgs/development/libraries/gdcm/default.nix b/pkgs/development/libraries/gdcm/default.nix
index c2121f31f1d..2d7e26b9e1a 100644
--- a/pkgs/development/libraries/gdcm/default.nix
+++ b/pkgs/development/libraries/gdcm/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, cmake, vtk }:
 
 stdenv.mkDerivation rec {
-  version = "2.4.6";
+  version = "2.6.4";
   name = "gdcm-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/gdcm/${name}.tar.bz2";
-    sha256 = "0rgqgkjyqgld0hpa311z8cddp42v9ihzidyanwyxqpv3jmcrlsfk";
+    sha256 = "14bysjdldq7xb9k1ayskxijm08dy2n45v9bg379dqrcz1q5xq5mi";
   };
 
   dontUseCmakeBuildDir = true;
diff --git a/pkgs/development/libraries/gegl/3.0.nix b/pkgs/development/libraries/gegl/3.0.nix
index f66ade28da9..2a201ed5523 100644
--- a/pkgs/development/libraries/gegl/3.0.nix
+++ b/pkgs/development/libraries/gegl/3.0.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, glib, babl, libpng, cairo, libjpeg, which
-, librsvg, pango, gtk, bzip2, intltool, libtool, automake, autoconf, json_glib }:
+, librsvg, pango, gtk, bzip2, intltool, libtool, automake, autoconf, json_glib , libraw }:
 
 stdenv.mkDerivation rec {
   name = "gegl-0.3.6";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   configureFlags = "--disable-docs";
 
   buildInputs = [ babl libpng cairo libjpeg librsvg pango gtk bzip2 intltool
-                  autoconf automake libtool which json_glib ];
+                  autoconf automake libtool which json_glib libraw ];
 
   nativeBuildInputs = [ pkgconfig ];
 
diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix
index 3c044bb6efa..e82b4385a9c 100644
--- a/pkgs/development/libraries/glib/default.nix
+++ b/pkgs/development/libraries/glib/default.nix
@@ -40,7 +40,7 @@ let
   '';
 
   ver_maj = "2.48";
-  ver_min = "1";
+  ver_min = "2";
 in
 
 stdenv.mkDerivation rec {
@@ -48,7 +48,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/glib/${ver_maj}/${name}.tar.xz";
-    sha256 = "74411bff489cb2a3527bac743a51018841a56a4d896cc1e0d0d54f8166a14612";
+    sha256 = "f25e751589cb1a58826eac24fbd4186cda4518af772806b666a3f91f66e6d3f4";
   };
 
   patches = optional stdenv.isDarwin ./darwin-compilation.patch ++ optional doCheck ./skip-timer-test.patch;
diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix
index e90fdc4ad7b..d7e91642342 100644
--- a/pkgs/development/libraries/glibc/common.nix
+++ b/pkgs/development/libraries/glibc/common.nix
@@ -10,9 +10,8 @@ cross:
 , preConfigure ? "", ... }@args:
 
 let
-
-  version = "2.23";
-  sha256 = "1lk9a8jv5kyx8hp0wmfzjyk047q95ybyjqbyw5idl7414jxqml1b";
+  version = "2.24";
+  sha256 = "1ghzp41ryvsqxn4rhrm8r25wc33m2jf8zrcc1pj3jxyk8ad9a0by";
 in
 
 assert cross != null -> gccCross != null;
@@ -49,12 +48,6 @@ stdenv.mkDerivation ({
          "/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
-
-      ./cve-2016-3075.patch
-      ./glob-simplify-interface.patch
-      ./cve-2016-1234.patch
-      ./cve-2016-3706.patch
-      ./fix_warnings.patch
     ];
 
   postPatch =
@@ -89,7 +82,6 @@ stdenv.mkDerivation ({
       "--enable-add-ons"
       "--enable-obsolete-rpc"
       "--sysconfdir=/etc"
-      "--localedir=/var/run/current-system/sw/lib/locale"
       "libc_cv_ssp=no"
       (if linuxHeaders != null
        then "--with-headers=${linuxHeaders}/include"
diff --git a/pkgs/development/libraries/glibc/cve-2016-1234.patch b/pkgs/development/libraries/glibc/cve-2016-1234.patch
deleted file mode 100644
index d98577868a9..00000000000
--- a/pkgs/development/libraries/glibc/cve-2016-1234.patch
+++ /dev/null
@@ -1,372 +0,0 @@
-commit c87db3fcbdf890990b44d956621763538c878cd3
-Author: Florian Weimer <fweimer@redhat.com>
-Date:   Wed May 4 12:09:35 2016 +0200
-
-    CVE-2016-1234: glob: Do not copy d_name field of struct dirent [BZ #19779]
-    
-    Instead, we store the data we need from the return value of
-    readdir in an object of the new type struct readdir_result.
-    This type is independent of the layout of struct dirent.
-    
-    (cherry picked from commit 5171f3079f2cc53e0548fc4967361f4d1ce9d7ea)
-
-diff --git a/posix/bug-glob2.c b/posix/bug-glob2.c
-index 0fdc5d0..5873e08 100644
---- a/posix/bug-glob2.c
-+++ b/posix/bug-glob2.c
-@@ -40,6 +40,17 @@
- # define PRINTF(fmt, args...)
- #endif
- 
-+#define LONG_NAME \
-+  "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-+  "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-+  "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-+  "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-+  "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-+  "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-+  "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-+  "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-+  "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-+  "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
- 
- static struct
- {
-@@ -58,6 +69,7 @@ static struct
-       { ".", 3, DT_DIR, 0755 },
-       { "..", 3, DT_DIR, 0755 },
-       { "a", 3, DT_REG, 0644 },
-+      { LONG_NAME, 3, DT_REG, 0644 },
-     { "unreadable", 2, DT_DIR, 0111 },
-       { ".", 3, DT_DIR, 0111 },
-       { "..", 3, DT_DIR, 0755 },
-@@ -75,7 +87,7 @@ typedef struct
-   int level;
-   int idx;
-   struct dirent d;
--  char room_for_dirent[NAME_MAX];
-+  char room_for_dirent[sizeof (LONG_NAME)];
- } my_DIR;
- 
- 
-diff --git a/posix/glob.c b/posix/glob.c
-index 9ae76ac..ea4b0b6 100644
---- a/posix/glob.c
-+++ b/posix/glob.c
-@@ -24,7 +24,9 @@
- #include <errno.h>
- #include <sys/types.h>
- #include <sys/stat.h>
-+#include <stdbool.h>
- #include <stddef.h>
-+#include <stdint.h>
- 
- /* Outcomment the following line for production quality code.  */
- /* #define NDEBUG 1 */
-@@ -73,69 +75,8 @@
- # endif /* HAVE_VMSDIR_H */
- #endif
- 
--
--/* When used in the GNU libc the symbol _DIRENT_HAVE_D_TYPE is available
--   if the `d_type' member for `struct dirent' is available.
--   HAVE_STRUCT_DIRENT_D_TYPE plays the same role in GNULIB.  */
--#if defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE
--/* True if the directory entry D must be of type T.  */
--# define DIRENT_MUST_BE(d, t)	((d)->d_type == (t))
--
--/* True if the directory entry D might be a symbolic link.  */
--# define DIRENT_MIGHT_BE_SYMLINK(d) \
--    ((d)->d_type == DT_UNKNOWN || (d)->d_type == DT_LNK)
--
--/* True if the directory entry D might be a directory.  */
--# define DIRENT_MIGHT_BE_DIR(d)	 \
--    ((d)->d_type == DT_DIR || DIRENT_MIGHT_BE_SYMLINK (d))
--
--#else /* !HAVE_D_TYPE */
--# define DIRENT_MUST_BE(d, t)		false
--# define DIRENT_MIGHT_BE_SYMLINK(d)	true
--# define DIRENT_MIGHT_BE_DIR(d)		true
--#endif /* HAVE_D_TYPE */
--
--/* If the system has the `struct dirent64' type we use it internally.  */
--#if defined _LIBC && !defined COMPILE_GLOB64
--
--# if (defined POSIX || defined WINDOWS32) && !defined __GNU_LIBRARY__
--#  define CONVERT_D_INO(d64, d32)
--# else
--#  define CONVERT_D_INO(d64, d32) \
--  (d64)->d_ino = (d32)->d_ino;
--# endif
--
--# ifdef _DIRENT_HAVE_D_TYPE
--#  define CONVERT_D_TYPE(d64, d32) \
--  (d64)->d_type = (d32)->d_type;
--# else
--#  define CONVERT_D_TYPE(d64, d32)
--# endif
--
--# define CONVERT_DIRENT_DIRENT64(d64, d32) \
--  strcpy ((d64)->d_name, (d32)->d_name);				      \
--  CONVERT_D_INO (d64, d32)						      \
--  CONVERT_D_TYPE (d64, d32)
--#endif
--
--
--#if (defined POSIX || defined WINDOWS32) && !defined __GNU_LIBRARY__
--/* Posix does not require that the d_ino field be present, and some
--   systems do not provide it. */
--# define REAL_DIR_ENTRY(dp) 1
--#else
--# define REAL_DIR_ENTRY(dp) (dp->d_ino != 0)
--#endif /* POSIX */
--
- #include <stdlib.h>
- #include <string.h>
--
--/* NAME_MAX is usually defined in <dirent.h> or <limits.h>.  */
--#include <limits.h>
--#ifndef NAME_MAX
--# define NAME_MAX (sizeof (((struct dirent *) 0)->d_name))
--#endif
--
- #include <alloca.h>
- 
- #ifdef _LIBC
-@@ -180,8 +121,111 @@
- 
- static const char *next_brace_sub (const char *begin, int flags) __THROWNL;
- 
-+/* A representation of a directory entry which does not depend on the
-+   layout of struct dirent, or the size of ino_t.  */
-+struct readdir_result
-+{
-+  const char *name;
-+# if defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE
-+  uint8_t type;
-+# endif
-+  bool skip_entry;
-+};
-+
-+# if defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE
-+/* Initializer based on the d_type member of struct dirent.  */
-+#  define D_TYPE_TO_RESULT(source) (source)->d_type,
-+
-+/* True if the directory entry D might be a symbolic link.  */
-+static bool
-+readdir_result_might_be_symlink (struct readdir_result d)
-+{
-+  return d.type == DT_UNKNOWN || d.type == DT_LNK;
-+}
-+
-+/* True if the directory entry D might be a directory.  */
-+static bool
-+readdir_result_might_be_dir (struct readdir_result d)
-+{
-+  return d.type == DT_DIR || readdir_result_might_be_symlink (d);
-+}
-+# else /* defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE */
-+#  define D_TYPE_TO_RESULT(source)
-+
-+/* If we do not have type information, symbolic links and directories
-+   are always a possibility.  */
-+
-+static bool
-+readdir_result_might_be_symlink (struct readdir_result d)
-+{
-+  return true;
-+}
-+
-+static bool
-+readdir_result_might_be_dir (struct readdir_result d)
-+{
-+  return true;
-+}
-+
-+# endif /* defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE */
-+
-+# if (defined POSIX || defined WINDOWS32) && !defined __GNU_LIBRARY__
-+/* Initializer for skip_entry.  POSIX does not require that the d_ino
-+   field be present, and some systems do not provide it. */
-+#  define D_INO_TO_RESULT(source) false,
-+# else
-+#  define D_INO_TO_RESULT(source) (source)->d_ino == 0,
-+# endif
-+
-+/* Construct an initializer for a struct readdir_result object from a
-+   struct dirent *.  No copy of the name is made.  */
-+#define READDIR_RESULT_INITIALIZER(source) \
-+  {					   \
-+    source->d_name,			   \
-+    D_TYPE_TO_RESULT (source)		   \
-+    D_INO_TO_RESULT (source)		   \
-+  }
-+
- #endif /* !defined _LIBC || !defined GLOB_ONLY_P */
- 
-+/* Call gl_readdir on STREAM.  This macro can be overridden to reduce
-+   type safety if an old interface version needs to be supported.  */
-+#ifndef GL_READDIR
-+# define GL_READDIR(pglob, stream) ((pglob)->gl_readdir (stream))
-+#endif
-+
-+/* Extract name and type from directory entry.  No copy of the name is
-+   made.  If SOURCE is NULL, result name is NULL.  Keep in sync with
-+   convert_dirent64 below.  */
-+static struct readdir_result
-+convert_dirent (const struct dirent *source)
-+{
-+  if (source == NULL)
-+    {
-+      struct readdir_result result = { NULL, };
-+      return result;
-+    }
-+  struct readdir_result result = READDIR_RESULT_INITIALIZER (source);
-+  return result;
-+}
-+
-+#ifndef COMPILE_GLOB64
-+/* Like convert_dirent, but works on struct dirent64 instead.  Keep in
-+   sync with convert_dirent above.  */
-+static struct readdir_result
-+convert_dirent64 (const struct dirent64 *source)
-+{
-+  if (source == NULL)
-+    {
-+      struct readdir_result result = { NULL, };
-+      return result;
-+    }
-+  struct readdir_result result = READDIR_RESULT_INITIALIZER (source);
-+  return result;
-+}
-+#endif
-+
-+
- #ifndef attribute_hidden
- # define attribute_hidden
- #endif
-@@ -1538,55 +1582,36 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
- 
- 	  while (1)
- 	    {
--	      const char *name;
--#if defined _LIBC && !defined COMPILE_GLOB64
--	      struct dirent64 *d;
--	      union
--		{
--		  struct dirent64 d64;
--		  char room [offsetof (struct dirent64, d_name[0])
--			     + NAME_MAX + 1];
--		}
--	      d64buf;
--
--	      if (__glibc_unlikely (flags & GLOB_ALTDIRFUNC))
--		{
--		  struct dirent *d32 = (*pglob->gl_readdir) (stream);
--		  if (d32 != NULL)
--		    {
--		      CONVERT_DIRENT_DIRENT64 (&d64buf.d64, d32);
--		      d = &d64buf.d64;
--		    }
--		  else
--		    d = NULL;
--		}
--	      else
--		d = __readdir64 (stream);
-+	      struct readdir_result d;
-+	      {
-+		if (__builtin_expect (flags & GLOB_ALTDIRFUNC, 0))
-+		  d = convert_dirent (GL_READDIR (pglob, stream));
-+		else
-+		  {
-+#ifdef COMPILE_GLOB64
-+		    d = convert_dirent (__readdir (stream));
- #else
--	      struct dirent *d = (__builtin_expect (flags & GLOB_ALTDIRFUNC, 0)
--				  ? ((struct dirent *)
--				     (*pglob->gl_readdir) (stream))
--				  : __readdir (stream));
-+		    d = convert_dirent64 (__readdir64 (stream));
- #endif
--	      if (d == NULL)
-+		  }
-+	      }
-+	      if (d.name == NULL)
- 		break;
--	      if (! REAL_DIR_ENTRY (d))
-+	      if (d.skip_entry)
- 		continue;
- 
- 	      /* If we shall match only directories use the information
- 		 provided by the dirent call if possible.  */
--	      if ((flags & GLOB_ONLYDIR) && !DIRENT_MIGHT_BE_DIR (d))
-+	      if ((flags & GLOB_ONLYDIR) && !readdir_result_might_be_dir (d))
- 		continue;
- 
--	      name = d->d_name;
--
--	      if (fnmatch (pattern, name, fnm_flags) == 0)
-+	      if (fnmatch (pattern, d.name, fnm_flags) == 0)
- 		{
- 		  /* If the file we found is a symlink we have to
- 		     make sure the target file exists.  */
--		  if (!DIRENT_MIGHT_BE_SYMLINK (d)
--		      || link_exists_p (dfd, directory, dirlen, name, pglob,
--					flags))
-+		  if (!readdir_result_might_be_symlink (d)
-+		      || link_exists_p (dfd, directory, dirlen, d.name,
-+					pglob, flags))
- 		    {
- 		      if (cur == names->count)
- 			{
-@@ -1606,7 +1631,7 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
- 			  names = newnames;
- 			  cur = 0;
- 			}
--		      names->name[cur] = strdup (d->d_name);
-+		      names->name[cur] = strdup (d.name);
- 		      if (names->name[cur] == NULL)
- 			goto memory_error;
- 		      ++cur;
-diff --git a/sysdeps/unix/sysv/linux/i386/glob64.c b/sysdeps/unix/sysv/linux/i386/glob64.c
-index b4fcd1a..802c957 100644
---- a/sysdeps/unix/sysv/linux/i386/glob64.c
-+++ b/sysdeps/unix/sysv/linux/i386/glob64.c
-@@ -1,3 +1,21 @@
-+/* Two glob variants with 64-bit support, for dirent64 and __olddirent64.
-+   Copyright (C) 1998-2016 Free Software Foundation, Inc.
-+   This file is part of the GNU C Library.
-+
-+   The GNU C Library is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU Lesser General Public
-+   License as published by the Free Software Foundation; either
-+   version 2.1 of the License, or (at your option) any later version.
-+
-+   The GNU C Library is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   Lesser General Public License for more details.
-+
-+   You should have received a copy of the GNU Lesser General Public
-+   License along with the GNU C Library; if not, see
-+   <http://www.gnu.org/licenses/>.  */
-+
- #include <dirent.h>
- #include <glob.h>
- #include <sys/stat.h>
-@@ -38,11 +56,15 @@ int __old_glob64 (const char *__pattern, int __flags,
- 
- #undef dirent
- #define dirent __old_dirent64
-+#undef GL_READDIR
-+# define GL_READDIR(pglob, stream) \
-+  ((struct __old_dirent64 *) (pglob)->gl_readdir (stream))
- #undef __readdir
- #define __readdir(dirp) __old_readdir64 (dirp)
- #undef glob
- #define glob(pattern, flags, errfunc, pglob) \
-   __old_glob64 (pattern, flags, errfunc, pglob)
-+#define convert_dirent __old_convert_dirent
- #define glob_in_dir __old_glob_in_dir
- #define GLOB_ATTRIBUTE attribute_compat_text_section
- 
diff --git a/pkgs/development/libraries/glibc/cve-2016-3075.patch b/pkgs/development/libraries/glibc/cve-2016-3075.patch
deleted file mode 100644
index 0da10167bef..00000000000
--- a/pkgs/development/libraries/glibc/cve-2016-3075.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-commit 146b58d11fddbef15b888906e3be4f33900c416f
-Author: Florian Weimer <fweimer@redhat.com>
-Date:   Tue Mar 29 12:57:56 2016 +0200
-
-    CVE-2016-3075: Stack overflow in _nss_dns_getnetbyname_r [BZ #19879]
-    
-    The defensive copy is not needed because the name may not alias the
-    output buffer.
-    
-    (cherry picked from commit 317b199b4aff8cfa27f2302ab404d2bb5032b9a4)
-    (cherry picked from commit 883dceebc8f11921a9890211a4e202e5be17562f)
-
-diff --git a/resolv/nss_dns/dns-network.c b/resolv/nss_dns/dns-network.c
-index 2eb2f67..8f301a7 100644
---- a/resolv/nss_dns/dns-network.c
-+++ b/resolv/nss_dns/dns-network.c
-@@ -118,17 +118,14 @@ _nss_dns_getnetbyname_r (const char *name, struct netent *result,
-   } net_buffer;
-   querybuf *orig_net_buffer;
-   int anslen;
--  char *qbuf;
-   enum nss_status status;
- 
-   if (__res_maybe_init (&_res, 0) == -1)
-     return NSS_STATUS_UNAVAIL;
- 
--  qbuf = strdupa (name);
--
-   net_buffer.buf = orig_net_buffer = (querybuf *) alloca (1024);
- 
--  anslen = __libc_res_nsearch (&_res, qbuf, C_IN, T_PTR, net_buffer.buf->buf,
-+  anslen = __libc_res_nsearch (&_res, name, C_IN, T_PTR, net_buffer.buf->buf,
- 			       1024, &net_buffer.ptr, NULL, NULL, NULL, NULL);
-   if (anslen < 0)
-     {
diff --git a/pkgs/development/libraries/glibc/cve-2016-3706.patch b/pkgs/development/libraries/glibc/cve-2016-3706.patch
deleted file mode 100644
index cf9fb060355..00000000000
--- a/pkgs/development/libraries/glibc/cve-2016-3706.patch
+++ /dev/null
@@ -1,181 +0,0 @@
-commit 1a8a7c12950a0026a3c406a7cb1608f96aa1460e
-Author: Florian Weimer <fweimer@redhat.com>
-Date:   Fri Apr 29 10:35:34 2016 +0200
-
-    CVE-2016-3706: getaddrinfo: stack overflow in hostent conversion [BZ #20010]
-    
-    When converting a struct hostent response to struct gaih_addrtuple, the
-    gethosts macro (which is called from gaih_inet) used alloca, without
-    malloc fallback for large responses.  This commit changes this code to
-    use calloc unconditionally.
-    
-    This commit also consolidated a second hostent-to-gaih_addrtuple
-    conversion loop (in gaih_inet) to use the new conversion function.
-    
-    (cherry picked from commit 4ab2ab03d4351914ee53248dc5aef4a8c88ff8b9)
-
-diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
-index 1ef3f20..fed2d3b 100644
---- a/sysdeps/posix/getaddrinfo.c
-+++ b/sysdeps/posix/getaddrinfo.c
-@@ -168,9 +168,58 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp,
-   return 0;
- }
- 
-+/* Convert struct hostent to a list of struct gaih_addrtuple objects.
-+   h_name is not copied, and the struct hostent object must not be
-+   deallocated prematurely.  *RESULT must be NULL or a pointer to an
-+   object allocated using malloc, which is freed.  */
-+static bool
-+convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
-+				   int family,
-+				   struct hostent *h,
-+				   struct gaih_addrtuple **result)
-+{
-+  free (*result);
-+  *result = NULL;
-+
-+  /* Count the number of addresses in h->h_addr_list.  */
-+  size_t count = 0;
-+  for (char **p = h->h_addr_list; *p != NULL; ++p)
-+    ++count;
-+
-+  /* Report no data if no addresses are available, or if the incoming
-+     address size is larger than what we can store.  */
-+  if (count == 0 || h->h_length > sizeof (((struct gaih_addrtuple) {}).addr))
-+    return true;
-+
-+  struct gaih_addrtuple *array = calloc (count, sizeof (*array));
-+  if (array == NULL)
-+    return false;
-+
-+  for (size_t i = 0; i < count; ++i)
-+    {
-+      if (family == AF_INET && req->ai_family == AF_INET6)
-+	{
-+	  /* Perform address mapping. */
-+	  array[i].family = AF_INET6;
-+	  memcpy(array[i].addr + 3, h->h_addr_list[i], sizeof (uint32_t));
-+	  array[i].addr[2] = htonl (0xffff);
-+	}
-+      else
-+	{
-+	  array[i].family = family;
-+	  memcpy (array[i].addr, h->h_addr_list[i], h->h_length);
-+	}
-+      array[i].next = array + i + 1;
-+    }
-+  array[0].name = h->h_name;
-+  array[count - 1].next = NULL;
-+
-+  *result = array;
-+  return true;
-+}
-+
- #define gethosts(_family, _type) \
-  {									      \
--  int i;								      \
-   int herrno;								      \
-   struct hostent th;							      \
-   struct hostent *h;							      \
-@@ -219,36 +268,23 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp,
-     }									      \
-   else if (h != NULL)							      \
-     {									      \
--      for (i = 0; h->h_addr_list[i]; i++)				      \
-+      /* Make sure that addrmem can be freed.  */			      \
-+      if (!malloc_addrmem)						      \
-+	addrmem = NULL;							      \
-+      if (!convert_hostent_to_gaih_addrtuple (req, _family,h, &addrmem))      \
- 	{								      \
--	  if (*pat == NULL)						      \
--	    {								      \
--	      *pat = __alloca (sizeof (struct gaih_addrtuple));		      \
--	      (*pat)->scopeid = 0;					      \
--	    }								      \
--	  uint32_t *addr = (*pat)->addr;				      \
--	  (*pat)->next = NULL;						      \
--	  (*pat)->name = i == 0 ? strdupa (h->h_name) : NULL;		      \
--	  if (_family == AF_INET && req->ai_family == AF_INET6)		      \
--	    {								      \
--	      (*pat)->family = AF_INET6;				      \
--	      addr[3] = *(uint32_t *) h->h_addr_list[i];		      \
--	      addr[2] = htonl (0xffff);					      \
--	      addr[1] = 0;						      \
--	      addr[0] = 0;						      \
--	    }								      \
--	  else								      \
--	    {								      \
--	      (*pat)->family = _family;					      \
--	      memcpy (addr, h->h_addr_list[i], sizeof(_type));		      \
--	    }								      \
--	  pat = &((*pat)->next);					      \
-+	  _res.options |= old_res_options & RES_USE_INET6;		      \
-+	  result = -EAI_SYSTEM;						      \
-+	  goto free_and_return;						      \
- 	}								      \
-+      *pat = addrmem;							      \
-+      /* The conversion uses malloc unconditionally.  */		      \
-+      malloc_addrmem = true;						      \
- 									      \
-       if (localcanon !=	NULL && canon == NULL)				      \
- 	canon = strdupa (localcanon);					      \
- 									      \
--      if (_family == AF_INET6 && i > 0)					      \
-+      if (_family == AF_INET6 && *pat != NULL)				      \
- 	got_ipv6 = true;						      \
-     }									      \
-  }
-@@ -612,44 +648,16 @@ gaih_inet (const char *name, const struct gaih_service *service,
- 		{
- 		  if (h != NULL)
- 		    {
--		      int i;
--		      /* We found data, count the number of addresses.  */
--		      for (i = 0; h->h_addr_list[i]; ++i)
--			;
--		      if (i > 0 && *pat != NULL)
--			--i;
--
--		      if (__libc_use_alloca (alloca_used
--					     + i * sizeof (struct gaih_addrtuple)))
--			addrmem = alloca_account (i * sizeof (struct gaih_addrtuple),
--						  alloca_used);
--		      else
--			{
--			  addrmem = malloc (i
--					    * sizeof (struct gaih_addrtuple));
--			  if (addrmem == NULL)
--			    {
--			      result = -EAI_MEMORY;
--			      goto free_and_return;
--			    }
--			  malloc_addrmem = true;
--			}
--
--		      /* Now convert it into the list.  */
--		      struct gaih_addrtuple *addrfree = addrmem;
--		      for (i = 0; h->h_addr_list[i]; ++i)
-+		      /* We found data, convert it.  */
-+		      if (!convert_hostent_to_gaih_addrtuple
-+			  (req, AF_INET, h, &addrmem))
- 			{
--			  if (*pat == NULL)
--			    {
--			      *pat = addrfree++;
--			      (*pat)->scopeid = 0;
--			    }
--			  (*pat)->next = NULL;
--			  (*pat)->family = AF_INET;
--			  memcpy ((*pat)->addr, h->h_addr_list[i],
--				  h->h_length);
--			  pat = &((*pat)->next);
-+			  result = -EAI_MEMORY;
-+			  goto free_and_return;
- 			}
-+		      *pat = addrmem;
-+		      /* The conversion uses malloc unconditionally.  */
-+		      malloc_addrmem = true;
- 		    }
- 		}
- 	      else
diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix
index 2a1652a5501..4d377bb93cb 100644
--- a/pkgs/development/libraries/glibc/default.nix
+++ b/pkgs/development/libraries/glibc/default.nix
@@ -70,7 +70,7 @@ in
       fi
 
       # Get rid of more unnecessary stuff.
-      rm -rf $out/var $out/sbin/sln
+      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.
diff --git a/pkgs/development/libraries/glibc/fix_warnings.patch b/pkgs/development/libraries/glibc/fix_warnings.patch
deleted file mode 100644
index fd75c18c84e..00000000000
--- a/pkgs/development/libraries/glibc/fix_warnings.patch
+++ /dev/null
@@ -1,36 +0,0 @@
---- a/stdlib/setenv.c	2016-05-30 11:09:14.487180254 +0000
-+++ b/stdlib/setenv.c	2016-05-30 11:08:25.560390748 +0000
-@@ -277,6 +277,7 @@
- 
-   ep = __environ;
-   if (ep != NULL)
-+    {
-     while (*ep != NULL)
-       if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
- 	{
-@@ -290,6 +291,7 @@
- 	}
-       else
- 	++ep;
-+    }
- 
-   UNLOCK;
- 
---- a/nis/nis_call.c	2016-05-30 08:05:59.359855696 -0700
-+++ b/nis/nis_call.c	2016-05-30 08:05:55.679873221 -0700
-@@ -680,6 +680,7 @@
-   /* Choose which entry should be evicted from the cache.  */
-   loc = &nis_server_cache[0];
-   if (*loc != NULL)
-+    {
-     for (i = 1; i < 16; ++i)
-       if (nis_server_cache[i] == NULL)
- 	{
-@@ -690,6 +691,7 @@
- 	       || ((*loc)->uses == nis_server_cache[i]->uses
- 		   && (*loc)->expires > nis_server_cache[i]->expires))
- 	loc = &nis_server_cache[i];
-+    }
-   old = *loc;
-   *loc = new;
- 
diff --git a/pkgs/development/libraries/glibc/glob-simplify-interface.patch b/pkgs/development/libraries/glibc/glob-simplify-interface.patch
deleted file mode 100644
index 647cca8b3a6..00000000000
--- a/pkgs/development/libraries/glibc/glob-simplify-interface.patch
+++ /dev/null
@@ -1,216 +0,0 @@
-commit 68302147ee061c69eb447e243ad9a18ef4cfbc4c
-Author: Florian Weimer <fweimer@redhat.com>
-Date:   Fri Apr 29 09:33:07 2016 +0200
-
-    glob: Simplify the interface for the GLOB_ALTDIRFUNC callback gl_readdir
-    
-    Previously, application code had to set up the d_namlen member if
-    the target supported it, involving conditional compilation.  After
-    this change, glob will use the length of the string in d_name instead
-    of d_namlen to determine the file name length.  All glibc targets
-    provide the d_type and d_ino members, and setting them as needed for
-    gl_readdir is straightforward.
-    
-    Changing the behavior with regards to d_ino is left to a future
-    cleanup.
-    
-    (cherry picked from commit 137fe72eca6923a00381a3ca9f0e7672c1f85e3f)
-
-diff --git a/manual/examples/mkdirent.c b/manual/examples/mkdirent.c
-new file mode 100644
-index 0000000..f8400f4
---- /dev/null
-+++ b/manual/examples/mkdirent.c
-@@ -0,0 +1,42 @@
-+/* Example for creating a struct dirent object for use with glob.
-+   Copyright (C) 2016 Free Software Foundation, Inc.
-+
-+   This program is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU General Public License
-+   as published by the Free Software Foundation; either version 2
-+   of the License, or (at your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program; if not, if not, see <http://www.gnu.org/licenses/>.
-+*/
-+
-+#include <dirent.h>
-+#include <errno.h>
-+#include <stddef.h>
-+#include <stdlib.h>
-+#include <string.h>
-+
-+struct dirent *
-+mkdirent (const char *name)
-+{
-+  size_t dirent_size = offsetof (struct dirent, d_name) + 1;
-+  size_t name_length = strlen (name);
-+  size_t total_size = dirent_size + name_length;
-+  if (total_size < dirent_size)
-+    {
-+      errno = ENOMEM;
-+      return NULL;
-+    }
-+  struct dirent *result = malloc (total_size);
-+  if (result == NULL)
-+    return NULL;
-+  result->d_type = DT_UNKNOWN;
-+  result->d_ino = 1;            /* Do not skip this entry.  */
-+  memcpy (result->d_name, name, name_length + 1);
-+  return result;
-+}
-diff --git a/manual/pattern.texi b/manual/pattern.texi
-index d1b9275..565e7eb 100644
---- a/manual/pattern.texi
-+++ b/manual/pattern.texi
-@@ -237,7 +237,44 @@ function used to read the contents of a directory.  It is used if the
- @code{GLOB_ALTDIRFUNC} bit is set in the flag parameter.  The type of
- this field is @w{@code{struct dirent *(*) (void *)}}.
- 
--This is a GNU extension.
-+An implementation of @code{gl_readdir} needs to initialize the following
-+members of the @code{struct dirent} object:
-+
-+@table @code
-+@item d_type
-+This member should be set to the file type of the entry if it is known.
-+Otherwise, the value @code{DT_UNKNOWN} can be used.  The @code{glob}
-+function may use the specified file type to avoid callbacks in cases
-+where the file type indicates that the data is not required.
-+
-+@item d_ino
-+This member needs to be non-zero, otherwise @code{glob} may skip the
-+current entry and call the @code{gl_readdir} callback function again to
-+retrieve another entry.
-+
-+@item d_name
-+This member must be set to the name of the entry.  It must be
-+null-terminated.
-+@end table
-+
-+The example below shows how to allocate a @code{struct dirent} object
-+containing a given name.
-+
-+@smallexample
-+@include mkdirent.c.texi
-+@end smallexample
-+
-+The @code{glob} function reads the @code{struct dirent} members listed
-+above and makes a copy of the file name in the @code{d_name} member
-+immediately after the @code{gl_readdir} callback function returns.
-+Future invocations of any of the callback functions may dealloacte or
-+reuse the buffer.  It is the responsibility of the caller of the
-+@code{glob} function to allocate and deallocate the buffer, around the
-+call to @code{glob} or using the callback functions.  For example, an
-+application could allocate the buffer in the @code{gl_readdir} callback
-+function, and deallocate it in the @code{gl_closedir} callback function.
-+
-+The @code{gl_readdir} member is a GNU extension.
- 
- @item gl_opendir
- The address of an alternative implementation of the @code{opendir}
-diff --git a/posix/bug-glob2.c b/posix/bug-glob2.c
-index ddf5ec9..0fdc5d0 100644
---- a/posix/bug-glob2.c
-+++ b/posix/bug-glob2.c
-@@ -193,7 +193,7 @@ my_readdir (void *gdir)
-       return NULL;
-     }
- 
--  dir->d.d_ino = dir->idx;
-+  dir->d.d_ino = 1;		/* glob should not skip this entry.  */
- 
- #ifdef _DIRENT_HAVE_D_TYPE
-   dir->d.d_type = filesystem[dir->idx].type;
-diff --git a/posix/glob.c b/posix/glob.c
-index 0c04c3c..9ae76ac 100644
---- a/posix/glob.c
-+++ b/posix/glob.c
-@@ -57,10 +57,8 @@
- 
- #if defined HAVE_DIRENT_H || defined __GNU_LIBRARY__
- # include <dirent.h>
--# define NAMLEN(dirent) strlen((dirent)->d_name)
- #else
- # define dirent direct
--# define NAMLEN(dirent) (dirent)->d_namlen
- # ifdef HAVE_SYS_NDIR_H
- #  include <sys/ndir.h>
- # endif
-@@ -76,12 +74,6 @@
- #endif
- 
- 
--/* In GNU systems, <dirent.h> defines this macro for us.  */
--#ifdef _D_NAMLEN
--# undef NAMLEN
--# define NAMLEN(d) _D_NAMLEN(d)
--#endif
--
- /* When used in the GNU libc the symbol _DIRENT_HAVE_D_TYPE is available
-    if the `d_type' member for `struct dirent' is available.
-    HAVE_STRUCT_DIRENT_D_TYPE plays the same role in GNULIB.  */
-@@ -105,12 +97,6 @@
- 
- /* If the system has the `struct dirent64' type we use it internally.  */
- #if defined _LIBC && !defined COMPILE_GLOB64
--# if defined HAVE_DIRENT_H || defined __GNU_LIBRARY__
--#  define CONVERT_D_NAMLEN(d64, d32)
--# else
--#  define CONVERT_D_NAMLEN(d64, d32) \
--  (d64)->d_namlen = (d32)->d_namlen;
--# endif
- 
- # if (defined POSIX || defined WINDOWS32) && !defined __GNU_LIBRARY__
- #  define CONVERT_D_INO(d64, d32)
-@@ -127,8 +113,7 @@
- # endif
- 
- # define CONVERT_DIRENT_DIRENT64(d64, d32) \
--  memcpy ((d64)->d_name, (d32)->d_name, NAMLEN (d32) + 1);		      \
--  CONVERT_D_NAMLEN (d64, d32)						      \
-+  strcpy ((d64)->d_name, (d32)->d_name);				      \
-   CONVERT_D_INO (d64, d32)						      \
-   CONVERT_D_TYPE (d64, d32)
- #endif
-@@ -1554,7 +1539,6 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
- 	  while (1)
- 	    {
- 	      const char *name;
--	      size_t len;
- #if defined _LIBC && !defined COMPILE_GLOB64
- 	      struct dirent64 *d;
- 	      union
-@@ -1622,12 +1606,10 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
- 			  names = newnames;
- 			  cur = 0;
- 			}
--		      len = NAMLEN (d);
--		      names->name[cur] = (char *) malloc (len + 1);
-+		      names->name[cur] = strdup (d->d_name);
- 		      if (names->name[cur] == NULL)
- 			goto memory_error;
--		      *((char *) mempcpy (names->name[cur++], name, len))
--			= '\0';
-+		      ++cur;
- 		      ++nfound;
- 		    }
- 		}
-diff --git a/posix/tst-gnuglob.c b/posix/tst-gnuglob.c
-index 992b997..b7b859b 100644
---- a/posix/tst-gnuglob.c
-+++ b/posix/tst-gnuglob.c
-@@ -211,7 +211,7 @@ my_readdir (void *gdir)
-       return NULL;
-     }
- 
--  dir->d.d_ino = dir->idx;
-+  dir->d.d_ino = 1;		/* glob should not skip this entry.  */
- 
- #ifdef _DIRENT_HAVE_D_TYPE
-   dir->d.d_type = filesystem[dir->idx].type;
diff --git a/pkgs/development/libraries/gnutls/3.3.nix b/pkgs/development/libraries/gnutls/3.3.nix
index c314da388dc..86262d4aef2 100644
--- a/pkgs/development/libraries/gnutls/3.3.nix
+++ b/pkgs/development/libraries/gnutls/3.3.nix
@@ -1,10 +1,10 @@
 { callPackage, fetchurl, ... } @ args:
 
 callPackage ./generic.nix (args // rec {
-  version = "3.3.18";
+  version = "3.3.24";
 
   src = fetchurl {
     url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3/gnutls-${version}.tar.xz";
-    sha256 = "15ckyblhkap3d4sqw0dc9l8wdrnd2aj1fs9m0w0a3bfihvsfg1vs";
+    sha256 = "5b65fe2a91c8dfa32bedc78acffcb152e5426cd3349e2afc43cccc9bdaf18aa5";
   };
 })
diff --git a/pkgs/development/libraries/gnutls/3.4.nix b/pkgs/development/libraries/gnutls/3.4.nix
index 4882e5dda04..2a48d045c51 100644
--- a/pkgs/development/libraries/gnutls/3.4.nix
+++ b/pkgs/development/libraries/gnutls/3.4.nix
@@ -1,17 +1,10 @@
 { callPackage, fetchurl, autoreconfHook, ... } @ args:
 
 callPackage ./generic.nix (args // rec {
-  version = "3.4.13";
+  version = "3.4.14";
 
   src = fetchurl {
     url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.4/gnutls-${version}.tar.xz";
-    sha256 = "0naqs9g5b577j1j7q55ma1vcn78jl2d98h3zrl5rh997wzl8cczx";
+    sha256 = "35deddf2779b76ac11057de38bf380b8066c05de21b94263ad5b6dfa75dfbb23";
   };
-
-  # This fixes some broken parallel dependencies
-  postPatch = ''
-    sed -i 's,^BUILT_SOURCES =,\0 systemkey-args.h,g' src/Makefile.am
-  '';
-
-  nativeBuildInputs = [ autoreconfHook ];
 })
diff --git a/pkgs/development/libraries/gnutls/3.5.nix b/pkgs/development/libraries/gnutls/3.5.nix
index 82bd437d721..db35a13cc41 100644
--- a/pkgs/development/libraries/gnutls/3.5.nix
+++ b/pkgs/development/libraries/gnutls/3.5.nix
@@ -1,17 +1,10 @@
 { callPackage, fetchurl, autoreconfHook, ... } @ args:
 
 callPackage ./generic.nix (args // rec {
-  version = "3.5.1";
+  version = "3.5.3";
 
   src = fetchurl {
     url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.5/gnutls-${version}.tar.xz";
-    sha256 = "1gdxr1p1sigigwvangqf3v31i8fda07d6ngawykarhr7ls00yjmw";
+    sha256 = "92c4bc999a10a1b95299ebefaeea8333f19d8a98d957a35b5eae74881bdb1fef";
   };
-
-  # This fixes some broken parallel dependencies
-  postPatch = ''
-    sed -i 's,^BUILT_SOURCES =,\0 systemkey-args.h,g' src/Makefile.am
-  '';
-
-  nativeBuildInputs = [ autoreconfHook ];
 })
diff --git a/pkgs/development/libraries/granite/default.nix b/pkgs/development/libraries/granite/default.nix
index 5a2ff5daa11..4d011ddd463 100644
--- a/pkgs/development/libraries/granite/default.nix
+++ b/pkgs/development/libraries/granite/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, cmake, vala, pkgconfig, gobjectIntrospection, glib, gtk3, gnome3, gettext }:
+{ stdenv, fetchurl, perl, cmake, vala_0_23, pkgconfig, gobjectIntrospection, glib, gtk3, gnome3, gettext }:
 
 stdenv.mkDerivation rec {
   majorVersion = "0.3";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "1laa109dz7kbd8zxddqw2p1b67yzva7cc5h3smqkj8a9jzbhv5fz";
   };
   cmakeFlags = "-DINTROSPECTION_GIRDIR=share/gir-1.0/ -DINTROSPECTION_TYPELIBDIR=lib/girepository-1.0";
-  buildInputs = [perl cmake vala pkgconfig gobjectIntrospection glib gtk3 gnome3.libgee gettext];
+  buildInputs = [perl cmake vala_0_23 pkgconfig gobjectIntrospection glib gtk3 gnome3.libgee gettext];
   meta = {
     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.";
diff --git a/pkgs/development/libraries/gtk+/3.x.nix b/pkgs/development/libraries/gtk+/3.x.nix
index 1a5931d9828..b0409ee2808 100644
--- a/pkgs/development/libraries/gtk+/3.x.nix
+++ b/pkgs/development/libraries/gtk+/3.x.nix
@@ -13,7 +13,7 @@ with stdenv.lib;
 
 let
   ver_maj = "3.20";
-  ver_min = "8";
+  ver_min = "9";
   version = "${ver_maj}.${ver_min}";
 in
 stdenv.mkDerivation rec {
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/gtk+/${ver_maj}/gtk+-${version}.tar.xz";
-    sha256 = "9841bd9b4d23c045c474b10fdde9da958af904b63783701e796391d55d4396f3";
+    sha256 = "05xcwvy68p7f4hdhi4bgdm3aycvqqr4pr5kkkr8ba91l5yx0k9l3";
   };
 
   outputs = [ "dev" "out" ];
diff --git a/pkgs/development/libraries/gusb/default.nix b/pkgs/development/libraries/gusb/default.nix
index c33920953ce..ac0425b54ad 100644
--- a/pkgs/development/libraries/gusb/default.nix
+++ b/pkgs/development/libraries/gusb/default.nix
@@ -1,6 +1,6 @@
 {stdenv, fetchurl
 , automake, autoconf, libtool, which, gtkdoc, gettext, pkgconfig, gobjectIntrospection, libxslt
-, glib, systemd, libusb1, vala
+, glib, systemd, libusb1, vala_0_23
 }:
 stdenv.mkDerivation rec {
   name = "gusb-${version}";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     pkgconfig autoconf automake libtool which gtkdoc gettext gobjectIntrospection libxslt
-    systemd libusb1 vala
+    systemd libusb1 vala_0_23
     glib
   ];
 
diff --git a/pkgs/development/libraries/icu/default.nix b/pkgs/development/libraries/icu/default.nix
index d2604b03f74..2f7c42c72b7 100644
--- a/pkgs/development/libraries/icu/default.nix
+++ b/pkgs/development/libraries/icu/default.nix
@@ -2,7 +2,7 @@
 
 let
   pname = "icu4c";
-  version = "56.1";
+  version = "57.1";
 in
 stdenv.mkDerivation ({
   name = pname + "-" + version;
@@ -10,7 +10,7 @@ stdenv.mkDerivation ({
   src = fetchurl {
     url = "http://download.icu-project.org/files/${pname}/${version}/${pname}-"
       + (stdenv.lib.replaceChars ["."] ["_"] version) + "-src.tgz";
-    sha256 = "05j86714qaj0lvhvyr2s1xncw6sk0h2dcghb3iiwykbkbh8fjr1s";
+    sha256 = "10cmkqigxh9f73y7q3p991q6j8pph0mrydgj11w1x6wlcp5ng37z";
   };
 
   outputs = [ "dev" "out" ];
diff --git a/pkgs/development/libraries/jemalloc/default.nix b/pkgs/development/libraries/jemalloc/default.nix
index 9b54ce48239..a332487d4ed 100644
--- a/pkgs/development/libraries/jemalloc/default.nix
+++ b/pkgs/development/libraries/jemalloc/default.nix
@@ -8,6 +8,11 @@ stdenv.mkDerivation rec {
     sha256 = "1bmdr51wxiir595k2r6z9a7rcgm42kkgnr586xir7vdcndr3pwf8";
   };
 
+  # By default, jemalloc puts a je_ prefix onto all its symbols on OSX, which
+  # then stops downstream builds (mariadb in particular) from detecting it. This
+  # option should remove the prefix and give us a working jemalloc.
+  configureFlags = stdenv.lib.optional stdenv.isDarwin "--with-jemalloc-prefix=";
+
   meta = with stdenv.lib; {
     homepage = http://www.canonware.com/jemalloc/index.html;
     description = "General purpose malloc(3) implementation";
diff --git a/pkgs/development/libraries/kdevplatform/default.nix b/pkgs/development/libraries/kdevplatform/default.nix
index d2b9581462b..549be9a71f5 100644
--- a/pkgs/development/libraries/kdevplatform/default.nix
+++ b/pkgs/development/libraries/kdevplatform/default.nix
@@ -9,7 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "195134bde11672de38838f4b341ed28c58042374ca12beedacca9d30e6ab4a2b";
   };
 
-  patches = [ ./gettext.patch ];
+  patches = [
+    ./gettext.patch     # build error caused by CMake update
+    ./dependency.patch  # build error: https://phabricator.kde.org/D1160
+  ];
 
   propagatedBuildInputs = [ kdelibs qt4 phonon ];
   buildInputs = [ apr aprutil subversion boost qjson grantlee ];
diff --git a/pkgs/development/libraries/kdevplatform/dependency.patch b/pkgs/development/libraries/kdevplatform/dependency.patch
new file mode 100644
index 00000000000..3205b4cab67
--- /dev/null
+++ b/pkgs/development/libraries/kdevplatform/dependency.patch
@@ -0,0 +1,12 @@
+diff --git a/plugins/filetemplates/CMakeLists.txt b/plugins/filetemplates/CMakeLists.txt
+--- a/plugins/filetemplates/CMakeLists.txt
++++ b/plugins/filetemplates/CMakeLists.txt
+@@ -81,6 +81,7 @@
+ )
+ 
+ kde4_add_executable(testfiletemplates ${test_srcs})
++add_dependencies(testfiletemplates kdevfiletemplates)
+ 
+ target_link_libraries(testfiletemplates
+     ${KDE4_KDECORE_LIBS}
+
diff --git a/pkgs/development/libraries/libappindicator/default.nix b/pkgs/development/libraries/libappindicator/default.nix
index 0dac5e4766f..4cf0c52d88b 100644
--- a/pkgs/development/libraries/libappindicator/default.nix
+++ b/pkgs/development/libraries/libappindicator/default.nix
@@ -5,7 +5,7 @@
 , glib, dbus_glib, gtkVersion
 , gtk2 ? null, libindicator-gtk2 ? null, libdbusmenu-gtk2 ? null
 , gtk3 ? null, libindicator-gtk3 ? null, libdbusmenu-gtk3 ? null
-, python, pygobject, pygtk, gobjectIntrospection, vala
+, python, pygobject, pygtk, gobjectIntrospection, vala_0_23
 , monoSupport ? false, mono ? null, gtk-sharp ? null
  }:
 
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     glib dbus_glib
-    python pygobject pygtk gobjectIntrospection vala
+    python pygobject pygtk gobjectIntrospection vala_0_23
   ] ++ (if gtkVersion == "2"
     then [ gtk2 libindicator-gtk2 libdbusmenu-gtk2 ] ++ optionals monoSupport [ mono gtk-sharp ]
     else [ gtk3 libindicator-gtk3 libdbusmenu-gtk3 ]);
diff --git a/pkgs/development/libraries/libbsd/default.nix b/pkgs/development/libraries/libbsd/default.nix
index 8597e0d9cf1..b7ec7533880 100644
--- a/pkgs/development/libraries/libbsd/default.nix
+++ b/pkgs/development/libraries/libbsd/default.nix
@@ -9,12 +9,6 @@ in stdenv.mkDerivation {
     sha256 = "02i5brb2007sxq3mn862mr7yxxm0g6nj172417hjyvjax7549xmj";
   };
 
-  patchPhase = ''
-    substituteInPlace Makefile \
-      --replace "/usr" "$out" \
-      --replace "{exec_prefix}" "{prefix}"
-  '';
-
   meta = {
     description = "Common functions found on BSD systems";
     homepage = http://libbsd.freedesktop.org/;
diff --git a/pkgs/development/libraries/libdbusmenu/default.nix b/pkgs/development/libraries/libdbusmenu/default.nix
index 3e633f9a365..90880fd4d52 100644
--- a/pkgs/development/libraries/libdbusmenu/default.nix
+++ b/pkgs/development/libraries/libdbusmenu/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, lib, file
 , pkgconfig, intltool
 , glib, dbus_glib, json_glib
-, gobjectIntrospection, vala, gnome_doc_utils
+, gobjectIntrospection, vala_0_23, gnome_doc_utils
 , gtkVersion ? null, gtk2 ? null, gtk3 ? null }:
 
 with lib;
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     glib dbus_glib json_glib
-    gobjectIntrospection vala gnome_doc_utils
+    gobjectIntrospection vala_0_23 gnome_doc_utils
   ] ++ optional (gtkVersion != null) (if gtkVersion == "2" then gtk2 else gtk3);
 
   postPatch = ''
diff --git a/pkgs/development/libraries/libdynd/default.nix b/pkgs/development/libraries/libdynd/default.nix
new file mode 100644
index 00000000000..119c92d690d
--- /dev/null
+++ b/pkgs/development/libraries/libdynd/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchFromGitHub, cmake }:
+
+let version = "0.7.2"; in
+stdenv.mkDerivation {
+  name = "libdynd-${version}";
+
+  src = fetchFromGitHub {
+    owner = "libdynd";
+    repo = "libdynd";
+    rev = "v${version}";
+    sha256 = "0fkd5rawqni1cq51fmr76iw7ll4fmbahfwv4rglnsabbkylf73pr";
+  };
+
+  cmakeFlags = [
+    "-DDYND_BUILD_BENCHMARKS=OFF"
+  ];
+
+  buildInputs = [ cmake ];
+
+  outputs = [ "dev" "out" ];
+  outputDoc = "dev";
+
+  meta = with stdenv.lib; {
+    description = "C++ dynamic ndarray library, with Python exposure.";
+    homepage = http://libdynd.org;
+    license = licenses.bsd2;
+  };
+}
diff --git a/pkgs/development/libraries/libfm/default.nix b/pkgs/development/libraries/libfm/default.nix
index db17b46b0d3..f4f3c774789 100644
--- a/pkgs/development/libraries/libfm/default.nix
+++ b/pkgs/development/libraries/libfm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, glib, gtk, intltool, menu-cache, pango, pkgconfig, vala
+{ stdenv, fetchurl, glib, gtk, intltool, menu-cache, pango, pkgconfig, vala_0_23
 , extraOnly ? false }:
 let
     inherit (stdenv.lib) optional;
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     sha256 = "0bsh4p7h2glhxf1cc1lvbxyb4qy0y1zsnl9izf7vrldkikrgc13q";
   };
 
-  buildInputs = [ glib gtk intltool pango pkgconfig vala ]
+  buildInputs = [ glib gtk intltool pango pkgconfig vala_0_23 ]
                 ++ optional (!extraOnly) menu-cache;
 
   configureFlags = optional extraOnly "--with-extra-only";
diff --git a/pkgs/development/libraries/libgcrypt/1.5.nix b/pkgs/development/libraries/libgcrypt/1.5.nix
index 4287c86dbd5..4139af2eac2 100644
--- a/pkgs/development/libraries/libgcrypt/1.5.nix
+++ b/pkgs/development/libraries/libgcrypt/1.5.nix
@@ -3,11 +3,11 @@
 assert enableCapabilities -> stdenv.isLinux;
 
 stdenv.mkDerivation rec {
-  name = "libgcrypt-1.5.4";
+  name = "libgcrypt-1.5.6";
 
   src = fetchurl {
     url = "mirror://gnupg/libgcrypt/${name}.tar.bz2";
-    sha256 = "0czvqxkzd5y872ipy6s010ifwdwv29sqbnqc4pf56sd486gqvy6m";
+    sha256 = "0ydy7bgra5jbq9mxl5x031nif3m6y3balc6ndw2ngj11wnsjc61h";
   };
 
   buildInputs =
diff --git a/pkgs/development/libraries/libgcrypt/default.nix b/pkgs/development/libraries/libgcrypt/default.nix
index 58de089a717..237a7ff0094 100644
--- a/pkgs/development/libraries/libgcrypt/default.nix
+++ b/pkgs/development/libraries/libgcrypt/default.nix
@@ -4,11 +4,11 @@ assert enableCapabilities -> stdenv.isLinux;
 
 stdenv.mkDerivation rec {
   name = "libgcrypt-${version}";
-  version = "1.7.2";
+  version = "1.7.3";
 
   src = fetchurl {
     url = "mirror://gnupg/libgcrypt/${name}.tar.bz2";
-    sha256 = "17v8nvvxagcwxz46apzz575l8682kfd78pf00i2kbavfdn8dyd9x";
+    sha256 = "0wbh6fq5zi9wg2xcfvfpwh7dv52jihivx1vm4h91c2kx0w8n3b6x";
   };
 
   outputs = [ "dev" "out" "info" ];
diff --git a/pkgs/development/libraries/libindicate/default.nix b/pkgs/development/libraries/libindicate/default.nix
index 0cff4aa1913..514aea12c7e 100644
--- a/pkgs/development/libraries/libindicate/default.nix
+++ b/pkgs/development/libraries/libindicate/default.nix
@@ -4,7 +4,7 @@
 , pkgconfig, autoconf
 , glib, dbus_glib, libdbusmenu-glib
 , gtkVersion, gtk2 ? null, gtk3 ? null
-, python, pygobject, pygtk, gobjectIntrospection, vala, gnome_doc_utils
+, python, pygobject, pygtk, gobjectIntrospection, vala_0_23, gnome_doc_utils
 , monoSupport ? false, mono ? null, gtk-sharp ? null
  }:
 
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     glib dbus_glib libdbusmenu-glib
-    python pygobject pygtk gobjectIntrospection vala gnome_doc_utils
+    python pygobject pygtk gobjectIntrospection vala_0_23 gnome_doc_utils
   ] ++ (if gtkVersion == "2"
     then [ gtk2 ] ++ optionals monoSupport [ mono gtk-sharp ]
     else [ gtk3 ]);
diff --git a/pkgs/development/libraries/libircclient/default.nix b/pkgs/development/libraries/libircclient/default.nix
new file mode 100644
index 00000000000..14e41961e0a
--- /dev/null
+++ b/pkgs/development/libraries/libircclient/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, cmake }:
+
+stdenv.mkDerivation rec {
+  name    = "${pname}-${version}";
+  version = "1.9";
+  pname   = "libircclient";
+
+  src = fetchurl {
+    url    = "mirror://sourceforge/${pname}/${pname}/${version}/${name}.tar.gz";
+    sha256 = "0r60i76jh4drjh2jgp5sx71chagqllmkaq49zv67nrhqwvp9ghw1";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  configureFlags = [ "--enable-shared" ];
+
+  postPatch = ''
+    substituteInPlace src/Makefile.in \
+      --replace "@prefix@/include" "@prefix@/include/libircclient" \
+      --replace "@libdir@"         "@prefix@/lib" \
+      --replace "cp "              "install "
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A small but extremely powerful library which implements the client IRC protocol";
+    homepage    = http://www.ulduzsoft.com/libircclient/;
+    license     = licenses.lgpl3;
+    maintainers = with maintainers; [ obadz ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/libosinfo/default.nix b/pkgs/development/libraries/libosinfo/default.nix
index 83873cc3660..b0b22aa18e7 100644
--- a/pkgs/development/libraries/libosinfo/default.nix
+++ b/pkgs/development/libraries/libosinfo/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, intltool, gobjectIntrospection, libsoup
-, libxslt, check, vala ? null
+, libxslt, check, vala_0_23 ? null
 }:
 
 stdenv.mkDerivation rec {
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [
-    pkgconfig intltool gobjectIntrospection libsoup libxslt check vala
+    pkgconfig intltool gobjectIntrospection libsoup libxslt check vala_0_23
   ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/libraw/default.nix b/pkgs/development/libraries/libraw/default.nix
index ee842b0c4bd..0b196cc22e0 100644
--- a/pkgs/development/libraries/libraw/default.nix
+++ b/pkgs/development/libraries/libraw/default.nix
@@ -9,7 +9,9 @@ stdenv.mkDerivation rec {
     sha256 = "18fygk896gxbx47nh2rn5jp4skisgkl6pdfjqb7h0zn39hd6b6g5";
   };
 
-  buildInputs = [ lcms2 jasper ];
+  buildInputs = [ jasper ];
+
+  propagatedBuildInputs = [ lcms2 ];
 
   nativeBuildInputs = [ pkgconfig ];
 
diff --git a/pkgs/development/libraries/libsecret/default.nix b/pkgs/development/libraries/libsecret/default.nix
index 8495650f02c..5aedc0df2b9 100644
--- a/pkgs/development/libraries/libsecret/default.nix
+++ b/pkgs/development/libraries/libsecret/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, glib, pkgconfig, intltool, libxslt, docbook_xsl, gtk_doc
-, libgcrypt, gobjectIntrospection }:
+, libgcrypt, gobjectIntrospection, vala_0_32 }:
 let
   version = "0.18.5";
 in
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ glib ];
   nativeBuildInputs = [ pkgconfig intltool libxslt docbook_xsl ];
-  buildInputs = [ libgcrypt gobjectIntrospection ];
+  buildInputs = [ libgcrypt gobjectIntrospection vala_0_32 ];
   # optional: build docs with gtk-doc? (probably needs a flag as well)
 
   meta = {
diff --git a/pkgs/development/libraries/libsidplayfp/default.nix b/pkgs/development/libraries/libsidplayfp/default.nix
new file mode 100644
index 00000000000..78e7036bdcc
--- /dev/null
+++ b/pkgs/development/libraries/libsidplayfp/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, pkgconfig
+, docSupport ? true, doxygen ? null, graphviz ? null }:
+
+assert docSupport -> doxygen != null && graphviz != null;
+
+stdenv.mkDerivation rec {
+  pname = "libsidplayfp";
+  major = "1";
+  minor = "8";
+  level = "6";
+  version = "${major}.${minor}.${level}";
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/sidplay-residfp/${pname}/${major}.${minor}/${name}.tar.gz";
+    sha256 = "0lzivfdq0crmfr01c6f5h883yr7wvagq198xkk3srdmvshhxmwnw";
+  };
+
+  nativeBuildInputs = [ pkgconfig ]
+    ++ stdenv.lib.optionals docSupport [ doxygen graphviz ];
+
+  installTargets = [ "install" ]
+    ++ stdenv.lib.optionals docSupport [ "doc" ];
+
+  outputs = [ "out" ] ++ stdenv.lib.optionals docSupport [ "doc" ];
+
+  postInstall = stdenv.lib.optionalString docSupport ''
+    mkdir -p $doc/share/doc/libsidplayfp
+    mv docs/html $doc/share/doc/libsidplayfp/
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A library to play Commodore 64 music derived from libsidplay2";
+    homepage = https://sourceforge.net/projects/sidplay-residfp/;
+    license = with licenses; [ gpl2Plus ];
+    maintainers = with maintainers; [ ramkromberg ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/pkgs/development/libraries/libsoup/default.nix b/pkgs/development/libraries/libsoup/default.nix
index 785e3320cc1..05026a06c61 100644
--- a/pkgs/development/libraries/libsoup/default.nix
+++ b/pkgs/development/libraries/libsoup/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, glib, libxml2, pkgconfig
 , gnomeSupport ? true, libgnome_keyring, sqlite, glib_networking, gobjectIntrospection
-, valaSupport ? true, vala
+, valaSupport ? true, vala_0_23
 , libintlOrEmpty
 , intltool, python }:
 let
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
   outputs = [ "dev" "out" ];
 
   buildInputs = libintlOrEmpty ++ [ intltool python sqlite ]
-    ++ stdenv.lib.optionals valaSupport [ vala ];
+    ++ stdenv.lib.optionals valaSupport [ vala_0_23 ];
   nativeBuildInputs = [ pkgconfig ];
   propagatedBuildInputs = [ glib libxml2 gobjectIntrospection ]
     ++ stdenv.lib.optionals gnomeSupport [ libgnome_keyring ];
diff --git a/pkgs/development/libraries/libunity/default.nix b/pkgs/development/libraries/libunity/default.nix
index 94e19f97e80..bcbe15afdf8 100644
--- a/pkgs/development/libraries/libunity/default.nix
+++ b/pkgs/development/libraries/libunity/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, vala, python, intltool, pkgconfig
+{ stdenv, fetchurl, vala_0_23, python, intltool, pkgconfig
 , glib, libgee_0_6, gtk3, dee, libdbusmenu-glib
 }:
 
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ glib libgee_0_6 gtk3 ];
   propagatedBuildInputs = [ dee libdbusmenu-glib ];
-  nativeBuildInputs = [ vala python intltool pkgconfig ];
+  nativeBuildInputs = [ vala_0_23 python intltool pkgconfig ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/libvdpau-va-gl/default.nix b/pkgs/development/libraries/libvdpau-va-gl/default.nix
index 0cbac567a45..8065df5c5b5 100644
--- a/pkgs/development/libraries/libvdpau-va-gl/default.nix
+++ b/pkgs/development/libraries/libvdpau-va-gl/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   name = "libvdpau-va-gl-${version}";
-  version = "0.3.6";
+  version = "0.4.0";
 
   src = fetchFromGitHub {
     owner = "i-rinat";
     repo = "libvdpau-va-gl";
     rev = "v${version}";
-    sha256 = "06lcg6zfj6mn17svz7s0y6ijdah55l9rnp9r440lcbixivjbgyn5";
+    sha256 = "1y511jxs0df1fqzjcvb6zln7nbmchv1g6z3lw0z9nsf64ziycj8k";
   };
 
   nativeBuildInputs = [ cmake pkgconfig ];
diff --git a/pkgs/development/libraries/libvirt/default.nix b/pkgs/development/libraries/libvirt/default.nix
index 12b4459cbca..0f9b5b5155b 100644
--- a/pkgs/development/libraries/libvirt/default.nix
+++ b/pkgs/development/libraries/libvirt/default.nix
@@ -9,11 +9,11 @@
 # if you update, also bump pythonPackages.libvirt or it will break
 stdenv.mkDerivation rec {
   name = "libvirt-${version}";
-  version = "2.0.0";
+  version = "2.1.0";
 
   src = fetchurl {
     url = "http://libvirt.org/sources/${name}.tar.xz";
-    sha256 = "1jwszhpjn09zkqji8w1x97rw0wqcl71ll2y6vp056fb1bvshms8h";
+    sha256 = "0sriasjc573c519yqw1hcfb3qqjcsm9hm8vayw0anwkl6di9ay8s";
   };
 
   patches = [ ./build-on-bsd.patch ];
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
   ];
 
   preConfigure = stdenv.lib.optionalString stdenv.isLinux ''
-    PATH=${iproute}/sbin:${iptables}/sbin:${ebtables}/sbin:${lvm2}/sbin:${systemd}/bin:$PATH
+    PATH=${stdenv.lib.makeBinPath [ iproute iptables ebtables lvm2 systemd ]}:$PATH
     substituteInPlace configure \
       --replace 'as_dummy="/bin:/usr/bin:/usr/sbin"' 'as_dummy="${numad}/bin"'
   '' + ''
@@ -69,7 +69,7 @@ stdenv.mkDerivation rec {
       --replace "$out/bin" "${gettext}/bin"
   '' + stdenv.lib.optionalString stdenv.isLinux ''
     wrapProgram $out/sbin/libvirtd \
-      --prefix PATH : ${iptables}/sbin:${iproute}/sbin:${pmutils}/bin:${numad}/bin:${numactl}/bin
+      --prefix PATH : ${stdenv.lib.makeBinPath [ iptables iproute pmutils numad numactl ]}
   '';
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/mlt/default.nix b/pkgs/development/libraries/mlt/default.nix
index 2bb709612b4..2e51492f142 100644
--- a/pkgs/development/libraries/mlt/default.nix
+++ b/pkgs/development/libraries/mlt/default.nix
@@ -1,19 +1,24 @@
-{ stdenv, fetchurl, SDL, ffmpeg, frei0r, libjack2, libdv, libsamplerate
-, libvorbis, libxml2, makeWrapper, movit, pkgconfig, qt, sox
+{ stdenv, fetchFromGitHub, makeWrapper
+, SDL, ffmpeg, frei0r, libjack2, libdv, libsamplerate
+, libvorbis, libxml2, movit, pkgconfig, sox
+, gtk2
 }:
 
 stdenv.mkDerivation rec {
   name = "mlt-${version}";
-  version = "0.9.6";
+  version = "6.2.0";
 
-  src = fetchurl {
-    url = "https://github.com/mltframework/mlt/archive/v${version}.tar.gz";
-    sha256 = "0s8ypg0q50zfcmq527y8cbdvzxhiqidm1923k28ar8jqmjp45ssh";
+  src = fetchFromGitHub {
+    owner = "mltframework";
+    repo = "mlt";
+    rev = "v${version}";
+    sha256 = "17jwz1lf9ilaxvgvhg7z86dhcsk95m4wlszy4gn7wab2ns5zhdm7";
   };
 
   buildInputs = [
     SDL ffmpeg frei0r libjack2 libdv libsamplerate libvorbis libxml2
-    makeWrapper movit pkgconfig qt sox
+    makeWrapper movit pkgconfig sox
+    gtk2
   ];
 
   # Mostly taken from:
@@ -33,7 +38,7 @@ stdenv.mkDerivation rec {
     description = "Open source multimedia framework, designed for television broadcasting";
     homepage = http://www.mltframework.org/;
     license = licenses.gpl3;
-    maintainers = [ maintainers.goibhniu ];
+    maintainers = [ maintainers.tohl ];
     platforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/mlt/qt-4.nix b/pkgs/development/libraries/mlt/qt-4.nix
new file mode 100644
index 00000000000..2bb709612b4
--- /dev/null
+++ b/pkgs/development/libraries/mlt/qt-4.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, SDL, ffmpeg, frei0r, libjack2, libdv, libsamplerate
+, libvorbis, libxml2, makeWrapper, movit, pkgconfig, qt, sox
+}:
+
+stdenv.mkDerivation rec {
+  name = "mlt-${version}";
+  version = "0.9.6";
+
+  src = fetchurl {
+    url = "https://github.com/mltframework/mlt/archive/v${version}.tar.gz";
+    sha256 = "0s8ypg0q50zfcmq527y8cbdvzxhiqidm1923k28ar8jqmjp45ssh";
+  };
+
+  buildInputs = [
+    SDL ffmpeg frei0r libjack2 libdv libsamplerate libvorbis libxml2
+    makeWrapper movit pkgconfig qt sox
+  ];
+
+  # Mostly taken from:
+  # http://www.kdenlive.org/user-manual/downloading-and-installing-kdenlive/installing-source/installing-mlt-rendering-engine
+  configureFlags = [
+    "--avformat-swscale" "--enable-gpl" "--enable-gpl" "--enable-gpl3"
+    "--enable-opengl"
+  ];
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    wrapProgram $out/bin/melt --prefix FREI0R_PATH : ${frei0r}/lib/frei0r-1
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Open source multimedia framework, designed for television broadcasting";
+    homepage = http://www.mltframework.org/;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/mlt/qt-5.nix b/pkgs/development/libraries/mlt/qt-5.nix
index d66d3fe9372..259d5a25d15 100644
--- a/pkgs/development/libraries/mlt/qt-5.nix
+++ b/pkgs/development/libraries/mlt/qt-5.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   name = "mlt-${version}";
-  version = "0.9.6";
+  version = "6.2.0";
 
   src = fetchurl {
     url = "https://github.com/mltframework/mlt/archive/v${version}.tar.gz";
-    sha256 = "0s8ypg0q50zfcmq527y8cbdvzxhiqidm1923k28ar8jqmjp45ssh";
+    sha256 = "1zwzfgxrcbwkxnkiwv0a1rzxdnnaly90yyarl9wdw84nx11ffbnx";
   };
 
   buildInputs = [
diff --git a/pkgs/development/libraries/pcl/default.nix b/pkgs/development/libraries/pcl/default.nix
index b38f1e5711a..42a8d00eec0 100644
--- a/pkgs/development/libraries/pcl/default.nix
+++ b/pkgs/development/libraries/pcl/default.nix
@@ -1,14 +1,15 @@
-{ stdenv, fetchzip, cmake, qhull, flann, boost, vtk, eigen, pkgconfig, qt4
+{ stdenv, fetchFromGitHub, cmake, qhull, flann, boost, vtk, eigen, pkgconfig, qt4
 , libusb1, libpcap, libXt, libpng, Cocoa, AGL, cf-private
 }:
 
 stdenv.mkDerivation rec {
-  name = "pcl-1.7.2";
+  name = "pcl-1.8.0";
 
-  src = fetchzip {
-    name = name + "-src";
-    url = "https://github.com/PointCloudLibrary/pcl/archive/${name}.tar.gz";
-    sha256 = "0sm19p6wcls2d9l0vi5fgwqp7l372nh3g7bdin42w31zr8dmz8h8";
+  src = fetchFromGitHub {
+    owner = "PointCloudLibrary";
+    repo = "pcl";
+    rev = name;
+    sha256 = "1pki4y7mc2dryxc8wa7rs4hg74qab80rpy90jnw3j8fzf09kxcll";
   };
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/phonon/backends/gstreamer.nix b/pkgs/development/libraries/phonon/backends/gstreamer.nix
index 1fb542c2c5f..56d40f81833 100644
--- a/pkgs/development/libraries/phonon/backends/gstreamer.nix
+++ b/pkgs/development/libraries/phonon/backends/gstreamer.nix
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = [
     # This flag should be picked up through pkgconfig, but it isn't.
-    "-I${gst_all_1.gstreamer}/lib/gstreamer-1.0/include"
+    "-I${gst_all_1.gstreamer.dev}/lib/gstreamer-1.0/include"
   ];
 
   nativeBuildInputs = [ cmake pkgconfig ] ++ optional withQt5 extra-cmake-modules;
diff --git a/pkgs/development/libraries/physics/geant4/g4py/default.nix b/pkgs/development/libraries/physics/geant4/g4py/default.nix
index e023b122091..ee332171158 100644
--- a/pkgs/development/libraries/physics/geant4/g4py/default.nix
+++ b/pkgs/development/libraries/physics/geant4/g4py/default.nix
@@ -30,8 +30,8 @@ let
                             --with-g4install-dir=${geant4} \
                             --with-python-incdir=${python}/include/python${python.majorVersion} \
                             --with-python-libdir=${python}/lib \
-                            --with-boost-incdir=${boost}/include \
-                            --with-boost-libdir=${boost}/lib
+                            --with-boost-incdir=${boost.dev}/include \
+                            --with-boost-libdir=${boost.out}/lib
       '';
 
       enableParallelBuilding = true;
@@ -47,24 +47,28 @@ let
       meta = {
         description = "Python bindings and utilities for Geant4";
         longDescription = ''
-          Geant4 is a toolkit for the simulation of the passage of particles through matter.      
-          Its areas of application include high energy, nuclear and accelerator physics, as well as studies in medical and space science.
-          The two main reference papers for Geant4 are published in Nuclear Instruments and Methods in Physics Research A 506 (2003) 250-303, and IEEE Transactions on Nuclear Science 53 No. 1 (2006) 270-278.
+          Geant4 is a toolkit for the simulation of the passage of particles
+          through matter.  Its areas of application include high energy,
+          nuclear and accelerator physics, as well as studies in medical and
+          space science.  The two main reference papers for Geant4 are
+          published in Nuclear Instruments and Methods in Physics Research A
+          506 (2003) 250-303, and IEEE Transactions on Nuclear Science 53 No. 1
+          (2006) 270-278.
         '';
         homepage = http://www.geant4.org;
         license = stdenv.lib.licenses.g4sl;
         maintainers = [ ];
         platforms = stdenv.lib.platforms.all;
-      }; 
+      };
     };
 
     fetchGeant4 = import ../fetch.nix {
       inherit stdenv fetchurl;
-    };  
+    };
 
 in {
   v10_0_2 = buildG4py {
     inherit (fetchGeant4.v10_0_2) version src;
     geant4 = geant4.v10_0_2;
-  };  
-} 
+  };
+}
diff --git a/pkgs/development/libraries/poppler/datadir_env.patch b/pkgs/development/libraries/poppler/datadir_env.patch
deleted file mode 100644
index fd111d71355..00000000000
--- a/pkgs/development/libraries/poppler/datadir_env.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
-index 2e11bb0..a277ab9 100644
---- a/poppler/GlobalParams.cc
-+++ b/poppler/GlobalParams.cc
-@@ -748,7 +748,7 @@ GlobalParams::GlobalParams(const char *customPopplerDataDir)
- void GlobalParams::scanEncodingDirs() {
-   GDir *dir;
-   GDirEntry *entry;
--  const char *dataRoot = popplerDataDir ? popplerDataDir : POPPLER_DATADIR;
-+  const char *dataRoot = popplerDataDir ? popplerDataDir : ( getenv("POPPLER_DATADIR") ? getenv("POPPLER_DATADIR") : POPPLER_DATADIR );
-   
-   // allocate buffer large enough to append "/nameToUnicode"
-   size_t bufSize = strlen(dataRoot) + strlen("/nameToUnicode") + 1;
diff --git a/pkgs/development/libraries/poppler/default.nix b/pkgs/development/libraries/poppler/default.nix
index e445af46e09..097031d54f1 100644
--- a/pkgs/development/libraries/poppler/default.nix
+++ b/pkgs/development/libraries/poppler/default.nix
@@ -1,14 +1,15 @@
 { stdenv, lib, fetchurl, fetchpatch, pkgconfig, libiconv, libintlOrEmpty
 , zlib, curl, cairo, freetype, fontconfig, lcms, libjpeg, openjpeg
-, minimal ? false
+, withData ? false, poppler_data
 , qt4Support ? false, qt4 ? null
 , qt5Support ? false, qtbase ? null
-, utils ? false, suffix ? "glib"
+, utils ? false
+, minimal ? false, suffix ? "glib"
 }:
 
 let # beware: updates often break cups_filters build
-  version = "0.43.0"; # even major numbers are stable
-  sha256 = "0mi4zf0pz3x3fx3ir7szz1n57nywgbpd4mp2r7mvf47f4rmf4867";
+  version = "0.46.0"; # even major numbers are stable
+  sha256 = "11z4d5vrrd0m7w9bfydwabksk273z7z0xf2nwvzf5pk17p8kazcn";
 in
 stdenv.mkDerivation rec {
   name = "poppler-${suffix}-${version}";
@@ -20,22 +21,19 @@ stdenv.mkDerivation rec {
 
   outputs = [ "dev" "out" ];
 
-  patches = [ ./datadir_env.patch ];
+  buildInputs = [ libiconv ] ++ libintlOrEmpty ++ lib.optional withData poppler_data;
 
   # TODO: reduce propagation to necessary libs
   propagatedBuildInputs = with lib;
-    [ zlib freetype fontconfig libjpeg ]
-    ++ optionals (!minimal) [ cairo lcms curl openjpeg ]
+    [ zlib freetype fontconfig libjpeg openjpeg ]
+    ++ optionals (!minimal) [ cairo lcms curl ]
     ++ optional qt4Support qt4
     ++ optional qt5Support qtbase;
 
-  nativeBuildInputs = [ pkgconfig libiconv ] ++ libintlOrEmpty;
+  nativeBuildInputs = [ pkgconfig ];
 
   NIX_CFLAGS_COMPILE = [ "-DQT_NO_DEBUG" ];
 
-  # Any package depending on Qt >= 5.7 must build using the C++11 standard.
-  CXXFLAGS = lib.optional qt5Support "-std=c++11";
-
   configureFlags = with lib;
     [
       "--enable-xpdf-headers"
@@ -45,7 +43,7 @@ stdenv.mkDerivation rec {
     ]
     ++ optionals minimal [
       "--disable-poppler-glib" "--disable-poppler-cpp"
-      "--disable-libopenjpeg" "--disable-libcurl"
+      "--disable-libcurl"
     ]
     ++ optional (!utils) "--disable-utils" ;
 
diff --git a/pkgs/development/libraries/protobuf/3.0.0-beta-2.nix b/pkgs/development/libraries/protobuf/3.0.0-beta-2.nix
new file mode 100644
index 00000000000..a06d4cef968
--- /dev/null
+++ b/pkgs/development/libraries/protobuf/3.0.0-beta-2.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchFromGitHub , autoreconfHook, zlib, gmock }:
+
+stdenv.mkDerivation rec {
+  name = "protobuf-${version}";
+
+  version = "3.0.0-beta-2";
+  # make sure you test also -A pythonPackages.protobuf
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "protobuf";
+    rev = "v${version}";
+    sha256 = "0cbr1glgma5vakabsjwcs41pcnn8yphhn037l0zd121zb9gdaqc1";
+  };
+
+  postPatch = ''
+    rm -rf gmock
+    cp -r ${gmock.source} gmock
+    chmod -R a+w gmock
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    substituteInPlace src/google/protobuf/testing/googletest.cc \
+      --replace 'tmpnam(b)' '"'$TMPDIR'/foo"'
+  '';
+
+  buildInputs = [ autoreconfHook zlib ];
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  meta = {
+    description = "Google's data interchange format";
+    longDescription =
+      ''Protocol Buffers are a way of encoding structured data in an efficient
+        yet extensible format. Google uses Protocol Buffers for almost all of
+        its internal RPC protocols and file formats.
+      '';
+    license = stdenv.lib.licenses.bsd3;
+    platforms = stdenv.lib.platforms.unix;
+    homepage = https://developers.google.com/protocol-buffers/;
+  };
+
+  passthru.version = version;
+}
diff --git a/pkgs/development/libraries/protobuf/3.0.nix b/pkgs/development/libraries/protobuf/3.0.nix
index a547dff14cc..16a39daf790 100644
--- a/pkgs/development/libraries/protobuf/3.0.nix
+++ b/pkgs/development/libraries/protobuf/3.0.nix
@@ -3,13 +3,13 @@
 stdenv.mkDerivation rec {
   name = "protobuf-${version}";
 
-  version = "3.0.0-beta-3.1";
+  version = "3.0.0";
   # make sure you test also -A pythonPackages.protobuf
   src = fetchFromGitHub {
     owner = "google";
     repo = "protobuf";
     rev = "v${version}";
-    sha256 = "1lj3q1wq821q9h2y2hhbnvyy4nw3gl0x2g0kplyvd6ivrissfcqx";
+    sha256 = "05qkcl96lkdama848m7q3nzzzdckjc158iiyvgmln0zi232xx7g7";
   };
 
   postPatch = ''
diff --git a/pkgs/development/libraries/protobuf/generic.nix b/pkgs/development/libraries/protobuf/generic.nix
index d4b7c77a5fe..47f66c83ff5 100644
--- a/pkgs/development/libraries/protobuf/generic.nix
+++ b/pkgs/development/libraries/protobuf/generic.nix
@@ -25,15 +25,12 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "Protocol Buffers - Google's data interchange format";
-
     longDescription =
       '' Protocol Buffers are a way of encoding structured data in an
          efficient yet extensible format.  Google uses Protocol Buffers for
          almost all of its internal RPC protocols and file formats.
       '';
-
     license = "mBSD";
-
     homepage = https://developers.google.com/protocol-buffers/;
     platforms = stdenv.lib.platforms.unix;
   };
diff --git a/pkgs/development/libraries/qt-5/5.5/fetchsrcs.sh b/pkgs/development/libraries/qt-5/5.5/fetchsrcs.sh
index 4754535a5f3..c958b5c9eed 100755
--- a/pkgs/development/libraries/qt-5/5.5/fetchsrcs.sh
+++ b/pkgs/development/libraries/qt-5/5.5/fetchsrcs.sh
@@ -3,16 +3,23 @@
 
 set -x
 
+MAJOR_VERSION="5.5"
+VERSION="${MAJOR_VERSION}.1"
 # The trailing slash at the end is necessary!
-RELEASE_URL="http://download.qt.io/official_releases/qt/5.5/5.5.1/submodules/"
+RELEASE_URLS=(
+    "http://download.qt.io/official_releases/qt/$MAJOR_VERSION/$VERSION/submodules/"
+    "http://download.qt.io/community_releases/$MAJOR_VERSION/$VERSION/"
+)
 EXTRA_WGET_ARGS='-A *.tar.xz'
 
 mkdir tmp; cd tmp
 
-wget -nH -r -c --no-parent $RELEASE_URL $EXTRA_WGET_ARGS
+for url in "${RELEASE_URLS[@]}"; do
+    wget -nH -r -c --no-parent $url $EXTRA_WGET_ARGS
+done
 
 cat >../srcs.nix <<EOF
-# DO NOT EDIT! This file is generated automatically by manifest.sh
+# DO NOT EDIT! This file is generated automatically by fetchsrcs.sh
 { fetchurl, mirror }:
 
 {
@@ -20,7 +27,7 @@ EOF
 
 workdir=$(pwd)
 
-find . | while read src; do
+find . | sort | while read src; do
     if [[ -f "${src}" ]]; then
         url="${src:2}"
         # Sanitize file name
diff --git a/pkgs/development/libraries/qt-5/5.5/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.5/qtbase/default.nix
index ef64a87d0e2..43eb71ede18 100644
--- a/pkgs/development/libraries/qt-5/5.5/qtbase/default.nix
+++ b/pkgs/development/libraries/qt-5/5.5/qtbase/default.nix
@@ -131,7 +131,7 @@ stdenv.mkDerivation {
     -rpath
     -optimized-qmake
     -strip
-    -reduce-relocations
+    -no-reduce-relocations
     -system-proxies
     -pkg-config
 
diff --git a/pkgs/development/libraries/qt-5/5.5/qtbase/setup-hook.sh b/pkgs/development/libraries/qt-5/5.5/qtbase/setup-hook.sh
index 6d8989281eb..30491983114 100644
--- a/pkgs/development/libraries/qt-5/5.5/qtbase/setup-hook.sh
+++ b/pkgs/development/libraries/qt-5/5.5/qtbase/setup-hook.sh
@@ -61,11 +61,6 @@ _qtMultioutDevs() {
 
 preFixupHooks+=(_qtMultioutDevs)
 
-if [[ -z "$NIX_QT_PIC" ]]; then
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE${NIX_CFLAGS_COMPILE:+ }-fPIC"
-    export NIX_QT_PIC=1
-fi
-
 _qtSetCMakePrefix() {
     export CMAKE_PREFIX_PATH="$NIX_QT5_TMP${CMAKE_PREFIX_PATH:+:}${CMAKE_PREFIX_PATH}"
 }
diff --git a/pkgs/development/libraries/qt-5/5.5/qtwebkit/default.nix b/pkgs/development/libraries/qt-5/5.5/qtwebkit/default.nix
index 2e92391f4c0..5ccf09515e4 100644
--- a/pkgs/development/libraries/qt-5/5.5/qtwebkit/default.nix
+++ b/pkgs/development/libraries/qt-5/5.5/qtwebkit/default.nix
@@ -1,6 +1,6 @@
-{ qtSubmodule, stdenv, qtdeclarative, qtlocation, qtmultimedia, qtsensors
+{ qtSubmodule, stdenv, qtdeclarative, qtlocation, qtsensors
 , fontconfig, gdk_pixbuf, gtk, libwebp, libxml2, libxslt
-, sqlite, libudev
+, sqlite, libudev, glib, gst_all_1
 , bison2, flex, gdb, gperf, perl, pkgconfig, python, ruby
 , substituteAll
 , flashplayerFix ? false
@@ -10,8 +10,8 @@ with stdenv.lib;
 
 qtSubmodule {
   name = "qtwebkit";
-  qtInputs = [ qtdeclarative qtlocation qtmultimedia qtsensors ];
-  buildInputs = [ fontconfig libwebp libxml2 libxslt sqlite ];
+  qtInputs = [ qtdeclarative qtlocation qtsensors ];
+  buildInputs = [ fontconfig libwebp libxml2 libxslt sqlite glib gst_all_1.gstreamer gst_all_1.gst-plugins-base ];
   nativeBuildInputs = [
     bison2 flex gdb gperf perl pkgconfig python ruby
   ];
diff --git a/pkgs/development/libraries/qt-5/5.5/srcs.nix b/pkgs/development/libraries/qt-5/5.5/srcs.nix
index 0cf62081f23..20aa28a55da 100644
--- a/pkgs/development/libraries/qt-5/5.5/srcs.nix
+++ b/pkgs/development/libraries/qt-5/5.5/srcs.nix
@@ -1,133 +1,125 @@
-# DO NOT EDIT! This file is generated automatically by manifest.sh
+# DO NOT EDIT! This file is generated automatically by fetchsrcs.sh
 { fetchurl, mirror }:
 
 {
-  qtx11extras = {
-    version = "5.5.1";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtx11extras-opensource-src-5.5.1.tar.xz";
-      sha256 = "0rgbxgp5l212c4vg8z685zv008j9s03mx8p576ny2qibjwfs11v3";
-      name = "qtx11extras-opensource-src-5.5.1.tar.xz";
-    };
-  };
-  qtconnectivity = {
+  qt3d = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtconnectivity-opensource-src-5.5.1.tar.xz";
-      sha256 = "08sh4hzib5l26l6mc6iil4nvl807cn9rn5w46vxw0bsqz3gfcdrn";
-      name = "qtconnectivity-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qt3d-opensource-src-5.5.1.tar.xz";
+      sha256 = "1xqvifsy5x2vj7p51c2z1ly7k2yq7l3byhshnkd2bn6b5dp91073";
+      name = "qt3d-opensource-src-5.5.1.tar.xz";
     };
   };
-  qttranslations = {
+  qt5 = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qttranslations-opensource-src-5.5.1.tar.xz";
-      sha256 = "1im4qzpyp1wqrrrlwc4r56b46w5y4bxg2m0y7wkcmihb1xqh1y21";
-      name = "qttranslations-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qt5-opensource-src-5.5.1.tar.xz";
+      sha256 = "0g83vzsj6hdjmagccy6gxgc1l8q0q6663r9xj58ix4lj7hsphf26";
+      name = "qt5-opensource-src-5.5.1.tar.xz";
     };
   };
-  qttools = {
+  qtactiveqt = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qttools-opensource-src-5.5.1.tar.xz";
-      sha256 = "1zbvr039sv0jzd41ngarxif6954bl50pha8814b5hw3i977gcqa3";
-      name = "qttools-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtactiveqt-opensource-src-5.5.1.tar.xz";
+      sha256 = "09dz5jj7gxa9ds2gw6xw8lacmv27ydhi64370q1ncc7khd0p6g3m";
+      name = "qtactiveqt-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtwebkit = {
+  qtandroidextras = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtwebkit-opensource-src-5.5.1.tar.xz";
-      sha256 = "0sbdglcf57lmgbcybimvvbpqikn3blb1pxvd71sdhsiypnfkyn3p";
-      name = "qtwebkit-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtandroidextras-opensource-src-5.5.1.tar.xz";
+      sha256 = "1cam9zd0kxgyplnaijy91rl8p30j2jbp2ikq9rnigcsglfnx5hd4";
+      name = "qtandroidextras-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtimageformats = {
+  qtbase = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtimageformats-opensource-src-5.5.1.tar.xz";
-      sha256 = "19alny9bm2lzzlxicbvw56ra4qcxdrnm9054zs4z1y82qq0fwzy9";
-      name = "qtimageformats-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtbase-opensource-src-5.5.1.tar.xz";
+      sha256 = "05p91m1d9b3gdfm5pgmxw63rk0fdxqz87s77hn9bdip4syjfi96z";
+      name = "qtbase-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtwinextras = {
+  qtcanvas3d = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtwinextras-opensource-src-5.5.1.tar.xz";
-      sha256 = "07w5ipiwvvapasjswk0g4ndcp0lq65pz2n6l348zwfb0gand406b";
-      name = "qtwinextras-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtcanvas3d-opensource-src-5.5.1.tar.xz";
+      sha256 = "105hl3mvsdif416l4dvpxl7r1iw42if8hhrnji8hf4fp6081g6vm";
+      name = "qtcanvas3d-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtwebsockets = {
+  qtconnectivity = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtwebsockets-opensource-src-5.5.1.tar.xz";
-      sha256 = "1srdn668z62j95q1wwhg6xk2dic407r4wl5yi1qk743vhr586kng";
-      name = "qtwebsockets-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtconnectivity-opensource-src-5.5.1.tar.xz";
+      sha256 = "08sh4hzib5l26l6mc6iil4nvl807cn9rn5w46vxw0bsqz3gfcdrn";
+      name = "qtconnectivity-opensource-src-5.5.1.tar.xz";
     };
   };
-  qt3d = {
+  qtdeclarative = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qt3d-opensource-src-5.5.1.tar.xz";
-      sha256 = "1xqvifsy5x2vj7p51c2z1ly7k2yq7l3byhshnkd2bn6b5dp91073";
-      name = "qt3d-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtdeclarative-opensource-src-5.5.1.tar.xz";
+      sha256 = "14b7naaa0rk4q6cxf0w62gvamxk812kr65k82zxkdzrzp3plxlaz";
+      name = "qtdeclarative-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtmacextras = {
+  qtdoc = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtmacextras-opensource-src-5.5.1.tar.xz";
-      sha256 = "0n4hxi9xhnyvp5cxklr9ygg4ficvahak2w73kr9ihqckrkym0lq2";
-      name = "qtmacextras-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtdoc-opensource-src-5.5.1.tar.xz";
+      sha256 = "11hgw1i1qm2yqzfyg0jsvjda9092hjas35l0bmxn6pvnl5asy3cz";
+      name = "qtdoc-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtandroidextras = {
+  qtenginio = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtandroidextras-opensource-src-5.5.1.tar.xz";
-      sha256 = "1cam9zd0kxgyplnaijy91rl8p30j2jbp2ikq9rnigcsglfnx5hd4";
-      name = "qtandroidextras-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtenginio-opensource-src-5.5.1.tar.xz";
+      sha256 = "1qpg9pcniqp5xxi2qrc6indqdyn850djk0njiniandbabfykd6d7";
+      name = "qtenginio-opensource-src-5.5.1.tar.xz";
     };
   };
-  qt5 = {
+  qtgraphicaleffects = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qt5-opensource-src-5.5.1.tar.xz";
-      sha256 = "0g83vzsj6hdjmagccy6gxgc1l8q0q6663r9xj58ix4lj7hsphf26";
-      name = "qt5-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtgraphicaleffects-opensource-src-5.5.1.tar.xz";
+      sha256 = "0irdq4lfbv740mbvd40x62k3zzj0aj8h95gsxg79wa54nf6hzjlv";
+      name = "qtgraphicaleffects-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtbase = {
+  qtimageformats = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtbase-opensource-src-5.5.1.tar.xz";
-      sha256 = "05p91m1d9b3gdfm5pgmxw63rk0fdxqz87s77hn9bdip4syjfi96z";
-      name = "qtbase-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtimageformats-opensource-src-5.5.1.tar.xz";
+      sha256 = "19alny9bm2lzzlxicbvw56ra4qcxdrnm9054zs4z1y82qq0fwzy9";
+      name = "qtimageformats-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtxmlpatterns = {
+  qtlocation = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtxmlpatterns-opensource-src-5.5.1.tar.xz";
-      sha256 = "1v78s0jygg83yzyldwms8zb72cwp718cc5ialc2ki3lqa81fndxm";
-      name = "qtxmlpatterns-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtlocation-opensource-src-5.5.1.tar.xz";
+      sha256 = "05k31nm1p444fixplspgh1d5j4f3xz6z674jpr8497v4hz5lis8z";
+      name = "qtlocation-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtwayland = {
+  qtmacextras = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtwayland-opensource-src-5.5.1.tar.xz";
-      sha256 = "19nxifpg9q785ahzaii2fd2911cg5m0dpk5v041sylm997f4p063";
-      name = "qtwayland-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtmacextras-opensource-src-5.5.1.tar.xz";
+      sha256 = "0n4hxi9xhnyvp5cxklr9ygg4ficvahak2w73kr9ihqckrkym0lq2";
+      name = "qtmacextras-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtwebkit-examples = {
+  qtmultimedia = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtwebkit-examples-opensource-src-5.5.1.tar.xz";
-      sha256 = "1ij65v3nzh5f6rdq43w6vmljjgfw1vky8dd6s4kr093d5ns3b289";
-      name = "qtwebkit-examples-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtmultimedia-opensource-src-5.5.1.tar.xz";
+      sha256 = "0zwmgmiix56c567qw5xnijd1y43mbjg4jw1n624c31qmyjcwmivw";
+      name = "qtmultimedia-opensource-src-5.5.1.tar.xz";
     };
   };
   qtquick1 = {
@@ -138,22 +130,6 @@
       name = "qtquick1-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtgraphicaleffects = {
-    version = "5.5.1";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtgraphicaleffects-opensource-src-5.5.1.tar.xz";
-      sha256 = "0irdq4lfbv740mbvd40x62k3zzj0aj8h95gsxg79wa54nf6hzjlv";
-      name = "qtgraphicaleffects-opensource-src-5.5.1.tar.xz";
-    };
-  };
-  qtlocation = {
-    version = "5.5.1";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtlocation-opensource-src-5.5.1.tar.xz";
-      sha256 = "05k31nm1p444fixplspgh1d5j4f3xz6z674jpr8497v4hz5lis8z";
-      name = "qtlocation-opensource-src-5.5.1.tar.xz";
-    };
-  };
   qtquickcontrols = {
     version = "5.5.1";
     src = fetchurl {
@@ -162,12 +138,20 @@
       name = "qtquickcontrols-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtwebchannel = {
+  qtscript = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtwebchannel-opensource-src-5.5.1.tar.xz";
-      sha256 = "1l0m5xjxg5va9dwvgf52r52inl4dl3954d16rfiwnkndazp9ahkz";
-      name = "qtwebchannel-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtscript-opensource-src-5.5.1.tar.xz";
+      sha256 = "1z98x3758mk24wf0nxxw4lphbxw1xxzl1q27cjqbq8lgk7fxsind";
+      name = "qtscript-opensource-src-5.5.1.tar.xz";
+    };
+  };
+  qtsensors = {
+    version = "5.5.1";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtsensors-opensource-src-5.5.1.tar.xz";
+      sha256 = "1spfr2pn8zz5vz3qz9lzs0wfshmim6hdgf2fpmwpcpcsfb04y9jx";
+      name = "qtsensors-opensource-src-5.5.1.tar.xz";
     };
   };
   qtserialport = {
@@ -178,36 +162,44 @@
       name = "qtserialport-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtscript = {
+  qtsvg = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtscript-opensource-src-5.5.1.tar.xz";
-      sha256 = "1z98x3758mk24wf0nxxw4lphbxw1xxzl1q27cjqbq8lgk7fxsind";
-      name = "qtscript-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtsvg-opensource-src-5.5.1.tar.xz";
+      sha256 = "1iwibbh835cpxbfh7rnrpvl9k20valr6h256np59rzdy92z8ixgp";
+      name = "qtsvg-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtmultimedia = {
+  qttools = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtmultimedia-opensource-src-5.5.1.tar.xz";
-      sha256 = "0zwmgmiix56c567qw5xnijd1y43mbjg4jw1n624c31qmyjcwmivw";
-      name = "qtmultimedia-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qttools-opensource-src-5.5.1.tar.xz";
+      sha256 = "1zbvr039sv0jzd41ngarxif6954bl50pha8814b5hw3i977gcqa3";
+      name = "qttools-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtcanvas3d = {
+  qttranslations = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtcanvas3d-opensource-src-5.5.1.tar.xz";
-      sha256 = "105hl3mvsdif416l4dvpxl7r1iw42if8hhrnji8hf4fp6081g6vm";
-      name = "qtcanvas3d-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qttranslations-opensource-src-5.5.1.tar.xz";
+      sha256 = "1im4qzpyp1wqrrrlwc4r56b46w5y4bxg2m0y7wkcmihb1xqh1y21";
+      name = "qttranslations-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtsensors = {
+  qtwayland = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtsensors-opensource-src-5.5.1.tar.xz";
-      sha256 = "1spfr2pn8zz5vz3qz9lzs0wfshmim6hdgf2fpmwpcpcsfb04y9jx";
-      name = "qtsensors-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtwayland-opensource-src-5.5.1.tar.xz";
+      sha256 = "19nxifpg9q785ahzaii2fd2911cg5m0dpk5v041sylm997f4p063";
+      name = "qtwayland-opensource-src-5.5.1.tar.xz";
+    };
+  };
+  qtwebchannel = {
+    version = "5.5.1";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtwebchannel-opensource-src-5.5.1.tar.xz";
+      sha256 = "1l0m5xjxg5va9dwvgf52r52inl4dl3954d16rfiwnkndazp9ahkz";
+      name = "qtwebchannel-opensource-src-5.5.1.tar.xz";
     };
   };
   qtwebengine = {
@@ -218,44 +210,52 @@
       name = "qtwebengine-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtdeclarative = {
+  qtwebkit-examples = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtdeclarative-opensource-src-5.5.1.tar.xz";
-      sha256 = "14b7naaa0rk4q6cxf0w62gvamxk812kr65k82zxkdzrzp3plxlaz";
-      name = "qtdeclarative-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtwebkit-examples-opensource-src-5.5.1.tar.xz";
+      sha256 = "1ij65v3nzh5f6rdq43w6vmljjgfw1vky8dd6s4kr093d5ns3b289";
+      name = "qtwebkit-examples-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtactiveqt = {
+  qtwebkit = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtactiveqt-opensource-src-5.5.1.tar.xz";
-      sha256 = "09dz5jj7gxa9ds2gw6xw8lacmv27ydhi64370q1ncc7khd0p6g3m";
-      name = "qtactiveqt-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtwebkit-opensource-src-5.5.1.tar.xz";
+      sha256 = "0sbdglcf57lmgbcybimvvbpqikn3blb1pxvd71sdhsiypnfkyn3p";
+      name = "qtwebkit-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtsvg = {
+  qtwebsockets = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtsvg-opensource-src-5.5.1.tar.xz";
-      sha256 = "1iwibbh835cpxbfh7rnrpvl9k20valr6h256np59rzdy92z8ixgp";
-      name = "qtsvg-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtwebsockets-opensource-src-5.5.1.tar.xz";
+      sha256 = "1srdn668z62j95q1wwhg6xk2dic407r4wl5yi1qk743vhr586kng";
+      name = "qtwebsockets-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtdoc = {
+  qtwinextras = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtdoc-opensource-src-5.5.1.tar.xz";
-      sha256 = "11hgw1i1qm2yqzfyg0jsvjda9092hjas35l0bmxn6pvnl5asy3cz";
-      name = "qtdoc-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtwinextras-opensource-src-5.5.1.tar.xz";
+      sha256 = "07w5ipiwvvapasjswk0g4ndcp0lq65pz2n6l348zwfb0gand406b";
+      name = "qtwinextras-opensource-src-5.5.1.tar.xz";
     };
   };
-  qtenginio = {
+  qtx11extras = {
     version = "5.5.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtenginio-opensource-src-5.5.1.tar.xz";
-      sha256 = "1qpg9pcniqp5xxi2qrc6indqdyn850djk0njiniandbabfykd6d7";
-      name = "qtenginio-opensource-src-5.5.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtx11extras-opensource-src-5.5.1.tar.xz";
+      sha256 = "0rgbxgp5l212c4vg8z685zv008j9s03mx8p576ny2qibjwfs11v3";
+      name = "qtx11extras-opensource-src-5.5.1.tar.xz";
+    };
+  };
+  qtxmlpatterns = {
+    version = "5.5.1";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.5/5.5.1/submodules/qtxmlpatterns-opensource-src-5.5.1.tar.xz";
+      sha256 = "1v78s0jygg83yzyldwms8zb72cwp718cc5ialc2ki3lqa81fndxm";
+      name = "qtxmlpatterns-opensource-src-5.5.1.tar.xz";
     };
   };
 }
diff --git a/pkgs/development/libraries/qt-5/5.6/default.nix b/pkgs/development/libraries/qt-5/5.6/default.nix
index 5276bcb73dc..1f03b138f25 100644
--- a/pkgs/development/libraries/qt-5/5.6/default.nix
+++ b/pkgs/development/libraries/qt-5/5.6/default.nix
@@ -95,6 +95,7 @@ let
       /* qtwayland = not packaged */
       qtwebchannel = callPackage ./qtwebchannel.nix {};
       qtwebengine = callPackage ./qtwebengine.nix {};
+      qtwebkit = callPackage ./qtwebkit {};
       qtwebsockets = callPackage ./qtwebsockets.nix {};
       /* qtwinextras = not packaged */
       qtx11extras = callPackage ./qtx11extras.nix {};
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.6/qtbase/default.nix
index 82b54ebd3a1..6c52b29b35e 100644
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/default.nix
+++ b/pkgs/development/libraries/qt-5/5.6/qtbase/default.nix
@@ -107,7 +107,7 @@ stdenv.mkDerivation {
     -rpath
     -optimized-qmake
     -strip
-    -reduce-relocations
+    -no-reduce-relocations
     -system-proxies
     -pkg-config
 
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/setup-hook.sh b/pkgs/development/libraries/qt-5/5.6/qtbase/setup-hook.sh
index 6d8989281eb..30491983114 100644
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/setup-hook.sh
+++ b/pkgs/development/libraries/qt-5/5.6/qtbase/setup-hook.sh
@@ -61,11 +61,6 @@ _qtMultioutDevs() {
 
 preFixupHooks+=(_qtMultioutDevs)
 
-if [[ -z "$NIX_QT_PIC" ]]; then
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE${NIX_CFLAGS_COMPILE:+ }-fPIC"
-    export NIX_QT_PIC=1
-fi
-
 _qtSetCMakePrefix() {
     export CMAKE_PREFIX_PATH="$NIX_QT5_TMP${CMAKE_PREFIX_PATH:+:}${CMAKE_PREFIX_PATH}"
 }
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebkit/0001-dlopen-webkit-nsplugin.patch b/pkgs/development/libraries/qt-5/5.6/qtwebkit/0001-dlopen-webkit-nsplugin.patch
new file mode 100644
index 00000000000..0eeacce1bc0
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.6/qtwebkit/0001-dlopen-webkit-nsplugin.patch
@@ -0,0 +1,53 @@
+From 862ce7d357a3ec32683ac6ec7c0ebdc9346b44ba Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@gmail.com>
+Date: Sun, 23 Aug 2015 09:18:54 -0500
+Subject: [PATCH 1/3] dlopen webkit nsplugin
+
+---
+ Source/WebCore/plugins/qt/PluginPackageQt.cpp                        | 2 +-
+ Source/WebCore/plugins/qt/PluginViewQt.cpp                           | 2 +-
+ Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Source/WebCore/plugins/qt/PluginPackageQt.cpp b/Source/WebCore/plugins/qt/PluginPackageQt.cpp
+index a923d49..2731d05 100644
+--- a/Source/WebCore/plugins/qt/PluginPackageQt.cpp
++++ b/Source/WebCore/plugins/qt/PluginPackageQt.cpp
+@@ -136,7 +136,7 @@ static void initializeGtk(QLibrary* module = 0)
+         }
+     }
+ 
+-    QLibrary library(QLatin1String("libgtk-x11-2.0"), 0);
++    QLibrary library(QLatin1String("@gtk@/lib/libgtk-x11-2.0"), 0);
+     if (library.load()) {
+         typedef void *(*gtk_init_check_ptr)(int*, char***);
+         gtk_init_check_ptr gtkInitCheck = (gtk_init_check_ptr)library.resolve("gtk_init_check");
+diff --git a/Source/WebCore/plugins/qt/PluginViewQt.cpp b/Source/WebCore/plugins/qt/PluginViewQt.cpp
+index de06a2f..363bde5 100644
+--- a/Source/WebCore/plugins/qt/PluginViewQt.cpp
++++ b/Source/WebCore/plugins/qt/PluginViewQt.cpp
+@@ -697,7 +697,7 @@ static Display *getPluginDisplay()
+     // support gdk based plugins (like flash) that use a different X connection.
+     // The code below has the same effect as this one:
+     // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default());
+-    QLibrary library(QLatin1String("libgdk-x11-2.0"), 0);
++    QLibrary library(QLatin1String("@gdk_pixbuf@/lib/libgdk-x11-2.0"), 0);
+     if (!library.load())
+         return 0;
+ 
+diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
+index d734ff6..62a2197 100644
+--- a/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
++++ b/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
+@@ -64,7 +64,7 @@ static Display* getPluginDisplay()
+     // The code below has the same effect as this one:
+     // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default());
+ 
+-    QLibrary library(QLatin1String("libgdk-x11-2.0"), 0);
++    QLibrary library(QLatin1String("@gdk_pixbuf@/libgdk-x11-2.0"), 0);
+     if (!library.load())
+         return 0;
+ 
+-- 
+2.5.0
+
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebkit/0002-dlopen-webkit-gtk.patch b/pkgs/development/libraries/qt-5/5.6/qtwebkit/0002-dlopen-webkit-gtk.patch
new file mode 100644
index 00000000000..bb5d1f74364
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.6/qtwebkit/0002-dlopen-webkit-gtk.patch
@@ -0,0 +1,25 @@
+From 6a407d30357c2551abceac75c82f4a1688e47437 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@gmail.com>
+Date: Sun, 23 Aug 2015 09:19:16 -0500
+Subject: [PATCH 2/3] dlopen webkit gtk
+
+---
+ Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp b/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
+index 8de6521..0b25748 100644
+--- a/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
++++ b/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
+@@ -53,7 +53,7 @@ static void messageHandler(QtMsgType type, const QMessageLogContext&, const QStr
+ 
+ static bool initializeGtk()
+ {
+-    QLibrary gtkLibrary(QLatin1String("libgtk-x11-2.0"), 0);
++    QLibrary gtkLibrary(QLatin1String("@gtk@/lib/libgtk-x11-2.0"), 0);
+     if (!gtkLibrary.load())
+         return false;
+     typedef void* (*gtk_init_ptr)(void*, void*);
+-- 
+2.5.0
+
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebkit/0003-dlopen-webkit-udev.patch b/pkgs/development/libraries/qt-5/5.6/qtwebkit/0003-dlopen-webkit-udev.patch
new file mode 100644
index 00000000000..1c360cd81aa
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.6/qtwebkit/0003-dlopen-webkit-udev.patch
@@ -0,0 +1,31 @@
+From 864020dd47c3b6d532d9f26b82185904cf9324f2 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@gmail.com>
+Date: Sun, 23 Aug 2015 09:19:29 -0500
+Subject: [PATCH 3/3] dlopen webkit udev
+
+---
+ Source/WebCore/platform/qt/GamepadsQt.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Source/WebCore/platform/qt/GamepadsQt.cpp b/Source/WebCore/platform/qt/GamepadsQt.cpp
+index 60ff317..da8ac69 100644
+--- a/Source/WebCore/platform/qt/GamepadsQt.cpp
++++ b/Source/WebCore/platform/qt/GamepadsQt.cpp
+@@ -111,12 +111,12 @@ private:
+     bool load()
+     {
+         m_libUdev.setLoadHints(QLibrary::ResolveAllSymbolsHint);
+-        m_libUdev.setFileNameAndVersion(QStringLiteral("udev"), 1);
++        m_libUdev.setFileNameAndVersion(QStringLiteral("@libudev@/lib/libudev"), 1);
+         m_loaded = m_libUdev.load();
+         if (resolveMethods())
+             return true;
+ 
+-        m_libUdev.setFileNameAndVersion(QStringLiteral("udev"), 0);
++        m_libUdev.setFileNameAndVersion(QStringLiteral("@libudev@/lib/libudev"), 0);
+         m_loaded = m_libUdev.load();
+         return resolveMethods();
+     }
+-- 
+2.5.0
+
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebkit/default.nix b/pkgs/development/libraries/qt-5/5.6/qtwebkit/default.nix
new file mode 100644
index 00000000000..a7953eb5901
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.6/qtwebkit/default.nix
@@ -0,0 +1,35 @@
+{ qtSubmodule, stdenv, qtdeclarative, qtlocation, qtsensors
+, fontconfig, gdk_pixbuf, gtk, libwebp, libxml2, libxslt
+, sqlite, libudev, glib, gst_all_1
+, bison2, flex, gdb, gperf, perl, pkgconfig, python, ruby
+, substituteAll
+, flashplayerFix ? false
+}:
+
+with stdenv.lib;
+
+qtSubmodule {
+  name = "qtwebkit";
+  qtInputs = [ qtdeclarative qtlocation qtsensors ];
+  buildInputs = [ fontconfig libwebp libxml2 libxslt sqlite glib gst_all_1.gstreamer gst_all_1.gst-plugins-base ];
+  nativeBuildInputs = [
+    bison2 flex gdb gperf perl pkgconfig python ruby
+  ];
+  patches =
+    let dlopen-webkit-nsplugin = substituteAll {
+          src = ./0001-dlopen-webkit-nsplugin.patch;
+          gtk = gtk.out;
+          gdk_pixbuf = gdk_pixbuf.out;
+        };
+        dlopen-webkit-gtk = substituteAll {
+          src = ./0002-dlopen-webkit-gtk.patch;
+          gtk = gtk.out;
+        };
+        dlopen-webkit-udev = substituteAll {
+          src = ./0003-dlopen-webkit-udev.patch;
+          libudev = libudev.out;
+        };
+    in optionals flashplayerFix [ dlopen-webkit-nsplugin dlopen-webkit-gtk ]
+    ++ [ dlopen-webkit-udev ];
+  meta.maintainers = with stdenv.lib.maintainers; [ abbradar ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.6/srcs.nix b/pkgs/development/libraries/qt-5/5.6/srcs.nix
index 42b688e6e8d..c6deca1150d 100644
--- a/pkgs/development/libraries/qt-5/5.6/srcs.nix
+++ b/pkgs/development/libraries/qt-5/5.6/srcs.nix
@@ -1,125 +1,133 @@
-# DO NOT EDIT! This file is generated automatically by fetchsrcs.sh
+# DO NOT EDIT! This file is generated automatically by manifest.sh
 { fetchurl, mirror }:
 
 {
-  qtxmlpatterns = {
-    version = "5.6.1-1";
+  qtwebkit = {
+    version = "5.6.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtxmlpatterns-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "1966rrk7f6c55k57j33rffdjs77kk4mawrnnl8yv1ckcirxc3np1";
-      name = "qtxmlpatterns-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/community_releases/5.6/5.6.1/qtwebkit-opensource-src-5.6.1.tar.xz";
+      sha256 = "1akjqvjavl0vn8a8hnmvqc26mf4ljvwjdm07x6dmmdnjzajvzkzm";
+      name = "qtwebkit-opensource-src-5.6.1.tar.xz";
     };
   };
-  qtx11extras = {
+  qt3d = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtx11extras-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "0yj5yg2dqkrwbgbicmk2rpqsagmi8dsffkrprpsj0fmkx4awhv5y";
-      name = "qtx11extras-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qt3d-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "1nxpcjsarcp40m4y18kyy9a5md56wnafll03j8c6q19rba9bcwbf";
+      name = "qt3d-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtwinextras = {
+  qtactiveqt = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtwinextras-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "03zkwqrix2nfqkwfn8lsrpgahzx1hv6p1qbvhkqymzakkzjjncgg";
-      name = "qtwinextras-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtactiveqt-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "00bj9c0x3ax34gpibaap3wpchkv4wapsydiz01fb0xzs1fy94nbf";
+      name = "qtactiveqt-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtwebview = {
+  qtandroidextras = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtwebview-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "19954snfw073flxn0qk5ayxyzk5x6hwhpg4kn4nrl1zygsw3y49l";
-      name = "qtwebview-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtandroidextras-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "0xhm4053y9hqnz5y3y4rwycniq0mb1al1rds3jx636211y039xhk";
+      name = "qtandroidextras-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtwebsockets = {
+  qtbase = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtwebsockets-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "1fz0x8570zxc00a22skd848svma3p2g3xyxj14jq10559jihqqil";
-      name = "qtwebsockets-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtbase-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "0fbwprlhqmdyhh2wb9122fcpq7pbil530iak482b9sy5gqs7i5ij";
+      name = "qtbase-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtwebengine = {
+  qtcanvas3d = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtwebengine-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "0k708a34zwkj6hwx3vv5kdvnv3lfgb0iad44zaim5gdpgcir03n8";
-      name = "qtwebengine-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtcanvas3d-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "13127xws6xfkkk1x617bgdzl96l66nd0v82dibdnxnpfa702rl44";
+      name = "qtcanvas3d-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtwebchannel = {
+  qtconnectivity = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtwebchannel-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "10kys3ppjkj60fs1s335fdcpdsbxsjn6ibvm6zph9gqbncabd2l7";
-      name = "qtwebchannel-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtconnectivity-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "0sr6sxp0q45pacs25knr28139xdrphcjgrwlksdhdpsryfw19mzi";
+      name = "qtconnectivity-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtwayland = {
+  qtdeclarative = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtwayland-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "1fnvgpi49ilds3ah9iizxj9qhhb5rnwqd9h03bhkwf0ydywv52c4";
-      name = "qtwayland-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtdeclarative-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "094gx5mzqzcga97y7ihf052b6i5iv512lh7m0702m5q94nsn1pqw";
+      name = "qtdeclarative-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qttranslations = {
+  qtdeclarative-render2d = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qttranslations-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "03sdzci4pgq6lmxwn25v8x0z5x8g7zgpq2as56dqgj7vp6cvhn8m";
-      name = "qttranslations-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtdeclarative-render2d-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "0kqmb3792rg9fx12m64x87ahcrh0g9krg77mv0ssx3g4gvsgcibc";
+      name = "qtdeclarative-render2d-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qttools = {
+  qtdoc = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qttools-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "0haic027a2d7p7k8xz83fbvci4a4dln34360rlwgy7hlyy5m4nip";
-      name = "qttools-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtdoc-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "1yf3g3h72ndrp88h8g21mzgqdz2ixwkvpav03i3jnrgy2pf7nssp";
+      name = "qtdoc-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtsvg = {
+  qtenginio = {
+    version = "1.6.1";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtenginio-opensource-src-1.6.1.tar.xz";
+      sha256 = "17hsrhzy9zdvpbzja45aac6jr7jzzjl206vma96b9w73rbgxa50f";
+      name = "qtenginio-opensource-src-1.6.1.tar.xz";
+    };
+  };
+  qtgraphicaleffects = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtsvg-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "1w0jvhgaiddafcms2nv8wl1klg07lncmjwm1zhdw3l6rxi9071sw";
-      name = "qtsvg-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtgraphicaleffects-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "0560800fa9sd6dw1vk0ia9vq8ywdrwch2cpsi1vmh4iyxgwfr71b";
+      name = "qtgraphicaleffects-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtserialport = {
+  qtimageformats = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtserialport-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "135cbgghxk0c6dblmyyrw6znfb9m8sac9hhyc2dm6vq7vzy8id52";
-      name = "qtserialport-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtimageformats-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "1p98acvsm3azka2by1ph4gdb31qbnndrr5k5wns4xk2d760y8ifc";
+      name = "qtimageformats-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtserialbus = {
+  qtlocation = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtserialbus-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "0li4g70s5vfb517ag0d6405ymsknvvny1c8x66w7qs8a8mnk1jq5";
-      name = "qtserialbus-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtlocation-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "0my4pbcxa58yzvdh65l5qx99ln03chjr5c3ml5v37wfk7nx23k69";
+      name = "qtlocation-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtsensors = {
+  qtmacextras = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtsensors-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "0kcrvf6vzn6g2v2m70f9r3raalzmfp48rwjlqhss3w84jfz3y04r";
-      name = "qtsensors-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtmacextras-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "07j26d5g7av4c6alggg5hssqpvdh555zmn1cpr8xrhx1hpbdnaas";
+      name = "qtmacextras-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtscript = {
+  qtmultimedia = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtscript-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "1gini9483flqa9q4a4bl81bh7g5s408bycqykqhgbklmfd29y5lx";
-      name = "qtscript-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtmultimedia-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "0paffx0614ivjbf87lr9klpbqik6r1pzbc14l41np6d9jv3dqa2f";
+      name = "qtmultimedia-opensource-src-5.6.1-1.tar.xz";
     };
   };
   qtquickcontrols2 = {
@@ -138,124 +146,124 @@
       name = "qtquickcontrols-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtmultimedia = {
+  qtscript = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtmultimedia-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "0paffx0614ivjbf87lr9klpbqik6r1pzbc14l41np6d9jv3dqa2f";
-      name = "qtmultimedia-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtscript-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "1gini9483flqa9q4a4bl81bh7g5s408bycqykqhgbklmfd29y5lx";
+      name = "qtscript-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtmacextras = {
+  qtsensors = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtmacextras-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "07j26d5g7av4c6alggg5hssqpvdh555zmn1cpr8xrhx1hpbdnaas";
-      name = "qtmacextras-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtsensors-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "0kcrvf6vzn6g2v2m70f9r3raalzmfp48rwjlqhss3w84jfz3y04r";
+      name = "qtsensors-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtlocation = {
+  qtserialbus = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtlocation-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "0my4pbcxa58yzvdh65l5qx99ln03chjr5c3ml5v37wfk7nx23k69";
-      name = "qtlocation-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtserialbus-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "0li4g70s5vfb517ag0d6405ymsknvvny1c8x66w7qs8a8mnk1jq5";
+      name = "qtserialbus-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtimageformats = {
+  qtserialport = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtimageformats-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "1p98acvsm3azka2by1ph4gdb31qbnndrr5k5wns4xk2d760y8ifc";
-      name = "qtimageformats-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtserialport-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "135cbgghxk0c6dblmyyrw6znfb9m8sac9hhyc2dm6vq7vzy8id52";
+      name = "qtserialport-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtgraphicaleffects = {
+  qtsvg = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtgraphicaleffects-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "0560800fa9sd6dw1vk0ia9vq8ywdrwch2cpsi1vmh4iyxgwfr71b";
-      name = "qtgraphicaleffects-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtsvg-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "1w0jvhgaiddafcms2nv8wl1klg07lncmjwm1zhdw3l6rxi9071sw";
+      name = "qtsvg-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtenginio = {
-    version = "1.6.1";
+  qttools = {
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtenginio-opensource-src-1.6.1.tar.xz";
-      sha256 = "17hsrhzy9zdvpbzja45aac6jr7jzzjl206vma96b9w73rbgxa50f";
-      name = "qtenginio-opensource-src-1.6.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qttools-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "0haic027a2d7p7k8xz83fbvci4a4dln34360rlwgy7hlyy5m4nip";
+      name = "qttools-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtdoc = {
+  qttranslations = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtdoc-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "1yf3g3h72ndrp88h8g21mzgqdz2ixwkvpav03i3jnrgy2pf7nssp";
-      name = "qtdoc-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qttranslations-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "03sdzci4pgq6lmxwn25v8x0z5x8g7zgpq2as56dqgj7vp6cvhn8m";
+      name = "qttranslations-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtdeclarative-render2d = {
+  qtwayland = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtdeclarative-render2d-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "0kqmb3792rg9fx12m64x87ahcrh0g9krg77mv0ssx3g4gvsgcibc";
-      name = "qtdeclarative-render2d-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtwayland-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "1fnvgpi49ilds3ah9iizxj9qhhb5rnwqd9h03bhkwf0ydywv52c4";
+      name = "qtwayland-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtdeclarative = {
+  qtwebchannel = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtdeclarative-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "094gx5mzqzcga97y7ihf052b6i5iv512lh7m0702m5q94nsn1pqw";
-      name = "qtdeclarative-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtwebchannel-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "10kys3ppjkj60fs1s335fdcpdsbxsjn6ibvm6zph9gqbncabd2l7";
+      name = "qtwebchannel-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtconnectivity = {
+  qtwebengine = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtconnectivity-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "0sr6sxp0q45pacs25knr28139xdrphcjgrwlksdhdpsryfw19mzi";
-      name = "qtconnectivity-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtwebengine-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "0k708a34zwkj6hwx3vv5kdvnv3lfgb0iad44zaim5gdpgcir03n8";
+      name = "qtwebengine-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtcanvas3d = {
+  qtwebsockets = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtcanvas3d-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "13127xws6xfkkk1x617bgdzl96l66nd0v82dibdnxnpfa702rl44";
-      name = "qtcanvas3d-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtwebsockets-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "1fz0x8570zxc00a22skd848svma3p2g3xyxj14jq10559jihqqil";
+      name = "qtwebsockets-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtbase = {
+  qtwebview = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtbase-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "0fbwprlhqmdyhh2wb9122fcpq7pbil530iak482b9sy5gqs7i5ij";
-      name = "qtbase-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtwebview-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "19954snfw073flxn0qk5ayxyzk5x6hwhpg4kn4nrl1zygsw3y49l";
+      name = "qtwebview-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtandroidextras = {
+  qtwinextras = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtandroidextras-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "0xhm4053y9hqnz5y3y4rwycniq0mb1al1rds3jx636211y039xhk";
-      name = "qtandroidextras-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtwinextras-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "03zkwqrix2nfqkwfn8lsrpgahzx1hv6p1qbvhkqymzakkzjjncgg";
+      name = "qtwinextras-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qtactiveqt = {
+  qtx11extras = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtactiveqt-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "00bj9c0x3ax34gpibaap3wpchkv4wapsydiz01fb0xzs1fy94nbf";
-      name = "qtactiveqt-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtx11extras-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "0yj5yg2dqkrwbgbicmk2rpqsagmi8dsffkrprpsj0fmkx4awhv5y";
+      name = "qtx11extras-opensource-src-5.6.1-1.tar.xz";
     };
   };
-  qt3d = {
+  qtxmlpatterns = {
     version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qt3d-opensource-src-5.6.1-1.tar.xz";
-      sha256 = "1nxpcjsarcp40m4y18kyy9a5md56wnafll03j8c6q19rba9bcwbf";
-      name = "qt3d-opensource-src-5.6.1-1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtxmlpatterns-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "1966rrk7f6c55k57j33rffdjs77kk4mawrnnl8yv1ckcirxc3np1";
+      name = "qtxmlpatterns-opensource-src-5.6.1-1.tar.xz";
     };
   };
 }
diff --git a/pkgs/development/libraries/qt-5/5.7/default.nix b/pkgs/development/libraries/qt-5/5.7/default.nix
index a84a429695c..aa2cbb92169 100644
--- a/pkgs/development/libraries/qt-5/5.7/default.nix
+++ b/pkgs/development/libraries/qt-5/5.7/default.nix
@@ -90,6 +90,7 @@ let
       qttranslations = callPackage ./qttranslations.nix {};
       qtwebchannel = callPackage ./qtwebchannel.nix {};
       qtwebengine = callPackage ./qtwebengine.nix {};
+      qtwebkit = callPackage ./qtwebkit {};
       qtwebsockets = callPackage ./qtwebsockets.nix {};
       qtx11extras = callPackage ./qtx11extras.nix {};
       qtxmlpatterns = callPackage ./qtxmlpatterns.nix {};
diff --git a/pkgs/development/libraries/qt-5/5.7/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.7/qtbase/default.nix
index 94ddb21f3b6..f9d56612375 100644
--- a/pkgs/development/libraries/qt-5/5.7/qtbase/default.nix
+++ b/pkgs/development/libraries/qt-5/5.7/qtbase/default.nix
@@ -106,7 +106,7 @@ stdenv.mkDerivation {
     -rpath
     -optimized-qmake
     -strip
-    -reduce-relocations
+    -no-reduce-relocations
     -system-proxies
     -pkg-config
 
diff --git a/pkgs/development/libraries/qt-5/5.7/qtbase/setup-hook.sh b/pkgs/development/libraries/qt-5/5.7/qtbase/setup-hook.sh
index 6d8989281eb..30491983114 100644
--- a/pkgs/development/libraries/qt-5/5.7/qtbase/setup-hook.sh
+++ b/pkgs/development/libraries/qt-5/5.7/qtbase/setup-hook.sh
@@ -61,11 +61,6 @@ _qtMultioutDevs() {
 
 preFixupHooks+=(_qtMultioutDevs)
 
-if [[ -z "$NIX_QT_PIC" ]]; then
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE${NIX_CFLAGS_COMPILE:+ }-fPIC"
-    export NIX_QT_PIC=1
-fi
-
 _qtSetCMakePrefix() {
     export CMAKE_PREFIX_PATH="$NIX_QT5_TMP${CMAKE_PREFIX_PATH:+:}${CMAKE_PREFIX_PATH}"
 }
diff --git a/pkgs/development/libraries/qt-5/5.7/qtwebkit/0001-dlopen-webkit-nsplugin.patch b/pkgs/development/libraries/qt-5/5.7/qtwebkit/0001-dlopen-webkit-nsplugin.patch
new file mode 100644
index 00000000000..0eeacce1bc0
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.7/qtwebkit/0001-dlopen-webkit-nsplugin.patch
@@ -0,0 +1,53 @@
+From 862ce7d357a3ec32683ac6ec7c0ebdc9346b44ba Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@gmail.com>
+Date: Sun, 23 Aug 2015 09:18:54 -0500
+Subject: [PATCH 1/3] dlopen webkit nsplugin
+
+---
+ Source/WebCore/plugins/qt/PluginPackageQt.cpp                        | 2 +-
+ Source/WebCore/plugins/qt/PluginViewQt.cpp                           | 2 +-
+ Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Source/WebCore/plugins/qt/PluginPackageQt.cpp b/Source/WebCore/plugins/qt/PluginPackageQt.cpp
+index a923d49..2731d05 100644
+--- a/Source/WebCore/plugins/qt/PluginPackageQt.cpp
++++ b/Source/WebCore/plugins/qt/PluginPackageQt.cpp
+@@ -136,7 +136,7 @@ static void initializeGtk(QLibrary* module = 0)
+         }
+     }
+ 
+-    QLibrary library(QLatin1String("libgtk-x11-2.0"), 0);
++    QLibrary library(QLatin1String("@gtk@/lib/libgtk-x11-2.0"), 0);
+     if (library.load()) {
+         typedef void *(*gtk_init_check_ptr)(int*, char***);
+         gtk_init_check_ptr gtkInitCheck = (gtk_init_check_ptr)library.resolve("gtk_init_check");
+diff --git a/Source/WebCore/plugins/qt/PluginViewQt.cpp b/Source/WebCore/plugins/qt/PluginViewQt.cpp
+index de06a2f..363bde5 100644
+--- a/Source/WebCore/plugins/qt/PluginViewQt.cpp
++++ b/Source/WebCore/plugins/qt/PluginViewQt.cpp
+@@ -697,7 +697,7 @@ static Display *getPluginDisplay()
+     // support gdk based plugins (like flash) that use a different X connection.
+     // The code below has the same effect as this one:
+     // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default());
+-    QLibrary library(QLatin1String("libgdk-x11-2.0"), 0);
++    QLibrary library(QLatin1String("@gdk_pixbuf@/lib/libgdk-x11-2.0"), 0);
+     if (!library.load())
+         return 0;
+ 
+diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
+index d734ff6..62a2197 100644
+--- a/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
++++ b/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
+@@ -64,7 +64,7 @@ static Display* getPluginDisplay()
+     // The code below has the same effect as this one:
+     // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default());
+ 
+-    QLibrary library(QLatin1String("libgdk-x11-2.0"), 0);
++    QLibrary library(QLatin1String("@gdk_pixbuf@/libgdk-x11-2.0"), 0);
+     if (!library.load())
+         return 0;
+ 
+-- 
+2.5.0
+
diff --git a/pkgs/development/libraries/qt-5/5.7/qtwebkit/0002-dlopen-webkit-gtk.patch b/pkgs/development/libraries/qt-5/5.7/qtwebkit/0002-dlopen-webkit-gtk.patch
new file mode 100644
index 00000000000..bb5d1f74364
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.7/qtwebkit/0002-dlopen-webkit-gtk.patch
@@ -0,0 +1,25 @@
+From 6a407d30357c2551abceac75c82f4a1688e47437 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@gmail.com>
+Date: Sun, 23 Aug 2015 09:19:16 -0500
+Subject: [PATCH 2/3] dlopen webkit gtk
+
+---
+ Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp b/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
+index 8de6521..0b25748 100644
+--- a/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
++++ b/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
+@@ -53,7 +53,7 @@ static void messageHandler(QtMsgType type, const QMessageLogContext&, const QStr
+ 
+ static bool initializeGtk()
+ {
+-    QLibrary gtkLibrary(QLatin1String("libgtk-x11-2.0"), 0);
++    QLibrary gtkLibrary(QLatin1String("@gtk@/lib/libgtk-x11-2.0"), 0);
+     if (!gtkLibrary.load())
+         return false;
+     typedef void* (*gtk_init_ptr)(void*, void*);
+-- 
+2.5.0
+
diff --git a/pkgs/development/libraries/qt-5/5.7/qtwebkit/0003-dlopen-webkit-udev.patch b/pkgs/development/libraries/qt-5/5.7/qtwebkit/0003-dlopen-webkit-udev.patch
new file mode 100644
index 00000000000..1c360cd81aa
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.7/qtwebkit/0003-dlopen-webkit-udev.patch
@@ -0,0 +1,31 @@
+From 864020dd47c3b6d532d9f26b82185904cf9324f2 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@gmail.com>
+Date: Sun, 23 Aug 2015 09:19:29 -0500
+Subject: [PATCH 3/3] dlopen webkit udev
+
+---
+ Source/WebCore/platform/qt/GamepadsQt.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Source/WebCore/platform/qt/GamepadsQt.cpp b/Source/WebCore/platform/qt/GamepadsQt.cpp
+index 60ff317..da8ac69 100644
+--- a/Source/WebCore/platform/qt/GamepadsQt.cpp
++++ b/Source/WebCore/platform/qt/GamepadsQt.cpp
+@@ -111,12 +111,12 @@ private:
+     bool load()
+     {
+         m_libUdev.setLoadHints(QLibrary::ResolveAllSymbolsHint);
+-        m_libUdev.setFileNameAndVersion(QStringLiteral("udev"), 1);
++        m_libUdev.setFileNameAndVersion(QStringLiteral("@libudev@/lib/libudev"), 1);
+         m_loaded = m_libUdev.load();
+         if (resolveMethods())
+             return true;
+ 
+-        m_libUdev.setFileNameAndVersion(QStringLiteral("udev"), 0);
++        m_libUdev.setFileNameAndVersion(QStringLiteral("@libudev@/lib/libudev"), 0);
+         m_loaded = m_libUdev.load();
+         return resolveMethods();
+     }
+-- 
+2.5.0
+
diff --git a/pkgs/development/libraries/qt-5/5.7/qtwebkit/default.nix b/pkgs/development/libraries/qt-5/5.7/qtwebkit/default.nix
new file mode 100644
index 00000000000..a7953eb5901
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.7/qtwebkit/default.nix
@@ -0,0 +1,35 @@
+{ qtSubmodule, stdenv, qtdeclarative, qtlocation, qtsensors
+, fontconfig, gdk_pixbuf, gtk, libwebp, libxml2, libxslt
+, sqlite, libudev, glib, gst_all_1
+, bison2, flex, gdb, gperf, perl, pkgconfig, python, ruby
+, substituteAll
+, flashplayerFix ? false
+}:
+
+with stdenv.lib;
+
+qtSubmodule {
+  name = "qtwebkit";
+  qtInputs = [ qtdeclarative qtlocation qtsensors ];
+  buildInputs = [ fontconfig libwebp libxml2 libxslt sqlite glib gst_all_1.gstreamer gst_all_1.gst-plugins-base ];
+  nativeBuildInputs = [
+    bison2 flex gdb gperf perl pkgconfig python ruby
+  ];
+  patches =
+    let dlopen-webkit-nsplugin = substituteAll {
+          src = ./0001-dlopen-webkit-nsplugin.patch;
+          gtk = gtk.out;
+          gdk_pixbuf = gdk_pixbuf.out;
+        };
+        dlopen-webkit-gtk = substituteAll {
+          src = ./0002-dlopen-webkit-gtk.patch;
+          gtk = gtk.out;
+        };
+        dlopen-webkit-udev = substituteAll {
+          src = ./0003-dlopen-webkit-udev.patch;
+          libudev = libudev.out;
+        };
+    in optionals flashplayerFix [ dlopen-webkit-nsplugin dlopen-webkit-gtk ]
+    ++ [ dlopen-webkit-udev ];
+  meta.maintainers = with stdenv.lib.maintainers; [ abbradar ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.7/srcs.nix b/pkgs/development/libraries/qt-5/5.7/srcs.nix
index 38334fa77f1..e7710ce82d6 100644
--- a/pkgs/development/libraries/qt-5/5.7/srcs.nix
+++ b/pkgs/development/libraries/qt-5/5.7/srcs.nix
@@ -2,6 +2,14 @@
 { fetchurl, mirror }:
 
 {
+  qtwebkit = {
+    version = "5.7.0";
+    src = fetchurl {
+      url = "${mirror}/community_releases/5.7/5.7.0/qtwebkit-opensource-src-5.7.0.tar.xz";
+      sha256 = "1prlpl3zslzpr1iv7m3irvxjxn3v8nlxh21v9k2kaq4fpwy2b8y7";
+      name = "qtwebkit-opensource-src-5.7.0.tar.xz";
+    };
+  };
   qt3d = {
     version = "5.7.0";
     src = fetchurl {
@@ -146,14 +154,6 @@
       name = "qtpurchasing-opensource-src-5.7.0.tar.xz";
     };
   };
-  qtquickcontrols = {
-    version = "5.7.0";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.7/5.7.0/submodules/qtquickcontrols-opensource-src-5.7.0.tar.xz";
-      sha256 = "0cpcrmz9n5b4bgmshmk093lirl9xwqb23inchnai1zqg21vrmqfq";
-      name = "qtquickcontrols-opensource-src-5.7.0.tar.xz";
-    };
-  };
   qtquickcontrols2 = {
     version = "5.7.0";
     src = fetchurl {
@@ -162,6 +162,14 @@
       name = "qtquickcontrols2-opensource-src-5.7.0.tar.xz";
     };
   };
+  qtquickcontrols = {
+    version = "5.7.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.7/5.7.0/submodules/qtquickcontrols-opensource-src-5.7.0.tar.xz";
+      sha256 = "0cpcrmz9n5b4bgmshmk093lirl9xwqb23inchnai1zqg21vrmqfq";
+      name = "qtquickcontrols-opensource-src-5.7.0.tar.xz";
+    };
+  };
   qtscript = {
     version = "5.7.0";
     src = fetchurl {
diff --git a/pkgs/development/libraries/qtwebkit-plugins/default.nix b/pkgs/development/libraries/qtwebkit-plugins/default.nix
new file mode 100644
index 00000000000..fbb2ffdd83b
--- /dev/null
+++ b/pkgs/development/libraries/qtwebkit-plugins/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchFromGitHub, qmakeHook, qtwebkit, hunspell }:
+
+stdenv.mkDerivation {
+  name = "qtwebkit-plugins-2015-05-09";
+
+  src = fetchFromGitHub {
+    owner = "QupZilla";
+    repo = "qtwebkit-plugins";
+    rev = "4e2e0402abd847346bec704be5305ba849eb754b";
+    sha256 = "0xyq25l56jgdxgqqv0380brhw9gg0hin5hyrf1j6d3c8k1gka20m";
+  };
+
+  nativeBuildInputs = [ qmakeHook ];
+
+  buildInputs = [ qtwebkit hunspell ];
+
+  postPatch = ''
+    sed -i "s,-lhunspell,-lhunspell-1.3," src/spellcheck/spellcheck.pri
+    sed -i "s,\$\$\[QT_INSTALL_PLUGINS\],$out/lib/qt5/plugins," src/src.pro
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Spell checking plugin using Hunspell and HTML5 Notifications plugin for QtWebKit";
+    homepage = "https://github.com/QupZilla/qtwebkit-plugins";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/pkgs/development/libraries/science/math/clblas/cuda/default.nix b/pkgs/development/libraries/science/math/clblas/cuda/default.nix
index 8691009acae..c142514b262 100644
--- a/pkgs/development/libraries/science/math/clblas/cuda/default.nix
+++ b/pkgs/development/libraries/science/math/clblas/cuda/default.nix
@@ -26,8 +26,8 @@ stdenv.mkDerivation rec {
     sed -i -re 's/(set\(\s*Boost_USE_STATIC_LIBS\s+).*/\1OFF\ \)/g' src/CMakeLists.txt
   '';
 
-  configurePhase = ''    
-    findInputs ${boost} boost_dirs propagated-native-build-inputs
+  configurePhase = ''
+    findInputs ${boost.dev} boost_dirs propagated-native-build-inputs
 
     export BOOST_INCLUDEDIR=$(echo $boost_dirs | sed -e s/\ /\\n/g - | grep '\-dev')/include
     export BOOST_LIBRARYDIR=$(echo $boost_dirs | sed -e s/\ /\\n/g - | grep -v '\-dev')/lib
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
     mkdir -p Build
     pushd Build
 
-    export LD_LIBRARY_PATH="${blas}/lib:${nvidia_x11}/lib"
+    export LD_LIBRARY_PATH="${stdenv.lib.makeLibraryPath [ blas nvidia_x11 ]}"
 
     cmake ../src -DCMAKE_INSTALL_PREFIX=$out \
                  -DCMAKE_BUILD_TYPE=Release \
diff --git a/pkgs/development/libraries/science/math/ipopt/default.nix b/pkgs/development/libraries/science/math/ipopt/default.nix
index f9897e4add3..9ea3a54f2b0 100644
--- a/pkgs/development/libraries/science/math/ipopt/default.nix
+++ b/pkgs/development/libraries/science/math/ipopt/default.nix
@@ -1,17 +1,15 @@
 { stdenv, fetchurl, unzip, openblas, gfortran }:
 
 stdenv.mkDerivation rec {
-  version = "3.12.4";
+  version = "3.12.6";
   name = "ipopt-${version}";
 
   src = fetchurl {
     url = "http://www.coin-or.org/download/source/Ipopt/Ipopt-${version}.zip";
-    sha256 = "0hxmpi3zx5zgv2ijscdvc40xf88hx5if0d9sgch155z70g15wx0l";
+    sha256 = "0lx09h1757s5jppwnxwblcjk0biqjxy7yaf3z4vfqbl4rl93avs0";
   };
 
-  preConfigure = ''
-     export CXXDEFS="-DHAVE_RAND -DHAVE_CSTRING -DHAVE_CSTDIO"
-  '';
+  CXXDEFS = [ "-DHAVE_RAND" "-DHAVE_CSTRING" "-DHAVE_CSTDIO" ];
 
   configureFlags = [
     "--with-blas-lib=-lopenblas"
diff --git a/pkgs/development/libraries/sqlcipher/default.nix b/pkgs/development/libraries/sqlcipher/default.nix
index bc30716e81f..c1f624f8744 100644
--- a/pkgs/development/libraries/sqlcipher/default.nix
+++ b/pkgs/development/libraries/sqlcipher/default.nix
@@ -1,25 +1,29 @@
-{ stdenv, fetchurl, openssl, tcl, readline ? null, ncurses ? null }:
+{ stdenv, lib, fetchFromGitHub, openssl, tcl, readline ? null, ncurses ? null }:
 
 assert readline != null -> ncurses != null;
 
-stdenv.mkDerivation {
-  name = "sqlcipher-3.1.0";
+stdenv.mkDerivation rec {
+  name = "sqlcipher-${version}";
+  version = "3.4.0";
 
-  src = fetchurl {
-    url = "https://github.com/sqlcipher/sqlcipher/archive/v3.1.0.tar.gz";
-    sha256 = "1h54hsl7g6ra955aaqid5wxm93fklx2pxz8abcdwf9md3bpfcn18";
+  src = fetchFromGitHub {
+    owner = "sqlcipher";
+    repo = "sqlcipher";
+    rev = "v${version}";
+    sha256 = "1lwc2m21sax3pnjfqddldbpbwr3b51s91fxz7dd7hf6ly8swnsvp";
   };
 
   buildInputs = [ readline ncurses openssl tcl ];
 
-  configureFlags = "--enable-threadsafe --disable-tcl";
+  configureFlags = [ "--enable-threadsafe" "--disable-tcl" ];
 
-  CFLAGS = "-DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_SECURE_DELETE=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -DSQLITE_HAS_CODEC";
-  LDFLAGS = if readline != null then "-lncurses" else "";
+  CFLAGS = [ "-DSQLITE_ENABLE_COLUMN_METADATA=1" "-DSQLITE_SECURE_DELETE=1" "-DSQLITE_ENABLE_UNLOCK_NOTIFY=1" "-DSQLITE_HAS_CODEC" ];
+  LDFLAGS = lib.optional (readline != null) "-lncurses";
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://sqlcipher.net/;
     description = "Full Database Encryption for SQLite";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = platforms.unix;
+    license = licenses.bsd3;
   };
 }
diff --git a/pkgs/development/libraries/talloc/default.nix b/pkgs/development/libraries/talloc/default.nix
index 2c7cbe04019..3c40ae247f6 100644
--- a/pkgs/development/libraries/talloc/default.nix
+++ b/pkgs/development/libraries/talloc/default.nix
@@ -24,6 +24,10 @@ stdenv.mkDerivation rec {
     "--builtin-libraries=replace"
   ];
 
+  postInstall = ''		
+    ar qf $out/lib/libtalloc.a bin/default/talloc_[0-9]*.o		
+  '';
+
   meta = with stdenv.lib; {
     description = "Hierarchical pool based memory allocator with destructors";
     homepage = http://tdb.samba.org/;
diff --git a/pkgs/development/libraries/telepathy/glib/default.nix b/pkgs/development/libraries/telepathy/glib/default.nix
index 69d833064ed..e9c9260d8d8 100644
--- a/pkgs/development/libraries/telepathy/glib/default.nix
+++ b/pkgs/development/libraries/telepathy/glib/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, dbus_glib, glib, python, pkgconfig, libxslt
-, gobjectIntrospection, valaSupport ? true, vala }:
+, gobjectIntrospection, valaSupport ? true, vala_0_23 }:
 
 stdenv.mkDerivation rec {
   name = "telepathy-glib-0.24.1";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [dbus_glib glib python gobjectIntrospection];
 
-  buildInputs = [pkgconfig libxslt] ++ stdenv.lib.optional valaSupport vala;
+  buildInputs = [pkgconfig libxslt] ++ stdenv.lib.optional valaSupport vala_0_23;
 
   preConfigure = ''
     substituteInPlace telepathy-glib/telepathy-glib.pc.in --replace Requires.private Requires
diff --git a/pkgs/development/libraries/telepathy/qt/default.nix b/pkgs/development/libraries/telepathy/qt/default.nix
index e3e579eefdb..6c2713c1ebe 100644
--- a/pkgs/development/libraries/telepathy/qt/default.nix
+++ b/pkgs/development/libraries/telepathy/qt/default.nix
@@ -1,7 +1,9 @@
-{ stdenv, fetchurl, cmake, qtbase, pkgconfig, python, dbus_glib, dbus_daemon
-, telepathy_farstream, telepathy_glib, pythonDBus, fetchpatch }:
+{ stdenv, fetchurl, cmake, qtbase, pkgconfig, pythonPackages, dbus_glib, dbus_daemon
+, telepathy_farstream, telepathy_glib, fetchpatch }:
 
-stdenv.mkDerivation rec {
+let
+  inherit (pythonPackages) python dbus-python;
+in stdenv.mkDerivation rec {
   name = "telepathy-qt-0.9.6.1";
 
   src = fetchurl {
@@ -30,7 +32,7 @@ stdenv.mkDerivation rec {
     ];
 
   nativeBuildInputs = [ cmake pkgconfig python ];
-  propagatedBuildInputs = [ qtbase dbus_glib telepathy_farstream telepathy_glib pythonDBus ];
+  propagatedBuildInputs = [ qtbase dbus_glib telepathy_farstream telepathy_glib dbus-python ];
 
   buildInputs = stdenv.lib.optional doCheck dbus_daemon;
 
diff --git a/pkgs/development/libraries/tntdb/default.nix b/pkgs/development/libraries/tntdb/default.nix
new file mode 100644
index 00000000000..31404e84d25
--- /dev/null
+++ b/pkgs/development/libraries/tntdb/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, cxxtools, postgresql, mysql, sqlite, zlib, openssl }:
+
+stdenv.mkDerivation rec {
+  version = "1.3";
+  name = "tntdb";
+  src = fetchurl {
+    url = "http://www.tntnet.org/download/tntdb-${version}.tar.gz";
+    sha256 = "0js79dbvkic30bzw1pf26m64vs2ssw2sbj55w1dc0sy69dlv4fh9";
+  };
+
+  buildInputs = [ cxxtools postgresql mysql sqlite zlib openssl ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = "http://www.tntnet.org/tntdb.html";
+    description = "C++ library which makes accessing SQL databases easy and robust";
+    platforms = platforms.linux ;
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.juliendehos ];
+  };
+}
diff --git a/pkgs/development/libraries/tntnet/default.nix b/pkgs/development/libraries/tntnet/default.nix
new file mode 100644
index 00000000000..93f4d43e6f6
--- /dev/null
+++ b/pkgs/development/libraries/tntnet/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, cxxtools, zlib, openssl, zip }:
+
+stdenv.mkDerivation rec {
+  version = "2.2.1";
+  name = "tntnet";
+  src = fetchurl {
+    url = "http://www.tntnet.org/download/tntnet-${version}.tar.gz";
+    sha256 = "08bmak9mpbamwwl3h9p8x5qzwqlm9g3jh70y0ml5hk7hiv870cf8";
+  };
+
+  buildInputs = [ cxxtools zlib openssl zip ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = "http://www.tntnet.org/tntnet.html";
+    description = "Web server which allows users to develop web applications using C++";
+    platforms = platforms.linux ;
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.juliendehos ];
+  };
+}
diff --git a/pkgs/development/libraries/torch/default.nix b/pkgs/development/libraries/torch/default.nix
new file mode 100644
index 00000000000..8700378ae75
--- /dev/null
+++ b/pkgs/development/libraries/torch/default.nix
@@ -0,0 +1,28 @@
+{stdenv, fetchgit, luajit, openblas, imagemagick, cmake, curl, fftw, gnuplot,
+  libjpeg_turbo, zeromq3, ncurses, openssl, libpng, qt4, readline, unzip}:
+stdenv.mkDerivation rec{
+  version = "0.0pre20160820";
+  name = "torch-${version}";
+  buildInputs = [
+    luajit openblas imagemagick cmake curl fftw gnuplot unzip qt4
+    libjpeg_turbo zeromq3 ncurses openssl libpng readline
+  ];
+  src = fetchgit (stdenv.lib.importJSON ./src.json);
+  configurePhase = ''
+  '';
+  buildPhase = ''
+    cd ..
+    export PREFIX=$out
+    mkdir "$out"
+    sh install.sh -s
+  '';
+  installPhase = ''
+  '';
+  meta = {
+    inherit version;
+    description = ''A scientific computing framework with wide support for machine learning algorithms'';
+    license = stdenv.lib.licenses.bsd3 ;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/torch/src.json b/pkgs/development/libraries/torch/src.json
new file mode 100644
index 00000000000..37c7a20ce54
--- /dev/null
+++ b/pkgs/development/libraries/torch/src.json
@@ -0,0 +1,6 @@
+{
+        "url": "https://github.com/torch/distro",
+        "rev": "8b6a834f8c8755f6f5f84ef9d8da9cfc79c5ce1f",
+        "sha256": "120hnz82d7izinsmv5smyqww71dhpix23pm43s522dfcglpql8xy",
+        "fetchSubmodules": true
+}
diff --git a/pkgs/development/libraries/vtk/default.nix b/pkgs/development/libraries/vtk/default.nix
index 59063645232..20e2213e3e7 100644
--- a/pkgs/development/libraries/vtk/default.nix
+++ b/pkgs/development/libraries/vtk/default.nix
@@ -5,24 +5,25 @@ with stdenv.lib;
 
 let
   os = stdenv.lib.optionalString;
-  majorVersion = "5.10";
-  minorVersion = "1";
+  majorVersion = "7.0";
+  minorVersion = "0";
   version = "${majorVersion}.${minorVersion}";
 in
 
 stdenv.mkDerivation rec {
   name = "vtk-${os (qtLib != null) "qvtk-"}${version}";
   src = fetchurl {
-    url = "${meta.homepage}files/release/${majorVersion}/vtk-${version}.tar.gz";
-    sha256 = "1fxxgsa7967gdphkl07lbfr6dcbq9a72z5kynlklxn7hyp0l18pi";
+    url = "${meta.homepage}files/release/${majorVersion}/VTK-${version}.tar.gz";
+    sha256 = "1hrjxkcvs3ap0bdhk90vymz5pgvxmg7q6sz8ab3wsyddbshr1abq";
   };
 
-  # https://bugzilla.redhat.com/show_bug.cgi?id=1138466
-  postPatch = "sed '/^#define GL_GLEXT_LEGACY/d' -i ./Rendering/vtkOpenGL.h";
-
   buildInputs = [ cmake mesa libX11 xproto libXt ]
     ++ optional (qtLib != null) qtLib;
 
+  preBuild = ''
+    export LD_LIBRARY_PATH="$(pwd)/lib";
+  '';
+
   # Shared libraries don't work, because of rpath troubles with the current
   # nixpkgs camke approach. It wants to call a binary at build time, just
   # built and requiring one of the shared objects.
diff --git a/pkgs/development/libraries/wt/cmake.patch b/pkgs/development/libraries/wt/cmake.patch
new file mode 100644
index 00000000000..e7b1f87411d
--- /dev/null
+++ b/pkgs/development/libraries/wt/cmake.patch
@@ -0,0 +1,10 @@
+--- a/CMakeLists.txt	2016-07-13 14:27:26.000000000 +0200
++++ b/CMakeLists.txt	2016-08-16 12:58:28.135652964 +0200
+@@ -6,6 +6,7 @@
+   CMAKE_POLICY(SET CMP0002 OLD)
+   CMAKE_POLICY(SET CMP0003 OLD)
+   CMAKE_POLICY(SET CMP0005 OLD)
++  CMAKE_POLICY(SET CMP0037 OLD)
+ ENDIF(COMMAND CMAKE_POLICY)
+ 
+ PROJECT(WT)
diff --git a/pkgs/development/libraries/wt/default.nix b/pkgs/development/libraries/wt/default.nix
new file mode 100644
index 00000000000..e25b23e84ed
--- /dev/null
+++ b/pkgs/development/libraries/wt/default.nix
@@ -0,0 +1,40 @@
+{stdenv, fetchFromGitHub, cmake, boost, pkgconfig, doxygen, qt48Full, libharu, 
+  pango, fcgi, firebird, libmysql, postgresql, graphicsmagick, glew, openssl,
+  pcre }:
+
+stdenv.mkDerivation rec {
+  name = "wt";
+  version = "3.3.6";
+
+  src = fetchFromGitHub {
+    owner = "kdeforche";
+    repo = name;
+    rev = version;
+    sha256 = "1pvykc969l9cpd0da8bgpi4gr8f6qczrbpprrxamyj1pn0ydzvq3";
+  };
+
+  enableParallelBuilding = true;
+
+  buildInputs = [ cmake boost pkgconfig doxygen qt48Full libharu 
+    pango fcgi firebird libmysql postgresql graphicsmagick glew 
+    openssl pcre ];
+
+  cmakeFlags = [
+    "-DWT_WRASTERIMAGE_IMPLEMENTATION=GraphicsMagick"
+    "-DWT_CPP_11_MODE=-std=c++11"
+    "-DGM_PREFIX=${graphicsmagick}"
+    "-DMYSQL_PREFIX=${libmysql.dev}"
+    "--no-warn-unused-cli"
+  ];
+
+  patches = [ ./cmake.patch ];  # fix a cmake warning; PR sent to upstream 
+
+  meta = with stdenv.lib; {
+    homepage = "https://www.webtoolkit.eu/wt";
+    description = "C++ library for developing web applications";
+    platforms = platforms.linux ;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.juliendehos ];
+  };
+}
+
diff --git a/pkgs/development/libraries/xgboost/default.nix b/pkgs/development/libraries/xgboost/default.nix
index 4ba366be56f..bdc21d72ac3 100644
--- a/pkgs/development/libraries/xgboost/default.nix
+++ b/pkgs/development/libraries/xgboost/default.nix
@@ -2,17 +2,15 @@
 
 stdenv.mkDerivation rec {
   name = "xgboost-${version}";
-  version = "2016-05-14";
+  version = "0.60";
 
   # needs submodules
   src = fetchgit {
     url = "https://github.com/dmlc/xgboost";
-    rev = "9c26566eb09733423f821f139938ff4105c3775d";
-    sha256 = "1d7lnbwxwakclqqfjwyk9w3wd2clkihdr6ljs5z08ydiaspri093";
+    rev = "refs/tags/v${version}";
+    sha256 = "0536vfl59n9vlagl1cpdl06c9y19dscwhwdzvi27zk5nc5qb6rdq";
   };
 
-  postPatch = "sed '1i#include <cmath>' -i src/tree/param.h";
-
   enableParallelBuilding = true;
 
   installPhase = ''
diff --git a/pkgs/development/libraries/zeitgeist/default.nix b/pkgs/development/libraries/zeitgeist/default.nix
index ced0844f3e1..879e1ccaec3 100644
--- a/pkgs/development/libraries/zeitgeist/default.nix
+++ b/pkgs/development/libraries/zeitgeist/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib, sqlite, gnome3, vala
+{ stdenv, fetchurl, pkgconfig, glib, sqlite, gnome3, vala_0_23
 , intltool, libtool, python, dbus_libs, telepathy_glib
 , gtk3, json_glib, librdf_raptor2, pythonPackages, dbus_glib }:
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   configureFlags = [ "--with-session-bus-services-dir=$(out)/share/dbus-1/services" ];
 
   buildInputs = [ pkgconfig glib sqlite gnome3.gnome_common intltool
-                  libtool python dbus_libs telepathy_glib vala dbus_glib
+                  libtool python dbus_libs telepathy_glib vala_0_23 dbus_glib
                   gtk3 json_glib librdf_raptor2 pythonPackages.rdflib ];
 
   prePatch = "patchShebangs .";