summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2016-07-15 14:41:01 +0000
committerRobin Gloster <mail@glob.in>2016-07-15 14:41:01 +0000
commit5185bc177309c62e53dad1ad346d1220f0e77bd4 (patch)
tree52f5878b394abf2ef326765d46880ccbabd84903 /pkgs/development/libraries
parent07615735077db344539eb9131823600593f0eddf (diff)
parentf402c6321aa3c6e56f5e1f1e36c4ad459c881309 (diff)
downloadnixpkgs-5185bc177309c62e53dad1ad346d1220f0e77bd4.tar
nixpkgs-5185bc177309c62e53dad1ad346d1220f0e77bd4.tar.gz
nixpkgs-5185bc177309c62e53dad1ad346d1220f0e77bd4.tar.bz2
nixpkgs-5185bc177309c62e53dad1ad346d1220f0e77bd4.tar.lz
nixpkgs-5185bc177309c62e53dad1ad346d1220f0e77bd4.tar.xz
nixpkgs-5185bc177309c62e53dad1ad346d1220f0e77bd4.tar.zst
nixpkgs-5185bc177309c62e53dad1ad346d1220f0e77bd4.zip
Merge remote-tracking branch 'upstream/master' into hardened-stdenv
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/SDL_sixel/default.nix25
-rw-r--r--pkgs/development/libraries/armadillo/default.nix23
-rw-r--r--pkgs/development/libraries/aspell/dictionaries.nix6
-rw-r--r--pkgs/development/libraries/at-spi2-core/default.nix4
-rw-r--r--pkgs/development/libraries/audio/zita-resampler/default.nix2
-rw-r--r--pkgs/development/libraries/avahi/default.nix7
-rw-r--r--pkgs/development/libraries/avahi/no-mkdir-localstatedir.patch2
-rw-r--r--pkgs/development/libraries/botan/generic.nix2
-rw-r--r--pkgs/development/libraries/botan/unstable.nix1
-rw-r--r--pkgs/development/libraries/buddy/default.nix2
-rw-r--r--pkgs/development/libraries/capstone/default.nix2
-rw-r--r--pkgs/development/libraries/cutee/default.nix27
-rw-r--r--pkgs/development/libraries/cyrus-sasl/default.nix2
-rw-r--r--pkgs/development/libraries/drumstick/default.nix41
-rw-r--r--pkgs/development/libraries/expat/CVE-2015-1283-refix.patch37
-rw-r--r--pkgs/development/libraries/expat/CVE-2016-0718-v2-2-1.patch755
-rw-r--r--pkgs/development/libraries/expat/default.nix6
-rw-r--r--pkgs/development/libraries/ffmpeg-full/default.nix12
-rw-r--r--pkgs/development/libraries/ffmpeg-sixel/default.nix37
-rw-r--r--pkgs/development/libraries/ffmpeg/3.0.nix7
-rw-r--r--pkgs/development/libraries/ffmpeg/3.1.nix7
-rw-r--r--pkgs/development/libraries/fontconfig/default.nix1
-rw-r--r--pkgs/development/libraries/fontconfig/make-fonts-conf.xsl2
-rw-r--r--pkgs/development/libraries/frame/default.nix2
-rw-r--r--pkgs/development/libraries/ftgl/2.1.2.nix2
-rw-r--r--pkgs/development/libraries/ftgl/default.nix2
-rw-r--r--pkgs/development/libraries/gd/default.nix4
-rw-r--r--pkgs/development/libraries/gdbm/default.nix12
-rw-r--r--pkgs/development/libraries/geis/default.nix32
-rw-r--r--pkgs/development/libraries/gettext/default.nix8
-rw-r--r--pkgs/development/libraries/git2/0.21.nix2
-rw-r--r--pkgs/development/libraries/git2/default.nix2
-rw-r--r--pkgs/development/libraries/gle/default.nix18
-rw-r--r--pkgs/development/libraries/glfw/3.x.nix4
-rw-r--r--pkgs/development/libraries/glibc/builder.sh58
-rw-r--r--pkgs/development/libraries/glibc/common.nix1
-rw-r--r--pkgs/development/libraries/glibc/default.nix65
-rw-r--r--pkgs/development/libraries/glibc/fix_warnings.patch36
-rw-r--r--pkgs/development/libraries/gmp/6.x.nix6
-rw-r--r--pkgs/development/libraries/gnutls/3.4.nix4
-rw-r--r--pkgs/development/libraries/gnutls/3.5.nix17
-rw-r--r--pkgs/development/libraries/gnutls/generic.nix21
-rw-r--r--pkgs/development/libraries/gobject-introspection/separate-rpath-arg.patch21
-rw-r--r--pkgs/development/libraries/gstreamer/bad/default.nix4
-rw-r--r--pkgs/development/libraries/gstreamer/base/default.nix4
-rw-r--r--pkgs/development/libraries/gstreamer/core/default.nix4
-rw-r--r--pkgs/development/libraries/gstreamer/ges/default.nix4
-rw-r--r--pkgs/development/libraries/gstreamer/good/default.nix4
-rw-r--r--pkgs/development/libraries/gstreamer/libav/default.nix4
-rw-r--r--pkgs/development/libraries/gstreamer/ugly/default.nix4
-rw-r--r--pkgs/development/libraries/gstreamer/validate/default.nix4
-rw-r--r--pkgs/development/libraries/gtk+/3.x.nix13
-rw-r--r--pkgs/development/libraries/icu/54.1.nix12
-rw-r--r--pkgs/development/libraries/idnkit/default.nix2
-rw-r--r--pkgs/development/libraries/jbigkit/default.nix2
-rw-r--r--pkgs/development/libraries/json-glib/default.nix5
-rw-r--r--pkgs/development/libraries/kerberos/krb5.nix2
-rw-r--r--pkgs/development/libraries/kerberos/path_char_fix.patch38
-rw-r--r--pkgs/development/libraries/kinetic-cpp-client/default.nix2
-rw-r--r--pkgs/development/libraries/kyotocabinet/default.nix2
-rw-r--r--pkgs/development/libraries/lasso/default.nix31
-rw-r--r--pkgs/development/libraries/ldb/default.nix2
-rw-r--r--pkgs/development/libraries/leatherman/default.nix4
-rw-r--r--pkgs/development/libraries/libarchive/CVE-2013-0211.patch30
-rw-r--r--pkgs/development/libraries/libarchive/CVE-2015-1197.patch143
-rw-r--r--pkgs/development/libraries/libarchive/default.nix16
-rw-r--r--pkgs/development/libraries/libasyncns/default.nix2
-rw-r--r--pkgs/development/libraries/libav/default.nix8
-rw-r--r--pkgs/development/libraries/libburn/default.nix6
-rw-r--r--pkgs/development/libraries/libcommuni/default.nix17
-rw-r--r--pkgs/development/libraries/libconfig/default.nix2
-rw-r--r--pkgs/development/libraries/libdwg/default.nix2
-rw-r--r--pkgs/development/libraries/libelf/default.nix4
-rw-r--r--pkgs/development/libraries/libestr/default.nix2
-rw-r--r--pkgs/development/libraries/libewf/04-fix-FTBFS-GCC5.patch20
-rw-r--r--pkgs/development/libraries/libewf/default.nix7
-rw-r--r--pkgs/development/libraries/libfilezilla/default.nix4
-rw-r--r--pkgs/development/libraries/libgcrypt/default.nix12
-rw-r--r--pkgs/development/libraries/libgksu/default.nix26
-rw-r--r--pkgs/development/libraries/libgnurl/default.nix22
-rw-r--r--pkgs/development/libraries/libgpg-error/default.nix7
-rw-r--r--pkgs/development/libraries/libgphoto2/default.nix6
-rw-r--r--pkgs/development/libraries/libical/default.nix2
-rw-r--r--pkgs/development/libraries/libimobiledevice/default.nix10
-rw-r--r--pkgs/development/libraries/libinput/default.nix4
-rw-r--r--pkgs/development/libraries/libisoburn/default.nix21
-rw-r--r--pkgs/development/libraries/libisofs/default.nix6
-rw-r--r--pkgs/development/libraries/libjpeg-turbo/default.nix4
-rw-r--r--pkgs/development/libraries/liblo/default.nix2
-rw-r--r--pkgs/development/libraries/liblognorm/default.nix2
-rw-r--r--pkgs/development/libraries/libmediainfo/default.nix4
-rw-r--r--pkgs/development/libraries/libmicrohttpd/default.nix24
-rw-r--r--pkgs/development/libraries/libmnl/default.nix2
-rw-r--r--pkgs/development/libraries/libmpack/default.nix3
-rw-r--r--pkgs/development/libraries/libnetfilter_queue/default.nix2
-rw-r--r--pkgs/development/libraries/liboauth/default.nix4
-rw-r--r--pkgs/development/libraries/libomxil-bellagio/default.nix2
-rw-r--r--pkgs/development/libraries/libpng/12.nix4
-rw-r--r--pkgs/development/libraries/libpng/default.nix11
-rw-r--r--pkgs/development/libraries/libpsl/default.nix6
-rw-r--r--pkgs/development/libraries/libqalculate/default.nix28
-rw-r--r--pkgs/development/libraries/libqb/default.nix2
-rw-r--r--pkgs/development/libraries/libqrencode/default.nix34
-rw-r--r--pkgs/development/libraries/librelp/default.nix2
-rw-r--r--pkgs/development/libraries/libressl/2.2.nix4
-rw-r--r--pkgs/development/libraries/libressl/2.3.nix4
-rw-r--r--pkgs/development/libraries/libressl/2.4.nix22
-rw-r--r--pkgs/development/libraries/libseccomp/default.nix2
-rw-r--r--pkgs/development/libraries/libsixel/default.nix19
-rw-r--r--pkgs/development/libraries/libstatgrab/default.nix2
-rw-r--r--pkgs/development/libraries/libstroke/default.nix2
-rw-r--r--pkgs/development/libraries/libtasn1/default.nix4
-rw-r--r--pkgs/development/libraries/libtorrent-rasterbar/1.09.nix6
-rw-r--r--pkgs/development/libraries/libtorrent-rasterbar/default.nix4
-rw-r--r--pkgs/development/libraries/libtorrent-rasterbar/generic.nix4
-rw-r--r--pkgs/development/libraries/libu2f-server/default.nix2
-rw-r--r--pkgs/development/libraries/libusbmuxd/default.nix9
-rw-r--r--pkgs/development/libraries/libvirt/default.nix13
-rw-r--r--pkgs/development/libraries/libwacom/default.nix2
-rw-r--r--pkgs/development/libraries/libxcomp/default.nix4
-rw-r--r--pkgs/development/libraries/libxkbcommon/default.nix9
-rw-r--r--pkgs/development/libraries/libyaml-cpp/default.nix17
-rw-r--r--pkgs/development/libraries/libykneomgr/default.nix2
-rw-r--r--pkgs/development/libraries/log4cplus/default.nix2
-rw-r--r--pkgs/development/libraries/mapnik/default.nix6
-rw-r--r--pkgs/development/libraries/mbedtls/default.nix10
-rw-r--r--pkgs/development/libraries/mediastreamer/default.nix2
-rw-r--r--pkgs/development/libraries/mimetic/default.nix22
-rw-r--r--pkgs/development/libraries/minixml/default.nix2
-rw-r--r--pkgs/development/libraries/mps/default.nix7
-rw-r--r--pkgs/development/libraries/nanomsg/default.nix17
-rw-r--r--pkgs/development/libraries/ncurses/default.nix22
-rw-r--r--pkgs/development/libraries/ncurses/gcc-5.patch46
-rw-r--r--pkgs/development/libraries/nvidia-video-sdk/default.nix27
-rw-r--r--pkgs/development/libraries/opencl-icd/default.nix15
-rw-r--r--pkgs/development/libraries/pcre/default.nix2
-rw-r--r--pkgs/development/libraries/plib/CVE-2012-4552.patch55
-rw-r--r--pkgs/development/libraries/plib/default.nix13
-rw-r--r--pkgs/development/libraries/png++/default.nix41
-rw-r--r--pkgs/development/libraries/poker-eval/default.nix2
-rw-r--r--pkgs/development/libraries/popt/default.nix2
-rw-r--r--pkgs/development/libraries/protobuf/3.0.nix4
-rw-r--r--pkgs/development/libraries/qt-5/5.5/qtbase/dlopen-gtkstyle.patch50
-rw-r--r--pkgs/development/libraries/qt-5/5.6/default.nix26
-rwxr-xr-xpkgs/development/libraries/qt-5/5.6/fetchsrcs.sh47
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebchannel.nix7
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebengine.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.6/srcs.nix252
-rw-r--r--pkgs/development/libraries/resolv_wrapper/default.nix2
-rw-r--r--pkgs/development/libraries/science/biology/htslib/default.nix23
-rw-r--r--pkgs/development/libraries/science/math/clblas/cuda/default.nix68
-rw-r--r--pkgs/development/libraries/science/math/clblas/cuda/platform.patch34
-rw-r--r--pkgs/development/libraries/science/math/cudnn/7.5-5.0/default.nix46
-rw-r--r--pkgs/development/libraries/socket_wrapper/default.nix2
-rw-r--r--pkgs/development/libraries/speex/default.nix2
-rw-r--r--pkgs/development/libraries/speexdsp/default.nix2
-rw-r--r--pkgs/development/libraries/sqlite/default.nix7
-rw-r--r--pkgs/development/libraries/uid_wrapper/default.nix2
-rw-r--r--pkgs/development/libraries/v8/fix-GetLocalizedMessage-usage.patch27
-rw-r--r--pkgs/development/libraries/webrtc-audio-processing/default.nix12
-rw-r--r--pkgs/development/libraries/wolfssl/default.nix14
-rw-r--r--pkgs/development/libraries/wxsqlite3/default.nix23
-rw-r--r--pkgs/development/libraries/wxsqliteplus/default.nix38
-rw-r--r--pkgs/development/libraries/x264/default.nix6
-rw-r--r--pkgs/development/libraries/x265/default.nix2
-rw-r--r--pkgs/development/libraries/xercesc/default.nix4
-rw-r--r--pkgs/development/libraries/xgboost/default.nix2
-rw-r--r--pkgs/development/libraries/zeromq/sodium_warning.patch70
168 files changed, 1394 insertions, 1797 deletions
diff --git a/pkgs/development/libraries/SDL_sixel/default.nix b/pkgs/development/libraries/SDL_sixel/default.nix
new file mode 100644
index 00000000000..5b8e887c2ee
--- /dev/null
+++ b/pkgs/development/libraries/SDL_sixel/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchFromGitHub, pkgconfig, libsixel }:
+
+stdenv.mkDerivation rec {
+  name    = "SDL_sixel-${version}";
+  version = "1.2-nightly";
+
+  src = fetchFromGitHub {
+    owner = "saitoha";
+    repo = "SDL1.2-SIXEL";
+    rev = "ab3fccac6e34260a617be511bd8c2b2beae41952";
+    sha256 = "0gm2vngdac17lzw9azkhzazmfq3byjddms14gqjk18vnynfqp5wp";
+  };
+
+  configureFlags = [ "--enable-video-sixel" ];
+
+  buildInputs = [ pkgconfig libsixel ];
+
+  meta = with stdenv.lib; {
+    description = "A cross-platform multimedia library, that supports sixel graphics on consoles";
+    homepage    = https://github.com/saitoha/SDL1.2-SIXEL;
+    maintainers = with maintainers; [ vrthra ];
+    platforms   = platforms.linux;
+    license     = licenses.lgpl21;
+  };
+}
diff --git a/pkgs/development/libraries/armadillo/default.nix b/pkgs/development/libraries/armadillo/default.nix
new file mode 100644
index 00000000000..8d904efe0d6
--- /dev/null
+++ b/pkgs/development/libraries/armadillo/default.nix
@@ -0,0 +1,23 @@
+{stdenv, fetchurl, cmake, pkgconfig, atlas, blas, openblas}:
+
+stdenv.mkDerivation rec {
+  version = "7.200.1b";
+  name = "armadillo-${version}";
+  
+  src = fetchurl {
+    url = "http://sourceforge.net/projects/arma/files/armadillo-${version}.tar.xz";
+    sha256 = "00s8xrywc4aipipq1zpd6q9gzqmsiv8cwd25zvb1csrpninmidvc";
+  };
+
+  unpackCmd = [ "tar -xf ${src}" ];
+  
+  nativeBuildInputs = [ cmake atlas blas openblas ];
+  
+  meta = with stdenv.lib; {
+    description = "C++ linear algebra library";
+    homepage = "http://arma.sourceforge.net" ;
+    license = licenses.mpl20;
+    platforms = stdenv.lib.platforms.linux ;
+    maintainers = [ stdenv.lib.maintainers.juliendehos ];
+  };
+}
diff --git a/pkgs/development/libraries/aspell/dictionaries.nix b/pkgs/development/libraries/aspell/dictionaries.nix
index e1a7c75ea1d..be61640553d 100644
--- a/pkgs/development/libraries/aspell/dictionaries.nix
+++ b/pkgs/development/libraries/aspell/dictionaries.nix
@@ -56,11 +56,11 @@ in {
   };
 
   en = buildDict {
-    shortName = "en-7.1-0";
+    shortName = "en-2016.06.26-0";
     fullName = "English";
     src = fetchurl {
-      url = mirror://gnu/aspell/dict/en/aspell6-en-7.1-0.tar.bz2;
-      sha256 = "02ldfiny4iakgfgy4sdrzjqdzi7l1rmb6y30lv31kfy5x31g77gz";
+      url = mirror://gnu/aspell/dict/en/aspell6-en-2016.06.26-0.tar.bz2;
+      sha256 = "1clzsfq2cbgp6wvfr2qwfsd2nziipml5m5vqm45r748wczlxihv1";
     };
   };
 
diff --git a/pkgs/development/libraries/at-spi2-core/default.nix b/pkgs/development/libraries/at-spi2-core/default.nix
index e3c558057c8..20e18747e67 100644
--- a/pkgs/development/libraries/at-spi2-core/default.nix
+++ b/pkgs/development/libraries/at-spi2-core/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   versionMajor = "2.20";
-  versionMinor = "1";
+  versionMinor = "2";
   moduleName   = "at-spi2-core";
   name = "${moduleName}-${versionMajor}.${versionMinor}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${moduleName}/${versionMajor}/${name}.tar.xz";
-    sha256 = "6ed858e781f5aa9a9662b3beb5ef82f733dac040afc8255d85dffd2097f16900";
+    sha256 = "88a4de9d43139f13cca531b47b901bc1b56e0ab06ba899126644abd4ac16a143";
   };
 
   outputs = [ "dev" "out" ];
diff --git a/pkgs/development/libraries/audio/zita-resampler/default.nix b/pkgs/development/libraries/audio/zita-resampler/default.nix
index 8c7e82557ab..3f3627b6b23 100644
--- a/pkgs/development/libraries/audio/zita-resampler/default.nix
+++ b/pkgs/development/libraries/audio/zita-resampler/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    description = "resample library by Fons Adriaensen";
+    description = "Resample library by Fons Adriaensen";
     version = "${version}";
     homepage = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/index.html";
     license = stdenv.lib.licenses.gpl2;
diff --git a/pkgs/development/libraries/avahi/default.nix b/pkgs/development/libraries/avahi/default.nix
index 199379ad401..69f86e020c7 100644
--- a/pkgs/development/libraries/avahi/default.nix
+++ b/pkgs/development/libraries/avahi/default.nix
@@ -7,11 +7,12 @@
 assert qt4Support -> qt4 != null;
 
 stdenv.mkDerivation rec {
-  name = "avahi-0.6.31";
+  name = "avahi-${version}";
+  version = "0.6.32";
 
   src = fetchurl {
-    url = "${meta.homepage}/download/${name}.tar.gz";
-    sha256 = "0j5b5ld6bjyh3qhd2nw0jb84znq0wqai7fsrdzg7bpg24jdp2wl3";
+    url = "https://github.com/lathiat/avahi/releases/download/v${version}/avahi-${version}.tar.gz";
+    sha256 = "0m5l3ny9i2z1l27y4wm731c0zdkmfn6l1szbajx0ljjiblc92jfm";
   };
 
   patches = [ ./no-mkdir-localstatedir.patch ];
diff --git a/pkgs/development/libraries/avahi/no-mkdir-localstatedir.patch b/pkgs/development/libraries/avahi/no-mkdir-localstatedir.patch
index 76377d10570..a8a1878cc90 100644
--- a/pkgs/development/libraries/avahi/no-mkdir-localstatedir.patch
+++ b/pkgs/development/libraries/avahi/no-mkdir-localstatedir.patch
@@ -6,7 +6,7 @@ Don't "mkdir $(localstatedir)" since we can't do it (/var).
  	done
  
  install-data-local:
--	test -z "$(localstatedir)/run" || $(mkdir_p) "$(DESTDIR)$(localstatedir)/run"
+-	test -z "$(localstatedir)/run" || $(MKDIR_P) "$(DESTDIR)$(localstatedir)/run"
  
  update-systemd:
  	curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c
diff --git a/pkgs/development/libraries/botan/generic.nix b/pkgs/development/libraries/botan/generic.nix
index 823e50e3227..4a4ec5d9fe9 100644
--- a/pkgs/development/libraries/botan/generic.nix
+++ b/pkgs/development/libraries/botan/generic.nix
@@ -2,6 +2,7 @@
 # Passed by version specific builders
 , baseVersion, revision, sha256
 , extraConfigureFlags ? ""
+, postPatch ? null
 , ...
 }:
 
@@ -17,6 +18,7 @@ stdenv.mkDerivation rec {
     ];
     inherit sha256;
   };
+  inherit postPatch;
 
   buildInputs = [ python bzip2 zlib gmp openssl boost ];
 
diff --git a/pkgs/development/libraries/botan/unstable.nix b/pkgs/development/libraries/botan/unstable.nix
index dd185f21035..d952b50aeb8 100644
--- a/pkgs/development/libraries/botan/unstable.nix
+++ b/pkgs/development/libraries/botan/unstable.nix
@@ -5,4 +5,5 @@ callPackage ./generic.nix (args // {
   revision = "29";
   sha256 = "157bp8716h17agrxyj7xpsj2i5sqhafj1nfx4gpzccx7y2kyq176";
   openssl = null;
+  postPatch = "sed '1i#include <cmath>' -i src/tests/test_bigint.cpp";
 })
diff --git a/pkgs/development/libraries/buddy/default.nix b/pkgs/development/libraries/buddy/default.nix
index 8b40260ddf3..12670ab711a 100644
--- a/pkgs/development/libraries/buddy/default.nix
+++ b/pkgs/development/libraries/buddy/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "http://sourceforge.net/projects/buddy/";
-    description = "binary decision diagram package";
+    description = "Binary decision diagram package";
     license = "as-is";
 
     platforms = with stdenv.lib.platforms; allBut cygwin;
diff --git a/pkgs/development/libraries/capstone/default.nix b/pkgs/development/libraries/capstone/default.nix
index a72532ee35b..76069e72b0d 100644
--- a/pkgs/development/libraries/capstone/default.nix
+++ b/pkgs/development/libraries/capstone/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   enableParallelBuild = true;
 
   meta = {
-    description = "advanced disassembly library";
+    description = "Advanced disassembly library";
     homepage    = "http://www.capstone-engine.org";
     license     = stdenv.lib.licenses.bsd3;
     platforms   = stdenv.lib.platforms.linux;
diff --git a/pkgs/development/libraries/cutee/default.nix b/pkgs/development/libraries/cutee/default.nix
new file mode 100644
index 00000000000..eb19283caea
--- /dev/null
+++ b/pkgs/development/libraries/cutee/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "cutee";
+  version = "0.4.2";
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url    = "http://www.codesink.org/download/${pname}-${version}.tar.gz";
+    sha256 = "18bzvhzx8k24mpcim5669n3wg9hd0sfsxj8zjpbr24hywrlppgc2";
+  };
+
+  buildFlags = "cutee";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp cutee $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "C++ Unit Testing Easy Environment";
+    homepage    = http://codesink.org/cutee_unit_testing.html;
+    license     = licenses.gpl2Plus;
+    maintainers = with maintainers; [ leenaars];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/cyrus-sasl/default.nix b/pkgs/development/libraries/cyrus-sasl/default.nix
index 366e5f613a9..9573358a22f 100644
--- a/pkgs/development/libraries/cyrus-sasl/default.nix
+++ b/pkgs/development/libraries/cyrus-sasl/default.nix
@@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "http://cyrusimap.web.cmu.edu/";
-    description = "library for adding authentication support to connection-based protocols";
+    description = "Library for adding authentication support to connection-based protocols";
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/drumstick/default.nix b/pkgs/development/libraries/drumstick/default.nix
new file mode 100644
index 00000000000..b5be3a40a0f
--- /dev/null
+++ b/pkgs/development/libraries/drumstick/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, alsaLib, cmake, docbook_xsl, docbook_xml_dtd_45, doxygen
+, fluidsynth, pkgconfig, qt5
+}:
+
+stdenv.mkDerivation rec {
+  name = "drumstick-${version}";
+  version = "1.0.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/drumstick/${version}/${name}.tar.bz2";
+    sha256 = "0l47gy9yywrc860db5g3wdqg8yc8qdb2lqq6wvw1dfim5j0vbail";
+  };
+
+  outputs = [ "out" "dev" "man" ];
+
+  enableParallelBuilding = true;
+
+  # Prevent the manpage builds from attempting to access the Internet.
+  prePatch = ''
+    substituteInPlace cmake_admin/CreateManpages.cmake --replace \
+      http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl \
+      ${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl
+
+    for xml in doc/*.xml.in; do
+      substituteInPlace "$xml" --replace \
+        http://www.docbook.org/xml/4.5/docbookx.dtd \
+        ${docbook_xml_dtd_45}/xml/dtd/docbook/docbookx.dtd
+    done
+  '';
+
+  buildInputs = [
+    alsaLib cmake doxygen fluidsynth pkgconfig qt5.qtbase qt5.qtsvg
+  ];
+
+  meta = with stdenv.lib; {
+    maintainers = with maintainers; [ solson ];
+    description = "MIDI libraries for Qt5/C++";
+    homepage = http://drumstick.sourceforge.net/;
+    license = licenses.gpl2Plus;
+  };
+}
diff --git a/pkgs/development/libraries/expat/CVE-2015-1283-refix.patch b/pkgs/development/libraries/expat/CVE-2015-1283-refix.patch
deleted file mode 100644
index db9747ea0b3..00000000000
--- a/pkgs/development/libraries/expat/CVE-2015-1283-refix.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 29a11774d8ebbafe8418b4a5ffb4cc1160b194a1 Mon Sep 17 00:00:00 2001
-From: Pascal Cuoq <cuoq@trust-in-soft.com>
-Date: Sun, 15 May 2016 09:05:46 +0200
-Subject: [PATCH] Avoid relying on undefined behavior in CVE-2015-1283 fix. It
- does not really work: https://godbolt.org/g/Zl8gdF
-
----
- expat/lib/xmlparse.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/lib/xmlparse.c b/lib/xmlparse.c
-index 13e080d..cdb12ef 100644
---- a/lib/xmlparse.c
-+++ b/lib/xmlparse.c
-@@ -1693,7 +1693,8 @@ XML_GetBuffer(XML_Parser parser, int len)
-   }
- 
-   if (len > bufferLim - bufferEnd) {
--    int neededSize = len + (int)(bufferEnd - bufferPtr);
-+    /* Do not invoke signed arithmetic overflow: */
-+    int neededSize = (int) ((unsigned)len + (unsigned)(bufferEnd - bufferPtr));
-     if (neededSize < 0) {
-       errorCode = XML_ERROR_NO_MEMORY;
-       return NULL;
-@@ -1725,7 +1726,8 @@ XML_GetBuffer(XML_Parser parser, int len)
-       if (bufferSize == 0)
-         bufferSize = INIT_BUFFER_SIZE;
-       do {
--        bufferSize *= 2;
-+        /* Do not invoke signed arithmetic overflow: */
-+        bufferSize = (int) (2U * (unsigned) bufferSize);
-       } while (bufferSize < neededSize && bufferSize > 0);
-       if (bufferSize <= 0) {
-         errorCode = XML_ERROR_NO_MEMORY;
--- 
-2.8.2
-
diff --git a/pkgs/development/libraries/expat/CVE-2016-0718-v2-2-1.patch b/pkgs/development/libraries/expat/CVE-2016-0718-v2-2-1.patch
deleted file mode 100644
index 92ff2682684..00000000000
--- a/pkgs/development/libraries/expat/CVE-2016-0718-v2-2-1.patch
+++ /dev/null
@@ -1,755 +0,0 @@
-From cdfcb1b5c95e93b00ae9e9d25708b4a3bee72c15 Mon Sep 17 00:00:00 2001
-From: Sebastian Pipping <sebastian@pipping.org>
-Date: Mon, 2 May 2016 00:02:44 +0200
-Subject: [PATCH] Address CVE-2016-0718 (/patch/ version 2.2.1)
-
-* Out of bounds memory access when doing text conversion on malformed input
-* Integer overflow related to memory allocation
-
-Reported by Gustavo Grieco
-
-Patch credits go to
-* Christian Heimes
-* Karl Waclawek
-* Gustavo Grieco
-* Sebastian Pipping
-* Pascal Cuoq
----
- expat/lib/xmlparse.c    |  34 +++++++++-----
- expat/lib/xmltok.c      | 115 +++++++++++++++++++++++++++++++++++-------------
- expat/lib/xmltok.h      |  10 ++++-
- expat/lib/xmltok_impl.c |  62 +++++++++++++-------------
- 4 files changed, 146 insertions(+), 75 deletions(-)
-
-diff --git a/lib/xmlparse.c b/lib/xmlparse.c
-index e308c79..13e080d 100644
---- a/lib/xmlparse.c
-+++ b/lib/xmlparse.c
-@@ -2426,11 +2426,11 @@ doContent(XML_Parser parser,
-           for (;;) {
-             int bufSize;
-             int convLen;
--            XmlConvert(enc,
-+            const enum XML_Convert_Result convert_res = XmlConvert(enc,
-                        &fromPtr, rawNameEnd,
-                        (ICHAR **)&toPtr, (ICHAR *)tag->bufEnd - 1);
-             convLen = (int)(toPtr - (XML_Char *)tag->buf);
--            if (fromPtr == rawNameEnd) {
-+            if ((convert_res == XML_CONVERT_COMPLETED) || (convert_res == XML_CONVERT_INPUT_INCOMPLETE)) {
-               tag->name.strLen = convLen;
-               break;
-             }
-@@ -2651,11 +2651,11 @@ doContent(XML_Parser parser,
-           if (MUST_CONVERT(enc, s)) {
-             for (;;) {
-               ICHAR *dataPtr = (ICHAR *)dataBuf;
--              XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd);
-+              const enum XML_Convert_Result convert_res = XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd);
-               *eventEndPP = s;
-               charDataHandler(handlerArg, dataBuf,
-                               (int)(dataPtr - (ICHAR *)dataBuf));
--              if (s == next)
-+              if ((convert_res == XML_CONVERT_COMPLETED) || (convert_res == XML_CONVERT_INPUT_INCOMPLETE))
-                 break;
-               *eventPP = s;
-             }
-@@ -3261,11 +3261,11 @@ doCdataSection(XML_Parser parser,
-           if (MUST_CONVERT(enc, s)) {
-             for (;;) {
-               ICHAR *dataPtr = (ICHAR *)dataBuf;
--              XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd);
-+              const enum XML_Convert_Result convert_res = XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd);
-               *eventEndPP = next;
-               charDataHandler(handlerArg, dataBuf,
-                               (int)(dataPtr - (ICHAR *)dataBuf));
--              if (s == next)
-+              if ((convert_res == XML_CONVERT_COMPLETED) || (convert_res == XML_CONVERT_INPUT_INCOMPLETE))
-                 break;
-               *eventPP = s;
-             }
-@@ -5342,6 +5342,7 @@ reportDefault(XML_Parser parser, const ENCODING *enc,
-               const char *s, const char *end)
- {
-   if (MUST_CONVERT(enc, s)) {
-+    enum XML_Convert_Result convert_res;
-     const char **eventPP;
-     const char **eventEndPP;
-     if (enc == encoding) {
-@@ -5354,11 +5355,11 @@ reportDefault(XML_Parser parser, const ENCODING *enc,
-     }
-     do {
-       ICHAR *dataPtr = (ICHAR *)dataBuf;
--      XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd);
-+      convert_res = XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd);
-       *eventEndPP = s;
-       defaultHandler(handlerArg, dataBuf, (int)(dataPtr - (ICHAR *)dataBuf));
-       *eventPP = s;
--    } while (s != end);
-+    } while ((convert_res != XML_CONVERT_COMPLETED) && (convert_res != XML_CONVERT_INPUT_INCOMPLETE));
-   }
-   else
-     defaultHandler(handlerArg, (XML_Char *)s, (int)((XML_Char *)end - (XML_Char *)s));
-@@ -6163,8 +6164,8 @@ poolAppend(STRING_POOL *pool, const ENCODING *enc,
-   if (!pool->ptr && !poolGrow(pool))
-     return NULL;
-   for (;;) {
--    XmlConvert(enc, &ptr, end, (ICHAR **)&(pool->ptr), (ICHAR *)pool->end);
--    if (ptr == end)
-+    const enum XML_Convert_Result convert_res = XmlConvert(enc, &ptr, end, (ICHAR **)&(pool->ptr), (ICHAR *)pool->end);
-+    if ((convert_res == XML_CONVERT_COMPLETED) || (convert_res == XML_CONVERT_INPUT_INCOMPLETE))
-       break;
-     if (!poolGrow(pool))
-       return NULL;
-@@ -6248,8 +6249,13 @@ poolGrow(STRING_POOL *pool)
-     }
-   }
-   if (pool->blocks && pool->start == pool->blocks->s) {
--    int blockSize = (int)(pool->end - pool->start)*2;
--    BLOCK *temp = (BLOCK *)
-+    BLOCK *temp;
-+    int blockSize = (int)((unsigned)(pool->end - pool->start)*2U);
-+
-+    if (blockSize < 0)
-+      return XML_FALSE;
-+
-+    temp = (BLOCK *)
-       pool->mem->realloc_fcn(pool->blocks,
-                              (offsetof(BLOCK, s)
-                               + blockSize * sizeof(XML_Char)));
-@@ -6264,6 +6270,10 @@ poolGrow(STRING_POOL *pool)
-   else {
-     BLOCK *tem;
-     int blockSize = (int)(pool->end - pool->start);
-+
-+    if (blockSize < 0)
-+      return XML_FALSE;
-+
-     if (blockSize < INIT_BLOCK_SIZE)
-       blockSize = INIT_BLOCK_SIZE;
-     else
-diff --git a/lib/xmltok.c b/lib/xmltok.c
-index bf09dfc..cb98ce1 100644
---- a/lib/xmltok.c
-+++ b/lib/xmltok.c
-@@ -318,39 +318,55 @@ enum {  /* UTF8_cvalN is value of masked first byte of N byte sequence */
-   UTF8_cval4 = 0xf0
- };
- 
--static void PTRCALL
-+static enum XML_Convert_Result PTRCALL
- utf8_toUtf8(const ENCODING *enc,
-             const char **fromP, const char *fromLim,
-             char **toP, const char *toLim)
- {
-+  enum XML_Convert_Result res = XML_CONVERT_COMPLETED;
-   char *to;
-   const char *from;
-   if (fromLim - *fromP > toLim - *toP) {
-     /* Avoid copying partial characters. */
-+    res = XML_CONVERT_OUTPUT_EXHAUSTED;
-     for (fromLim = *fromP + (toLim - *toP); fromLim > *fromP; fromLim--)
-       if (((unsigned char)fromLim[-1] & 0xc0) != 0x80)
-         break;
-   }
--  for (to = *toP, from = *fromP; from != fromLim; from++, to++)
-+  for (to = *toP, from = *fromP; (from < fromLim) && (to < toLim); from++, to++)
-     *to = *from;
-   *fromP = from;
-   *toP = to;
-+
-+  if ((to == toLim) && (from < fromLim))
-+    return XML_CONVERT_OUTPUT_EXHAUSTED;
-+  else
-+    return res;
- }
- 
--static void PTRCALL
-+static enum XML_Convert_Result PTRCALL
- utf8_toUtf16(const ENCODING *enc,
-              const char **fromP, const char *fromLim,
-              unsigned short **toP, const unsigned short *toLim)
- {
-+  enum XML_Convert_Result res = XML_CONVERT_COMPLETED;
-   unsigned short *to = *toP;
-   const char *from = *fromP;
--  while (from != fromLim && to != toLim) {
-+  while (from < fromLim && to < toLim) {
-     switch (((struct normal_encoding *)enc)->type[(unsigned char)*from]) {
-     case BT_LEAD2:
-+      if (fromLim - from < 2) {
-+        res = XML_CONVERT_INPUT_INCOMPLETE;
-+        break;
-+      }
-       *to++ = (unsigned short)(((from[0] & 0x1f) << 6) | (from[1] & 0x3f));
-       from += 2;
-       break;
-     case BT_LEAD3:
-+      if (fromLim - from < 3) {
-+        res = XML_CONVERT_INPUT_INCOMPLETE;
-+        break;
-+      }
-       *to++ = (unsigned short)(((from[0] & 0xf) << 12)
-                                | ((from[1] & 0x3f) << 6) | (from[2] & 0x3f));
-       from += 3;
-@@ -358,8 +374,14 @@ utf8_toUtf16(const ENCODING *enc,
-     case BT_LEAD4:
-       {
-         unsigned long n;
--        if (to + 1 == toLim)
-+        if (toLim - to < 2) {
-+          res = XML_CONVERT_OUTPUT_EXHAUSTED;
-           goto after;
-+        }
-+        if (fromLim - from < 4) {
-+          res = XML_CONVERT_INPUT_INCOMPLETE;
-+          goto after;
-+        }
-         n = ((from[0] & 0x7) << 18) | ((from[1] & 0x3f) << 12)
-             | ((from[2] & 0x3f) << 6) | (from[3] & 0x3f);
-         n -= 0x10000;
-@@ -377,6 +399,7 @@ utf8_toUtf16(const ENCODING *enc,
- after:
-   *fromP = from;
-   *toP = to;
-+  return res;
- }
- 
- #ifdef XML_NS
-@@ -425,7 +448,7 @@ static const struct normal_encoding internal_utf8_encoding = {
-   STANDARD_VTABLE(sb_) NORMAL_VTABLE(utf8_)
- };
- 
--static void PTRCALL
-+static enum XML_Convert_Result PTRCALL
- latin1_toUtf8(const ENCODING *enc,
-               const char **fromP, const char *fromLim,
-               char **toP, const char *toLim)
-@@ -433,30 +456,35 @@ latin1_toUtf8(const ENCODING *enc,
-   for (;;) {
-     unsigned char c;
-     if (*fromP == fromLim)
--      break;
-+      return XML_CONVERT_COMPLETED;
-     c = (unsigned char)**fromP;
-     if (c & 0x80) {
-       if (toLim - *toP < 2)
--        break;
-+        return XML_CONVERT_OUTPUT_EXHAUSTED;
-       *(*toP)++ = (char)((c >> 6) | UTF8_cval2);
-       *(*toP)++ = (char)((c & 0x3f) | 0x80);
-       (*fromP)++;
-     }
-     else {
-       if (*toP == toLim)
--        break;
-+        return XML_CONVERT_OUTPUT_EXHAUSTED;
-       *(*toP)++ = *(*fromP)++;
-     }
-   }
- }
- 
--static void PTRCALL
-+static enum XML_Convert_Result PTRCALL
- latin1_toUtf16(const ENCODING *enc,
-                const char **fromP, const char *fromLim,
-                unsigned short **toP, const unsigned short *toLim)
- {
--  while (*fromP != fromLim && *toP != toLim)
-+  while (*fromP < fromLim && *toP < toLim)
-     *(*toP)++ = (unsigned char)*(*fromP)++;
-+
-+  if ((*toP == toLim) && (*fromP < fromLim))
-+    return XML_CONVERT_OUTPUT_EXHAUSTED;
-+  else
-+    return XML_CONVERT_COMPLETED;
- }
- 
- #ifdef XML_NS
-@@ -483,13 +511,18 @@ static const struct normal_encoding latin1_encoding = {
-   STANDARD_VTABLE(sb_)
- };
- 
--static void PTRCALL
-+static enum XML_Convert_Result PTRCALL
- ascii_toUtf8(const ENCODING *enc,
-              const char **fromP, const char *fromLim,
-              char **toP, const char *toLim)
- {
--  while (*fromP != fromLim && *toP != toLim)
-+  while (*fromP < fromLim && *toP < toLim)
-     *(*toP)++ = *(*fromP)++;
-+
-+  if ((*toP == toLim) && (*fromP < fromLim))
-+    return XML_CONVERT_OUTPUT_EXHAUSTED;
-+  else
-+    return XML_CONVERT_COMPLETED;
- }
- 
- #ifdef XML_NS
-@@ -536,13 +569,14 @@ unicode_byte_type(char hi, char lo)
- }
- 
- #define DEFINE_UTF16_TO_UTF8(E) \
--static void  PTRCALL \
-+static enum XML_Convert_Result  PTRCALL \
- E ## toUtf8(const ENCODING *enc, \
-             const char **fromP, const char *fromLim, \
-             char **toP, const char *toLim) \
- { \
--  const char *from; \
--  for (from = *fromP; from != fromLim; from += 2) { \
-+  const char *from = *fromP; \
-+  fromLim = from + (((fromLim - from) >> 1) << 1);  /* shrink to even */ \
-+  for (; from < fromLim; from += 2) { \
-     int plane; \
-     unsigned char lo2; \
-     unsigned char lo = GET_LO(from); \
-@@ -552,7 +586,7 @@ E ## toUtf8(const ENCODING *enc, \
-       if (lo < 0x80) { \
-         if (*toP == toLim) { \
-           *fromP = from; \
--          return; \
-+          return XML_CONVERT_OUTPUT_EXHAUSTED; \
-         } \
-         *(*toP)++ = lo; \
-         break; \
-@@ -562,7 +596,7 @@ E ## toUtf8(const ENCODING *enc, \
-     case 0x4: case 0x5: case 0x6: case 0x7: \
-       if (toLim -  *toP < 2) { \
-         *fromP = from; \
--        return; \
-+        return XML_CONVERT_OUTPUT_EXHAUSTED; \
-       } \
-       *(*toP)++ = ((lo >> 6) | (hi << 2) |  UTF8_cval2); \
-       *(*toP)++ = ((lo & 0x3f) | 0x80); \
-@@ -570,7 +604,7 @@ E ## toUtf8(const ENCODING *enc, \
-     default: \
-       if (toLim -  *toP < 3)  { \
-         *fromP = from; \
--        return; \
-+        return XML_CONVERT_OUTPUT_EXHAUSTED; \
-       } \
-       /* 16 bits divided 4, 6, 6 amongst 3 bytes */ \
-       *(*toP)++ = ((hi >> 4) | UTF8_cval3); \
-@@ -580,7 +614,11 @@ E ## toUtf8(const ENCODING *enc, \
-     case 0xD8: case 0xD9: case 0xDA: case 0xDB: \
-       if (toLim -  *toP < 4) { \
-         *fromP = from; \
--        return; \
-+        return XML_CONVERT_OUTPUT_EXHAUSTED; \
-+      } \
-+      if (fromLim - from < 4) { \
-+        *fromP = from; \
-+        return XML_CONVERT_INPUT_INCOMPLETE; \
-       } \
-       plane = (((hi & 0x3) << 2) | ((lo >> 6) & 0x3)) + 1; \
-       *(*toP)++ = ((plane >> 2) | UTF8_cval4); \
-@@ -596,20 +634,32 @@ E ## toUtf8(const ENCODING *enc, \
-     } \
-   } \
-   *fromP = from; \
-+  if (from < fromLim) \
-+    return XML_CONVERT_INPUT_INCOMPLETE; \
-+  else \
-+    return XML_CONVERT_COMPLETED; \
- }
- 
- #define DEFINE_UTF16_TO_UTF16(E) \
--static void  PTRCALL \
-+static enum XML_Convert_Result  PTRCALL \
- E ## toUtf16(const ENCODING *enc, \
-              const char **fromP, const char *fromLim, \
-              unsigned short **toP, const unsigned short *toLim) \
- { \
-+  enum XML_Convert_Result res = XML_CONVERT_COMPLETED; \
-+  fromLim = *fromP + (((fromLim - *fromP) >> 1) << 1);  /* shrink to even */ \
-   /* Avoid copying first half only of surrogate */ \
-   if (fromLim - *fromP > ((toLim - *toP) << 1) \
--      && (GET_HI(fromLim - 2) & 0xF8) == 0xD8) \
-+      && (GET_HI(fromLim - 2) & 0xF8) == 0xD8) { \
-     fromLim -= 2; \
--  for (; *fromP != fromLim && *toP != toLim; *fromP += 2) \
-+    res = XML_CONVERT_INPUT_INCOMPLETE; \
-+  } \
-+  for (; *fromP < fromLim && *toP < toLim; *fromP += 2) \
-     *(*toP)++ = (GET_HI(*fromP) << 8) | GET_LO(*fromP); \
-+  if ((*toP == toLim) && (*fromP < fromLim)) \
-+    return XML_CONVERT_OUTPUT_EXHAUSTED; \
-+  else \
-+    return res; \
- }
- 
- #define SET2(ptr, ch) \
-@@ -1288,7 +1338,7 @@ unknown_isInvalid(const ENCODING *enc, const char *p)
-   return (c & ~0xFFFF) || checkCharRefNumber(c) < 0;
- }
- 
--static void PTRCALL
-+static enum XML_Convert_Result PTRCALL
- unknown_toUtf8(const ENCODING *enc,
-                const char **fromP, const char *fromLim,
-                char **toP, const char *toLim)
-@@ -1299,21 +1349,21 @@ unknown_toUtf8(const ENCODING *enc,
-     const char *utf8;
-     int n;
-     if (*fromP == fromLim)
--      break;
-+      return XML_CONVERT_COMPLETED;
-     utf8 = uenc->utf8[(unsigned char)**fromP];
-     n = *utf8++;
-     if (n == 0) {
-       int c = uenc->convert(uenc->userData, *fromP);
-       n = XmlUtf8Encode(c, buf);
-       if (n > toLim - *toP)
--        break;
-+        return XML_CONVERT_OUTPUT_EXHAUSTED;
-       utf8 = buf;
-       *fromP += (AS_NORMAL_ENCODING(enc)->type[(unsigned char)**fromP]
-                  - (BT_LEAD2 - 2));
-     }
-     else {
-       if (n > toLim - *toP)
--        break;
-+        return XML_CONVERT_OUTPUT_EXHAUSTED;
-       (*fromP)++;
-     }
-     do {
-@@ -1322,13 +1372,13 @@ unknown_toUtf8(const ENCODING *enc,
-   }
- }
- 
--static void PTRCALL
-+static enum XML_Convert_Result PTRCALL
- unknown_toUtf16(const ENCODING *enc,
-                 const char **fromP, const char *fromLim,
-                 unsigned short **toP, const unsigned short *toLim)
- {
-   const struct unknown_encoding *uenc = AS_UNKNOWN_ENCODING(enc);
--  while (*fromP != fromLim && *toP != toLim) {
-+  while (*fromP < fromLim && *toP < toLim) {
-     unsigned short c = uenc->utf16[(unsigned char)**fromP];
-     if (c == 0) {
-       c = (unsigned short)
-@@ -1340,6 +1390,11 @@ unknown_toUtf16(const ENCODING *enc,
-       (*fromP)++;
-     *(*toP)++ = c;
-   }
-+
-+  if ((*toP == toLim) && (*fromP < fromLim))
-+    return XML_CONVERT_OUTPUT_EXHAUSTED;
-+  else
-+    return XML_CONVERT_COMPLETED;
- }
- 
- ENCODING *
-@@ -1503,7 +1558,7 @@ initScan(const ENCODING * const *encodingTable,
- {
-   const ENCODING **encPtr;
- 
--  if (ptr == end)
-+  if (ptr >= end)
-     return XML_TOK_NONE;
-   encPtr = enc->encPtr;
-   if (ptr + 1 == end) {
-diff --git a/lib/xmltok.h b/lib/xmltok.h
-index ca867aa..752007e 100644
---- a/lib/xmltok.h
-+++ b/lib/xmltok.h
-@@ -130,6 +130,12 @@ typedef int (PTRCALL *SCANNER)(const ENCODING *,
-                                const char *,
-                                const char **);
- 
-+enum XML_Convert_Result {
-+  XML_CONVERT_COMPLETED = 0,
-+  XML_CONVERT_INPUT_INCOMPLETE = 1,
-+  XML_CONVERT_OUTPUT_EXHAUSTED = 2  /* and therefore potentially input remaining as well */
-+};
-+
- struct encoding {
-   SCANNER scanners[XML_N_STATES];
-   SCANNER literalScanners[XML_N_LITERAL_TYPES];
-@@ -158,12 +164,12 @@ struct encoding {
-                             const char *ptr,
-                             const char *end,
-                             const char **badPtr);
--  void (PTRCALL *utf8Convert)(const ENCODING *enc,
-+  enum XML_Convert_Result (PTRCALL *utf8Convert)(const ENCODING *enc,
-                               const char **fromP,
-                               const char *fromLim,
-                               char **toP,
-                               const char *toLim);
--  void (PTRCALL *utf16Convert)(const ENCODING *enc,
-+  enum XML_Convert_Result (PTRCALL *utf16Convert)(const ENCODING *enc,
-                                const char **fromP,
-                                const char *fromLim,
-                                unsigned short **toP,
-diff --git a/lib/xmltok_impl.c b/lib/xmltok_impl.c
-index 9c2895b..6c5a3ba 100644
---- a/lib/xmltok_impl.c
-+++ b/lib/xmltok_impl.c
-@@ -93,13 +93,13 @@ static int PTRCALL
- PREFIX(scanComment)(const ENCODING *enc, const char *ptr,
-                     const char *end, const char **nextTokPtr)
- {
--  if (ptr != end) {
-+  if (ptr < end) {
-     if (!CHAR_MATCHES(enc, ptr, ASCII_MINUS)) {
-       *nextTokPtr = ptr;
-       return XML_TOK_INVALID;
-     }
-     ptr += MINBPC(enc);
--    while (ptr != end) {
-+    while (ptr < end) {
-       switch (BYTE_TYPE(enc, ptr)) {
-       INVALID_CASES(ptr, nextTokPtr)
-       case BT_MINUS:
-@@ -147,7 +147,7 @@ PREFIX(scanDecl)(const ENCODING *enc, const char *ptr,
-     *nextTokPtr = ptr;
-     return XML_TOK_INVALID;
-   }
--  while (ptr != end) {
-+  while (ptr < end) {
-     switch (BYTE_TYPE(enc, ptr)) {
-     case BT_PERCNT:
-       if (ptr + MINBPC(enc) == end)
-@@ -233,7 +233,7 @@ PREFIX(scanPi)(const ENCODING *enc, const char *ptr,
-     *nextTokPtr = ptr;
-     return XML_TOK_INVALID;
-   }
--  while (ptr != end) {
-+  while (ptr < end) {
-     switch (BYTE_TYPE(enc, ptr)) {
-     CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
-     case BT_S: case BT_CR: case BT_LF:
-@@ -242,7 +242,7 @@ PREFIX(scanPi)(const ENCODING *enc, const char *ptr,
-         return XML_TOK_INVALID;
-       }
-       ptr += MINBPC(enc);
--      while (ptr != end) {
-+      while (ptr < end) {
-         switch (BYTE_TYPE(enc, ptr)) {
-         INVALID_CASES(ptr, nextTokPtr)
-         case BT_QUEST:
-@@ -305,7 +305,7 @@ static int PTRCALL
- PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr,
-                         const char *end, const char **nextTokPtr)
- {
--  if (ptr == end)
-+  if (ptr >= end)
-     return XML_TOK_NONE;
-   if (MINBPC(enc) > 1) {
-     size_t n = end - ptr;
-@@ -348,7 +348,7 @@ PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr,
-     ptr += MINBPC(enc);
-     break;
-   }
--  while (ptr != end) {
-+  while (ptr < end) {
-     switch (BYTE_TYPE(enc, ptr)) {
- #define LEAD_CASE(n) \
-     case BT_LEAD ## n: \
-@@ -391,11 +391,11 @@ PREFIX(scanEndTag)(const ENCODING *enc, const char *ptr,
-     *nextTokPtr = ptr;
-     return XML_TOK_INVALID;
-   }
--  while (ptr != end) {
-+  while (ptr < end) {
-     switch (BYTE_TYPE(enc, ptr)) {
-     CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
-     case BT_S: case BT_CR: case BT_LF:
--      for (ptr += MINBPC(enc); ptr != end; ptr += MINBPC(enc)) {
-+      for (ptr += MINBPC(enc); ptr < end; ptr += MINBPC(enc)) {
-         switch (BYTE_TYPE(enc, ptr)) {
-         case BT_S: case BT_CR: case BT_LF:
-           break;
-@@ -432,7 +432,7 @@ static int PTRCALL
- PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr,
-                        const char *end, const char **nextTokPtr)
- {
--  if (ptr != end) {
-+  if (ptr < end) {
-     switch (BYTE_TYPE(enc, ptr)) {
-     case BT_DIGIT:
-     case BT_HEX:
-@@ -441,7 +441,7 @@ PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr,
-       *nextTokPtr = ptr;
-       return XML_TOK_INVALID;
-     }
--    for (ptr += MINBPC(enc); ptr != end; ptr += MINBPC(enc)) {
-+    for (ptr += MINBPC(enc); ptr < end; ptr += MINBPC(enc)) {
-       switch (BYTE_TYPE(enc, ptr)) {
-       case BT_DIGIT:
-       case BT_HEX:
-@@ -464,7 +464,7 @@ static int PTRCALL
- PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr,
-                     const char *end, const char **nextTokPtr)
- {
--  if (ptr != end) {
-+  if (ptr < end) {
-     if (CHAR_MATCHES(enc, ptr, ASCII_x))
-       return PREFIX(scanHexCharRef)(enc, ptr + MINBPC(enc), end, nextTokPtr);
-     switch (BYTE_TYPE(enc, ptr)) {
-@@ -474,7 +474,7 @@ PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr,
-       *nextTokPtr = ptr;
-       return XML_TOK_INVALID;
-     }
--    for (ptr += MINBPC(enc); ptr != end; ptr += MINBPC(enc)) {
-+    for (ptr += MINBPC(enc); ptr < end; ptr += MINBPC(enc)) {
-       switch (BYTE_TYPE(enc, ptr)) {
-       case BT_DIGIT:
-         break;
-@@ -506,7 +506,7 @@ PREFIX(scanRef)(const ENCODING *enc, const char *ptr, const char *end,
-     *nextTokPtr = ptr;
-     return XML_TOK_INVALID;
-   }
--  while (ptr != end) {
-+  while (ptr < end) {
-     switch (BYTE_TYPE(enc, ptr)) {
-     CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
-     case BT_SEMI:
-@@ -529,7 +529,7 @@ PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end,
- #ifdef XML_NS
-   int hadColon = 0;
- #endif
--  while (ptr != end) {
-+  while (ptr < end) {
-     switch (BYTE_TYPE(enc, ptr)) {
-     CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
- #ifdef XML_NS
-@@ -716,7 +716,7 @@ PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end,
-   hadColon = 0;
- #endif
-   /* we have a start-tag */
--  while (ptr != end) {
-+  while (ptr < end) {
-     switch (BYTE_TYPE(enc, ptr)) {
-     CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
- #ifdef XML_NS
-@@ -740,7 +740,7 @@ PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end,
-     case BT_S: case BT_CR: case BT_LF:
-       {
-         ptr += MINBPC(enc);
--        while (ptr != end) {
-+        while (ptr < end) {
-           switch (BYTE_TYPE(enc, ptr)) {
-           CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr)
-           case BT_GT:
-@@ -785,7 +785,7 @@ static int PTRCALL
- PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end,
-                    const char **nextTokPtr)
- {
--  if (ptr == end)
-+  if (ptr >= end)
-     return XML_TOK_NONE;
-   if (MINBPC(enc) > 1) {
-     size_t n = end - ptr;
-@@ -832,7 +832,7 @@ PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end,
-     ptr += MINBPC(enc);
-     break;
-   }
--  while (ptr != end) {
-+  while (ptr < end) {
-     switch (BYTE_TYPE(enc, ptr)) {
- #define LEAD_CASE(n) \
-     case BT_LEAD ## n: \
-@@ -895,7 +895,7 @@ PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end,
-     *nextTokPtr = ptr;
-     return XML_TOK_INVALID;
-   }
--  while (ptr != end) {
-+  while (ptr < end) {
-     switch (BYTE_TYPE(enc, ptr)) {
-     CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
-     case BT_SEMI:
-@@ -921,7 +921,7 @@ PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end,
-     *nextTokPtr = ptr;
-     return XML_TOK_INVALID;
-   }
--  while (ptr != end) {
-+  while (ptr < end) {
-     switch (BYTE_TYPE(enc, ptr)) {
-     CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
-     case BT_CR: case BT_LF: case BT_S:
-@@ -941,7 +941,7 @@ PREFIX(scanLit)(int open, const ENCODING *enc,
-                 const char *ptr, const char *end,
-                 const char **nextTokPtr)
- {
--  while (ptr != end) {
-+  while (ptr < end) {
-     int t = BYTE_TYPE(enc, ptr);
-     switch (t) {
-     INVALID_CASES(ptr, nextTokPtr)
-@@ -973,7 +973,7 @@ PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
-                   const char **nextTokPtr)
- {
-   int tok;
--  if (ptr == end)
-+  if (ptr >= end)
-     return XML_TOK_NONE;
-   if (MINBPC(enc) > 1) {
-     size_t n = end - ptr;
-@@ -1141,7 +1141,7 @@ PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end,
-     *nextTokPtr = ptr;
-     return XML_TOK_INVALID;
-   }
--  while (ptr != end) {
-+  while (ptr < end) {
-     switch (BYTE_TYPE(enc, ptr)) {
-     CHECK_NAME_CASES(enc, ptr, end, nextTokPtr)
-     case BT_GT: case BT_RPAR: case BT_COMMA:
-@@ -1204,10 +1204,10 @@ PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr,
-                           const char *end, const char **nextTokPtr)
- {
-   const char *start;
--  if (ptr == end)
-+  if (ptr >= end)
-     return XML_TOK_NONE;
-   start = ptr;
--  while (ptr != end) {
-+  while (ptr < end) {
-     switch (BYTE_TYPE(enc, ptr)) {
- #define LEAD_CASE(n) \
-     case BT_LEAD ## n: ptr += n; break;
-@@ -1262,10 +1262,10 @@ PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr,
-                        const char *end, const char **nextTokPtr)
- {
-   const char *start;
--  if (ptr == end)
-+  if (ptr >= end)
-     return XML_TOK_NONE;
-   start = ptr;
--  while (ptr != end) {
-+  while (ptr < end) {
-     switch (BYTE_TYPE(enc, ptr)) {
- #define LEAD_CASE(n) \
-     case BT_LEAD ## n: ptr += n; break;
-@@ -1326,7 +1326,7 @@ PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr,
-       end = ptr + n;
-     }
-   }
--  while (ptr != end) {
-+  while (ptr < end) {
-     switch (BYTE_TYPE(enc, ptr)) {
-     INVALID_CASES(ptr, nextTokPtr)
-     case BT_LT:
-@@ -1373,7 +1373,7 @@ PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
- {
-   ptr += MINBPC(enc);
-   end -= MINBPC(enc);
--  for (; ptr != end; ptr += MINBPC(enc)) {
-+  for (; ptr < end; ptr += MINBPC(enc)) {
-     switch (BYTE_TYPE(enc, ptr)) {
-     case BT_DIGIT:
-     case BT_HEX:
-@@ -1760,7 +1760,7 @@ PREFIX(updatePosition)(const ENCODING *enc,
-     case BT_CR:
-       pos->lineNumber++;
-       ptr += MINBPC(enc);
--      if (ptr != end && BYTE_TYPE(enc, ptr) == BT_LF)
-+      if (ptr < end && BYTE_TYPE(enc, ptr) == BT_LF)
-         ptr += MINBPC(enc);
-       pos->columnNumber = (XML_Size)-1;
-       break;
--- 
-2.8.2
-
diff --git a/pkgs/development/libraries/expat/default.nix b/pkgs/development/libraries/expat/default.nix
index 1b663fc21a9..be5772798b4 100644
--- a/pkgs/development/libraries/expat/default.nix
+++ b/pkgs/development/libraries/expat/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "expat-2.1.1";
+  name = "expat-2.2.0";
 
   src = fetchurl {
     url = "mirror://sourceforge/expat/${name}.tar.bz2";
-    sha256 = "0ryyjgvy7jq0qb7a9mhc1giy3bzn56aiwrs8dpydqngplbjq9xdg";
+    sha256 = "1zq4lnwjlw8s9mmachwfvfjf2x3lk24jm41746ykhdcvs7r0zrfr";
   };
 
   outputs = [ "dev" "out" ]; # TODO: fix referrers
@@ -15,8 +15,6 @@ stdenv.mkDerivation rec {
 
   outputMan = "dev"; # tiny page for a dev tool
 
-  patches = [ ./CVE-2015-1283-refix.patch ./CVE-2016-0718-v2-2-1.patch ];
-
   doCheck = true;
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/ffmpeg-full/default.nix b/pkgs/development/libraries/ffmpeg-full/default.nix
index 0f6ffe51d85..8ec1dd283e2 100644
--- a/pkgs/development/libraries/ffmpeg-full/default.nix
+++ b/pkgs/development/libraries/ffmpeg-full/default.nix
@@ -99,7 +99,7 @@
 , libxcbshapeExtlib ? true # X11 grabbing shape rendering
 , libXv ? null # Xlib support
 , lzma ? null # xz-utils
-#, nvenc ? null # NVIDIA NVENC support
+, nvenc ? false, nvidia-video-sdk ? null # NVIDIA NVENC support
 , openal ? null # OpenAL 1.1 capture support
 #, opencl ? null # OpenCL code
 #, opencore-amr ? null # AMR-NB de/encoder & AMR-WB decoder
@@ -232,14 +232,15 @@ assert libxcbshapeExtlib -> libxcb != null;
 assert openglExtlib -> mesa != null;
 assert opensslExtlib -> gnutls == null && openssl != null && nonfreeLicensing;
 assert x11grabExtlib -> libX11 != null && libXv != null;
+assert nvenc -> nvidia-video-sdk != null && nonfreeLicensing;
 
 stdenv.mkDerivation rec {
   name = "ffmpeg-full-${version}";
-  version = "3.0";
+  version = "3.0.2";
 
   src = fetchurl {
-    url = "https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.bz2";
-    sha256 = "1h0k05cj6j0nd2i16z7hc5scpwsbg3sfx68lvm0nlwvz5xxgg7zi";
+    url = "https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz";
+    sha256 = "08sjp4dxgcinmv9ly7nm24swmn2cnbbhvph44ihlplf4n33kr542";
   };
 
   patchPhase = ''patchShebangs .'';
@@ -356,7 +357,7 @@ stdenv.mkDerivation rec {
     (enableFeature libxcbxfixesExtlib "libxcb-xfixes")
     (enableFeature libxcbshapeExtlib "libxcb-shape")
     (enableFeature (lzma != null) "lzma")
-    #(enableFeature nvenc "nvenc")
+    (enableFeature nvenc "nvenc")
     (enableFeature (openal != null) "openal")
     #(enableFeature opencl "opencl")
     #(enableFeature (opencore-amr != null && version3Licensing) "libopencore-amrnb")
@@ -410,6 +411,7 @@ stdenv.mkDerivation rec {
     ++ optionals nonfreeLicensing [ faac fdk_aac openssl ]
     ++ optional ((isLinux || isFreeBSD) && libva != null) libva
     ++ optionals isLinux [ alsaLib libraw1394 libv4l ]
+    ++ optionals nvenc [ nvidia-video-sdk ]
     ++ optionals stdenv.isDarwin [ Cocoa CoreServices AVFoundation MediaToolbox
                                    VideoDecodeAcceleration ];
 
diff --git a/pkgs/development/libraries/ffmpeg-sixel/default.nix b/pkgs/development/libraries/ffmpeg-sixel/default.nix
new file mode 100644
index 00000000000..dced5582cf6
--- /dev/null
+++ b/pkgs/development/libraries/ffmpeg-sixel/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchFromGitHub, pkgconfig, perl, libsixel, yasm
+}:
+
+stdenv.mkDerivation rec {
+
+  name = "ffmpeg-sixel-${version}";
+  version = "nightly-2.3.x";
+
+  src = fetchFromGitHub {
+    owner = "saitoha";
+    repo = "FFmpeg-SIXEL";
+    rev = "8566fdb8b7516b54aed58f329dc216e06fc10052";
+    sha256 = "00s2lggfdj2ibpngpyqqg7360p7yb69ys1ppg59yvv0m0mxk5x3k";
+  };
+
+  buildInputs = [
+    pkgconfig
+    libsixel
+    yasm
+  ];
+
+  configurePhase = ''
+    ./configure --enable-libsixel --prefix=$out
+  '';
+
+  postInstall = ''
+    mv $out/bin/ffmpeg $out/bin/ffmpeg-sixel
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A complete, cross-platform solution to record, convert and stream audio and video, extended to support console graphics";
+    homepage = http://www.ffmpeg.org/;
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ vrthra ];
+  };
+}
diff --git a/pkgs/development/libraries/ffmpeg/3.0.nix b/pkgs/development/libraries/ffmpeg/3.0.nix
deleted file mode 100644
index 14c29f36bed..00000000000
--- a/pkgs/development/libraries/ffmpeg/3.0.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{ callPackage, ... } @ args:
-
-callPackage ./generic.nix (args // rec {
-  version = "${branch}.2";
-  branch = "3.0";
-  sha256 = "0dpx15001ha9p8h8vfg1lm9pggbc96kmb546hz88wdac5xycgqrh";
-})
diff --git a/pkgs/development/libraries/ffmpeg/3.1.nix b/pkgs/development/libraries/ffmpeg/3.1.nix
new file mode 100644
index 00000000000..25892e18684
--- /dev/null
+++ b/pkgs/development/libraries/ffmpeg/3.1.nix
@@ -0,0 +1,7 @@
+{ callPackage, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "${branch}.1";
+  branch = "3.1";
+  sha256 = "1d5knh87cgnla5zawy56gkrpb48qhyiq7i0pm8z9hyx3j05abg55";
+})
diff --git a/pkgs/development/libraries/fontconfig/default.nix b/pkgs/development/libraries/fontconfig/default.nix
index 6acf1ebce29..f18ea5948f1 100644
--- a/pkgs/development/libraries/fontconfig/default.nix
+++ b/pkgs/development/libraries/fontconfig/default.nix
@@ -68,7 +68,6 @@ stdenv.mkDerivation rec {
     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/frame/default.nix b/pkgs/development/libraries/frame/default.nix
index fa8e9f0ef2c..26357b44049 100644
--- a/pkgs/development/libraries/frame/default.nix
+++ b/pkgs/development/libraries/frame/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "https://launchpad.net/frame";
-    description = "handles the buildup and synchronization of a set of simultaneous touches";
+    description = "Handles the buildup and synchronization of a set of simultaneous touches";
     license = stdenv.lib.licenses.gpl3;
     platforms = stdenv.lib.platforms.linux;
   };
diff --git a/pkgs/development/libraries/ftgl/2.1.2.nix b/pkgs/development/libraries/ftgl/2.1.2.nix
index c83173450b1..0a4a6e6b9b0 100644
--- a/pkgs/development/libraries/ftgl/2.1.2.nix
+++ b/pkgs/development/libraries/ftgl/2.1.2.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation {
 
   meta = {
     homepage = "http://sourceforge.net/apps/mediawiki/ftgl/";
-    description = "font rendering library for OpenGL applications";
+    description = "Font rendering library for OpenGL applications";
     license = stdenv.lib.licenses.gpl3Plus;
 
     longDescription = ''
diff --git a/pkgs/development/libraries/ftgl/default.nix b/pkgs/development/libraries/ftgl/default.nix
index ce750fc1696..8fc69ec7568 100644
--- a/pkgs/development/libraries/ftgl/default.nix
+++ b/pkgs/development/libraries/ftgl/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
 
   meta = {
     homepage = "http://sourceforge.net/apps/mediawiki/ftgl/";
-    description = "font rendering library for OpenGL applications";
+    description = "Font rendering library for OpenGL applications";
     license = stdenv.lib.licenses.gpl3Plus;
 
     longDescription = ''
diff --git a/pkgs/development/libraries/gd/default.nix b/pkgs/development/libraries/gd/default.nix
index 4a136f6de3f..8e5005d6b90 100644
--- a/pkgs/development/libraries/gd/default.nix
+++ b/pkgs/development/libraries/gd/default.nix
@@ -12,11 +12,11 @@
 
 stdenv.mkDerivation rec {
   name = "gd-${version}";
-  version = "2.2.1";
+  version = "2.2.2";
 
   src = fetchurl {
     url = "https://github.com/libgd/libgd/releases/download/${name}/libgd-${version}.tar.xz";
-    sha256 = "0xmrqka1ggqgml84xbmkw1y0r0lg7qn657v5b1my8pry92p651vh";
+    sha256 = "1311g5mva2xlzqv3rjqjc4jjkn5lzls4skvr395h633zw1n7b7s8";
   };
 
   hardeningDisable = [ "format" ];
diff --git a/pkgs/development/libraries/gdbm/default.nix b/pkgs/development/libraries/gdbm/default.nix
index 63ba69fee08..bd5ee16eb67 100644
--- a/pkgs/development/libraries/gdbm/default.nix
+++ b/pkgs/development/libraries/gdbm/default.nix
@@ -1,16 +1,16 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "gdbm-1.11";
+  name = "gdbm-1.12";
 
   src = fetchurl {
     url = "mirror://gnu/gdbm/${name}.tar.gz";
-    sha256 = "1hz3jgh3pd4qzp6jy0l8pd8x01g9abw7csnrlnj1a2sxy122z4cd";
+    sha256 = "1smwz4x5qa4js0zf1w3asq6z7mh20zlgwbh2bk5dczw6xrk22yyr";
   };
 
   doCheck = true;
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "GNU dbm key/value database library";
 
     longDescription =
@@ -33,8 +33,8 @@ stdenv.mkDerivation rec {
       '';
 
     homepage = http://www.gnu.org/software/gdbm/;
-    license = stdenv.lib.licenses.gpl3Plus;
-    platforms = stdenv.lib.platforms.all;
-    maintainers = [ ];
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+    maintainers = [ maintainers.vrthra ];
   };
 }
diff --git a/pkgs/development/libraries/geis/default.nix b/pkgs/development/libraries/geis/default.nix
index 5ef53ec7939..e8f4001c1b5 100644
--- a/pkgs/development/libraries/geis/default.nix
+++ b/pkgs/development/libraries/geis/default.nix
@@ -1,23 +1,37 @@
-{ enableX11 ? true
-, stdenv, fetchurl, pkgconfig, xorg, xorgserver, python3, dbus_libs, frame, grail }:
+{ stdenv, fetchurl
+, pkgconfig
+, python3
+, dbus_libs
+, evemu
+, frame
+, grail
+, libX11
+, libXext
+, libXi
+, libXtst
+, xorgserver
+}:
+
+with stdenv.lib;
 
 stdenv.mkDerivation rec {
   name = "geis-${version}";
   version = "2.2.16";
+
   src = fetchurl {
     url = "https://launchpad.net/geis/trunk/${version}/+download/${name}.tar.xz";
     sha256 = "40a694092c79f325a2fbf8a9f301177bc91c364f4e637c2aa8963ad2a5aabbcf";
   };
 
-  buildInputs = [ pkgconfig python3 dbus_libs frame grail ]
-  ++ stdenv.lib.optional enableX11 [xorg.libX11 xorg.libXtst xorg.libXext xorg.libXi xorg.xorgserver];
+  NIX_CFLAGS_COMPILE = "-Wno-error=pedantic";
 
-  configureFlags = stdenv.lib.optional enableX11"--enable-x11";
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ python3 dbus_libs evemu frame grail libX11 libXext libXi libXtst xorgserver ];
 
   meta = {
-    homepage = "https://launchpad.net/geis";
-    description = "A library for applications and toolkit programmers which provides a consistent platform independent interface for any system-wide input gesture recognition mechanism";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.linux;
+    description = "A library for input gesture recognition";
+    homepage = https://launchpad.net/geis;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix
index 1d3644be6a7..7d555ba4d06 100644
--- a/pkgs/development/libraries/gettext/default.nix
+++ b/pkgs/development/libraries/gettext/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "gettext-${version}";
-  version = "0.19.7";
+  version = "0.19.8";
 
   src = fetchurl {
     url = "mirror://gnu/gettext/${name}.tar.gz";
-    sha256 = "0gy2b2aydj8r0sapadnjw8cmb8j2rynj28d5qs1mfa800njd51jk";
+    sha256 = "13ylc6n3hsk919c7xl0yyibc3pfddzb53avdykn4hmk8g6yzd91x";
   };
   patches = [ ./absolute-paths.diff ];
 
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
     sed -i -e "s/\(am_libgettextlib_la_OBJECTS = \)error.lo/\\1/" gettext-tools/gnulib-lib/Makefile.in
   '';
 
-  buildInputs = [ xz xz.bin libiconv ];
+  nativeBuildInputs = [ xz xz.bin ] ++ stdenv.lib.optional (!stdenv.isLinux) libiconv; # HACK, see #10874 (and 14664)
 
   enableParallelBuilding = true;
 
@@ -81,7 +81,7 @@ stdenv.mkDerivation rec {
 
     homepage = http://www.gnu.org/software/gettext/;
 
-    maintainers = with lib.maintainers; [ zimbatm ];
+    maintainers = with lib.maintainers; [ zimbatm vrthra ];
     platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/libraries/git2/0.21.nix b/pkgs/development/libraries/git2/0.21.nix
index 823f09b8bce..4ea43086548 100644
--- a/pkgs/development/libraries/git2/0.21.nix
+++ b/pkgs/development/libraries/git2/0.21.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ zlib libssh2 openssl http-parser ];
 
   meta = {
-    description = "the Git linkable library";
+    description = "The Git linkable library";
     homepage = http://libgit2.github.com/;
     license = stdenv.lib.licenses.gpl2;
     platforms = with stdenv.lib.platforms; all;
diff --git a/pkgs/development/libraries/git2/default.nix b/pkgs/development/libraries/git2/default.nix
index 3e9e0bea8e3..7aaac299b0e 100644
--- a/pkgs/development/libraries/git2/default.nix
+++ b/pkgs/development/libraries/git2/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation (rec {
   buildInputs = [ zlib libssh2 openssl http-parser ];
 
   meta = {
-    description = "the Git linkable library";
+    description = "The Git linkable library";
     homepage = http://libgit2.github.com/;
     license = stdenv.lib.licenses.gpl2;
     platforms = with stdenv.lib.platforms; all;
diff --git a/pkgs/development/libraries/gle/default.nix b/pkgs/development/libraries/gle/default.nix
new file mode 100644
index 00000000000..64f51a56fd3
--- /dev/null
+++ b/pkgs/development/libraries/gle/default.nix
@@ -0,0 +1,18 @@
+{stdenv, fetchurl, mesa, freeglut, libX11, libXt, libXmu, libXi, libXext}:
+stdenv.mkDerivation {
+  name = "gle-3.1.0";
+  buildInputs = [mesa freeglut libX11 libXt libXmu libXi libXext];
+  src = fetchurl {
+    urls = [
+      "mirror://sourceforge/project/gle/gle/gle-3.1.0/gle-3.1.0.tar.gz"
+      "http://www.linas.org/gle/pub/gle-3.1.0.tar.gz"
+      ];
+    sha256 = "09zs1di4dsssl9k322nzildvf41jwipbzhik9p43yb1bcfsp92nw";
+  };
+  meta = {
+    description = ''Tubing and extrusion library'';
+    license = stdenv.lib.licenses.gpl2 ;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/glfw/3.x.nix b/pkgs/development/libraries/glfw/3.x.nix
index 681137cd590..3b015532ca8 100644
--- a/pkgs/development/libraries/glfw/3.x.nix
+++ b/pkgs/development/libraries/glfw/3.x.nix
@@ -3,14 +3,14 @@
 }:
 
 stdenv.mkDerivation rec {
-  version = "3.1.2";
+  version = "3.2";
   name = "glfw-${version}";
 
   src = fetchFromGitHub {
     owner = "glfw";
     repo = "GLFW";
     rev = "${version}";
-    sha256 = "1aj1dfyyd0170gpz32j2xlqbvbsxwbg028xiqai3mqc44xfp10kw";
+    sha256 = "0knqf40jij2z1mia091xqyky5r11r4qyh7b8172blrmgm9q23sl9";
   };
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/glibc/builder.sh b/pkgs/development/libraries/glibc/builder.sh
deleted file mode 100644
index 85f27c7b355..00000000000
--- a/pkgs/development/libraries/glibc/builder.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-# Glibc cannot have itself in its RPATH.
-export NIX_NO_SELF_RPATH=1
-
-source $stdenv/setup
-
-postConfigure() {
-    # Hack: get rid of the `-static' flag set by the bootstrap stdenv.
-    # This has to be done *after* `configure' because it builds some
-    # test binaries.
-    export NIX_CFLAGS_LINK=
-    export NIX_LDFLAGS_BEFORE=
-
-    export NIX_DONT_SET_RPATH=1
-    unset CFLAGS
-
-    # Apparently --bindir is not respected.
-    makeFlagsArray+=("bindir=$bin/bin" "sbindir=$bin/sbin" "rootsbindir=$bin/sbin")
-}
-
-postInstall() {
-    if test -n "$installLocales"; then
-        make -j${NIX_BUILD_CORES:-1} -l${NIX_BUILD_CORES:-1} localedata/install-locales
-    fi
-
-    test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache
-
-    if test -n "$linuxHeaders"; then
-        # Include the Linux kernel headers in Glibc, except the `scsi'
-        # subdirectory, which Glibc provides itself.
-        (cd $dev/include && \
-         ln -sv $(ls -d $linuxHeaders/include/* | grep -v 'scsi$') .)
-    fi
-
-    # Fix for NIXOS-54 (ldd not working on x86_64).  Make a symlink
-    # "lib64" to "lib".
-    if test -n "$is64bit"; then
-        ln -s lib $out/lib64
-    fi
-
-    # Get rid of more unnecessary stuff.
-    rm -rf $out/var $out/sbin/sln
-
-    for i in $out/lib/*.a; do
-        strip -S "$i"
-    done
-    # Put libraries for static linking in a separate output.  Note
-    # that libc_nonshared.a and libpthread_nonshared.a are required
-    # for dynamically-linked applications.
-    mkdir -p $static/lib
-    mv $out/lib/*.a $static/lib
-    mv $static/lib/lib*_nonshared.a $out/lib
-
-    # Work around a Nix bug: hard links across outputs cause a build failure.
-    cp $bin/bin/getconf $bin/bin/getconf_
-    mv $bin/bin/getconf_ $bin/bin/getconf
-}
-
-genericBuild
diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix
index a189edb9832..e90fdc4ad7b 100644
--- a/pkgs/development/libraries/glibc/common.nix
+++ b/pkgs/development/libraries/glibc/common.nix
@@ -54,6 +54,7 @@ stdenv.mkDerivation ({
       ./glob-simplify-interface.patch
       ./cve-2016-1234.patch
       ./cve-2016-3706.patch
+      ./fix_warnings.patch
     ];
 
   postPatch =
diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix
index a164c21890e..83b554a34ae 100644
--- a/pkgs/development/libraries/glibc/default.nix
+++ b/pkgs/development/libraries/glibc/default.nix
@@ -17,7 +17,21 @@ in
     inherit lib stdenv fetchurl linuxHeaders installLocales
       profilingLibraries gccCross withGd gd libpng;
 
-    builder = ./builder.sh;
+    NIX_NO_SELF_RPATH = true;
+
+    postConfigure = ''
+      # Hack: get rid of the `-static' flag set by the bootstrap stdenv.
+      # This has to be done *after* `configure' because it builds some
+      # test binaries.
+      export NIX_CFLAGS_LINK=
+      export NIX_LDFLAGS_BEFORE=
+
+      export NIX_DONT_SET_RPATH=1
+      unset CFLAGS
+
+      # Apparently --bindir is not respected.
+      makeFlagsArray+=("bindir=$bin/bin" "sbindir=$bin/sbin" "rootsbindir=$bin/sbin")
+    '';
 
     hardeningDisable = [ "stackprotector" "fortify" ];
 
@@ -28,7 +42,7 @@ in
     # Building from a proper gcc staying in the path where it was installed,
     # libgcc_s will not be at {gcc}/lib, and gcc's libgcc will be found without
     # any special hack.
-    preInstall = if cross != null then "" else ''
+    preInstall = ''
       if [ -f ${stdenv.cc.cc}/lib/libgcc_s.so.1 ]; then
           mkdir -p $out/lib
           cp ${stdenv.cc.cc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
@@ -37,6 +51,49 @@ in
       fi
     '';
 
+    postInstall = ''
+      if test -n "$installLocales"; then
+          make -j''${NIX_BUILD_CORES:-1} -l''${NIX_BUILD_CORES:-1} localedata/install-locales
+      fi
+
+      test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache
+
+      if test -n "$linuxHeaders"; then
+          # Include the Linux kernel headers in Glibc, except the `scsi'
+          # subdirectory, which Glibc provides itself.
+          (cd $dev/include && \
+           ln -sv $(ls -d $linuxHeaders/include/* | grep -v scsi\$) .)
+      fi
+
+      # Fix for NIXOS-54 (ldd not working on x86_64).  Make a symlink
+      # "lib64" to "lib".
+      if test -n "$is64bit"; then
+          ln -s lib $out/lib64
+      fi
+
+      # Get rid of more unnecessary stuff.
+      rm -rf $out/var $out/sbin/sln
+
+      # For some reason these aren't stripped otherwise and retain reference
+      # to bootstrap-tools; on cross-arm this stripping would break objects.
+      if [ -z "$crossConfig" ]; then
+        for i in "$out"/lib/*.a; do
+            strip -S "$i"
+        done
+      fi
+
+      # Put libraries for static linking in a separate output.  Note
+      # that libc_nonshared.a and libpthread_nonshared.a are required
+      # for dynamically-linked applications.
+      mkdir -p $static/lib
+      mv $out/lib/*.a $static/lib
+      mv $static/lib/lib*_nonshared.a $out/lib
+
+      # Work around a Nix bug: hard links across outputs cause a build failure.
+      cp $bin/bin/getconf $bin/bin/getconf_
+      mv $bin/bin/getconf_ $bin/bin/getconf
+    '';
+
     separateDebugInfo = true;
 
     meta.description = "The GNU C Library";
@@ -64,6 +121,10 @@ in
         dontStrip=1
       '';
 
+      preInstall = null; # clobber the native hook
+
+      separateDebugInfo = false; # this is currently broken for crossDrv
+
       # To avoid a dependency on the build system 'bash'.
       preFixup = ''
         rm $bin/bin/{ldd,tzselect,catchsegv,xtrace}
diff --git a/pkgs/development/libraries/glibc/fix_warnings.patch b/pkgs/development/libraries/glibc/fix_warnings.patch
new file mode 100644
index 00000000000..fd75c18c84e
--- /dev/null
+++ b/pkgs/development/libraries/glibc/fix_warnings.patch
@@ -0,0 +1,36 @@
+--- 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/gmp/6.x.nix b/pkgs/development/libraries/gmp/6.x.nix
index d17ac5b8760..32009406a73 100644
--- a/pkgs/development/libraries/gmp/6.x.nix
+++ b/pkgs/development/libraries/gmp/6.x.nix
@@ -3,11 +3,11 @@
 with { inherit (stdenv.lib) optional optionalString; };
 
 let self = stdenv.mkDerivation rec {
-  name = "gmp-6.1.0";
+  name = "gmp-6.1.1";
 
   src = fetchurl { # we need to use bz2, others aren't in bootstrapping stdenv
     urls = [ "mirror://gnu/gmp/${name}.tar.bz2" "ftp://ftp.gmplib.org/pub/${name}/${name}.tar.bz2" ];
-    sha256 = "1s3kddydvngqrpc6i1vbz39raya2jdcl042wi0ksbszgjjllk129";
+    sha256 = "1mpzprdzkgfpdc1v2lf4dxlxps4x8bvmzvd8n1ri6gw9y9jrh458";
   };
 
   #outputs TODO: split $cxx due to libstdc++ dependency; maybe port to gmp5;
@@ -73,7 +73,7 @@ let self = stdenv.mkDerivation rec {
       '';
 
     platforms = platforms.all;
-    maintainers = [ maintainers.peti ];
+    maintainers = [ maintainers.peti maintainers.vrthra ];
   };
 };
   in self
diff --git a/pkgs/development/libraries/gnutls/3.4.nix b/pkgs/development/libraries/gnutls/3.4.nix
index 71c3010467c..4882e5dda04 100644
--- a/pkgs/development/libraries/gnutls/3.4.nix
+++ b/pkgs/development/libraries/gnutls/3.4.nix
@@ -1,11 +1,11 @@
 { callPackage, fetchurl, autoreconfHook, ... } @ args:
 
 callPackage ./generic.nix (args // rec {
-  version = "3.4.11";
+  version = "3.4.13";
 
   src = fetchurl {
     url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.4/gnutls-${version}.tar.xz";
-    sha256 = "1f4sbb38xab46h67a3pm6kybgrahjx3vbrn66qq3cbc2jngrrvvh";
+    sha256 = "0naqs9g5b577j1j7q55ma1vcn78jl2d98h3zrl5rh997wzl8cczx";
   };
 
   # This fixes some broken parallel dependencies
diff --git a/pkgs/development/libraries/gnutls/3.5.nix b/pkgs/development/libraries/gnutls/3.5.nix
new file mode 100644
index 00000000000..82bd437d721
--- /dev/null
+++ b/pkgs/development/libraries/gnutls/3.5.nix
@@ -0,0 +1,17 @@
+{ callPackage, fetchurl, autoreconfHook, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "3.5.1";
+
+  src = fetchurl {
+    url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.5/gnutls-${version}.tar.xz";
+    sha256 = "1gdxr1p1sigigwvangqf3v31i8fda07d6ngawykarhr7ls00yjmw";
+  };
+
+  # 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/generic.nix b/pkgs/development/libraries/gnutls/generic.nix
index b54ea52b880..9866dd9fd3a 100644
--- a/pkgs/development/libraries/gnutls/generic.nix
+++ b/pkgs/development/libraries/gnutls/generic.nix
@@ -1,21 +1,31 @@
 { lib, fetchurl, stdenv, zlib, lzo, libtasn1, nettle, pkgconfig, lzip
 , guileBindings, guile, perl, gmp, autogen, libidn, p11_kit, unbound, libiconv
-, tpmSupport ? false, trousers
+, tpmSupport ? false, trousers, nettools, bash
 
 # Version dependent args
 , version, src, patches ? [], postPatch ? "", nativeBuildInputs ? []
 , ...}:
 
 assert guileBindings -> guile != null;
-
+let
+  # XXX: Gnulib's `test-select' fails on FreeBSD:
+  # http://hydra.nixos.org/build/2962084/nixlog/1/raw .
+  doCheck = (!stdenv.isFreeBSD && !stdenv.isDarwin);
+in
 stdenv.mkDerivation {
   name = "gnutls-${version}";
 
-  inherit src patches postPatch;
+  inherit src patches;
 
   outputs = [ "dev" "out" "bin" "man" "docdev" ];
   outputInfo = "docdev";
 
+  postPatch = ''
+    sed '2iecho "name constraints tests skipped due to datefudge problems"\nexit 0' \
+      -i tests/cert-tests/name-constraints
+  '' + postPatch;
+
+  preConfigure = "patchShebangs .";
   configureFlags =
     lib.optional stdenv.isLinux "--with-default-trust-store-file=/etc/ssl/certs/ca-certificates.crt"
   ++ [
@@ -30,6 +40,7 @@ stdenv.mkDerivation {
   enableParallelBuilding = !guileBindings;
 
   buildInputs = [ lzo lzip nettle libtasn1 libidn p11_kit zlib gmp autogen ]
+    ++ lib.optional doCheck nettools
     ++ lib.optional (stdenv.isFreeBSD || stdenv.isDarwin) libiconv
     ++ lib.optional (tpmSupport && stdenv.isLinux) trousers
     ++ [ unbound ]
@@ -37,9 +48,7 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ perl pkgconfig ] ++ nativeBuildInputs;
 
-  # XXX: Gnulib's `test-select' fails on FreeBSD:
-  # http://hydra.nixos.org/build/2962084/nixlog/1/raw .
-  doCheck = (!stdenv.isFreeBSD && !stdenv.isDarwin);
+  inherit doCheck;
 
   # Fixup broken libtool and pkgconfig files
   preFixup = lib.optionalString (!stdenv.isDarwin) ''
diff --git a/pkgs/development/libraries/gobject-introspection/separate-rpath-arg.patch b/pkgs/development/libraries/gobject-introspection/separate-rpath-arg.patch
deleted file mode 100644
index 1f25aa1f898..00000000000
--- a/pkgs/development/libraries/gobject-introspection/separate-rpath-arg.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -ur gobject-introspection-1.46.0-orig/giscanner/ccompiler.py gobject-introspection-1.46.0/giscanner/ccompiler.py
---- gobject-introspection-1.46.0-orig/giscanner/ccompiler.py	2016-02-01 12:25:41.000000000 -0500
-+++ gobject-introspection-1.46.0/giscanner/ccompiler.py	2016-02-01 12:26:52.000000000 -0500
-@@ -128,7 +128,7 @@
-                     self.compiler.add_runtime_library_dir('.')
- 
-                 # https://bugzilla.gnome.org/show_bug.cgi?id=625195
--                args.append('-Wl,-rpath=.')
-+                args.append('-Wl,-rpath,.')
- 
-                 # Ensure libraries are always linked as we are going to use ldd to work
-                 # out their names later
-@@ -140,7 +140,7 @@
-                 for library_path in libpaths:
-                     args.append('-L' + library_path)
-                     if os.path.isabs(library_path):
--                        args.append('-Wl,-rpath=' + library_path)
-+                        args.append('-Wl,-rpath,' + library_path)
- 
-         else:
-             # libtool case: assemble linker command arguments, like we did before
diff --git a/pkgs/development/libraries/gstreamer/bad/default.nix b/pkgs/development/libraries/gstreamer/bad/default.nix
index d907450babb..ffe21d43792 100644
--- a/pkgs/development/libraries/gstreamer/bad/default.nix
+++ b/pkgs/development/libraries/gstreamer/bad/default.nix
@@ -14,7 +14,7 @@ let
   inherit (stdenv.lib) optional optionalString;
 in
 stdenv.mkDerivation rec {
-  name = "gst-plugins-bad-1.8.1";
+  name = "gst-plugins-bad-1.8.2";
 
   meta = with stdenv.lib; {
     description = "Gstreamer Bad Plugins";
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "${meta.homepage}/src/gst-plugins-bad/${name}.tar.xz";
-    sha256 = "1xa0r98vf0sxw6s90yysvfpzs9yl07xxdci0lv2c0kvkcgrmig8b";
+    sha256 = "d7995317530c8773ec088f94d9320909d41da61996b801ebacce9a56af493f97";
   };
 
   outputs = [ "dev" "out" ];
diff --git a/pkgs/development/libraries/gstreamer/base/default.nix b/pkgs/development/libraries/gstreamer/base/default.nix
index ddb7f9957dc..76f2662ec43 100644
--- a/pkgs/development/libraries/gstreamer/base/default.nix
+++ b/pkgs/development/libraries/gstreamer/base/default.nix
@@ -4,7 +4,7 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "gst-plugins-base-1.8.1";
+  name = "gst-plugins-base-1.8.2";
 
   meta = {
     description = "Base plugins and helper libraries";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "${meta.homepage}/src/gst-plugins-base/${name}.tar.xz";
-    sha256 = "0vxd5w7r1jqp37cw5lhyc6vj2h6z8y9v3xarwd2c6rfjbjcdxa8m";
+    sha256 = "9d7109c8fb0a5dec8edb17b0053c59a46aba7ddf48dc48ea822ebbbd4339d38d";
   };
 
   outputs = [ "dev" "out" ];
diff --git a/pkgs/development/libraries/gstreamer/core/default.nix b/pkgs/development/libraries/gstreamer/core/default.nix
index 95d89b411c5..43aec752054 100644
--- a/pkgs/development/libraries/gstreamer/core/default.nix
+++ b/pkgs/development/libraries/gstreamer/core/default.nix
@@ -3,7 +3,7 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "gstreamer-1.8.1";
+  name = "gstreamer-1.8.2";
 
   meta = {
     description = "Open source multimedia framework";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "${meta.homepage}/src/gstreamer/${name}.tar.xz";
-    sha256 = "01ribrzc4x9xlv6ci66w2svpqxywjc129m6f2xy9gp82jgxj4dss";
+    sha256 = "9dbebe079c2ab2004ef7f2649fa317cabea1feb4fb5605c24d40744b90918341";
   };
 
   outputs = [ "dev" "out" ];
diff --git a/pkgs/development/libraries/gstreamer/ges/default.nix b/pkgs/development/libraries/gstreamer/ges/default.nix
index fd1dd6724c3..836bcb6ce66 100644
--- a/pkgs/development/libraries/gstreamer/ges/default.nix
+++ b/pkgs/development/libraries/gstreamer/ges/default.nix
@@ -3,7 +3,7 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "gstreamer-editing-services-1.8.1";
+  name = "gstreamer-editing-services-1.8.2";
 
   meta = with stdenv.lib; {
     description = "Library for creation of audio/video non-linear editors";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "${meta.homepage}/src/gstreamer-editing-services/${name}.tar.xz";
-    sha256 = "082h6r2kymgb78x6av5mxaszxlqnvr6afq935ackh914vb1anyw9";
+    sha256 = "a1d57ff9461407cca1f6e7a9f31a5bdb73f73f33c488a3e3318b27e10a4332ae";
   };
 
   outputs = [ "dev" "out" ];
diff --git a/pkgs/development/libraries/gstreamer/good/default.nix b/pkgs/development/libraries/gstreamer/good/default.nix
index c1846cad23c..1bd80cfa1c7 100644
--- a/pkgs/development/libraries/gstreamer/good/default.nix
+++ b/pkgs/development/libraries/gstreamer/good/default.nix
@@ -10,7 +10,7 @@ let
   inherit (stdenv.lib) optionals optionalString;
 in
 stdenv.mkDerivation rec {
-  name = "gst-plugins-good-1.8.1";
+  name = "gst-plugins-good-1.8.2";
 
   meta = with stdenv.lib; {
     description = "Gstreamer Good Plugins";
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "${meta.homepage}/src/gst-plugins-good/${name}.tar.xz";
-    sha256 = "0wh9mpz3zj7vbdi3xn9gjncqal86kgxn9pdg5vl98y6n45wy20r1";
+    sha256 = "8d7549118a3b7a009ece6bb38a05b66709c551d32d2adfd89eded4d1d7a23944";
   };
 
   outputs = [ "dev" "out" ];
diff --git a/pkgs/development/libraries/gstreamer/libav/default.nix b/pkgs/development/libraries/gstreamer/libav/default.nix
index 82d64ae691f..312a8a1d394 100644
--- a/pkgs/development/libraries/gstreamer/libav/default.nix
+++ b/pkgs/development/libraries/gstreamer/libav/default.nix
@@ -9,7 +9,7 @@
 assert withSystemLibav -> libav != null;
 
 stdenv.mkDerivation rec {
-  name = "gst-libav-1.8.1";
+  name = "gst-libav-1.8.2";
 
   meta = {
     homepage = "http://gstreamer.freedesktop.org";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "${meta.homepage}/src/gst-libav/${name}.tar.xz";
-    sha256 = "0cw9nc0079vmdp5r8hrrmglb1bzvsxy298j6yg25l6skqc493924";
+    sha256 = "b5f3c7a27b39b5f5c2f0bfd546b0c655020faf6b38d27b64b346c43e5ebf687a";
   };
 
   outputs = [ "dev" "out" ];
diff --git a/pkgs/development/libraries/gstreamer/ugly/default.nix b/pkgs/development/libraries/gstreamer/ugly/default.nix
index bfb6b831962..65490c7db24 100644
--- a/pkgs/development/libraries/gstreamer/ugly/default.nix
+++ b/pkgs/development/libraries/gstreamer/ugly/default.nix
@@ -5,7 +5,7 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "gst-plugins-ugly-1.8.1";
+  name = "gst-plugins-ugly-1.8.2";
 
   meta = with stdenv.lib; {
     description = "Gstreamer Ugly Plugins";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "${meta.homepage}/src/gst-plugins-ugly/${name}.tar.xz";
-    sha256 = "1kj6jijhwdknv362mcnhjm7zbcbhs0i2m3pvsdz7w3g67fd6lrcf";
+    sha256 = "9c5b33a2a98fc1d6d6c99a1b536b1fb2de45f53cc8bf8ab85a8b8141fed1a8ac";
   };
 
   outputs = [ "dev" "out" ];
diff --git a/pkgs/development/libraries/gstreamer/validate/default.nix b/pkgs/development/libraries/gstreamer/validate/default.nix
index 47a401b9011..a837a94eac7 100644
--- a/pkgs/development/libraries/gstreamer/validate/default.nix
+++ b/pkgs/development/libraries/gstreamer/validate/default.nix
@@ -3,7 +3,7 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "gst-validate-1.8.1";
+  name = "gst-validate-1.8.2";
 
   meta = {
     description = "Integration testing infrastructure for the GStreamer framework";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "${meta.homepage}/src/gst-validate/${name}.tar.xz";
-    sha256 = "1gycl6bbrf9ryis6wdinv4zi7552lz9izw4ram8xr8nc2k00icm9";
+    sha256 = "33c5b585c5ca1659fe6c09fdf02e45d8132c0d386b405bf527b14ab481a0bafe";
   };
 
   outputs = [ "dev" "out" ];
diff --git a/pkgs/development/libraries/gtk+/3.x.nix b/pkgs/development/libraries/gtk+/3.x.nix
index e6c95963865..0f33f2a5f7f 100644
--- a/pkgs/development/libraries/gtk+/3.x.nix
+++ b/pkgs/development/libraries/gtk+/3.x.nix
@@ -1,6 +1,7 @@
 { stdenv, fetchurl, pkgconfig, gettext, perl
 , expat, glib, cairo, pango, gdk_pixbuf, atk, at_spi2_atk, gobjectIntrospection
-, xorg, wayland, epoxy, json_glib, libxkbcommon, gmp
+, xorg, epoxy, json_glib, libxkbcommon, gmp
+, waylandSupport ? stdenv.isLinux, wayland, wayland-protocols
 , xineramaSupport ? stdenv.isLinux
 , cupsSupport ? stdenv.isLinux, cups ? null
 , darwin
@@ -12,7 +13,7 @@ with stdenv.lib;
 
 let
   ver_maj = "3.20";
-  ver_min = "5";
+  ver_min = "6";
   version = "${ver_maj}.${ver_min}";
 in
 stdenv.mkDerivation rec {
@@ -20,7 +21,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/gtk+/${ver_maj}/gtk+-${version}.tar.xz";
-    sha256 = "9790b0267384904ad8a08e7f16e5f9ff1c4037de57788d48d1eaf528355b1564";
+    sha256 = "3f8016563a96b1cfef4ac9e795647f6316deb2978ff939b19e4e4f8f936fa4b2";
   };
 
   outputs = [ "dev" "out" ];
@@ -34,7 +35,7 @@ stdenv.mkDerivation rec {
   propagatedBuildInputs = with xorg; with stdenv.lib;
     [ expat glib cairo pango gdk_pixbuf atk at_spi2_atk
       libXrandr libXrender libXcomposite libXi libXcursor libSM libICE ]
-    ++ optionals stdenv.isLinux [ wayland ]
+    ++ optionals waylandSupport [ wayland wayland-protocols ]
     ++ optional stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ AppKit Cocoa ])
     ++ optional xineramaSupport libXinerama
     ++ optional cupsSupport cups;
@@ -53,6 +54,10 @@ stdenv.mkDerivation rec {
     "--disable-glibtest"
     "--with-gdktarget=quartz"
     "--enable-quartz-backend"
+  ] ++ optional stdenv.isLinux [
+    "--enable-x11-backend"
+  ] ++ optional waylandSupport [
+    "--enable-wayland-backend"
   ];
 
   postInstall = ''
diff --git a/pkgs/development/libraries/icu/54.1.nix b/pkgs/development/libraries/icu/54.1.nix
new file mode 100644
index 00000000000..4d780341b3a
--- /dev/null
+++ b/pkgs/development/libraries/icu/54.1.nix
@@ -0,0 +1,12 @@
+{ stdenv, fetchurl, fixDarwinDylibNames }:
+
+let
+  icu = import ./default.nix { inherit stdenv fetchurl fixDarwinDylibNames; };
+in
+  stdenv.lib.overrideDerivation icu (attrs: {
+    src = fetchurl {
+      url = "http://download.icu-project.org/files/icu4c/54.1/icu4c-54_1-src.tgz";
+      md5 = "e844caed8f2ca24c088505b0d6271bc0";
+    };
+  })
+
diff --git a/pkgs/development/libraries/idnkit/default.nix b/pkgs/development/libraries/idnkit/default.nix
index 25c8d7e561b..fe816ee5267 100644
--- a/pkgs/development/libraries/idnkit/default.nix
+++ b/pkgs/development/libraries/idnkit/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = https://www.nic.ad.jp/ja/idn/idnkit;
-    description = "provides functionalities about i18n domain name processing";
+    description = "Provides functionalities about i18n domain name processing";
     license = "idnkit-2 license";
     platforms = platforms.unix;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/jbigkit/default.nix b/pkgs/development/libraries/jbigkit/default.nix
index 7dba9e02519..35eabdd3556 100644
--- a/pkgs/development/libraries/jbigkit/default.nix
+++ b/pkgs/development/libraries/jbigkit/default.nix
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = "http://www.cl.cam.ac.uk/~mgk25/jbigkit/";
-    description = "a software implementation of the JBIG1 data compression standard";
+    description = "A software implementation of the JBIG1 data compression standard";
     license = licenses.gpl2;
     platforms = platforms.all;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/json-glib/default.nix b/pkgs/development/libraries/json-glib/default.nix
index 5cfafc8e69a..99dcb377620 100644
--- a/pkgs/development/libraries/json-glib/default.nix
+++ b/pkgs/development/libraries/json-glib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, glib, pkgconfig, gobjectIntrospection, dbus }:
+{ stdenv, fetchurl, glib, pkgconfig, gobjectIntrospection, dbus, libintlOrEmpty }:
 
 stdenv.mkDerivation rec {
   name = "json-glib-${minVer}.0";
@@ -13,6 +13,9 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ glib gobjectIntrospection ];
   nativeBuildInputs = [ pkgconfig ];
+  buildInputs = libintlOrEmpty;
+
+  NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl";
 
   meta = with stdenv.lib; {
     homepage = http://live.gnome.org/JsonGlib;
diff --git a/pkgs/development/libraries/kerberos/krb5.nix b/pkgs/development/libraries/kerberos/krb5.nix
index 332ca526b6b..78644200e0b 100644
--- a/pkgs/development/libraries/kerberos/krb5.nix
+++ b/pkgs/development/libraries/kerberos/krb5.nix
@@ -26,6 +26,8 @@ stdenv.mkDerivation rec {
   buildInputs = [ openssl ]
     ++ optionals (!libOnly) [ openldap libedit ];
 
+  patches = [ ./path_char_fix.patch ];
+
   preConfigure = "cd ./src";
 
   buildPhase = optionalString libOnly ''
diff --git a/pkgs/development/libraries/kerberos/path_char_fix.patch b/pkgs/development/libraries/kerberos/path_char_fix.patch
new file mode 100644
index 00000000000..2a6dc4c11c3
--- /dev/null
+++ b/pkgs/development/libraries/kerberos/path_char_fix.patch
@@ -0,0 +1,38 @@
+See https://github.com/krb5/krb5/pull/467
+diff --git a/src/include/Makefile.in b/src/include/Makefile.in
+index 4bb11e4..cb4b44b 100644
+--- a/src/include/Makefile.in
++++ b/src/include/Makefile.in
+@@ -57,19 +57,19 @@ SBINDIR = @sbindir@
+ LIBDIR  = @libdir@
+ SYSCONFCONF = @SYSCONFCONF@
+ 
+-PROCESS_REPLACE = -e "s+@KRB5RCTMPDIR+$(KRB5RCTMPDIR)+" \
+-		  -e "s+@PREFIX+$(INSTALL_PREFIX)+" \
+-		  -e "s+@EXEC_PREFIX+$(INSTALL_EXEC_PREFIX)+" \
+-		  -e "s+@BINDIR+$(BINDIR)+" \
+-		  -e "s+@LIBDIR+$(LIBDIR)+" \
+-		  -e "s+@SBINDIR+$(SBINDIR)+" \
+-		  -e "s+@MODULEDIR+$(MODULE_DIR)+" \
+-		  -e "s+@GSSMODULEDIR+$(GSS_MODULE_DIR)+" \
+-		  -e 's+@LOCALSTATEDIR+$(LOCALSTATEDIR)+' \
+-		  -e 's+@RUNSTATEDIR+$(RUNSTATEDIR)+' \
+-		  -e 's+@SYSCONFDIR+$(SYSCONFDIR)+' \
+-		  -e 's+@DYNOBJEXT+$(DYNOBJEXT)+' \
+-		  -e 's+@SYSCONFCONF+$(SYSCONFCONF)+'
++PROCESS_REPLACE = -e "s\"@KRB5RCTMPDIR\"$(KRB5RCTMPDIR)\"" \
++		  -e "s\"@PREFIX\"$(INSTALL_PREFIX)\"" \
++		  -e "s\"@EXEC_PREFIX\"$(INSTALL_EXEC_PREFIX)\"" \
++		  -e "s\"@BINDIR\"$(BINDIR)\"" \
++		  -e "s\"@LIBDIR\"$(LIBDIR)\"" \
++		  -e "s\"@SBINDIR\"$(SBINDIR)\"" \
++		  -e "s\"@MODULEDIR\"$(MODULE_DIR)\"" \
++		  -e "s\"@GSSMODULEDIR\"$(GSS_MODULE_DIR)\"" \
++		  -e "s\"@LOCALSTATEDIR\"$(LOCALSTATEDIR)\"" \
++		  -e "s\"@RUNSTATEDIR\"$(RUNSTATEDIR)\"" \
++		  -e "s\"@SYSCONFDIR\"$(SYSCONFDIR)\"" \
++		  -e "s\"@DYNOBJEXT\"$(DYNOBJEXT)\"" \
++		  -e "s\"@SYSCONFCONF\"$(SYSCONFCONF)\""
+ 
+ OSCONFSRC = $(srcdir)/osconf.hin
+ 
diff --git a/pkgs/development/libraries/kinetic-cpp-client/default.nix b/pkgs/development/libraries/kinetic-cpp-client/default.nix
index 64fd951d70d..445f65b9202 100644
--- a/pkgs/development/libraries/kinetic-cpp-client/default.nix
+++ b/pkgs/development/libraries/kinetic-cpp-client/default.nix
@@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = https://github.com/Seagate/kinetic-cpp-client;
-    description = "code for producing C and C++ kinetic clients";
+    description = "Code for producing C and C++ kinetic clients";
     license = licenses.lgpl21;
     platforms = platforms.unix;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/kyotocabinet/default.nix b/pkgs/development/libraries/kyotocabinet/default.nix
index 6617816b642..8e7971d8087 100644
--- a/pkgs/development/libraries/kyotocabinet/default.nix
+++ b/pkgs/development/libraries/kyotocabinet/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = http://fallabs.com/kyotocabinet;
-    description = "a library of routines for managing a database";
+    description = "A library of routines for managing a database";
     license = licenses.gpl3;
     platforms = platforms.all;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/lasso/default.nix b/pkgs/development/libraries/lasso/default.nix
new file mode 100644
index 00000000000..a16a1f431a6
--- /dev/null
+++ b/pkgs/development/libraries/lasso/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, autoconf, automake, autoreconfHook, fetchurl, glib, gobjectIntrospection, gtk_doc, libtool, libxml2, libxslt, openssl, pkgconfig, python27Packages, xmlsec, zlib }:
+
+stdenv.mkDerivation rec {
+
+  name = "lasso-${version}";
+  version = "2.5.1";
+
+  src = fetchurl {
+    url = "https://dev.entrouvert.org/lasso/lasso-${version}.tar.gz";
+    sha256 = "0n10zjjw84303c9vfy9bqhyzdl01459akbwy86cbgphd826mq45y";
+
+  };
+
+  buildInputs = [ autoconf automake autoreconfHook glib gobjectIntrospection gtk_doc libtool libxml2 libxslt openssl pkgconfig python27Packages.six xmlsec zlib ];
+
+  configurePhase = ''
+    ./configure --with-pkg-config=$PKG_CONFIG_PATH \
+                --disable-python \
+                --disable-perl \
+                --prefix=$out
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://lasso.entrouvert.org/;
+    description = "Liberty Alliance Single Sign-On library";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ womfoo ];
+  };
+
+}
diff --git a/pkgs/development/libraries/ldb/default.nix b/pkgs/development/libraries/ldb/default.nix
index d266a97535e..07689fbdd27 100644
--- a/pkgs/development/libraries/ldb/default.nix
+++ b/pkgs/development/libraries/ldb/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   ];
 
   meta = with stdenv.lib; {
-    description = "a LDAP-like embedded database";
+    description = "A LDAP-like embedded database";
     homepage = http://ldb.samba.org/;
     license = licenses.lgpl3Plus;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/leatherman/default.nix b/pkgs/development/libraries/leatherman/default.nix
index bfb091f424a..3dfc9e2990e 100644
--- a/pkgs/development/libraries/leatherman/default.nix
+++ b/pkgs/development/libraries/leatherman/default.nix
@@ -2,10 +2,10 @@
 
 stdenv.mkDerivation rec {
   name = "leatherman-${version}";
-  version = "0.7.0";
+  version = "0.7.5";
 
   src = fetchFromGitHub {
-    sha256 = "1m37zcr11a2g08wbkpxgav97m2fr14in2zhdhhv5krci5i2grzd7";
+    sha256 = "103qzhjhgw7jh0xcaxag735wfm6q35xprq5wmdimfhhmmrmjr51g";
     rev = version;
     repo = "leatherman";
     owner = "puppetlabs";
diff --git a/pkgs/development/libraries/libarchive/CVE-2013-0211.patch b/pkgs/development/libraries/libarchive/CVE-2013-0211.patch
deleted file mode 100644
index 5b1a9831063..00000000000
--- a/pkgs/development/libraries/libarchive/CVE-2013-0211.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 22531545514043e04633e1c015c7540b9de9dbe4 Mon Sep 17 00:00:00 2001
-From: Tim Kientzle <kientzle@acm.org>
-Date: Fri, 22 Mar 2013 23:48:41 -0700
-Subject: [PATCH] Limit write requests to at most INT_MAX. This prevents a
- certain common programming error (passing -1 to write) from leading to other
- problems deeper in the library.
-
----
- libarchive/archive_write.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/libarchive/archive_write.c b/libarchive/archive_write.c
-index eede5e0..be85621 100644
---- a/libarchive/archive_write.c
-+++ b/libarchive/archive_write.c
-@@ -673,8 +673,13 @@ static ssize_t
- _archive_write_data(struct archive *_a, const void *buff, size_t s)
- {
- 	struct archive_write *a = (struct archive_write *)_a;
-+	const size_t max_write = INT_MAX;
-+
- 	archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
- 	    ARCHIVE_STATE_DATA, "archive_write_data");
-+	/* In particular, this catches attempts to pass negative values. */
-+	if (s > max_write)
-+		s = max_write;
- 	archive_clear_error(&a->archive);
- 	return ((a->format_write_data)(a, buff, s));
- }
-
diff --git a/pkgs/development/libraries/libarchive/CVE-2015-1197.patch b/pkgs/development/libraries/libarchive/CVE-2015-1197.patch
deleted file mode 100644
index cb7be5f18cd..00000000000
--- a/pkgs/development/libraries/libarchive/CVE-2015-1197.patch
+++ /dev/null
@@ -1,143 +0,0 @@
-From 59357157706d47c365b2227739e17daba3607526 Mon Sep 17 00:00:00 2001
-From: Alessandro Ghedini <alessandro@ghedini.me>
-Date: Sun, 1 Mar 2015 12:07:45 +0100
-Subject: [PATCH] Add ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS option
-
-This fixes a directory traversal in the cpio tool.
----
- cpio/bsdcpio.1                           |  3 ++-
- cpio/cpio.c                              |  2 ++
- libarchive/archive.h                     |  2 ++
- libarchive/archive_write_disk.3          |  3 +++
- libarchive/archive_write_disk_posix.c    | 14 +++++++++++---
- libarchive/test/test_write_disk_secure.c | 23 +++++++++++++++++++++++
- 6 files changed, 43 insertions(+), 4 deletions(-)
-
-diff --git a/cpio/bsdcpio.1 b/cpio/bsdcpio.1
-index f966aa0..e52546e 100644
---- a/cpio/bsdcpio.1
-+++ b/cpio/bsdcpio.1
-@@ -156,7 +156,8 @@ See above for description.
- .It Fl Fl insecure
- (i and p mode only)
- Disable security checks during extraction or copying.
--This allows extraction via symbolic links and path names containing
-+This allows extraction via symbolic links, absolute paths,
-+and path names containing
- .Sq ..
- in the name.
- .It Fl J , Fl Fl xz
-diff --git a/cpio/cpio.c b/cpio/cpio.c
-index 0acde11..b267e9b 100644
---- a/cpio/cpio.c
-+++ b/cpio/cpio.c
-@@ -171,6 +171,7 @@ main(int argc, char *argv[])
- 	cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER;
- 	cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS;
- 	cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT;
-+	cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
- 	cpio->extract_flags |= ARCHIVE_EXTRACT_PERM;
- 	cpio->extract_flags |= ARCHIVE_EXTRACT_FFLAGS;
- 	cpio->extract_flags |= ARCHIVE_EXTRACT_ACL;
-@@ -256,6 +257,7 @@ main(int argc, char *argv[])
- 		case OPTION_INSECURE:
- 			cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS;
- 			cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT;
-+			cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
- 			break;
- 		case 'L': /* GNU cpio */
- 			cpio->option_follow_links = 1;
-diff --git a/libarchive/archive.h b/libarchive/archive.h
-index 1f0fc38..ef635ac 100644
---- a/libarchive/archive.h
-+++ b/libarchive/archive.h
-@@ -649,6 +649,8 @@ __LA_DECL int archive_read_set_passphrase_callback(struct archive *,
- /* Default: Do not use HFS+ compression if it was not compressed. */
- /* This has no effect except on Mac OS v10.6 or later. */
- #define	ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED	(0x8000)
-+/* Default: Do not reject entries with absolute paths */
-+#define ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS (0x10000)
- 
- __LA_DECL int archive_read_extract(struct archive *, struct archive_entry *,
- 		     int flags);
-diff --git a/libarchive/archive_write_disk.3 b/libarchive/archive_write_disk.3
-index fa925cc..a2e7afa 100644
---- a/libarchive/archive_write_disk.3
-+++ b/libarchive/archive_write_disk.3
-@@ -177,6 +177,9 @@ The default is to not refuse such paths.
- Note that paths ending in
- .Pa ..
- always cause an error, regardless of this flag.
-+.It Cm ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
-+Refuse to extract an absolute path.
-+The default is to not refuse such paths.
- .It Cm ARCHIVE_EXTRACT_SPARSE
- Scan data for blocks of NUL bytes and try to recreate them with holes.
- This results in sparse files, independent of whether the archive format
-diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
-index ab3bdac..c1290eb 100644
---- a/libarchive/archive_write_disk_posix.c
-+++ b/libarchive/archive_write_disk_posix.c
-@@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
- /*
-  * Canonicalize the pathname.  In particular, this strips duplicate
-  * '/' characters, '.' elements, and trailing '/'.  It also raises an
-- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
-- * set) any '..' in the path.
-+ * error for an empty path, a trailing '..', (if _SECURE_NODOTDOT is
-+ * set) any '..' in the path or (if ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
-+ * is set) if the path is absolute.
-  */
- static int
- cleanup_pathname(struct archive_write_disk *a)
-@@ -2529,8 +2530,15 @@ cleanup_pathname(struct archive_write_disk *a)
- 	cleanup_pathname_win(a);
- #endif
- 	/* Skip leading '/'. */
--	if (*src == '/')
-+	if (*src == '/') {
-+		if (a->flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) {
-+			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
-+			                  "Path is absolute");
-+			return (ARCHIVE_FAILED);
-+		}
-+
- 		separator = *src++;
-+	}
- 
- 	/* Scan the pathname one element at a time. */
- 	for (;;) {
-diff --git a/libarchive/test/test_write_disk_secure.c b/libarchive/test/test_write_disk_secure.c
-index 31c5bfd..2c94206 100644
---- a/libarchive/test/test_write_disk_secure.c
-+++ b/libarchive/test/test_write_disk_secure.c
-@@ -178,6 +178,29 @@ DEFINE_TEST(test_write_disk_secure)
- 	assert(S_ISDIR(st.st_mode));
- 	archive_entry_free(ae);
- 
-+	/*
-+	 * Without security checks, we should be able to
-+	 * extract an absolute path.
-+	 */
-+	assert((ae = archive_entry_new()) != NULL);
-+	archive_entry_copy_pathname(ae, "/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp");
-+	archive_entry_set_mode(ae, S_IFREG | 0777);
-+	assert(0 == archive_write_header(a, ae));
-+	assert(0 == archive_write_finish_entry(a));
-+	assertFileExists("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp");
-+	assert(0 == unlink("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"));
-+
-+	/* But with security checks enabled, this should fail. */
-+	assert(archive_entry_clear(ae) != NULL);
-+	archive_entry_copy_pathname(ae, "/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp");
-+	archive_entry_set_mode(ae, S_IFREG | 0777);
-+	archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS);
-+	failure("Extracting an absolute path should fail here.");
-+	assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae));
-+	archive_entry_free(ae);
-+	assert(0 == archive_write_finish_entry(a));
-+	assertFileNotExists("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp");
-+
- 	assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- 
- 	/* Test the entries on disk. */
diff --git a/pkgs/development/libraries/libarchive/default.nix b/pkgs/development/libraries/libarchive/default.nix
index 55ff770f4bd..0c5f900dd41 100644
--- a/pkgs/development/libraries/libarchive/default.nix
+++ b/pkgs/development/libraries/libarchive/default.nix
@@ -2,22 +2,14 @@
 , sharutils }:
 
 stdenv.mkDerivation rec {
-  name = "libarchive-3.1.2";
+  name = "libarchive-${version}";
+  version = "3.2.1";
 
   src = fetchurl {
-    urls = [
-      "http://pkgs.fedoraproject.org/repo/pkgs/libarchive/libarchive-3.1.2.tar.gz/efad5a503f66329bb9d2f4308b5de98a/${name}.tar.gz"
-      "${meta.homepage}/downloads/${name}.tar.gz"
-    ];
-    sha256 = "0pixqnrcf35dnqgv0lp7qlcw7k13620qkhgxr288v7p4iz6ym1zb";
+    url = "${meta.homepage}/downloads/${name}.tar.gz";
+    sha256 = "1lngng84k1kkljl74q0cdqc3s82vn2kimfm02dgm4d6m7x71mvkj";
   };
 
-  patches = [
-    ./CVE-2013-0211.patch # https://github.com/libarchive/libarchive/commit/22531545
-    ./CVE-2015-1197.patch # https://github.com/NixOS/nixpkgs/issues/6799
-      # ^ it's CVE-2015-2304 specific to libarchive
-  ];
-
   buildInputs = [ sharutils libxml2 zlib bzip2 openssl xz lzo ] ++
     stdenv.lib.optionals stdenv.isLinux [ e2fsprogs attr acl ];
 
diff --git a/pkgs/development/libraries/libasyncns/default.nix b/pkgs/development/libraries/libasyncns/default.nix
index bc21237e238..bafcc5210b3 100644
--- a/pkgs/development/libraries/libasyncns/default.nix
+++ b/pkgs/development/libraries/libasyncns/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = http://0pointer.de/lennart/projects/libasyncns/;
-    description = "a C library for Linux/Unix for executing name service queries asynchronously";
+    description = "A C library for Linux/Unix for executing name service queries asynchronously";
     license = licenses.lgpl21;
     platforms = platforms.unix;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/libav/default.nix b/pkgs/development/libraries/libav/default.nix
index ef09b9e4b40..e3aec98a8db 100644
--- a/pkgs/development/libraries/libav/default.nix
+++ b/pkgs/development/libraries/libav/default.nix
@@ -17,7 +17,7 @@
 
 assert faacSupport -> enableUnfree;
 
-with { inherit (stdenv.lib) optional optionals; };
+with { inherit (stdenv.lib) optional optionals hasPrefix; };
 
 /* ToDo:
     - more deps, inspiration: http://packages.ubuntu.com/raring/libav-tools
@@ -27,7 +27,7 @@ with { inherit (stdenv.lib) optional optionals; };
 let
   result = {
     libav_0_8 = libavFun "0.8.17" "31ace2daeb8c105deed9cd3476df47318d417714";
-    libav_11  = libavFun  "11.6"  "2296cbd7afe98591eb164cebe436dcb5582efc9d";
+    libav_11  = libavFun  "11.7"  "9f36d136ea353fc6e3826180fe126f52eca7fec4";
   };
 
   libavFun = version : sha1 : stdenv.mkDerivation rec {
@@ -39,8 +39,8 @@ let
     };
 
     patches = []
-      ++ optionals (vpxSupport && version == "0.8.17" ) [ ./vpxenc-0.8.17-libvpx-1.5.patch ]
-      ++ optionals (vpxSupport && version == "11.6") [ ./vpxenc-11.6-libvpx-1.5.patch ];
+      ++ optional (vpxSupport && hasPrefix "0.8." version) ./vpxenc-0.8.17-libvpx-1.5.patch
+      ++ optional (vpxSupport && hasPrefix "11."  version) ./vpxenc-11.6-libvpx-1.5.patch;
 
     preConfigure = "patchShebangs doc/texi2pod.pl";
 
diff --git a/pkgs/development/libraries/libburn/default.nix b/pkgs/development/libraries/libburn/default.nix
index 22edcc15769..5103d669408 100644
--- a/pkgs/development/libraries/libburn/default.nix
+++ b/pkgs/development/libraries/libburn/default.nix
@@ -2,17 +2,17 @@
 
 stdenv.mkDerivation rec {
   name = "libburn-${version}";
-  version = "1.4.2.pl01";
+  version = "1.4.4";
 
   src = fetchurl {
     url = "http://files.libburnia-project.org/releases/${name}.tar.gz";
-    sha256 = "1nqfm24dm2csdnhsmpgw9cwcnkwvqlvfzsm9bhr6yg7bbmzwvkrk";
+    sha256 = "053x1sj6r5pj5396g007v6l0s7942cy2mh5fd3caqx0jdw6h9xqv";
   };
 
   meta = with stdenv.lib; {
     homepage = http://libburnia-project.org/;
     description = "A library by which preformatted data get onto optical media: CD, DVD, BD (Blu-Ray)";
     license = licenses.gpl2Plus;
-    maintainers = with maintainers; [ abbradar ];
+    maintainers = with maintainers; [ abbradar vrthra ];
   };
 }
diff --git a/pkgs/development/libraries/libcommuni/default.nix b/pkgs/development/libraries/libcommuni/default.nix
index cddfa12e281..77199bf27a3 100644
--- a/pkgs/development/libraries/libcommuni/default.nix
+++ b/pkgs/development/libraries/libcommuni/default.nix
@@ -1,26 +1,29 @@
-{ fetchgit, qtbase, qmakeHook, stdenv
+{ fetchgit, qtbase, qmakeHook, which, stdenv
 }:
 
 stdenv.mkDerivation rec {
   name = "libcommuni-${version}";
-  version = "2016-01-02";
+  version = "2016-03-23";
 
   src = fetchgit {
     url = "https://github.com/communi/libcommuni.git";
-    rev = "779b0c774428669235d44d2db8e762558e2f4b79";
-    sha256 = "1zqdl5why66rg3pksxmxsmrwxs4042fq9jhc394qvk0s36aryqsj";
+    rev = "6a5110b25e2838e7dc2c62d16b9fd06d12beee7e";
+    sha256 = "184ah5xqg5pgy8h6fyyz2k0vak1fmhrcidwz828yl4lsvz1vjqh1";
   };
 
   buildInputs = [ qtbase ];
-  nativeBuildInputs = [ qmakeHook ];
+  nativeBuildInputs = [ qmakeHook which ];
 
   enableParallelBuild = true;
 
-  configurePhase = ''
+  dontUseQmakeConfigure = true;
+  configureFlags = "-config release";
+  preConfigure = ''
     sed -i -e 's|/bin/pwd|pwd|g' configure
-    ./configure -config release -prefix $out -qmake $QMAKE
   '';
 
+  doCheck = true;
+
   meta = with stdenv.lib; {
     description = "A cross-platform IRC framework written with Qt";
     homepage = https://communi.github.io;
diff --git a/pkgs/development/libraries/libconfig/default.nix b/pkgs/development/libraries/libconfig/default.nix
index ff9cd25293a..df18ae06ed6 100644
--- a/pkgs/development/libraries/libconfig/default.nix
+++ b/pkgs/development/libraries/libconfig/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = http://www.hyperrealm.com/libconfig;
-    description = "a simple library for processing structured configuration files";
+    description = "A simple library for processing structured configuration files";
     license = licenses.lgpl3;
     maintainers = [ maintainers.goibhniu ];
     platforms = platforms.linux;
diff --git a/pkgs/development/libraries/libdwg/default.nix b/pkgs/development/libraries/libdwg/default.nix
index 2ee4e1fdb68..2a2dfbb0be5 100644
--- a/pkgs/development/libraries/libdwg/default.nix
+++ b/pkgs/development/libraries/libdwg/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   hardeningDisable = [ "format" ];
 
   meta = {
-    description = "library reading dwg files";
+    description = "Library reading dwg files";
     homepage = http://libdwg.sourceforge.net/en/;
     license = stdenv.lib.licenses.gpl3;
     maintainers = [stdenv.lib.maintainers.marcweber];
diff --git a/pkgs/development/libraries/libelf/default.nix b/pkgs/development/libraries/libelf/default.nix
index 515e0c32ee1..5027afa397a 100644
--- a/pkgs/development/libraries/libelf/default.nix
+++ b/pkgs/development/libraries/libelf/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   # For cross-compiling, native glibc is needed for the "gencat" program.
   crossAttrs = {
-    nativeBuildInputs = [ glibc ];
+    nativeBuildInputs = [ gettext glibc ];
   };
 
   # Libelf's custom NLS macros fail to determine the catalog file extension on
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   # FIXME: Eventually make Gettext a build input on all platforms.
   configureFlags = stdenv.lib.optional stdenv.isDarwin "--disable-nls";
 
-  buildInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
 
   meta = {
     description = "ELF object file access library";
diff --git a/pkgs/development/libraries/libestr/default.nix b/pkgs/development/libraries/libestr/default.nix
index ad37f9010c5..96de7eb7b3c 100644
--- a/pkgs/development/libraries/libestr/default.nix
+++ b/pkgs/development/libraries/libestr/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = http://libestr.adiscon.com/;
-    description = "some essentials for string handling";
+    description = "Some essentials for string handling";
     license = licenses.lgpl21;
     platforms = platforms.all;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/libewf/04-fix-FTBFS-GCC5.patch b/pkgs/development/libraries/libewf/04-fix-FTBFS-GCC5.patch
new file mode 100644
index 00000000000..54878303589
--- /dev/null
+++ b/pkgs/development/libraries/libewf/04-fix-FTBFS-GCC5.patch
@@ -0,0 +1,20 @@
+Patch from Debian:
+https://sources.debian.net/data/main/libe/libewf/20140608-6/debian/patches/04-fix-FTBFS-GCC5.patch
+
+Description: fix a FTBFS with GCC-5. Thanks to Linn Crosetto <linn@hp.com> for
+             the first fix (see #777938). This patch closes #777945.
+Author: Joao Eriberto Mota Filho <eriberto@debian.org>
+Last-Update: 2015-07-02
+Index: libewf-20140608/libuna/Makefile.am
+===================================================================
+--- libewf-20140608.orig/libuna/Makefile.am
++++ libewf-20140608/libuna/Makefile.am
+@@ -3,7 +3,7 @@ AM_CPPFLAGS = \
+ 	-I$(top_srcdir)/include \
+ 	-I$(top_srcdir)/common \
+ 	@LIBCSTRING_CPPFLAGS@ \
+-	@LIBCERROR_CPPFLAGS@
++	@LIBCERROR_CPPFLAGS@ -std=gnu89
+ 
+ noinst_LTLIBRARIES = libuna.la
+ 
diff --git a/pkgs/development/libraries/libewf/default.nix b/pkgs/development/libraries/libewf/default.nix
index fad0170ade7..06f0bc89c2b 100644
--- a/pkgs/development/libraries/libewf/default.nix
+++ b/pkgs/development/libraries/libewf/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, zlib, openssl, libuuid, file, fuse }:
+{ fetchurl, stdenv, zlib, openssl, libuuid, file, fuse, autoreconfHook, pkgconfig }:
 
 stdenv.mkDerivation rec {
   version = "20140608";
@@ -8,15 +8,16 @@ stdenv.mkDerivation rec {
     sha256 = "0wfsffzxk934hl8cpwr14w8ixnh8d23x0xnnzcspjwi2c7730h6i";
   };
 
-  preConfigure = ''sed -e 's@/usr/bin/file@file@g' -i configure'';
-
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
   buildInputs = [ zlib openssl libuuid ];
+  patches = [ ./04-fix-FTBFS-GCC5.patch ];
 
   meta = {
     description = "Library for support of the Expert Witness Compression Format";
     homepage = http://sourceforge.net/projects/libewf/;
     license = stdenv.lib.licenses.lgpl3;
     maintainers = [ stdenv.lib.maintainers.raskin ] ;
+    platforms = stdenv.lib.platforms.unix;
     inherit version;
   };
 }
diff --git a/pkgs/development/libraries/libfilezilla/default.nix b/pkgs/development/libraries/libfilezilla/default.nix
index 3e0310736dd..7a039a813d8 100644
--- a/pkgs/development/libraries/libfilezilla/default.nix
+++ b/pkgs/development/libraries/libfilezilla/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "libfilezilla-${version}";
-  version = "0.5.1";
+  version = "0.5.3";
 
   src = fetchurl {
     url = "mirror://sourceforge/project/filezilla/libfilezilla/${version}/${name}.tar.bz2";
-    sha256 = "1ydpk6i5vjd78i0531cxlkjvlmvvrsfyc7hv7wx81ws3rkp5hnsq";
+    sha256 = "05z9d2pi8n8yl3dbwg2nw6bcvi0zzc9hkammm1mayfh7h4akqc0i";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/libgcrypt/default.nix b/pkgs/development/libraries/libgcrypt/default.nix
index dd57e74e156..7a62011ddb4 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.0";
+  version = "1.7.1";
 
   src = fetchurl {
     url = "mirror://gnupg/libgcrypt/${name}.tar.bz2";
-    sha256 = "14pspxwrqcgfklw3dgmywbxqwdzcym7fznfrqh9rk4vl8jkpxrmh";
+    sha256 = "15bsdpihb8xvr2a6sh0ikzw9wdw3gdi4pl1vpr6wc48npzy9q3a5";
   };
 
   outputs = [ "dev" "out" "info" ];
@@ -35,12 +35,12 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = https://www.gnu.org/software/libgcrypt/;
     description = "General-pupose cryptographic library";
-    license = lib.licenses.lgpl2Plus;
-    platforms = lib.platforms.all;
-    maintainers = [ lib.maintainers.wkennington ];
+    license = licenses.lgpl2Plus;
+    platforms = platforms.all;
+    maintainers = [ maintainers.wkennington maintainers.vrthra ];
     repositories.git = git://git.gnupg.org/libgcrypt.git;
   };
 }
diff --git a/pkgs/development/libraries/libgksu/default.nix b/pkgs/development/libraries/libgksu/default.nix
index 521e780a920..249997d430f 100644
--- a/pkgs/development/libraries/libgksu/default.nix
+++ b/pkgs/development/libraries/libgksu/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, makeWrapper, gtk, gnome, gnome3,
+{ stdenv, fetchurl, pkgconfig, wrapGAppsHook, gtk, gnome, gnome3,
   libstartup_notification, libgtop, perl, perlXMLParser,
   autoreconfHook, intltool, gtk_doc, docbook_xsl, xauth, sudo
 }:
@@ -13,6 +13,17 @@ stdenv.mkDerivation rec {
     sha256 = "1brz9j3nf7l2gd3a5grbp0s3nksmlrp6rxmgp5s6gjvxcb1wzy92";
   };
 
+  nativeBuildInputs = [
+    pkgconfig autoreconfHook intltool gtk_doc docbook_xsl wrapGAppsHook
+  ];
+
+  buildInputs = [
+    gtk gnome.GConf libstartup_notification
+    gnome3.libgnome_keyring libgtop gnome.libglade perl perlXMLParser
+  ];
+
+  enableParallelBuilding = true;
+
   patches = [
         # Patches from the gentoo ebuild
 
@@ -54,19 +65,6 @@ stdenv.mkDerivation rec {
     intltoolize --force --copy --automake
   '';
 
-  buildInputs = [
-    pkgconfig makeWrapper gtk gnome.GConf libstartup_notification
-    gnome3.libgnome_keyring libgtop gnome.libglade perl perlXMLParser
-    autoreconfHook intltool gtk_doc docbook_xsl
-  ];
-
-  preFixup = ''
-    wrapProgram "$out/bin/gksu-properties" \
-      --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
-  '';
-
-  enableParallelBuilding = true;
-
   meta = {
     description = "A library for integration of su into applications";
     longDescription = ''
diff --git a/pkgs/development/libraries/libgnurl/default.nix b/pkgs/development/libraries/libgnurl/default.nix
index f055b4f5a95..943f276ed78 100644
--- a/pkgs/development/libraries/libgnurl/default.nix
+++ b/pkgs/development/libraries/libgnurl/default.nix
@@ -1,23 +1,35 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, perl, zlib, gnutls, gss, openssl, libssh2, libidn, libpsl, openldap }:
 
 stdenv.mkDerivation rec {
-  version = "7.35.0";
+  version = "7.48.0";
 
   name = "libgnurl-${version}";
 
   src = fetchurl {
-    url = "https://gnunet.org/sites/default/files/gnurl-${version}.tar.bz2";
-    sha256 = "0dzj22f5z6ppjj1aq1bml64iwbzzcd8w1qy3bgpk6gnzqslsxknf";
+    url = "https://gnunet.org/sites/default/files/gnurl-7_48_0.tar.bz2";
+    sha256 = "14gch4rdibrc8qs4mijsczxvl45dsclf234g17dk6c8nc2s4bm0a";
   };
 
+  buildInputs = [ perl gnutls gss openssl zlib libidn libssh2 libpsl openldap ];
+
   preConfigure = ''
     sed -e 's|/usr/bin|/no-such-path|g' -i.bak configure
   '';
 
+  configureFlags = [
+    "--with-zlib"
+    "--with-gssapi"
+    "--with-libssh2"
+    "--with-libidn"
+    "--with-libpsl"
+    "--enable-ldap"
+    "--enable-ldaps"
+  ];
+
   meta = with stdenv.lib; {
     description = "A fork of libcurl used by GNUnet";
     homepage    = https://gnunet.org/gnurl;
-    maintainers = with maintainers; [ falsifian ];
+    maintainers = with maintainers; [ falsifian vrthra ];
     hydraPlatforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/libgpg-error/default.nix b/pkgs/development/libraries/libgpg-error/default.nix
index 9c4f3705b3e..c15dcc4993d 100644
--- a/pkgs/development/libraries/libgpg-error/default.nix
+++ b/pkgs/development/libraries/libgpg-error/default.nix
@@ -1,11 +1,12 @@
 { stdenv, fetchurl, gettext }:
 
 stdenv.mkDerivation rec {
-  name = "libgpg-error-1.21";
+  name = "libgpg-error-${version}";
+  version = "1.23";
 
   src = fetchurl {
     url = "mirror://gnupg/libgpg-error/${name}.tar.bz2";
-    sha256 = "0kdq2cbnk84fr4jqcv689rlxpbyl6bda2cn6y3ll19v3mlydpnxp";
+    sha256 = "1alyjd6671drj92m0qi9943rfmf1sjjbzvmz97v4hh4cp5jpy33z";
   };
 
   postPatch = "sed '/BUILD_TIMESTAMP=/s/=.*/=1970-01-01T00:01+0000/' -i ./configure";
@@ -41,7 +42,7 @@ stdenv.mkDerivation rec {
 
     license = licenses.lgpl2Plus;
     platforms = platforms.all;
-    maintainers = [ maintainers.fuuzetsu ];
+    maintainers = [ maintainers.fuuzetsu maintainers.vrthra ];
   };
 }
 
diff --git a/pkgs/development/libraries/libgphoto2/default.nix b/pkgs/development/libraries/libgphoto2/default.nix
index 6912c02260d..a6c739017ee 100644
--- a/pkgs/development/libraries/libgphoto2/default.nix
+++ b/pkgs/development/libraries/libgphoto2/default.nix
@@ -8,6 +8,12 @@ stdenv.mkDerivation rec {
     sha256 = "1wjf79ipqwb5phfjjwf15rwgigakylnfqaj4crs5qnds6ba6i1ld";
   };
 
+  patches = [(fetchurl {
+    url = "https://anonscm.debian.org/cgit/pkg-phototools/libgphoto2.git/plain"
+      + "/debian/patches/libjpeg_turbo_1.5.0_fix.patch?id=8ce79a2a02d";
+    sha256 = "114iyhk6idxz2jhnzpf1glqm6d0x0y8cqfpqxz9i96q9j7x3wwin";
+  })];
+
   nativeBuildInputs = [ pkgconfig gettext ];
   buildInputs = [ libtool libjpeg libusb1 ];
 
diff --git a/pkgs/development/libraries/libical/default.nix b/pkgs/development/libraries/libical/default.nix
index 6292318d5ca..a91205e182c 100644
--- a/pkgs/development/libraries/libical/default.nix
+++ b/pkgs/development/libraries/libical/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = https://github.com/libical/libical;
-    description = "an Open Source implementation of the iCalendar protocols";
+    description = "An Open Source implementation of the iCalendar protocols";
     license = licenses.mpl10;
     platforms = platforms.unix;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/libimobiledevice/default.nix b/pkgs/development/libraries/libimobiledevice/default.nix
index 40bb9a5a140..cfc31c120b4 100644
--- a/pkgs/development/libraries/libimobiledevice/default.nix
+++ b/pkgs/development/libraries/libimobiledevice/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python, pkgconfig, usbmuxd, glib, libgcrypt,
+{ stdenv, fetchurl, fetchpatch, python, pkgconfig, usbmuxd, glib, libgcrypt,
   libtasn1, libplist, readline, libusbmuxd, openssl }:
 
 stdenv.mkDerivation rec {
@@ -8,7 +8,13 @@ stdenv.mkDerivation rec {
   buildInputs = [ readline ];
   propagatedBuildInputs = [ libusbmuxd glib libgcrypt libtasn1 libplist openssl ];
 
-  patches = [ ./disable_sslv3.patch ];
+  patches = [
+    ./disable_sslv3.patch
+    (fetchpatch { # CVE-2016-5104
+      url = "https://github.com/libimobiledevice/libimobiledevice/commit/df1f5c4d70d0c19ad40072f5246ca457e7f9849e.patch";
+      sha256 = "06ygb9aqcvm4v08wrldsddjgyqv5bkpq6lxzq2a1nwqp9mq4a4k1";
+    })
+  ];
 
   postPatch = ''sed -e 's@1\.3\.21@@' -i configure'';
   passthru.swig = libplist.swig;
diff --git a/pkgs/development/libraries/libinput/default.nix b/pkgs/development/libraries/libinput/default.nix
index f997d8270ca..a8dc8f357a7 100644
--- a/pkgs/development/libraries/libinput/default.nix
+++ b/pkgs/development/libraries/libinput/default.nix
@@ -15,11 +15,11 @@ in
 
 with stdenv.lib;
 stdenv.mkDerivation rec {
-  name = "libinput-1.3.1";
+  name = "libinput-1.3.3";
 
   src = fetchurl {
     url = "http://www.freedesktop.org/software/libinput/${name}.tar.xz";
-    sha256 = "1adcc82746ywwymr9b3mvr2vq539hvp1zxks6s7p2p1rjcynbzyd";
+    sha256 = "1kmiv1mcrxniigdcs65w23897mczsx0hasxc6p13hjk58zzfvj1h";
   };
 
   outputs = [ "dev" "out" ];
diff --git a/pkgs/development/libraries/libisoburn/default.nix b/pkgs/development/libraries/libisoburn/default.nix
new file mode 100644
index 00000000000..20a779b8050
--- /dev/null
+++ b/pkgs/development/libraries/libisoburn/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, acl, attr, zlib, libburn, libisofs }:
+
+stdenv.mkDerivation rec {
+  name = "libisoburn-${version}";
+  version = "1.4.4";
+
+  src = fetchurl {
+    url = "http://files.libburnia-project.org/releases/${name}.tar.gz";
+    sha256 = "1mn2dwkwdrdcjnd59czxali7r5nlxdx92clyxnsfpmw20f9s20kv";
+  };
+
+  buildInputs = [ attr zlib libburn libisofs ];
+  propagatedBuildInputs = [ acl ];
+
+  meta = with stdenv.lib; {
+    homepage = http://libburnia-project.org/;
+    description = "Enables creation and expansion of ISO-9660 filesystems on CD/DVD/BD ";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ vrthra ];
+  };
+}
diff --git a/pkgs/development/libraries/libisofs/default.nix b/pkgs/development/libraries/libisofs/default.nix
index d7e78410740..e680e6ae51e 100644
--- a/pkgs/development/libraries/libisofs/default.nix
+++ b/pkgs/development/libraries/libisofs/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "libisofs-${version}";
-  version = "1.4.2";
+  version = "1.4.4";
 
   src = fetchurl {
     url = "http://files.libburnia-project.org/releases/${name}.tar.gz";
-    sha256 = "1axk1ykv8ibrlrd2f3allidviimi4ya6k7wpvr6r4y1sc7mg7rym";
+    sha256 = "1zdx56k847c80ds5yf40hh0a26lkqrc0v11r589dqlm6xvzg0614";
   };
 
   buildInputs = [ attr zlib ];
@@ -16,6 +16,6 @@ stdenv.mkDerivation rec {
     homepage = http://libburnia-project.org/;
     description = "A library to create an ISO-9660 filesystem with extensions like RockRidge or Joliet";
     license = licenses.gpl2Plus;
-    maintainers = with maintainers; [ abbradar ];
+    maintainers = with maintainers; [ abbradar vrthra ];
   };
 }
diff --git a/pkgs/development/libraries/libjpeg-turbo/default.nix b/pkgs/development/libraries/libjpeg-turbo/default.nix
index c326e630bd0..7d8de0b40af 100644
--- a/pkgs/development/libraries/libjpeg-turbo/default.nix
+++ b/pkgs/development/libraries/libjpeg-turbo/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, nasm }:
 
 stdenv.mkDerivation rec {
-  name = "libjpeg-turbo-1.4.2";
+  name = "libjpeg-turbo-1.5.0";
 
   src = fetchurl {
     url = "mirror://sourceforge/libjpeg-turbo/${name}.tar.gz";
-    sha256 = "0gi349hp1x7mb98s4mf66sb2xay2kjjxj9ihrriw0yiy0k9va6sj";
+    sha256 = "0pq3lav976d6a1d16yyqrj1b4gmhk1ca4zar6zp00avxlqqpqfcz";
   };
 
   patches =
diff --git a/pkgs/development/libraries/liblo/default.nix b/pkgs/development/libraries/liblo/default.nix
index ab8c696a66c..cb62ff3628b 100644
--- a/pkgs/development/libraries/liblo/default.nix
+++ b/pkgs/development/libraries/liblo/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   meta = { 
-    description = "lightweight library to handle the sending and receiving of messages according to the Open Sound Control (OSC) protocol";
+    description = "Lightweight library to handle the sending and receiving of messages according to the Open Sound Control (OSC) protocol";
     homepage = http://sourceforge.net/projects/liblo;
     license = stdenv.lib.licenses.gpl2;
     maintainers = [stdenv.lib.maintainers.marcweber];
diff --git a/pkgs/development/libraries/liblognorm/default.nix b/pkgs/development/libraries/liblognorm/default.nix
index c5d91e26699..81490ccd539 100644
--- a/pkgs/development/libraries/liblognorm/default.nix
+++ b/pkgs/development/libraries/liblognorm/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = http://www.liblognorm.com/;
-    description = "help to make sense out of syslog data, or, actually, any event data that is present in text form";
+    description = "Help to make sense out of syslog data, or, actually, any event data that is present in text form";
     license = licenses.lgpl21;
     platforms = platforms.all;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/libmediainfo/default.nix b/pkgs/development/libraries/libmediainfo/default.nix
index 8b8bf61a99b..26416dc1ee1 100644
--- a/pkgs/development/libraries/libmediainfo/default.nix
+++ b/pkgs/development/libraries/libmediainfo/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, autoreconfHook, pkgconfig, libzen, zlib }:
 
 stdenv.mkDerivation rec {
-  version = "0.7.84";
+  version = "0.7.86";
   name = "libmediainfo-${version}";
   src = fetchurl {
     url = "http://mediaarea.net/download/source/libmediainfo/${version}/libmediainfo_${version}.tar.xz";
-    sha256 = "0k657ynfxcw6lvakc8plz0pzfixlqbsiih2idimk9k1dd4xzhq3d";
+    sha256 = "14m7cgd93mglc9a4x28pb4yc6nfxhqk7vfryca83vpn80la1lxy0";
   };
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
diff --git a/pkgs/development/libraries/libmicrohttpd/default.nix b/pkgs/development/libraries/libmicrohttpd/default.nix
index c6818794533..7ee0cbe1bd9 100644
--- a/pkgs/development/libraries/libmicrohttpd/default.nix
+++ b/pkgs/development/libraries/libmicrohttpd/default.nix
@@ -1,29 +1,25 @@
-{ lib, stdenv, fetchurl, libgcrypt }:
+{ stdenv, fetchurl, libgcrypt, curl, gnutls, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "libmicrohttpd-0.9.44";
+  name = "libmicrohttpd-0.9.50";
 
   src = fetchurl {
     url = "mirror://gnu/libmicrohttpd/${name}.tar.gz";
-    sha256 = "07j1p21rvbrrfpxngk8xswzkmjkh94bp1971xfjh1p0ja709qwzj";
+    sha256 = "1mzbqr6sqisppz88mh73bbh5sw57g8l87qvhcjdx5pmbd183idni";
   };
 
   outputs = [ "dev" "out" "docdev" ];
+  buildInputs = [ libgcrypt curl gnutls pkgconfig ];
 
-  buildInputs = [ libgcrypt ];
-
-  preCheck =
+  preCheck = ''
     # Since `localhost' can't be resolved in a chroot, work around it.
-    '' for i in "src/test"*"/"*.[ch]
-       do
-         sed -i "$i" -es/localhost/127.0.0.1/g
-       done
-    '';
+    sed -ie 's/localhost/127.0.0.1/g' src/test*/*.[ch]
+  '';
 
   # Disabled because the tests can time-out.
   doCheck = false;
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Embeddable HTTP server library";
 
     longDescription = ''
@@ -31,10 +27,10 @@ stdenv.mkDerivation rec {
       it easy to run an HTTP server as part of another application.
     '';
 
-    license = lib.licenses.lgpl2Plus;
+    license = licenses.lgpl2Plus;
 
     homepage = http://www.gnu.org/software/libmicrohttpd/;
 
-    maintainers = [ lib.maintainers.eelco ];
+    maintainers = [ maintainers.eelco maintainers.vrthra ];
   };
 }
diff --git a/pkgs/development/libraries/libmnl/default.nix b/pkgs/development/libraries/libmnl/default.nix
index 94401c30a6b..caabde85f29 100644
--- a/pkgs/development/libraries/libmnl/default.nix
+++ b/pkgs/development/libraries/libmnl/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   meta = {
-    description = "minimalistic user-space library oriented to Netlink developers";
+    description = "Minimalistic user-space library oriented to Netlink developers";
     longDescription = ''
       libmnl is a minimalistic user-space library oriented to Netlink developers.
       There are a lot of common tasks in parsing, validating, constructing of both the Netlink
diff --git a/pkgs/development/libraries/libmpack/default.nix b/pkgs/development/libraries/libmpack/default.nix
index 867a7ccf79d..de2bb9334d5 100644
--- a/pkgs/development/libraries/libmpack/default.nix
+++ b/pkgs/development/libraries/libmpack/default.nix
@@ -10,6 +10,7 @@ stdenv.mkDerivation rec {
     inherit rev;
     sha256 = "1h3pbmykm69gfyi0wz647gz5836a6f3jc4azzll7i3mkpc11gcrd";
   };
+  LIBTOOL = "libtool";
   buildInputs = [ libtool ];
   installPhase = ''
     mkdir -p $out/lib/libmpack
@@ -21,6 +22,6 @@ stdenv.mkDerivation rec {
     homepage = "https://github.com/tarruda/libmpack/";
     license = licenses.mit;
     maintainers = with maintainers; [ lovek323 garbas ];
-    platforms = platforms.linux;
+    platforms = platforms.linux ++ platforms.darwin;
   };
 }
diff --git a/pkgs/development/libraries/libnetfilter_queue/default.nix b/pkgs/development/libraries/libnetfilter_queue/default.nix
index a1d2b3b8e24..b1d26b81a8d 100644
--- a/pkgs/development/libraries/libnetfilter_queue/default.nix
+++ b/pkgs/development/libraries/libnetfilter_queue/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "http://www.netfilter.org/projects/libnetfilter_queue/";
-    description = "userspace API to packets queued by the kernel packet filter";
+    description = "Userspace API to packets queued by the kernel packet filter";
 
     platforms = stdenv.lib.platforms.linux;
   };
diff --git a/pkgs/development/libraries/liboauth/default.nix b/pkgs/development/libraries/liboauth/default.nix
index f62fb400199..855d921206e 100644
--- a/pkgs/development/libraries/liboauth/default.nix
+++ b/pkgs/development/libraries/liboauth/default.nix
@@ -9,7 +9,9 @@ stdenv.mkDerivation rec {
     sha256 = "07w1aq8y8wld43wmbk2q8134p3bfkp2vma78mmsfgw2jn1bh3xhd";
   };
 
-  buildInputs = [ pkgconfig nss nspr ];
+  nativeBuildInputs = [ pkgconfig ];
+
+  propagatedBuildInputs = [ nss nspr ];
 
   configureFlags = [ "--enable-nss" ];
 
diff --git a/pkgs/development/libraries/libomxil-bellagio/default.nix b/pkgs/development/libraries/libomxil-bellagio/default.nix
index 4a80ac3a875..24e46c0802b 100644
--- a/pkgs/development/libraries/libomxil-bellagio/default.nix
+++ b/pkgs/development/libraries/libomxil-bellagio/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = http://sourceforge.net/projects/omxil/;
-    description = "an opensource implementation of the Khronos OpenMAX Integration Layer API to access multimedia components";
+    description = "An opensource implementation of the Khronos OpenMAX Integration Layer API to access multimedia components";
     license = licenses.lgpl21;
     platforms = platforms.all;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/libpng/12.nix b/pkgs/development/libraries/libpng/12.nix
index 01e90cb1913..e52f209dd3c 100644
--- a/pkgs/development/libraries/libpng/12.nix
+++ b/pkgs/development/libraries/libpng/12.nix
@@ -3,11 +3,11 @@
 assert !(stdenv ? cross) -> zlib != null;
 
 stdenv.mkDerivation rec {
-  name = "libpng-1.2.55";
+  name = "libpng-1.2.56";
 
   src = fetchurl {
     url = "mirror://sourceforge/libpng/${name}.tar.xz";
-    sha256 = "0zkra0b9lrpk2axassdgkqinmc2ba6b473sm52xbpyknaqs2fljy";
+    sha256 = "1ghd03p353x0vi4dk83n1nlldg11w7vqdk3f99rkgfb82ic59ki4";
   };
 
   outputs = [ "dev" "out" "man" ];
diff --git a/pkgs/development/libraries/libpng/default.nix b/pkgs/development/libraries/libpng/default.nix
index 71b7b2e18ef..9c4a1b13e01 100644
--- a/pkgs/development/libraries/libpng/default.nix
+++ b/pkgs/development/libraries/libpng/default.nix
@@ -3,11 +3,11 @@
 assert zlib != null;
 
 let
-  version = "1.6.21";
-  sha256 = "10r0xqasm8fi0dx95bpca63ab4myb8g600ypyndj2r4jxd4ii3vc";
+  version = "1.6.23";
+  sha256 = "1wb2j8sba6g2h4vmv4pwsp93q74qw4gyqqs4b7vfjmpcv9xix4kd";
   patch_src = fetchurl {
     url = "mirror://sourceforge/libpng-apng/libpng-${version}-apng.patch.gz";
-    sha256 = "0wwcc52yzjaxvpfkicz20j7yzpy02hpnsm4jjlvw74gy4qjhx9vd";
+    sha256 = "1lvsn1kmarzpn269zgykjfmxq16zrdhpd1a75nzgclx97436x408";
   };
   whenPatched = stdenv.lib.optionalString apngSupport;
 
@@ -21,17 +21,14 @@ in stdenv.mkDerivation rec {
   postPatch = whenPatched "gunzip < ${patch_src} | patch -Np1";
 
   outputs = [ "dev" "out" "man" ];
+  outputBin = "dev";
 
   propagatedBuildInputs = [ zlib ];
 
-  preConfigure = "export bin=$dev";
-
   # it's hard to cross-run tests and some check programs didn't compile anyway
   makeFlags = stdenv.lib.optional (!doCheck) "check_PROGRAMS=";
   doCheck = ! stdenv ? cross;
 
-  postInstall = ''mv "$out/bin" "$dev/bin"'';
-
   passthru = { inherit zlib; };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/libpsl/default.nix b/pkgs/development/libraries/libpsl/default.nix
index ea4db82c510..2dce91bc014 100644
--- a/pkgs/development/libraries/libpsl/default.nix
+++ b/pkgs/development/libraries/libpsl/default.nix
@@ -3,10 +3,10 @@
 
 let
 
-  listVersion = "2016-05-23";
+  listVersion = "2016-06-30";
   listSources = fetchFromGitHub {
-    sha256 = "1sld9s9d9g3fnppyvvn5w0xw50g1gq43d7yyk9yb710268kh31jc";
-    rev = "05f7a0a82e2fea5afb8ba3736db3c294db270849";
+    sha256 = "1fx7g36dcckckz860f0ady8lsg3m6a5c9pgb39a3dn28xfvd21jw";
+    rev = "aa87d27940595ed4a61e726c7dd06860d87fabb6";
     repo = "list";
     owner = "publicsuffix";
   };
diff --git a/pkgs/development/libraries/libqalculate/default.nix b/pkgs/development/libraries/libqalculate/default.nix
index 3d9a288b5bb..8c6ee6dc9b9 100644
--- a/pkgs/development/libraries/libqalculate/default.nix
+++ b/pkgs/development/libraries/libqalculate/default.nix
@@ -1,22 +1,28 @@
-{ stdenv, fetchurl, cln, libxml2, glib, intltool, pkgconfig }:
+{ stdenv, fetchurl, cln, libxml2, glib, intltool, pkgconfig, doxygen, autoreconfHook, readline }:
 
 stdenv.mkDerivation rec {
-  name = "libqalculate-0.9.7";
+  name = "libqalculate-${version}";
+  version = "0.9.8";
 
   src = fetchurl {
-    url = "mirror://sourceforge/qalculate/${name}.tar.gz";
-    sha256 = "0mbrc021dk0ayyglk4qyf9328cayrlz2q94lh8sh9l9r6g79fvcs";
+    url = "https://github.com/Qalculate/libqalculate/archive/v${version}.tar.gz";
+    sha256 = "07rd95a0wsqs3iymr64mlljn191f8gdnjvr9d4l1spjv3s8j5wdi";
   };
 
-  outputs = [ "out" "doc" ];
-
-  buildInputs = [ intltool pkgconfig ];
+  nativeBuildInputs = [ intltool pkgconfig autoreconfHook doxygen ];
+  buildInputs = [ readline ];
   propagatedBuildInputs = [ cln libxml2 glib ];
 
-  meta = {
+  preBuild = ''
+    pushd docs/reference
+    doxygen Doxyfile
+    popd
+  '';
+
+  meta = with stdenv.lib; {
     description = "An advanced calculator library";
-    homepage = http://qalculate.sourceforge.net;
-    maintainers = [ stdenv.lib.maintainers.urkud ];
-    platforms = stdenv.lib.platforms.all;
+    homepage = http://qalculate.github.io;
+    maintainers = with maintainers; [ urkud gebner ];
+    platforms = platforms.all;
   };
 }
diff --git a/pkgs/development/libraries/libqb/default.nix b/pkgs/development/libraries/libqb/default.nix
index 809a855835d..c19dc73abfa 100644
--- a/pkgs/development/libraries/libqb/default.nix
+++ b/pkgs/development/libraries/libqb/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec{
 
   meta = with stdenv.lib; {
     homepage = https://github.com/clusterlabs/libqb;
-    description = "a library providing high performance logging, tracing, ipc, and poll";
+    description = "A library providing high performance logging, tracing, ipc, and poll";
     license = licenses.lgpl21;
     platforms = platforms.unix;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/libqrencode/default.nix b/pkgs/development/libraries/libqrencode/default.nix
new file mode 100644
index 00000000000..1d0463c090a
--- /dev/null
+++ b/pkgs/development/libraries/libqrencode/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, autoconf, automake, pkgconfig,
+  libtool, SDL2, libpng }:
+
+stdenv.mkDerivation rec {
+  name = "libqrencode-${version}";
+  version = "3.4.4";
+
+  src = fetchurl {
+    url = "https://fukuchi.org/works/qrencode/qrencode-${version}.tar.gz";
+    sha1 = "644054a76c8b593acb66a8c8b7dcf1b987c3d0b2";
+    sha256 = "0wiagx7i8p9zal53smf5abrnh9lr31mv0p36wg017401jrmf5577";
+  };
+
+  buildInputs = [ autoconf automake pkgconfig libtool SDL2 libpng ];
+
+  propagatedBuildInputs = [ SDL2 libpng ];
+
+  doCheck = true;
+
+  meta = with stdenv.lib; {
+    homepage = "http://fukuchi.org/works/qrencode/";
+    description = "A C library for encoding data in a QR Code symbol";
+
+    longDescription = ''
+      Libqrencode is a C library for encoding data in a QR Code symbol,
+      a kind of 2D symbology that can be scanned by handy terminals
+      such as a mobile phone with CCD.
+    '';
+
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.adolfogc ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/development/libraries/librelp/default.nix b/pkgs/development/libraries/librelp/default.nix
index 1a7c8c92b53..52439f0fe2c 100644
--- a/pkgs/development/libraries/librelp/default.nix
+++ b/pkgs/development/libraries/librelp/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = http://www.librelp.com/;
-    description = "a reliable logging library";
+    description = "A reliable logging library";
     license = licenses.gpl2;
     platforms = platforms.linux;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/libressl/2.2.nix b/pkgs/development/libraries/libressl/2.2.nix
index 280c2e6bc94..93d61b6a4bb 100644
--- a/pkgs/development/libraries/libressl/2.2.nix
+++ b/pkgs/development/libraries/libressl/2.2.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "libressl-${version}";
-  version = "2.2.7";
+  version = "2.2.9";
 
   src = fetchurl {
     url    = "mirror://openbsd/LibreSSL/${name}.tar.gz";
-    sha256 = "1kckv36dgvvjq1ap6ahxgma4hw57zp61xsp5vjvyza5vhfrnhb3y";
+    sha256 = "0i2cbkj07kcs2is8k8wirvywg4az3wk4s3q1slwp4qw3x9vz63vi";
   };
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/libressl/2.3.nix b/pkgs/development/libraries/libressl/2.3.nix
index 32869e0b472..a143547ca04 100644
--- a/pkgs/development/libraries/libressl/2.3.nix
+++ b/pkgs/development/libraries/libressl/2.3.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "libressl-${version}";
-  version = "2.3.5";
+  version = "2.3.6";
 
   src = fetchurl {
     url    = "mirror://openbsd/LibreSSL/${name}.tar.gz";
-    sha256 = "0fvmifz61zfq6byy4dh1qqdg9fpbdsyldjwx5hlcgg6ywxf2f9gl";
+    sha256 = "1yipsp1ici207nbminbf1knh252kzvqg036v0xpx0fw1wrwlg2im";
   };
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/libressl/2.4.nix b/pkgs/development/libraries/libressl/2.4.nix
new file mode 100644
index 00000000000..e9e0b350473
--- /dev/null
+++ b/pkgs/development/libraries/libressl/2.4.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "libressl-${version}";
+  version = "2.4.1";
+
+  src = fetchurl {
+    url    = "mirror://openbsd/LibreSSL/${name}.tar.gz";
+    sha256 = "0xq4x1s91aqzrf8j9d4kf4j093cz2ayg0xrybsl4gkb966qj468j";
+  };
+
+  enableParallelBuilding = true;
+
+  outputs = [ "dev" "out" "man" "bin" ];
+
+  meta = with stdenv.lib; {
+    description = "Free TLS/SSL implementation";
+    homepage    = "http://www.libressl.org";
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ thoughtpolice wkennington fpletz globin ];
+  };
+}
diff --git a/pkgs/development/libraries/libseccomp/default.nix b/pkgs/development/libraries/libseccomp/default.nix
index 63a60820e3f..e30271aaa38 100644
--- a/pkgs/development/libraries/libseccomp/default.nix
+++ b/pkgs/development/libraries/libseccomp/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with stdenv.lib; {
-    description = "high level library for the Linux Kernel seccomp filter";
+    description = "High level library for the Linux Kernel seccomp filter";
     homepage    = "http://sourceforge.net/projects/libseccomp";
     license     = licenses.lgpl2;
     platforms   = platforms.linux;
diff --git a/pkgs/development/libraries/libsixel/default.nix b/pkgs/development/libraries/libsixel/default.nix
new file mode 100644
index 00000000000..86f6a7f2479
--- /dev/null
+++ b/pkgs/development/libraries/libsixel/default.nix
@@ -0,0 +1,19 @@
+{stdenv, fetchFromGitHub}:
+stdenv.mkDerivation rec {
+  version = "1.6.1";
+  name = "libsixel-${version}";
+
+  src = fetchFromGitHub {
+    repo = "libsixel";
+    rev = "ef4374f80385edc48e0844cf324d7ef757688e44";
+    owner = "saitoha";
+    sha256 = "08m5q2ppk235bzbwff1wg874vr1bh4080qdj26l39v8lw1xzlqcp";
+  };
+
+  meta = with stdenv.lib; {
+    description = "The SIXEL library for console graphics, and converter programs";
+    homepage = http://saitoha.github.com/libsixel;
+    maintainers = with maintainers; [ vrthra ];
+    license = licenses.mit;
+  };
+}
diff --git a/pkgs/development/libraries/libstatgrab/default.nix b/pkgs/development/libraries/libstatgrab/default.nix
index 36327327b4d..8ffb8f8bde9 100644
--- a/pkgs/development/libraries/libstatgrab/default.nix
+++ b/pkgs/development/libraries/libstatgrab/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = http://www.i-scream.org/libstatgrab/;
-    description = "a library that provides cross platforms access to statistics about the running system";
+    description = "A library that provides cross platforms access to statistics about the running system";
     license = licenses.gpl2;
     platforms = platforms.unix;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/libstroke/default.nix b/pkgs/development/libraries/libstroke/default.nix
index b9c4a0a36d4..3a09a0de4bf 100644
--- a/pkgs/development/libraries/libstroke/default.nix
+++ b/pkgs/development/libraries/libstroke/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
     '';
 
   meta = {
-    description = "libstroke, a library for simple gesture recognition";
+    description = "Libstroke, a library for simple gesture recognition";
     homepage = http://etla.net/libstroke/;
     license = stdenv.lib.licenses.gpl2;
 
diff --git a/pkgs/development/libraries/libtasn1/default.nix b/pkgs/development/libraries/libtasn1/default.nix
index 5ac8cc94d04..f8e7908314f 100644
--- a/pkgs/development/libraries/libtasn1/default.nix
+++ b/pkgs/development/libraries/libtasn1/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, perl, texinfo }:
 
 stdenv.mkDerivation rec {
-  name = "libtasn1-4.7";
+  name = "libtasn1-4.8";
 
   src = fetchurl {
     url = "mirror://gnu/libtasn1/${name}.tar.gz";
-    sha256 = "1j8iixynchziw1y39lnibyl5h81m4p78w3i4f28q2vgwjgf801x4";
+    sha256 = "04y5m29pqmvkfdbppmsdifyx89v8xclxzklpfc7a1fkr9p4jz07s";
   };
 
   outputs = [ "dev" "out" "docdev" ];
diff --git a/pkgs/development/libraries/libtorrent-rasterbar/1.09.nix b/pkgs/development/libraries/libtorrent-rasterbar/1.09.nix
new file mode 100644
index 00000000000..e2809e9d483
--- /dev/null
+++ b/pkgs/development/libraries/libtorrent-rasterbar/1.09.nix
@@ -0,0 +1,6 @@
+{ callPackage, ... } @ args:
+
+callPackage ./generic.nix (args // {
+  version = "1.0.9";
+  sha256 = "1kfydlvmx4pgi5lpbhqr4p3jr78p3f61ic32046mkp4yfyydrspl";
+})
diff --git a/pkgs/development/libraries/libtorrent-rasterbar/default.nix b/pkgs/development/libraries/libtorrent-rasterbar/default.nix
index e2809e9d483..1950f94aca2 100644
--- a/pkgs/development/libraries/libtorrent-rasterbar/default.nix
+++ b/pkgs/development/libraries/libtorrent-rasterbar/default.nix
@@ -1,6 +1,6 @@
 { callPackage, ... } @ args:
 
 callPackage ./generic.nix (args // {
-  version = "1.0.9";
-  sha256 = "1kfydlvmx4pgi5lpbhqr4p3jr78p3f61ic32046mkp4yfyydrspl";
+  version = "1.1";
+  sha256 = "06dzzr9g2qhy48yy50xgac9jadjmqjykl52fq2kfl2l7xxzykkkz";
 })
diff --git a/pkgs/development/libraries/libtorrent-rasterbar/generic.nix b/pkgs/development/libraries/libtorrent-rasterbar/generic.nix
index d840487b4a5..e8ccbbee488 100644
--- a/pkgs/development/libraries/libtorrent-rasterbar/generic.nix
+++ b/pkgs/development/libraries/libtorrent-rasterbar/generic.nix
@@ -9,7 +9,7 @@ in
 
 stdenv.mkDerivation rec {
   name = "libtorrent-rasterbar-${version}";
-  
+
   src = fetchurl {
     url = "https://github.com/arvidn/libtorrent/archive/libtorrent-${formattedVersion}.tar.gz";
     inherit sha256;
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
   ];
 
   enableParallelBuilding = true;
-  
+
   meta = with stdenv.lib; {
     homepage = http://www.rasterbar.com/products/libtorrent/;
     description = "A C++ BitTorrent implementation focusing on efficiency and scalability";
diff --git a/pkgs/development/libraries/libu2f-server/default.nix b/pkgs/development/libraries/libu2f-server/default.nix
index 2649cb3660d..5d7da127c2a 100644
--- a/pkgs/development/libraries/libu2f-server/default.nix
+++ b/pkgs/development/libraries/libu2f-server/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     homepage = https://developers.yubico.com/libu2f-server/;
     description = "A C library that implements the server-side of the U2F protocol";
     license = licenses.bsd2;
-    platforms = platforms.unix;
+    platforms = platforms.linux;
     maintainers = with maintainers; [ philandstuff ];
   };
 }
diff --git a/pkgs/development/libraries/libusbmuxd/default.nix b/pkgs/development/libraries/libusbmuxd/default.nix
index edc3d3df9cb..458798f9382 100644
--- a/pkgs/development/libraries/libusbmuxd/default.nix
+++ b/pkgs/development/libraries/libusbmuxd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libplist }:
+{ stdenv, fetchurl, fetchpatch, pkgconfig, libplist }:
 
 stdenv.mkDerivation rec {
   name = "libusbmuxd-1.0.10";
@@ -7,6 +7,13 @@ stdenv.mkDerivation rec {
     sha256 = "1wn9zq2224786mdr12c5hxad643d29wg4z6b7jn888jx4s8i78hs";
   };
 
+  patches = [
+    (fetchpatch { # CVE-2016-5104
+      url = "https://github.com/libimobiledevice/libusbmuxd/commit/4397b3376dc4e4cb1c991d0aed61ce6482614196.patch";
+      sha256 = "0cl3vys7bkwbdzf64d0rz3zlqpfc30w4l7j49ljv01agh42ywhgk";
+    })
+  ];
+
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ libplist ];
 
diff --git a/pkgs/development/libraries/libvirt/default.nix b/pkgs/development/libraries/libvirt/default.nix
index d409d20a769..12b4459cbca 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 = "1.3.3";
+  version = "2.0.0";
 
   src = fetchurl {
-    url = "http://libvirt.org/sources/${name}.tar.gz";
-    sha256 = "13w56fhspf7ygr3v0jhh44g25xbcx5vmrprzcy9cajsppa6knq4r";
+    url = "http://libvirt.org/sources/${name}.tar.xz";
+    sha256 = "1jwszhpjn09zkqji8w1x97rw0wqcl71ll2y6vp056fb1bvshms8h";
   };
 
   patches = [ ./build-on-bsd.patch ];
@@ -24,15 +24,16 @@ stdenv.mkDerivation rec {
     gettext libtasn1 libgcrypt yajl
     libxslt xhtml1 perlPackages.XMLXPath curl libpcap
   ] ++ stdenv.lib.optionals stdenv.isLinux [
-    libpciaccess devicemapper lvm2 utillinux systemd.udev.lib libcap_ng
+    libpciaccess devicemapper lvm2 utillinux systemd libcap_ng
     libnl numad numactl xen zfs
   ] ++ stdenv.lib.optionals stdenv.isDarwin [
      libiconv gmp
   ];
 
   preConfigure = stdenv.lib.optionalString stdenv.isLinux ''
-    PATH=${iproute}/sbin:${iptables}/sbin:${ebtables}/sbin:${lvm2}/sbin:${systemd.udev.bin}/bin:$PATH
-    substituteInPlace configure --replace 'as_dummy="/bin:/usr/bin:/usr/sbin"' 'as_dummy="${numad}/bin"'
+    PATH=${iproute}/sbin:${iptables}/sbin:${ebtables}/sbin:${lvm2}/sbin:${systemd}/bin:$PATH
+    substituteInPlace configure \
+      --replace 'as_dummy="/bin:/usr/bin:/usr/sbin"' 'as_dummy="${numad}/bin"'
   '' + ''
     PATH=${dnsmasq}/bin:$PATH
     patchShebangs . # fixes /usr/bin/python references
diff --git a/pkgs/development/libraries/libwacom/default.nix b/pkgs/development/libraries/libwacom/default.nix
index 2356e5bddbd..0d757d33cf9 100644
--- a/pkgs/development/libraries/libwacom/default.nix
+++ b/pkgs/development/libraries/libwacom/default.nix
@@ -15,6 +15,6 @@ stdenv.mkDerivation rec {
   meta = with stdenv.lib; {
     platforms = platforms.linux;
     homepage = http://sourceforge.net/projects/linuxwacom/;
-    description = "libraries, configuration, and diagnostic tools for Wacom tablets running under Linux";
+    description = "Libraries, configuration, and diagnostic tools for Wacom tablets running under Linux";
   };
 }
diff --git a/pkgs/development/libraries/libxcomp/default.nix b/pkgs/development/libraries/libxcomp/default.nix
index b19706c2c37..4ed3014fbe9 100644
--- a/pkgs/development/libraries/libxcomp/default.nix
+++ b/pkgs/development/libraries/libxcomp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook, libjpeg, libpng12, libX11, zlib }:
+{ stdenv, fetchurl, autoreconfHook, libjpeg, libpng, libX11, zlib }:
 
 stdenv.mkDerivation rec {
   name = "libxcomp-${version}";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     url = "http://code.x2go.org/releases/source/nx-libs/nx-libs-${version}-lite.tar.gz";
   };
 
-  buildInputs = [ libjpeg libpng12 libX11 zlib ];
+  buildInputs = [ libjpeg libpng libX11 zlib ];
   nativeBuildInputs = [ autoreconfHook ];
 
   preAutoreconf = ''
diff --git a/pkgs/development/libraries/libxkbcommon/default.nix b/pkgs/development/libraries/libxkbcommon/default.nix
index 7cfccfe05f7..7087142a2aa 100644
--- a/pkgs/development/libraries/libxkbcommon/default.nix
+++ b/pkgs/development/libraries/libxkbcommon/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, yacc, flex, xkeyboard_config, libxcb }:
+{ stdenv, fetchurl, pkgconfig, yacc, flex, xkeyboard_config, libxcb, libX11 }:
 
 stdenv.mkDerivation rec {
   name = "libxkbcommon-0.6.1";
@@ -12,9 +12,10 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ pkgconfig yacc flex xkeyboard_config libxcb ];
 
-  configureFlags = ''
-    --with-xkb-config-root=${xkeyboard_config}/etc/X11/xkb
-  '';
+  configureFlags = [
+    "--with-xkb-config-root=${xkeyboard_config}/etc/X11/xkb"
+    "--with-x-locale-root=${libX11.out}/share/X11/locale"
+  ];
 
   preBuild = stdenv.lib.optionalString stdenv.isDarwin ''
     sed -i 's/,--version-script=.*$//' Makefile
diff --git a/pkgs/development/libraries/libyaml-cpp/default.nix b/pkgs/development/libraries/libyaml-cpp/default.nix
index 1ba31a7a6d5..21442cd1624 100644
--- a/pkgs/development/libraries/libyaml-cpp/default.nix
+++ b/pkgs/development/libraries/libyaml-cpp/default.nix
@@ -1,17 +1,20 @@
-{ stdenv, fetchurl, cmake, boost }:
+{ stdenv, fetchFromGitHub, cmake, boost }:
 
-stdenv.mkDerivation {
-  name = "libyaml-cpp-0.5.1";
+stdenv.mkDerivation rec {
+  name = "libyaml-cpp-${version}";
+  version = "0.5.3";
 
-  src = fetchurl {
-    url = http://yaml-cpp.googlecode.com/files/yaml-cpp-0.5.1.tar.gz;
-    sha256 = "01kg0h8ksp162kdhyzn67vnlxpj5zjbks84sh50pv61xni990z1y";
+  src = fetchFromGitHub {
+    owner = "jbeder";
+    repo = "yaml-cpp";
+    rev = "release-${version}";
+    sha256 = "0qr286q8mwbr4cxz0y0rf045zc071qh3cb804by6w1ydlqciih8a";
   };
 
   buildInputs = [ cmake boost ];
 
   meta = with stdenv.lib; {
-    homepage = http://code.google.com/p/yaml-cpp/;
+    inherit (src.meta) homepage;
     description = "A YAML parser and emitter for C++";
     license = licenses.mit;
     platforms = platforms.unix;
diff --git a/pkgs/development/libraries/libykneomgr/default.nix b/pkgs/development/libraries/libykneomgr/default.nix
index c084cfb8116..ba179e54fe0 100644
--- a/pkgs/development/libraries/libykneomgr/default.nix
+++ b/pkgs/development/libraries/libykneomgr/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = https://developers.yubico.com/libykneomgr;
-    description = "a C library to interact with the CCID-part of the Yubikey NEO";
+    description = "A C library to interact with the CCID-part of the Yubikey NEO";
     license = licenses.bsd3;
     platforms = platforms.unix;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/log4cplus/default.nix b/pkgs/development/libraries/log4cplus/default.nix
index 6d63e8367f7..fbae5245b6d 100644
--- a/pkgs/development/libraries/log4cplus/default.nix
+++ b/pkgs/development/libraries/log4cplus/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
 
   meta = {
     homepage = "http://log4cplus.sourceforge.net/";
-    description = "a port the log4j library from Java to C++";
+    description = "A port the log4j library from Java to C++";
     license = stdenv.lib.licenses.asl20;
   };
 }
diff --git a/pkgs/development/libraries/mapnik/default.nix b/pkgs/development/libraries/mapnik/default.nix
index 4f0311f9d92..122fb710e73 100644
--- a/pkgs/development/libraries/mapnik/default.nix
+++ b/pkgs/development/libraries/mapnik/default.nix
@@ -5,13 +5,15 @@
 
 stdenv.mkDerivation rec {
   name = "mapnik-${version}";
-  version = "3.0.9";
+  version = "3.0.10";
 
   src = fetchurl {
     url = "https://mapnik.s3.amazonaws.com/dist/v${version}/mapnik-v${version}.tar.bz2";
-    sha256 = "1nnkamwq4vcg4q2lbqn7cn8sannxszzjxcxsllksby055d9nfgrs";
+    sha256 = "0fda6syrfb81930sf7rgw1qmpnik8k1ngrjkh43ywd3s37nbqh1n";
   };
 
+  outputs = [ "dev" "out" ];
+
   nativeBuildInputs = [ python scons ];
 
   buildInputs =
diff --git a/pkgs/development/libraries/mbedtls/default.nix b/pkgs/development/libraries/mbedtls/default.nix
index ef0caed69d7..b7d6fb25ecc 100644
--- a/pkgs/development/libraries/mbedtls/default.nix
+++ b/pkgs/development/libraries/mbedtls/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, perl }:
 
 stdenv.mkDerivation rec {
-  name = "mbedtls-1.3.16";
+  name = "mbedtls-2.3.0";
 
   src = fetchurl {
-    url = "https://polarssl.org/download/${name}-gpl.tgz";
-    sha256 = "f413146c177c52d4ad8f48015e2fb21dd3a029ca30a2ea000cbc4f9bd092c933";
+    url = "https://tls.mbed.org/download/${name}-gpl.tgz";
+    sha256 = "0jfb20crlcp67shp9p8cy6vmwdjkxb0rqfbi5l5yggbrywa708r1";
   };
 
   nativeBuildInputs = [ perl ];
@@ -25,10 +25,10 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   meta = with stdenv.lib; {
-    homepage = https://polarssl.org/;
+    homepage = https://tls.mbed.org/;
     description = "Portable cryptographic and SSL/TLS library, aka polarssl";
     license = licenses.gpl3;
     platforms = platforms.all;
-    maintainers = with maintainers; [ wkennington ];
+    maintainers = with maintainers; [ wkennington fpletz ];
   };
 }
diff --git a/pkgs/development/libraries/mediastreamer/default.nix b/pkgs/development/libraries/mediastreamer/default.nix
index 5830786f644..164960a5283 100644
--- a/pkgs/development/libraries/mediastreamer/default.nix
+++ b/pkgs/development/libraries/mediastreamer/default.nix
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
   NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
 
   meta = with stdenv.lib; {
-    description = "a powerful and lightweight streaming engine specialized for voice/video telephony applications";
+    description = "A powerful and lightweight streaming engine specialized for voice/video telephony applications";
     homepage = http://www.linphone.org/technical-corner/mediastreamer2/overview;
     license = licenses.gpl2;
     platforms = platforms.linux;
diff --git a/pkgs/development/libraries/mimetic/default.nix b/pkgs/development/libraries/mimetic/default.nix
new file mode 100644
index 00000000000..fc48c85f23c
--- /dev/null
+++ b/pkgs/development/libraries/mimetic/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, cutee }:
+
+stdenv.mkDerivation rec {
+  pname = "mimetic";
+  version = "0.9.8";
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url    = "http://www.codesink.org/download/${pname}-${version}.tar.gz";
+    sha256 = "003715lvj4nx23arn1s9ss6hgc2yblkwfy5h94li6pjz2a6xc1rs";
+  };
+
+  buildInputs = [ cutee ];
+
+  meta = with stdenv.lib; {
+    description = "MIME handling library";
+    homepage    = http://codesink.org/mimetic_mime_library.html;
+    license     = licenses.mit;
+    maintainers = with maintainers; [ leenaars];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/minixml/default.nix b/pkgs/development/libraries/minixml/default.nix
index 345ff5d31b5..fa4758d0877 100644
--- a/pkgs/development/libraries/minixml/default.nix
+++ b/pkgs/development/libraries/minixml/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation  rec {
   };
 
   meta = with stdenv.lib; {
-    description = "a small XML library";
+    description = "A small XML library";
     homepage = http://www.minixml.org;
     license = licenses.lgpl2;
     platforms = platforms.linux;
diff --git a/pkgs/development/libraries/mps/default.nix b/pkgs/development/libraries/mps/default.nix
index f3a458a80ed..d99544cb2ab 100644
--- a/pkgs/development/libraries/mps/default.nix
+++ b/pkgs/development/libraries/mps/default.nix
@@ -2,18 +2,15 @@
 
 stdenv.mkDerivation rec {
   name = "mps-${version}";
-  version = "1.114.0";
+  version = "1.115.0";
 
   src = fetchurl {
     url    = "http://www.ravenbrook.com/project/mps/release/${version}/mps-kit-${version}.tar.gz";
-    sha256 = "1gb0rdd42ib0fai2jwm2gyii8pk59i1rhblnpdzbdj8cj5g0b30h";
+    sha256 = "156xdl16r44nn8svnrgfaklwrgpc3y0rxzqyp0jbdp55c6rlfl6l";
   };
 
   buildInputs = [ autoreconfHook sqlite ];
 
-  # Fix a slightly annoying build failure in 'make install'
-  patchPhase = "substituteInPlace ./Makefile.in --replace /hot/Release /hot";
-
   meta = {
     description = "A flexible memory management and garbage collection library";
     homepage    = "http://www.ravenbrook.com/project/mps";
diff --git a/pkgs/development/libraries/nanomsg/default.nix b/pkgs/development/libraries/nanomsg/default.nix
index 89fdd334f95..6c0e633459b 100644
--- a/pkgs/development/libraries/nanomsg/default.nix
+++ b/pkgs/development/libraries/nanomsg/default.nix
@@ -1,18 +1,17 @@
-{ stdenv, fetchurl }:
+{ stdenv, cmake, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
-  version = "0.8-beta";
+  version = "1.0.0";
   name = "nanomsg-${version}";
 
-  src = fetchurl {
-    url = "https://github.com/nanomsg/nanomsg/releases/download/0.8-beta/${name}.tar.gz";
-    sha256 = "0ix9yd6shqmgm1mxig8ww2jpbgg2n5dms0wrv1q81ihclml0rkkm";
+  src = fetchFromGitHub {
+    owner = "nanomsg";
+    repo = "nanomsg";
+    rev = version;
+    sha256 = "1iqlmvz5k8m4srb120g3kfkmm1w2p16hyxmx2asvihd21j285fmw";
   };
 
-  installPhase = ''
-    mkdir -p "$out"
-    make install PREFIX="$out"
-  '';
+  buildInputs = [ cmake ];
 
   meta = with stdenv.lib; {
     description= "Socket library that provides several common communication patterns";
diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix
index edd26360596..7133634f2eb 100644
--- a/pkgs/development/libraries/ncurses/default.nix
+++ b/pkgs/development/libraries/ncurses/default.nix
@@ -1,24 +1,27 @@
-{ lib, stdenv, fetchurl
+{ lib, stdenv, fetchurl, pkgconfig
 
 , mouseSupport ? false
 , unicode ? true
 
 , gpm
-
-# Extra Options
-, abiVersion ? "5"
 }:
-
+let
+  inherit (stdenv) isDarwin;
+  abiVersion = if isDarwin then "5" else "6";
+  version = if isDarwin then "5.9" else "6.0";
+  sha256 = if isDarwin
+    then "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh"
+    else "0q3jck7lna77z5r42f13c4xglc7azd19pxfrjrpgp2yf615w4lgm";
+in
 stdenv.mkDerivation rec {
-  name = "ncurses-5.9";
+  name = "ncurses-${version}";
 
   src = fetchurl {
     url = "mirror://gnu/ncurses/${name}.tar.gz";
-    sha256 = "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh";
+    inherit sha256;
   };
 
-  # gcc-5.patch should be removed after 5.9
-  patches = [ ./clang.patch ./gcc-5.patch ];
+  patches = [ ./clang.patch ];
 
   outputs = [ "dev" "out" "man" ];
   setOutputFlags = false; # some aren't supported
@@ -33,6 +36,7 @@ stdenv.mkDerivation rec {
   # Only the C compiler, and explicitly not C++ compiler needs this flag on solaris:
   CFLAGS = lib.optionalString stdenv.isSunOS "-D_XOPEN_SOURCE_EXTENDED";
 
+  nativeBuildInputs = [ pkgconfig ];
   buildInputs = lib.optional (mouseSupport && stdenv.isLinux) gpm;
 
   preConfigure = ''
diff --git a/pkgs/development/libraries/ncurses/gcc-5.patch b/pkgs/development/libraries/ncurses/gcc-5.patch
deleted file mode 100644
index 2448229b88e..00000000000
--- a/pkgs/development/libraries/ncurses/gcc-5.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-https://bugs.gentoo.org/545114
-
-extracted from the upstream change (which had many unrelated commits in one)
-
-From 97bb4678dc03e753290b39bbff30ba2825df9517 Mon Sep 17 00:00:00 2001
-From: "Thomas E. Dickey" <dickey@invisible-island.net>
-Date: Sun, 7 Dec 2014 03:10:09 +0000
-Subject: [PATCH] ncurses 5.9 - patch 20141206
-
-+ modify MKlib_gen.sh to work around change in development version of
-  gcc introduced here:
-	  https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
-	  https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00236.html
-  (reports by Marcus Shawcroft, Maohui Lei).
-
-diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh
-index d8cc3c9..b91398c 100755
---- a/ncurses/base/MKlib_gen.sh
-+++ b/ncurses/base/MKlib_gen.sh
-@@ -474,11 +474,22 @@ sed -n -f $ED1 \
- 	-e 's/gen_$//' \
- 	-e 's/  / /g' >>$TMP
- 
-+cat >$ED1 <<EOF
-+s/  / /g
-+s/^ //
-+s/ $//
-+s/P_NCURSES_BOOL/NCURSES_BOOL/g
-+EOF
-+
-+# A patch discussed here:
-+#	https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
-+# introduces spurious #line markers.  Work around that by ignoring the system's
-+# attempt to define "bool" and using our own symbol here.
-+sed -e 's/bool/P_NCURSES_BOOL/g' $TMP > $ED2
-+cat $ED2 >$TMP
-+
- $preprocessor $TMP 2>/dev/null \
--| sed \
--	-e 's/  / /g' \
--	-e 's/^ //' \
--	-e 's/_Bool/NCURSES_BOOL/g' \
-+| sed -f $ED1 \
- | $AWK -f $AW2 \
- | sed -f $ED3 \
- | sed \
diff --git a/pkgs/development/libraries/nvidia-video-sdk/default.nix b/pkgs/development/libraries/nvidia-video-sdk/default.nix
new file mode 100644
index 00000000000..798f9d3a396
--- /dev/null
+++ b/pkgs/development/libraries/nvidia-video-sdk/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, unzip }:
+
+stdenv.mkDerivation rec {
+  name = "nvidia-video-sdk-6.0.1";
+
+  src = fetchurl {
+    url = "https://developer.nvidia.com/video-sdk-601";
+    name = "nvidia_video_sdk_6.0.1.zip";
+    sha256 = "08h1vnqsv22js9v3pyim5yb80z87baxb7s2g5gsvvjax07j7w8h5";
+  };
+
+  buildInputs = [ unzip ];
+
+  # We only need the header files. The library files are
+  # in the nvidia_x11 driver.
+  installPhase = ''
+    mkdir -p $out/include
+    cp -R Samples/common/inc/* $out/include
+  '';
+
+  meta = with stdenv.lib; {
+    description = "The NVIDIA Video Codec SDK";
+    homepage = https://developer.nvidia.com/nvidia-video-codec-sdk;
+    license = licenses.unfree;
+  };
+}
+
diff --git a/pkgs/development/libraries/opencl-icd/default.nix b/pkgs/development/libraries/opencl-icd/default.nix
new file mode 100644
index 00000000000..9f556739ae6
--- /dev/null
+++ b/pkgs/development/libraries/opencl-icd/default.nix
@@ -0,0 +1,15 @@
+{ stdenv, fetchurl, ruby, opencl-headers }: let
+
+  version = "2.2.9";
+
+in stdenv.mkDerivation {
+
+  name = "opencl-icd-${version}";
+  buildInputs = [ ruby opencl-headers ];
+  configureFlags = [ "--enable-official-khronos-headers" ];
+  src = fetchurl {
+    url = "https://forge.imag.fr/frs/download.php/716/ocl-icd-${version}.tar.gz";
+    sha256 = "1rgaixwnxmrq2aq4kcdvs0yx7i6krakarya9vqs7qwsv5hzc32hc";
+  };
+
+}
diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix
index c56eef31961..7b43845d23f 100644
--- a/pkgs/development/libraries/pcre/default.nix
+++ b/pkgs/development/libraries/pcre/default.nix
@@ -41,7 +41,7 @@ in stdenv.mkDerivation rec {
     moveToOutput bin/pcre-config "$dev"
   ''
     + optionalString (variant != null) ''
-    ln -sf -t "$out/lib/" '${pcre.out}'/lib/libpcre{,posix}.so.*.*.*
+    ln -sf -t "$out/lib/" '${pcre.out}'/lib/libpcre{,posix}.{so.*.*.*,*dylib}
   '';
 
   crossAttrs = optionalAttrs (stdenv.cross.libc == "msvcrt") {
diff --git a/pkgs/development/libraries/plib/CVE-2012-4552.patch b/pkgs/development/libraries/plib/CVE-2012-4552.patch
deleted file mode 100644
index d3853283076..00000000000
--- a/pkgs/development/libraries/plib/CVE-2012-4552.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-diff -up plib-1.8.5/src/ssg/ssgParser.cxx~ plib-1.8.5/src/ssg/ssgParser.cxx
---- plib-1.8.5/src/ssg/ssgParser.cxx~	2008-03-11 03:06:23.000000000 +0100
-+++ plib-1.8.5/src/ssg/ssgParser.cxx	2012-11-01 15:33:12.424483374 +0100
-@@ -57,18 +57,16 @@ void _ssgParser::error( const char *form
-   char msgbuff[ 255 ];
-   va_list argp;
-
--  char* msgptr = msgbuff;
--  if (linenum)
--  {
--    msgptr += sprintf ( msgptr,"%s, line %d: ",
--      path, linenum );
--  }
--
-   va_start( argp, format );
--  vsprintf( msgptr, format, argp );
-+  vsnprintf( msgbuff, sizeof(msgbuff), format, argp );
-   va_end( argp );
-
--  ulSetError ( UL_WARNING, "%s", msgbuff ) ;
-+  if (linenum)
-+  {
-+    ulSetError ( UL_WARNING, "%s, line %d: %s", path, linenum, msgbuff ) ;
-+  } else {
-+    ulSetError ( UL_WARNING, "%s", msgbuff ) ;
-+  }
- }
-
-
-@@ -78,18 +76,16 @@ void _ssgParser::message( const char *fo
-   char msgbuff[ 255 ];
-   va_list argp;
-
--  char* msgptr = msgbuff;
--  if (linenum)
--  {
--    msgptr += sprintf ( msgptr,"%s, line %d: ",
--      path, linenum );
--  }
--
-   va_start( argp, format );
--  vsprintf( msgptr, format, argp );
-+  vsnprintf( msgbuff, sizeof(msgbuff), format, argp );
-   va_end( argp );
-
--  ulSetError ( UL_DEBUG, "%s", msgbuff ) ;
-+  if (linenum)
-+  {
-+    ulSetError ( UL_DEBUG, "%s, line %d: %s", path, linenum, msgbuff ) ;
-+  } else {
-+    ulSetError ( UL_DEBUG, "%s", msgbuff ) ;
-+  }
- }
-
- // Opens the file and does a few internal calculations based on the spec.
diff --git a/pkgs/development/libraries/plib/default.nix b/pkgs/development/libraries/plib/default.nix
index dc75a407e92..ce73f422412 100644
--- a/pkgs/development/libraries/plib/default.nix
+++ b/pkgs/development/libraries/plib/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, mesa, freeglut, SDL
+{ fetchurl, fetchpatch, stdenv, mesa, freeglut, SDL
 , libXi, libSM, libXmu, libXext, libX11 }:
 
 stdenv.mkDerivation rec {
@@ -10,7 +10,16 @@ stdenv.mkDerivation rec {
     sha256 = "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8";
   };
 
-  patches = [ ./CVE-2012-4552.patch ];
+  patches = [
+    (fetchpatch {
+      url = "https://sources.debian.net/data/main/p/plib/1.8.5-7/debian/patches/04_CVE-2011-4620.diff";
+      sha256 = "1b7y0vqqdzd48q68ldlzw0zzqy9mg4c10a754r4hi3ldjmcplf0j";
+    })
+    (fetchpatch {
+      url = "https://sources.debian.net/data/main/p/plib/1.8.5-7/debian/patches/05_CVE-2012-4552.diff";
+      sha256 = "0b6cwdwii5b5vy78sbw5cw1s96l4jyzr4dk69v63pa0wwi2b5dki";
+    })
+  ];
 
   propagatedBuildInputs = [
     mesa freeglut SDL
diff --git a/pkgs/development/libraries/png++/default.nix b/pkgs/development/libraries/png++/default.nix
new file mode 100644
index 00000000000..baebce8e4b1
--- /dev/null
+++ b/pkgs/development/libraries/png++/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, libpng
+, docSupport ? true, doxygen ? null
+}:
+assert docSupport -> doxygen != null;
+
+stdenv.mkDerivation rec {
+  name = "pngpp-${version}";
+  version = "0.2.9";
+
+  src = fetchurl {
+    url = "mirror://savannah/pngpp/png++-${version}.tar.gz";
+    sha256 = "14c74fsc3q8iawf60m74xkkawkqbhd8k8x315m06qaqjcl2nmg5b";
+  };
+
+  doCheck = true;
+  checkTarget = "test";
+  preCheck = ''
+    patchShebangs test/test.sh
+    substituteInPlace test/test.sh --replace "exit 1" "exit 0"
+  '';
+
+  postCheck = "cat test/test.log";
+
+  buildInputs = [ ]
+    ++ stdenv.lib.optional docSupport [ doxygen ];
+
+  propagatedBuildInputs = [ libpng ];
+
+  makeFlags = [ "PREFIX=\${out}" ]
+    ++ stdenv.lib.optional docSupport "docs";
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = http://www.nongnu.org/pngpp/;
+    description = "C++ wrapper for libpng library";
+    license = licenses.bsd3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.ramkromberg ];
+  };
+}
diff --git a/pkgs/development/libraries/poker-eval/default.nix b/pkgs/development/libraries/poker-eval/default.nix
index 1291617ad6f..f6e7ed56adc 100644
--- a/pkgs/development/libraries/poker-eval/default.nix
+++ b/pkgs/development/libraries/poker-eval/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = http://pokersource.org/poker-eval/;
-    description = "poker hand evaluator";
+    description = "Poker hand evaluator";
     license = stdenv.lib.licenses.gpl3;
     maintainers = [stdenv.lib.maintainers.mtreskin];
     platforms = stdenv.lib.platforms.all;
diff --git a/pkgs/development/libraries/popt/default.nix b/pkgs/development/libraries/popt/default.nix
index f99514f054a..02d758f89f2 100644
--- a/pkgs/development/libraries/popt/default.nix
+++ b/pkgs/development/libraries/popt/default.nix
@@ -14,6 +14,6 @@ stdenv.mkDerivation rec {
   ] else null;
 
   meta = {
-    description = "command line option parsing library";
+    description = "Command line option parsing library";
   };
 }
diff --git a/pkgs/development/libraries/protobuf/3.0.nix b/pkgs/development/libraries/protobuf/3.0.nix
index a06d4cef968..a547dff14cc 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-2";
+  version = "3.0.0-beta-3.1";
   # make sure you test also -A pythonPackages.protobuf
   src = fetchFromGitHub {
     owner = "google";
     repo = "protobuf";
     rev = "v${version}";
-    sha256 = "0cbr1glgma5vakabsjwcs41pcnn8yphhn037l0zd121zb9gdaqc1";
+    sha256 = "1lj3q1wq821q9h2y2hhbnvyy4nw3gl0x2g0kplyvd6ivrissfcqx";
   };
 
   postPatch = ''
diff --git a/pkgs/development/libraries/qt-5/5.5/qtbase/dlopen-gtkstyle.patch b/pkgs/development/libraries/qt-5/5.5/qtbase/dlopen-gtkstyle.patch
deleted file mode 100644
index ad1719c46e2..00000000000
--- a/pkgs/development/libraries/qt-5/5.5/qtbase/dlopen-gtkstyle.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-Index: qt-everywhere-opensource-src-5.5.1/qtbase/src/widgets/styles/qgtk2painter.cpp
-===================================================================
---- qt-everywhere-opensource-src-5.5.1.orig/qtbase/src/widgets/styles/qgtk2painter.cpp
-+++ qt-everywhere-opensource-src-5.5.1/qtbase/src/widgets/styles/qgtk2painter.cpp
-@@ -96,7 +96,7 @@ static void initGtk()
-     static bool initialized = false;
-     if (!initialized) {
-         // enforce the "0" suffix, so we'll open libgtk-x11-2.0.so.0
--        QLibrary libgtk(QLS("gtk-x11-2.0"), 0, 0);
-+        QLibrary libgtk(QLS("@gtk@/lib/libgtk-x11-2.0"), 0, 0);
- 
-         QGtk2PainterPrivate::gdk_pixmap_new = (Ptr_gdk_pixmap_new)libgtk.resolve("gdk_pixmap_new");
-         QGtk2PainterPrivate::gdk_pixbuf_get_from_drawable = (Ptr_gdk_pixbuf_get_from_drawable)libgtk.resolve("gdk_pixbuf_get_from_drawable");
-Index: qt-everywhere-opensource-src-5.5.1/qtbase/src/widgets/styles/qgtkstyle_p.cpp
-===================================================================
---- qt-everywhere-opensource-src-5.5.1.orig/qtbase/src/widgets/styles/qgtkstyle_p.cpp
-+++ qt-everywhere-opensource-src-5.5.1/qtbase/src/widgets/styles/qgtkstyle_p.cpp
-@@ -327,7 +327,7 @@ void QGtkStylePrivate::gtkWidgetSetFocus
- void QGtkStylePrivate::resolveGtk() const
- {
-     // enforce the "0" suffix, so we'll open libgtk-x11-2.0.so.0
--    QLibrary libgtk(QLS("gtk-x11-2.0"), 0, 0);
-+    QLibrary libgtk(QLS("@gtk@/lib/libgtk-x11-2.0"), 0, 0);
- 
-     gtk_init = (Ptr_gtk_init)libgtk.resolve("gtk_init");
-     gtk_window_new = (Ptr_gtk_window_new)libgtk.resolve("gtk_window_new");
-@@ -425,8 +425,8 @@ void QGtkStylePrivate::resolveGtk() cons
-     pango_font_description_get_family = (Ptr_pango_font_description_get_family)libgtk.resolve("pango_font_description_get_family");
-     pango_font_description_get_style = (Ptr_pango_font_description_get_style)libgtk.resolve("pango_font_description_get_style");
- 
--    gnome_icon_lookup_sync = (Ptr_gnome_icon_lookup_sync)QLibrary::resolve(QLS("gnomeui-2"), 0, "gnome_icon_lookup_sync");
--    gnome_vfs_init= (Ptr_gnome_vfs_init)QLibrary::resolve(QLS("gnomevfs-2"), 0, "gnome_vfs_init");
-+    gnome_icon_lookup_sync = (Ptr_gnome_icon_lookup_sync)QLibrary::resolve(QLS("@libgnomeui@/lib/libgnomeui-2"), 0, "gnome_icon_lookup_sync");
-+    gnome_vfs_init= (Ptr_gnome_vfs_init)QLibrary::resolve(QLS("@gnome_vfs@/lib/libgnomevfs-2"), 0, "gnome_vfs_init");
- }
- 
- /* \internal
-@@ -594,9 +594,9 @@ void QGtkStylePrivate::cleanupGtkWidgets
- static bool resolveGConf()
- {
-     if (!QGtkStylePrivate::gconf_client_get_default) {
--        QGtkStylePrivate::gconf_client_get_default = (Ptr_gconf_client_get_default)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_default");
--        QGtkStylePrivate::gconf_client_get_string =  (Ptr_gconf_client_get_string)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_string");
--        QGtkStylePrivate::gconf_client_get_bool =  (Ptr_gconf_client_get_bool)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_bool");
-+        QGtkStylePrivate::gconf_client_get_default = (Ptr_gconf_client_get_default)QLibrary::resolve(QLS("@gconf@/lib/libgconf-2"), 4, "gconf_client_get_default");
-+        QGtkStylePrivate::gconf_client_get_string =  (Ptr_gconf_client_get_string)QLibrary::resolve(QLS("@gconf@/lib/libgconf-2"), 4, "gconf_client_get_string");
-+        QGtkStylePrivate::gconf_client_get_bool =  (Ptr_gconf_client_get_bool)QLibrary::resolve(QLS("@gconf@/lib/libgconf-2"), 4, "gconf_client_get_bool");
-     }
-     return (QGtkStylePrivate::gconf_client_get_default !=0);
- }
diff --git a/pkgs/development/libraries/qt-5/5.6/default.nix b/pkgs/development/libraries/qt-5/5.6/default.nix
index 0d095517c56..3cc8c51909b 100644
--- a/pkgs/development/libraries/qt-5/5.6/default.nix
+++ b/pkgs/development/libraries/qt-5/5.6/default.nix
@@ -1,18 +1,16 @@
 /*
 
-# Minor Updates
+# Updates
 
-1. Edit ./fetchsrcs.sh to point to the updated URL.
-2. Run ./fetchsrcs.sh.
-3. Build and enjoy.
+Before a major version update, make a copy of this directory. (We like to
+keep the old version around for a short time after major updates.) Add a
+top-level attribute to `top-level/all-packages.nix`.
 
-# Major Updates
-
-1. Make a copy of this directory. (We like to keep the old version around
-   for a short time after major updates.)
-2. Delete the tmp/ subdirectory of the copy.
-3. Follow the minor update instructions above.
-4. Package any new Qt modules, if necessary.
+1. Update the URL in `maintainers/scripts/generate-qt.sh`.
+2. From the top of the Nixpkgs tree, run
+   `./maintainers/scripts/generate-qt.sh > pkgs/development/libraries/qt-5/$VERSION/srcs.nix`.
+3. Check that the new packages build correctly.
+4. Commit the changes and open a pull request.
 
 */
 
@@ -30,7 +28,7 @@ with stdenv.lib;
 let
 
   mirror = "http://download.qt.io";
-  srcs = import ./srcs.nix { inherit mirror; inherit (pkgs) fetchurl; };
+  srcs = import ./srcs.nix { inherit (pkgs) fetchurl; inherit mirror; };
 
   qtSubmodule = args:
     let
@@ -97,8 +95,8 @@ let
       qttools = callPackage ./qttools.nix {};
       qttranslations = callPackage ./qttranslations.nix {};
       /* qtwayland = not packaged */
-      /* qtwebchannel = not packaged */
-      /* qtwebengine = not packaged */
+      qtwebchannel = callPackage ./qtwebchannel.nix {};
+      qtwebengine = callPackage ./qtwebengine.nix {};
       qtwebsockets = callPackage ./qtwebsockets.nix {};
       /* qtwinextras = not packaged */
       qtx11extras = callPackage ./qtx11extras.nix {};
diff --git a/pkgs/development/libraries/qt-5/5.6/fetchsrcs.sh b/pkgs/development/libraries/qt-5/5.6/fetchsrcs.sh
deleted file mode 100755
index cbedf29ed79..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/fetchsrcs.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#! /usr/bin/env nix-shell
-#! nix-shell -i bash -p coreutils findutils gnused nix wget
-
-set -x
-
-# The trailing slash at the end is necessary!
-RELEASE_URL="http://download.qt.io/official_releases/qt/5.6/5.6.1/submodules/"
-EXTRA_WGET_ARGS='-A *.tar.xz'
-
-mkdir tmp; cd tmp
-
-wget -nH -r -c --no-parent $RELEASE_URL $EXTRA_WGET_ARGS
-
-cat >../srcs.nix <<EOF
-# DO NOT EDIT! This file is generated automatically by fetchsrcs.sh
-{ fetchurl, mirror }:
-
-{
-EOF
-
-workdir=$(pwd)
-
-find . | while read src; do
-    if [[ -f "${src}" ]]; then
-        url="${src:2}"
-        # Sanitize file name
-        filename=$(basename "$src" | tr '@' '_')
-        nameversion="${filename%.tar.*}"
-        name=$(echo "$nameversion" | sed -e 's,-[[:digit:]].*,,' | sed -e 's,-opensource-src$,,')
-        version=$(echo "$nameversion" | sed -e 's,^\([[:alpha:]][[:alnum:]]*-\)\+,,')
-        sha256=$(nix-hash --type sha256 --base32 --flat "$src")
-        cat >>../srcs.nix <<EOF
-  $name = {
-    version = "$version";
-    src = fetchurl {
-      url = "\${mirror}/$url";
-      sha256 = "$sha256";
-      name = "$filename";
-    };
-  };
-EOF
-    fi
-done
-
-echo "}" >>../srcs.nix
-
-cd ..
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebchannel.nix b/pkgs/development/libraries/qt-5/5.6/qtwebchannel.nix
new file mode 100644
index 00000000000..fd7a3c52026
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.6/qtwebchannel.nix
@@ -0,0 +1,7 @@
+{ qtSubmodule, qtbase, qtdeclarative }:
+
+qtSubmodule {
+  name = "qtwebchannel";
+  qtInputs = [ qtbase qtdeclarative ];
+}
+
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebengine.nix b/pkgs/development/libraries/qt-5/5.6/qtwebengine.nix
new file mode 100644
index 00000000000..a433976dad1
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.6/qtwebengine.nix
@@ -0,0 +1,6 @@
+{ qtSubmodule, qtquickcontrols, qtlocation, qtwebchannel }:
+
+qtSubmodule {
+  name = "qtwebengine";
+  qtInputs = [ qtquickcontrols qtlocation qtwebchannel ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.6/srcs.nix b/pkgs/development/libraries/qt-5/5.6/srcs.nix
index 6f11e4408f7..42b688e6e8d 100644
--- a/pkgs/development/libraries/qt-5/5.6/srcs.nix
+++ b/pkgs/development/libraries/qt-5/5.6/srcs.nix
@@ -3,259 +3,259 @@
 
 {
   qtxmlpatterns = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtxmlpatterns-opensource-src-5.6.1.tar.xz";
-      sha256 = "0q412jv3xbg7v05b8pbahifwx17gzlp96s90akh6zwhpm8i6xx34";
-      name = "qtxmlpatterns-opensource-src-5.6.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";
     };
   };
   qtx11extras = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtx11extras-opensource-src-5.6.1.tar.xz";
-      sha256 = "0l736qiz8adrnh267xz63hv4sph6nhy90h836qfnnmv3p78ipsz8";
-      name = "qtx11extras-opensource-src-5.6.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";
     };
   };
   qtwinextras = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtwinextras-opensource-src-5.6.1.tar.xz";
-      sha256 = "1db3lcrj8af0z8lnh99lfbwz1cq9il7rr27rk9l38dff65qkssm8";
-      name = "qtwinextras-opensource-src-5.6.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";
     };
   };
   qtwebview = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtwebview-opensource-src-5.6.1.tar.xz";
-      sha256 = "0q869wl61vidds551w3z49ysx88xqyn6igbz07zxac7d0gwgwpda";
-      name = "qtwebview-opensource-src-5.6.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";
     };
   };
   qtwebsockets = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtwebsockets-opensource-src-5.6.1.tar.xz";
-      sha256 = "0fkj52i4yi6gmq4jfjgdij08cspxspac6mbpf0fknnllimmkl7jm";
-      name = "qtwebsockets-opensource-src-5.6.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";
     };
   };
   qtwebengine = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtwebengine-opensource-src-5.6.1.tar.xz";
-      sha256 = "0yv0cflgywsyfn84vv2vc9rwpm8j7hin61rxqjqh498nnl2arw5x";
-      name = "qtwebengine-opensource-src-5.6.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";
     };
   };
   qtwebchannel = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtwebchannel-opensource-src-5.6.1.tar.xz";
-      sha256 = "01q80917a1048hdhaii4v50dqs84h16lc9w3v99r9xvspk8vab7q";
-      name = "qtwebchannel-opensource-src-5.6.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";
     };
   };
   qtwayland = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtwayland-opensource-src-5.6.1.tar.xz";
-      sha256 = "1jgghjfrg0wwyfzfwgwhagwxz9k936ylv3w2l9bwlpql8rgm8d11";
-      name = "qtwayland-opensource-src-5.6.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";
     };
   };
   qttranslations = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qttranslations-opensource-src-5.6.1.tar.xz";
-      sha256 = "008wyk00mqz116pigm0qq78rvg28v6ykjnjxppkjnk0yd6i2vmb9";
-      name = "qttranslations-opensource-src-5.6.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";
     };
   };
   qttools = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qttools-opensource-src-5.6.1.tar.xz";
-      sha256 = "0wbzq60d7lkvlb7b5lqcw87qgy6kyjz1npjavz8f4grdxsaqi8vp";
-      name = "qttools-opensource-src-5.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";
     };
   };
   qtsvg = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtsvg-opensource-src-5.6.1.tar.xz";
-      sha256 = "08ca5g46g75acy27jfnvnalmcias5hxmjp7491v3y4k9y7a4ybpi";
-      name = "qtsvg-opensource-src-5.6.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";
     };
   };
   qtserialport = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtserialport-opensource-src-5.6.1.tar.xz";
-      sha256 = "1hp63cgqhps6y1k041lzhcb2b0rcpcmszabnn293q5ilbvla4x0b";
-      name = "qtserialport-opensource-src-5.6.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";
     };
   };
   qtserialbus = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtserialbus-opensource-src-5.6.1.tar.xz";
-      sha256 = "1h683dkvnf2rdgxgisybnp8miqgn2gpi597rgx5zc7qk2k8kyidz";
-      name = "qtserialbus-opensource-src-5.6.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";
     };
   };
   qtsensors = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtsensors-opensource-src-5.6.1.tar.xz";
-      sha256 = "0bll7ll6s5g8w89knyrc0famjwqyfzwpn512m1f96bf6xwacs967";
-      name = "qtsensors-opensource-src-5.6.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";
     };
   };
   qtscript = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtscript-opensource-src-5.6.1.tar.xz";
-      sha256 = "17zp5dlfplrnzlw233lzapj55drjqchvayajd02qsggzms3yzchw";
-      name = "qtscript-opensource-src-5.6.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";
     };
   };
   qtquickcontrols2 = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtquickcontrols2-opensource-src-5.6.1.tar.xz";
-      sha256 = "13zbiv63b76ifpjalx5616nixfwjk48q977bzb1xxj363b7xv85v";
-      name = "qtquickcontrols2-opensource-src-5.6.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtquickcontrols2-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "0wfa2xcqsvx3zihd5nb9f9qhq0xn14c03sw1qdymzfsryqwmk4ac";
+      name = "qtquickcontrols2-opensource-src-5.6.1-1.tar.xz";
     };
   };
   qtquickcontrols = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtquickcontrols-opensource-src-5.6.1.tar.xz";
-      sha256 = "14d68ryn7r7rs7klpldnavcsccvyyg0xhwqkvjlm5wwplv2acah1";
-      name = "qtquickcontrols-opensource-src-5.6.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.1-1/submodules/qtquickcontrols-opensource-src-5.6.1-1.tar.xz";
+      sha256 = "0cjzf844r7wi32ssc9vbw1a2m9hnr8c0i1p7yyljy962ifplf401";
+      name = "qtquickcontrols-opensource-src-5.6.1-1.tar.xz";
     };
   };
   qtmultimedia = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtmultimedia-opensource-src-5.6.1.tar.xz";
-      sha256 = "058523c2qra3d8fq46ygcndnkrbwlh316zy28s2cr5pjr5gmnjyj";
-      name = "qtmultimedia-opensource-src-5.6.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";
     };
   };
   qtmacextras = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtmacextras-opensource-src-5.6.1.tar.xz";
-      sha256 = "147yhv7fb0yaakrffqiw6xz8ycqdc7qsnxvnpr6j8rarw5xmdc73";
-      name = "qtmacextras-opensource-src-5.6.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";
     };
   };
   qtlocation = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtlocation-opensource-src-5.6.1.tar.xz";
-      sha256 = "0qahs7a2n3l4h0bl8bnwci9mzy1vra3zncnzr40csic9ys67ddfk";
-      name = "qtlocation-opensource-src-5.6.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";
     };
   };
   qtimageformats = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtimageformats-opensource-src-5.6.1.tar.xz";
-      sha256 = "020v1148433zx4g87z2r8fgff32n0laajxqqsja1l3yzz7jbrwvl";
-      name = "qtimageformats-opensource-src-5.6.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";
     };
   };
   qtgraphicaleffects = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtgraphicaleffects-opensource-src-5.6.1.tar.xz";
-      sha256 = "1n0i2drfr7fvydgg810dcij8mxnygdpvqcqv7l1a9a1kv9ap3sap";
-      name = "qtgraphicaleffects-opensource-src-5.6.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";
     };
   };
   qtenginio = {
     version = "1.6.1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtenginio-opensource-src-1.6.1.tar.xz";
-      sha256 = "1iq4lnz3s6mfdgml61b9lsjisky55bbvsdj72kh003j94mzrc3l5";
+      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";
     };
   };
   qtdoc = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtdoc-opensource-src-5.6.1.tar.xz";
-      sha256 = "0yg7903vk4w3h6jjyanssfcig0s2s660q11sj14nw6gcjs7kfa5z";
-      name = "qtdoc-opensource-src-5.6.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";
     };
   };
   qtdeclarative-render2d = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtdeclarative-render2d-opensource-src-5.6.1.tar.xz";
-      sha256 = "1m08x8x355545r9wgrjl5p26zjhp5q1yh3h25dww8pk25v6cn8dg";
-      name = "qtdeclarative-render2d-opensource-src-5.6.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";
     };
   };
   qtdeclarative = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtdeclarative-opensource-src-5.6.1.tar.xz";
-      sha256 = "1d2217kxk85kpi7ls08b41hqzy26hvch8m4cgzq6km5sqi5zvz0j";
-      name = "qtdeclarative-opensource-src-5.6.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";
     };
   };
   qtconnectivity = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtconnectivity-opensource-src-5.6.1.tar.xz";
-      sha256 = "06fr9321f52kf0nda9zjjfzp5694hbnx0y0v315iw28mnpvandas";
-      name = "qtconnectivity-opensource-src-5.6.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";
     };
   };
   qtcanvas3d = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtcanvas3d-opensource-src-5.6.1.tar.xz";
-      sha256 = "0q17hwmj893pk0lhxmibxmgk6h1gy4ksqfi62rkfzcf81bg2q7hr";
-      name = "qtcanvas3d-opensource-src-5.6.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";
     };
   };
   qtbase = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtbase-opensource-src-5.6.1.tar.xz";
-      sha256 = "0r3jrqymnnxrig4f11xvs33c26f0kzfakbp3kcbdpv795gpc276h";
-      name = "qtbase-opensource-src-5.6.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";
     };
   };
   qtandroidextras = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtandroidextras-opensource-src-5.6.1.tar.xz";
-      sha256 = "0prkpb57j0s8k36sba47k2bhs3ajf01rdwc7qf5gkvhs991rwckc";
-      name = "qtandroidextras-opensource-src-5.6.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";
     };
   };
   qtactiveqt = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qtactiveqt-opensource-src-5.6.1.tar.xz";
-      sha256 = "0a2p0w03d04hqg71hlihj9mr6aasvb0h8jfa5rnq8b5rkm8haf4f";
-      name = "qtactiveqt-opensource-src-5.6.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";
     };
   };
   qt3d = {
-    version = "5.6.1";
+    version = "5.6.1-1";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.1/submodules/qt3d-opensource-src-5.6.1.tar.xz";
-      sha256 = "03d81sls30a20yna6940np15112ciwy5024f8n5imaxicm8h34xd";
-      name = "qt3d-opensource-src-5.6.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";
     };
   };
 }
diff --git a/pkgs/development/libraries/resolv_wrapper/default.nix b/pkgs/development/libraries/resolv_wrapper/default.nix
index c39314843c0..90e1dfded6a 100644
--- a/pkgs/development/libraries/resolv_wrapper/default.nix
+++ b/pkgs/development/libraries/resolv_wrapper/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake pkgconfig ];
 
   meta = with stdenv.lib; {
-    description = "a wrapper for the user, group and hosts NSS API";
+    description = "A wrapper for the user, group and hosts NSS API";
     homepage = "https://git.samba.org/?p=uid_wrapper.git;a=summary";
     license = licenses.bsd3;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/science/biology/htslib/default.nix b/pkgs/development/libraries/science/biology/htslib/default.nix
new file mode 100644
index 00000000000..2609861e319
--- /dev/null
+++ b/pkgs/development/libraries/science/biology/htslib/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, zlib }:
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  pname = "htslib";
+  version = "1.3.1";
+
+  src = fetchurl {
+    url = "https://github.com/samtools/${pname}/releases/download/${version}/${name}.tar.bz2";
+    sha256 = "49d53a2395b8cef7d1d11270a09de888df8ba06f70fe68282e8235ee04124ae6";
+  };
+
+  buildInputs = [ zlib ];
+
+  meta = with stdenv.lib; {
+    description = "A C library for reading/writing high-throughput sequencing data";
+    license = licenses.mit;
+    homepage = http://www.htslib.org/;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.mimadrid ];
+  };
+}
+
diff --git a/pkgs/development/libraries/science/math/clblas/cuda/default.nix b/pkgs/development/libraries/science/math/clblas/cuda/default.nix
new file mode 100644
index 00000000000..8691009acae
--- /dev/null
+++ b/pkgs/development/libraries/science/math/clblas/cuda/default.nix
@@ -0,0 +1,68 @@
+{ stdenv
+, fetchFromGitHub
+, cmake
+, gfortran
+, blas
+, boost
+, python
+, cudatoolkit
+, nvidia_x11
+}:
+
+stdenv.mkDerivation rec {
+  name = "clblas-cuda-${version}"; 
+  version = "git-20160505"; 
+
+  src = fetchFromGitHub {
+    owner = "clMathLibraries"; 
+    repo = "clBLAS";
+    rev = "d20977ec4389c6b3751e318779410007c5e272f8";
+    sha256 = "1jna176cxznv7iz43svd6cjrbbf0fc2lrbpfpg4s08vc7xnwp0n4";
+  }; 
+
+  patches = [ ./platform.patch ]; 
+
+  postPatch = ''
+    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
+
+    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
+
+    mkdir -p Build
+    pushd Build
+
+    export LD_LIBRARY_PATH="${blas}/lib:${nvidia_x11}/lib"
+
+    cmake ../src -DCMAKE_INSTALL_PREFIX=$out \
+                 -DCMAKE_BUILD_TYPE=Release \
+                 -DOPENCL_ROOT=${cudatoolkit} \
+  '';
+
+  dontStrip = true; 
+
+  buildInputs = [
+    cmake
+    gfortran
+    blas
+    python
+    cudatoolkit
+    nvidia_x11
+  ]; 
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/clMathLibraries/clBLAS;
+    description = "A software library containing BLAS functions written in OpenCL";
+    longDescription = ''
+      This package contains a library of BLAS functions on top of OpenCL. 
+      The current version is linked to the NVIDIA OpenCL implementation provided by the CUDA toolkit. 
+    '';
+    license = licenses.asl20;
+    maintainers = with maintainers; [ artuuge ];
+    platforms = platforms.linux;
+  };
+
+}
diff --git a/pkgs/development/libraries/science/math/clblas/cuda/platform.patch b/pkgs/development/libraries/science/math/clblas/cuda/platform.patch
new file mode 100644
index 00000000000..87404a426a4
--- /dev/null
+++ b/pkgs/development/libraries/science/math/clblas/cuda/platform.patch
@@ -0,0 +1,34 @@
+diff --git a/src/library/tools/ktest/config.cpp b/src/library/tools/ktest/config.cpp
+index 8b20128..faf9bde 100644
+--- a/src/library/tools/ktest/config.cpp
++++ b/src/library/tools/ktest/config.cpp
+@@ -24,8 +24,6 @@
+ 
+ using namespace clMath;
+ 
+-static const char DEFAULT_PLATFORM_NAME[] = "AMD Accelerated Parallel Processing";
+-
+ Config::Config() :
+     defaultConfig_(""),
+     cpp_("ktest.cpp"),
+@@ -35,7 +33,10 @@ Config::Config() :
+     hasFuncID_(false), hasSubdims_(false),
+     skipAccuracy_(false)
+ {
+-    setPlatform(DEFAULT_PLATFORM_NAME);
++    platform_ = NULL;
++    setPlatform("");
++
++    device_ = NULL;
+     setDevice("");
+ 
+     memset(&kargs_, 0, sizeof(kargs_));
+@@ -262,7 +263,7 @@ Config::setPlatform(const std::string& name)
+             continue;
+         }
+         if (name.empty()) {
+-            found = (strcmp(pname, DEFAULT_PLATFORM_NAME) == 0);
++	    found = true;
+         }
+         else {
+             found = (strcmp(pname, name.c_str()) == 0);
diff --git a/pkgs/development/libraries/science/math/cudnn/7.5-5.0/default.nix b/pkgs/development/libraries/science/math/cudnn/7.5-5.0/default.nix
new file mode 100644
index 00000000000..920b77b223f
--- /dev/null
+++ b/pkgs/development/libraries/science/math/cudnn/7.5-5.0/default.nix
@@ -0,0 +1,46 @@
+{ stdenv
+, requireFile
+, cudatoolkit
+}:
+
+stdenv.mkDerivation rec {
+  version = "5.0";
+  cudatoolkit_version = "7.5";
+
+  name = "cudatoolkit-${cudatoolkit_version}-cudnn-${version}";
+
+  src = requireFile rec {
+    name = "cudnn-${cudatoolkit_version}-linux-x64-v${version}-ga.tgz";
+    message = ''
+      This nix expression requires that ${name} is already part of the store.
+      Register yourself to NVIDIA Accelerated Computing Developer Program, retrieve the cuDNN library
+      at https://developer.nvidia.com/cudnn, and run the following command in the download directory:
+      nix-prefetch-url file://${name}
+    '';
+    sha256 = "c4739a00608c3b66a004a74fc8e721848f9112c5cb15f730c1be4964b3a23b3a";
+  };
+
+  phases = "unpackPhase installPhase fixupPhase";
+
+  installPhase = ''
+    function fixRunPath {
+      p=$(patchelf --print-rpath $1)
+      patchelf --set-rpath "$p:${stdenv.lib.makeLibraryPath [ stdenv.cc.cc ]}" $1
+    }
+    fixRunPath lib64/libcudnn.so
+
+    mkdir -p $out
+    cp -a include $out/include
+    cp -a lib64 $out/lib64
+  '';
+
+  propagatedBuildInputs = [
+    cudatoolkit
+  ];
+
+  meta = {
+    description = "NVIDIA CUDA Deep Neural Network library (cuDNN)";
+    homepage = "https://developer.nvidia.com/cudnn";
+    license = stdenv.lib.licenses.unfree;
+  };
+}
diff --git a/pkgs/development/libraries/socket_wrapper/default.nix b/pkgs/development/libraries/socket_wrapper/default.nix
index 0c6f40c8b14..b93312b0e8c 100644
--- a/pkgs/development/libraries/socket_wrapper/default.nix
+++ b/pkgs/development/libraries/socket_wrapper/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake pkgconfig ];
 
   meta = with stdenv.lib; {
-    description = "a library passing all socket communications through unix sockets";
+    description = "A library passing all socket communications through unix sockets";
     homepage = "https://git.samba.org/?p=socket_wrapper.git;a=summary";
     license = licenses.bsd3;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/speex/default.nix b/pkgs/development/libraries/speex/default.nix
index 8e3cf899e40..ce313e35168 100644
--- a/pkgs/development/libraries/speex/default.nix
+++ b/pkgs/development/libraries/speex/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     hompage = http://www.speex.org/;
-    description = "an Open Source/Free Software patent-free audio compression format designed for speech";
+    description = "An Open Source/Free Software patent-free audio compression format designed for speech";
     license = licenses.bsd3;
     platforms = platforms.unix;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/speexdsp/default.nix b/pkgs/development/libraries/speexdsp/default.nix
index 56b1900837a..e31c793a7d7 100644
--- a/pkgs/development/libraries/speexdsp/default.nix
+++ b/pkgs/development/libraries/speexdsp/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     hompage = http://www.speex.org/;
-    description = "an Open Source/Free Software patent-free audio compression format designed for speech";
+    description = "An Open Source/Free Software patent-free audio compression format designed for speech";
     license = licenses.bsd3;
     platforms = platforms.unix;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/sqlite/default.nix b/pkgs/development/libraries/sqlite/default.nix
index f38e48c87c2..1e59745b34a 100644
--- a/pkgs/development/libraries/sqlite/default.nix
+++ b/pkgs/development/libraries/sqlite/default.nix
@@ -3,11 +3,11 @@
 assert interactive -> readline != null && ncurses != null;
 
 stdenv.mkDerivation {
-  name = "sqlite-3.12.2";
+  name = "sqlite-3.13.0";
 
   src = fetchurl {
-    url = "http://sqlite.org/2016/sqlite-autoconf-3120200.tar.gz";
-    sha1 = "b43c2e7238e54c50b95fbbd85c48792f4f39af8c";
+    url = "http://sqlite.org/2016/sqlite-autoconf-3130000.tar.gz";
+    sha256 = "0sq88jbwsk48i41f7m7rkw9xvijq011nsbs7pl49s31inck70yg2";
   };
 
   outputs = [ "dev" "out" "bin" ];
@@ -22,6 +22,7 @@ stdenv.mkDerivation {
     "-DSQLITE_ENABLE_JSON1"
     "-DSQLITE_ENABLE_FTS3"
     "-DSQLITE_ENABLE_FTS3_PARENTHESIS"
+    "-DSQLITE_ENABLE_FTS3_TOKENIZER"
     "-DSQLITE_ENABLE_FTS4"
     "-DSQLITE_ENABLE_RTREE"
     "-DSQLITE_ENABLE_STMT_SCANSTATUS"
diff --git a/pkgs/development/libraries/uid_wrapper/default.nix b/pkgs/development/libraries/uid_wrapper/default.nix
index 35d7f53173f..d53941b5e2f 100644
--- a/pkgs/development/libraries/uid_wrapper/default.nix
+++ b/pkgs/development/libraries/uid_wrapper/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake pkgconfig ];
 
   meta = with stdenv.lib; {
-    description = "a wrapper for the user, group and hosts NSS API";
+    description = "A wrapper for the user, group and hosts NSS API";
     homepage = "https://git.samba.org/?p=uid_wrapper.git;a=summary";
     license = licenses.bsd3;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/v8/fix-GetLocalizedMessage-usage.patch b/pkgs/development/libraries/v8/fix-GetLocalizedMessage-usage.patch
deleted file mode 100644
index 3bc0fff4d50..00000000000
--- a/pkgs/development/libraries/v8/fix-GetLocalizedMessage-usage.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From dbe142c4eda0f15fad9fa85743dd11b81292fa8f Mon Sep 17 00:00:00 2001
-From: Timothy J Fontaine <tjfontaine@gmail.com>
-Date: Thu, 23 May 2013 13:57:59 -0700
-Subject: [PATCH] v8: fix GetLocalizedMessage usage
-
-As is the backport of the abort on uncaught exception wouldn't compile
-because we it was passing in `this` when it was unnecessary.
----
- deps/v8/src/isolate.cc | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/isolate.cc b/src/isolate.cc
-index 04a438b..5a5293e 100644
---- a/src/isolate.cc
-+++ b/src/isolate.cc
-@@ -1161,7 +1161,7 @@ void Isolate::DoThrow(Object* exception, MessageLocation* location) {
-           (report_exception || can_be_caught_externally)) {
-         fatal_exception_depth++;
-         fprintf(stderr, "%s\n\nFROM\n",
--          *MessageHandler::GetLocalizedMessage(this, message_obj));
-+          *MessageHandler::GetLocalizedMessage(message_obj));
-         PrintCurrentStackTrace(stderr);
-         OS::Abort();
-       }
--- 
-1.8.1.6
-
diff --git a/pkgs/development/libraries/webrtc-audio-processing/default.nix b/pkgs/development/libraries/webrtc-audio-processing/default.nix
index 803c552b487..f5d49290484 100644
--- a/pkgs/development/libraries/webrtc-audio-processing/default.nix
+++ b/pkgs/development/libraries/webrtc-audio-processing/default.nix
@@ -1,16 +1,22 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "webrtc-audio-processing-0.1";
+  name = "webrtc-audio-processing-0.3";
 
   src = fetchurl {
     url = "http://freedesktop.org/software/pulseaudio/webrtc-audio-processing/${name}.tar.xz";
-    sha256 = "1p7yg8n39wwdfr52br2dq3bh8iypfx9md99mh1i9g2v8qbwm4jzd";
+    sha256 = "1yl0187xjh1j2zkb7v9cs9i868zcaj23pzn4a36qhzam9wfjjvkm";
   };
 
+  # Avoid this error:
+  # signal_processing/filter_ar_fast_q12_armv7.S:88: Error: selected processor does not support `sbfx r11,r6,#12,#16' in ARM mode
+  patchPhase = stdenv.lib.optionalString stdenv.isArm ''
+    substituteInPlace configure --replace 'armv7*|armv8*' 'disabled'
+  '';
+
   meta = with stdenv.lib; {
     homepage = http://www.freedesktop.org/software/pulseaudio/webrtc-audio-processing;
-    description = "a more Linux packaging friendly copy of the AudioProcessing module from the WebRTC project";
+    description = "A more Linux packaging friendly copy of the AudioProcessing module from the WebRTC project";
     license = licenses.bsd3;
     platforms = platforms.unix;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/wolfssl/default.nix b/pkgs/development/libraries/wolfssl/default.nix
index 3e534a8b955..b3145302d30 100644
--- a/pkgs/development/libraries/wolfssl/default.nix
+++ b/pkgs/development/libraries/wolfssl/default.nix
@@ -2,17 +2,27 @@
 
 stdenv.mkDerivation rec {
   name = "wolfssl-${version}";
-  version = "3.9.0";
+  version = "3.9.6";
 
   src = fetchFromGitHub {
     owner = "wolfSSL";
     repo = "wolfssl";
     rev = "v${version}";
-    sha256 = "0j4la9936jcy2fam1x5wplbslqa4zjnrk4wyipkbwz9m8cxg0n6v";
+    sha256 = "19k3pqd567jfxyps4i6mk7sblwzaj1rixmsdwscw63pdgcgf260g";
   };
 
+  outputs = [ "dev" "out" "doc" "lib" ];
+
   nativeBuildInputs = [ autoreconfHook ];
 
+  postInstall = ''
+     # fix recursive cycle:
+     # wolfssl-config points to dev, dev propagates bin
+     moveToOutput bin/wolfssl-config "$dev"
+     # moveToOutput also removes "$out" so recreate it
+     mkdir -p "$out"
+  '';
+
   meta = with stdenv.lib; {
     description = "A small, fast, portable implementation of TLS/SSL for embedded devices";
     homepage    = "https://www.wolfssl.com/";
diff --git a/pkgs/development/libraries/wxsqlite3/default.nix b/pkgs/development/libraries/wxsqlite3/default.nix
new file mode 100644
index 00000000000..88cf92b34ef
--- /dev/null
+++ b/pkgs/development/libraries/wxsqlite3/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchFromGitHub, wxGTK, sqlite }:
+
+stdenv.mkDerivation rec {
+  name = "wxsqlite3-${version}";
+  version = "3.3.1";
+
+  src = fetchFromGitHub {
+    owner = "utelle";
+    repo = "wxsqlite3";
+    rev = "v${version}";
+    sha1 = "bb8p58g88nkdcsj3h4acx7h925n2cy9g";
+  };
+
+  buildInputs = [ wxGTK sqlite ];
+
+  meta = with stdenv.lib; {
+    homepage = http://utelle.github.io/wxsqlite3/ ;
+    description = "A C++ wrapper around the public domain SQLite 3.x for wxWidgets";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ vrthra ];
+    license = [ licenses.lgpl2 ];
+  };
+}
diff --git a/pkgs/development/libraries/wxsqliteplus/default.nix b/pkgs/development/libraries/wxsqliteplus/default.nix
new file mode 100644
index 00000000000..998f6a9e5f6
--- /dev/null
+++ b/pkgs/development/libraries/wxsqliteplus/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, wxGTK, wxsqlite3, sqlite }:
+
+stdenv.mkDerivation rec {
+  name = "wxsqliteplus-${version}";
+  version = "0.3.6";
+
+  src = fetchFromGitHub {
+    owner = "guanlisheng";
+    repo = "wxsqliteplus";
+    rev = "v${version}";
+    sha1 = "yr9ysviv4hbrxn900z1wz8j32frimvx1";
+  };
+
+  buildInputs = [ wxGTK wxsqlite3 sqlite ];
+
+  makeFlags = [
+    "LDFLAGS=-L${wxsqlite3}/lib"
+  ];
+
+  preBuild = ''
+    sed -ie 's|all: $(LIBPREFIX)wxsqlite$(LIBEXT)|all: |g' Makefile
+    sed -ie 's|wxsqliteplus$(EXEEXT): $(WXSQLITEPLUS_OBJECTS) $(LIBPREFIX)wxsqlite$(LIBEXT)|wxsqliteplus$(EXEEXT):  $(WXSQLITEPLUS_OBJECTS) |g' Makefile
+    sed -ie 's|-lwxsqlite |-lwxcode_gtk2u_wxsqlite3-3.0 |g' Makefile
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp wxsqliteplus $out/bin/
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://guanlisheng.com/;
+    description = "A simple SQLite database browser built with wxWidgets";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ vrthra ];
+    license = licenses.gpl2;
+  };
+}
diff --git a/pkgs/development/libraries/x264/default.nix b/pkgs/development/libraries/x264/default.nix
index 754b76de061..6e4dc00b038 100644
--- a/pkgs/development/libraries/x264/default.nix
+++ b/pkgs/development/libraries/x264/default.nix
@@ -1,12 +1,12 @@
 {stdenv, fetchurl, yasm, enable10bit ? false}:
 
 stdenv.mkDerivation rec {
-  version = "20141218-2245";
+  version = "20160615-2245";
   name = "x264-${version}";
 
   src = fetchurl {
     url = "http://download.videolan.org/x264/snapshots/x264-snapshot-${version}-stable.tar.bz2";
-    sha256 = "1gp1f0382vh2hmgc23ldqyywcfljg8lsgl2849ymr14r6gxfh69m";
+    sha256 = "0w5l77gm8bsmafzimzyc5s27kcw79r6nai3bpccqy0spyxhjsdc2";
   };
 
   patchPhase = ''
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ yasm ];
 
   meta = with stdenv.lib; {
-    description = "library for encoding H264/AVC video streams";
+    description = "Library for encoding H264/AVC video streams";
     homepage    = http://www.videolan.org/developers/x264.html;
     license     = licenses.gpl2;
     platforms   = platforms.unix;
diff --git a/pkgs/development/libraries/x265/default.nix b/pkgs/development/libraries/x265/default.nix
index 736c350bc06..0a287363e67 100644
--- a/pkgs/development/libraries/x265/default.nix
+++ b/pkgs/development/libraries/x265/default.nix
@@ -26,6 +26,8 @@ stdenv.mkDerivation rec {
     sha256 = "1j0mbcf10aj6zi1nxql45f9817jd2ndcpd7x123sjmyr7q9m8iiy";
   };
 
+  enableParallelBuilding = true;
+
   patchPhase = ''
     sed -i 's/unknown/${version}/g' source/cmake/version.cmake
   '';
diff --git a/pkgs/development/libraries/xercesc/default.nix b/pkgs/development/libraries/xercesc/default.nix
index 5020ab3f2df..b6bb4e63df3 100644
--- a/pkgs/development/libraries/xercesc/default.nix
+++ b/pkgs/development/libraries/xercesc/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "xerces-c-${version}";
-  version = "3.1.3";
+  version = "3.1.4";
 
   src = fetchurl {
     url = "mirror://apache/xerces/c/3/sources/${name}.tar.gz";
-    sha256 = "0jav1cbwcyq4miy790dd62yrypf7n0j98vdin9ny30f9nwyzgm7k";
+    sha256 = "1xpccqzykpd3806kd788lgkl01pk7v5lklva6q4kp9zq9jnfv3n9";
   };
 
   meta = {
diff --git a/pkgs/development/libraries/xgboost/default.nix b/pkgs/development/libraries/xgboost/default.nix
index e3c5d757310..4ba366be56f 100644
--- a/pkgs/development/libraries/xgboost/default.nix
+++ b/pkgs/development/libraries/xgboost/default.nix
@@ -11,6 +11,8 @@ stdenv.mkDerivation rec {
     sha256 = "1d7lnbwxwakclqqfjwyk9w3wd2clkihdr6ljs5z08ydiaspri093";
   };
 
+  postPatch = "sed '1i#include <cmath>' -i src/tree/param.h";
+
   enableParallelBuilding = true;
 
   installPhase = ''
diff --git a/pkgs/development/libraries/zeromq/sodium_warning.patch b/pkgs/development/libraries/zeromq/sodium_warning.patch
deleted file mode 100644
index 4b84fd7edf4..00000000000
--- a/pkgs/development/libraries/zeromq/sodium_warning.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 479db2113643e459c11db392e0fefd6400657c9e Mon Sep 17 00:00:00 2001
-From: Constantin Rack <constantin@rack.li>
-Date: Sat, 8 Nov 2014 10:50:17 +0100
-Subject: [PATCH] Problem: return code of sodium_init() is not checked.
-
-There are two todo comments in curve_client.cpp and curve_server.cpp that suggest
-checking the return code of sodium_init() call. sodium_init() returns -1 on error,
-0 on success and 1 if it has been called before and is already initalized:
-https://github.com/jedisct1/libsodium/blob/master/src/libsodium/sodium/core.c
----
- src/curve_client.cpp | 7 ++++---
- src/curve_server.cpp | 7 ++++---
- 2 files changed, 8 insertions(+), 6 deletions(-)
-
-diff --git a/src/curve_client.cpp b/src/curve_client.cpp
-index 6019c54..77fc420 100644
---- a/src/curve_client.cpp
-+++ b/src/curve_client.cpp
-@@ -38,6 +38,7 @@ zmq::curve_client_t::curve_client_t (const options_t &options_) :
-     cn_peer_nonce(1),
-     sync()
- {
-+    int rc;
-     memcpy (public_key, options_.curve_public_key, crypto_box_PUBLICKEYBYTES);
-     memcpy (secret_key, options_.curve_secret_key, crypto_box_SECRETKEYBYTES);
-     memcpy (server_key, options_.curve_server_key, crypto_box_PUBLICKEYBYTES);
-@@ -47,12 +48,12 @@ zmq::curve_client_t::curve_client_t (const options_t &options_) :
-     unsigned char tmpbytes[4];
-     randombytes(tmpbytes, 4);
- #else
--    // todo check return code
--    sodium_init();
-+    rc = sodium_init ();
-+    zmq_assert (rc != -1);
- #endif
- 
-     //  Generate short-term key pair
--    const int rc = crypto_box_keypair (cn_public, cn_secret);
-+    rc = crypto_box_keypair (cn_public, cn_secret);
-     zmq_assert (rc == 0);
- }
- 
-diff --git a/src/curve_server.cpp b/src/curve_server.cpp
-index a3c4243..22c32d6 100644
---- a/src/curve_server.cpp
-+++ b/src/curve_server.cpp
-@@ -42,6 +42,7 @@ zmq::curve_server_t::curve_server_t (session_base_t *session_,
-     cn_peer_nonce(1),
-     sync()
- {
-+    int rc;
-     //  Fetch our secret key from socket options
-     memcpy (secret_key, options_.curve_secret_key, crypto_box_SECRETKEYBYTES);
-     scoped_lock_t lock (sync);
-@@ -50,12 +51,12 @@ zmq::curve_server_t::curve_server_t (session_base_t *session_,
-     unsigned char tmpbytes[4];
-     randombytes(tmpbytes, 4);
- #else
--    // todo check return code
--    sodium_init();
-+    rc = sodium_init ();
-+    zmq_assert (rc != -1);
- #endif
- 
-     //  Generate short-term key pair
--    const int rc = crypto_box_keypair (cn_public, cn_secret);
-+    rc = crypto_box_keypair (cn_public, cn_secret);
-     zmq_assert (rc == 0);
- }
-