summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2018-01-26 16:46:43 +0200
committerTuomas Tynkkynen <tuomas@tuxera.com>2018-01-26 16:46:43 +0200
commit6a11ebfae93708d8156b11847d3bae6315d5cd4a (patch)
tree0cead5fe37f5d0f9be2cf8c95710b72f9cfc7808 /pkgs/development/libraries
parent18300172897169e62d6140c34f5949a7a2232375 (diff)
parent4a2f7a73cc2bfde778194fafb8efb0c16de366bb (diff)
downloadnixpkgs-6a11ebfae93708d8156b11847d3bae6315d5cd4a.tar
nixpkgs-6a11ebfae93708d8156b11847d3bae6315d5cd4a.tar.gz
nixpkgs-6a11ebfae93708d8156b11847d3bae6315d5cd4a.tar.bz2
nixpkgs-6a11ebfae93708d8156b11847d3bae6315d5cd4a.tar.lz
nixpkgs-6a11ebfae93708d8156b11847d3bae6315d5cd4a.tar.xz
nixpkgs-6a11ebfae93708d8156b11847d3bae6315d5cd4a.tar.zst
nixpkgs-6a11ebfae93708d8156b11847d3bae6315d5cd4a.zip
Merge remote-tracking branch 'upstream/master' into gcc-7
Conflicts:
	pkgs/development/compilers/gcc/7/default.nix
	pkgs/development/libraries/SDL2/default.nix
	pkgs/top-level/all-packages.nix
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/SDL/setup-hook.sh6
-rw-r--r--pkgs/development/libraries/SDL2/default.nix4
-rw-r--r--pkgs/development/libraries/SDL2/setup-hook.sh6
-rw-r--r--pkgs/development/libraries/SDL2_gfx/default.nix7
-rw-r--r--pkgs/development/libraries/SDL2_image/default.nix9
-rw-r--r--pkgs/development/libraries/SDL2_mixer/default.nix5
-rw-r--r--pkgs/development/libraries/SDL2_net/default.nix6
-rw-r--r--pkgs/development/libraries/SDL2_ttf/default.nix7
-rw-r--r--pkgs/development/libraries/SDL_gfx/default.nix3
-rw-r--r--pkgs/development/libraries/SDL_image/default.nix2
-rw-r--r--pkgs/development/libraries/SDL_mixer/default.nix4
-rw-r--r--pkgs/development/libraries/SDL_net/default.nix2
-rw-r--r--pkgs/development/libraries/SDL_ttf/default.nix2
-rw-r--r--pkgs/development/libraries/Xaw3d/default.nix4
-rw-r--r--pkgs/development/libraries/accounts-qt/default.nix1
-rw-r--r--pkgs/development/libraries/agg/default.nix4
-rw-r--r--pkgs/development/libraries/alembic/default.nix5
-rw-r--r--pkgs/development/libraries/apr-util/default.nix4
-rw-r--r--pkgs/development/libraries/apr/default.nix4
-rw-r--r--pkgs/development/libraries/armadillo/default.nix4
-rw-r--r--pkgs/development/libraries/armadillo/use-unix-config-on-OS-X.patch9
-rw-r--r--pkgs/development/libraries/aspell/dictionaries.nix9
-rw-r--r--pkgs/development/libraries/assimp/default.nix4
-rw-r--r--pkgs/development/libraries/at-spi2-atk/default.nix8
-rw-r--r--pkgs/development/libraries/at-spi2-core/default.nix11
-rw-r--r--pkgs/development/libraries/atk/default.nix13
-rw-r--r--pkgs/development/libraries/aubio/default.nix16
-rw-r--r--pkgs/development/libraries/audio/lv2/unstable.nix6
-rw-r--r--pkgs/development/libraries/audio/raul/default.nix6
-rw-r--r--pkgs/development/libraries/audio/suil/default.nix4
-rw-r--r--pkgs/development/libraries/audiofile/default.nix53
-rw-r--r--pkgs/development/libraries/aws-sdk-cpp/default.nix11
-rw-r--r--pkgs/development/libraries/babl/default.nix9
-rw-r--r--pkgs/development/libraries/bobcat/default.nix1
-rw-r--r--pkgs/development/libraries/boehm-gc/default.nix18
-rw-r--r--pkgs/development/libraries/boost/1.59.nix58
-rw-r--r--pkgs/development/libraries/boost/1.66.nix12
-rw-r--r--pkgs/development/libraries/boost/generic.nix152
-rw-r--r--pkgs/development/libraries/bootil/default.nix2
-rw-r--r--pkgs/development/libraries/botan/2.0.upstream4
-rw-r--r--pkgs/development/libraries/breakpad/default.nix28
-rw-r--r--pkgs/development/libraries/bullet/bullet283.nix29
-rw-r--r--pkgs/development/libraries/bullet/default.nix26
-rw-r--r--pkgs/development/libraries/bullet/gwen-narrowing.patch22
-rw-r--r--pkgs/development/libraries/c-ares/default.nix29
-rw-r--r--pkgs/development/libraries/c-ares/release.patch19
-rw-r--r--pkgs/development/libraries/cairomm/default.nix8
-rw-r--r--pkgs/development/libraries/catch/default.nix6
-rw-r--r--pkgs/development/libraries/cdk/default.nix9
-rw-r--r--pkgs/development/libraries/cmocka/default.nix21
-rw-r--r--pkgs/development/libraries/cpp-netlib/default.nix1
-rw-r--r--pkgs/development/libraries/cppdb/default.nix6
-rw-r--r--pkgs/development/libraries/csfml/default.nix31
-rw-r--r--pkgs/development/libraries/curlcpp/default.nix2
-rw-r--r--pkgs/development/libraries/czmq/3.x.nix2
-rw-r--r--pkgs/development/libraries/czmq/4.x.nix9
-rw-r--r--pkgs/development/libraries/czmq/czmq3-gcc7.patch26
-rw-r--r--pkgs/development/libraries/dbus/make-dbus-conf.nix1
-rw-r--r--pkgs/development/libraries/dirac/default.nix2
-rw-r--r--pkgs/development/libraries/dleyna-connector-dbus/default.nix24
-rw-r--r--pkgs/development/libraries/dleyna-core/0001-Search-connectors-in-DLEYNA_CONNECTOR_PATH.patch95
-rw-r--r--pkgs/development/libraries/dleyna-core/default.nix28
-rw-r--r--pkgs/development/libraries/dleyna-core/setup-hook.sh8
-rw-r--r--pkgs/development/libraries/dleyna-renderer/default.nix29
-rw-r--r--pkgs/development/libraries/dleyna-server/default.nix29
-rw-r--r--pkgs/development/libraries/dlib/default.nix4
-rw-r--r--pkgs/development/libraries/dotconf/default.nix2
-rw-r--r--pkgs/development/libraries/eccodes/default.nix6
-rw-r--r--pkgs/development/libraries/exiv2/default.nix18
-rw-r--r--pkgs/development/libraries/expat/default.nix2
-rw-r--r--pkgs/development/libraries/faac/default.nix6
-rw-r--r--pkgs/development/libraries/faad2/default.nix4
-rw-r--r--pkgs/development/libraries/facile/default.nix29
-rw-r--r--pkgs/development/libraries/facile/ocaml_4.xx.patch12
-rw-r--r--pkgs/development/libraries/fastpbkdf2/default.nix31
-rw-r--r--pkgs/development/libraries/ffmpeg-full/default.nix11
-rw-r--r--pkgs/development/libraries/ffmpeg/3.4.nix6
-rw-r--r--pkgs/development/libraries/ffmpeg/generic.nix4
-rw-r--r--pkgs/development/libraries/fftw/default.nix4
-rw-r--r--pkgs/development/libraries/flite/default.nix16
-rw-r--r--pkgs/development/libraries/flite/fix-rpath.patch5
-rw-r--r--pkgs/development/libraries/folly/default.nix16
-rw-r--r--pkgs/development/libraries/fribidi/default.nix18
-rw-r--r--pkgs/development/libraries/ftgl/2.1.2.nix44
-rw-r--r--pkgs/development/libraries/ftgl/default.nix6
-rw-r--r--pkgs/development/libraries/ftgl/gcc.patch13
-rw-r--r--pkgs/development/libraries/gamin/debian-patches.nix2
-rw-r--r--pkgs/development/libraries/gamin/debian-patches.txt2
-rw-r--r--pkgs/development/libraries/gdal/default.nix6
-rw-r--r--pkgs/development/libraries/gdal/gdal-1_11.nix4
-rw-r--r--pkgs/development/libraries/gdbm/default.nix6
-rw-r--r--pkgs/development/libraries/gdk-pixbuf/setup-hook.sh2
-rw-r--r--pkgs/development/libraries/gegl/3.0.nix20
-rw-r--r--pkgs/development/libraries/gettext/default.nix2
-rw-r--r--pkgs/development/libraries/gettext/gettext-setup-hook.sh7
-rw-r--r--pkgs/development/libraries/gflags/default.nix10
-rw-r--r--pkgs/development/libraries/giflib/5.0.nix18
-rw-r--r--pkgs/development/libraries/glew/default.nix5
-rw-r--r--pkgs/development/libraries/glib-networking/default.nix4
-rw-r--r--pkgs/development/libraries/glib/default.nix7
-rw-r--r--pkgs/development/libraries/glib/schema-override-variable.patch12
-rw-r--r--pkgs/development/libraries/glib/setup-hook.sh7
-rw-r--r--pkgs/development/libraries/glibc/2.26-115to131.diff.gzbin0 -> 20022 bytes
-rw-r--r--pkgs/development/libraries/glibc/2.26-75to115.diff.gzbin0 -> 32865 bytes
-rw-r--r--pkgs/development/libraries/glibc/allow-kernel-2.6.32.patch39
-rw-r--r--pkgs/development/libraries/glibc/common.nix28
-rw-r--r--pkgs/development/libraries/glm/default.nix28
-rw-r--r--pkgs/development/libraries/glog/default.nix6
-rw-r--r--pkgs/development/libraries/glpk/default.nix4
-rw-r--r--pkgs/development/libraries/gmime/3.nix4
-rw-r--r--pkgs/development/libraries/gmp/6.x.nix7
-rw-r--r--pkgs/development/libraries/gmtk/default.nix32
-rw-r--r--pkgs/development/libraries/gmtk/fix-paths.patch20
-rw-r--r--pkgs/development/libraries/gnutls/3.5.10.nix2
-rw-r--r--pkgs/development/libraries/gnutls/3.6.nix (renamed from pkgs/development/libraries/gnutls/3.5.nix)7
-rw-r--r--pkgs/development/libraries/gobject-introspection/setup-hook.sh12
-rw-r--r--pkgs/development/libraries/goffice/default.nix4
-rw-r--r--pkgs/development/libraries/gpgme/default.nix12
-rw-r--r--pkgs/development/libraries/granite/default.nix4
-rw-r--r--pkgs/development/libraries/grantlee/5/setup-hook.sh14
-rw-r--r--pkgs/development/libraries/grib-api/default.nix4
-rw-r--r--pkgs/development/libraries/grpc/default.nix19
-rw-r--r--pkgs/development/libraries/gstreamer/bad/default.nix16
-rw-r--r--pkgs/development/libraries/gstreamer/base/default.nix4
-rw-r--r--pkgs/development/libraries/gstreamer/core/default.nix6
-rw-r--r--pkgs/development/libraries/gstreamer/core/setup-hook.sh2
-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/gstreamermm/default.nix13
-rw-r--r--pkgs/development/libraries/gstreamer/legacy/gst-plugins-bad/default.nix6
-rw-r--r--pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh2
-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/vaapi/default.nix4
-rw-r--r--pkgs/development/libraries/gstreamer/validate/default.nix4
-rw-r--r--pkgs/development/libraries/gtdialog/default.nix8
-rw-r--r--pkgs/development/libraries/gtk+/2.x.nix4
-rw-r--r--pkgs/development/libraries/gtk+/3.x.nix19
-rw-r--r--pkgs/development/libraries/gtkd/default.nix2
-rw-r--r--pkgs/development/libraries/gumbo/default.nix (renamed from pkgs/development/libraries/libgumbo/default.nix)2
-rw-r--r--pkgs/development/libraries/gupnp-av/default.nix4
-rw-r--r--pkgs/development/libraries/gupnp-dlna/default.nix22
-rw-r--r--pkgs/development/libraries/gupnp/default.nix6
-rw-r--r--pkgs/development/libraries/gvfs/default.nix4
-rw-r--r--pkgs/development/libraries/harfbuzz/default.nix4
-rw-r--r--pkgs/development/libraries/hwloc/default.nix22
-rw-r--r--pkgs/development/libraries/ignition-math/default.nix2
-rw-r--r--pkgs/development/libraries/ilmbase/default.nix4
-rw-r--r--pkgs/development/libraries/ip2location-c/default.nix1
-rw-r--r--pkgs/development/libraries/java/lombok/default.nix15
-rw-r--r--pkgs/development/libraries/java/saxon/default.nix93
-rw-r--r--pkgs/development/libraries/java/saxon/default8.nix26
-rwxr-xr-xpkgs/development/libraries/java/saxon/unzip-builder.sh6
-rw-r--r--pkgs/development/libraries/jbig2dec/default.nix12
-rw-r--r--pkgs/development/libraries/jemalloc/default.nix19
-rw-r--r--pkgs/development/libraries/json-glib/default.nix2
-rw-r--r--pkgs/development/libraries/kdb/default.nix4
-rw-r--r--pkgs/development/libraries/kde-frameworks/default.nix6
-rw-r--r--pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh2
-rw-r--r--pkgs/development/libraries/kde-frameworks/fetch.sh2
-rw-r--r--pkgs/development/libraries/kde-frameworks/kcmutils/kcmutils-follow-symlinks.patch14
-rw-r--r--pkgs/development/libraries/kde-frameworks/kconfigwidgets/0001-qdiriterator-follow-symlinks.patch21
-rw-r--r--pkgs/development/libraries/kde-frameworks/kdoctools/default.nix14
-rw-r--r--pkgs/development/libraries/kde-frameworks/kdoctools/setup-hook.sh2
-rw-r--r--pkgs/development/libraries/kde-frameworks/kimageformats.nix2
-rw-r--r--pkgs/development/libraries/kde-frameworks/kinit/default.nix8
-rw-r--r--pkgs/development/libraries/kde-frameworks/ktexteditor.nix5
-rw-r--r--pkgs/development/libraries/kde-frameworks/plasma-framework.nix4
-rw-r--r--pkgs/development/libraries/kde-frameworks/srcs.nix608
-rw-r--r--pkgs/development/libraries/kdiagram/default.nix2
-rw-r--r--pkgs/development/libraries/kerberos/krb5.nix40
-rw-r--r--pkgs/development/libraries/kmsxx/default.nix4
-rw-r--r--pkgs/development/libraries/ldb/default.nix4
-rw-r--r--pkgs/development/libraries/ldns/default.nix21
-rw-r--r--pkgs/development/libraries/leveldb/default.nix13
-rw-r--r--pkgs/development/libraries/libaal/default.nix4
-rw-r--r--pkgs/development/libraries/libaal/libaal-1.0.6-glibc-2.26.patch89
-rw-r--r--pkgs/development/libraries/libaccounts-glib/default.nix6
-rw-r--r--pkgs/development/libraries/libagar/default.nix5
-rw-r--r--pkgs/development/libraries/libamqpcpp/default.nix27
-rw-r--r--pkgs/development/libraries/libamqpcpp/libamqpcpp-darwin.patch13
-rw-r--r--pkgs/development/libraries/libao/default.nix37
-rw-r--r--pkgs/development/libraries/libappindicator/default.nix4
-rw-r--r--pkgs/development/libraries/libassuan/default.nix4
-rw-r--r--pkgs/development/libraries/libatomic_ops/default.nix4
-rw-r--r--pkgs/development/libraries/libatomic_ops/default.upstream1
-rw-r--r--pkgs/development/libraries/libav/default.nix2
-rw-r--r--pkgs/development/libraries/libbfd/default.nix47
-rw-r--r--pkgs/development/libraries/libbladeRF/default.nix6
-rw-r--r--pkgs/development/libraries/libbrotli/default.nix37
-rw-r--r--pkgs/development/libraries/libbsd/darwin.patch97
-rw-r--r--pkgs/development/libraries/libbsd/default.nix1
-rw-r--r--pkgs/development/libraries/libcerf/default.nix18
-rw-r--r--pkgs/development/libraries/libcli/default.nix1
-rw-r--r--pkgs/development/libraries/libcollectdclient/default.nix11
-rw-r--r--pkgs/development/libraries/libconfuse/default.nix1
-rw-r--r--pkgs/development/libraries/libcutl/default.nix10
-rw-r--r--pkgs/development/libraries/libdbi-drivers/default.nix18
-rw-r--r--pkgs/development/libraries/libdbusmenu/default.nix13
-rw-r--r--pkgs/development/libraries/libdrm/default.nix7
-rw-r--r--pkgs/development/libraries/libelf/default.nix24
-rw-r--r--pkgs/development/libraries/libexif/default.nix11
-rw-r--r--pkgs/development/libraries/libextractor/default.nix4
-rw-r--r--pkgs/development/libraries/libfaketime/default.nix12
-rw-r--r--pkgs/development/libraries/libfilezilla/default.nix4
-rw-r--r--pkgs/development/libraries/libftdi/1.x.nix4
-rw-r--r--pkgs/development/libraries/libgcrypt/default.nix4
-rw-r--r--pkgs/development/libraries/libgig/default.nix22
-rw-r--r--pkgs/development/libraries/libgphoto2/default.upstream9
-rw-r--r--pkgs/development/libraries/libgssglue/default.nix29
-rw-r--r--pkgs/development/libraries/libguestfs/default.nix11
-rw-r--r--pkgs/development/libraries/libhttpseverywhere/default.nix15
-rw-r--r--pkgs/development/libraries/libiberty/default.nix11
-rw-r--r--pkgs/development/libraries/libindicate/default.nix6
-rw-r--r--pkgs/development/libraries/libinput/default.nix6
-rw-r--r--pkgs/development/libraries/libjpeg-turbo/default.nix6
-rw-r--r--pkgs/development/libraries/libjson-rpc-cpp/default.nix4
-rw-r--r--pkgs/development/libraries/libkeyfinder/default.nix1
-rw-r--r--pkgs/development/libraries/liblcf/default.nix23
-rw-r--r--pkgs/development/libraries/liblouis/default.nix57
-rw-r--r--pkgs/development/libraries/liblscp/default.nix20
-rw-r--r--pkgs/development/libraries/libmicrohttpd/default.nix5
-rw-r--r--pkgs/development/libraries/libminc/default.nix16
-rw-r--r--pkgs/development/libraries/libmpack/default.nix19
-rw-r--r--pkgs/development/libraries/libmpc/default.nix4
-rw-r--r--pkgs/development/libraries/libmsgpack/1.4.nix12
-rw-r--r--pkgs/development/libraries/libmsgpack/2.0.nix12
-rw-r--r--pkgs/development/libraries/libmypaint/default.nix32
-rw-r--r--pkgs/development/libraries/libmysqlconnectorcpp/default.nix2
-rw-r--r--pkgs/development/libraries/libnetfilter_conntrack/default.nix1
-rw-r--r--pkgs/development/libraries/libnetfilter_log/default.nix2
-rw-r--r--pkgs/development/libraries/libnetfilter_queue/default.nix7
-rw-r--r--pkgs/development/libraries/libnftnl/default.nix7
-rw-r--r--pkgs/development/libraries/libopcodes/default.nix44
-rw-r--r--pkgs/development/libraries/libosinfo/default.nix40
-rw-r--r--pkgs/development/libraries/libosinfo/osinfo-db-data-dir.patch11
-rw-r--r--pkgs/development/libraries/libp11/default.nix4
-rw-r--r--pkgs/development/libraries/libpcap/default.nix9
-rw-r--r--pkgs/development/libraries/libpng/default.nix2
-rw-r--r--pkgs/development/libraries/libpsl/default.nix1
-rw-r--r--pkgs/development/libraries/libqmatrixclient/default.nix40
-rw-r--r--pkgs/development/libraries/librdf/redland.nix2
-rw-r--r--pkgs/development/libraries/libre/default.nix13
-rw-r--r--pkgs/development/libraries/librem/default.nix4
-rw-r--r--pkgs/development/libraries/librep/setup-hook.sh2
-rw-r--r--pkgs/development/libraries/libressl/default.nix4
-rw-r--r--pkgs/development/libraries/libsecret/default.nix4
-rw-r--r--pkgs/development/libraries/libserialport/default.nix4
-rw-r--r--pkgs/development/libraries/libsexy/default.nix2
-rw-r--r--pkgs/development/libraries/libsigcxx/default.nix5
-rw-r--r--pkgs/development/libraries/libsigsegv/2.5.nix23
-rw-r--r--pkgs/development/libraries/libsigsegv/default.nix6
-rw-r--r--pkgs/development/libraries/libskk/default.nix49
-rw-r--r--pkgs/development/libraries/libsnark/darwin-fix-clock-gettime.patch41
-rw-r--r--pkgs/development/libraries/libsnark/default.nix32
-rw-r--r--pkgs/development/libraries/libsndfile/default.nix29
-rw-r--r--pkgs/development/libraries/libsoundio/default.nix10
-rw-r--r--pkgs/development/libraries/libsoup/default.nix19
-rw-r--r--pkgs/development/libraries/libsrs2/default.nix4
-rw-r--r--pkgs/development/libraries/libstatgrab/default.nix2
-rw-r--r--pkgs/development/libraries/libstdc++5/default.nix6
-rw-r--r--pkgs/development/libraries/libstroke/default.nix6
-rw-r--r--pkgs/development/libraries/libsvm/default.nix4
-rw-r--r--pkgs/development/libraries/libtasn1/default.nix3
-rw-r--r--pkgs/development/libraries/libtiff/default.nix2
-rw-r--r--pkgs/development/libraries/libtiger/default.nix8
-rw-r--r--pkgs/development/libraries/libtomcrypt/default.nix29
-rw-r--r--pkgs/development/libraries/libtommath/default.nix32
-rw-r--r--pkgs/development/libraries/libtorrent-rasterbar/1.0.nix13
-rw-r--r--pkgs/development/libraries/libtorrent-rasterbar/default.nix4
-rw-r--r--pkgs/development/libraries/libtorrent-rasterbar/generic.nix2
-rw-r--r--pkgs/development/libraries/libtoxcore/default.nix7
-rw-r--r--pkgs/development/libraries/libtoxcore/old-api.nix59
-rw-r--r--pkgs/development/libraries/libu2f-host/default.nix6
-rw-r--r--pkgs/development/libraries/libunistring/clang.patch14
-rw-r--r--pkgs/development/libraries/libunistring/default.nix15
-rw-r--r--pkgs/development/libraries/libunity/default.nix27
-rw-r--r--pkgs/development/libraries/libusb1/default.nix4
-rw-r--r--pkgs/development/libraries/libuv/default.nix4
-rw-r--r--pkgs/development/libraries/libva-utils/default.nix29
-rw-r--r--pkgs/development/libraries/libva/default.nix37
-rw-r--r--pkgs/development/libraries/libvdpau/default.nix4
-rw-r--r--pkgs/development/libraries/libvirt-glib/default.nix4
-rw-r--r--pkgs/development/libraries/libvirt/default.nix18
-rw-r--r--pkgs/development/libraries/libvncserver/default.nix22
-rw-r--r--pkgs/development/libraries/libvorbis/default.nix21
-rw-r--r--pkgs/development/libraries/libvpx/default.nix2
-rw-r--r--pkgs/development/libraries/libwnck/3.x.nix13
-rw-r--r--pkgs/development/libraries/libx86emu/default.nix24
-rw-r--r--pkgs/development/libraries/libxc/default.nix32
-rw-r--r--pkgs/development/libraries/libxcomp/default.nix1
-rw-r--r--pkgs/development/libraries/libxl/default.nix26
-rw-r--r--pkgs/development/libraries/libxml2/default.nix4
-rw-r--r--pkgs/development/libraries/libxmlxx/default.nix2
-rw-r--r--pkgs/development/libraries/libxmlxx/v3.nix2
-rw-r--r--pkgs/development/libraries/libxslt/default.nix6
-rw-r--r--pkgs/development/libraries/libzip/default.nix4
-rw-r--r--pkgs/development/libraries/lightning/default.nix5
-rw-r--r--pkgs/development/libraries/lightstep-tracer-cpp/default.nix2
-rw-r--r--pkgs/development/libraries/lzo/default.nix3
-rw-r--r--pkgs/development/libraries/mesa/default.nix11
-rw-r--r--pkgs/development/libraries/microsoft_gsl/default.nix22
-rw-r--r--pkgs/development/libraries/mlt/qt-5.nix2
-rw-r--r--pkgs/development/libraries/mongoc/default.nix6
-rw-r--r--pkgs/development/libraries/mp4v2/default.nix8
-rw-r--r--pkgs/development/libraries/mpfr/default.nix2
-rw-r--r--pkgs/development/libraries/mps/default.nix4
-rw-r--r--pkgs/development/libraries/ncurses/default.nix16
-rw-r--r--pkgs/development/libraries/ndpi/default.nix2
-rw-r--r--pkgs/development/libraries/netcdf-cxx4/default.nix2
-rw-r--r--pkgs/development/libraries/nettle/default.nix4
-rw-r--r--pkgs/development/libraries/newt/default.nix2
-rw-r--r--pkgs/development/libraries/nspr/default.nix4
-rw-r--r--pkgs/development/libraries/nss/ckpem.patch11
-rw-r--r--pkgs/development/libraries/nss/default.nix25
-rw-r--r--pkgs/development/libraries/ogre/1.9.x.nix46
-rw-r--r--pkgs/development/libraries/ogre/default.nix8
-rw-r--r--pkgs/development/libraries/ogrepaged/default.nix19
-rw-r--r--pkgs/development/libraries/opencascade/default.nix6
-rw-r--r--pkgs/development/libraries/opencv/3.x.nix99
-rw-r--r--pkgs/development/libraries/opencv/default.nix2
-rw-r--r--pkgs/development/libraries/opendbx/default.nix6
-rw-r--r--pkgs/development/libraries/openexr/default.nix10
-rw-r--r--pkgs/development/libraries/openjpeg/2.1.nix37
-rw-r--r--pkgs/development/libraries/openjpeg/CVE-2016-9580-and-CVE-2016-9581.patch242
-rw-r--r--pkgs/development/libraries/openldap/default.nix2
-rw-r--r--pkgs/development/libraries/openmpi/default.nix2
-rw-r--r--pkgs/development/libraries/opensaml-cpp/default.nix6
-rw-r--r--pkgs/development/libraries/openslp/CVE-2016-4912.patch11
-rw-r--r--pkgs/development/libraries/openslp/default.nix1
-rw-r--r--pkgs/development/libraries/openssl/default.nix12
-rw-r--r--pkgs/development/libraries/openwsman/default.nix37
-rw-r--r--pkgs/development/libraries/oracle-instantclient/default.nix36
-rw-r--r--pkgs/development/libraries/pango/default.nix4
-rw-r--r--pkgs/development/libraries/pcre/default.nix3
-rw-r--r--pkgs/development/libraries/pcre/stacksize-detection.patch16
-rw-r--r--pkgs/development/libraries/pcre2/default.nix11
-rw-r--r--pkgs/development/libraries/physfs/default.nix50
-rw-r--r--pkgs/development/libraries/physics/fastjet/default.nix13
-rw-r--r--pkgs/development/libraries/physics/lhapdf/default.nix4
-rw-r--r--pkgs/development/libraries/physics/rivet/default.nix19
-rw-r--r--pkgs/development/libraries/physics/yoda/default.nix7
-rw-r--r--pkgs/development/libraries/pkcs11helper/default.nix8
-rw-r--r--pkgs/development/libraries/png++/default.nix14
-rw-r--r--pkgs/development/libraries/poco/default.nix5
-rw-r--r--pkgs/development/libraries/protobuf/2.5.nix10
-rw-r--r--pkgs/development/libraries/psol/default.nix4
-rw-r--r--pkgs/development/libraries/psol/generic.nix2
-rw-r--r--pkgs/development/libraries/ptlib/default.nix2
-rw-r--r--pkgs/development/libraries/ptlib/ptlib-2.10.11-glibc-2.26.patch13
-rw-r--r--pkgs/development/libraries/qca-qt5/default.nix6
-rw-r--r--pkgs/development/libraries/qca2/default.nix6
-rw-r--r--pkgs/development/libraries/qmltermwidget/default.nix9
-rw-r--r--pkgs/development/libraries/qpdf/default.nix10
-rw-r--r--pkgs/development/libraries/qt-3/default.nix2
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/default.nix83
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/parallel-configure.patch22
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/qmake-hook.sh5
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/qt-4.8.7-unixmake-darwin.patch11
-rw-r--r--pkgs/development/libraries/qt-5/5.10/default.nix124
-rw-r--r--pkgs/development/libraries/qt-5/5.10/fetch.sh2
-rw-r--r--pkgs/development/libraries/qt-5/5.10/qtbase-darwin.patch57
-rw-r--r--pkgs/development/libraries/qt-5/5.10/qtbase.patch1119
-rw-r--r--pkgs/development/libraries/qt-5/5.10/qtdeclarative.patch33
-rw-r--r--pkgs/development/libraries/qt-5/5.10/qtscript.patch (renamed from pkgs/development/libraries/qt-5/5.6/qtscript/0001-glib-2.32.patch)12
-rw-r--r--pkgs/development/libraries/qt-5/5.10/qtserialport.patch (renamed from pkgs/development/libraries/qt-5/5.6/qtserialport/qtserialport-dlopen-udev.patch)10
-rw-r--r--pkgs/development/libraries/qt-5/5.10/qttools.patch71
-rw-r--r--pkgs/development/libraries/qt-5/5.10/qtwebengine-paxmark-mksnapshot.patch48
-rw-r--r--pkgs/development/libraries/qt-5/5.10/qtwebkit.patch77
-rw-r--r--pkgs/development/libraries/qt-5/5.10/srcs.nix341
-rw-r--r--pkgs/development/libraries/qt-5/5.6/default.nix5
-rw-r--r--pkgs/development/libraries/qt-5/5.6/fetch.sh4
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase.patch48
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/cmake-paths-darwin.patch384
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/cmake-paths.patch385
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/compose-search-path.patch16
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/decrypt-ssl-traffic.patch13
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/default.nix325
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-dbus.patch13
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-gl.patch17
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-libXcursor.patch17
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-openssl.patch26
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-resolv.patch26
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/library-paths.patch20
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/libressl.patch33
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/mkspecs-libgl.patch15
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/qpa-platform-plugin-path.patch43
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/series9
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/tzdir.patch40
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/xdg-config-dirs.patch42
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtconnectivity.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtdeclarative/default.nix12
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtdeclarative/import-paths.patch20
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtdeclarative/series1
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtdoc.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtenginio.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtgraphicaleffects.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtimageformats.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtlocation.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtmultimedia.nix13
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtquickcontrols.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtquickcontrols2.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtscript/default.nix7
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtsensors.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtserialport/0001-dlopen-serialport-udev.patch28
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtserialport/default.nix12
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtserialport/series1
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtsvg.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qttools/cmake-paths.patch72
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qttools/default.nix12
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qttools/series1
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qttranslations.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwayland.nix8
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebchannel.nix7
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebengine-seccomp.patch24
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebengine.patch874
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebengine/default.nix90
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebkit.patch72
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebkit/0001-dlopen-webkit-nsplugin.patch53
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebkit/0002-dlopen-webkit-gtk.patch25
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebkit/0003-dlopen-webkit-udev.patch31
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebkit/default.nix40
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebkit/qtwebkit-dlopen-gtk.patch64
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebkit/qtwebkit-dlopen-udev.patch0
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebkit/qtwebkit-icu-59.patch86
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebkit/qtwebkit-icucore-darwin.patch13
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebkit/series4
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebsockets.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtx11extras.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtxmlpatterns.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.6/srcs.nix304
-rw-r--r--pkgs/development/libraries/qt-5/5.9/default.nix9
-rw-r--r--pkgs/development/libraries/qt-5/5.9/fetch.sh2
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qtbase.patch129
-rw-r--r--pkgs/development/libraries/qt-5/5.9/srcs.nix312
-rw-r--r--pkgs/development/libraries/qt-5/hooks/fix-qt-module-paths.sh11
-rw-r--r--pkgs/development/libraries/qt-5/hooks/fix-qt-static-libs.sh32
-rw-r--r--pkgs/development/libraries/qt-5/hooks/qmake-hook.sh5
-rw-r--r--pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh27
-rw-r--r--pkgs/development/libraries/qt-5/mkDerivation.nix17
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtbase.nix311
-rw-r--r--pkgs/development/libraries/qt-5/modules/qttools.nix4
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtvirtualkeyboard.nix6
-rw-r--r--pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix38
-rw-r--r--pkgs/development/libraries/qtstyleplugin-kvantum/default.nix31
-rw-r--r--pkgs/development/libraries/qwt/6_qt4.nix20
-rw-r--r--pkgs/development/libraries/rabbitmq-c/default.nix4
-rw-r--r--pkgs/development/libraries/readline/6.3.nix6
-rw-r--r--pkgs/development/libraries/rep-gtk/setup-hook.sh2
-rw-r--r--pkgs/development/libraries/rote/default.nix1
-rw-r--r--pkgs/development/libraries/safefile/default.nix4
-rw-r--r--pkgs/development/libraries/sblim-sfcc/default.nix34
-rw-r--r--pkgs/development/libraries/science/math/arpack/default.nix8
-rw-r--r--pkgs/development/libraries/science/math/atlas/default.nix4
-rw-r--r--pkgs/development/libraries/science/math/cudnn/default.nix8
-rw-r--r--pkgs/development/libraries/science/math/fenics/default.nix2
-rw-r--r--pkgs/development/libraries/science/math/nccl/default.nix41
-rw-r--r--pkgs/development/libraries/science/math/openblas/default.nix16
-rw-r--r--pkgs/development/libraries/serd/default.nix15
-rw-r--r--pkgs/development/libraries/serf/default.nix2
-rw-r--r--pkgs/development/libraries/shibboleth-sp/default.nix6
-rw-r--r--pkgs/development/libraries/skalibs/default.nix4
-rw-r--r--pkgs/development/libraries/slib/setup-hook.sh2
-rw-r--r--pkgs/development/libraries/smpeg2/default.nix7
-rw-r--r--pkgs/development/libraries/snappy/default.nix27
-rw-r--r--pkgs/development/libraries/snappy/disable-benchmark.patch5
-rw-r--r--pkgs/development/libraries/sord/default.nix4
-rw-r--r--pkgs/development/libraries/speechd/default.nix72
-rw-r--r--pkgs/development/libraries/speex/default.nix2
-rw-r--r--pkgs/development/libraries/swc/default.nix34
-rw-r--r--pkgs/development/libraries/taglib/1.9.nix3
-rw-r--r--pkgs/development/libraries/taglib/default.nix38
-rw-r--r--pkgs/development/libraries/telepathy/qt/default.nix58
-rw-r--r--pkgs/development/libraries/theft/default.nix2
-rw-r--r--pkgs/development/libraries/tntdb/default.nix2
-rw-r--r--pkgs/development/libraries/tremor/default.nix2
-rw-r--r--pkgs/development/libraries/udunits/default.nix2
-rw-r--r--pkgs/development/libraries/unicorn-emu/default.nix26
-rw-r--r--pkgs/development/libraries/unixODBCDrivers/default.nix12
-rw-r--r--pkgs/development/libraries/usbredir/default.nix2
-rw-r--r--pkgs/development/libraries/v8/default.nix14
-rw-r--r--pkgs/development/libraries/vaapi-intel/default.nix22
-rw-r--r--pkgs/development/libraries/vaapi-vdpau/default.nix2
-rw-r--r--pkgs/development/libraries/vapoursynth/default.nix4
-rw-r--r--pkgs/development/libraries/vigra/default.nix2
-rw-r--r--pkgs/development/libraries/vmime/default.nix2
-rw-r--r--pkgs/development/libraries/vmmlib/default.nix2
-rw-r--r--pkgs/development/libraries/vulkan-loader/default.nix11
-rw-r--r--pkgs/development/libraries/wayland/default.nix8
-rw-r--r--pkgs/development/libraries/wayland/protocols.nix4
-rw-r--r--pkgs/development/libraries/webkitgtk/2.18.nix17
-rw-r--r--pkgs/development/libraries/websocket++/default.nix2
-rw-r--r--pkgs/development/libraries/wiredtiger/default.nix1
-rw-r--r--pkgs/development/libraries/wld/default.nix30
-rw-r--r--pkgs/development/libraries/wlroots/default.nix26
-rw-r--r--pkgs/development/libraries/wt/default.nix78
-rw-r--r--pkgs/development/libraries/wxsqlite3/default.nix2
-rw-r--r--pkgs/development/libraries/wxwidgets/3.1/default.nix16
-rw-r--r--pkgs/development/libraries/x265/default.nix4
-rw-r--r--pkgs/development/libraries/xapian/default.nix4
-rw-r--r--pkgs/development/libraries/xapian/tools/omega/default.nix2
-rw-r--r--pkgs/development/libraries/xcb-util-cursor/HEAD.nix4
-rw-r--r--pkgs/development/libraries/xml-tooling-c/default.nix6
-rw-r--r--pkgs/development/libraries/yajl/default.nix4
-rw-r--r--pkgs/development/libraries/zeitgeist/default.nix2
-rw-r--r--pkgs/development/libraries/zeromq/4.x.nix4
-rw-r--r--pkgs/development/libraries/zimg/default.nix4
-rw-r--r--pkgs/development/libraries/zlib/default.nix2
-rw-r--r--pkgs/development/libraries/zxcvbn-c/default.nix24
509 files changed, 6488 insertions, 6106 deletions
diff --git a/pkgs/development/libraries/SDL/setup-hook.sh b/pkgs/development/libraries/SDL/setup-hook.sh
index 3696e743a07..20382f18f52 100644
--- a/pkgs/development/libraries/SDL/setup-hook.sh
+++ b/pkgs/development/libraries/SDL/setup-hook.sh
@@ -4,8 +4,4 @@ addSDLPath () {
   fi
 }
 
-if test -n "$crossConfig"; then
-  crossEnvHooks+=(addSDLPath)
-else
-  envHooks+=(addSDLPath)
-fi
+addEnvHooks "$hostOffset" addSDLPath
diff --git a/pkgs/development/libraries/SDL2/default.nix b/pkgs/development/libraries/SDL2/default.nix
index 0846e199c07..d75aea726e1 100644
--- a/pkgs/development/libraries/SDL2/default.nix
+++ b/pkgs/development/libraries/SDL2/default.nix
@@ -54,9 +54,9 @@ stdenv.mkDerivation rec {
   # https://bugzilla.libsdl.org/show_bug.cgi?id=1431
   dontDisableStatic = true;
 
-  # SDL_waylandevents.c:41:10: fatal error:
+  # /build/SDL2-2.0.7/src/video/wayland/SDL_waylandevents.c:41:10: fatal error:
   #   pointer-constraints-unstable-v1-client-protocol.h: No such file or directory
-  #enableParallelBuilding = true;
+  enableParallelBuilding = false;
 
   # XXX: By default, SDL wants to dlopen() PulseAudio, in which case
   # we must arrange to add it to its RPATH; however, `patchelf' seems
diff --git a/pkgs/development/libraries/SDL2/setup-hook.sh b/pkgs/development/libraries/SDL2/setup-hook.sh
index 5a26440f37b..3acce9d473c 100644
--- a/pkgs/development/libraries/SDL2/setup-hook.sh
+++ b/pkgs/development/libraries/SDL2/setup-hook.sh
@@ -4,8 +4,4 @@ addSDL2Path () {
   fi
 }
 
-if test -n "$crossConfig"; then
-  crossEnvHooks+=(addSDL2Path)
-else
-  envHooks+=(addSDL2Path)
-fi
+addEnvHooks "$hostOffset" addSDL2Path
diff --git a/pkgs/development/libraries/SDL2_gfx/default.nix b/pkgs/development/libraries/SDL2_gfx/default.nix
index a7ef0290734..a630e9cead8 100644
--- a/pkgs/development/libraries/SDL2_gfx/default.nix
+++ b/pkgs/development/libraries/SDL2_gfx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, SDL2 }:
+{ stdenv, darwin, fetchurl, SDL2 }:
 
 stdenv.mkDerivation rec {
   name = "SDL2_gfx-${version}";
@@ -9,7 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "16jrijzdp095qf416zvj9gs2fqqn6zkyvlxs5xqybd0ip37cp6yn";
   };
 
-  buildInputs = [ SDL2 ];
+  buildInputs = [ SDL2 ]
+    ++ stdenv.lib.optional stdenv.isDarwin darwin.libobjc;
 
   configureFlags = if stdenv.isi686 || stdenv.isx86_64 then "--enable-mmx" else "--disable-mmx";
 
@@ -38,6 +39,6 @@ stdenv.mkDerivation rec {
     license = licenses.zlib;
 
     maintainers = with maintainers; [ bjg ];
-    platforms = platforms.linux;
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/SDL2_image/default.nix b/pkgs/development/libraries/SDL2_image/default.nix
index 548f8e686ba..91b4a563da0 100644
--- a/pkgs/development/libraries/SDL2_image/default.nix
+++ b/pkgs/development/libraries/SDL2_image/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, SDL2, libpng, libjpeg, libtiff, libungif, libXpm, zlib }:
+{ stdenv, fetchurl, SDL2, libpng, libjpeg, libtiff, libungif, libXpm, zlib, Foundation }:
 
 stdenv.mkDerivation rec {
   name = "SDL2_image-${version}";
@@ -9,12 +9,15 @@ stdenv.mkDerivation rec {
     sha256 = "1s3ciydixrgv34vlf45ak5syq5nlfaqf19wf162lbz4ixxd0gpvj";
   };
 
-  buildInputs = [ SDL2 libpng libjpeg libtiff libungif libXpm zlib ];
+  buildInputs = [ SDL2 libpng libjpeg libtiff libungif libXpm zlib ]
+    ++ stdenv.lib.optional stdenv.isDarwin Foundation;
+
+  enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
     description = "SDL image library";
     homepage = http://www.libsdl.org/projects/SDL_image/;
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     license = licenses.zlib;
   };
 }
diff --git a/pkgs/development/libraries/SDL2_mixer/default.nix b/pkgs/development/libraries/SDL2_mixer/default.nix
index 6eada0c83e5..00251adb915 100644
--- a/pkgs/development/libraries/SDL2_mixer/default.nix
+++ b/pkgs/development/libraries/SDL2_mixer/default.nix
@@ -1,5 +1,6 @@
 { stdenv, lib, fetchurl, autoreconfHook, pkgconfig, which
 , SDL2, libogg, libvorbis, smpeg2, flac, libmodplug
+, CoreServices, AudioUnit, AudioToolbox
 , enableNativeMidi ? false, fluidsynth ? null }:
 
 stdenv.mkDerivation rec {
@@ -17,6 +18,8 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook pkgconfig which ];
 
+  buildInputs = stdenv.lib.optionals stdenv.isDarwin [ CoreServices AudioUnit AudioToolbox ];
+
   propagatedBuildInputs = [ SDL2 libogg libvorbis fluidsynth smpeg2 flac libmodplug ];
 
   configureFlags = [ "--disable-music-ogg-shared" ]
@@ -24,7 +27,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "SDL multi-channel audio mixer library";
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     homepage = https://www.libsdl.org/projects/SDL_mixer/;
     maintainers = with maintainers; [ MP2E ];
     license = licenses.zlib;
diff --git a/pkgs/development/libraries/SDL2_net/default.nix b/pkgs/development/libraries/SDL2_net/default.nix
index cf81fc0cac8..780444d51f4 100644
--- a/pkgs/development/libraries/SDL2_net/default.nix
+++ b/pkgs/development/libraries/SDL2_net/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, SDL2 }:
+{ stdenv, darwin, fetchurl, SDL2 }:
 
 stdenv.mkDerivation rec {
   name = "SDL2_net-${version}";
@@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "08cxc1bicmyk89kiks7izw1rlx5ng5n6xpy8fy0zxni3b9z8mkhm";
   };
 
+  buildInputs = stdenv.lib.optional stdenv.isDarwin darwin.libobjc;
+
   propagatedBuildInputs = [ SDL2 ];
 
   meta = with stdenv.lib; {
@@ -16,6 +18,6 @@ stdenv.mkDerivation rec {
     homepage = https://www.libsdl.org/projects/SDL_net;
     license = licenses.zlib;
     maintainers = with maintainers; [ MP2E ];
-    platforms = platforms.linux;
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/SDL2_ttf/default.nix b/pkgs/development/libraries/SDL2_ttf/default.nix
index 010ca46695a..87436119ef4 100644
--- a/pkgs/development/libraries/SDL2_ttf/default.nix
+++ b/pkgs/development/libraries/SDL2_ttf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, SDL2, freetype, mesa_noglu }:
+{ stdenv, darwin, fetchurl, SDL2, freetype, mesa_noglu }:
 
 stdenv.mkDerivation rec {
   name = "SDL2_ttf-${version}";
@@ -9,11 +9,12 @@ stdenv.mkDerivation rec {
     sha256 = "0xljwcpvd2knrjdfag5b257xqayplz55mqlszrqp0kpnphh5xnrl";
   };
 
-  buildInputs = [ SDL2 freetype mesa_noglu ];
+  buildInputs = [ SDL2 freetype mesa_noglu ]
+    ++ stdenv.lib.optional stdenv.isDarwin darwin.libobjc;
 
   meta = with stdenv.lib; {
     description = "SDL TrueType library";
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     license = licenses.zlib;
     homepage = https://www.libsdl.org/projects/SDL_ttf/;
   };
diff --git a/pkgs/development/libraries/SDL_gfx/default.nix b/pkgs/development/libraries/SDL_gfx/default.nix
index 0f66f0afb17..1d7d96f7536 100644
--- a/pkgs/development/libraries/SDL_gfx/default.nix
+++ b/pkgs/development/libraries/SDL_gfx/default.nix
@@ -11,7 +11,8 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ SDL ] ;
 
-  configureFlags = [ "--disable-mmx" ];
+  configureFlags = [ "--disable-mmx" ]
+    ++ stdenv.lib.optional stdenv.isDarwin "--disable-sdltest";
 
   meta = with stdenv.lib; {
     description = "SDL graphics drawing primitives and support functions";
diff --git a/pkgs/development/libraries/SDL_image/default.nix b/pkgs/development/libraries/SDL_image/default.nix
index 55a4058fe56..c8cab33ed57 100644
--- a/pkgs/development/libraries/SDL_image/default.nix
+++ b/pkgs/development/libraries/SDL_image/default.nix
@@ -17,6 +17,8 @@ stdenv.mkDerivation rec {
     })
   ];
 
+  configureFlags = stdenv.lib.optional stdenv.isDarwin "--disable-sdltest";
+
   buildInputs = [ SDL libpng libjpeg libtiff libungif libXpm ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/SDL_mixer/default.nix b/pkgs/development/libraries/SDL_mixer/default.nix
index fe64569abbe..d328d80d389 100644
--- a/pkgs/development/libraries/SDL_mixer/default.nix
+++ b/pkgs/development/libraries/SDL_mixer/default.nix
@@ -12,7 +12,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ SDL libogg libvorbis fluidsynth smpeg ];
 
-  configureFlags = [ "--disable-music-ogg-shared" ] ++ lib.optional enableNativeMidi " --enable-music-native-midi-gpl";
+  configureFlags = [ "--disable-music-ogg-shared" ]
+    ++ lib.optional enableNativeMidi " --enable-music-native-midi-gpl"
+    ++ lib.optionals stdenv.isDarwin [ "--disable-sdltest" "--disable-smpegtest" ];
 
   meta = with stdenv.lib; {
     description = "SDL multi-channel audio mixer library";
diff --git a/pkgs/development/libraries/SDL_net/default.nix b/pkgs/development/libraries/SDL_net/default.nix
index a159a0691f4..f1c5a5462d1 100644
--- a/pkgs/development/libraries/SDL_net/default.nix
+++ b/pkgs/development/libraries/SDL_net/default.nix
@@ -11,6 +11,8 @@ stdenv.mkDerivation rec {
     sha256 = "1d5c9xqlf4s1c01gzv6cxmg0r621pq9kfgxcg3197xw4p25pljjz";
   };
 
+  configureFlags = stdenv.lib.optional stdenv.isDarwin "--disable-sdltest";
+
   propagatedBuildInputs = [ SDL ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/SDL_ttf/default.nix b/pkgs/development/libraries/SDL_ttf/default.nix
index 1f290bf7044..f98e4a3b0ad 100644
--- a/pkgs/development/libraries/SDL_ttf/default.nix
+++ b/pkgs/development/libraries/SDL_ttf/default.nix
@@ -21,6 +21,8 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ SDL freetype ];
 
+  configureFlags = stdenv.lib.optional stdenv.isDarwin "--disable-sdltest";
+
   meta = with stdenv.lib; {
     description = "SDL TrueType library";
     license = licenses.zlib;
diff --git a/pkgs/development/libraries/Xaw3d/default.nix b/pkgs/development/libraries/Xaw3d/default.nix
index 8cadc7290aa..07d256f4f57 100644
--- a/pkgs/development/libraries/Xaw3d/default.nix
+++ b/pkgs/development/libraries/Xaw3d/default.nix
@@ -4,9 +4,9 @@ stdenv.mkDerivation {
   name = "Xaw3d-1.6.2";
   src = fetchurl {
     urls = [ 
-      ftp://ftp.x.org/pub/xorg/individual/lib/libXaw3d-1.6.tar.bz2
+      ftp://ftp.x.org/pub/xorg/individual/lib/libXaw3d-1.6.2.tar.bz2
       ];
-    sha256 = "099kx6ni5vkgr3kf40glif8m6r1m1hq6hxqlqrblaj1w5cphh8hi";
+    sha256 = "0awplv1nf53ywv01yxphga3v6dcniwqnxgnb0cn4khb121l12kxp";
   };
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [imake gccmakedep libXpm libXp bison flex];
diff --git a/pkgs/development/libraries/accounts-qt/default.nix b/pkgs/development/libraries/accounts-qt/default.nix
index e45a9f2f387..e7a90e40548 100644
--- a/pkgs/development/libraries/accounts-qt/default.nix
+++ b/pkgs/development/libraries/accounts-qt/default.nix
@@ -25,7 +25,6 @@ stdenv.mkDerivation rec {
     description = "Qt library for accessing the online accounts database";
     homepage = https://gitlab.com/accounts-sso;
     license = licenses.lgpl21;
-    maintainers = with maintainers; [ nckx ];
     platforms = with platforms; linux;
   };
 }
diff --git a/pkgs/development/libraries/agg/default.nix b/pkgs/development/libraries/agg/default.nix
index 2edf4e23226..c7f5ac86660 100644
--- a/pkgs/development/libraries/agg/default.nix
+++ b/pkgs/development/libraries/agg/default.nix
@@ -18,6 +18,10 @@ stdenv.mkDerivation rec {
 
   configureFlags = "--x-includes=${libX11.dev}/include --x-libraries=${libX11.out}/lib";
 
+  # libtool --tag=CXX --mode=link g++ -g -O2 libexamples.la ../src/platform/X11/libaggplatformX11.la ../src/libagg.la -o alpha_mask2 alpha_mask2.o
+  # libtool: error: cannot find the library 'libexamples.la'
+  enableParallelBuilding = false;
+
   meta = {
     description = "High quality rendering engine for C++";
 
diff --git a/pkgs/development/libraries/alembic/default.nix b/pkgs/development/libraries/alembic/default.nix
index bd540cdd500..a185f19a9a1 100644
--- a/pkgs/development/libraries/alembic/default.nix
+++ b/pkgs/development/libraries/alembic/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, unzip, cmake, openexr, hdf5 }:
+{ stdenv, fetchFromGitHub, unzip, cmake, openexr, hdf5-threadsafe }:
 
 stdenv.mkDerivation rec
 {
@@ -14,7 +14,8 @@ stdenv.mkDerivation rec
 
   outputs = [ "bin" "dev" "out" "lib" ];
 
-  buildInputs = [ unzip cmake openexr hdf5 ];
+  nativeBuildInputs = [ unzip cmake ];
+  buildInputs = [ openexr hdf5-threadsafe ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/apr-util/default.nix b/pkgs/development/libraries/apr-util/default.nix
index 3251693f574..7e7864cef52 100644
--- a/pkgs/development/libraries/apr-util/default.nix
+++ b/pkgs/development/libraries/apr-util/default.nix
@@ -13,11 +13,11 @@ assert ldapSupport -> openldap != null;
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
-  name = "apr-util-1.6.0";
+  name = "apr-util-1.6.1";
 
   src = fetchurl {
     url = "mirror://apache/apr/${name}.tar.bz2";
-    sha256 = "0k6a90d67xl36brz69s7adgkswjmw7isnjblm1naqmjblwzwjx44";
+    sha256 = "0nq3s1yn13vplgl6qfm09f7n0wm08malff9s59bqf9nid9xjzqfk";
   };
 
   patches = optional stdenv.isFreeBSD ./include-static-dependencies.patch;
diff --git a/pkgs/development/libraries/apr/default.nix b/pkgs/development/libraries/apr/default.nix
index 9abf48289ae..ecdeb35f6ed 100644
--- a/pkgs/development/libraries/apr/default.nix
+++ b/pkgs/development/libraries/apr/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "apr-1.6.2";
+  name = "apr-1.6.3";
 
   src = fetchurl {
     url = "mirror://apache/apr/${name}.tar.bz2";
-    sha256 = "1gffipa87pflvgvw01dbkvgh75p8n2sr56m1pcl01avv6zm9q409";
+    sha256 = "0wiik6amxn6lkc55fv9yz5i3kbxnqbp36alrzabx1avsdp8hc7qk";
   };
 
   patches = stdenv.lib.optionals stdenv.isDarwin [ ./is-this-a-compiler-bug.patch ];
diff --git a/pkgs/development/libraries/armadillo/default.nix b/pkgs/development/libraries/armadillo/default.nix
index 7a3e0b2083c..0d42ff9c680 100644
--- a/pkgs/development/libraries/armadillo/default.nix
+++ b/pkgs/development/libraries/armadillo/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, cmake, openblasCompat, superlu, hdf5 }:
 
 stdenv.mkDerivation rec {
-  version = "7.800.1";
+  version = "8.300.0";
   name = "armadillo-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/arma/armadillo-${version}.tar.xz";
-    sha256 = "1nxq2jp4jlvinynv0l04rpdzpnkzdsng0d5vi3hilc0hlsjnbnjs";
+    sha256 = "0g6wcfrmb2hndz995wrlc80v6d39mhxf26lmycaqv5bjfq050ic5";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/armadillo/use-unix-config-on-OS-X.patch b/pkgs/development/libraries/armadillo/use-unix-config-on-OS-X.patch
index b6fdddcaf2d..a1442d14119 100644
--- a/pkgs/development/libraries/armadillo/use-unix-config-on-OS-X.patch
+++ b/pkgs/development/libraries/armadillo/use-unix-config-on-OS-X.patch
@@ -1,10 +1,9 @@
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -84,7 +84,7 @@ message(STATUS "DETECT_HDF5                = ${DETECT_HDF5}"               )
- ##
- ## Find LAPACK and BLAS libraries, or their optimised versions
- ##
--
+@@ -152,6 +152,7 @@ message(STATUS "DETECT_HDF5                = ${DETECT_HDF5}"               )
+
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake_aux/Modules/")
+
 +set(APPLE false)
  if(APPLE)
    
diff --git a/pkgs/development/libraries/aspell/dictionaries.nix b/pkgs/development/libraries/aspell/dictionaries.nix
index fc6b47e8a63..8d97d6db2f1 100644
--- a/pkgs/development/libraries/aspell/dictionaries.nix
+++ b/pkgs/development/libraries/aspell/dictionaries.nix
@@ -212,6 +212,15 @@ in {
     };
   };
 
+  tr = buildDict {
+    shortName = "tr-0.50-0";
+    fullName = "Turkish";
+    src = fetchurl {
+      url = mirror://gnu/aspell/dict/tr/aspell-tr-0.50-0.tar.bz2;
+      sha256 = "0jpvpm96ga7s7rmsm6rbyrrr22b2dicxv2hy7ysv5y7bbq757ihb";
+    };
+  };
+
   uk = buildDict {
     shortName = "uk-1.4.0-0";
     fullName = "Ukrainian";
diff --git a/pkgs/development/libraries/assimp/default.nix b/pkgs/development/libraries/assimp/default.nix
index e342d8ab6c0..219c8df803b 100644
--- a/pkgs/development/libraries/assimp/default.nix
+++ b/pkgs/development/libraries/assimp/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "assimp-${version}";
-  version = "3.3.1";
+  version = "4.1.0";
 
   src = fetchFromGitHub{
     owner = "assimp";
     repo = "assimp";
     rev = "v${version}";
-    sha256 = "13y44fymj13h6alig0nqab91j2qch0yh9gq8yql2zz744ch2s5vc";
+    sha256 = "00g61g3ixmfszzjncpvm8x7gp2livaj4lmhbycjmrw4x3gfqlc4r";
   };
 
   buildInputs = [ cmake boost zlib ];
diff --git a/pkgs/development/libraries/at-spi2-atk/default.nix b/pkgs/development/libraries/at-spi2-atk/default.nix
index e2350cf2cd1..52c3a5f8c07 100644
--- a/pkgs/development/libraries/at-spi2-atk/default.nix
+++ b/pkgs/development/libraries/at-spi2-atk/default.nix
@@ -3,18 +3,18 @@
 
 stdenv.mkDerivation rec {
   versionMajor = "2.26";
-  versionMinor = "0";
+  versionMinor = "1";
   moduleName   = "at-spi2-atk";
   name = "${moduleName}-${versionMajor}.${versionMinor}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${moduleName}/${versionMajor}/${name}.tar.xz";
-    sha256 = "d25e528e1406a10c7d9b675aa15e638bcbf0a122ca3681f655a30cce83272fb9";
+    sha256 = "0x9vc99ni46fg5dzlx67vbw0zqffr24gz8jvbdxbmzyvc5xw5w5l";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig intltool ];
   buildInputs = [ python popt atk libX11 libICE xorg.libXtst libXi
-                  intltool dbus_glib at_spi2_core libSM ];
+                  dbus_glib at_spi2_core libSM ];
 
   meta = with stdenv.lib; {
     platforms = platforms.unix;
diff --git a/pkgs/development/libraries/at-spi2-core/default.nix b/pkgs/development/libraries/at-spi2-core/default.nix
index 95de186a29a..1743faafa68 100644
--- a/pkgs/development/libraries/at-spi2-core/default.nix
+++ b/pkgs/development/libraries/at-spi2-core/default.nix
@@ -1,24 +1,23 @@
-{ stdenv, fetchurl, python, pkgconfig, popt, intltool, dbus_glib
+{ stdenv, fetchurl, python, pkgconfig, popt, gettext, dbus_glib
 , libX11, xextproto, libSM, libICE, libXtst, libXi, gobjectIntrospection }:
 
 stdenv.mkDerivation rec {
   versionMajor = "2.26";
-  versionMinor = "0";
+  versionMinor = "2";
   moduleName   = "at-spi2-core";
   name = "${moduleName}-${versionMajor}.${versionMinor}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${moduleName}/${versionMajor}/${name}.tar.xz";
-    sha256 = "511568a65fda11fdd5ba5d4adfd48d5d76810d0e6ba4f7460f1b2ec0dbbbc337";
+    sha256 = "0596ghkamkxgv08r4a1pdhm06qd5zzgcfqsv64038w9xbvghq3n8";
   };
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig gettext gobjectIntrospection ];
   buildInputs = [
-    python popt  intltool dbus_glib
+    python popt dbus_glib
     libX11 xextproto libSM libICE libXtst libXi
-    gobjectIntrospection
   ];
 
   # ToDo: on non-NixOS we create a symlink from there?
diff --git a/pkgs/development/libraries/atk/default.nix b/pkgs/development/libraries/atk/default.nix
index 1574d8d037c..f7d3887cc18 100644
--- a/pkgs/development/libraries/atk/default.nix
+++ b/pkgs/development/libraries/atk/default.nix
@@ -2,14 +2,14 @@
 
 let
   ver_maj = "2.26";
-  ver_min = "0";
+  ver_min = "1";
 in
 stdenv.mkDerivation rec {
   name = "atk-${ver_maj}.${ver_min}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/atk/${ver_maj}/${name}.tar.xz";
-    sha256 = "eafe49d5c4546cb723ec98053290d7e0b8d85b3fdb123938213acb7bb4178827";
+    sha256 = "1jwpx8az0iifw176dc2hl4mmg6gvxzxdkd1qvg4ds7c5hdmzy07g";
   };
 
   enableParallelBuilding = true;
@@ -18,11 +18,14 @@ stdenv.mkDerivation rec {
 
   buildInputs = libintlOrEmpty;
 
-  nativeBuildInputs = [ pkgconfig perl ];
+  nativeBuildInputs = [ pkgconfig perl gobjectIntrospection ];
 
-  propagatedBuildInputs = [ glib gobjectIntrospection /*ToDo: why propagate*/ ];
+  propagatedBuildInputs = [
+    # Required by atk.pc
+    glib
+  ];
 
-  #doCheck = true; # no checks in there (2.22.0)
+  doCheck = true;
 
   meta = {
     description = "Accessibility toolkit";
diff --git a/pkgs/development/libraries/aubio/default.nix b/pkgs/development/libraries/aubio/default.nix
index e13b102c788..51ae14be404 100644
--- a/pkgs/development/libraries/aubio/default.nix
+++ b/pkgs/development/libraries/aubio/default.nix
@@ -1,23 +1,23 @@
 { stdenv, fetchurl, alsaLib, fftw, libjack2, libsamplerate
-, libsndfile, pkgconfig, python3
+, libsndfile, pkgconfig, python
 }:
 
 stdenv.mkDerivation rec {
-  name = "aubio-0.4.5";
+  name = "aubio-0.4.6";
 
   src = fetchurl {
     url = "http://aubio.org/pub/${name}.tar.bz2";
-    sha256 = "1xkshac4wdm7r5sc04c38d6lmvv5sk4qrb5r1yy0xgsgdx781hkh";
+    sha256 = "1yvwskahx1bf3x2fvi6cwah1ay11iarh79fjlqz8s887y3hkpixx";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ alsaLib fftw libjack2 libsamplerate libsndfile python3 ];
+  nativeBuildInputs = [ pkgconfig python ];
+  buildInputs = [ alsaLib fftw libjack2 libsamplerate libsndfile ];
 
-  configurePhase = "${python3.interpreter} waf configure --prefix=$out";
+  configurePhase = "python waf configure --prefix=$out";
 
-  buildPhase = "${python3.interpreter} waf";
+  buildPhase = "python waf";
 
-  installPhase = "${python3.interpreter} waf install";
+  installPhase = "python waf install";
 
   meta = with stdenv.lib; {
     description = "Library for audio labelling";
diff --git a/pkgs/development/libraries/audio/lv2/unstable.nix b/pkgs/development/libraries/audio/lv2/unstable.nix
index 595dd9e0a53..4a632d07006 100644
--- a/pkgs/development/libraries/audio/lv2/unstable.nix
+++ b/pkgs/development/libraries/audio/lv2/unstable.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   name = "lv2-unstable-${version}";
-  version = "2016-10-23";
+  version = "2017-07-08";
 
   src = fetchgit {
     url = "http://lv2plug.in/git/cgit.cgi/lv2.git";
-    rev = "b36868f3b96a436961c0c51b5b2dd71d05da9b12";
-    sha256 = "1sx39j0gary2nayzv7xgqcra7z1rcw9hrafkji05aksdwf7q0pdm";
+    rev = "39c7c726cd52b2863fcea356cafe1bcab2ba7f37";
+    sha256 = "1gp2rd99dfmpibvpixrqn115mrhybzf3if3h8bssf6siyi13f29r";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/audio/raul/default.nix b/pkgs/development/libraries/audio/raul/default.nix
index b0b0c6bc59a..63e3ae36028 100644
--- a/pkgs/development/libraries/audio/raul/default.nix
+++ b/pkgs/development/libraries/audio/raul/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   name = "raul-unstable-${rev}";
-  rev = "2016-09-20";
+  rev = "2017-07-23";
 
   src = fetchgit {
     url = "http://git.drobilla.net/cgit.cgi/raul.git";
-    rev = "f8bf77d3c3b77830aedafb9ebb5cdadfea7ed07a";
-    sha256 = "1lby508fb0n8ks6iz959sh18fc37br39d6pbapwvbcw5nckdrxwj";
+    rev = "4db870b2b20b0a608ec0283139056b836c5b1624";
+    sha256 = "04fajrass3ymr72flx5js5vxc601ccrmx8ny8scp0rw7j0igyjdr";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/audio/suil/default.nix b/pkgs/development/libraries/audio/suil/default.nix
index b2cfb0be8be..63f43ac7a2c 100644
--- a/pkgs/development/libraries/audio/suil/default.nix
+++ b/pkgs/development/libraries/audio/suil/default.nix
@@ -8,12 +8,12 @@ assert !(withQt4 && withQt5);
 
 stdenv.mkDerivation rec {
   pname = "suil";
-  version = "0.8.4";
+  version = "0.10.0";
   name = "${pname}-qt${if withQt4 then "4" else "5"}-${version}";
 
   src = fetchurl {
     url = "http://download.drobilla.net/${pname}-${version}.tar.bz2";
-    sha256 = "1kji3lhha26qr6xm9j8ic5c40zbrrb5qnwm2qxzmsfxgmrz29wkf";
+    sha256 = "0j489gm3fhnmwmbgw30bvd4byw1vsy4yazdlnji8jzhcz0qwb5cq";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/audiofile/default.nix b/pkgs/development/libraries/audiofile/default.nix
index a7576e07f2d..80aae344dcd 100644
--- a/pkgs/development/libraries/audiofile/default.nix
+++ b/pkgs/development/libraries/audiofile/default.nix
@@ -1,4 +1,14 @@
-{ stdenv, fetchurl, alsaLib, AudioUnit, CoreServices }:
+{ stdenv, fetchurl, fetchpatch, alsaLib, AudioUnit, CoreServices }:
+
+let
+
+  fetchDebianPatch = { name, debname, sha256 }:
+    fetchpatch {
+      inherit sha256 name;
+      url = "https://anonscm.debian.org/cgit/pkg-multimedia/audiofile.git/plain/debian/patches/${debname}?h=debian/0.3.6-4";
+    };
+
+in
 
 stdenv.mkDerivation rec {
   name = "audiofile-0.3.6";
@@ -15,7 +25,46 @@ stdenv.mkDerivation rec {
     sha256 = "0rb927zknk9kmhprd8rdr4azql4gn2dp75a36iazx2xhkbqhvind";
   };
 
-  patches = [ ./CVE-2015-7747.patch ./gcc-6.patch ];
+  patches = [
+    ./gcc-6.patch
+    ./CVE-2015-7747.patch
+
+    (fetchDebianPatch {
+      name = "CVE-2017-6829.patch";
+      debname = "04_clamp-index-values-to-fix-index-overflow-in-IMA.cpp.patch";
+      sha256 = "04qxl51i64c53v69q2kx61qdq474f4vapk8rq97cipj7yrar392m";
+    })
+    (fetchDebianPatch {
+      name = "CVE-2017-6827+CVE-2017-6828+CVE-2017-6832+CVE-2017-6835+CVE-2017-6837.patch";
+      debname = "05_Always-check-the-number-of-coefficients.patch";
+      sha256 = "1ih03kfkabffi6ymp6832q470i28rsds78941vzqlshnqjb2nnxw";
+    })
+    (fetchDebianPatch {
+      name = "CVE-2017-6839.patch";
+      debname = "06_Check-for-multiplication-overflow-in-MSADPCM-decodeSam.patch";
+      sha256 = "0a8s2z8rljlj03p7l1is9s4fml8vyzvyvfrh1m6xj5a8vbi635d0";
+    })
+    (fetchDebianPatch {
+      name = "CVE-2017-6830+CVE-2017-6834+CVE-2017-6836+CVE-2017-6838.patch";
+      debname = "07_Check-for-multiplication-overflow-in-sfconvert.patch";
+      sha256 = "0rfba8rkasl5ycvc0kqlzinkl3rvyrrjvjhpc45h423wmjk2za2l";
+    })
+    (fetchDebianPatch {
+      name = "audiofile-fix-multiplyCheckOverflow-signature.patch";
+      debname = "08_Fix-signature-of-multiplyCheckOverflow.-It-returns-a-b.patch";
+      sha256 = "032p5jqp7q7jgc5axdnazz00zm7hd26z6m5j55ifs0sykr5lwldb";
+    })
+    (fetchDebianPatch {
+      name = "CVE-2017-6831.patch";
+      debname = "09_Actually-fail-when-error-occurs-in-parseFormat.patch";
+      sha256 = "0csikmj8cbiy6cigg0rmh67jrr0sgm56dfrnrxnac3m9635nxlac";
+    })
+    (fetchDebianPatch {
+      name = "CVE-2017-6833.patch";
+      debname = "10_Check-for-division-by-zero-in-BlockCodec-runPull.patch";
+      sha256 = "1rlislkjawq98bbcf1dgl741zd508wwsg85r37ca7pfdf6wgl6z7";
+    })
+  ];
 
   meta = with stdenv.lib; {
     description = "Library for reading and writing audio files in various formats";
diff --git a/pkgs/development/libraries/aws-sdk-cpp/default.nix b/pkgs/development/libraries/aws-sdk-cpp/default.nix
index fe06bcfab6d..47d9e7dba4c 100644
--- a/pkgs/development/libraries/aws-sdk-cpp/default.nix
+++ b/pkgs/development/libraries/aws-sdk-cpp/default.nix
@@ -14,13 +14,13 @@ let
         else throw "Unsupported system!";
 in stdenv.mkDerivation rec {
   name = "aws-sdk-cpp-${version}";
-  version = "1.1.18";
+  version = "1.3.22";
 
   src = fetchFromGitHub {
     owner = "awslabs";
     repo = "aws-sdk-cpp";
     rev = version;
-    sha256 = "1i85zpns3gj5by45ppg4rfk9csix8mjazpyj6dqic40b2wshnw8c";
+    sha256 = "0sdgy8kqhxnw7n0sw4m3p3ay7yic3rhad5ab8m5lbx61ad9bq3c2";
   };
 
   # FIXME: might be nice to put different APIs in different outputs
@@ -28,7 +28,8 @@ in stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
   separateDebugInfo = stdenv.isLinux;
 
-  buildInputs = [ cmake curl ];
+  nativeBuildInputs = [ cmake curl ];
+  buildInputs = [ zlib curl openssl ];
 
   cmakeFlags =
     lib.optional (!customMemoryManagement) "-DCUSTOM_MEMORY_MANAGEMENT=0"
@@ -51,10 +52,6 @@ in stdenv.mkDerivation rec {
       rm aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp
     '';
 
-  NIX_LDFLAGS = lib.concatStringsSep " " (
-    (map (pkg: "-rpath ${lib.getOutput "lib" pkg}/lib"))
-      [ curl openssl zlib stdenv.cc.cc ]);
-
   meta = {
     description = "A C++ interface for Amazon Web Services";
     homepage = https://github.com/awslabs/aws-sdk-cpp;
diff --git a/pkgs/development/libraries/babl/default.nix b/pkgs/development/libraries/babl/default.nix
index 133b39d0797..04e714f886e 100644
--- a/pkgs/development/libraries/babl/default.nix
+++ b/pkgs/development/libraries/babl/default.nix
@@ -1,17 +1,20 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "babl-0.1.34";
+  name = "babl-0.1.38";
 
   src = fetchurl {
     url = "http://ftp.gtk.org/pub/babl/0.1/${name}.tar.bz2";
-    sha256 = "0nwakj313l2dh5npx18avkg4z17i2prkxbl6vj547a08n6ry1gsy";
+    sha256 = "11pfbyzq20596p9sgwraxspg3djg1jzz6wvz4bapf0yyr97jiyd0";
   };
 
-  meta = with stdenv.lib; { 
+  doCheck = true;
+
+  meta = with stdenv.lib; {
     description = "Image pixel format conversion library";
     homepage = http://gegl.org/babl/;
     license = licenses.gpl3;
+    maintainers = with stdenv.lib.maintainers; [ jtojnar ];
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/bobcat/default.nix b/pkgs/development/libraries/bobcat/default.nix
index 9805930c7bf..dd7d6a34867 100644
--- a/pkgs/development/libraries/bobcat/default.nix
+++ b/pkgs/development/libraries/bobcat/default.nix
@@ -39,6 +39,5 @@ stdenv.mkDerivation rec {
     homepage = https://fbb-git.github.io/bobcat/;
     license = licenses.gpl3;
     platforms = platforms.linux;
-    maintainers = with maintainers; [ nckx ];
   };
 }
diff --git a/pkgs/development/libraries/boehm-gc/default.nix b/pkgs/development/libraries/boehm-gc/default.nix
index 1ac96e2b4f0..b79900288c9 100644
--- a/pkgs/development/libraries/boehm-gc/default.nix
+++ b/pkgs/development/libraries/boehm-gc/default.nix
@@ -3,11 +3,15 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "boehm-gc-7.6.0";
+  name = "boehm-gc-${version}";
+  version = "7.6.2";
 
   src = fetchurl {
-    url = http://www.hboehm.info/gc/gc_source/gc-7.6.0.tar.gz;
-    sha256 = "143x7g0d0k6250ai6m2x3l4y352mzizi4wbgrmahxscv2aqjhjm1";
+    urls = [
+      "http://www.hboehm.info/gc/gc_source/gc-${version}.tar.gz"
+      "https://github.com/ivmai/bdwgc/releases/download/v${version}/gc-${version}.tar.gz"
+    ];
+    sha256 = "07nli9hgdzc09qzw169sn7gchkrn5kqgyniv2rspcy1xaq2j04dx";
   };
 
   buildInputs = [ libatomic_ops ];
@@ -20,16 +24,12 @@ stdenv.mkDerivation rec {
     [ "--enable-cplusplus" ]
     ++ lib.optional enableLargeConfig "--enable-large-config";
 
-  doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
+  doCheck = true; # not cross;
 
   # Don't run the native `strip' when cross-compiling.
   dontStrip = hostPlatform != buildPlatform;
 
-  postInstall =
-    ''
-      mkdir -p $out/share/doc
-      mv $out/share/gc $out/share/doc/gc
-    '';
+  enableParallelBuilding = true;
 
   meta = {
     description = "The Boehm-Demers-Weiser conservative garbage collector for C and C++";
diff --git a/pkgs/development/libraries/boost/1.59.nix b/pkgs/development/libraries/boost/1.59.nix
index 2666b1d6c5d..603d7883c64 100644
--- a/pkgs/development/libraries/boost/1.59.nix
+++ b/pkgs/development/libraries/boost/1.59.nix
@@ -8,33 +8,33 @@ callPackage ./generic.nix (args // rec {
     sha256 = "1jj1aai5rdmd72g90a3pd8sw9vi32zad46xv5av8fhnr48ir6ykj";
   };
 
-  patches = if stdenv.isCygwin then [
-      ./cygwin-fedora-boost-1.50.0-fix-non-utf8-files.patch
-      ./cygwin-fedora-boost-1.50.0-pool.patch
-      ./cygwin-fedora-boost-1.57.0-mpl-print.patch
-      ./cygwin-fedora-boost-1.57.0-spirit-unused_typedef.patch
-      ./cygwin-fedora-boost-1.54.0-locale-unused_typedef.patch
-      ./cygwin-fedora-boost-1.54.0-python-unused_typedef.patch
-      ./cygwin-fedora-boost-1.57.0-pool-test_linking.patch
-      ./cygwin-fedora-boost-1.54.0-pool-max_chunks_shadow.patch
-      ./cygwin-fedora-boost-1.57.0-signals2-weak_ptr.patch
-      ./cygwin-fedora-boost-1.57.0-uuid-comparison.patch
-      ./cygwin-fedora-boost-1.57.0-move-is_class.patch
-      ./cygwin-1.40.0-cstdint-cygwin.patch
-      ./cygwin-1.57.0-asio-cygwin.patch
-      ./cygwin-1.55.0-asio-MSG_EOR.patch
-      ./cygwin-1.57.0-config-cygwin.patch
-      ./cygwin-1.57.0-context-cygwin.patch
-      ./cygwin-1.57.0-filesystem-cygwin.patch
-      ./cygwin-1.55.0-interlocked-cygwin.patch
-      ./cygwin-1.40.0-iostreams-cygwin.patch
-      ./cygwin-1.57.0-locale-cygwin.patch
-      ./cygwin-1.57.0-log-cygwin.patch
-      ./cygwin-1.40.0-python-cygwin.patch
-      ./cygwin-1.40.0-regex-cygwin.patch
-      ./cygwin-1.57.0-smart_ptr-cygwin.patch
-      ./cygwin-1.57.0-system-cygwin.patch
-      ./cygwin-1.45.0-jam-cygwin.patch
-      ./cygwin-1.50.0-jam-pep3149.patch
-    ] else null;
+  patches = stdenv.lib.optionals stdenv.isCygwin [
+    ./cygwin-fedora-boost-1.50.0-fix-non-utf8-files.patch
+    ./cygwin-fedora-boost-1.50.0-pool.patch
+    ./cygwin-fedora-boost-1.57.0-mpl-print.patch
+    ./cygwin-fedora-boost-1.57.0-spirit-unused_typedef.patch
+    ./cygwin-fedora-boost-1.54.0-locale-unused_typedef.patch
+    ./cygwin-fedora-boost-1.54.0-python-unused_typedef.patch
+    ./cygwin-fedora-boost-1.57.0-pool-test_linking.patch
+    ./cygwin-fedora-boost-1.54.0-pool-max_chunks_shadow.patch
+    ./cygwin-fedora-boost-1.57.0-signals2-weak_ptr.patch
+    ./cygwin-fedora-boost-1.57.0-uuid-comparison.patch
+    ./cygwin-fedora-boost-1.57.0-move-is_class.patch
+    ./cygwin-1.40.0-cstdint-cygwin.patch
+    ./cygwin-1.57.0-asio-cygwin.patch
+    ./cygwin-1.55.0-asio-MSG_EOR.patch
+    ./cygwin-1.57.0-config-cygwin.patch
+    ./cygwin-1.57.0-context-cygwin.patch
+    ./cygwin-1.57.0-filesystem-cygwin.patch
+    ./cygwin-1.55.0-interlocked-cygwin.patch
+    ./cygwin-1.40.0-iostreams-cygwin.patch
+    ./cygwin-1.57.0-locale-cygwin.patch
+    ./cygwin-1.57.0-log-cygwin.patch
+    ./cygwin-1.40.0-python-cygwin.patch
+    ./cygwin-1.40.0-regex-cygwin.patch
+    ./cygwin-1.57.0-smart_ptr-cygwin.patch
+    ./cygwin-1.57.0-system-cygwin.patch
+    ./cygwin-1.45.0-jam-cygwin.patch
+    ./cygwin-1.50.0-jam-pep3149.patch
+  ];
 })
diff --git a/pkgs/development/libraries/boost/1.66.nix b/pkgs/development/libraries/boost/1.66.nix
new file mode 100644
index 00000000000..3fd9c160824
--- /dev/null
+++ b/pkgs/development/libraries/boost/1.66.nix
@@ -0,0 +1,12 @@
+{ stdenv, callPackage, fetchurl, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "1.66_0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/boost/boost_1_66_0.tar.bz2";
+    # SHA256 from http://www.boost.org/users/history/version_1_66_0.html
+    sha256 = "5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9";
+  };
+
+})
diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix
index 3f9ae113f84..c2a59431ac0 100644
--- a/pkgs/development/libraries/boost/generic.nix
+++ b/pkgs/development/libraries/boost/generic.nix
@@ -1,18 +1,19 @@
 { stdenv, fetchurl, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, libiconv
-, buildPlatform, hostPlatform
-, toolset ? if stdenv.cc.isClang then "clang" else null
+, which
+, buildPackages, buildPlatform, hostPlatform
+, toolset ? /**/ if stdenv.cc.isClang                                then "clang"
+            else if stdenv.cc.isGNU && hostPlatform != buildPlatform then "gcc-cross"
+            else null
 , enableRelease ? true
 , enableDebug ? false
 , enableSingleThreaded ? false
 , enableMultiThreaded ? true
 , enableShared ? !(hostPlatform.libc == "msvcrt") # problems for now
 , enableStatic ? !enableShared
-, enablePIC ? false
-, enableExceptions ? false
 , enablePython ? hostPlatform == buildPlatform
-, enableNumpy ? false, numpy ? null
+, enableNumpy ? enablePython && stdenv.lib.versionAtLeast version "1.65"
 , taggedLayout ? ((enableRelease && enableDebug) || (enableSingleThreaded && enableMultiThreaded) || (enableShared && enableStatic))
-, patches ? null
+, patches ? []
 , mpi ? null
 
 # Attributes inherit from specific versions
@@ -21,8 +22,9 @@
 }:
 
 # We must build at least one type of libraries
-assert !enableShared -> enableStatic;
+assert enableShared || enableStatic;
 
+# Python isn't supported when cross-compiling
 assert enablePython -> hostPlatform == buildPlatform;
 assert enableNumpy -> enablePython;
 
@@ -46,86 +48,41 @@ let
   # To avoid library name collisions
   layout = if taggedLayout then "tagged" else "system";
 
-  cflags = if enablePIC && enableExceptions then
-             "cflags=\"-fPIC -fexceptions\" cxxflags=-fPIC linkflags=-fPIC"
-           else if enablePIC then
-             "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC"
-           else if enableExceptions then
-             "cflags=-fexceptions"
-           else
-             "";
-
-  withToolset = stdenv.lib.optionalString (toolset != null) "--with-toolset=${toolset}";
-
-  genericB2Flags = [
+  b2Args = concatStringsSep " " ([
     "--includedir=$dev/include"
     "--libdir=$out/lib"
     "-j$NIX_BUILD_CORES"
     "--layout=${layout}"
     "variant=${variant}"
     "threading=${threading}"
-  ] ++ optional (link != "static") "runtime-link=${runtime-link}" ++ [
+    "runtime-link=${runtime-link}"
     "link=${link}"
-    "${cflags}"
-  ] ++ optional (variant == "release") "debug-symbols=off"
-    ++ optional (!enablePython) "--without-python";
-
-  nativeB2Flags = [
     "-sEXPAT_INCLUDE=${expat.dev}/include"
     "-sEXPAT_LIBPATH=${expat.out}/lib"
-  ] ++ optional (toolset != null) "toolset=${toolset}"
-    ++ optional (mpi != null) "--user-config=user-config.jam";
-  nativeB2Args = concatStringsSep " " (genericB2Flags ++ nativeB2Flags);
-
-  crossB2Flags = [
-    "-sEXPAT_INCLUDE=${expat.crossDrv}/include"
-    "-sEXPAT_LIBPATH=${expat.crossDrv}/lib"
-    "--user-config=user-config.jam"
-    "toolset=gcc-cross"
-  ] ++ optionals (hostPlatform.libc == "msvcrt") [
+  ] ++ optional (variant == "release") "debug-symbols=off"
+    ++ optional (toolset != null) "toolset=${toolset}"
+    ++ optional (mpi != null || hostPlatform != buildPlatform) "--user-config=user-config.jam"
+    ++ optionals (hostPlatform.libc == "msvcrt") [
     "target-os=windows"
     "threadapi=win32"
     "binary-format=pe"
     "address-model=${toString hostPlatform.parsed.cpu.bits}"
     "architecture=x86"
-  ];
-  crossB2Args = concatStringsSep " " (genericB2Flags ++ crossB2Flags);
-
-  builder = b2Args: ''
-    ./b2 ${b2Args}
-  '';
-
-  installer = b2Args: ''
-    # boostbook is needed by some applications
-    mkdir -p $dev/share/boostbook
-    cp -a tools/boostbook/{xsl,dtd} $dev/share/boostbook/
-
-    # Let boost install everything else
-    ./b2 ${b2Args} install
-  '';
-
-  commonConfigureFlags = [
-    "--includedir=$(dev)/include"
-    "--libdir=$(out)/lib"
-  ];
-
-  fixup = ''
-    # Make boost header paths relative so that they are not runtime dependencies
-    (
-      cd "$dev"
-      find include \( -name '*.hpp' -or -name '*.h' -or -name '*.ipp' \) \
-        -exec sed '1i#line 1 "{}"' -i '{}' \;
-    )
-  '' + optionalString (hostPlatform.libc == "msvcrt") ''
-    ${stdenv.cc.prefix}ranlib "$out/lib/"*.a
-  '';
+  ]);
 
 in
 
 stdenv.mkDerivation {
   name = "boost-${version}";
 
-  inherit src patches;
+  inherit src;
+
+  patchFlags = optionalString (hostPlatform.libc == "msvcrt") "-p0";
+  patches = patches ++ optional (hostPlatform.libc == "msvcrt") (fetchurl {
+    url = "https://svn.boost.org/trac/boost/raw-attachment/tickaet/7262/"
+        + "boost-mingw.patch";
+    sha256 = "0s32kwll66k50w6r5np1y5g907b7lcpsjhfgr7rsw7q5syhzddyj";
+  });
 
   meta = {
     homepage = http://boost.org/;
@@ -142,9 +99,13 @@ stdenv.mkDerivation {
           --replace '@rpath/$(<[1]:D=)' "$out/lib/\$(<[1]:D=)";
     fi;
   '' + optionalString (mpi != null) ''
-    cat << EOF > user-config.jam
+    cat << EOF >> user-config.jam
     using mpi : ${mpi}/bin/mpiCC ;
     EOF
+  '' + optionalString (hostPlatform != buildPlatform) ''
+    cat << EOF >> user-config.jam
+    using gcc : cross : ${stdenv.cc.targetPrefix}c++ ;
+    EOF
   '';
 
   NIX_CFLAGS_LINK = stdenv.lib.optionalString stdenv.isDarwin
@@ -152,46 +113,43 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
+  nativeBuildInputs = [ which buildPackages.stdenv.cc ];
   buildInputs = [ expat zlib bzip2 libiconv ]
     ++ optional (hostPlatform == buildPlatform) icu
     ++ optional stdenv.isDarwin fixDarwinDylibNames
     ++ optional enablePython python
-    ++ optional enableNumpy numpy;
+    ++ optional enableNumpy python.pkgs.numpy;
 
   configureScript = "./bootstrap.sh";
-  configureFlags = commonConfigureFlags
-    ++ [ "--with-python=${python.interpreter}" ]
-    ++ optional (hostPlatform == buildPlatform) "--with-icu=${icu.dev}"
+  configurePlatforms = [];
+  configureFlags = [
+    "--includedir=$(dev)/include"
+    "--libdir=$(out)/lib"
+  ] ++ optional enablePython "--with-python=${python.interpreter}"
+    ++ [ (if hostPlatform == buildPlatform then "--with-icu=${icu.dev}" else "--without-icu") ]
     ++ optional (toolset != null) "--with-toolset=${toolset}";
 
-  buildPhase = builder nativeB2Args;
+  buildPhase = ''
+    ./b2 ${b2Args}
+  '';
+
+  installPhase = ''
+    # boostbook is needed by some applications
+    mkdir -p $dev/share/boostbook
+    cp -a tools/boostbook/{xsl,dtd} $dev/share/boostbook/
 
-  installPhase = installer nativeB2Args;
+    # Let boost install everything else
+    ./b2 ${b2Args} install
+  '';
 
-  postFixup = fixup;
+  postFixup = ''
+    # Make boost header paths relative so that they are not runtime dependencies
+    find "$dev/include" \( -name '*.hpp' -or -name '*.h' -or -name '*.ipp' \) \
+      -exec sed '1i#line 1 "{}"' -i '{}' \;
+  '' + optionalString (hostPlatform.libc == "msvcrt") ''
+    $RANLIB "$out/lib/"*.a
+  '';
 
   outputs = [ "out" "dev" ];
   setOutputFlags = false;
-
-  crossAttrs = rec {
-    # We want to substitute the contents of configureFlags, removing thus the
-    # usual --build and --host added on cross building.
-    preConfigure = ''
-      export configureFlags="--without-icu ${concatStringsSep " " commonConfigureFlags}"
-      cat << EOF > user-config.jam
-      using gcc : cross : $crossConfig-g++ ;
-      EOF
-    '';
-    buildPhase = builder crossB2Args;
-    installPhase = installer crossB2Args;
-    postFixup = fixup;
-  } // optionalAttrs (hostPlatform.libc == "msvcrt") {
-    patches = fetchurl {
-      url = "https://svn.boost.org/trac/boost/raw-attachment/ticket/7262/"
-          + "boost-mingw.patch";
-      sha256 = "0s32kwll66k50w6r5np1y5g907b7lcpsjhfgr7rsw7q5syhzddyj";
-    };
-
-    patchFlags = "-p0";
-  };
 }
diff --git a/pkgs/development/libraries/bootil/default.nix b/pkgs/development/libraries/bootil/default.nix
index 727c6bfc4f3..160f6230594 100644
--- a/pkgs/development/libraries/bootil/default.nix
+++ b/pkgs/development/libraries/bootil/default.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   platform =
     if stdenv.isLinux then "linux"
     else if stdenv.isDarwin then "macosx"
-    else abort "unrecognized platform";
+    else throw "unrecognized system ${stdenv.system}";
 
   buildInputs = [ premake4 ];
 
diff --git a/pkgs/development/libraries/botan/2.0.upstream b/pkgs/development/libraries/botan/2.0.upstream
index d10850d46ad..74eb1a2ca83 100644
--- a/pkgs/development/libraries/botan/2.0.upstream
+++ b/pkgs/development/libraries/botan/2.0.upstream
@@ -1,5 +1,5 @@
-url http://botan.randombit.net/download.html
-version_link 'Botan-[0-9]+[.][0-9]*[02468]([.][0-9]+)?[.](tgz|tbz|tbz2|tar[.]bz2)$'
+url https://botan.randombit.net/
+version_link 'Botan-[0-9]+([.][0-9]+)*[.](tgz|tbz|tbz2|tar[.]bz2)$'
 ensure_version
 attribute_name botan2
 do_overwrite(){
diff --git a/pkgs/development/libraries/breakpad/default.nix b/pkgs/development/libraries/breakpad/default.nix
deleted file mode 100644
index 7f3117fac42..00000000000
--- a/pkgs/development/libraries/breakpad/default.nix
+++ /dev/null
@@ -1,28 +0,0 @@
-{ stdenv, fetchgit }:
-
-stdenv.mkDerivation {
-  name = "breakpad-2016-03-28";
-  
-  src = fetchgit {
-    url = "https://chromium.googlesource.com/breakpad/breakpad";
-    rev = "512cac3a1b69721ab727f3079f4d29e4580467b1";
-    sha256 = "1ksilbdpi1krycxkidqd1dlly95qf7air3zy8h5zfnagrlkz7zzx";
-  };
-
-  breakpad_lss = fetchgit {
-    url = "https://chromium.googlesource.com/linux-syscall-support";
-    rev = "08056836f2b4a5747daff75435d10d649bed22f6";
-    sha256 = "1ryshs2nyxwa0kn3rlbnd5b3fhna9vqm560yviddcfgdm2jyg0hz";
-  };
-
-  enableParallelBuilding = true;
-
-  prePatch = ''
-    cp -r $breakpad_lss src/third_party/lss
-    chmod +w -R src/third_party/lss
-  '';
-
-  meta = {
-    platforms = stdenv.lib.platforms.unix;
-  };
-}
diff --git a/pkgs/development/libraries/bullet/bullet283.nix b/pkgs/development/libraries/bullet/bullet283.nix
deleted file mode 100644
index 36790dbe3a2..00000000000
--- a/pkgs/development/libraries/bullet/bullet283.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{ stdenv, fetchurl, cmake, mesa, freeglut }:
-
-stdenv.mkDerivation rec {
-  name = "bullet-2.83.7"; # vdrift 2012-07-22 doesn't build with 2.81
-  src = fetchurl {
-    url = "https://github.com/bulletphysics/bullet3/archive/2.83.7.tar.gz";
-    sha256 = "0hqjnmlb2p29yiasrm7kvgv0nklz5zkwhfk4f78zz1gf0vrdil80";
-  };
-
-  buildInputs = [ cmake mesa freeglut ];
-  configurePhase = ''
-    cmake -DBUILD_SHARED_LIBS=ON -DINSTALL_EXTRA_LIBS=TRUE \
-      -DCMAKE_INSTALL_PREFIX=$out .
-  '';
-
-  enableParallelBuilding = true;
-
-  meta = {
-    description = "A professional free 3D Game Multiphysics Library";
-    longDescription = ''
-      Bullet 3D Game Multiphysics Library provides state of the art collision
-      detection, soft body and rigid body dynamics. 
-    '';
-    homepage = https://github.com/bulletphysics/bullet3;
-    license = stdenv.lib.licenses.zlib;
-    maintainers = with stdenv.lib.maintainers; [ aforemny ];
-    platforms = with stdenv.lib.platforms; linux;
-  };
-}
diff --git a/pkgs/development/libraries/bullet/default.nix b/pkgs/development/libraries/bullet/default.nix
index e7b50090537..39a5a9869ba 100644
--- a/pkgs/development/libraries/bullet/default.nix
+++ b/pkgs/development/libraries/bullet/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "bullet-${version}";
-  version = "2.86.1";
+  version = "2.87";
 
   src = fetchFromGitHub {
     owner = "bulletphysics";
     repo = "bullet3";
     rev = version;
-    sha256 = "1k81hr5y9rs2nsal6711fal21rxp6h573cpmjjk8x8ji2crqbqlz";
+    sha256 = "1msp7w3563vb43w70myjmqsdb97kna54dcfa7yvi9l3bvamb92w3";
   };
 
   buildInputs = [ cmake ] ++
@@ -16,19 +16,25 @@ stdenv.mkDerivation rec {
      then with darwin.apple_sdk.frameworks; [ Cocoa OpenGL ]
      else [mesa freeglut]);
 
+  patches = [ ./gwen-narrowing.patch ];
+
   postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
     sed -i 's/FIND_PACKAGE(OpenGL)//' CMakeLists.txt
     sed -i 's/FIND_LIBRARY(COCOA_LIBRARY Cocoa)//' CMakeLists.txt
   '';
 
-  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DBUILD_CPU_DEMOS=OFF" ] ++
-    stdenv.lib.optionals stdenv.isDarwin [
-      "-DMACOSX_DEPLOYMENT_TARGET=\"10.9\""
-      "-DOPENGL_FOUND=true"
-      "-DOPENGL_LIBRARIES=${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework"
-      "-DOPENGL_INCLUDE_DIR=${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework"
-      "-DOPENGL_gl_LIBRARY=${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework"
-      "-DCOCOA_LIBRARY=${darwin.apple_sdk.frameworks.Cocoa}/Library/Frameworks/Cocoa.framework"];
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DBUILD_CPU_DEMOS=OFF"
+    "-DINSTALL_EXTRA_LIBS=ON"
+  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+    "-DMACOSX_DEPLOYMENT_TARGET=\"10.9\""
+    "-DOPENGL_FOUND=true"
+    "-DOPENGL_LIBRARIES=${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework"
+    "-DOPENGL_INCLUDE_DIR=${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework"
+    "-DOPENGL_gl_LIBRARY=${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework"
+    "-DCOCOA_LIBRARY=${darwin.apple_sdk.frameworks.Cocoa}/Library/Frameworks/Cocoa.framework"
+  ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/bullet/gwen-narrowing.patch b/pkgs/development/libraries/bullet/gwen-narrowing.patch
new file mode 100644
index 00000000000..c6c06325dae
--- /dev/null
+++ b/pkgs/development/libraries/bullet/gwen-narrowing.patch
@@ -0,0 +1,22 @@
+commit a5d3497577c78b03c05c69d17df972fa9fb54f53
+Author: Linus Heckemann <git@sphalerite.org>
+Date:   Fri Jan 5 23:57:09 2018 +0100
+
+    Add -Wno-narrowing to GWEN's CMakeLists
+    
+    This avoids the compilation issue that occurs on aarch64 with gcc6.
+    (nixpkgs-specific patch)
+
+diff --git a/examples/ThirdPartyLibs/Gwen/CMakeLists.txt b/examples/ThirdPartyLibs/Gwen/CMakeLists.txt
+index 82fa0ffba..26c4bbd37 100644
+--- a/examples/ThirdPartyLibs/Gwen/CMakeLists.txt
++++ b/examples/ThirdPartyLibs/Gwen/CMakeLists.txt
+@@ -15,7 +15,7 @@ IF(NOT WIN32 AND NOT APPLE)
+         ADD_DEFINITIONS("-DDYNAMIC_LOAD_X11_FUNCTIONS=1")
+ ENDIF()
+ 
+-ADD_DEFINITIONS( -DGLEW_STATIC -DGWEN_COMPILE_STATIC -D_HAS_EXCEPTIONS=0 -D_STATIC_CPPLIB )
++ADD_DEFINITIONS( -DGLEW_STATIC -DGWEN_COMPILE_STATIC -D_HAS_EXCEPTIONS=0 -D_STATIC_CPPLIB -Wno-narrowing )
+ 
+ FILE(GLOB gwen_SRCS "*.cpp" "Controls/*.cpp" "Controls/Dialog/*.cpp" "Controls/Dialogs/*.cpp" "Controls/Layout/*.cpp" "Controls/Property/*.cpp" "Input/*.cpp" "Platforms/*.cpp" "Renderers/*.cpp" "Skins/*.cpp")
+ FILE(GLOB gwen_HDRS "*.h" "Controls/*.h" "Controls/Dialog/*.h" "Controls/Dialogs/*.h" "Controls/Layout/*.h" "Controls/Property/*.h" "Input/*.h" "Platforms/*.h" "Renderers/*.h" "Skins/*.h")
diff --git a/pkgs/development/libraries/c-ares/default.nix b/pkgs/development/libraries/c-ares/default.nix
index 14ff7a5f16c..6b3b69f9997 100644
--- a/pkgs/development/libraries/c-ares/default.nix
+++ b/pkgs/development/libraries/c-ares/default.nix
@@ -1,5 +1,6 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, writeTextDir }:
 
+let self =
 stdenv.mkDerivation rec {
   name = "c-ares-1.13.0";
 
@@ -14,4 +15,28 @@ stdenv.mkDerivation rec {
     license = licenses.mit;
     platforms = platforms.all;
   };
-}
+
+  # Adapted from running a cmake build
+  passthru.cmake-config = writeTextDir "c-ares-config.cmake"
+    ''
+      set(c-ares_INCLUDE_DIR "${self}/include")
+
+      set(c-ares_LIBRARY c-ares::cares)
+
+      add_library(c-ares::cares SHARED IMPORTED)
+
+      set_target_properties(c-ares::cares PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${self}/include"
+        INTERFACE_LINK_LIBRARIES "nsl;rt"
+      )
+      set_property(TARGET c-ares::cares APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+      set_target_properties(c-ares::cares PROPERTIES
+        IMPORTED_LOCATION_RELEASE "${self}/lib/libcares.so.2.2.0"
+        IMPORTED_SONAME_RELEASE "libcares.so.2"
+        )
+      add_library(c-ares::cares_shared INTERFACE IMPORTED)
+      set_target_properties(c-ares::cares_shared PROPERTIES INTERFACE_LINK_LIBRARIES "c-ares::cares")
+      set(c-ares_SHARED_LIBRARY c-ares::cares_shared)
+    '';
+
+}; in self
diff --git a/pkgs/development/libraries/c-ares/release.patch b/pkgs/development/libraries/c-ares/release.patch
new file mode 100644
index 00000000000..e745648062a
--- /dev/null
+++ b/pkgs/development/libraries/c-ares/release.patch
@@ -0,0 +1,19 @@
+diff -aur c-ares-cares-1_13_0/ares_version.h c-ares-1.13.0/ares_version.h
+--- c-ares-cares-1_13_0/ares_version.h	2017-06-20 02:00:21.000000000 -0400
++++ c-ares-1.13.0/ares_version.h	2017-06-20 02:03:54.000000000 -0400
+@@ -6,12 +6,12 @@
+ #define ARES_COPYRIGHT "2004 - 2016 Daniel Stenberg, <daniel@haxx.se>."
+ 
+ #define ARES_VERSION_MAJOR 1
+-#define ARES_VERSION_MINOR 12
+-#define ARES_VERSION_PATCH 1
++#define ARES_VERSION_MINOR 13
++#define ARES_VERSION_PATCH 0
+ #define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
+                        (ARES_VERSION_MINOR<<8)|\
+                        (ARES_VERSION_PATCH))
+-#define ARES_VERSION_STR "1.12.1-DEV"
++#define ARES_VERSION_STR "1.13.0"
+ 
+ #if (ARES_VERSION >= 0x010700)
+ #  define CARES_HAVE_ARES_LIBRARY_INIT 1
diff --git a/pkgs/development/libraries/cairomm/default.nix b/pkgs/development/libraries/cairomm/default.nix
index b1ee0b8d273..09d162db853 100644
--- a/pkgs/development/libraries/cairomm/default.nix
+++ b/pkgs/development/libraries/cairomm/default.nix
@@ -1,16 +1,16 @@
 { fetchurl, stdenv, pkgconfig, darwin, cairo, xlibsWrapper, fontconfig, freetype, libsigcxx }:
 let
   ver_maj = "1.12";
-  ver_min = "0";
+  ver_min = "2";
 in
 stdenv.mkDerivation rec {
   name = "cairomm-${ver_maj}.${ver_min}";
 
   src = fetchurl {
-    #url = "http://www.cairographics.org/releases/${name}.tar.gz";
+    url = "http://www.cairographics.org/releases/${name}.tar.gz";
     # gnome doesn't have the latest version ATM; beware: same name but different hash
-    url = "mirror://gnome/sources/cairomm/${ver_maj}/${name}.tar.xz";
-    sha256 = "a54ada8394a86182525c0762e6f50db6b9212a2109280d13ec6a0b29bfd1afe6";
+    # url = "mirror://gnome/sources/cairomm/${ver_maj}/${name}.tar.xz";
+    sha256 = "16fmigxsaz85c3lgcls7biwyz8zy8c8h3jndfm54cxxas3a7zi25";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/catch/default.nix b/pkgs/development/libraries/catch/default.nix
index 66ced59c26d..6c20f4d6c91 100644
--- a/pkgs/development/libraries/catch/default.nix
+++ b/pkgs/development/libraries/catch/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "catch-${version}";
-  version = "1.9.6";
+  version = "1.11.0";
 
   src = fetchFromGitHub {
-    owner = "philsquared";
+    owner = "catchorg";
     repo = "Catch";
     rev = "v${version}";
-    sha256 = "0nqnyw6haa2771748ycag4hhjb8ni32cv4f7w3h0pji212542xan";
+    sha256 = "0v9yw7ydvhydp78hh7cmaif4h73k5qxqpm1g7xn8i882i3s84s2s";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/cdk/default.nix b/pkgs/development/libraries/cdk/default.nix
index a97ca5cc698..19f39217fd0 100644
--- a/pkgs/development/libraries/cdk/default.nix
+++ b/pkgs/development/libraries/cdk/default.nix
@@ -2,15 +2,18 @@
 
 stdenv.mkDerivation rec {
   name = "cdk-${version}";
-  version ="5.0-20161210";
+  version ="5.0-20171209";
 
   buildInputs = [
     ncurses
   ];
 
   src = fetchurl {
-    url = "ftp://invisible-island.net/cdk/cdk-${version}.tgz";
-    sha256 = "1bazwcwz4qhxyc8jaahdd2nlm30f5dhy0f6cnix5rjjhi35mhxcy";
+    urls = [
+      "ftp://ftp.invisible-island.net/cdk/cdk-${version}.tgz"
+      "https://invisible-mirror.net/archives/cdk/cdk-${version}.tgz"
+    ];
+    sha256 = "0jq0dx7gm7gl6lv5mhlfkxhw5362g9dxqdlpjlrag069nns8xdc8";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/cmocka/default.nix b/pkgs/development/libraries/cmocka/default.nix
index f352357ac21..995844524dc 100644
--- a/pkgs/development/libraries/cmocka/default.nix
+++ b/pkgs/development/libraries/cmocka/default.nix
@@ -1,26 +1,15 @@
-{ fetchurl, stdenv, cmake, fetchpatch }:
+{ fetchurl, stdenv, cmake }:
 
 stdenv.mkDerivation rec {
   name = "cmocka-${version}";
-  version = "1.0.1";
+  majorVersion = "1.1";
+  version = "${majorVersion}.1";
 
   src = fetchurl {
-    url = "https://cmocka.org/files/1.0/cmocka-${version}.tar.xz";
-    sha256 = "0fvm6rdalqcxckbddch8ycdw6n2ckldblv117n09chi2l7bm0q5k";
+    url = "https://cmocka.org/files/${majorVersion}/cmocka-${version}.tar.xz";
+    sha256 = "f02ef48a7039aa77191d525c5b1aee3f13286b77a13615d11bc1148753fc0389";
   };
 
-  patches = [
-    # This fixes the build for clang-3.7.0 and thus Darwin.
-    # See https://open.cryptomilk.org/issues/43 for more info.
-    #
-    # The patch is already merged to upstream, so it should be removed
-    # here on next release.
-    (fetchpatch {
-      url = "https://git.cryptomilk.org/projects/cmocka.git/patch/?id=1b595a80934fa95234fb290913cfe533f740d965";
-      sha256 = "1fg8xwb1mrrmw4dqa65ghnvgfdkpi0lv4j2gq0lm9ayvsi3v00vp";
-    })
-  ];
-
   nativeBuildInputs = [ cmake ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/cpp-netlib/default.nix b/pkgs/development/libraries/cpp-netlib/default.nix
index ecc730597c3..e5391e7100d 100644
--- a/pkgs/development/libraries/cpp-netlib/default.nix
+++ b/pkgs/development/libraries/cpp-netlib/default.nix
@@ -26,6 +26,5 @@ stdenv.mkDerivation rec {
     homepage    = http://cpp-netlib.org;
     license     = licenses.boost;
     platforms   = platforms.all;
-    maintainers = with maintainers; [ nckx ];
   };
 }
diff --git a/pkgs/development/libraries/cppdb/default.nix b/pkgs/development/libraries/cppdb/default.nix
index 72fa309b721..07c6e1490e7 100644
--- a/pkgs/development/libraries/cppdb/default.nix
+++ b/pkgs/development/libraries/cppdb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, sqlite, libmysql, postgresql, unixODBC }:
+{ stdenv, fetchurl, cmake, sqlite, mysql, postgresql, unixODBC }:
 
 stdenv.mkDerivation rec {
   name = "cppdb";
@@ -11,9 +11,10 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  buildInputs = [ cmake sqlite libmysql postgresql unixODBC ];
+  buildInputs = [ cmake sqlite mysql.connector-c postgresql unixODBC ];
 
   cmakeFlags = [ "--no-warn-unused-cli" ];
+  NIX_CFLAGS_COMPILE = [ "-I${mysql.connector-c}/include/mysql" "-L${mysql.connector-c}/lib/mysql" ];
 
   meta = with stdenv.lib; {
     homepage = http://cppcms.com/sql/cppdb/;
@@ -23,4 +24,3 @@ stdenv.mkDerivation rec {
     maintainers = [ maintainers.juliendehos ];
   };
 }
-
diff --git a/pkgs/development/libraries/csfml/default.nix b/pkgs/development/libraries/csfml/default.nix
new file mode 100644
index 00000000000..8f66b65e49a
--- /dev/null
+++ b/pkgs/development/libraries/csfml/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub, cmake, sfml }:
+
+let
+  version = "2.4";
+in
+
+stdenv.mkDerivation {
+  name = "csfml-${version}";
+  src = fetchFromGitHub {
+    owner = "SFML";
+    repo  = "CSFML";
+    rev   = "b5facb85d13bff451a5fd2d088a97472a685576c";
+    sha256 = "1q716gd7c7jlxzwpq5z4rjj5lsrn71ql2djphccdf9jannllqizn";
+  };
+  buildInputs = [ cmake sfml ];
+  cmakeFlags = [ "-DCMAKE_MODULE_PATH=${sfml}/share/SFML/cmake/Modules/" ];
+
+  meta = with stdenv.lib; {
+    homepage = http://www.sfml-dev.org/;
+    description = "Simple and fast multimedia library";
+    longDescription = ''
+      SFML is a simple, fast, cross-platform and object-oriented multimedia API.
+      It provides access to windowing, graphics, audio and network.
+      It is written in C++, and has bindings for various languages such as C, .Net, Ruby, Python.
+    '';
+    license = licenses.zlib;
+    maintainers = [ maintainers.jpdoyle ];
+
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/pkgs/development/libraries/curlcpp/default.nix b/pkgs/development/libraries/curlcpp/default.nix
index c1579b71748..c1c867abcdf 100644
--- a/pkgs/development/libraries/curlcpp/default.nix
+++ b/pkgs/development/libraries/curlcpp/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ cmake curl ];
 
   meta = with stdenv.lib; {
-    homepage = http://josephp91.github.io/curlcpp/;
+    homepage = https://josephp91.github.io/curlcpp/;
     description = "Object oriented C++ wrapper for CURL";
     platforms = platforms.unix;
     license = licenses.mit;
diff --git a/pkgs/development/libraries/czmq/3.x.nix b/pkgs/development/libraries/czmq/3.x.nix
index 0b4aeeb0801..9c9d8513422 100644
--- a/pkgs/development/libraries/czmq/3.x.nix
+++ b/pkgs/development/libraries/czmq/3.x.nix
@@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "16k9awrhdsymx7dnmvqcnkaq8lz8x8zppy6sh7ls8prpd6mkkjlb";
   };
 
+  patches = [ ./czmq3-gcc7.patch ];
+
   # Fix build on Glibc 2.24.
   NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
 
diff --git a/pkgs/development/libraries/czmq/4.x.nix b/pkgs/development/libraries/czmq/4.x.nix
index 971d15686ca..840fa34d6ae 100644
--- a/pkgs/development/libraries/czmq/4.x.nix
+++ b/pkgs/development/libraries/czmq/4.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, zeromq }:
+{ stdenv, fetchurl, fetchpatch, zeromq }:
 
 stdenv.mkDerivation rec {
   version = "4.0.2";
@@ -9,6 +9,13 @@ stdenv.mkDerivation rec {
     sha256 = "12gbh57xnz2v82x1g80gv4bwapmyzl00lbin5ix3swyac8i7m340";
   };
 
+  patches = [
+    (fetchpatch {
+      url = https://patch-diff.githubusercontent.com/raw/zeromq/czmq/pull/1618.patch;
+      sha256 = "1dssy7k0fni6djail8rz0lk8p777158jvrqhgn500i636gkxaxhp";
+    })
+  ];
+
   # Needs to be propagated for the .pc file to work
   propagatedBuildInputs = [ zeromq ];
 
diff --git a/pkgs/development/libraries/czmq/czmq3-gcc7.patch b/pkgs/development/libraries/czmq/czmq3-gcc7.patch
new file mode 100644
index 00000000000..4ab14685a6c
--- /dev/null
+++ b/pkgs/development/libraries/czmq/czmq3-gcc7.patch
@@ -0,0 +1,26 @@
+diff --git a/src/zgossip_engine.inc b/src/zgossip_engine.inc
+index 37dbb4eb..727aaa9b 100644
+--- a/src/zgossip_engine.inc
++++ b/src/zgossip_engine.inc
+@@ -258,7 +258,7 @@ engine_set_log_prefix (client_t *client, const char *string)
+ {
+     if (client) {
+         s_client_t *self = (s_client_t *) client;
+-        snprintf (self->log_prefix, sizeof (self->log_prefix) - 1,
++        snprintf (self->log_prefix, sizeof (self->log_prefix),
+             "%6d:%-33s", self->unique_id, string);
+     }
+ }
+diff --git a/src/zsys.c b/src/zsys.c
+index 4d0bb8a1..f07db9c8 100644
+--- a/src/zsys.c
++++ b/src/zsys.c
+@@ -1071,7 +1071,7 @@ zsys_run_as (const char *lockfile, const char *group, const char *user)
+             }
+         }
+         //   We record the current process id in the lock file
+-        char pid_buffer [10];
++        char pid_buffer [32];
+         snprintf (pid_buffer, sizeof (pid_buffer), "%6d\n", getpid ());
+         if (write (handle, pid_buffer, strlen (pid_buffer)) != strlen (pid_buffer)) {
+             zsys_error ("cannot write to lockfile: %s", strerror (errno));
diff --git a/pkgs/development/libraries/dbus/make-dbus-conf.nix b/pkgs/development/libraries/dbus/make-dbus-conf.nix
index d836d87efef..71da22ee374 100644
--- a/pkgs/development/libraries/dbus/make-dbus-conf.nix
+++ b/pkgs/development/libraries/dbus/make-dbus-conf.nix
@@ -11,6 +11,7 @@
 runCommand "dbus-1"
   {
     inherit serviceDirectories suidHelper;
+    preferLocalBuild = true;
     XML_CATALOG_FILES = writeText "dbus-catalog.xml" ''
       <?xml version="1.0"?>
       <!DOCTYPE catalog PUBLIC
diff --git a/pkgs/development/libraries/dirac/default.nix b/pkgs/development/libraries/dirac/default.nix
index 7cb7187a3ce..5b05d64f072 100644
--- a/pkgs/development/libraries/dirac/default.nix
+++ b/pkgs/development/libraries/dirac/default.nix
@@ -26,6 +26,6 @@ stdenv.mkDerivation rec {
     description = "A general-purpose video codec based on wavelets";
     platforms = platforms.linux;
     license = with licenses; [ mpl11 gpl2 lgpl21 ];
-    maintainer = maintainers.igsha;
+    maintainers = [ maintainers.igsha ];
   };
 }
diff --git a/pkgs/development/libraries/dleyna-connector-dbus/default.nix b/pkgs/development/libraries/dleyna-connector-dbus/default.nix
new file mode 100644
index 00000000000..94efa8e31d3
--- /dev/null
+++ b/pkgs/development/libraries/dleyna-connector-dbus/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, autoreconfHook, pkgconfig, fetchFromGitHub, dbus, dleyna-core, glib }:
+
+stdenv.mkDerivation rec {
+  name = "dleyna-connector-dbus";
+  version = "0.3.0";
+
+  src = fetchFromGitHub {
+    owner = "01org";
+    repo = name;
+    rev = "${version}";
+    sha256 = "0vziq5gwjm79yl2swch2mz6ias20nvfddf5cqgk9zbg25cb9m117";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  buildInputs = [ dbus dleyna-core glib ];
+
+  meta = with stdenv.lib; {
+    description = "A D-Bus API for the dLeyna services";
+    homepage = http://01.org/dleyna;
+    maintainers = [ maintainers.jtojnar ];
+    platforms = platforms.linux;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/pkgs/development/libraries/dleyna-core/0001-Search-connectors-in-DLEYNA_CONNECTOR_PATH.patch b/pkgs/development/libraries/dleyna-core/0001-Search-connectors-in-DLEYNA_CONNECTOR_PATH.patch
new file mode 100644
index 00000000000..cc50c159800
--- /dev/null
+++ b/pkgs/development/libraries/dleyna-core/0001-Search-connectors-in-DLEYNA_CONNECTOR_PATH.patch
@@ -0,0 +1,95 @@
+From bf549a028a5da122b7a4206529711b969c2ecd48 Mon Sep 17 00:00:00 2001
+From: Jan Tojnar <jtojnar@gmail.com>
+Date: Fri, 1 Sep 2017 13:49:06 +0200
+Subject: [PATCH] Search connectors in DLEYNA_CONNECTOR_PATH
+
+Previously, the connectors would only be looked for in a single
+directory, specified during compilation. This patch allows to
+traverse a list of directories provided by an environment variable.
+---
+ libdleyna/core/connector-mgr.c | 63 ++++++++++++++++++++++++++++--------------
+ 1 file changed, 42 insertions(+), 21 deletions(-)
+
+diff --git a/libdleyna/core/connector-mgr.c b/libdleyna/core/connector-mgr.c
+index eafb16c..8041c67 100644
+--- a/libdleyna/core/connector-mgr.c
++++ b/libdleyna/core/connector-mgr.c
+@@ -34,33 +34,54 @@ const dleyna_connector_t *dleyna_connector_mgr_load(const gchar *name)
+ 	const dleyna_connector_t *connector;
+ 	dleyna_connector_get_interface_t get_interface;
+ 	gchar *path;
++	const gchar *connector_path;
++	gchar **connector_path_list;
++	gsize i;
+ 
+ 	DLEYNA_LOG_DEBUG("Enter");
+ 
+-	path = g_strdup_printf("%s/%s%s.so", CONNECTOR_DIR,
+-			       DLEYNA_CONNECTOR_LIB_PATTERN, name);
+-	module = g_module_open(path, G_MODULE_BIND_LAZY);
+-	g_free(path);
++	connector_path = g_getenv ("DLEYNA_CONNECTOR_PATH");
++	if (!connector_path) {
++		DLEYNA_LOG_DEBUG ("DLEYNA_CONNECTOR_PATH not set");
++		connector_path = CONNECTOR_DIR;
++	} else {
++		DLEYNA_LOG_DEBUG ("DLEYNA_CONNECTOR_PATH set to %s", connector_path);
++	}
++
++	connector_path_list = g_strsplit (connector_path, G_SEARCHPATH_SEPARATOR_S, 0);
++
++	for (i = 0; connector_path_list[i]; i++) {
++		path = g_strdup_printf("%s/%s%s.so", connector_path_list[i],
++				       DLEYNA_CONNECTOR_LIB_PATTERN, name);
++		module = g_module_open(path, G_MODULE_BIND_LAZY);
++		g_free(path);
++
++		if (module) {
++			if (!g_connectors)
++				g_connectors = g_hash_table_new(g_direct_hash,
++								g_direct_equal);
++
++			if (g_module_symbol(module, "dleyna_connector_get_interface",
++					    (gpointer *)&get_interface)) {
++				connector = get_interface();
++				g_hash_table_insert(g_connectors, (gpointer)connector,
++						    module);
++
++				break;
++			} else {
++				connector = NULL;
++				g_module_close(module);
++				DLEYNA_LOG_CRITICAL(
++						"Connector '%s' entry point not found",
++						name);
++			}
+ 
+-	if (module) {
+-		if (!g_connectors)
+-			g_connectors = g_hash_table_new(g_direct_hash,
+-							g_direct_equal);
+-
+-		if (g_module_symbol(module, "dleyna_connector_get_interface",
+-				    (gpointer *)&get_interface)) {
+-			connector = get_interface();
+-			g_hash_table_insert(g_connectors, (gpointer)connector,
+-					    module);
+-		} else {
+-			connector = NULL;
+-			g_module_close(module);
+-			DLEYNA_LOG_CRITICAL(
+-					"Connector '%s' entry point not found",
+-					name);
+ 		}
++	}
+ 
+-	} else {
++	g_strfreev (connector_path_list);
++
++	if (!module) {
+ 		connector = NULL;
+ 		DLEYNA_LOG_CRITICAL("Connector '%s' not found", name);
+ 	}
+-- 
+2.14.1
+
diff --git a/pkgs/development/libraries/dleyna-core/default.nix b/pkgs/development/libraries/dleyna-core/default.nix
new file mode 100644
index 00000000000..1fc65b9ac7f
--- /dev/null
+++ b/pkgs/development/libraries/dleyna-core/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, autoreconfHook, pkgconfig, fetchFromGitHub, gupnp }:
+
+stdenv.mkDerivation rec {
+  name = "dleyna-core";
+  version = "0.6.0";
+
+  src = fetchFromGitHub {
+    owner = "01org";
+    repo = name;
+    rev = "v${version}";
+    sha256 = "1x5vj5zfk95avyg6g3nf6gar250cfrgla2ixj2ifn8pcick2d9vq";
+  };
+
+  setupHook = ./setup-hook.sh;
+
+  patches = [ ./0001-Search-connectors-in-DLEYNA_CONNECTOR_PATH.patch ];
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  propagatedBuildInputs = [ gupnp ];
+
+  meta = with stdenv.lib; {
+    description = "Library of utility functions that are used by the higher level dLeyna";
+    homepage = http://01.org/dleyna;
+    maintainers = [ maintainers.jtojnar ];
+    platforms = platforms.linux;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/pkgs/development/libraries/dleyna-core/setup-hook.sh b/pkgs/development/libraries/dleyna-core/setup-hook.sh
new file mode 100644
index 00000000000..87b5c67dff5
--- /dev/null
+++ b/pkgs/development/libraries/dleyna-core/setup-hook.sh
@@ -0,0 +1,8 @@
+addDleynaConnectorPath () {
+    if test -d "$1/lib/dleyna-1.0/connectors"
+    then
+        export DLEYNA_CONNECTOR_PATH="${DLEYNA_CONNECTOR_PATH}${DLEYNA_CONNECTOR_PATH:+:}$1/lib/dleyna-1.0/connectors"
+    fi
+}
+
+addEnvHooks "$targetOffset" addDleynaConnectorPath
diff --git a/pkgs/development/libraries/dleyna-renderer/default.nix b/pkgs/development/libraries/dleyna-renderer/default.nix
new file mode 100644
index 00000000000..b9b8d8fbd75
--- /dev/null
+++ b/pkgs/development/libraries/dleyna-renderer/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, autoreconfHook, pkgconfig, fetchFromGitHub, dleyna-connector-dbus, dleyna-core, gssdp, gupnp, gupnp_av, gupnp_dlna, libsoup, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "dleyna-renderer";
+  version = "0.6.0";
+
+  src = fetchFromGitHub {
+    owner = "01org";
+    repo = name;
+    rev = "${version}";
+    sha256 = "0jy54aq8hgrvzchrvfzqaj4pcn0cfhafl9bv8a9p6j82yjk4pvpp";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig makeWrapper ];
+  buildInputs = [ dleyna-core dleyna-connector-dbus gssdp gupnp gupnp_av gupnp_dlna libsoup ];
+
+  preFixup = ''
+    wrapProgram "$out/libexec/dleyna-renderer-service" \
+      --set DLEYNA_CONNECTOR_PATH "$DLEYNA_CONNECTOR_PATH"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Library to discover and manipulate Digital Media Renderers";
+    homepage = http://01.org/dleyna;
+    maintainers = [ maintainers.jtojnar ];
+    platforms = platforms.linux;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/pkgs/development/libraries/dleyna-server/default.nix b/pkgs/development/libraries/dleyna-server/default.nix
new file mode 100644
index 00000000000..8668cff644e
--- /dev/null
+++ b/pkgs/development/libraries/dleyna-server/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, autoreconfHook, makeWrapper, pkgconfig, fetchFromGitHub, dleyna-core, dleyna-connector-dbus, gssdp, gupnp, gupnp_av, gupnp_dlna, libsoup }:
+
+stdenv.mkDerivation rec {
+  name = "dleyna-server";
+  version = "0.6.0";
+
+  src = fetchFromGitHub {
+    owner = "01org";
+    repo = name;
+    rev = "${version}";
+    sha256 = "13a2i6ms27s46yxdvlh2zm7pim7jmr5cylnygzbliz53g3gxxl3j";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig makeWrapper ];
+  buildInputs = [ dleyna-core dleyna-connector-dbus gssdp gupnp gupnp_av gupnp_dlna libsoup ];
+
+  preFixup = ''
+    wrapProgram "$out/libexec/dleyna-server-service" \
+      --set DLEYNA_CONNECTOR_PATH "$DLEYNA_CONNECTOR_PATH"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Library to discover, browse and manipulate Digital Media Servers";
+    homepage = http://01.org/dleyna;
+    maintainers = [ maintainers.jtojnar ];
+    platforms = platforms.linux;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/pkgs/development/libraries/dlib/default.nix b/pkgs/development/libraries/dlib/default.nix
index 61932b29e62..bb150da6799 100644
--- a/pkgs/development/libraries/dlib/default.nix
+++ b/pkgs/development/libraries/dlib/default.nix
@@ -3,14 +3,14 @@
 }:
 
 stdenv.mkDerivation rec {
-  version = "19.6";
+  version = "19.8";
   name = "dlib-${version}";
 
   src = fetchFromGitHub {
     owner = "davisking";
     repo = "dlib";
     rev ="v${version}";
-    sha256 = "1nlx4z53jnk7wysaxrzbyyqb65m45rw4g1fagazl2jvwh1qn49ds";
+    sha256 = "0ras4dl1ws9f9680bi8wg0mnbqvrpn0l2xl5lrvq3jvnijb3cz9i";
   };
 
   postPatch = ''
diff --git a/pkgs/development/libraries/dotconf/default.nix b/pkgs/development/libraries/dotconf/default.nix
index efadff6a113..a2b2e08fd62 100644
--- a/pkgs/development/libraries/dotconf/default.nix
+++ b/pkgs/development/libraries/dotconf/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   meta = with stdenv.lib; {
     description = "A configuration parser library";
     maintainers = with maintainers; [ pSub ];
-    homepage = http://www.azzit.de/dotconf/;
+    homepage = https://github.com/williamh/dotconf;
     license = licenses.lgpl21Plus;
     platforms = with platforms; unix;
   };
diff --git a/pkgs/development/libraries/eccodes/default.nix b/pkgs/development/libraries/eccodes/default.nix
index 672fed2f015..651878182dc 100644
--- a/pkgs/development/libraries/eccodes/default.nix
+++ b/pkgs/development/libraries/eccodes/default.nix
@@ -6,11 +6,11 @@
 with stdenv.lib; 
 stdenv.mkDerivation rec {
   name = "eccodes-${version}";
-  version = "2.2.0";
+  version = "2.5.0";
 
   src = fetchurl {
-    url = https://software.ecmwf.int/wiki/download/attachments/45757960/eccodes-2.2.0-Source.tar.gz;
-    sha256 = "1hzl0akjfxphqivnaj2kg131w8ki80ba3872h0a45f4pchci4h8s";
+    url = "https://software.ecmwf.int/wiki/download/attachments/45757960/eccodes-${version}-Source.tar.gz";
+    sha256 = "0kiff19gk0w7ij0kx5ydqpsmdq499ylxxxq79lrgss218jy49aqq";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/exiv2/default.nix b/pkgs/development/libraries/exiv2/default.nix
index a1a07b43197..7f5f1903517 100644
--- a/pkgs/development/libraries/exiv2/default.nix
+++ b/pkgs/development/libraries/exiv2/default.nix
@@ -7,6 +7,24 @@ stdenv.mkDerivation rec {
     url = "http://www.exiv2.org/builds/${name}-trunk.tar.gz";
     sha256 = "1yza317qxd8yshvqnay164imm0ks7cvij8y8j86p1gqi1153qpn7";
   };
+
+  patches = [
+    (fetchurl rec {
+      name = "CVE-2017-9239.patch";
+      url = let patchname = "0006-1296-Fix-submitted.patch";
+          in "https://src.fedoraproject.org/lookaside/pkgs/exiv2/${patchname}"
+          + "/sha512/${sha512}/${patchname}";
+      sha512 = "3f9242dbd4bfa9dcdf8c9820243b13dc14990373a800c4ebb6cf7eac5653cfef"
+             + "e6f2c47a94fbee4ed24f0d8c2842729d721f6100a2b215e0f663c89bfefe9e32";
+     })
+     (fetchpatch {
+       # many CVEs - see https://github.com/Exiv2/exiv2/pull/120
+       url = "https://patch-diff.githubusercontent.com/raw/Exiv2/exiv2/pull/120.patch";
+       sha256 = "1szl22xmh12hibzaqf2zi8zl377x841m52x4jm5lziw6j8g81sj8";
+       excludes = [ "test/bugfixes-test.sh" ];
+     })
+  ];
+
   postPatch = "patchShebangs ./src/svn_version.sh";
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/expat/default.nix b/pkgs/development/libraries/expat/default.nix
index 01f3c11ac73..e341ce842eb 100644
--- a/pkgs/development/libraries/expat/default.nix
+++ b/pkgs/development/libraries/expat/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   outputMan = "dev"; # tiny page for a dev tool
 
-  doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
+  doCheck = true; # not cross;
 
   preCheck = ''
     patchShebangs ./run.sh
diff --git a/pkgs/development/libraries/faac/default.nix b/pkgs/development/libraries/faac/default.nix
index 55433786002..51696886148 100644
--- a/pkgs/development/libraries/faac/default.nix
+++ b/pkgs/development/libraries/faac/default.nix
@@ -8,11 +8,11 @@ assert mp4v2Support -> (mp4v2 != null);
 with stdenv.lib;
 stdenv.mkDerivation rec {
   name = "faac-${version}";
-  version = "1.29.3";
+  version = "1.29.9.2";
 
   src = fetchurl {
     url = "mirror://sourceforge/faac/${name}.tar.gz";
-    sha256 = "0gssrz2vq52mj8x2hvdqc9bwkp64s4f4g7yj7ac6dwxs8dw8kwnf";
+    sha256 = "0wf781vp7rzmxkx5h0w8j2i4xc63iixxikgbvvkdljbwhffj0pyl";
   };
 
   configureFlags = [ ]
@@ -26,6 +26,8 @@ stdenv.mkDerivation rec {
   buildInputs = [ ]
     ++ optional mp4v2Support mp4v2;
 
+  enableParallelBuilding = true;
+
   meta = {
     description = "Open source MPEG-4 and MPEG-2 AAC encoder";
     homepage    = http://www.audiocoding.com/faac.html;
diff --git a/pkgs/development/libraries/faad2/default.nix b/pkgs/development/libraries/faad2/default.nix
index 865bedf09ba..04a6b9c5354 100644
--- a/pkgs/development/libraries/faad2/default.nix
+++ b/pkgs/development/libraries/faad2/default.nix
@@ -5,10 +5,10 @@
 with stdenv.lib;
 stdenv.mkDerivation rec {
   name = "faad2-${version}";
-  version = "2.7";
+  version = "2.8.8";
 
   src = fetchurl {
-    url = "mirror://sourceforge/faac/${name}.tar.bz2";
+    url = "mirror://sourceforge/faac/${name}.tar.gz";
     sha256 = "1db37ydb6mxhshbayvirm5vz6j361bjim4nkpwjyhmy4ddfinmhl";
   };
 
diff --git a/pkgs/development/libraries/facile/default.nix b/pkgs/development/libraries/facile/default.nix
deleted file mode 100644
index 4050bdfd9eb..00000000000
--- a/pkgs/development/libraries/facile/default.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{ stdenv, fetchurl, ocaml }:
-
-stdenv.mkDerivation rec {
-  name = "facile-1.1";
-  
-  src = fetchurl {
-    url = "${meta.homepage}/distrib/${name}.tar.gz";
-    sha256 = "1jp59ankjds8mh4vm0b5h4fd1lcbfn0rd6n151cgh14ihsknnym8";
-  };
-  
-  dontAddPrefix = 1;
-
-  patches = [ ./ocaml_4.xx.patch ];
-
-  postPatch = "sed -e 's@mkdir@mkdir -p@' -i Makefile";
-
-  postConfigure = "make -C src .depend";
-  
-  makeFlags = "FACILEDIR=\${out}/lib/ocaml/facile";
-  
-  buildInputs = [ ocaml ];
-
-  meta = {
-    homepage = http://www.recherche.enac.fr/log/facile;
-    license = "LGPL";
-    description = "A Functional Constraint Library";
-    platforms = stdenv.lib.platforms.unix;
-  };
-}
diff --git a/pkgs/development/libraries/facile/ocaml_4.xx.patch b/pkgs/development/libraries/facile/ocaml_4.xx.patch
deleted file mode 100644
index 429405fabda..00000000000
--- a/pkgs/development/libraries/facile/ocaml_4.xx.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -rupN facile-1.1/src/fcl_data.ml facile-1.1-patched//src/fcl_data.ml
---- facile-1.1/src/fcl_data.ml	2004-09-08 11:51:02.000000000 +0200
-+++ facile-1.1-patched//src/fcl_data.ml	2012-12-16 13:49:36.286722670 +0100
-@@ -16,7 +16,7 @@ end
- 
- module Hashtbl = struct
-   type ('a, 'b) t = ('a, 'b) Hashtbl.t
--  let create = Hashtbl.create
-+  let create x = Hashtbl.create x
-   let get h = h
- 
-   let add h k d =
diff --git a/pkgs/development/libraries/fastpbkdf2/default.nix b/pkgs/development/libraries/fastpbkdf2/default.nix
new file mode 100644
index 00000000000..e781e2aab83
--- /dev/null
+++ b/pkgs/development/libraries/fastpbkdf2/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub, openssl }:
+
+stdenv.mkDerivation {
+  name = "fastpbkdf2-1.0.0";
+  
+  src = fetchFromGitHub {
+    owner = "ctz";
+    repo = "fastpbkdf2";
+    rev = "v1.0.0";
+    sha256 = "09ax0h4ik3vhvp3s98lic93l3g9f4v1jkr5k6z4g1lvm7s3lrha2";
+  };
+  
+  buildInputs = [ openssl ];
+
+  preBuild = ''
+    makeFlagsArray=(CFLAGS="-std=c99 -O3 -g")
+  '';
+
+  installPhase = ''
+    mkdir -p $out/{lib,include/fastpbkdf2}
+    cp *.a $out/lib
+    cp fastpbkdf2.h $out/include/fastpbkdf2
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A fast PBKDF2-HMAC-{SHA1,SHA256,SHA512} implementation in C";
+    homepage = https://github.com/ctz/fastpbkdf2;
+    license = licenses.cc0;
+    maintainers = with maintainers; [ ledif ];
+  };
+}
diff --git a/pkgs/development/libraries/ffmpeg-full/default.nix b/pkgs/development/libraries/ffmpeg-full/default.nix
index b50025aa108..780008c9500 100644
--- a/pkgs/development/libraries/ffmpeg-full/default.nix
+++ b/pkgs/development/libraries/ffmpeg-full/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, perl, texinfo, yasm
+{ stdenv, fetchurl, fetchpatch, pkgconfig, perl, texinfo, yasm
 , hostPlatform
 /*
  *  Licensing options (yes some are listed twice, filters and such are not listed)
@@ -231,14 +231,15 @@ assert nvenc -> nvidia-video-sdk != null && nonfreeLicensing;
 
 stdenv.mkDerivation rec {
   name = "ffmpeg-full-${version}";
-  version = "3.4";
+  version = "3.4.1";
 
   src = fetchurl {
     url = "https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz";
-    sha256 = "1vzvpx8ixy8m44f8qwp833hv253hpghybgzbc4n8b3div3j0dvmf";
+    sha256 = "1h4iz7q10wj04awr2wvmp60n7b09pfwrgwbbw9sgl7klcf52fxss";
   };
 
-  patchPhase = ''patchShebangs .
+  prePatch = ''
+    patchShebangs .
   '' + stdenv.lib.optionalString stdenv.isDarwin ''
     sed -i 's/#ifndef __MAC_10_11/#if 1/' ./libavcodec/audiotoolboxdec.c
   '' + stdenv.lib.optionalString (frei0r != null) ''
@@ -438,7 +439,7 @@ stdenv.mkDerivation rec {
   crossAttrs = {
     configurePlatforms = [];
     configureFlags = configureFlags ++ [
-      "--cross-prefix=${stdenv.cc.prefix}"
+      "--cross-prefix=${stdenv.cc.targetPrefix}"
       "--enable-cross-compile"
       "--target_os=${hostPlatform.parsed.kernel.name}"
       "--arch=${hostPlatform.arch}"
diff --git a/pkgs/development/libraries/ffmpeg/3.4.nix b/pkgs/development/libraries/ffmpeg/3.4.nix
index 513654e98f7..f4cda16424c 100644
--- a/pkgs/development/libraries/ffmpeg/3.4.nix
+++ b/pkgs/development/libraries/ffmpeg/3.4.nix
@@ -1,4 +1,4 @@
-{ stdenv, callPackage
+{ stdenv, callPackage, fetchpatch
 # Darwin frameworks
 , Cocoa, CoreMedia
 , ...
@@ -6,7 +6,7 @@
 
 callPackage ./generic.nix (args // rec {
   version = "${branch}";
-  branch = "3.4";
-  sha256 = "0pn8g3ab937ahslqd41crk0g4j4fh7kwimsrlfc0rl0pc3z132ax";
+  branch = "3.4.1";
+  sha256 = "0b2aaxx8l7g3pvs4zd3mzig44cc73savrxzfm6w0lnaa2lh3wi7k";
   darwinFrameworks = [ Cocoa CoreMedia ];
 })
diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix
index 1bd8b739260..906a15c419d 100644
--- a/pkgs/development/libraries/ffmpeg/generic.nix
+++ b/pkgs/development/libraries/ffmpeg/generic.nix
@@ -173,9 +173,9 @@ stdenv.mkDerivation rec {
   crossAttrs = {
     configurePlatforms = [];
     configureFlags = configureFlags ++ [
-      "--cross-prefix=${stdenv.cc.prefix}"
+      "--cross-prefix=${stdenv.cc.targetPrefix}"
       "--enable-cross-compile"
-      "--target_os=${hostPlatform.parsed.kernel}"
+      "--target_os=${hostPlatform.parsed.kernel.name}"
       "--arch=${hostPlatform.arch}"
     ];
   };
diff --git a/pkgs/development/libraries/fftw/default.nix b/pkgs/development/libraries/fftw/default.nix
index 5cf83752aa7..36c824c7528 100644
--- a/pkgs/development/libraries/fftw/default.nix
+++ b/pkgs/development/libraries/fftw/default.nix
@@ -5,7 +5,7 @@ with lib;
 assert elem precision [ "single" "double" "long-double" "quad-precision" ];
 
 let
-  version = "3.3.6-pl1";
+  version = "3.3.7";
   withDoc = stdenv.cc.isGNU;
 in
 
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "ftp://ftp.fftw.org/pub/fftw/fftw-${version}.tar.gz";
-    sha256 = "0g8qk98lgq770ixdf7n36yd5xjsgm2v3wzvnphwmhy6r4y2amx0y";
+    sha256 = "0wsms8narnbhfsa8chdflv2j9hzspvflblnqdn7hw8x5xdzrnq1v";
   };
 
   outputs = [ "out" "dev" "man" ]
diff --git a/pkgs/development/libraries/flite/default.nix b/pkgs/development/libraries/flite/default.nix
index 483f02f823f..31dad5e255a 100644
--- a/pkgs/development/libraries/flite/default.nix
+++ b/pkgs/development/libraries/flite/default.nix
@@ -1,18 +1,18 @@
-{ stdenv, fetchurl, pkgconfig }:
+{ stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "flite-1.9.0";
+  name = "flite-2.0.0";
 
   src = fetchurl {
-    url = "http://www.festvox.org/bard/${name}-current.tar.bz2";
-    sha256 = "197cc2a1f045b1666a29a9b5f035b3d676db6db94a4439d99a03b65e551ae2e0";
+    url = "http://www.festvox.org/flite/packed/flite-2.0/${name}-release.tar.bz2";
+    sha256 = "04g4r83jh4cl0irc8bg7njngcah7749956v9s6sh552kzmh3i337";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  patches = [ ./fix-rpath.patch ];
 
-  configureFlags = ''
-    --enable-shared
-  '';
+  configureFlags = [ "--enable-shared" ];
+
+  enableParallelBuilding = true;
 
   meta = {
     description = "A small, fast run-time speech synthesis engine";
diff --git a/pkgs/development/libraries/flite/fix-rpath.patch b/pkgs/development/libraries/flite/fix-rpath.patch
new file mode 100644
index 00000000000..be774147c3f
--- /dev/null
+++ b/pkgs/development/libraries/flite/fix-rpath.patch
@@ -0,0 +1,5 @@
+--- a/main/Makefile
++++ b/main/Makefile
+@@ -81 +80,1 @@ ifdef SHFLAGS
+-flite_LIBS_flags += -Wl,-rpath $(LIBDIR) 
++flite_LIBS_flags += -Wl,-rpath,$(INSTALLLIBDIR) 
diff --git a/pkgs/development/libraries/folly/default.nix b/pkgs/development/libraries/folly/default.nix
index 286e4ac56b5..45e3c964e99 100644
--- a/pkgs/development/libraries/folly/default.nix
+++ b/pkgs/development/libraries/folly/default.nix
@@ -1,27 +1,19 @@
 { stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, pkgconfig, boost, libevent
-, double_conversion, glog, google-gflags, python, libiberty, openssl }:
+, double-conversion, glog, google-gflags, python, libiberty, openssl }:
 
 stdenv.mkDerivation rec {
   name = "folly-${version}";
-  version = "2017.07.24.00";
+  version = "2017.11.06.00";
 
   src = fetchFromGitHub {
     owner = "facebook";
     repo = "folly";
     rev = "v${version}";
-    sha256 = "1cmqrm9yjxrw4xr1kcgzl0s7vcvp125wcgb0cz7whssgj11mf169";
+    sha256 = "11sn4gwqw94ygc2s4bzqy5k67v3rr20gy375brdcrl5rv0r2hhc0";
   };
 
-  patches = [
-    # Fix compilation
-    (fetchpatch {
-      url = "https://github.com/facebook/folly/commit/9fc87c83d93f092859823ec32289ed1b6abeb683.patch";
-      sha256 = "0ix0grqlzm16hwa4rjbajjck8kr9lksh6c3gn7p3ihbbchsmlhvl";
-    })
-  ];
-
   nativeBuildInputs = [ autoreconfHook python pkgconfig ];
-  buildInputs = [ libiberty boost libevent double_conversion glog google-gflags openssl ];
+  buildInputs = [ libiberty boost libevent double-conversion glog google-gflags openssl ];
 
   postPatch = "cd folly";
   preBuild = ''
diff --git a/pkgs/development/libraries/fribidi/default.nix b/pkgs/development/libraries/fribidi/default.nix
index bdfbb97f021..a107c9a478f 100644
--- a/pkgs/development/libraries/fribidi/default.nix
+++ b/pkgs/development/libraries/fribidi/default.nix
@@ -1,22 +1,26 @@
-{stdenv, fetchurl}:
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig }:
 
 stdenv.mkDerivation rec {
   name = "fribidi-${version}";
   version = "0.19.7";
 
-  src = fetchurl {
-    url = "http://fribidi.org/download/${name}.tar.bz2";
-    sha256 = "13jsb5qadlhsaxkbrb49nqslmbh904vvzhsm5mm2ghmv29i2l8h8";
+  src = fetchFromGitHub {
+    owner = "fribidi";
+    repo = "fribidi";
+    rev = version;
+    sha256 = "10q5jfch5qzrj2w4fbkr086ank66plx8hp7ra9a01irj80pbk96d";
   };
 
-  hardeningDisable = [ "format" ];
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+
+  # Configure script checks for glib, but it is only used for tests.
 
   outputs = [ "out" "devdoc" ];
 
   meta = with stdenv.lib; {
-    homepage = http://fribidi.org/;
+    homepage = https://github.com/fribidi/fribidi;
     description = "GNU implementation of the Unicode Bidirectional Algorithm (bidi)";
-    license = licenses.gpl2;
+    license = licenses.lgpl21;
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/ftgl/2.1.2.nix b/pkgs/development/libraries/ftgl/2.1.2.nix
deleted file mode 100644
index d4afc7ad481..00000000000
--- a/pkgs/development/libraries/ftgl/2.1.2.nix
+++ /dev/null
@@ -1,44 +0,0 @@
-{stdenv, fetchurl, freetype, mesa}:
-
-let
-  name = "ftgl-2.1.2";
-in
-stdenv.mkDerivation {
-  inherit name;
-
-  src = fetchurl {
-    url = "mirror://sourceforge/ftgl/${name}.tar.gz";
-    sha256 = "0xa00fnn6wd3rnkrkcs1wpv21lxdsb83r4hjn3l33dn0zbawnn97";
-  };
-
-  buildInputs = [freetype mesa];
-
-  NIX_LDFLAGS = "-lGLU -lGL";
-
-  patches = [ ./gcc.patch ];
-
-  configureFlags = "--enable-shared";
-
-  preConfigure = ''
-    cd unix
-    cd docs
-    tar vxf ../../docs/html.tar.gz
-    cd ..
-  '';
-
-  meta = {
-    homepage = https://sourceforge.net/apps/mediawiki/ftgl/;
-    description = "Font rendering library for OpenGL applications";
-    license = stdenv.lib.licenses.gpl3Plus;
-
-    longDescription = ''
-      FTGL is a free cross-platform Open Source C++ library that uses
-      Freetype2 to simplify rendering fonts in OpenGL applications. FTGL
-      supports bitmaps, pixmaps, texture maps, outlines, polygon mesh,
-      and extruded polygon rendering modes.
-    '';
-
-    platforms = stdenv.lib.platforms.gnu;
-    maintainers = [];
-  };
-}
diff --git a/pkgs/development/libraries/ftgl/default.nix b/pkgs/development/libraries/ftgl/default.nix
index 5e94618376b..432f5182345 100644
--- a/pkgs/development/libraries/ftgl/default.nix
+++ b/pkgs/development/libraries/ftgl/default.nix
@@ -11,7 +11,9 @@ stdenv.mkDerivation {
     sha256 = "0nsn4s6vnv5xcgxcw6q031amvh2zfj2smy1r5mbnjj2548hxcn2l";
   };
 
-  buildInputs = [freetype mesa];
+  buildInputs = [ freetype mesa ];
+
+  enableParallelBuilding = true;
 
   meta = {
     homepage = https://sourceforge.net/apps/mediawiki/ftgl/;
@@ -25,7 +27,7 @@ stdenv.mkDerivation {
       and extruded polygon rendering modes.
     '';
 
-    platforms = stdenv.lib.platforms.gnu;
+    platforms = stdenv.lib.platforms.unix;
     maintainers = [];
   };
 }
diff --git a/pkgs/development/libraries/ftgl/gcc.patch b/pkgs/development/libraries/ftgl/gcc.patch
deleted file mode 100644
index 6e9871476c8..00000000000
--- a/pkgs/development/libraries/ftgl/gcc.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/include/FTTextureGlyph.h b/include/FTTextureGlyph.h
-index c263f72..8959cb3 100755
---- a/include/FTTextureGlyph.h
-+++ b/include/FTTextureGlyph.h
-@@ -52,7 +52,7 @@ class FTGL_EXPORT FTTextureGlyph : public FTGlyph
-          * Reset the currently active texture to zero to get into a known state before
-          * drawing a string. This is to get round possible threading issues.
-          */
--        static void FTTextureGlyph::ResetActiveTexture(){ activeTextureID = 0;}
-+        static void ResetActiveTexture(){ activeTextureID = 0;}
-         
-     private:
-         /**
diff --git a/pkgs/development/libraries/gamin/debian-patches.nix b/pkgs/development/libraries/gamin/debian-patches.nix
index f784b8ccfee..a8f334fb3c3 100644
--- a/pkgs/development/libraries/gamin/debian-patches.nix
+++ b/pkgs/development/libraries/gamin/debian-patches.nix
@@ -1,6 +1,6 @@
 # Generated by debian-patches.sh from debian-patches.txt
 let
-  prefix = "http://patch-tracker.debian.org/patch/series/dl/gamin/0.1.10-4.1";
+  prefix = "https://sources.debian.org/data/main/g/gamin/0.1.10-4.1/debian/patches";
 in
 [
   {
diff --git a/pkgs/development/libraries/gamin/debian-patches.txt b/pkgs/development/libraries/gamin/debian-patches.txt
index 4faad71d44d..46d2420b21e 100644
--- a/pkgs/development/libraries/gamin/debian-patches.txt
+++ b/pkgs/development/libraries/gamin/debian-patches.txt
@@ -1,2 +1,2 @@
-gamin/0.1.10-4
+gamin/0.1.10-4.1
 17_deprecated_const_return.patch
diff --git a/pkgs/development/libraries/gdal/default.nix b/pkgs/development/libraries/gdal/default.nix
index 984d3da8119..54174e7cfe4 100644
--- a/pkgs/development/libraries/gdal/default.nix
+++ b/pkgs/development/libraries/gdal/default.nix
@@ -8,12 +8,12 @@
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
-  version = "2.2.1";
+  version = "2.2.3";
   name = "gdal-${version}";
 
   src = fetchurl {
     url = "http://download.osgeo.org/gdal/${version}/${name}.tar.xz";
-    sha256 = "0rk0p0k787whzzdl8m1f9wcrm7h9bf1pny3z96d93b4383arhw4j";
+    sha256 = "a328d63d476b3653f5a25b5f7971e87a15cdf8860ab0729d4b1157ba988b8d0b";
   };
 
   buildInputs = [ unzip libjpeg libtiff libpng proj openssl sqlite
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     "--with-poppler=${poppler.dev}" # optional
     "--with-libz=${zlib.dev}"       # optional
     "--with-pg=${postgresql}/bin/pg_config"
-    "--with-mysql=${mysql.lib.dev}/bin/mysql_config"
+    "--with-mysql=${mysql.connector-c or mysql}/bin/mysql_config"
     "--with-geotiff=${libgeotiff}"
     "--with-sqlite3=${sqlite.dev}"
     "--with-spatialite=${libspatialite}"
diff --git a/pkgs/development/libraries/gdal/gdal-1_11.nix b/pkgs/development/libraries/gdal/gdal-1_11.nix
index c9f0c076101..7a80ce7fdb6 100644
--- a/pkgs/development/libraries/gdal/gdal-1_11.nix
+++ b/pkgs/development/libraries/gdal/gdal-1_11.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, unzip, libjpeg, libtiff, zlib
-, postgresql, mysql, libgeotiff, python, pythonPackages, proj, geos, openssl
+, postgresql, mysql57, libgeotiff, python, pythonPackages, proj, geos, openssl
 , libpng }:
 
 stdenv.mkDerivation rec {
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
     "--with-libz=${zlib.dev}"       # optional
 
     "--with-pg=${postgresql}/bin/pg_config"
-    "--with-mysql=${mysql.lib.dev}/bin/mysql_config"
+    "--with-mysql=${mysql57.connector-c}/bin/mysql_config"
     "--with-geotiff=${libgeotiff}"
     "--with-python"               # optional
     "--with-static-proj4=${proj}" # optional
diff --git a/pkgs/development/libraries/gdbm/default.nix b/pkgs/development/libraries/gdbm/default.nix
index 3b78225a447..310aaa430da 100644
--- a/pkgs/development/libraries/gdbm/default.nix
+++ b/pkgs/development/libraries/gdbm/default.nix
@@ -1,14 +1,14 @@
 { stdenv, lib, buildPlatform, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "gdbm-1.13";
+  name = "gdbm-1.14";
 
   src = fetchurl {
     url = "mirror://gnu/gdbm/${name}.tar.gz";
-    sha256 = "0lx201q20dvc70f8a3c9s7s18z15inlxvbffph97ngvrgnyjq9cx";
+    sha256 = "02dakgrq93xwgln8qfv3vs5jyz5yvds5nyzkx6rhg9v585x478dd";
   };
 
-  doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
+  doCheck = true; # not cross;
 
   # Linking static stubs on cygwin requires correct ordering.
   # Consider upstreaming this.
diff --git a/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
index ba7ab82f50b..5a7dcd79299 100644
--- a/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
+++ b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
@@ -14,4 +14,4 @@ findGdkPixbufLoaders() {
 
 }
 
-envHooks+=(findGdkPixbufLoaders)
+addEnvHooks "$hostOffset" findGdkPixbufLoaders
diff --git a/pkgs/development/libraries/gegl/3.0.nix b/pkgs/development/libraries/gegl/3.0.nix
index 48b1e47e0ed..158707557a5 100644
--- a/pkgs/development/libraries/gegl/3.0.nix
+++ b/pkgs/development/libraries/gegl/3.0.nix
@@ -1,12 +1,13 @@
 { stdenv, fetchurl, pkgconfig, glib, babl, libpng, cairo, libjpeg, which
-, librsvg, pango, gtk, bzip2, json_glib, intltool, autoreconfHook, libraw }:
+, librsvg, pango, gtk, bzip2, json_glib, intltool, autoreconfHook, libraw
+, libwebp, gnome3 }:
 
 stdenv.mkDerivation rec {
-  name = "gegl-0.3.18";
+  name = "gegl-0.3.26";
 
   src = fetchurl {
     url = "http://download.gimp.org/pub/gegl/0.3/${name}.tar.bz2";
-    sha256 = "1ywihjav9yhmsvbrdyx9c5q71rqdkjg8l66ywca6s4yydvr8x1fp";
+    sha256 = "1a9zbi6ws0r0sqynvg2fh3ad0ipnphg7w62y7whlcrbpqi29izvf";
   };
 
   hardeningDisable = [ "format" ];
@@ -14,17 +15,24 @@ stdenv.mkDerivation rec {
   # needs fonts otherwise  don't know how to pass them
   configureFlags = "--disable-docs";
 
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
   buildInputs = [
-    babl libpng cairo libjpeg librsvg pango gtk bzip2 which json_glib intltool
-    libraw
+    libpng cairo libjpeg librsvg pango gtk bzip2
+    libraw libwebp gnome3.gexiv2
   ];
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  propagatedBuildInputs = [ glib json_glib babl ]; # for gegl-3.0.pc
+
+  nativeBuildInputs = [ pkgconfig intltool which autoreconfHook ];
 
   meta = {
     description = "Graph-based image processing framework";
     homepage = http://www.gegl.org;
     license = stdenv.lib.licenses.gpl3;
+    maintainers = with stdenv.lib.maintainers; [ jtojnar ];
     platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix
index a35d2380ede..9c3024ce25f 100644
--- a/pkgs/development/libraries/gettext/default.nix
+++ b/pkgs/development/libraries/gettext/default.nix
@@ -48,6 +48,8 @@ stdenv.mkDerivation rec {
   # HACK, see #10874 (and 14664)
   buildInputs = stdenv.lib.optional (!stdenv.isLinux && !hostPlatform.isCygwin) libiconv;
 
+  setupHook = ./gettext-setup-hook.sh;
+
   enableParallelBuilding = true;
 
   meta = {
diff --git a/pkgs/development/libraries/gettext/gettext-setup-hook.sh b/pkgs/development/libraries/gettext/gettext-setup-hook.sh
new file mode 100644
index 00000000000..5932ef6a44f
--- /dev/null
+++ b/pkgs/development/libraries/gettext/gettext-setup-hook.sh
@@ -0,0 +1,7 @@
+gettextDataDirsHook() {
+    if [ -d "$1/share/gettext" ]; then
+        addToSearchPath GETTEXTDATADIRS "$1/share/gettext"
+    fi
+}
+
+addEnvHooks "$hostOffset" gettextDataDirsHook
diff --git a/pkgs/development/libraries/gflags/default.nix b/pkgs/development/libraries/gflags/default.nix
new file mode 100644
index 00000000000..d79b7691335
--- /dev/null
+++ b/pkgs/development/libraries/gflags/default.nix
@@ -0,0 +1,10 @@
+{ stdenv, fetchurl, cmake }:
+
+stdenv.mkDerivation
+  { name = "gflags-2.2.1";
+    src = fetchurl
+      { url = "https://github.com/gflags/gflags/archive/v2.2.1.tar.gz";
+        sha256 = "03lxc2ah8i392kh1naq99iip34k4fpv22kwflyx3byd2ssycs9xf";
+      };
+    nativeBuildInputs = [ cmake ];
+  }
diff --git a/pkgs/development/libraries/giflib/5.0.nix b/pkgs/development/libraries/giflib/5.0.nix
deleted file mode 100644
index 95038284cd6..00000000000
--- a/pkgs/development/libraries/giflib/5.0.nix
+++ /dev/null
@@ -1,18 +0,0 @@
-{stdenv, fetchurl, xmlto, docbook_xml_dtd_412, docbook_xsl, libxml2 }:
-
-stdenv.mkDerivation {
-  name = "giflib-5.0.6";
-  src = fetchurl {
-    url = mirror://sourceforge/giflib/giflib-5.0.6.tar.bz2;
-    sha256 = "1sk9ysh27nabwb6z7a38n8gy2y2rnl3vjkbapv7pbjnzrff862c9";
-  };
-
-  buildInputs = [ xmlto docbook_xml_dtd_412 docbook_xsl libxml2 ];
-  meta = {
-    description = "A library for reading and writing gif images";
-    platforms = stdenv.lib.platforms.unix;
-    license = stdenv.lib.licenses.mit;
-    maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
-    branch = "5.0";
-  };
-}
diff --git a/pkgs/development/libraries/glew/default.nix b/pkgs/development/libraries/glew/default.nix
index 57bb4cb631d..38b303bde85 100644
--- a/pkgs/development/libraries/glew/default.nix
+++ b/pkgs/development/libraries/glew/default.nix
@@ -19,8 +19,9 @@ stdenv.mkDerivation rec {
 
   patchPhase = ''
     sed -i 's|lib64|lib|' config/Makefile.linux
+    substituteInPlace config/Makefile.darwin --replace /usr/local "$out"
     ${optionalString (hostPlatform != buildPlatform) ''
-    sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile
+      sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile
     ''}
   '';
 
@@ -43,6 +44,8 @@ stdenv.mkDerivation rec {
     "SYSTEM=${if hostPlatform.isMinGW then "mingw" else hostPlatform.parsed.kernel.name}"
   ];
 
+  enableParallelBuilding = true;
+
   meta = with stdenv.lib; {
     description = "An OpenGL extension loading library for C(++)";
     homepage = http://glew.sourceforge.net/;
diff --git a/pkgs/development/libraries/glib-networking/default.nix b/pkgs/development/libraries/glib-networking/default.nix
index fd8055fd0b3..87f3c78a82e 100644
--- a/pkgs/development/libraries/glib-networking/default.nix
+++ b/pkgs/development/libraries/glib-networking/default.nix
@@ -3,14 +3,14 @@
 
 let
   ver_maj = "2.54";
-  ver_min = "0";
+  ver_min = "1";
 in
 stdenv.mkDerivation rec {
   name = "glib-networking-${ver_maj}.${ver_min}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/glib-networking/${ver_maj}/${name}.tar.xz";
-    sha256 = "5961b3779080b72314b373ff5d4790eb7e41b75ca91816ad7a81ef32922f7096";
+    sha256 = "0bq16m9nh3gcz9x2fvygr0iwxd2pxcbrm3lj3kihsnh1afv8g9za";
   };
 
   outputs = [ "out" "dev" ]; # to deal with propagatedBuildInputs
diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix
index b82fd5f1e29..325a6e5bfa9 100644
--- a/pkgs/development/libraries/glib/default.nix
+++ b/pkgs/development/libraries/glib/default.nix
@@ -43,7 +43,7 @@ let
   '';
 
   ver_maj = "2.54";
-  ver_min = "1";
+  ver_min = "2";
 in
 
 stdenv.mkDerivation rec {
@@ -51,11 +51,12 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/glib/${ver_maj}/${name}.tar.xz";
-    sha256 = "50c01b1419324f10fbf9b9709ec2164b18586968bdce7540583bf32302cf47a3";
+    sha256 = "bb89e5c5aad33169a8c7f28b45671c7899c12f74caf707737f784d7102758e6c";
   };
 
   patches = optional stdenv.isDarwin ./darwin-compilation.patch
-    ++ optional doCheck ./skip-timer-test.patch;
+    ++ optional doCheck ./skip-timer-test.patch
+    ++ [ ./schema-override-variable.patch ];
 
   outputs = [ "out" "dev" "devdoc" ];
   outputBin = "dev";
diff --git a/pkgs/development/libraries/glib/schema-override-variable.patch b/pkgs/development/libraries/glib/schema-override-variable.patch
new file mode 100644
index 00000000000..1cb5a730351
--- /dev/null
+++ b/pkgs/development/libraries/glib/schema-override-variable.patch
@@ -0,0 +1,12 @@
+--- a/gio/gsettingsschema.c
++++ b/gio/gsettingsschema.c
+@@ -352,6 +352,9 @@
+ 
+       try_prepend_data_dir (g_get_user_data_dir ());
+ 
++      if ((path = g_getenv ("NIX_GSETTINGS_OVERRIDES_DIR")) != NULL)
++        try_prepend_dir (path);
++
+       if ((path = g_getenv ("GSETTINGS_SCHEMA_DIR")) != NULL)
+         try_prepend_dir (path);
+ 
diff --git a/pkgs/development/libraries/glib/setup-hook.sh b/pkgs/development/libraries/glib/setup-hook.sh
index c5cf293902c..233845c6541 100644
--- a/pkgs/development/libraries/glib/setup-hook.sh
+++ b/pkgs/development/libraries/glib/setup-hook.sh
@@ -5,13 +5,13 @@ make_glib_find_gsettings_schemas() {
         addToSearchPath GSETTINGS_SCHEMAS_PATH "$1/share/gsettings-schemas/"*
     fi
 }
-envHooks+=(make_glib_find_gsettings_schemas)
+addEnvHooks "$hostOffset" make_glib_find_gsettings_schemas
 
 # Install gschemas, if any, in a package-specific directory
 glibPreInstallPhase() {
   installFlagsArray+=("gsettingsschemadir=${!outputLib}/share/gsettings-schemas/$name/glib-2.0/schemas/")
 }
-preInstallPhases+=(glibPreInstallPhase)
+preInstallPhases+=" glibPreInstallPhase"
 
 glibPreFixupPhase() {
     # Move gschemas in case the install flag didn't help
@@ -22,5 +22,4 @@ glibPreFixupPhase() {
 
     addToSearchPath GSETTINGS_SCHEMAS_PATH "${!outputLib}/share/gsettings-schemas/$name"
 }
-preFixupPhases+=(glibPreFixupPhase)
-
+preFixupPhases+=" glibPreFixupPhase"
diff --git a/pkgs/development/libraries/glibc/2.26-115to131.diff.gz b/pkgs/development/libraries/glibc/2.26-115to131.diff.gz
new file mode 100644
index 00000000000..3d866c567a7
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.26-115to131.diff.gz
Binary files differdiff --git a/pkgs/development/libraries/glibc/2.26-75to115.diff.gz b/pkgs/development/libraries/glibc/2.26-75to115.diff.gz
new file mode 100644
index 00000000000..9bf1a4f7d39
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.26-75to115.diff.gz
Binary files differdiff --git a/pkgs/development/libraries/glibc/allow-kernel-2.6.32.patch b/pkgs/development/libraries/glibc/allow-kernel-2.6.32.patch
new file mode 100644
index 00000000000..ce18b874c42
--- /dev/null
+++ b/pkgs/development/libraries/glibc/allow-kernel-2.6.32.patch
@@ -0,0 +1,39 @@
+diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure
+index cace758c01..38fe7fe0b0 100644
+--- a/sysdeps/unix/sysv/linux/configure
++++ b/sysdeps/unix/sysv/linux/configure
+@@ -69,7 +69,7 @@ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kernel header at least $minimum_kernel" >&5
+ $as_echo_n "checking for kernel header at least $minimum_kernel... " >&6; }
+ decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
+-abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
++abinum=`echo "2.6.32.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ #include <linux/version.h>
+diff --git a/sysdeps/unix/sysv/linux/configure.ac b/sysdeps/unix/sysv/linux/configure.ac
+index 13abda0a51..6abc12eaed 100644
+--- a/sysdeps/unix/sysv/linux/configure.ac
++++ b/sysdeps/unix/sysv/linux/configure.ac
+@@ -50,7 +50,7 @@ fi
+ AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
+ changequote(,)dnl
+ decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
+-abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
++abinum=`echo "2.6.32.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
+ changequote([,])dnl
+ AC_TRY_COMPILE([#include <linux/version.h>
+ #if LINUX_VERSION_CODE < $decnum
+diff --git a/sysdeps/unix/sysv/linux/dl-osinfo.h b/sysdeps/unix/sysv/linux/dl-osinfo.h
+index 823cd8224d..482caaeeec 100644
+--- a/sysdeps/unix/sysv/linux/dl-osinfo.h
++++ b/sysdeps/unix/sysv/linux/dl-osinfo.h
+@@ -39,7 +39,7 @@
+ 	  GLRO(dl_osversion) = version;					      \
+ 									      \
+ 	/* Now we can test with the required version.  */		      \
+-	if (__LINUX_KERNEL_VERSION > 0 && version < __LINUX_KERNEL_VERSION)   \
++	if (__LINUX_KERNEL_VERSION > 0 && version < __LINUX_KERNEL_VERSION && version != 0x020620)   \
+ 	  /* Not sufficent.  */						      \
+ 	  FATAL ("FATAL: kernel too old\n");				      \
+       }									      \
diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix
index 7894d75fbe6..f68970ae13e 100644
--- a/pkgs/development/libraries/glibc/common.nix
+++ b/pkgs/development/libraries/glibc/common.nix
@@ -20,7 +20,7 @@
 
 let
   version = "2.26";
-  patchSuffix = "-75";
+  patchSuffix = "-131";
   sha256 = "1ggnj1hzjym7sn93rbwydcqd562q73lsb7g7kd199g6j9j9hlkp5";
   cross = if buildPlatform != hostPlatform then hostPlatform else null;
 in
@@ -47,6 +47,10 @@ stdenv.mkDerivation ({
           $ git show --reverse glibc-2.25..release/2.25/master | gzip -n -9 --rsyncable - > 2.25-49.patch.gz
       */
       ./2.26-75.patch.gz
+      ./2.26-75to115.diff.gz
+      # contains fix for CVE-2018-1000001 as the last commit:
+      # https://sourceware.org/git/?p=glibc.git;a=commit;h=fabef2edbc
+      ./2.26-115to131.diff.gz
 
       /* Have rpcgen(1) look for cpp(1) in $PATH.  */
       ./rpcgen-path.patch
@@ -64,6 +68,25 @@ stdenv.mkDerivation ({
          "/bin:/usr/bin", which is inappropriate on NixOS machines. This
          patch extends the search path by "/run/current-system/sw/bin". */
       ./fix_path_attribute_in_getconf.patch
+
+      /* Allow running with RHEL 6 -like kernels.  The patch adds an exception
+        for glibc to accept 2.6.32 and to tag the ELFs as 2.6.32-compatible
+        (otherwise the loader would refuse libc).
+        Note that glibc will fully work only on their heavily patched kernels
+        and we lose early mismatch detection on 2.6.32.
+
+        On major glibc updates we should check that the patched kernel supports
+        all the required features.  ATM it's verified up to glibc-2.26-131.
+        # HOWTO: check glibc sources for changes in kernel requirements
+        git log -p glibc-2.25.. sysdeps/unix/sysv/linux/x86_64/kernel-features.h sysdeps/unix/sysv/linux/kernel-features.h
+        # get kernel sources (update the URL)
+        mkdir tmp && cd tmp
+        curl http://vault.centos.org/6.9/os/Source/SPackages/kernel-2.6.32-696.el6.src.rpm | rpm2cpio - | cpio -idmv
+        tar xf linux-*.bz2
+        # check syscall presence, for example
+        less linux-*?/arch/x86/kernel/syscall_table_32.S
+       */
+      ./allow-kernel-2.6.32.patch
     ]
     ++ lib.optional stdenv.isx86_64 ./fix-x64-abi.patch;
 
@@ -91,6 +114,7 @@ stdenv.mkDerivation ({
   configureFlags =
     [ "-C"
       "--enable-add-ons"
+      "--enable-obsolete-nsl"
       "--enable-obsolete-rpc"
       "--sysconfdir=/etc"
       "--enable-stackguard-randomization"
@@ -120,7 +144,7 @@ stdenv.mkDerivation ({
 
   outputs = [ "out" "bin" "dev" "static" ];
 
-  nativeBuildInputs = lib.optional (cross != null) buildPackages.stdenv.cc;
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
   buildInputs = lib.optionals withGd [ gd libpng ];
 
   # Needed to install share/zoneinfo/zone.tab.  Set to impure /bin/sh to
diff --git a/pkgs/development/libraries/glm/default.nix b/pkgs/development/libraries/glm/default.nix
index 0841990fa95..904727ceae6 100644
--- a/pkgs/development/libraries/glm/default.nix
+++ b/pkgs/development/libraries/glm/default.nix
@@ -1,23 +1,28 @@
-{ stdenv, fetchurl, unzip }:
+{ stdenv, fetchzip, cmake }:
 
 stdenv.mkDerivation rec {
-  name = "glm-0.9.6.1";
+  version = "0.9.8.5";
+  name = "glm-${version}";
 
-  src = fetchurl {
-    url = "mirror://sourceforge/project/ogl-math/${name}/${name}.zip";
-    sha256 = "1s1kpf9hpyq6bdf87nhlkxyr2ay0ip9wqicdma9h8yz4vs20r2hs";
+  src = fetchzip {
+    url = "https://github.com/g-truc/glm/releases/download/${version}/${name}.zip";
+    sha256 = "0dkfj4hin3am9fxgcvwr5gj0h9y52x7wa03lfwb3q0bvaj1rsly2";
   };
 
-  buildInputs = [ unzip ];
+  nativeBuildInputs = [ cmake ];
 
   outputs = [ "out" "doc" ];
 
-  installPhase = ''
-    mkdir -p "$out/include"
-    cp -r glm "$out/include"
+  cmakeConfigureFlags = [ "-DGLM_INSTALL_ENABLE=off" ];
 
-    mkdir -p "$doc/share/doc/glm"
-    cp -r doc/* "$doc/share/doc/glm"
+  postPatch = ''
+    substituteInPlace CMakeLists.txt \
+      --replace '"''${CMAKE_CURRENT_BINARY_DIR}/''${GLM_INSTALL_CONFIGDIR}' '"''${GLM_INSTALL_CONFIGDIR}'
+  '';
+
+  postInstall = ''
+    mkdir -p $doc/share/doc/glm
+    cp -rv $NIX_BUILD_TOP/$sourceRoot/doc/* $doc/share/doc/glm
   '';
 
   meta = with stdenv.lib; {
@@ -33,3 +38,4 @@ stdenv.mkDerivation rec {
     maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
   };
 }
+
diff --git a/pkgs/development/libraries/glog/default.nix b/pkgs/development/libraries/glog/default.nix
index 10ef1bbd920..93e94fc8c42 100644
--- a/pkgs/development/libraries/glog/default.nix
+++ b/pkgs/development/libraries/glog/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "glog-${version}";
-  version = "0.3.4";
+  version = "0.3.5";
 
   src = fetchFromGitHub {
-    owner = "Google";
+    owner = "google";
     repo = "glog";
     rev = "v${version}";
-    sha256 = "0ym5g15m7c8kjfr2c3zq6bz08ghin2d1r1nb6v2vnkfh1vn945x1";
+    sha256 = "12v7j6xy0ghya6a0f6ciy4fnbdc486vml2g07j9zm8y5xc6vx3pq";
   };
 
   nativeBuildInputs = [ autoreconfHook ];
diff --git a/pkgs/development/libraries/glpk/default.nix b/pkgs/development/libraries/glpk/default.nix
index 4ab61a2d282..d608b3af6ce 100644
--- a/pkgs/development/libraries/glpk/default.nix
+++ b/pkgs/development/libraries/glpk/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv }:
 
 stdenv.mkDerivation rec {
-  name = "glpk-4.63";
+  name = "glpk-4.64";
 
   src = fetchurl {
     url = "mirror://gnu/glpk/${name}.tar.gz";
-    sha256 = "1xp7nclmp8inp20968bvvfcwmz3mz03sbm0v3yjz8aqwlpqjfkci";
+    sha256 = "096cqgjc7vkq6wd8znhcxjbs1s2rym3qf753fqxrrq531vs6g4jk";
   };
 
   doCheck = true;
diff --git a/pkgs/development/libraries/gmime/3.nix b/pkgs/development/libraries/gmime/3.nix
index d6877e72a1f..66d0cf88bd0 100644
--- a/pkgs/development/libraries/gmime/3.nix
+++ b/pkgs/development/libraries/gmime/3.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, pkgconfig, glib, zlib, gpgme, libidn, gobjectIntrospection }:
 
 stdenv.mkDerivation rec {
-  version = "3.0.1";
+  version = "3.0.5";
   name = "gmime-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gmime/3.0/${name}.tar.xz";
-    sha256 = "001y93b8mq9alzkvli6vfh3pzdcn5c5iy206ml23lzhhhvm5k162";
+    sha256 = "1q45gd1ahnz9q1milc2lqqwl7j3q0wd6kiswhp25iak222n56lrg";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/gmp/6.x.nix b/pkgs/development/libraries/gmp/6.x.nix
index e3bacc86d58..5973c89cef7 100644
--- a/pkgs/development/libraries/gmp/6.x.nix
+++ b/pkgs/development/libraries/gmp/6.x.nix
@@ -1,6 +1,5 @@
 { stdenv, fetchurl, m4, cxx ? true
 , buildPackages
-, buildPlatform, hostPlatform
 , withStatic ? false }:
 
 let inherit (stdenv.lib) optional optionalString; in
@@ -19,8 +18,8 @@ let self = stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "info" ];
   passthru.static = self.out;
 
-  nativeBuildInputs = [ m4 ]
-    ++ stdenv.lib.optional (buildPlatform != hostPlatform) buildPackages.stdenv.cc;
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ m4 ];
 
   configureFlags =
     # Build a "fat binary", with routines for several sub-architectures
@@ -43,7 +42,7 @@ let self = stdenv.mkDerivation rec {
       configureFlagsArray+=("--build=$(./configfsf.guess)")
     '';
 
-  doCheck = buildPlatform == hostPlatform;
+  doCheck = true; # not cross;
 
   dontDisableStatic = withStatic;
 
diff --git a/pkgs/development/libraries/gmtk/default.nix b/pkgs/development/libraries/gmtk/default.nix
new file mode 100644
index 00000000000..0fac97aaa43
--- /dev/null
+++ b/pkgs/development/libraries/gmtk/default.nix
@@ -0,0 +1,32 @@
+{stdenv, substituteAll, fetchFromGitHub, libtool, pkgconfig, intltool, glib, gtk3
+, libpulseaudio, mplayer, gnome_mplayer }:
+
+stdenv.mkDerivation rec {
+  name = "gmtk-${version}";
+  version = "1.0.9";
+
+  src = fetchFromGitHub {
+    owner = "kdekorte";
+    repo = "gmtk";
+    rev = "v${version}";
+    sha256 = "1zb5m1y1gckal3140gvx31572a6xpccwfmdwa1w5lx2wdq1pwk1i";
+  };
+
+  nativeBuildInputs = [ libtool pkgconfig intltool ];
+  buildInputs = [ glib gtk3 libpulseaudio ];
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      mplayer = "${mplayer}/bin/mplayer";
+    })
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Common functions for gnome-mplayer and gecko-mediaplayer";
+    homepage = https://sites.google.com/site/kdekorte2/gnomemplayer;
+    license = licenses.gpl2;
+    maintainers = gnome_mplayer.meta.maintainers;
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/gmtk/fix-paths.patch b/pkgs/development/libraries/gmtk/fix-paths.patch
new file mode 100644
index 00000000000..64738300aba
--- /dev/null
+++ b/pkgs/development/libraries/gmtk/fix-paths.patch
@@ -0,0 +1,20 @@
+--- a/src/gmtk_media_player.c
++++ b/src/gmtk_media_player.c
+@@ -2449,7 +2449,7 @@
+         player->minimum_mplayer = detect_mplayer_features(player);
+ 
+         if (player->mplayer_binary == NULL || !g_file_test(player->mplayer_binary, G_FILE_TEST_EXISTS)) {
+-            argv[argn++] = g_strdup_printf("mplayer");
++            argv[argn++] = g_strdup_printf("@mplayer@");
+         } else {
+             argv[argn++] = g_strdup_printf("%s", player->mplayer_binary);
+         }
+@@ -4135,7 +4135,7 @@
+         return ret;
+ 
+     if (player->mplayer_binary == NULL || !g_file_test(player->mplayer_binary, G_FILE_TEST_EXISTS)) {
+-        av[ac++] = g_strdup_printf("mplayer");
++        av[ac++] = g_strdup_printf("@mplayer@");
+     } else {
+         av[ac++] = g_strdup_printf("%s", player->mplayer_binary);
+     }
diff --git a/pkgs/development/libraries/gnutls/3.5.10.nix b/pkgs/development/libraries/gnutls/3.5.10.nix
index a1eab1a84c1..a44e2b04ed7 100644
--- a/pkgs/development/libraries/gnutls/3.5.10.nix
+++ b/pkgs/development/libraries/gnutls/3.5.10.nix
@@ -4,7 +4,7 @@ callPackage ./generic.nix (args // rec {
   version = "3.5.10";
 
   src = fetchurl {
-    url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.5/gnutls-${version}.tar.xz";
+    url = "mirror://gnupg/gnutls/v3.5/gnutls-${version}.tar.xz";
     sha256 = "17apwvdkkazh5w8z8mbanpj2yj8s2002qwy46wz4v3akpa33wi5g";
   };
 })
diff --git a/pkgs/development/libraries/gnutls/3.5.nix b/pkgs/development/libraries/gnutls/3.6.nix
index 55c917f212e..9dc6d5389d9 100644
--- a/pkgs/development/libraries/gnutls/3.5.nix
+++ b/pkgs/development/libraries/gnutls/3.6.nix
@@ -1,11 +1,11 @@
 { callPackage, fetchurl, ... } @ args:
 
 callPackage ./generic.nix (args // rec {
-  version = "3.5.15";
+  version = "3.6.1";
 
   src = fetchurl {
-    url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.5/gnutls-${version}.tar.xz";
-    sha256 = "1mgsxkbs44csw07ngwbqns2y2s03m975lk1sl5ay87wbic882q04";
+    url = "mirror://gnupg/gnutls/v3.6/gnutls-${version}.tar.xz";
+    sha256 = "1vdsir53ddxyapnxh5fpnfyij3scx3818iri4hl07g4lk4n0vc90";
   };
 
   # Skip two tests introduced in 3.5.11.  Probable reasons of failure:
@@ -14,5 +14,6 @@ callPackage ./generic.nix (args // rec {
   postPatch = ''
     sed '2iexit 77' -i tests/pkgconfig.sh
     sed '/^void doit(void)/,$s/{/{ exit(77);/; t' -i tests/trust-store.c
+    # TODO: remove just this line on some rebuild
   '';
 })
diff --git a/pkgs/development/libraries/gobject-introspection/setup-hook.sh b/pkgs/development/libraries/gobject-introspection/setup-hook.sh
index 583d8475ec3..a79ce05a38d 100644
--- a/pkgs/development/libraries/gobject-introspection/setup-hook.sh
+++ b/pkgs/development/libraries/gobject-introspection/setup-hook.sh
@@ -1,5 +1,4 @@
 make_gobject_introspection_find_gir_files() {
-
     # required for .typelib files, eg mypaint git version
     if [ -d "$1/lib/girepository-1.0" ]; then
       addToSearchPath GI_TYPELIB_PATH $1/lib/girepository-1.0
@@ -11,11 +10,18 @@ make_gobject_introspection_find_gir_files() {
     fi
 }
 
-envHooks+=(make_gobject_introspection_find_gir_files)
+addEnvHooks "$hostOffset" make_gobject_introspection_find_gir_files
+
+giDiscoverSelf() {
+    if [ -d "$prefix/lib/girepository-1.0" ]; then
+      addToSearchPath GI_TYPELIB_PATH $prefix/lib/girepository-1.0
+    fi
+}
+
+preFixupHooks+=(giDiscoverSelf)
 
 _multioutMoveGlibGir() {
   moveToOutput share/gir-1.0 "${!outputDev}"
 }
 
 preFixupHooks+=(_multioutMoveGlibGir)
-
diff --git a/pkgs/development/libraries/goffice/default.nix b/pkgs/development/libraries/goffice/default.nix
index 7971448133e..f67129c007e 100644
--- a/pkgs/development/libraries/goffice/default.nix
+++ b/pkgs/development/libraries/goffice/default.nix
@@ -2,11 +2,11 @@
 , libgsf, libxml2, libxslt, cairo, pango, librsvg, libspectre }:
 
 stdenv.mkDerivation rec {
-  name = "goffice-0.10.35";
+  name = "goffice-0.10.38";
 
   src = fetchurl {
     url = "mirror://gnome/sources/goffice/0.10/${name}.tar.xz";
-    sha256 = "c19001afca09dc5446e06605a113d81a57124018a09c5889aeebba16cf1d5738";
+    sha256 = "443199d7a9833fddaadfc4f9065c289e639eed480de316f37da816e396bb9764";
   };
 
   nativeBuildInputs = [ pkgconfig intltool ];
diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix
index 9773ef8b896..1e59e8f1d65 100644
--- a/pkgs/development/libraries/gpgme/default.nix
+++ b/pkgs/development/libraries/gpgme/default.nix
@@ -4,21 +4,13 @@
 let inherit (stdenv) lib system; in
 
 stdenv.mkDerivation rec {
-  name = "gpgme-1.9.0";
+  name = "gpgme-1.10.0";
 
   src = fetchurl {
     url = "mirror://gnupg/gpgme/${name}.tar.bz2";
-    sha256 = "1ssc0gs02r4fasabk7c6v6r865k2j02mpb5g1vkpbmzsigdzwa8v";
+    sha256 = "14q619lxbk64vz7lih5gjb928qm28jrnn1h3yhsrrff3jw8yv3qs";
   };
 
-  patches = [
-    (fetchpatch {
-      url = "https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpgme.git;a=commitdiff_plain;h=5d4f977dac542340c877fdd4b1304fa8f6e058e6";
-      sha256 = "0swpxzd3x3b6h2ry2py9j8l0xp3vdw8rixxhgfavzia5p869qyyx";
-      name = "qgpgme-format-security.patch";
-    })
-  ];
-
   outputs = [ "out" "dev" "info" ];
   outputBin = "dev"; # gpgme-config; not so sure about gpgme-tool
 
diff --git a/pkgs/development/libraries/granite/default.nix b/pkgs/development/libraries/granite/default.nix
index be869063111..4e41545687a 100644
--- a/pkgs/development/libraries/granite/default.nix
+++ b/pkgs/development/libraries/granite/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   majorVersion = "0.4";
-  minorVersion = "0.1";
+  minorVersion = "1";
   name = "granite-${majorVersion}.${minorVersion}";
   src = fetchurl {
     url = "https://launchpad.net/granite/${majorVersion}/${majorVersion}.${minorVersion}/+download/${name}.tar.xz";
-    sha256 = "1pf4jkz3xyn1sqv70063im80ayb5kdsqwqwx11dc7vgypsl458cm";
+    sha256 = "177h5h1q4qd7g99mzbczvz78j8c9jf4f1gwdj9f6imbc7r913d4b";
   };
   cmakeFlags = "-DINTROSPECTION_GIRDIR=share/gir-1.0/ -DINTROSPECTION_TYPELIBDIR=lib/girepository-1.0";
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/grantlee/5/setup-hook.sh b/pkgs/development/libraries/grantlee/5/setup-hook.sh
index d11ef5883a1..b51cb4a3190 100644
--- a/pkgs/development/libraries/grantlee/5/setup-hook.sh
+++ b/pkgs/development/libraries/grantlee/5/setup-hook.sh
@@ -4,20 +4,10 @@ providesGrantleeRuntime() {
     [ -d "$1/$grantleePluginPrefix" ]
 }
 
-_grantleeCrossEnvHook() {
-    if providesQtRuntime "$1"; then
-        propagatedBuildInputs+=" $1"
-        propagatedUserEnvPkgs+=" $1"
-    fi
-}
-crossEnvHooks+=(_grantleeCrossEnvHook)
-
 _grantleeEnvHook() {
     if providesGrantleeRuntime "$1"; then
-        propagatedNativeBuildInputs+=" $1"
-        if [ -z "$crossConfig" ]; then
+        propagatedBuildInputs+=" $1"
         propagatedUserEnvPkgs+=" $1"
-        fi
     fi
 }
-envHooks+=(_grantleeEnvHook)
+addEnvHooks "$hostOffset" _grantleeEnvHook
diff --git a/pkgs/development/libraries/grib-api/default.nix b/pkgs/development/libraries/grib-api/default.nix
index f091fedeb2d..3abea7d2d8c 100644
--- a/pkgs/development/libraries/grib-api/default.nix
+++ b/pkgs/development/libraries/grib-api/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec{
   name = "grib-api-${version}";
-  version = "1.19.0";
+  version = "1.24.0";
 
   src = fetchurl {
     url = "https://software.ecmwf.int/wiki/download/attachments/3473437/grib_api-${version}-Source.tar.gz";
-    sha256 = "07cj9mw5bb249lxx1m9nmfdqb8b2a8cm7s6x62cdwca3sp16dv6a";
+    sha256 = "1kbvyzaghbn1bqn97sslskmb6k3ki1dnr0g5abk5sb40n0y483bb";
   };
 
   preConfigure = ''
diff --git a/pkgs/development/libraries/grpc/default.nix b/pkgs/development/libraries/grpc/default.nix
new file mode 100644
index 00000000000..4e6fe783dc2
--- /dev/null
+++ b/pkgs/development/libraries/grpc/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, cmake, zlib, c-ares, pkgconfig, openssl, protobuf, gflags }:
+
+stdenv.mkDerivation rec
+  { name = "grpc-1.8.3";
+    src = fetchurl
+      { url = "https://github.com/grpc/grpc/archive/v1.8.3.tar.gz";
+        sha256 = "14ichjllvhkbv8sjh9j5njnagpqw2sl12n41ga90jnj7qvfwwjy1";
+      };
+    nativeBuildInputs = [ cmake pkgconfig ];
+    buildInputs = [ zlib c-ares c-ares.cmake-config openssl protobuf gflags ];
+    cmakeFlags =
+      [ "-DgRPC_ZLIB_PROVIDER=package"
+        "-DgRPC_CARES_PROVIDER=package"
+        "-DgRPC_SSL_PROVIDER=package"
+        "-DgRPC_PROTOBUF_PROVIDER=package"
+        "-DgRPC_GFLAGS_PROVIDER=package"
+      ];
+    enableParallelBuilds = true;
+  }
diff --git a/pkgs/development/libraries/gstreamer/bad/default.nix b/pkgs/development/libraries/gstreamer/bad/default.nix
index 2e0e711ce71..c033140d8dc 100644
--- a/pkgs/development/libraries/gstreamer/bad/default.nix
+++ b/pkgs/development/libraries/gstreamer/bad/default.nix
@@ -15,9 +15,15 @@ assert gtkSupport -> gtk3 != null;
 
 let
   inherit (stdenv.lib) optional optionalString;
+
+  # OpenJPEG version is hardcoded in package source
+  openJpegVersion = with stdenv;
+    lib.concatStringsSep "." (lib.lists.take 2
+      (lib.splitString "." (lib.getVersion openjpeg)));
+
 in
 stdenv.mkDerivation rec {
-  name = "gst-plugins-bad-1.12.2";
+  name = "gst-plugins-bad-1.12.3";
 
   meta = with stdenv.lib; {
     description = "Gstreamer Bad Plugins";
@@ -32,9 +38,13 @@ stdenv.mkDerivation rec {
     platforms   = platforms.linux;
   };
 
+  patchPhase = ''
+    sed -i 's/openjpeg-2.2/openjpeg-${openJpegVersion}/' ext/openjpeg/*
+  '';
+
   src = fetchurl {
     url = "${meta.homepage}/src/gst-plugins-bad/${name}.tar.xz";
-    sha256 = "0dwyq03g2m0p16dwx8q5qvjn5x9ia72h21sf87mp97gmwkfpwb4w";
+    sha256 = "1v5z3i5ha20gmbb3r9dwsaaspv5fm1jfzlzwlzqx1gjj31v5kl1n";
   };
 
   outputs = [ "out" "dev" ];
@@ -60,4 +70,6 @@ stdenv.mkDerivation rec {
     ++ optional (!stdenv.isDarwin) wildmidi;
 
   LDFLAGS = optionalString stdenv.isDarwin "-lintl";
+
+  enableParallelBuilding = true;
 }
diff --git a/pkgs/development/libraries/gstreamer/base/default.nix b/pkgs/development/libraries/gstreamer/base/default.nix
index 2ff42917964..2cd0c14c1f3 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.12.2";
+  name = "gst-plugins-base-1.12.3";
 
   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 = "0x86a7aph0y6gyq178plvwvbbyhkfb3hf0gadx9sk5z1mzixqrsh";
+    sha256 = "19ffwdch7m777ragmwpy6prqmfb742ym1n3ki40s0zyki627plyk";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/gstreamer/core/default.nix b/pkgs/development/libraries/gstreamer/core/default.nix
index 67521e40daf..ee9438d3c29 100644
--- a/pkgs/development/libraries/gstreamer/core/default.nix
+++ b/pkgs/development/libraries/gstreamer/core/default.nix
@@ -1,9 +1,10 @@
 { stdenv, fetchurl, pkgconfig, perl, bison, flex, python, gobjectIntrospection
 , glib, makeWrapper
+, darwin
 }:
 
 stdenv.mkDerivation rec {
-  name = "gstreamer-1.12.2";
+  name = "gstreamer-1.12.3";
 
   meta = {
     description = "Open source multimedia framework";
@@ -15,7 +16,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "${meta.homepage}/src/gstreamer/${name}.tar.xz";
-    sha256 = "1fllz7n58lavyy4nh64xc7izd4ffhl12a2ff0yg4z67al8wkzplz";
+    sha256 = "0vi1g8rmmsnd630ds3jwv2iph46ll8y07fzf04mz15q88j9g926k";
   };
 
   outputs = [ "out" "dev" ];
@@ -24,6 +25,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     pkgconfig perl bison flex python gobjectIntrospection makeWrapper
   ];
+  buildInputs = stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.CoreServices;
 
   propagatedBuildInputs = [ glib ];
 
diff --git a/pkgs/development/libraries/gstreamer/core/setup-hook.sh b/pkgs/development/libraries/gstreamer/core/setup-hook.sh
index 3dd7812ece6..b8c741af578 100644
--- a/pkgs/development/libraries/gstreamer/core/setup-hook.sh
+++ b/pkgs/development/libraries/gstreamer/core/setup-hook.sh
@@ -5,5 +5,5 @@ addGstreamer1LibPath () {
     fi
 }
 
-envHooks+=(addGstreamer1LibPath)
+addEnvHooks "$hostOffset" addGstreamer1LibPath
 
diff --git a/pkgs/development/libraries/gstreamer/ges/default.nix b/pkgs/development/libraries/gstreamer/ges/default.nix
index e206f317d4b..c38ab12ec96 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.12.2";
+  name = "gstreamer-editing-services-1.12.3";
 
   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 = "0bi0f487949k9xnl1r6ngysgaibmmswwgdqcrchg0dixnnbm9isr";
+    sha256 = "0xjz8r0wbzc0kwi9q8akv7w71ii1n2y2dmb0q2p5k4h78382ybh3";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/gstreamer/good/default.nix b/pkgs/development/libraries/gstreamer/good/default.nix
index 1c7f7951e91..e4e4f3b394d 100644
--- a/pkgs/development/libraries/gstreamer/good/default.nix
+++ b/pkgs/development/libraries/gstreamer/good/default.nix
@@ -11,7 +11,7 @@ let
   inherit (stdenv.lib) optionals optionalString;
 in
 stdenv.mkDerivation rec {
-  name = "gst-plugins-good-1.12.2";
+  name = "gst-plugins-good-1.12.3";
 
   meta = with stdenv.lib; {
     description = "Gstreamer Good Plugins";
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "${meta.homepage}/src/gst-plugins-good/${name}.tar.xz";
-    sha256 = "15pfw54fsh9s9xwrnbap4z4njwgqdfvq52k562d2hc5b11rfx4am";
+    sha256 = "00sznj1sl97fqpn6j8ngps04clvxp8h8yhw6lvszx4b855wz9rqk";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/gstreamer/gstreamermm/default.nix b/pkgs/development/libraries/gstreamer/gstreamermm/default.nix
index f6138fafaef..bee80cb24ec 100644
--- a/pkgs/development/libraries/gstreamer/gstreamermm/default.nix
+++ b/pkgs/development/libraries/gstreamer/gstreamermm/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, pkgconfig, file, glibmm, gst_all_1 }:
 
 let
-  ver_maj = "1.8";
+  ver_maj = "1.10";
   ver_min = "0";
 in
 stdenv.mkDerivation rec {
@@ -9,16 +9,9 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url    = "mirror://gnome/sources/gstreamermm/${ver_maj}/${name}.tar.xz";
-    sha256 = "0i4sk6ns4dyi4szk45bkm4kvl57l52lgm15p2wg2rhx2gr2w3qry";
+    sha256 = "0q4dx9sncqbwgpzma0zvj6zssc279yl80pn8irb95qypyyggwn5y";
   };
 
-  patches = [
-    (fetchurl {
-      url = https://bug783628.bugzilla-attachments.gnome.org/attachment.cgi?id=354765;
-      sha256 = "082510a934bl05mz4cyakp8mfmd97cdj7vdrbvyqc4g58dcskvz0";
-    })
-  ];
-
   outputs = [ "out" "dev" ];
 
   nativeBuildInputs = [ pkgconfig file ];
@@ -31,8 +24,8 @@ stdenv.mkDerivation rec {
     description = "C++ interface for GStreamer";
     homepage = https://gstreamer.freedesktop.org/bindings/cplusplus.html;
     license = licenses.lgpl21Plus;
-    maintainers = with maintainers; [ romildo ];
     platforms = platforms.unix;
+    maintainers = with maintainers; [ romildo ];
   };
 
 }
diff --git a/pkgs/development/libraries/gstreamer/legacy/gst-plugins-bad/default.nix b/pkgs/development/libraries/gstreamer/legacy/gst-plugins-bad/default.nix
index bdb1b6c7bb7..77465645d23 100644
--- a/pkgs/development/libraries/gstreamer/legacy/gst-plugins-bad/default.nix
+++ b/pkgs/development/libraries/gstreamer/legacy/gst-plugins-bad/default.nix
@@ -12,6 +12,12 @@ stdenv.mkDerivation rec {
     sha256 = "148lw51dm6pgw8vc6v0fpvm7p233wr11nspdzmvq7bjp2cd7vbhf";
   };
 
+  postInstall = ''
+    # Fixes CVE-2016-9447
+    # Does not actually impact NSF playback
+    rm -v $out/lib/gstreamer-0.10/libgstnsf.so
+  '';
+
   buildInputs =
     [ pkgconfig glib gstreamer gst-plugins-base libdvdnav libdvdread orc ];
 
diff --git a/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh b/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh
index e89aeda5bc1..65ce2611251 100644
--- a/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh
+++ b/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh
@@ -5,4 +5,4 @@ addGstreamerLibPath () {
     fi
 }
 
-envHooks+=(addGstreamerLibPath)
+addEnvHooks "$hostOffset" addGstreamerLibPath
diff --git a/pkgs/development/libraries/gstreamer/libav/default.nix b/pkgs/development/libraries/gstreamer/libav/default.nix
index 7c0a05f8202..9969c5e604f 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.12.2";
+  name = "gst-libav-1.12.3";
 
   meta = {
     homepage = https://gstreamer.freedesktop.org;
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "${meta.homepage}/src/gst-libav/${name}.tar.xz";
-    sha256 = "1crdahkjm23byg1awcrjkmgfbalfpvvac7h7whm6b2r1pfwkbdsv";
+    sha256 = "0l4nc6ikdx49l7bdrk3bd9p3pzry8a328r22zg48gyzpnv5ghph1";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/gstreamer/ugly/default.nix b/pkgs/development/libraries/gstreamer/ugly/default.nix
index 610f10075a8..3aa8eb886d7 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.12.2";
+  name = "gst-plugins-ugly-1.12.3";
 
   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 = "0rplyp1qk359c97ig9i2vc1v34g92khd8dslwfipva1ypwmr9hqw";
+    sha256 = "0lh00rg26iy5lr5al23lxsyncjqkgzph1bzkrgp8x9sfr62ab378";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/gstreamer/vaapi/default.nix b/pkgs/development/libraries/gstreamer/vaapi/default.nix
index becd4cf0d92..2033c07d952 100644
--- a/pkgs/development/libraries/gstreamer/vaapi/default.nix
+++ b/pkgs/development/libraries/gstreamer/vaapi/default.nix
@@ -5,11 +5,11 @@
 
 stdenv.mkDerivation rec {
   name = "gst-vaapi-${version}";
-  version = "1.12.2";
+  version = "1.12.4";
 
   src = fetchurl {
     url = "${meta.homepage}/src/gstreamer-vaapi/gstreamer-vaapi-${version}.tar.xz";
-    sha256 = "0fhncs27hcdcnb9a4prkxlyvr883hnzsx148zzk7lg2b8zh19ir3";
+    sha256 = "1jg9nvc8000yi2bcl3wn2yh2hwl7yvlwldj6778w8c0z5qj7fb8w";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/gstreamer/validate/default.nix b/pkgs/development/libraries/gstreamer/validate/default.nix
index 9704ca1d743..47eeb3d3284 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.12.2";
+  name = "gst-validate-1.12.3";
 
   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 = "1pgycs35bwmp4aicyxwyzlfy1i5l2rzmh2a8ivhgy21azp8jaykb";
+    sha256 = "17j812pkzgbyn9ys3b305yl5mrf9nbm8whwj4iqdskr742fr8fai";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/gtdialog/default.nix b/pkgs/development/libraries/gtdialog/default.nix
index d6f745d399d..36da2fb72aa 100644
--- a/pkgs/development/libraries/gtdialog/default.nix
+++ b/pkgs/development/libraries/gtdialog/default.nix
@@ -3,11 +3,11 @@ let
   s = # Generated upstream information
   rec {
     baseName="gtdialog";
-    version="1.3";
+    version="1.4";
     name="${baseName}-${version}";
-    hash="0y7sln877940bpj0s38cs5s97xg8csnaihh18lmnchf7c2kkbxpq";
-    url="http://foicica.com/gtdialog/download/gtdialog_1.3.zip";
-    sha256="0y7sln877940bpj0s38cs5s97xg8csnaihh18lmnchf7c2kkbxpq";
+    hash="1lhsaz56s8m838fi6vnfcd2r6djymvy3n2pbqhii88hraapq3rfk";
+    url="http://foicica.com/gtdialog/download/gtdialog_1.4.zip";
+    sha256="1lhsaz56s8m838fi6vnfcd2r6djymvy3n2pbqhii88hraapq3rfk";
   };
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [
diff --git a/pkgs/development/libraries/gtk+/2.x.nix b/pkgs/development/libraries/gtk+/2.x.nix
index 45222b7d7fc..169fd119d51 100644
--- a/pkgs/development/libraries/gtk+/2.x.nix
+++ b/pkgs/development/libraries/gtk+/2.x.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, gettext, glib, atk, pango, cairo, perl, xorg
-, gdk_pixbuf, libintlOrEmpty, xlibsWrapper
+, gdk_pixbuf, libintlOrEmpty, xlibsWrapper, gobjectIntrospection
 , xineramaSupport ? stdenv.isLinux
 , cupsSupport ? true, cups ? null
 , gdktarget ? "x11"
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
 
   setupHook = ./setup-hook.sh;
 
-  nativeBuildInputs = [ setupHook perl pkgconfig gettext ];
+  nativeBuildInputs = [ setupHook perl pkgconfig gettext gobjectIntrospection ];
 
   patches = [ ./2.0-immodules.cache.patch ./gtk2-theme-paths.patch ];
 
diff --git a/pkgs/development/libraries/gtk+/3.x.nix b/pkgs/development/libraries/gtk+/3.x.nix
index 1d0930d8d03..4c377c73571 100644
--- a/pkgs/development/libraries/gtk+/3.x.nix
+++ b/pkgs/development/libraries/gtk+/3.x.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchurl, pkgconfig, gettext, perl
+{ stdenv, fetchurl, fetchpatch, pkgconfig, gettext, perl
 , expat, glib, cairo, pango, gdk_pixbuf, atk, at_spi2_atk, gobjectIntrospection
 , xorg, epoxy, json_glib, libxkbcommon, gmp
 , waylandSupport ? stdenv.isLinux, wayland, wayland-protocols
 , xineramaSupport ? stdenv.isLinux
 , cupsSupport ? stdenv.isLinux, cups ? null
-, darwin
+, darwin, gnome3
 }:
 
 assert cupsSupport -> cups != null;
@@ -13,7 +13,7 @@ with stdenv.lib;
 
 let
   ver_maj = "3.22";
-  ver_min = "24";
+  ver_min = "26";
   version = "${ver_maj}.${ver_min}";
 in
 stdenv.mkDerivation rec {
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/gtk+/${ver_maj}/gtk+-${version}.tar.xz";
-    sha256 = "cbb16e4cfc928ab8f5f22f7290616f95f6ebc8c97cc724a2007b07ced833592b";
+    sha256 = "61eef0d320e541976e2dfe445729f12b5ade53050ee9de6184235cb60cd4b967";
   };
 
   outputs = [ "out" "dev" ];
@@ -29,11 +29,18 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig gettext gobjectIntrospection perl ];
 
-  patches = [ ./3.0-immodules.cache.patch ];
+  patches = [
+    ./3.0-immodules.cache.patch
+    (fetchpatch {
+      name = "Xft-setting-fallback-compute-DPI-properly.patch";
+      url = "https://bug757142.bugzilla-attachments.gnome.org/attachment.cgi?id=344123";
+      sha256 = "0g6fhqcv8spfy3mfmxpyji93k8d4p4q4fz1v9a1c1cgcwkz41d7p";
+    })
+  ];
 
   buildInputs = [ libxkbcommon epoxy json_glib ];
   propagatedBuildInputs = with xorg; with stdenv.lib;
-    [ expat glib cairo pango gdk_pixbuf atk at_spi2_atk
+    [ expat glib cairo pango gdk_pixbuf atk at_spi2_atk gnome3.gsettings_desktop_schemas
       libXrandr libXrender libXcomposite libXi libXcursor libSM libICE ]
     ++ optionals waylandSupport [ wayland wayland-protocols ]
     ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ AppKit Cocoa ])
diff --git a/pkgs/development/libraries/gtkd/default.nix b/pkgs/development/libraries/gtkd/default.nix
index ffbab3fce42..5a4cf75048f 100644
--- a/pkgs/development/libraries/gtkd/default.nix
+++ b/pkgs/development/libraries/gtkd/default.nix
@@ -92,7 +92,7 @@ stdenv.mkDerivation rec {
   meta = with stdenv.lib; {
     description = "D binding and OO wrapper for GTK+";
     homepage = https://gtkd.org;
-    licence = licenses.lgpl3Plus;
+    license = licenses.lgpl3Plus;
     platforms = platforms.linux ++ platforms.darwin;
   };
 }
diff --git a/pkgs/development/libraries/libgumbo/default.nix b/pkgs/development/libraries/gumbo/default.nix
index 210a66e654a..17ca323a5fe 100644
--- a/pkgs/development/libraries/libgumbo/default.nix
+++ b/pkgs/development/libraries/gumbo/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchFromGitHub, autoconf, automake, libtool }:
 
 stdenv.mkDerivation rec {
-  name = "libgumbo-${version}";
+  name = "gumbo-${version}";
   version = "0.10.1";
 
   src = fetchFromGitHub {
diff --git a/pkgs/development/libraries/gupnp-av/default.nix b/pkgs/development/libraries/gupnp-av/default.nix
index 789fdcd9c2a..9b61f4b648e 100644
--- a/pkgs/development/libraries/gupnp-av/default.nix
+++ b/pkgs/development/libraries/gupnp-av/default.nix
@@ -3,11 +3,11 @@
 stdenv.mkDerivation rec {
   name = "gupnp-av-${version}";
   majorVersion = "0.12";
-  version = "${majorVersion}.7";
+  version = "${majorVersion}.10";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gupnp-av/${majorVersion}/${name}.tar.xz";
-    sha256 = "35e775bc4f7801d65dcb710905a6b8420ce751a239b5651e6d830615dc906ea8";
+    sha256 = "0nmq6wlbfsssanv3jgv2z0nhfkv8vzfr3gq5qa8svryvvn2fyf40";
   };
   
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/gupnp-dlna/default.nix b/pkgs/development/libraries/gupnp-dlna/default.nix
new file mode 100644
index 00000000000..642e10ea541
--- /dev/null
+++ b/pkgs/development/libraries/gupnp-dlna/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, pkgconfig,  gobjectIntrospection, gupnp, gst_plugins_base }:
+
+stdenv.mkDerivation rec {
+  name = "gupnp-dlna-${version}";
+  majorVersion = "0.10";
+  version = "${majorVersion}.5";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gupnp-dlna/${majorVersion}/${name}.tar.xz";
+    sha256 = "0spzd2saax7w776p5laixdam6d7smyynr9qszhbmq7f14y13cghj";
+  };
+
+  nativeBuildInputs = [ pkgconfig gobjectIntrospection ];
+  buildInputs = [ gupnp gst_plugins_base ];
+
+  meta = {
+    homepage = https://wiki.gnome.org/Projects/GUPnP/;
+    description = "Library to ease DLNA-related bits for applications using GUPnP";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/gupnp/default.nix b/pkgs/development/libraries/gupnp/default.nix
index afd5ee591c6..963b93ef691 100644
--- a/pkgs/development/libraries/gupnp/default.nix
+++ b/pkgs/development/libraries/gupnp/default.nix
@@ -2,12 +2,12 @@
  
 stdenv.mkDerivation rec {
   name = "gupnp-${version}";
-  majorVersion = "0.20";
-  version = "${majorVersion}.14";
+  majorVersion = "1.0";
+  version = "${majorVersion}.2";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gupnp/${majorVersion}/gupnp-${version}.tar.xz";
-    sha256 = "77ffb940ba77c4a6426d09d41004c75d92652dcbde86c84ac1c847dbd9ad59bd";
+    sha256 = "043nqxlj030a3wvd6x4c9z8fjarjjjsl2pjarl0nn70ig6kzswsi";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/gvfs/default.nix b/pkgs/development/libraries/gvfs/default.nix
index 78f507ca146..15e7e736e0c 100644
--- a/pkgs/development/libraries/gvfs/default.nix
+++ b/pkgs/development/libraries/gvfs/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, pkgconfig, intltool, libtool
 , glib, dbus, udev, libgudev, udisks2, libgcrypt, libcap, polkit
 , libgphoto2, avahi, libarchive, fuse, libcdio, file, bzip2, lzma
-, libxml2, libxslt, docbook_xsl, samba, libmtp
+, libxml2, libxslt, docbook_xsl, docbook_xml_dtd_42, samba, libmtp
 , gnomeSupport ? false, gnome, makeWrapper }:
 
 let
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     pkgconfig intltool libtool file makeWrapper
-    libxml2 libxslt docbook_xsl
+    libxml2 libxslt docbook_xsl docbook_xml_dtd_42
   ];
 
   buildInputs =
diff --git a/pkgs/development/libraries/harfbuzz/default.nix b/pkgs/development/libraries/harfbuzz/default.nix
index f5756d1f570..2c38387eb83 100644
--- a/pkgs/development/libraries/harfbuzz/default.nix
+++ b/pkgs/development/libraries/harfbuzz/default.nix
@@ -5,7 +5,7 @@
 }:
 
 let
-  version = "1.5.1";
+  version = "1.7.1";
   inherit (stdenv.lib) optional optionals optionalString;
 in
 
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-${version}.tar.bz2";
-    sha256 = "56838dfdad2729b8866763c82d623354d138a4d99d9ffb710c7d377b5cfc7c51";
+    sha256 = "9645a6e83313b690602017f18d4eb2adf81f2e54c6fc4471e19331304965154e";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/hwloc/default.nix b/pkgs/development/libraries/hwloc/default.nix
index e1acacc328c..4d6af866990 100644
--- a/pkgs/development/libraries/hwloc/default.nix
+++ b/pkgs/development/libraries/hwloc/default.nix
@@ -1,16 +1,24 @@
-{ stdenv, fetchurl, pkgconfig, cairo, expat, ncurses, libX11
-, pciutils, numactl }:
+{ stdenv, fetchurl, pkgconfig, expat, ncurses, pciutils, numactl
+, cairo, libX11
+, x11Support ? (!stdenv.isCygwin)
+}:
 
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
-  name = "hwloc-1.11.6";
+  name = "hwloc-1.11.8";
 
   src = fetchurl {
     url = "http://www.open-mpi.org/software/hwloc/v1.11/downloads/${name}.tar.bz2";
-    sha256 = "1yl7dm2qplwmnidd712zy12qfvxk28k8ccs694n42ybwdjwzg1bn";
+    sha256 = "0karxv4r1r8sa7ki5aamlxdvyvz0bvzq4gdhq0yi5nc4a0k11vzc";
   };
 
+  hardeningDisable = [ "format" ];
+
+  configureFlags = [
+    "--localstatedir=/var"
+  ];
+
   # XXX: libX11 is not directly needed, but needed as a propagated dep of Cairo.
   nativeBuildInputs = [ pkgconfig ];
 
@@ -18,7 +26,7 @@ stdenv.mkDerivation rec {
   # derivation and set optional dependencies to `null'.
   buildInputs = stdenv.lib.filter (x: x != null)
    ([ expat ncurses ]
-     ++  (optionals (!stdenv.isCygwin) [ cairo libX11 ])
+     ++  (optionals x11Support [ cairo libX11 ])
      ++  (optionals stdenv.isLinux [ numactl ]));
 
   propagatedBuildInputs =
@@ -37,7 +45,7 @@ stdenv.mkDerivation rec {
              test -d "$numalibdir"
          fi
 
-         sed -i "$out/lib/libhwloc.la" \
+         sed -i "$lib/lib/libhwloc.la" \
              -e "s|-lnuma|-L$numalibdir -lnuma|g"
       '';
 
@@ -45,6 +53,8 @@ stdenv.mkDerivation rec {
   # fail on some build machines.
   doCheck = false;
 
+  outputs = [ "out" "lib" "dev" "doc" "man" ];
+
   meta = {
     description = "Portable abstraction of hierarchical architectures for high-performance computing";
     longDescription = ''
diff --git a/pkgs/development/libraries/ignition-math/default.nix b/pkgs/development/libraries/ignition-math/default.nix
index 66b21b6fae6..867ce024d2f 100644
--- a/pkgs/development/libraries/ignition-math/default.nix
+++ b/pkgs/development/libraries/ignition-math/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with stdenv.lib; {
-    homepage = http://ignitionrobotics.org/libraries/math;
+    homepage = https://ignitionrobotics.org/libraries/math;
     description = "Math library by Ingition Robotics, created for the Gazebo project";
     license = licenses.asl20;
     maintainers = with maintainers; [ pxc ];
diff --git a/pkgs/development/libraries/ilmbase/default.nix b/pkgs/development/libraries/ilmbase/default.nix
index 21c2c46105e..956a8667be5 100644
--- a/pkgs/development/libraries/ilmbase/default.nix
+++ b/pkgs/development/libraries/ilmbase/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, automake, autoconf, libtool, which }:
 
 stdenv.mkDerivation rec {
-  name = "ilmbase-2.2.0";
+  name = "ilmbase-2.2.1";
 
   src = fetchurl {
     url = "http://download.savannah.nongnu.org/releases/openexr/${name}.tar.gz";
-    sha256 = "1izddjwbh1grs8080vmaix72z469qy29wrvkphgmqmcm0sv1by7c";
+    sha256 = "17k0hq19wplx9s029kjrq6c51x2ryrfmaavcappkd0g67gk0dhna";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/ip2location-c/default.nix b/pkgs/development/libraries/ip2location-c/default.nix
index 109510df79b..82a4ec33755 100644
--- a/pkgs/development/libraries/ip2location-c/default.nix
+++ b/pkgs/development/libraries/ip2location-c/default.nix
@@ -28,6 +28,5 @@ stdenv.mkDerivation rec {
     homepage = http://www.ip2location.com/developers/c-7;
     license = with licenses; [ gpl3Plus lgpl3Plus ];
     platforms = platforms.linux;
-    maintainers = with maintainers; [ nckx ];
   };
 }
diff --git a/pkgs/development/libraries/java/lombok/default.nix b/pkgs/development/libraries/java/lombok/default.nix
index 05ad908b3c3..df9b3f96c87 100644
--- a/pkgs/development/libraries/java/lombok/default.nix
+++ b/pkgs/development/libraries/java/lombok/default.nix
@@ -1,13 +1,18 @@
-{stdenv, fetchurl}:
+{ stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "lombok-1.16.8";
+  name = "lombok-1.16.20";
+
   src = fetchurl {
     url = "https://projectlombok.org/downloads/${name}.jar";
-    sha256 = "0s7ak6gx1h04da2rdhvc0fk896cwqm2m7g3chqcjpsrkgfdv4cpy";
+    sha256 = "0v8fq4qlpjh4b87xx35m32y2xpnj4d05xflrgghia6mar8c8n5y5";
   };
-  phases = [ "installPhase" ];
-  installPhase = "mkdir -p $out/share/java; cp $src $out/share/java/lombok.jar";
+
+  buildCommand = ''
+    mkdir -p $out/share/java
+    cp $src $out/share/java/lombok.jar
+  '';
+
   meta = {
     description = "A library that can write a lot of boilerplate for your Java project";
     platforms = stdenv.lib.platforms.all;
diff --git a/pkgs/development/libraries/java/saxon/default.nix b/pkgs/development/libraries/java/saxon/default.nix
index fcd884f0a41..ca9aa8fc36e 100644
--- a/pkgs/development/libraries/java/saxon/default.nix
+++ b/pkgs/development/libraries/java/saxon/default.nix
@@ -1,22 +1,83 @@
-{ stdenv, fetchurl, unzip }:
-
-stdenv.mkDerivation {
-  name = "saxon-6.5.3";
-  builder = ./unzip-builder.sh;
-  src = fetchurl {
-    url = mirror://sourceforge/saxon/saxon6_5_3.zip;
-    sha256 = "0l5y3y2z4wqgh80f26dwwxwncs8v3nkz3nidv14z024lmk730vs3";
+{ stdenv, fetchurl, unzip, jre }:
+
+let
+  common = { pname, version, src, description
+           , prog ? null, jar ? null, license ? stdenv.lib.licenses.mpl20 }:
+    stdenv.mkDerivation {
+      name = "${pname}-${version}";
+      inherit pname version src;
+
+      nativeBuildInputs = [ unzip ];
+
+      buildCommand = let
+        prog' = if prog == null then pname else prog;
+        jar' = if jar == null then pname else jar;
+      in ''
+        unzip $src -d $out
+        mkdir -p $out/bin $out/share $out/share/java
+        cp -s "$out"/*.jar "$out/share/java/"  # */
+        rm -rf $out/notices
+        mv $out/doc $out/share
+        cat > $out/bin/${prog'} <<EOF
+        #! $shell
+        export JAVA_HOME=${jre}
+        exec ${jre}/bin/java -jar $out/${jar'}.jar "\$@"
+        EOF
+        chmod a+x $out/bin/${prog'}
+      '';
+
+      meta = with stdenv.lib; {
+        inherit description license;
+        homepage = http://saxon.sourceforge.net/;
+        maintainers = with maintainers; [ rvl ];
+        platforms = platforms.all;
+      };
+    };
+
+in {
+  saxon = common {
+    pname = "saxon";
+    version = "6.5.3";
+    src = fetchurl {
+      url = mirror://sourceforge/saxon/saxon6_5_3.zip;
+      sha256 = "0l5y3y2z4wqgh80f26dwwxwncs8v3nkz3nidv14z024lmk730vs3";
+    };
+    description = "XSLT 1.0 processor";
+    # http://saxon.sourceforge.net/saxon6.5.3/conditions.html
+    license = stdenv.lib.licenses.mpl10;
   };
 
-  nativeBuildInputs = [ unzip ];
+  saxonb_8_8 = common {
+    pname = "saxonb";
+    version = "8.8";
+    jar = "saxon8";
+    src = fetchurl {
+      url = mirror://sourceforge/saxon/saxonb8-8j.zip;
+      sha256 = "15bzrfyd2f1045rsp9dp4znyhmizh1pm97q8ji2bc0b43q23xsb8";
+    };
+    description = "Complete and conformant processor of XSLT 2.0, XQuery 1.0, and XPath 2.0";
+  };
 
-  # still leaving in root as well, in case someone is relying on that
-  preFixup = ''
-    mkdir -p "$out/share/java"
-    cp -s "$out"/*.jar "$out/share/java/"
-  '';
+  saxonb_9_1 = common {
+    pname = "saxonb";
+    version = "9.1.0.8";
+    jar = "saxon9";
+    src = fetchurl {
+      url = mirror://sourceforge/saxon/Saxon-B/9.1.0.8/saxonb9-1-0-8j.zip;
+      sha256 = "1d39jdnwr3v3pzswm81zry6yikqlqy9dp2l2wmpqdiw00r5drg4j";
+    };
+    description = "Complete and conformant processor of XSLT 2.0, XQuery 1.0, and XPath 2.0";
+  };
 
-  meta = {
-    platforms = stdenv.lib.platforms.unix;
+  saxon-he = common {
+    pname = "saxon-he";
+    version = "9.8.0.6";
+    prog = "saxon-he";
+    jar = "saxon9he";
+    src = fetchurl {
+      url = mirror://sourceforge/saxon/Saxon-HE/9.8/SaxonHE9-8-0-6J.zip;
+      sha256 = "03r4djm298rxz8q7jph63h9niglrl3rifxskq1b3bclx5rgxi2lk";
+    };
+    description = "Processor for XSLT 3.0, XPath 2.0 and 3.1, and XQuery 3.1";
   };
 }
diff --git a/pkgs/development/libraries/java/saxon/default8.nix b/pkgs/development/libraries/java/saxon/default8.nix
deleted file mode 100644
index 7728737977c..00000000000
--- a/pkgs/development/libraries/java/saxon/default8.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{stdenv, fetchurl, unzip, jre}:
-
-stdenv.mkDerivation {
-  name = "saxonb-8.8";
-  src = fetchurl {
-    url = mirror://sourceforge/saxon/saxonb8-8j.zip;
-    sha256 = "15bzrfyd2f1045rsp9dp4znyhmizh1pm97q8ji2bc0b43q23xsb8";
-  };
-
-  buildInputs = [unzip];
-
-  buildCommand = "
-    unzip $src -d $out
-    mkdir -p $out/bin
-    cat > $out/bin/saxon8 <<EOF
-#! $shell
-export JAVA_HOME=${jre}
-exec ${jre}/bin/java -jar $out/saxon8.jar \"\\$@\"
-EOF
-    chmod a+x $out/bin/saxon8
-  ";
-
-  meta = {
-    platforms = stdenv.lib.platforms.unix;
-  };
-}
diff --git a/pkgs/development/libraries/java/saxon/unzip-builder.sh b/pkgs/development/libraries/java/saxon/unzip-builder.sh
deleted file mode 100755
index 8ac35568f0b..00000000000
--- a/pkgs/development/libraries/java/saxon/unzip-builder.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-source $stdenv/setup
-
-unzip $src -d $out
-
-fixupPhase
-
diff --git a/pkgs/development/libraries/jbig2dec/default.nix b/pkgs/development/libraries/jbig2dec/default.nix
index 45df4876be1..8731bd8e736 100644
--- a/pkgs/development/libraries/jbig2dec/default.nix
+++ b/pkgs/development/libraries/jbig2dec/default.nix
@@ -1,21 +1,13 @@
 { stdenv, fetchurl, fetchpatch }:
 
 stdenv.mkDerivation rec {
-  name = "jbig2dec-0.13";
+  name = "jbig2dec-0.14";
 
   src = fetchurl {
     url = "http://downloads.ghostscript.com/public/jbig2dec/${name}.tar.gz";
-    sha256 = "04akiwab8iy5iy34razcvh9mcja9wy737civ3sbjxk4j143s1b2s";
+    sha256 = "0k01hp0q4275fj4rbr1gy64svfraw5w7wvwl08yjhvsnpb1rid11";
   };
 
-  patches =
-    [ (fetchpatch {
-        url = "http://git.ghostscript.com/?p=jbig2dec.git;a=patch;h=e698d5c11d27212aa1098bc5b1673a3378563092";
-        sha256 = "1fc8xm1z98xj2zkcl0zj7dpjjsbz3vn61b59jnkhcyzy3iiczv7f";
-        name = "CVE-2016-9601.patch";
-      })
-    ];
-
   meta = {
     homepage = https://www.ghostscript.com/jbig2dec.html;
     description = "Decoder implementation of the JBIG2 image compression format";
diff --git a/pkgs/development/libraries/jemalloc/default.nix b/pkgs/development/libraries/jemalloc/default.nix
index 8c8c181409d..0882431cc15 100644
--- a/pkgs/development/libraries/jemalloc/default.nix
+++ b/pkgs/development/libraries/jemalloc/default.nix
@@ -1,21 +1,30 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, fetchpatch }:
 
 stdenv.mkDerivation rec {
   name = "jemalloc-${version}";
-  version = "4.5.0";
+  version = "5.0.1";
 
   src = fetchurl {
     url = "https://github.com/jemalloc/jemalloc/releases/download/${version}/${name}.tar.bz2";
-    sha256 = "9409d85664b4f135b77518b0b118c549009dc10f6cba14557d170476611f6780";
+    sha256 = "4814781d395b0ef093b21a08e8e6e0bd3dab8762f9935bbfb71679b0dea7c3e9";
   };
 
   # By default, jemalloc puts a je_ prefix onto all its symbols on OSX, which
   # then stops downstream builds (mariadb in particular) from detecting it. This
   # option should remove the prefix and give us a working jemalloc.
-  configureFlags = stdenv.lib.optional stdenv.isDarwin "--with-jemalloc-prefix=";
-
+  configureFlags = stdenv.lib.optional stdenv.isDarwin "--with-jemalloc-prefix="
+                   # jemalloc is unable to correctly detect transparent hugepage support on
+                   # ARM (https://github.com/jemalloc/jemalloc/issues/526), and the default
+                   # kernel ARMv6/7 kernel does not enable it, so we explicitly disable support
+                   ++ stdenv.lib.optional stdenv.isArm "--disable-thp";
   doCheck = true;
 
+  patches = stdenv.lib.optional stdenv.isAarch64 (fetchpatch {
+    url = "https://patch-diff.githubusercontent.com/raw/jemalloc/jemalloc/pull/1035.patch";
+    sha256 = "02y0q3dp253bipxv4r954nqipbjbj92p6ww9bx5bk3d8pa81wkqq";
+  });
+
+  enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
     homepage = http://jemalloc.net;
diff --git a/pkgs/development/libraries/json-glib/default.nix b/pkgs/development/libraries/json-glib/default.nix
index 2414931e76a..73fa1f311bf 100644
--- a/pkgs/development/libraries/json-glib/default.nix
+++ b/pkgs/development/libraries/json-glib/default.nix
@@ -27,8 +27,6 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  checkPhase = "meson test";
-
   meta = with stdenv.lib; {
     homepage = http://live.gnome.org/JsonGlib;
     description = "A library providing (de)serialization support for the JavaScript Object Notation (JSON) format";
diff --git a/pkgs/development/libraries/kdb/default.nix b/pkgs/development/libraries/kdb/default.nix
index 399d5914c2d..e85190cdfce 100644
--- a/pkgs/development/libraries/kdb/default.nix
+++ b/pkgs/development/libraries/kdb/default.nix
@@ -1,7 +1,7 @@
 {
   mkDerivation, lib, fetchurl,
   extra-cmake-modules,
-  qtbase, qttranslations, kcoreaddons, python2, sqlite, postgresql, libmysql
+  qtbase, qttranslations, kcoreaddons, python2, sqlite, postgresql, mysql
 }:
 
 mkDerivation rec {
@@ -16,7 +16,7 @@ mkDerivation rec {
 
   nativeBuildInputs = [ extra-cmake-modules ];
 
-  buildInputs = [ qttranslations kcoreaddons python2 sqlite postgresql libmysql ];
+  buildInputs = [ qttranslations kcoreaddons python2 sqlite postgresql mysql.connector-c ];
 
   propagatedBuildInputs = [ qtbase ];
 
diff --git a/pkgs/development/libraries/kde-frameworks/default.nix b/pkgs/development/libraries/kde-frameworks/default.nix
index 2bf10737ab0..08eebfd83ae 100644
--- a/pkgs/development/libraries/kde-frameworks/default.nix
+++ b/pkgs/development/libraries/kde-frameworks/default.nix
@@ -56,11 +56,7 @@ let
                     # Propagate $dev so that this setup hook is propagated
                     # But only if there is a separate $dev output
                     if [ "$outputDev" != out ]; then
-                        if [ -n "$crossConfig" ]; then
-                          propagatedBuildInputs="$propagatedBuildInputs @dev@"
-                        else
-                          propagatedNativeBuildInputs="$propagatedNativeBuildInputs @dev@"
-                        fi
+                        propagatedBuildInputs="$propagatedBuildInputs @dev@"
                     fi
                 fi
               '';
diff --git a/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh b/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh
index c1b1e21852c..88091e78a0c 100644
--- a/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh
+++ b/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh
@@ -2,7 +2,7 @@ _ecmEnvHook() {
     addToSearchPath XDG_DATA_DIRS "$1/share"
     addToSearchPath XDG_CONFIG_DIRS "$1/etc/xdg"
 }
-envHooks+=(_ecmEnvHook)
+addEnvHooks "$targetOffset" _ecmEnvHook
 
 _ecmPreConfigureHook() {
     # Because we need to use absolute paths here, we must set *all* the paths.
diff --git a/pkgs/development/libraries/kde-frameworks/fetch.sh b/pkgs/development/libraries/kde-frameworks/fetch.sh
index 0e0372ad7ac..119abbe9f53 100644
--- a/pkgs/development/libraries/kde-frameworks/fetch.sh
+++ b/pkgs/development/libraries/kde-frameworks/fetch.sh
@@ -1 +1 @@
-WGET_ARGS=( https://download.kde.org/stable/frameworks/5.39/ -A '*.tar.xz' )
+WGET_ARGS=( https://download.kde.org/stable/frameworks/5.42/ -A '*.tar.xz' )
diff --git a/pkgs/development/libraries/kde-frameworks/kcmutils/kcmutils-follow-symlinks.patch b/pkgs/development/libraries/kde-frameworks/kcmutils/kcmutils-follow-symlinks.patch
index 5e1007b7fc0..cc041b9aa3b 100644
--- a/pkgs/development/libraries/kde-frameworks/kcmutils/kcmutils-follow-symlinks.patch
+++ b/pkgs/development/libraries/kde-frameworks/kcmutils/kcmutils-follow-symlinks.patch
@@ -1,13 +1,13 @@
-Index: kcmutils-5.33.0/src/kpluginselector.cpp
-===================================================================
---- kcmutils-5.33.0.orig/src/kpluginselector.cpp
-+++ kcmutils-5.33.0/src/kpluginselector.cpp
-@@ -305,7 +305,7 @@ void KPluginSelector::addPlugins(const Q
+diff --git a/src/kpluginselector.cpp b/src/kpluginselector.cpp
+index 137c865..097ab75 100644
+--- a/src/kpluginselector.cpp
++++ b/src/kpluginselector.cpp
+@@ -303,7 +303,7 @@ void KPluginSelector::addPlugins(const QString &componentName,
      QStringList desktopFileNames;
      const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, componentName + QStringLiteral("/kpartplugins"), QStandardPaths::LocateDirectory);
-     Q_FOREACH (const QString &dir, dirs) {
+     for (const QString &dir : dirs) {
 -        QDirIterator it(dir, QStringList() << QStringLiteral("*.desktop"), QDir::NoFilter, QDirIterator::Subdirectories);
-+      QDirIterator it(dir, QStringList() << QStringLiteral("*.desktop"), QDir::NoFilter, QDirIterator::Subdirectories | QDirIterator::FollowSymlinks);
++        QDirIterator it(dir, QStringList() << QStringLiteral("*.desktop"), QDir::NoFilter, QDirIterator::Subdirectories | QDirIterator::FollowSymlinks);
          while (it.hasNext()) {
              desktopFileNames.append(it.next());
          }
diff --git a/pkgs/development/libraries/kde-frameworks/kconfigwidgets/0001-qdiriterator-follow-symlinks.patch b/pkgs/development/libraries/kde-frameworks/kconfigwidgets/0001-qdiriterator-follow-symlinks.patch
index 7a6c0ee9053..3b6ea27d41e 100644
--- a/pkgs/development/libraries/kde-frameworks/kconfigwidgets/0001-qdiriterator-follow-symlinks.patch
+++ b/pkgs/development/libraries/kde-frameworks/kconfigwidgets/0001-qdiriterator-follow-symlinks.patch
@@ -1,25 +1,18 @@
-From 4f84780893d505b2d62a14633dd983baa8ec6e28 Mon Sep 17 00:00:00 2001
-From: Thomas Tuegel <ttuegel@gmail.com>
-Date: Wed, 14 Oct 2015 06:47:01 -0500
-Subject: [PATCH] qdiriterator follow symlinks
-
----
- src/khelpclient.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
 diff --git a/src/khelpclient.cpp b/src/khelpclient.cpp
-index 53a331e..80fbb01 100644
+index fbbc0fa..cb78741 100644
 --- a/src/khelpclient.cpp
 +++ b/src/khelpclient.cpp
 @@ -48,7 +48,7 @@ void KHelpClient::invokeHelp(const QString &anchor, const QString &_appname)
      QString docPath;
      const QStringList desktopDirs = QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation);
-     Q_FOREACH (const QString &dir, desktopDirs) {
+     for (const QString &dir : desktopDirs) {
 -        QDirIterator it(dir, QStringList() << appname + QLatin1String(".desktop"), QDir::NoFilter, QDirIterator::Subdirectories);
 +        QDirIterator it(dir, QStringList() << appname + QLatin1String(".desktop"), QDir::NoFilter, QDirIterator::Subdirectories | QDirIterator::FollowSymlinks);
          while (it.hasNext()) {
              const QString desktopPath(it.next());
              KDesktopFile desktopFile(desktopPath);
--- 
-2.5.2
-
+@@ -75,4 +75,3 @@ void KHelpClient::invokeHelp(const QString &anchor, const QString &_appname)
+     // launch khelpcenter, or a browser for URIs not handled by khelpcenter
+     QDesktopServices::openUrl(url);
+ }
+-
diff --git a/pkgs/development/libraries/kde-frameworks/kdoctools/default.nix b/pkgs/development/libraries/kde-frameworks/kdoctools/default.nix
index 661e89e3078..0a600fe8d05 100644
--- a/pkgs/development/libraries/kde-frameworks/kdoctools/default.nix
+++ b/pkgs/development/libraries/kde-frameworks/kdoctools/default.nix
@@ -8,10 +8,18 @@
 mkDerivation {
   name = "kdoctools";
   meta = { maintainers = [ lib.maintainers.ttuegel ]; };
-  nativeBuildInputs = [ extra-cmake-modules ];
-  propagatedNativeBuildInputs = [ perl perlPackages.URI ];
+  nativeBuildInputs = [
+    extra-cmake-modules
+    # The build system insists on having native Perl.
+    perl perlPackages.URI
+  ];
+  propagatedBuildInputs = [
+    # kdoctools at runtime actually needs Perl for the platform kdoctools is
+    # running on, not necessarily native perl.
+    perl perlPackages.URI
+    qtbase
+  ];
   buildInputs = [ karchive ki18n ];
-  propagatedBuildInputs = [ qtbase ];
   outputs = [ "out" "dev" ];
   patches = [ ./kdoctools-no-find-docbook-xml.patch ];
   cmakeFlags = [
diff --git a/pkgs/development/libraries/kde-frameworks/kdoctools/setup-hook.sh b/pkgs/development/libraries/kde-frameworks/kdoctools/setup-hook.sh
index 5cfffbd622d..2928d9b34db 100644
--- a/pkgs/development/libraries/kde-frameworks/kdoctools/setup-hook.sh
+++ b/pkgs/development/libraries/kde-frameworks/kdoctools/setup-hook.sh
@@ -2,4 +2,4 @@ addXdgData() {
     addToSearchPath XDG_DATA_DIRS "$1/share"
 }
 
-envHooks+=(addXdgData)
+addEnvHooks "$targetOffset" addXdgData
diff --git a/pkgs/development/libraries/kde-frameworks/kimageformats.nix b/pkgs/development/libraries/kde-frameworks/kimageformats.nix
index 26a8637bafc..29748a5f7f4 100644
--- a/pkgs/development/libraries/kde-frameworks/kimageformats.nix
+++ b/pkgs/development/libraries/kde-frameworks/kimageformats.nix
@@ -12,5 +12,5 @@ mkDerivation {
   nativeBuildInputs = [ extra-cmake-modules ];
   buildInputs = [ karchive openexr qtbase ];
   outputs = [ "out" ]; # plugins only
-  NIX_CFLAGS_COMPILE = "-I${getDev ilmbase}/include/OpenEXR";
+  CXXFLAGS = "-I${getDev ilmbase}/include/OpenEXR";
 }
diff --git a/pkgs/development/libraries/kde-frameworks/kinit/default.nix b/pkgs/development/libraries/kde-frameworks/kinit/default.nix
index 1036ea27745..538078fd745 100644
--- a/pkgs/development/libraries/kde-frameworks/kinit/default.nix
+++ b/pkgs/development/libraries/kde-frameworks/kinit/default.nix
@@ -14,10 +14,10 @@ mkDerivation {
     kconfig kcrash ki18n kio kservice kwindowsystem
   ];
   patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
-  NIX_CFLAGS_COMPILE = [
-    ''-DNIXPKGS_KF5_KIOCORE="${getLib kio}/lib/libKF5KIOCore.so.5"''
-    ''-DNIXPKGS_KF5_PARTS="${getLib kparts}/lib/libKF5Parts.so.5"''
-    ''-DNIXPKGS_KF5_PLASMA="${getLib plasma-framework}/lib/libKF5Plasma.so.5"''
+  CXXFLAGS = [
+    ''-DNIXPKGS_KF5_KIOCORE=\"${getLib kio}/lib/libKF5KIOCore.so.5\"''
+    ''-DNIXPKGS_KF5_PARTS=\"${getLib kparts}/lib/libKF5Parts.so.5\"''
+    ''-DNIXPKGS_KF5_PLASMA=\"${getLib plasma-framework}/lib/libKF5Plasma.so.5\"''
   ];
   postFixup = ''
     moveToOutput "lib/libexec/kf5/start_kdeinit" "$bin"
diff --git a/pkgs/development/libraries/kde-frameworks/ktexteditor.nix b/pkgs/development/libraries/kde-frameworks/ktexteditor.nix
index 7fc11b1505c..3efd4cf4e2a 100644
--- a/pkgs/development/libraries/kde-frameworks/ktexteditor.nix
+++ b/pkgs/development/libraries/kde-frameworks/ktexteditor.nix
@@ -14,9 +14,4 @@ mkDerivation {
     qtxmlpatterns sonnet syntax-highlighting qtquickcontrols
   ];
   propagatedBuildInputs = [ kparts ];
-  patches = [ (fetchpatch {
-    url = "https://cgit.kde.org/ktexteditor.git/patch/?id=aeebeadb5f5955995c17de56cf83ba7166a132dd";
-    sha256 = "10a61w1qyw3czffl06xgccgd3yycz7s0hpg2vj0a24v05jhqiigf";
-    name = "ktextedtor_fix_indenters.patch";
-  })];
 }
diff --git a/pkgs/development/libraries/kde-frameworks/plasma-framework.nix b/pkgs/development/libraries/kde-frameworks/plasma-framework.nix
index d3a81b50bf1..a2a90e448d4 100644
--- a/pkgs/development/libraries/kde-frameworks/plasma-framework.nix
+++ b/pkgs/development/libraries/kde-frameworks/plasma-framework.nix
@@ -4,7 +4,7 @@
   kactivities, karchive, kconfig, kconfigwidgets, kcoreaddons, kdbusaddons,
   kdeclarative, kglobalaccel, kguiaddons, ki18n, kiconthemes, kio,
   knotifications, kpackage, kservice, kwayland, kwindowsystem, kxmlgui,
-  qtbase, qtdeclarative, qtscript, qtx11extras,
+  qtbase, qtdeclarative, qtscript, qtx11extras, kirigami2
 }:
 
 mkDerivation {
@@ -14,7 +14,7 @@ mkDerivation {
   buildInputs = [
     kactivities karchive kconfig kconfigwidgets kcoreaddons kdbusaddons
     kdeclarative kglobalaccel kguiaddons ki18n kiconthemes kio knotifications
-    kwayland kwindowsystem kxmlgui qtdeclarative qtscript qtx11extras
+    kwayland kwindowsystem kxmlgui qtdeclarative qtscript qtx11extras kirigami2
   ];
   propagatedBuildInputs = [ kpackage kservice qtbase ];
 }
diff --git a/pkgs/development/libraries/kde-frameworks/srcs.nix b/pkgs/development/libraries/kde-frameworks/srcs.nix
index 3a8ed594655..f8d4bcf5c8f 100644
--- a/pkgs/development/libraries/kde-frameworks/srcs.nix
+++ b/pkgs/development/libraries/kde-frameworks/srcs.nix
@@ -3,611 +3,611 @@
 
 {
   attica = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/attica-5.39.0.tar.xz";
-      sha256 = "15972518n4g65k391imkcsjikfsfhx8livdm6n0whag0aiz55haf";
-      name = "attica-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/attica-5.42.0.tar.xz";
+      sha256 = "0icjsk5sbri6nwybb2301wc6ysc1h4p35rxqp0adifyksq8akyxd";
+      name = "attica-5.42.0.tar.xz";
     };
   };
   baloo = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/baloo-5.39.0.tar.xz";
-      sha256 = "06y8mv7v9y7syz04x0zicdm628k6za3p366xrzwafc43m159wyms";
-      name = "baloo-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/baloo-5.42.0.tar.xz";
+      sha256 = "18yknkcls1ypsp8n5l254bhlffiq4as5w1wgcjzhnf49cacys8nl";
+      name = "baloo-5.42.0.tar.xz";
     };
   };
   bluez-qt = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/bluez-qt-5.39.0.tar.xz";
-      sha256 = "0j0072q0zc9hdpjbkqciqv18pwpdij74qrjph7whh66csjkr5ad1";
-      name = "bluez-qt-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/bluez-qt-5.42.0.tar.xz";
+      sha256 = "0pbb0nn70hbsnp9q8jvqr3s85gh4bnnh1mp8xfkia2hp4c63ws9f";
+      name = "bluez-qt-5.42.0.tar.xz";
     };
   };
   breeze-icons = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/breeze-icons-5.39.0.tar.xz";
-      sha256 = "132bpgma1lqhrly48zz1f8jyg5z5pvnn1wnqxz6psvqhipw7fh5x";
-      name = "breeze-icons-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/breeze-icons-5.42.0.tar.xz";
+      sha256 = "0mrj0b022yfy669qqby09k4ij6aqyky23gpnjcp85df9saq0x44r";
+      name = "breeze-icons-5.42.0.tar.xz";
     };
   };
   extra-cmake-modules = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/extra-cmake-modules-5.39.0.tar.xz";
-      sha256 = "1ldwzx2bzlzw7r31w8zy08j4cn9q7d1kszc5jb22zhfqpvbkc1dq";
-      name = "extra-cmake-modules-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/extra-cmake-modules-5.42.0.tar.xz";
+      sha256 = "1ml6s3ssr5izm3vnzlg5gn2nkcbz5l5nmapvyr4ml7n0089b43a3";
+      name = "extra-cmake-modules-5.42.0.tar.xz";
     };
   };
   frameworkintegration = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/frameworkintegration-5.39.0.tar.xz";
-      sha256 = "136s8chyiac30czicqgkrc4abgm7c8b2ppnqwv9ngxpx7nsjgd2h";
-      name = "frameworkintegration-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/frameworkintegration-5.42.0.tar.xz";
+      sha256 = "17fyny3c5chv7bipr19ayfjmd1amp2nms4ba5r7mwjp97xkphry7";
+      name = "frameworkintegration-5.42.0.tar.xz";
     };
   };
   kactivities = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kactivities-5.39.0.tar.xz";
-      sha256 = "0nkc1p7n6yvybcib6aqmnz08hwn3ryj1f9wbkiimgs0svr00sslq";
-      name = "kactivities-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kactivities-5.42.0.tar.xz";
+      sha256 = "0z0ac426npq99s1b8yzrqkjjjc34nbxlpw8pw388yj7fa41hw21r";
+      name = "kactivities-5.42.0.tar.xz";
     };
   };
   kactivities-stats = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kactivities-stats-5.39.0.tar.xz";
-      sha256 = "18ghfqggwf38rmb1lkbv8ggxx71cp6ba3882kp5ccb7wwih51qcy";
-      name = "kactivities-stats-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kactivities-stats-5.42.0.tar.xz";
+      sha256 = "0si70hayf4brr83jzdjdsfvp8nc1sb7vdk0q532liafhf8hw9mq8";
+      name = "kactivities-stats-5.42.0.tar.xz";
     };
   };
   kapidox = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kapidox-5.39.0.tar.xz";
-      sha256 = "12nmsa1cg5amyawfxywlg8qsl01idi0jacrd8jzmvdj5m8sisw6n";
-      name = "kapidox-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kapidox-5.42.0.tar.xz";
+      sha256 = "0izyd66p5403gl09l7irzy97mb9b14n4zyjrwap800zjlpwh41pz";
+      name = "kapidox-5.42.0.tar.xz";
     };
   };
   karchive = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/karchive-5.39.0.tar.xz";
-      sha256 = "0rb8vr6lg8vx4f07swvlsyrxy4gj21aqfffk0cvhlsdz94j1phrw";
-      name = "karchive-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/karchive-5.42.0.tar.xz";
+      sha256 = "1vq2ngdxmdl6hzjwdcrv66ban8v9s5jiqwy1mgdqv4ak14l31qbi";
+      name = "karchive-5.42.0.tar.xz";
     };
   };
   kauth = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kauth-5.39.0.tar.xz";
-      sha256 = "08bjxvv22y199skx4l9m8az165wz7inqqx7s8b7p5cjms4bvi15i";
-      name = "kauth-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kauth-5.42.0.tar.xz";
+      sha256 = "04kqb2hhr9lkpkxiaqlnyk0kmk6p89z5fgp5i5g83hsi8maz7swi";
+      name = "kauth-5.42.0.tar.xz";
     };
   };
   kbookmarks = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kbookmarks-5.39.0.tar.xz";
-      sha256 = "1xfabyc7hxmi1p0wqld0va5pl6bfwh50px4mvpxbnjdna6anw6z5";
-      name = "kbookmarks-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kbookmarks-5.42.0.tar.xz";
+      sha256 = "08q413mr5ib04gwnqznvm9vkkfmnh16rgf6rqdvclnci9w7ml5x2";
+      name = "kbookmarks-5.42.0.tar.xz";
     };
   };
   kcmutils = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kcmutils-5.39.0.tar.xz";
-      sha256 = "1cz4haj83j59szl16r0mfh4zx93szrwkmb9mq2r21v46c8k5ldw0";
-      name = "kcmutils-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kcmutils-5.42.0.tar.xz";
+      sha256 = "1q67b0m6w3xvm22kq8b0b0rib1jzf25gf6dz7h286987zfbbs5n7";
+      name = "kcmutils-5.42.0.tar.xz";
     };
   };
   kcodecs = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kcodecs-5.39.0.tar.xz";
-      sha256 = "1q0l88nfbxgdy5lpm5xbcs749n9jyxhq7xsgqpf9c8irc7c1gw7f";
-      name = "kcodecs-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kcodecs-5.42.0.tar.xz";
+      sha256 = "0b19z432r9dnyjknvwffhcmrg969yhydjvy4qrkrf22026f4smwc";
+      name = "kcodecs-5.42.0.tar.xz";
     };
   };
   kcompletion = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kcompletion-5.39.0.tar.xz";
-      sha256 = "09jdc4pn7yjb7nagic38xiqdpv9fy4f2f4c1a5ynbli7x1r6l7ms";
-      name = "kcompletion-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kcompletion-5.42.0.tar.xz";
+      sha256 = "0yqci2v0dk5v1mz4n3gca599a7mpihy563zc6sl8hsa30ld8li0f";
+      name = "kcompletion-5.42.0.tar.xz";
     };
   };
   kconfig = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kconfig-5.39.0.tar.xz";
-      sha256 = "011i48f07470igqqcz4hychbw0q85p0bh5dykpla4zwdldllsl1w";
-      name = "kconfig-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kconfig-5.42.0.tar.xz";
+      sha256 = "08gg0d20c09j7hyxm8ydpzk2yf30c87g9ag7a9nfykrmi6cqirdq";
+      name = "kconfig-5.42.0.tar.xz";
     };
   };
   kconfigwidgets = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kconfigwidgets-5.39.0.tar.xz";
-      sha256 = "1i6cniqsmn9sds8nj7bcsnbmlkq9m1yjwvr45mhal9rkhaas4xzw";
-      name = "kconfigwidgets-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kconfigwidgets-5.42.0.tar.xz";
+      sha256 = "191zm24q2n001b65hcnfh2639k4iqhxwdmgdw29php3n2648xq4z";
+      name = "kconfigwidgets-5.42.0.tar.xz";
     };
   };
   kcoreaddons = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kcoreaddons-5.39.0.tar.xz";
-      sha256 = "0qskv44siykyn8iiq99llibw3bk499ry7r3i8abx4ljjl717cvlz";
-      name = "kcoreaddons-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kcoreaddons-5.42.0.tar.xz";
+      sha256 = "17qv7r6z72mm9a0hyx5dgk90ikhhgm41bkvnq2hjal0py2lsnrs9";
+      name = "kcoreaddons-5.42.0.tar.xz";
     };
   };
   kcrash = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kcrash-5.39.0.tar.xz";
-      sha256 = "1fv32l50h9rlc5s9iplyljcsrscivgdy2baghq7hbcs58xrjf1ws";
-      name = "kcrash-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kcrash-5.42.0.tar.xz";
+      sha256 = "049y0xdyw37y0qid3d3plj8szfys5gw98j7lhcakiini8mn5cins";
+      name = "kcrash-5.42.0.tar.xz";
     };
   };
   kdbusaddons = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kdbusaddons-5.39.0.tar.xz";
-      sha256 = "0hp85995n3193dvvdv48hv59b66dzd9p4iwnx2dmj797lghpnir3";
-      name = "kdbusaddons-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kdbusaddons-5.42.0.tar.xz";
+      sha256 = "1613pc3r70jnzvpwm1xjdbdsmcpx28jwvcs2qq9swlywr5qr9hbd";
+      name = "kdbusaddons-5.42.0.tar.xz";
     };
   };
   kdeclarative = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kdeclarative-5.39.0.tar.xz";
-      sha256 = "1l8wnyfz6qjqmcpdzavsb6m1r3ay1b2r186myymsyknr80yr2d7p";
-      name = "kdeclarative-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kdeclarative-5.42.0.tar.xz";
+      sha256 = "1w604jy6vg2247vggz0ivl7wy2h5iapkz2z86mah3aw99f7dqa22";
+      name = "kdeclarative-5.42.0.tar.xz";
     };
   };
   kded = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kded-5.39.0.tar.xz";
-      sha256 = "0jv4ghl2gzfdkhk1in3vx39kigvpprvcb9xlzc5506mpfjc38ga5";
-      name = "kded-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kded-5.42.0.tar.xz";
+      sha256 = "0w25dl4pnvby28gz0yvij32vi9n3p8si4nm4x45j7zsi2cb70j4l";
+      name = "kded-5.42.0.tar.xz";
     };
   };
   kdelibs4support = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/portingAids/kdelibs4support-5.39.0.tar.xz";
-      sha256 = "03xjzhdvs497sk9bpz79crxlzwff198ivj4n5f0mwmnqc0100dfp";
-      name = "kdelibs4support-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/portingAids/kdelibs4support-5.42.0.tar.xz";
+      sha256 = "0aiig8akn6bdxrqdl96xjjy2pxw8hhfrsalbkkzyhh06j794snfb";
+      name = "kdelibs4support-5.42.0.tar.xz";
     };
   };
   kdesignerplugin = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kdesignerplugin-5.39.0.tar.xz";
-      sha256 = "1b7rn66wsyn9aipgvfmn2pq18g0zdjxb469126dj18fahg2k777f";
-      name = "kdesignerplugin-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kdesignerplugin-5.42.0.tar.xz";
+      sha256 = "004axa1fkj954d65x7l9z8dmw04209hb368rwa4gjzb8naf13ib6";
+      name = "kdesignerplugin-5.42.0.tar.xz";
     };
   };
   kdesu = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kdesu-5.39.0.tar.xz";
-      sha256 = "03avzhs6a0p3cjv4kk9vavf6f64ffgs3pzhbdkfr76fh58h1v6wx";
-      name = "kdesu-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kdesu-5.42.0.tar.xz";
+      sha256 = "0402p1h7wifk6sppg7ca9w0zfjllbhc1j5gsxj7ypq55g94np7hx";
+      name = "kdesu-5.42.0.tar.xz";
     };
   };
   kdewebkit = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kdewebkit-5.39.0.tar.xz";
-      sha256 = "05f0l3zw8cnvyavwwijwy5jx8dairhdbvg6ynpn7r5l10vawcf6x";
-      name = "kdewebkit-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kdewebkit-5.42.0.tar.xz";
+      sha256 = "1csd4p996im7ygxc5rfdkzgdpngjgzyqakj12rl9rnfbsd15i8kb";
+      name = "kdewebkit-5.42.0.tar.xz";
     };
   };
   kdnssd = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kdnssd-5.39.0.tar.xz";
-      sha256 = "1c8d1wwr0hkdkgnq4k7lgkqwm1pj676i09l1kas256rzz6dcyl75";
-      name = "kdnssd-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kdnssd-5.42.0.tar.xz";
+      sha256 = "1k1rz62h3mafliik5n0k98dc56b5v2v6qyqj40696mcyc2d1yvll";
+      name = "kdnssd-5.42.0.tar.xz";
     };
   };
   kdoctools = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kdoctools-5.39.0.tar.xz";
-      sha256 = "17g4kf7mbjjxhii4nbhfpmhjs1q23mlh0d3fqyxxhm3pp02jg8ap";
-      name = "kdoctools-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kdoctools-5.42.0.tar.xz";
+      sha256 = "1bby3avdllch1mji0mxzcix8q5yir5a0i6wpjs5lwckv1glh6kmz";
+      name = "kdoctools-5.42.0.tar.xz";
     };
   };
   kemoticons = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kemoticons-5.39.0.tar.xz";
-      sha256 = "132gs69v43ms117ibdqmnhbyzzs5by76pfz7bd2zqwl4mq94hpgh";
-      name = "kemoticons-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kemoticons-5.42.0.tar.xz";
+      sha256 = "0f6an1bwxnga41a2b35b2pdcni4p0hh76k4jvanl3g046v07f2wr";
+      name = "kemoticons-5.42.0.tar.xz";
     };
   };
   kfilemetadata = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kfilemetadata-5.39.0.tar.xz";
-      sha256 = "1mcxphjpayyq7v16b6c3zhb6c9vn67495xywfb9y8ysma1cdpshg";
-      name = "kfilemetadata-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kfilemetadata-5.42.0.tar.xz";
+      sha256 = "03wk38q3sq354ykz9dwbgykn73ldf94ryx6hxvpr66bq3a59jmwz";
+      name = "kfilemetadata-5.42.0.tar.xz";
     };
   };
   kglobalaccel = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kglobalaccel-5.39.0.tar.xz";
-      sha256 = "0wcbnwfi98cx8f99a2mcz2kg7mggz3hipfxv9s8ks6c80865kar1";
-      name = "kglobalaccel-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kglobalaccel-5.42.0.tar.xz";
+      sha256 = "0nlza73i0qd79yhwhpnvgbh2xa9lvd1n2xg25p3bvfzwidcfdxg6";
+      name = "kglobalaccel-5.42.0.tar.xz";
     };
   };
   kguiaddons = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kguiaddons-5.39.0.tar.xz";
-      sha256 = "1az9i5bg7xd7kv7ajq8j8jab7zly683gyi90rmk54vfnn6igbq3f";
-      name = "kguiaddons-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kguiaddons-5.42.0.tar.xz";
+      sha256 = "193i8b4f13dkgp88m3pk9wzi0dhx7qmsnmpizxia3457gg016wn7";
+      name = "kguiaddons-5.42.0.tar.xz";
     };
   };
   khtml = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/portingAids/khtml-5.39.0.tar.xz";
-      sha256 = "097nbwv8ba48xmrga62j1irlkkc0l0f3971fp7225pzh1g3cg152";
-      name = "khtml-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/portingAids/khtml-5.42.0.tar.xz";
+      sha256 = "1bfslndxvad0zgzr22w2mz1xwavix9bh5qrrv8dpshlh043bwr3l";
+      name = "khtml-5.42.0.tar.xz";
     };
   };
   ki18n = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/ki18n-5.39.0.tar.xz";
-      sha256 = "1985qgihrch37b5gf7qw33bazahm3xb5v2nj43k6vdjxfg1clcay";
-      name = "ki18n-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/ki18n-5.42.0.tar.xz";
+      sha256 = "1rpriflb2a48j94zxgh63l6rzq4nlnlkvy89ns1vkdw42bnqrjx9";
+      name = "ki18n-5.42.0.tar.xz";
     };
   };
   kiconthemes = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kiconthemes-5.39.0.tar.xz";
-      sha256 = "1k4r263zz54497dgqaw9a74wqdklq4w353mc0g905k2g8arh7p9f";
-      name = "kiconthemes-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kiconthemes-5.42.0.tar.xz";
+      sha256 = "1nbxxpf8bv835xl35b17rk8s3zs110bh31078kqqh7dhvwzlxic7";
+      name = "kiconthemes-5.42.0.tar.xz";
     };
   };
   kidletime = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kidletime-5.39.0.tar.xz";
-      sha256 = "01h5pcr5kn11jby0zsz6igiwzf31hzip7h63dcsa8h67li4sibd8";
-      name = "kidletime-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kidletime-5.42.0.tar.xz";
+      sha256 = "019r41r28pcrcn1kwxsll53za705jkc9n23b6sr2lplgjk05bcxh";
+      name = "kidletime-5.42.0.tar.xz";
     };
   };
   kimageformats = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kimageformats-5.39.0.tar.xz";
-      sha256 = "1mnfdsxqnqdzhw3as77n1f1ddxpmab4slqlpwi4ih55xmgl85455";
-      name = "kimageformats-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kimageformats-5.42.0.tar.xz";
+      sha256 = "1k67yrmszx7azjzrg478rimbz991lghx4d6dmg22p6dknajd78a6";
+      name = "kimageformats-5.42.0.tar.xz";
     };
   };
   kinit = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kinit-5.39.0.tar.xz";
-      sha256 = "0a2wl1vhsbb2x1cjd3wz7j3bp9kz1pxfc6mml7gpnq70qgk8hsn2";
-      name = "kinit-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kinit-5.42.0.tar.xz";
+      sha256 = "05vpac41pw1n8y58l2z08vyknzv950x8dxxw66dnymm2v31w07ia";
+      name = "kinit-5.42.0.tar.xz";
     };
   };
   kio = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kio-5.39.0.tar.xz";
-      sha256 = "091g4dbnals6c5wrj3xh3ws29wszysmb9ksyvyqf3d1lp9dfmjwn";
-      name = "kio-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kio-5.42.0.tar.xz";
+      sha256 = "1526a89x11ank55dp3rfp7xd04w8x7prjg3y6i7n2q9nabwhw7gc";
+      name = "kio-5.42.0.tar.xz";
     };
   };
   kirigami2 = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kirigami2-5.39.0.tar.xz";
-      sha256 = "0spgylk4yjy74rs5d5b28qv72qz5ra9j3wfmk6vx2b6cvf1fw517";
-      name = "kirigami2-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kirigami2-5.42.0.tar.xz";
+      sha256 = "11gqn7amp0r9bgh8ldgisfc2lrkzkn5mq2a1madf24nvjbkvqnqv";
+      name = "kirigami2-5.42.0.tar.xz";
     };
   };
   kitemmodels = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kitemmodels-5.39.0.tar.xz";
-      sha256 = "1bn0k0ya2phix6fyv8ax800ahncrkdzikz0sa3xrw5bq3iz1x6k9";
-      name = "kitemmodels-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kitemmodels-5.42.0.tar.xz";
+      sha256 = "0mcdzdqwmvf9pwirsrnjbhrgqphnfmanbl9zij4qsmin8n866mhc";
+      name = "kitemmodels-5.42.0.tar.xz";
     };
   };
   kitemviews = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kitemviews-5.39.0.tar.xz";
-      sha256 = "0pl899d1lz1dymdbq70485a8332z9i3s38dxnxv3cdwbla3xlsfh";
-      name = "kitemviews-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kitemviews-5.42.0.tar.xz";
+      sha256 = "1j1q0b08f8mnfc3r2a7rplyb2nv9f0aq5a3fxskinvg70c6y248w";
+      name = "kitemviews-5.42.0.tar.xz";
     };
   };
   kjobwidgets = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kjobwidgets-5.39.0.tar.xz";
-      sha256 = "1z26555pkirdkfw8c9j1a863pqybklryfa30v3a59a0m9v2jdzfc";
-      name = "kjobwidgets-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kjobwidgets-5.42.0.tar.xz";
+      sha256 = "1m3csdl7wh18ywv5p0qpbjpixvflgjcq3yvk3vlvh0sxxlwcz8k4";
+      name = "kjobwidgets-5.42.0.tar.xz";
     };
   };
   kjs = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/portingAids/kjs-5.39.0.tar.xz";
-      sha256 = "0fkn308l6drj7pa94niqhcn2pqv7da7da5lq1nk8q6zlyg4nbcrn";
-      name = "kjs-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/portingAids/kjs-5.42.0.tar.xz";
+      sha256 = "1m26sb2qyrcgmpkw76k2yv5my2pkhld96vw6aaqm77q90faw734g";
+      name = "kjs-5.42.0.tar.xz";
     };
   };
   kjsembed = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/portingAids/kjsembed-5.39.0.tar.xz";
-      sha256 = "1i3qyxr409x82nqyck4qva63maxa2vvi07i0yxm6zqx5lvm9gkgb";
-      name = "kjsembed-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/portingAids/kjsembed-5.42.0.tar.xz";
+      sha256 = "10w4w4ncwr245bv1ii4sh154w91ghfz0l60k89j50lsydpcqcp3a";
+      name = "kjsembed-5.42.0.tar.xz";
     };
   };
   kmediaplayer = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/portingAids/kmediaplayer-5.39.0.tar.xz";
-      sha256 = "09ysw11br4k26bq6rvzcws2g565336p3gjkz4fxc8w2g3ma527p1";
-      name = "kmediaplayer-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/portingAids/kmediaplayer-5.42.0.tar.xz";
+      sha256 = "1k1pjc0cz36gs0pl2pxw8f9f82xkbqyy320nfyhan5waxbl1qd5n";
+      name = "kmediaplayer-5.42.0.tar.xz";
     };
   };
   knewstuff = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/knewstuff-5.39.0.tar.xz";
-      sha256 = "1amflv96ybd6dqkc1chmz6d5crrl4dcq07fwsalxzx9mgr0z499r";
-      name = "knewstuff-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/knewstuff-5.42.0.tar.xz";
+      sha256 = "0i2gmyp67xzf2m5wnv7v574q3gsp1yxfflv1jgl0wy57vchwn9g6";
+      name = "knewstuff-5.42.0.tar.xz";
     };
   };
   knotifications = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/knotifications-5.39.0.tar.xz";
-      sha256 = "0f38ca090p291d114fg3jz25lhwz7vad7s60ql4x3xwmdgaaw7dj";
-      name = "knotifications-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/knotifications-5.42.0.tar.xz";
+      sha256 = "0awmwypmd104vhaj2v9k83niflxj26d4mbl6mzfcj75lgka6kffc";
+      name = "knotifications-5.42.0.tar.xz";
     };
   };
   knotifyconfig = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/knotifyconfig-5.39.0.tar.xz";
-      sha256 = "09nk6sr6sp9a85lj4x9ac0ir4s5ac08835927b95d7m4ap2dbxrb";
-      name = "knotifyconfig-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/knotifyconfig-5.42.0.tar.xz";
+      sha256 = "1h07bjj71611v6912m5ajli6qszh9w925zqbk3vih8rn6pd2s3mc";
+      name = "knotifyconfig-5.42.0.tar.xz";
     };
   };
   kpackage = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kpackage-5.39.0.tar.xz";
-      sha256 = "1ibppkg9m77p0dcpfshcd891vlxcfgx6rk205gq6d5qxyqizygki";
-      name = "kpackage-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kpackage-5.42.0.tar.xz";
+      sha256 = "10amhh07x8d0jkyylb19cyzjs71k8dq1y8isfahqzb2kd43vijqa";
+      name = "kpackage-5.42.0.tar.xz";
     };
   };
   kparts = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kparts-5.39.0.tar.xz";
-      sha256 = "1r32jf2qbhqdjih9ff4n0ajd6s1cdncpq367mp5am31fz1jv3sr6";
-      name = "kparts-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kparts-5.42.0.tar.xz";
+      sha256 = "1mb5gp2ckmmrb4ym7cqvyl81wnp7cryk85gmizl7cnn69svlf40h";
+      name = "kparts-5.42.0.tar.xz";
     };
   };
   kpeople = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kpeople-5.39.0.tar.xz";
-      sha256 = "1s78dld3zlldhpk66s08v34zwi1k5ghivzbi7ab290sgrjc9afar";
-      name = "kpeople-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kpeople-5.42.0.tar.xz";
+      sha256 = "050km3rpx58acx2341si46lxc2hywa59m8rwd849c2dnsxw3w1hm";
+      name = "kpeople-5.42.0.tar.xz";
     };
   };
   kplotting = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kplotting-5.39.0.tar.xz";
-      sha256 = "1diy1f23n6pih0s91kv1bp4mnnypnjl3pmi1xqni1v2cfwy0mnba";
-      name = "kplotting-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kplotting-5.42.0.tar.xz";
+      sha256 = "109b9grshrwralyp8ilkbf1k0akaggygqh6wafqdf0ris0ps13l9";
+      name = "kplotting-5.42.0.tar.xz";
     };
   };
   kpty = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kpty-5.39.0.tar.xz";
-      sha256 = "02h6dg3w3k58d1ydzyz6mhd1y5gds3k64wdsb84fnpxvlw46dlhn";
-      name = "kpty-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kpty-5.42.0.tar.xz";
+      sha256 = "07s16zxs03ixy7yxy9fda83yqhcgqzx42gnvwjwkyc8q05njmma6";
+      name = "kpty-5.42.0.tar.xz";
     };
   };
   kross = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/portingAids/kross-5.39.0.tar.xz";
-      sha256 = "1gh9gicr7ba8y3c0r7qpw2fj651fbbrhsy8gps8yll71axhxqvfh";
-      name = "kross-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/portingAids/kross-5.42.0.tar.xz";
+      sha256 = "1aqqwby6jslimpvx42d4n6gjsjc8l82gmsq5ajpv9zkkk91dqfqi";
+      name = "kross-5.42.0.tar.xz";
     };
   };
   krunner = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/krunner-5.39.0.tar.xz";
-      sha256 = "0gxs9z8mlb3s615ccrgkwyxww4jly48d8fkay33zwjaanqhkhgfl";
-      name = "krunner-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/krunner-5.42.0.tar.xz";
+      sha256 = "0xh9kss67l09am1ilsr9zyx1yhlmaq3g9x60hw0sx7h7wrl6zsw6";
+      name = "krunner-5.42.0.tar.xz";
     };
   };
   kservice = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kservice-5.39.0.tar.xz";
-      sha256 = "0abz878yc8yir7iv5scn55d0g2nljnzhr9c81wa6ggjsw0h077hl";
-      name = "kservice-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kservice-5.42.0.tar.xz";
+      sha256 = "0z8zfpd00ndvkm1klp8l4mrcksshhyg280zgmg3gffz5rgh3gwri";
+      name = "kservice-5.42.0.tar.xz";
     };
   };
   ktexteditor = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/ktexteditor-5.39.0.tar.xz";
-      sha256 = "1bk5wlvzjmfv7g9ab77asn055jp647zj69mfx2z3lvxb69swdnf5";
-      name = "ktexteditor-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/ktexteditor-5.42.0.tar.xz";
+      sha256 = "020y3j6vm15sfpiwainr3qsx9i93j15mrvq523wmbmdj1z36yrh2";
+      name = "ktexteditor-5.42.0.tar.xz";
     };
   };
   ktextwidgets = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/ktextwidgets-5.39.0.tar.xz";
-      sha256 = "0p6h165y03ir7qdf50kc77iq9plgvx39c8pz9dalvscvx42d2jaq";
-      name = "ktextwidgets-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/ktextwidgets-5.42.0.tar.xz";
+      sha256 = "088azbv95ycwxmxxw4l63i2l14fmn8l473pb4djh2mvz1ypfqayk";
+      name = "ktextwidgets-5.42.0.tar.xz";
     };
   };
   kunitconversion = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kunitconversion-5.39.0.tar.xz";
-      sha256 = "04r1b2nc6vi56nfh6glhhd3d9v0ywxn2waibryjbszwrr39yhlzv";
-      name = "kunitconversion-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kunitconversion-5.42.0.tar.xz";
+      sha256 = "0219pna4l3vvhyf5acsc87n48jzdnws6kwyhaiy3hy1pzrilv32l";
+      name = "kunitconversion-5.42.0.tar.xz";
     };
   };
   kwallet = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kwallet-5.39.0.tar.xz";
-      sha256 = "1vlz9y3r1n6w7q9is60jsl9f7bm1djckdi9ibgzanwsp4k5ab0sz";
-      name = "kwallet-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kwallet-5.42.0.tar.xz";
+      sha256 = "1kv3v7593srfn0wd7qp4rhvb30rxp7d2qmlwi0n4nc9s6v59pabn";
+      name = "kwallet-5.42.0.tar.xz";
     };
   };
   kwayland = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kwayland-5.39.0.tar.xz";
-      sha256 = "0a9hi47nrsspkak88c9f6ind2i7q69zjmrgr5n7xsa4zxznwhx6x";
-      name = "kwayland-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kwayland-5.42.0.tar.xz";
+      sha256 = "0wr6ygppahxsx3dh71h2wmybv7z7iyqdv7wn80cxb0mp4zpyinh7";
+      name = "kwayland-5.42.0.tar.xz";
     };
   };
   kwidgetsaddons = {
-    version = "5.39.0";
+    version = "5.42.1";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kwidgetsaddons-5.39.0.tar.xz";
-      sha256 = "1d0d3ags15vr7ck031m6n5n3hw347siskzhb8rsgzghn6xnmbfdb";
-      name = "kwidgetsaddons-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kwidgetsaddons-5.42.1.tar.xz";
+      sha256 = "0h0vfrfl5zi01fpvmd825kazzlyawz3i66qrfkymdrnvqmfzcmlg";
+      name = "kwidgetsaddons-5.42.1.tar.xz";
     };
   };
   kwindowsystem = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kwindowsystem-5.39.0.tar.xz";
-      sha256 = "1dys70va4h00ixxgxv52wbg8wi3jgsqckaikjqr34fzrmjh1lxqp";
-      name = "kwindowsystem-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kwindowsystem-5.42.0.tar.xz";
+      sha256 = "15k6x0f93qxka3mz7qfzak2ibdd88q77pz6akil8s3g41zsg2dqv";
+      name = "kwindowsystem-5.42.0.tar.xz";
     };
   };
   kxmlgui = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kxmlgui-5.39.0.tar.xz";
-      sha256 = "0zwy11rh3yphl2346hmcahajxkgmrnfz1m8pd3vlnjs175dwz115";
-      name = "kxmlgui-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kxmlgui-5.42.0.tar.xz";
+      sha256 = "0kfxjx8wrhkys5bydnv84nqxc2jqvv92zb2l6zpi0km5ggmia5y0";
+      name = "kxmlgui-5.42.0.tar.xz";
     };
   };
   kxmlrpcclient = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/kxmlrpcclient-5.39.0.tar.xz";
-      sha256 = "1j4a1n3ydln62m98h5p5lxlg1i7k5vzxb4f9kxkvzhw5gfpy78zs";
-      name = "kxmlrpcclient-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/kxmlrpcclient-5.42.0.tar.xz";
+      sha256 = "0ciip27ilsfk9s3gslpbi06v8i6ipdbmcig2jf43z3amsxpq0ncn";
+      name = "kxmlrpcclient-5.42.0.tar.xz";
     };
   };
   modemmanager-qt = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/modemmanager-qt-5.39.0.tar.xz";
-      sha256 = "0gdsp1017yjcfbq2jny7jz5rv7y4cavps5pfvg7zmylx0v057zk7";
-      name = "modemmanager-qt-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/modemmanager-qt-5.42.0.tar.xz";
+      sha256 = "0q6qzn60z55h0gyc9xwdfaq45mjpk3zrr6d4qqjjfkqsr3866sfx";
+      name = "modemmanager-qt-5.42.0.tar.xz";
     };
   };
   networkmanager-qt = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/networkmanager-qt-5.39.0.tar.xz";
-      sha256 = "1jksv0zsdmkrid2f1m92fxw3gl6crcjaw43v5zra8h2m394iyr81";
-      name = "networkmanager-qt-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/networkmanager-qt-5.42.0.tar.xz";
+      sha256 = "03hhvx8d52mfgbhd4gn0vhsk9k1fv1pvq24ixxdgs2mw44v884xq";
+      name = "networkmanager-qt-5.42.0.tar.xz";
     };
   };
   oxygen-icons5 = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/oxygen-icons5-5.39.0.tar.xz";
-      sha256 = "1k1rns0fz5gvfnfwg60lrcw885cqmn814nzql9jvk07340w29s98";
-      name = "oxygen-icons5-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/oxygen-icons5-5.42.0.tar.xz";
+      sha256 = "0pnav9h0xmvbaamzpcyznjjv25slz8maszshx7sj7h07b5a23x46";
+      name = "oxygen-icons5-5.42.0.tar.xz";
     };
   };
   plasma-framework = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/plasma-framework-5.39.0.tar.xz";
-      sha256 = "1gaxk9mzwlyld09gqk29y3shvi6a1g1q3l849a9kl1hd07gr53x3";
-      name = "plasma-framework-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/plasma-framework-5.42.0.tar.xz";
+      sha256 = "079c8h0lmbkfr3srj5m8a40b50kyrxbgmy1n66329l8js9xrvaah";
+      name = "plasma-framework-5.42.0.tar.xz";
     };
   };
   prison = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/prison-5.39.0.tar.xz";
-      sha256 = "1b0ji341xcamrd19z54r2nkm8cglbr4qfxyxmqzn8yc6icfl61nv";
-      name = "prison-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/prison-5.42.0.tar.xz";
+      sha256 = "0bhg2fjdwsv7mk16jh1nc3miwggz1dl9l99l2f20xvi75hn7rryg";
+      name = "prison-5.42.0.tar.xz";
     };
   };
   qqc2-desktop-style = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/qqc2-desktop-style-5.39.0.tar.xz";
-      sha256 = "1q8ihhrnk2dh6bbmwkz822l5vv15y11qaj7gig1lf7xw5nr1i27v";
-      name = "qqc2-desktop-style-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/qqc2-desktop-style-5.42.0.tar.xz";
+      sha256 = "1arlfhcshfs11pgf87jzjgln1p711zlx0v0q014740mbzb9g5wnk";
+      name = "qqc2-desktop-style-5.42.0.tar.xz";
     };
   };
   solid = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/solid-5.39.0.tar.xz";
-      sha256 = "19bl7hzg1fya613vqhdxllh09csm6amrndnhfqnx90w4gb31p36r";
-      name = "solid-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/solid-5.42.0.tar.xz";
+      sha256 = "10lr8paaq6vaiqn833kzcdc3kkyv8j9fdchy7h8pvi9ajjjwq0lq";
+      name = "solid-5.42.0.tar.xz";
     };
   };
   sonnet = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/sonnet-5.39.0.tar.xz";
-      sha256 = "1b5bfjbpb6l3c9j9k42shhnz9lqqxk2g607qx9ni0n2pr7w2p7w1";
-      name = "sonnet-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/sonnet-5.42.0.tar.xz";
+      sha256 = "1r3amddmy0nm8klw0jzvb8bl1l9hkrx50d8j0zq2lbjy36h3yliw";
+      name = "sonnet-5.42.0.tar.xz";
     };
   };
   syntax-highlighting = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/syntax-highlighting-5.39.0.tar.xz";
-      sha256 = "0b8sdkh9dqmqk3x48d25v4qhrqph0mv76v47skhvls9jspw7kzdc";
-      name = "syntax-highlighting-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/syntax-highlighting-5.42.0.tar.xz";
+      sha256 = "1iwiym50859jki4x41rfdmbd14jiq5lr2hdg46pjkyw17njdjd60";
+      name = "syntax-highlighting-5.42.0.tar.xz";
     };
   };
   threadweaver = {
-    version = "5.39.0";
+    version = "5.42.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.39/threadweaver-5.39.0.tar.xz";
-      sha256 = "101bk8rzdysb3vi3vbbkh2s7sb1dhnsa8ncdvdsxqyyaya9ns4aw";
-      name = "threadweaver-5.39.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.42/threadweaver-5.42.0.tar.xz";
+      sha256 = "1isqlpnfxzxyz7mdm7yfrafgnx09mcndicdgdw3mi4r4misbrrbn";
+      name = "threadweaver-5.42.0.tar.xz";
     };
   };
 }
diff --git a/pkgs/development/libraries/kdiagram/default.nix b/pkgs/development/libraries/kdiagram/default.nix
index 853f02f566a..50f3e6a6c02 100644
--- a/pkgs/development/libraries/kdiagram/default.nix
+++ b/pkgs/development/libraries/kdiagram/default.nix
@@ -13,7 +13,7 @@ mkDerivation {
   nativeBuildInputs = [ extra-cmake-modules qttools ];
   propagatedBuildInputs = [ qtbase qtsvg ];
   meta = {
-    shortDescription = "Libraries for creating business diagrams";
+    description = "Libraries for creating business diagrams";
     license = lib.licenses.gpl2;
     platforms = qtbase.meta.platforms;
     maintainers = [ lib.maintainers.ttuegel ];
diff --git a/pkgs/development/libraries/kerberos/krb5.nix b/pkgs/development/libraries/kerberos/krb5.nix
index 1e64a4d6600..98073b7bbdc 100644
--- a/pkgs/development/libraries/kerberos/krb5.nix
+++ b/pkgs/development/libraries/kerberos/krb5.nix
@@ -19,10 +19,18 @@ stdenv.mkDerivation rec {
     sha256 = "0zn8s7anb10hw3nzwjz7vg10fgmmgvwnibn2zrn3nppjxn9f6f8n";
   };
 
+  outputs = [ "out" "dev" ];
+
   configureFlags = [ "--with-tcl=no" "--localstatedir=/var/lib"]
-    ++ optional stdenv.isFreeBSD ''WARN_CFLAGS=""'';
+    ++ optional stdenv.isFreeBSD ''WARN_CFLAGS=""''
+    ++ optionals (stdenv.buildPlatform != stdenv.hostPlatform)
+       [ "krb5_cv_attr_constructor_destructor=yes,yes"
+         "ac_cv_func_regcomp=yes"
+         "ac_cv_printf_positional=yes"
+       ];
 
-  nativeBuildInputs = [ pkgconfig perl yacc ]
+  nativeBuildInputs = [ pkgconfig perl ]
+    ++ optional (!libOnly) yacc
     # Provides the mig command used by the build scripts
     ++ optional stdenv.isDarwin bootstrap_cmds;
   buildInputs = [ openssl ]
@@ -31,20 +39,26 @@ stdenv.mkDerivation rec {
   preConfigure = "cd ./src";
 
   buildPhase = optionalString libOnly ''
-    (cd util; make -j $NIX_BUILD_CORES)
-    (cd include; make -j $NIX_BUILD_CORES)
-    (cd lib; make -j $NIX_BUILD_CORES)
-    (cd build-tools; make -j $NIX_BUILD_CORES)
+    MAKE="make -j $NIX_BUILD_CORES -l $NIX_BUILD_CORES"
+    (cd util; $MAKE)
+    (cd include; $MAKE)
+    (cd lib; $MAKE)
+    (cd build-tools; $MAKE)
   '';
 
   installPhase = optionalString libOnly ''
-    mkdir -p $out/{bin,include/{gssapi,gssrpc,kadm5,krb5},lib/pkgconfig,sbin,share/{et,man/man1}}
-    (cd util; make -j $NIX_BUILD_CORES install)
-    (cd include; make -j $NIX_BUILD_CORES install)
-    (cd lib; make -j $NIX_BUILD_CORES install)
-    (cd build-tools; make -j $NIX_BUILD_CORES install)
-    rm -rf $out/{sbin,share}
-    find $out/bin -type f | grep -v 'krb5-config' | xargs rm
+    mkdir -p "$out"/{bin,sbin,lib/pkgconfig,share/{et,man/man1}} \
+      "$dev"/include/{gssapi,gssrpc,kadm5,krb5}
+    (cd util; $MAKE install)
+    (cd include; $MAKE install)
+    (cd lib; $MAKE install)
+    (cd build-tools; $MAKE install)
+    ${postInstall}
+  '';
+
+  # not via outputBin, due to reference from libkrb5.so
+  postInstall = ''
+    moveToOutput bin "$dev"
   '';
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/kmsxx/default.nix b/pkgs/development/libraries/kmsxx/default.nix
index 490732c3802..8be8eb71357 100644
--- a/pkgs/development/libraries/kmsxx/default.nix
+++ b/pkgs/development/libraries/kmsxx/default.nix
@@ -1,7 +1,9 @@
 { stdenv, fetchFromGitHub, cmake, pkgconfig, libdrm, python }:
 
 stdenv.mkDerivation rec {
-  name = "kmsxx-2017-10-10";
+  pname = "kmsxx";
+  version = "2017-10-10";
+  name = pname + "-" + version;
 
   src = fetchFromGitHub {
     owner = "tomba";
diff --git a/pkgs/development/libraries/ldb/default.nix b/pkgs/development/libraries/ldb/default.nix
index 4f2785675f0..f7da9e9140d 100644
--- a/pkgs/development/libraries/ldb/default.nix
+++ b/pkgs/development/libraries/ldb/default.nix
@@ -3,11 +3,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "ldb-1.1.27";
+  name = "ldb-1.3.1";
 
   src = fetchurl {
     url = "mirror://samba/ldb/${name}.tar.gz";
-    sha256 = "1b1mkl5p8swb67s9aswavhzswlib34hpgsv66zgns009paf2df6d";
+    sha256 = "1b1mkggp8swb67s9aswavhzswlib34hpgsv66zgns009paf2df6d";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/ldns/default.nix b/pkgs/development/libraries/ldns/default.nix
index f465cf1cc44..6c2a8f84d23 100644
--- a/pkgs/development/libraries/ldns/default.nix
+++ b/pkgs/development/libraries/ldns/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, openssl, perl, dns-root-data}:
+{ stdenv, fetchurl, fetchpatch, openssl, perl, dns-root-data }:
 
 stdenv.mkDerivation rec {
   pname = "ldns";
@@ -8,10 +8,25 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "https://www.nlnetlabs.nl/downloads/ldns/${name}.tar.gz";
-    sha1 = "ceeeccf8a27e61a854762737f6ee02f44662c1b8";
+    sha256 = "1k56jw4hz8njspfxcfw0czf1smg0n48ylia89ziwyx5k9wdmp7y1";
   };
 
-  patchPhase = ''
+  patches = [
+    (fetchpatch {
+      name = "CVE-2017-1000231.patch";
+      url = "https://git.nlnetlabs.nl/ldns/patch/?id=c8391790";
+      sha256 = "1rprfh0y1c28dqiy3vgwvwdhn7b5rsylfzzblx5xdhwfqgdw8vn0";
+      excludes = [ "Changelog" ];
+    })
+    (fetchpatch {
+      name = "CVE-2017-1000232.patch";
+      url = "https://git.nlnetlabs.nl/ldns/patch/?id=3bdeed02";
+      sha256 = "0bv0s5jjp0sswfg8da47d346iwp9yjhj9w7fa3bxh174br0zj07r";
+      excludes = [ "Changelog" ];
+    })
+  ];
+
+  postPatch = ''
     patchShebangs doc/doxyparse.pl
   '';
 
diff --git a/pkgs/development/libraries/leveldb/default.nix b/pkgs/development/libraries/leveldb/default.nix
index 2a109e0366f..3ff2ca0b0ee 100644
--- a/pkgs/development/libraries/leveldb/default.nix
+++ b/pkgs/development/libraries/leveldb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, sqlite, kyotocabinet }:
+{ stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   name = "leveldb-${version}";
@@ -11,19 +11,20 @@ stdenv.mkDerivation rec {
     sha256 = "1bnsii47vbyqnbah42qgq6pbmmcg4k3fynjnw7whqfv6lpdgmb8d";
   };
 
-  buildInputs = [ sqlite kyotocabinet ];
-
   buildPhase = ''
-    make all db_bench{,_sqlite3,_tree_db} leveldbutil libmemenv.a
+    make all leveldbutil libmemenv.a
   '';
 
   installPhase = "
     mkdir -p $out/{bin,lib,include}
+
     cp -r include $out
-    cp lib* $out/lib
-    cp db_bench{,_sqlite3,_tree_db} leveldbutil $out/bin
     mkdir -p $out/include/leveldb/helpers
     cp helpers/memenv/memenv.h $out/include/leveldb/helpers
+
+    cp lib* $out/lib
+
+    cp leveldbutil $out/bin
   ";
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/libaal/default.nix b/pkgs/development/libraries/libaal/default.nix
index 88396786ed7..6df7bc22772 100644
--- a/pkgs/development/libraries/libaal/default.nix
+++ b/pkgs/development/libraries/libaal/default.nix
@@ -9,10 +9,14 @@ stdenv.mkDerivation rec {
     sha256 = "176f2sns6iyxv3h9zyirdinjwi05gdak48zqarhib2s38rvm98di";
   };
 
+  patches = [ ./libaal-1.0.6-glibc-2.26.patch ];
+
   preInstall = ''
     substituteInPlace Makefile --replace ./run-ldconfig true
   '';
 
+  enableParallelBuilding = true;
+
   meta = {
     homepage = http://www.namesys.com/;
     description = "Support library for Reiser4";
diff --git a/pkgs/development/libraries/libaal/libaal-1.0.6-glibc-2.26.patch b/pkgs/development/libraries/libaal/libaal-1.0.6-glibc-2.26.patch
new file mode 100644
index 00000000000..6d49682f03a
--- /dev/null
+++ b/pkgs/development/libraries/libaal/libaal-1.0.6-glibc-2.26.patch
@@ -0,0 +1,89 @@
+Date: 2017-09-02 13:03:15.353403096 +0200
+From: Jan Engelhardt <jengelh@inai.de>
+
+Stop redefining libc definitions that cause build failures under glibc-2.26.
+
+[   46s] In file included from /usr/include/sys/types.h:156:0,
+[   46s]                  from /usr/include/stdlib.h:279,
+[   46s]                  from malloc.c:15:
+[   46s] /usr/include/bits/stdint-intn.h:27:19: error: conflicting types for 'int64_t'
+[   46s]  typedef __int64_t int64_t;
+[   46s]                    ^~~~~~~
+[   46s] In file included from ../include/aal/libaal.h:17:0,
+[   46s]                  from malloc.c:6:
+[   46s] ../include/aal/types.h:35:33: note: previous declaration of 'int64_t' was here
+[   46s]  typedef long long int           int64_t;
+
+
+---
+ include/aal/types.h |   48 ++----------------------------------------------
+ 1 file changed, 2 insertions(+), 46 deletions(-)
+
+Index: libaal-1.0.6/include/aal/types.h
+===================================================================
+--- libaal-1.0.6.orig/include/aal/types.h
++++ libaal-1.0.6/include/aal/types.h
+@@ -26,24 +26,7 @@
+ #undef ESTRUCT
+ #define ESTRUCT                 50
+ 
+-#ifndef __int8_t_defined
+-#define __int8_t_defined
+-typedef signed char             int8_t;
+-typedef short int               int16_t;
+-typedef int                     int32_t;
+-__extension__
+-typedef long long int           int64_t;
+-#endif
+- 
+-typedef unsigned char           uint8_t;
+-typedef unsigned short int      uint16_t;
+-#ifndef __uint32_t_defined
+-#define __uint32_t_defined
+-typedef unsigned int            uint32_t;
+-__extension__
+-typedef unsigned long long int  uint64_t;
+-#endif
+-
++#include <stdint.h>
+ #define MAX_UINT8  ((uint8_t)~0)
+ #define MAX_UINT16 ((uint16_t)~0)
+ #define MAX_UINT32 ((uint32_t)~0)
+@@ -53,36 +36,9 @@ typedef unsigned long long int  uint64_t
+    because we don't want use gcc builtins in minimal mode for achive as small
+    binary size as possible. */
+ 
+-#ifndef ENABLE_MINIMAL
+ #  include <stdarg.h>
+-#else
+-#ifndef _VA_LIST_
+-#define _VA_LIST_
+-typedef char *va_list;
+-#endif
+-#undef va_arg
+-#undef va_end
+-#undef va_start
+-
+-#define va_end(ap)       \
+-        do {} while(0);
+-
+-#define va_start(ap, p)  \
+-        (ap = (char *)(&(p)+1))
+-
+-#define va_arg(ap, type) \
+-        ((type *)(ap += sizeof(type)))[-1]
+-#endif
+-
+-/* As libaal may be used without any standard headers, we need to declare NULL
+-   macro here in order to avoid compilation errors. */
+-#undef NULL
+ 
+-#if defined(__cplusplus)
+-#  define NULL 0
+-#else
+-#  define NULL ((void *)0)
+-#endif
++#include <stdio.h>
+ 
+ /* Simple type for direction denoting */
+ enum aal_dir {
diff --git a/pkgs/development/libraries/libaccounts-glib/default.nix b/pkgs/development/libraries/libaccounts-glib/default.nix
index e410b6d4aa5..70d0e9faf84 100644
--- a/pkgs/development/libraries/libaccounts-glib/default.nix
+++ b/pkgs/development/libraries/libaccounts-glib/default.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchFromGitLab, autoconf, automake, glib
 , gtk_doc, libtool, libxml2, libxslt, pkgconfig, sqlite }:
 
-let version = "1.18"; in
+let version = "1.23"; in
 stdenv.mkDerivation rec {
   name = "libaccounts-glib-${version}";
 
   src = fetchFromGitLab {
-    sha256 = "02p23vrqhw2l2w6nrwlk4bqxf7z9kplkc2d43716x9xakxr291km";
-    rev = version;
+    sha256 = "11cvl3ch0y93756k90mw1swqv0ylr8qgalmvcn5yari8z4sg6cgg";
+    rev = "VERSION_${version}";
     repo = "libaccounts-glib";
     owner = "accounts-sso";
   };
diff --git a/pkgs/development/libraries/libagar/default.nix b/pkgs/development/libraries/libagar/default.nix
index 1c9e8eca0d5..ee984a53b4c 100644
--- a/pkgs/development/libraries/libagar/default.nix
+++ b/pkgs/development/libraries/libagar/default.nix
@@ -20,15 +20,16 @@ stdenv.mkDerivation rec {
     "--with-gettext=${gettext}"
     "--with-jpeg=${libjpeg.dev}"
     "--with-gl=${mesa}"
-    "--with-mysql=yes"
+    "--with-mysql=${mysql.connector-c}"
     "--with-manpages=yes"
   ];
 
   outputs = [ "out" "devdoc" ];
 
   nativeBuildInputs = [ pkgconfig libtool gettext ];
+
   buildInputs = [
-    bsdbuild perl xlibsWrapper libXinerama SDL mesa  mysql.client mandoc
+    bsdbuild perl xlibsWrapper libXinerama SDL mesa mysql.connector-c mandoc
     freetype.dev libpng libjpeg.dev fontconfig portaudio libsndfile
   ];
 
diff --git a/pkgs/development/libraries/libamqpcpp/default.nix b/pkgs/development/libraries/libamqpcpp/default.nix
new file mode 100644
index 00000000000..421c73cbb05
--- /dev/null
+++ b/pkgs/development/libraries/libamqpcpp/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  name = "libamqpcpp-${version}";
+  version = "2.7.4";
+
+  src = fetchFromGitHub {
+    owner = "CopernicaMarketingSoftware";
+    repo = "AMQP-CPP";
+    rev = "v${version}";
+    sha256 = "0m010bz0axawcpv4d1p1vx7c6r8lg27w2s2vjqpbpg99w35n6c8k";
+  };
+
+  patches = [ ./libamqpcpp-darwin.patch ];
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Library for communicating with a RabbitMQ server";
+    homepage = https://github.com/CopernicaMarketingSoftware/AMQP-CPP;
+    license = licenses.asl20;
+    maintainers = [ maintainers.mjp ];
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/libamqpcpp/libamqpcpp-darwin.patch b/pkgs/development/libraries/libamqpcpp/libamqpcpp-darwin.patch
new file mode 100644
index 00000000000..9f8d700929b
--- /dev/null
+++ b/pkgs/development/libraries/libamqpcpp/libamqpcpp-darwin.patch
@@ -0,0 +1,13 @@
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -0,0 +1 @@
++CXX ?= g++
+@@ -43 +44 @@ ${SHARED_LIB}: ${SHARED_OBJECTS}
+-	${LD} ${LD_FLAGS} -Wl,${SONAMEPARAMETER},lib$(LIBRARY_NAME).so.$(SONAME) -o $@ ${SHARED_OBJECTS}
++	${CXX} ${LD_FLAGS} -Wl,${SONAMEPARAMETER},lib$(LIBRARY_NAME).so.$(SONAME) -o $@ ${SHARED_OBJECTS}
+@@ -52 +53 @@ ${SHARED_OBJECTS}:
+-	${CPP} ${CPPFLAGS} -fpic -o $@ ${@:%.o=%.cpp}
++	${CXX} ${CPPFLAGS} -fpic -o $@ ${@:%.o=%.cpp}
+@@ -55 +56 @@ ${STATIC_OBJECTS}:
+-	${CPP} ${CPPFLAGS} -o $@ ${@:%.s.o=%.cpp}
++	${CXX} ${CPPFLAGS} -o $@ ${@:%.s.o=%.cpp}
diff --git a/pkgs/development/libraries/libao/default.nix b/pkgs/development/libraries/libao/default.nix
index 3a1c8938405..826f72b1f5f 100644
--- a/pkgs/development/libraries/libao/default.nix
+++ b/pkgs/development/libraries/libao/default.nix
@@ -1,33 +1,42 @@
-{ lib, stdenv, fetchurl, pkgconfig, libpulseaudio, alsaLib, libcap
+{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkgconfig, libpulseaudio, alsaLib, libcap
 , CoreAudio, CoreServices, AudioUnit
 , usePulseAudio }:
 
 stdenv.mkDerivation rec {
-  version = "1.2.0";
+  version = "1.2.2";
   name = "libao-${version}";
-  src = fetchurl {
-    url = "http://downloads.xiph.org/releases/ao/${name}.tar.gz";
-    sha256 = "1bwwv1g9lchaq6qmhvj1pp3hnyqr64ydd4j38x94pmprs4d27b83";
+
+  # the github mirror is more up to date than downloads.xiph.org
+  src = fetchFromGitHub {
+    owner  = "xiph";
+    repo   = "libao";
+    rev    = "${version}";
+    sha256 = "0svgk4sc9kdhcsfyvbvgm5vpbg3sfr6z5rliflrw49v3x2i4vxq5";
   };
 
+  configureFlags = [
+    "--disable-broken-oss"
+    "--enable-alsa-mmap"
+  ];
+
   outputs = [ "out" "dev" "man" "doc" ];
 
-  buildInputs =
-    [ pkgconfig ] ++
-    lib.optional usePulseAudio libpulseaudio ++
-    lib.optional stdenv.isLinux alsaLib ++
-    lib.optional stdenv.isLinux libcap ++
+  buildInputs = [ ] ++
+    lib.optional  usePulseAudio   libpulseaudio ++
+    lib.optionals stdenv.isLinux  [ alsaLib libcap ] ++
     lib.optionals stdenv.isDarwin [ CoreAudio CoreServices AudioUnit ];
 
-  meta = {
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+
+  meta = with stdenv.lib; {
     longDescription = ''
       Libao is Xiph.org's cross-platform audio library that allows
       programs to output audio using a simple API on a wide variety of
       platforms.
     '';
     homepage = https://xiph.org/ao/;
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
-    platforms = with stdenv.lib.platforms; unix;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ fuuzetsu ];
+    platforms = with platforms; unix;
   };
 }
diff --git a/pkgs/development/libraries/libappindicator/default.nix b/pkgs/development/libraries/libappindicator/default.nix
index 3a26dd407e4..7ebd14b51f5 100644
--- a/pkgs/development/libraries/libappindicator/default.nix
+++ b/pkgs/development/libraries/libappindicator/default.nix
@@ -5,7 +5,7 @@
 , glib, dbus_glib, gtkVersion
 , gtk2 ? null, libindicator-gtk2 ? null, libdbusmenu-gtk2 ? null
 , gtk3 ? null, libindicator-gtk3 ? null, libdbusmenu-gtk3 ? null
-, python2Packages, gobjectIntrospection, vala_0_23
+, python2Packages, gobjectIntrospection, vala
 , monoSupport ? false, mono ? null, gtk-sharp-2_0 ? null
  }:
 
@@ -34,7 +34,7 @@ in stdenv.mkDerivation rec {
 
   buildInputs = [
     glib dbus_glib
-    python pygobject2 pygtk gobjectIntrospection vala_0_23
+    python pygobject2 pygtk gobjectIntrospection vala
   ] ++ (if gtkVersion == "2"
     then [ libindicator-gtk2 ] ++ optionals monoSupport [ mono gtk-sharp-2_0 ]
     else [ libindicator-gtk3 ]);
diff --git a/pkgs/development/libraries/libassuan/default.nix b/pkgs/development/libraries/libassuan/default.nix
index bad2a060cdc..94369449ff3 100644
--- a/pkgs/development/libraries/libassuan/default.nix
+++ b/pkgs/development/libraries/libassuan/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, pth, libgpgerror }:
 
 stdenv.mkDerivation rec {
-  name = "libassuan-2.4.3";
+  name = "libassuan-2.5.1";
 
   src = fetchurl {
     url = "mirror://gnupg/libassuan/${name}.tar.bz2";
-    sha256 = "0w9bmasln4z8mn16s1is55a06w3nv8jbyal496z5jvr5vcxkm112";
+    sha256 = "0jb4nb4nrjr949gd3lw8lh4v5d6qigxaq6xwy24w5apjnhvnrya7";
   };
 
   outputs = [ "out" "dev" "info" ];
diff --git a/pkgs/development/libraries/libatomic_ops/default.nix b/pkgs/development/libraries/libatomic_ops/default.nix
index eedc0993d73..3aae754be40 100644
--- a/pkgs/development/libraries/libatomic_ops/default.nix
+++ b/pkgs/development/libraries/libatomic_ops/default.nix
@@ -2,14 +2,14 @@
 
 stdenv.mkDerivation rec {
   name = "libatomic_ops-${version}";
-  version = "7.6.0";
+  version = "7.6.2";
 
   src = fetchurl {
     urls = [
       "http://www.ivmaisoft.com/_bin/atomic_ops/libatomic_ops-${version}.tar.gz"
       "https://github.com/ivmai/libatomic_ops/releases/download/v${version}/libatomic_ops-${version}.tar.gz"
     ];
-    sha256 ="03ylfr29g9zc0r6b6axz3i68alj5qmxgzknxwam3jlx0sz8hcb4f";
+    sha256 ="1rif2hjscq5mh639nsnjhb90c01gnmy1sbmj6x6hsn1xmpnj95r1";
   };
 
   nativeBuildInputs = stdenv.lib.optionals stdenv.isCygwin [ autoconf automake libtool ];
diff --git a/pkgs/development/libraries/libatomic_ops/default.upstream b/pkgs/development/libraries/libatomic_ops/default.upstream
deleted file mode 100644
index c9fd4554e4a..00000000000
--- a/pkgs/development/libraries/libatomic_ops/default.upstream
+++ /dev/null
@@ -1 +0,0 @@
-url https://github.com/ivmai/libatomic_ops/wiki/Download
diff --git a/pkgs/development/libraries/libav/default.nix b/pkgs/development/libraries/libav/default.nix
index e348fe0fae2..6a80a856df3 100644
--- a/pkgs/development/libraries/libav/default.nix
+++ b/pkgs/development/libraries/libav/default.nix
@@ -110,7 +110,7 @@ let
     crossAttrs = {
       configurePlatforms = [];
       configureFlags = configureFlags ++ [
-        "--cross-prefix=${stdenv.cc.prefix}"
+        "--cross-prefix=${stdenv.cc.targetPrefix}"
         "--enable-cross-compile"
         "--target_os=linux"
         "--arch=${hostPlatform.arch}"
diff --git a/pkgs/development/libraries/libbfd/default.nix b/pkgs/development/libraries/libbfd/default.nix
new file mode 100644
index 00000000000..5bcf243155b
--- /dev/null
+++ b/pkgs/development/libraries/libbfd/default.nix
@@ -0,0 +1,47 @@
+{ stdenv
+, fetchurl, autoreconfHook264, bison, binutils-raw
+, libiberty, zlib
+}:
+
+stdenv.mkDerivation rec {
+  name = "libbfd-${version}";
+  inherit (binutils-raw.bintools) version src;
+
+  outputs = [ "out" "dev" ];
+
+  patches = binutils-raw.bintools.patches ++ [
+    ../../tools/misc/binutils/build-components-separately.patch
+  ];
+
+  # We just want to build libbfd
+  postPatch = ''
+    cd bfd
+  '';
+
+  nativeBuildInputs = [ autoreconfHook264 bison ];
+  buildInputs = [ libiberty zlib ];
+
+  configurePlatforms = [ "build" "host" ];
+  configureFlags = [
+    "--enable-targets=all" "--enable-64-bit-bfd"
+    "--enable-install-libbfd"
+    "--enable-shared"
+    "--with-system-zlib"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A library for manipulating containers of machine code";
+    longDescription = ''
+      BFD is a library which provides a single interface to read and write
+      object files, executables, archive files, and core files in any format.
+      It is associated with GNU Binutils, and elsewhere often distributed with
+      it.
+    '';
+    homepage = http://www.gnu.org/software/binutils/;
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ ericson2314 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/development/libraries/libbladeRF/default.nix b/pkgs/development/libraries/libbladeRF/default.nix
index 8948a74ad63..3f4f48775c1 100644
--- a/pkgs/development/libraries/libbladeRF/default.nix
+++ b/pkgs/development/libraries/libbladeRF/default.nix
@@ -2,14 +2,14 @@
 , libusb1, udev }:
 
 stdenv.mkDerivation rec {
-  version = "1.4.0";
+  version = "1.9.0";
   name = "libbladeRF-v${version}";
 
   src = fetchFromGitHub {
     owner = "Nuand";
     repo = "bladeRF";
     rev = "libbladeRF_v${version}";
-    sha256 = "1y00hqsmqaix4dql8mb75zx87zvn8b483yxv53x9qyjspksbs60c";
+    sha256 = "0frvphp4xxdxwzmi94b0asl7b891sd3fk8iw9kfk8h6f3cdhj8xa";
   };
 
   nativeBuildInputs = [ pkgconfig ];
@@ -35,6 +35,6 @@ stdenv.mkDerivation rec {
     description = "Supporting library of the BladeRF SDR opensource hardware";
     license = licenses.lgpl21;
     maintainers = with maintainers; [ funfunctor ];
-    platforms = platforms.linux;
+    platforms = with platforms; linux;
   };
 }
diff --git a/pkgs/development/libraries/libbrotli/default.nix b/pkgs/development/libraries/libbrotli/default.nix
deleted file mode 100644
index 03604e3a93e..00000000000
--- a/pkgs/development/libraries/libbrotli/default.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-{ stdenv, fetchFromGitHub, autoconf, automake, libtool, brotliUnstable }:
-
-stdenv.mkDerivation rec {
-  name = "libbrotli-${version}";
-  version = "1.0";
-
-  src = fetchFromGitHub {
-    owner = "bagder";
-    repo = "libbrotli";
-    rev = name;
-    sha256 = "0apd3hpy3vaa7brkv8v0xwz05zbd5xv86rcbkwns4x39klba3m3y";
-  };
-
-  nativeBuildInputs = [ autoconf automake libtool ];
-
-  preConfigure = ''
-    cp -r ${brotliUnstable.src}/* brotli/
-    chmod -R +700 brotli
-    mkdir m4
-    autoreconf --install --force --symlink
-  '';
-
-  meta = with stdenv.lib; {
-    description = "Meta project to build libraries from the brotli source code";
-    longDescription = ''
-      Wrapper scripts and code around the brotli code base.
-      Builds libraries out of the brotli decode and encode sources. Uses autotools.
-      'brotlidec' is the library for decoding, decompression
-      'brotlienc' is the library for encoding, compression
-    '';
-
-    homepage = https://github.com/bagder/libbrotli;
-    license = licenses.mit;
-    platforms = platforms.all;
-    maintainers = [];
-  };
-}
diff --git a/pkgs/development/libraries/libbsd/darwin.patch b/pkgs/development/libraries/libbsd/darwin.patch
index 77062cf4ec8..a9ac414e93d 100644
--- a/pkgs/development/libraries/libbsd/darwin.patch
+++ b/pkgs/development/libraries/libbsd/darwin.patch
@@ -1,8 +1,8 @@
 diff --git a/configure.ac b/configure.ac
-index 5a432d4..a69ae0b 100644
+index c909878..60c540e 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -55,7 +55,7 @@ AS_CASE([$host_os],
+@@ -59,7 +59,7 @@ AS_CASE([$host_os],
  )
  
  # Checks for header files.
@@ -10,10 +10,10 @@ index 5a432d4..a69ae0b 100644
 +AC_CHECK_HEADERS([sys/ndir.h sys/dir.h ndir.h dirent.h stdio_ext.h])
  
  # Checks for typedefs, structures, and compiler characteristics.
- AC_TYPE_UID_T
-@@ -143,6 +143,31 @@ AC_CHECK_FUNCS([clearenv dirfd fopencookie __fpurge \
+ AC_C_INLINE
+@@ -146,6 +146,31 @@ AC_CHECK_FUNCS([clearenv dirfd fopencookie __fpurge \
                  pstat_getproc sysconf])
- AM_CONDITIONAL(HAVE_GETENTROPY, [test "x$ac_cv_func_getentropy" = "xtrue"])
+ AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xtrue"])
  
 +HostOS=`echo "$host" | sed 's/.*-//'`
 +os_is_macosx=false
@@ -31,7 +31,7 @@ index 5a432d4..a69ae0b 100644
 +		os_is_macosx=false
 +		nonLinuxOS=false
 +		;;
-+esac		
++esac
 +AM_CONDITIONAL([IS_DARWIN], [test x$os_is_macosx = xtrue])
 +AM_COND_IF([IS_DARWIN],
 +	[AC_DEFINE([IS_DARWIN], [1], [Get HostOS Type is Darwin])])
@@ -44,12 +44,12 @@ index 5a432d4..a69ae0b 100644
  	Makefile
  	include/Makefile
 diff --git a/include/bsd/libutil.h b/include/bsd/libutil.h
-index ebb6160..ce882bf 100644
+index 45b3b15..d0d4043 100644
 --- a/include/bsd/libutil.h
 +++ b/include/bsd/libutil.h
 @@ -39,7 +39,9 @@
- #ifndef _LIBUTIL_H_
- #define _LIBUTIL_H_
+ #ifndef LIBBSD_LIBUTIL_H
+ #define LIBBSD_LIBUTIL_H
  
 +#ifdef HAVE_FEATURES_H
  #include <features.h>
@@ -58,10 +58,10 @@ index ebb6160..ce882bf 100644
  #include <sys/types.h>
  #include <stdint.h>
 diff --git a/include/bsd/stdio.h b/include/bsd/stdio.h
-index 7697425..ef34c4f 100644
+index 4b69983..8e2ac75 100644
 --- a/include/bsd/stdio.h
 +++ b/include/bsd/stdio.h
-@@ -44,12 +44,16 @@
+@@ -48,12 +48,16 @@
  __BEGIN_DECLS
  const char *fmtcheck(const char *, const char *);
  
@@ -69,9 +69,9 @@ index 7697425..ef34c4f 100644
  /* XXX: The function requires cooperation from the system libc to store the
   * line buffer in the FILE struct itself. */
  char *fgetln(FILE *fp, size_t *lenp)
- 	__attribute__((deprecated("This functions cannot be safely ported, "
- 	                          "use getline(3) instead, as it is supported "
- 	                          "by GNU and POSIX.1-2008.")));
+ 	LIBBSD_DEPRECATED("This functions cannot be safely ported, "
+ 	                  "use getline(3) instead, as it is supported "
+ 	                  "by GNU and POSIX.1-2008.");
 +#else
 +char *fgetln(FILE *fp, size_t *lenp);
 +#endif
@@ -519,17 +519,18 @@ index 462535a..e7eb46f 100644
 +}
  #endif
 diff --git a/src/funopen.c b/src/funopen.c
-index 7d6ae31..9963162 100644
+index 1e05c7e..ed8ce85 100644
 --- a/src/funopen.c
 +++ b/src/funopen.c
-@@ -137,6 +137,7 @@ funopen(const void *cookie,
+@@ -137,7 +137,7 @@ funopen(const void *cookie,
  
  	return fopencookie(cookiewrap, mode, funcswrap);
  }
-+#elif defined(darwin) || defined(__APPLE__) || defined(MACOSX)
- #else
- #error "Function funopen() needs to be ported."
- #endif
+-#elif defined(__MUSL__)
++#elif defined(__MUSL__) || defined(darwin) || defined(__APPLE__) || defined(MACOSX)
+ /*
+  * This is unimplementable on musl based systems, and upstream has stated
+  * they will not add the needed support to implement it. Just ignore this
 diff --git a/src/getentropy.c b/src/getentropy.c
 index 3f11a1e..8a23a07 100644
 --- a/src/getentropy.c
@@ -562,13 +563,13 @@ index 4f368a1..ab22fc1 100644
  #define SHA512_DIGEST_LENGTH		64
  
 diff --git a/src/hash/sha512c.c b/src/hash/sha512c.c
-index c2a93be..f69013d 100644
+index b3c8d5e..4fade0f 100644
 --- a/src/hash/sha512c.c
 +++ b/src/hash/sha512c.c
-@@ -27,7 +27,11 @@
- #include <sys/cdefs.h>
- __FBSDID("$FreeBSD$");
+@@ -25,7 +25,11 @@
+  */
  
+ #include <sys/cdefs.h>
 +#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
 +#include <machine/endian.h>
 +#else
@@ -578,24 +579,26 @@ index c2a93be..f69013d 100644
  
  #include <string.h>
 diff --git a/src/nlist.c b/src/nlist.c
-index 0cffe55..f785b61 100644
+index 0932f59..a3ba2be 100644
 --- a/src/nlist.c
 +++ b/src/nlist.c
-@@ -27,6 +27,7 @@
+@@ -27,6 +27,8 @@
   * SUCH DAMAGE.
   */
  
 +#if !defined(darwin) && !defined(__APPLE__) && !defined(MACOSX)
- #if defined(LIBC_SCCS) && !defined(lint)
- static char sccsid[] = "@(#)nlist.c	8.1 (Berkeley) 6/4/93";
- #endif /* LIBC_SCCS and not lint */
-@@ -409,3 +410,4 @@ elf_sym_to_nlist(struct nlist *nl, Elf_Sym *s, Elf_Shdr *shdr, int shnum)
- 		nl->n_type |= N_EXT;
++
+ #include <sys/cdefs.h>
+ 
+ #include <sys/param.h>
+@@ -265,3 +267,5 @@ nlist(const char *name, struct nlist *list)
+ 	(void)close(fd);
+ 	return (n);
  }
- #endif /* _NLIST_DO_ELF */
++
 +#endif
 diff --git a/src/setproctitle.c b/src/setproctitle.c
-index c18c61c..b1b1591 100644
+index 038ac7d..d0ef01b 100644
 --- a/src/setproctitle.c
 +++ b/src/setproctitle.c
 @@ -32,6 +32,11 @@
@@ -626,42 +629,42 @@ index c18c61c..b1b1591 100644
  void setproctitle_stub(const char *fmt, ...)
  	__attribute__((alias("setproctitle_impl")));
 diff --git a/src/strlcat.c b/src/strlcat.c
-index 21c8afb..e036132 100644
+index 14c53a1..e01cb60 100644
 --- a/src/strlcat.c
 +++ b/src/strlcat.c
 @@ -27,7 +27,11 @@
-  * If retval >= siz, truncation occurred.
+  * If retval >= dsize, truncation occurred.
   */
  size_t
 +#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
-+bsd_strlcat(char *dst, const char *src, size_t siz)
++bsd_strlcat(char *dst, const char *src, size_t dsize)
 +#else
- strlcat(char *dst, const char *src, size_t siz)
+ strlcat(char *dst, const char *src, size_t dsize)
 +#endif
  {
- 	char *d = dst;
- 	const char *s = src;
+ 	const char *odst = dst;
+ 	const char *osrc = src;
 diff --git a/src/strlcpy.c b/src/strlcpy.c
-index 1719d35..c63591d 100644
+index e9a7fe4..10a855f 100644
 --- a/src/strlcpy.c
 +++ b/src/strlcpy.c
 @@ -25,7 +25,11 @@
-  * Returns strlen(src); if retval >= siz, truncation occurred.
+  * Returns strlen(src); if retval >= dsize, truncation occurred.
   */
  size_t
 +#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
-+bsd_strlcpy(char *dst, const char *src, size_t siz)
++bsd_strlcpy(char *dst, const char *src, size_t dsize)
 +#else
- strlcpy(char *dst, const char *src, size_t siz)
+ strlcpy(char *dst, const char *src, size_t dsize)
 +#endif
  {
- 	char *d = dst;
- 	const char *s = src;
+ 	const char *osrc = src;
+ 	size_t nleft = dsize;
 diff --git a/src/strmode.c b/src/strmode.c
-index 8d825ae..c1b5f8d 100644
+index e6afde5..c463243 100644
 --- a/src/strmode.c
 +++ b/src/strmode.c
-@@ -37,7 +37,11 @@ static char sccsid[] = "@(#)strmode.c	8.3 (Berkeley) 8/15/94";
+@@ -33,7 +33,11 @@
  #include <string.h>
  
  void
diff --git a/pkgs/development/libraries/libbsd/default.nix b/pkgs/development/libraries/libbsd/default.nix
index c73096d1eeb..7e112caf3c7 100644
--- a/pkgs/development/libraries/libbsd/default.nix
+++ b/pkgs/development/libraries/libbsd/default.nix
@@ -20,5 +20,6 @@ stdenv.mkDerivation rec {
     homepage = https://libbsd.freedesktop.org/;
     license = licenses.bsd3;
     platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ matthewbauer ];
   };
 }
diff --git a/pkgs/development/libraries/libcerf/default.nix b/pkgs/development/libraries/libcerf/default.nix
new file mode 100644
index 00000000000..fd5ee8dcaaf
--- /dev/null
+++ b/pkgs/development/libraries/libcerf/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, lib, fetchurl }:
+
+stdenv.mkDerivation {
+  name = "libcerf-1.5";
+
+  src = fetchurl {
+    url = "http://apps.jcns.fz-juelich.de/src/libcerf/libcerf-1.5.tgz";
+    sha256 = "11jwr8ql4a9kmv04ycgwk4dsqnlv4l65a8aa0x1i3y7zwx3w2vg3";
+  };
+
+  meta = with lib; {
+    description = "Complex error (erf), Dawson, Faddeeva, and Voigt function library";
+    homepage = http://apps.jcns.fz-juelich.de/doku/sc/libcerf;
+    license = licenses.mit;
+    maintainers = with maintainers; [ orivej ];
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/libcli/default.nix b/pkgs/development/libraries/libcli/default.nix
index 587e72409c4..f101eb22310 100644
--- a/pkgs/development/libraries/libcli/default.nix
+++ b/pkgs/development/libraries/libcli/default.nix
@@ -27,6 +27,5 @@ stdenv.mkDerivation rec {
     homepage = http://sites.dparrish.com/libcli;
     license = licenses.lgpl21Plus;
     platforms = platforms.linux;
-    maintainers = with maintainers; [ nckx ];
   };
 }
diff --git a/pkgs/development/libraries/libcollectdclient/default.nix b/pkgs/development/libraries/libcollectdclient/default.nix
index f6d9d7ca69b..e4e61c94283 100644
--- a/pkgs/development/libraries/libcollectdclient/default.nix
+++ b/pkgs/development/libraries/libcollectdclient/default.nix
@@ -5,14 +5,17 @@ overrideDerivation collectd (oldAttrs: {
   name = "libcollectdclient-${collectd.version}";
   buildInputs = [ ];
 
-  configureFlags = [
-    "--without-daemon"
+  NIX_CFLAGS_COMPILE = oldAttrs.NIX_CFLAGS_COMPILE ++ [
+    "-Wno-error=unused-function"
   ];
 
-  makeFlags = [
-    "-C src/libcollectdclient/"
+  configureFlags = oldAttrs.configureFlags ++ [
+    "--disable-daemon"
+    "--disable-all-plugins"
   ];
 
+  postInstall = "rm -rf $out/{bin,etc,sbin,share}";
+
 }) // {
   meta = with stdenv.lib; {
     description = "C Library for collectd, a daemon which collects system performance statistics periodically";
diff --git a/pkgs/development/libraries/libconfuse/default.nix b/pkgs/development/libraries/libconfuse/default.nix
index a89bdec2c8a..1ef550238d1 100644
--- a/pkgs/development/libraries/libconfuse/default.nix
+++ b/pkgs/development/libraries/libconfuse/default.nix
@@ -32,6 +32,5 @@ stdenv.mkDerivation rec {
     '';
     license = licenses.isc;
     platforms = platforms.linux ++ platforms.darwin;
-    maintainers = with maintainers; [ nckx ];
   };
 }
diff --git a/pkgs/development/libraries/libcutl/default.nix b/pkgs/development/libraries/libcutl/default.nix
index 526890ed563..7b4d39f955a 100644
--- a/pkgs/development/libraries/libcutl/default.nix
+++ b/pkgs/development/libraries/libcutl/default.nix
@@ -1,11 +1,13 @@
-{stdenv, fetchurl, xercesc }:
+{ stdenv, fetchurl, xercesc }:
+let
+    major = "1.9";
+    minor = "0";
+in
 with stdenv; with lib;
 mkDerivation rec {
-  name = "libcutl-${meta.major}.${meta.minor}";
+  name = "libcutl-${major}.${minor}";
 
   meta = {
-    major = "1.9";
-    minor = "0";
     description = "A collection of generic and independent components such as meta-programming tests, smart pointers, containers, compiler building blocks" ;
     platforms = platforms.all;
     maintainers = with maintainers; [ ];
diff --git a/pkgs/development/libraries/libdbi-drivers/default.nix b/pkgs/development/libraries/libdbi-drivers/default.nix
index 77c09f3ed15..2a03efd632f 100644
--- a/pkgs/development/libraries/libdbi-drivers/default.nix
+++ b/pkgs/development/libraries/libdbi-drivers/default.nix
@@ -1,5 +1,7 @@
 { stdenv, fetchurl, libdbi
-, libmysql ? null, sqlite ? null, postgresql ? null
+, mysql ? null
+, sqlite ? null
+, postgresql ? null
 }:
 
 with stdenv.lib;
@@ -11,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3";
   };
 
-  buildInputs = [ libdbi libmysql sqlite postgresql ];
+  buildInputs = [ libdbi sqlite postgresql ] ++ optional (mysql != null) mysql.connector-c;
 
   postPatch = ''
     sed -i '/SQLITE3_LIBS/ s/-lsqlite/-lsqlite3/' configure;
@@ -24,16 +26,18 @@ stdenv.mkDerivation rec {
     "--enable-libdbi"
     "--with-dbi-incdir=${libdbi}/include"
     "--with-dbi-libdir=${libdbi}/lib"
-  ] ++ optionals (libmysql != null) [
+  ] ++ optionals (mysql != null) [
     "--with-mysql"
-  ] ++ optionals (postgresql != null) [
-    "--with-pgsql"
-    "--with-pgsql_incdir=${postgresql}/include"
-    "--with-pgsql_libdir=${postgresql.lib}/lib"
+    "--with-mysql-incdir=${mysql.connector-c}/include/mysql"
+    "--with-mysql-libdir=${mysql.connector-c}/lib/mysql"
   ] ++ optionals (sqlite != null) [
     "--with-sqlite3"
     "--with-sqlite3-incdir=${sqlite.dev}/include/sqlite"
     "--with-sqlite3-libdir=${sqlite.out}/lib/sqlite"
+  ] ++ optionals (postgresql != null) [
+    "--with-pgsql"
+    "--with-pgsql_incdir=${postgresql}/include"
+    "--with-pgsql_libdir=${postgresql.lib}/lib"
   ];
 
   installFlags = [ "DESTDIR=\${out}" ];
diff --git a/pkgs/development/libraries/libdbusmenu/default.nix b/pkgs/development/libraries/libdbusmenu/default.nix
index 96e9c0624f2..c7a6fcc5874 100644
--- a/pkgs/development/libraries/libdbusmenu/default.nix
+++ b/pkgs/development/libraries/libdbusmenu/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, lib, file
 , pkgconfig, intltool
 , glib, dbus_glib, json_glib
-, gobjectIntrospection, vala_0_23, gnome_doc_utils
+, gobjectIntrospection, vala_0_38, gnome_doc_utils
 , gtkVersion ? null, gtk2 ? null, gtk3 ? null }:
 
 with lib;
@@ -10,19 +10,19 @@ stdenv.mkDerivation rec {
   name = let postfix = if gtkVersion == null then "glib" else "gtk${gtkVersion}";
           in "libdbusmenu-${postfix}-${version}";
   version = "${versionMajor}.${versionMinor}";
-  versionMajor = "12.10";
-  versionMinor = "2";
+  versionMajor = "16.04";
+  versionMinor = "0";
 
   src = fetchurl {
     url = "${meta.homepage}/${versionMajor}/${version}/+download/libdbusmenu-${version}.tar.gz";
-    sha256 = "9d6ad4a0b918b342ad2ee9230cce8a095eb601cb0cee6ddc1122d0481f9d04c9";
+    sha256 = "12l7z8dhl917iy9h02sxmpclnhkdjryn08r8i4sr8l3lrlm4mk5r";
   };
 
   nativeBuildInputs = [ pkgconfig intltool ];
 
   buildInputs = [
     glib dbus_glib json_glib
-    gobjectIntrospection vala_0_23 gnome_doc_utils
+    gobjectIntrospection vala_0_38 gnome_doc_utils
   ] ++ optional (gtkVersion != null) (if gtkVersion == "2" then gtk2 else gtk3);
 
   postPatch = ''
@@ -49,10 +49,11 @@ stdenv.mkDerivation rec {
   installFlags = [
     "sysconfdir=\${out}/etc"
     "localstatedir=\${TMPDIR}"
+    "typelibdir=\${out}/lib/girepository-1.0"
   ];
 
   meta = {
-    description = "A library for passing menu structures across DBus";
+    description = "Library for passing menu structures across DBus";
     homepage = https://launchpad.net/dbusmenu;
     license = with licenses; [ gpl3 lgpl21 lgpl3 ];
     platforms = platforms.linux;
diff --git a/pkgs/development/libraries/libdrm/default.nix b/pkgs/development/libraries/libdrm/default.nix
index 992b1ea70dc..e5e1e2e7a39 100644
--- a/pkgs/development/libraries/libdrm/default.nix
+++ b/pkgs/development/libraries/libdrm/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, libpthreadstubs, libpciaccess, valgrind-light }:
 
 stdenv.mkDerivation rec {
-  name = "libdrm-2.4.84";
+  name = "libdrm-2.4.89";
 
   src = fetchurl {
     url = "http://dri.freedesktop.org/libdrm/${name}.tar.bz2";
-    sha256 = "7ae9c24d91139ac9a2cdee06fe46dbe1c401a1eda1c0bd2a6d1ecf72f479e0aa";
+    sha256 = "629f9782aabbb4809166de5f24d26fe0766055255038f16935602d89f136a02e";
   };
 
   outputs = [ "out" "dev" "bin" ];
@@ -20,7 +20,8 @@ stdenv.mkDerivation rec {
     "echo : \\\${ac_cv_func_clock_gettime=\'yes\'} > config.cache";
 
   configureFlags = [ "--enable-install-test-programs" ]
-    ++ stdenv.lib.optionals (stdenv.isArm || stdenv.isAarch64) [ "--enable-tegra-experimental-api" "--enable-etnaviv-experimental-api" ]
+    ++ stdenv.lib.optionals (stdenv.isArm || stdenv.isAarch64)
+      [ "--enable-tegra-experimental-api" "--enable-etnaviv-experimental-api" ]
     ++ stdenv.lib.optional stdenv.isDarwin "-C";
 
   crossAttrs.configureFlags = configureFlags ++ [ "--disable-intel" ];
diff --git a/pkgs/development/libraries/libelf/default.nix b/pkgs/development/libraries/libelf/default.nix
index bd0d23bd0cd..bb1dbe51765 100644
--- a/pkgs/development/libraries/libelf/default.nix
+++ b/pkgs/development/libraries/libelf/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl
-, gettext, glibc
+{ stdenv
+, fetchurl, autoreconfHook, gettext
 , buildPlatform, hostPlatform
 }:
 
@@ -17,12 +17,20 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  # Libelf's custom NLS macros fail to determine the catalog file extension on
-  # Darwin, so disable NLS for now.
-  # FIXME: Eventually make Gettext a build input on all platforms.
-  configureFlags = stdenv.lib.optional hostPlatform.isDarwin "--disable-nls";
-
-  nativeBuildInputs = [ gettext ];
+  configureFlags = []
+       # Configure check for dynamic lib support is broken, see
+       # http://lists.uclibc.org/pipermail/uclibc-cvs/2005-August/019383.html
+    ++ stdenv.lib.optional (hostPlatform != buildPlatform) "mr_cv_target_elf=yes"
+       # Libelf's custom NLS macros fail to determine the catalog file extension
+       # on Darwin, so disable NLS for now.
+    ++ stdenv.lib.optional hostPlatform.isDarwin "--disable-nls";
+
+  nativeBuildInputs = [ gettext ]
+       # Need to regenerate configure script with newer version in order to pass
+       # "mr_cv_target_elf=yes", but `autoreconfHook` brings in `makeWrapper`
+       # which doesn't work with the bootstrapTools bash, so can only do this
+       # for cross builds when `stdenv.shell` is a newer bash.
+    ++ stdenv.lib.optional (hostPlatform != buildPlatform) autoreconfHook;
 
   meta = {
     description = "ELF object file access library";
diff --git a/pkgs/development/libraries/libexif/default.nix b/pkgs/development/libraries/libexif/default.nix
index ebcba0fa155..5a8f5126680 100644
--- a/pkgs/development/libraries/libexif/default.nix
+++ b/pkgs/development/libraries/libexif/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gettext }:
+{ stdenv, fetchurl, fetchpatch, gettext }:
 
 stdenv.mkDerivation rec {
   name = "libexif-0.6.21";
@@ -8,6 +8,15 @@ stdenv.mkDerivation rec {
     sha256 = "06nlsibr3ylfwp28w8f5466l6drgrnydgxrm4jmxzrmk5svaxk8n";
   };
 
+  patches = [
+   (fetchpatch {
+     name = "CVE-2017-7544.patch";
+     url = https://sourceforge.net/p/libexif/bugs/_discuss/thread/fc394c4b/489a/attachment/xx.pat;
+     sha256 = "1qgk8hgnxr8d63jsc4vljxz9yg33mbml280dq4a6050rmk9wq4la";
+   })
+  ];
+  patchFlags = "-p0";
+
   buildInputs = [ gettext ];
 
   meta = {
diff --git a/pkgs/development/libraries/libextractor/default.nix b/pkgs/development/libraries/libextractor/default.nix
index a6fb4ec515a..81caa3e91ac 100644
--- a/pkgs/development/libraries/libextractor/default.nix
+++ b/pkgs/development/libraries/libextractor/default.nix
@@ -7,11 +7,11 @@ assert gtkSupport -> glib != null && gtk3 != null;
 assert videoSupport -> ffmpeg != null && libmpeg2 != null;
 
 stdenv.mkDerivation rec {
-  name = "libextractor-1.4";
+  name = "libextractor-1.6";
 
   src = fetchurl {
     url = "mirror://gnu/libextractor/${name}.tar.gz";
-    sha256 = "0v7ns5jhsyp1wzvbaydfgxnva5zd63gkzm9djhckmam9liq824l4";
+    sha256 = "17gnpgspdhfgcr27j8sn9105vb4lw22yqdrhic62l79q5v5avm16";
   };
 
   preConfigure =
diff --git a/pkgs/development/libraries/libfaketime/default.nix b/pkgs/development/libraries/libfaketime/default.nix
index c620254aacd..cedd5f98027 100644
--- a/pkgs/development/libraries/libfaketime/default.nix
+++ b/pkgs/development/libraries/libfaketime/default.nix
@@ -1,11 +1,12 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "libfaketime-0.9.6";
+  name = "libfaketime-${version}";
+  version = "0.9.7";
 
   src = fetchurl {
-    url = "http://www.code-wizards.com/projects/libfaketime/${name}.tar.gz";
-    sha256 = "1dw2lqsv2iqwxg51mdn25b4fjj3v357s0mc6ahxawqp210krg29s";
+    url = "https://github.com/wolfcw/libfaketime/archive/v${version}.tar.gz";
+    sha256 = "07l189881q0hybzmlpjyp7r5fwz23iafkm957bwy4gnmn9lg6rad";
   };
 
   patches = [
@@ -16,12 +17,9 @@ stdenv.mkDerivation rec {
     makeFlagsArray+=(PREFIX="$out" LIBDIRNAME=/lib)
   '';
 
-  # Work around "libfaketime.c:513:7: error: nonnull argument 'buf' compared to NULL [-Werror=nonnull-compare]".
-  NIX_CFLAGS_COMPILE = "-Wno-nonnull-compare";
-
   meta = with stdenv.lib; {
     description = "Report faked system time to programs without having to change the system-wide time";
-    homepage = http://www.code-wizards.com/projects/libfaketime/;
+    homepage = "https://github.com/wolfcw/libfaketime/";
     license = licenses.gpl2;
     platforms = platforms.all;
     maintainers = [ maintainers.bjornfor ];
diff --git a/pkgs/development/libraries/libfilezilla/default.nix b/pkgs/development/libraries/libfilezilla/default.nix
index 0df0f570b2e..84e3517835e 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.11.1";
+  version = "0.11.2";
 
   src = fetchurl {
     url = "http://download.filezilla-project.org/libfilezilla/${name}.tar.bz2";
-    sha256 = "1xv4is3zaz66h6iblj9pikapsjasjcbxx31bhkgn62xdq1sadfpc";
+    sha256 = "0wl42yxrha633dbh1vcbhrpsd7sv4zwskbmlpx549ygnzi39krcn";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/libftdi/1.x.nix b/pkgs/development/libraries/libftdi/1.x.nix
index 353c82aa193..8b75f85852e 100644
--- a/pkgs/development/libraries/libftdi/1.x.nix
+++ b/pkgs/development/libraries/libftdi/1.x.nix
@@ -9,11 +9,11 @@ assert pythonSupport -> python != null && swig != null;
 assert docSupport -> doxygen != null;
 
 stdenv.mkDerivation rec {
-  name = "libftdi1-1.3";
+  name = "libftdi1-1.4";
 
   src = fetchurl {
     url = "http://www.intra2net.com/en/developer/libftdi/download/${name}.tar.bz2";
-    sha256 = "1x41mbzh4qy7mrv2n86r2cr176rx03iacn0a99c3dkzv9g4rb34s";
+    sha256 = "0x0vncf6i92slgrn0h7ghkskqbglbs534220qa84d0qg114zndpc";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/libgcrypt/default.nix b/pkgs/development/libraries/libgcrypt/default.nix
index e32ba050c38..397000fc7d2 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.8.1";
+  version = "1.8.2";
 
   src = fetchurl {
     url = "mirror://gnupg/libgcrypt/${name}.tar.bz2";
-    sha256 = "1cvqd9jk5qshbh48yh3ixw4zyr4n5k50r3475rrh20xfn7w7aa3s";
+    sha256 = "01sca9m8hm6b5v8hmqsfdjhyz013869p1f0fxw9ln52qfnp4q1n8";
   };
 
   outputs = [ "out" "dev" "info" ];
diff --git a/pkgs/development/libraries/libgig/default.nix b/pkgs/development/libraries/libgig/default.nix
index 4adb7e53578..90d41e30502 100644
--- a/pkgs/development/libraries/libgig/default.nix
+++ b/pkgs/development/libraries/libgig/default.nix
@@ -1,19 +1,21 @@
-{ stdenv, fetchsvn, autoconf, automake, libsndfile, libtool, pkgconfig, libuuid }:
+{ stdenv, fetchurl, autoconf, automake, libsndfile, libtool, pkgconfig, libuuid }:
 
 stdenv.mkDerivation rec {
-  name = "libgig-svn-${version}";
-  version = "2334";
+  name = "libgig-${version}";
+  version = "4.1.0";
 
-  src = fetchsvn {
-    url = "https://svn.linuxsampler.org/svn/libgig/trunk";
-    rev = "${version}";
-    sha256 = "0i7sj3zm6banl5avjdxblx0mlbxxzbsbr4x5hsl2fhrdsv5dnxhc";
+  src = fetchurl {
+    url = "http://download.linuxsampler.org/packages/${name}.tar.bz2";
+    sha256 = "02xx6bqxzgkvrawwnzrnxx1ypk244q4kpwfd58266f9ji8kq18h6";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ autoconf automake libsndfile libtool libuuid ];
+  nativeBuildInputs = [ autoconf automake libtool pkgconfig ];
 
-  preConfigure = "make -f Makefile.cvs";
+  buildInputs = [ libsndfile libuuid ];
+
+  preConfigure = "make -f Makefile.svn";
+
+  enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
     homepage = http://www.linuxsampler.org;
diff --git a/pkgs/development/libraries/libgphoto2/default.upstream b/pkgs/development/libraries/libgphoto2/default.upstream
deleted file mode 100644
index 0029e695930..00000000000
--- a/pkgs/development/libraries/libgphoto2/default.upstream
+++ /dev/null
@@ -1,9 +0,0 @@
-url http://sourceforge.net/projects/gphoto/files/libgphoto/
-SF_version_dir
-version_link '[.]tar[.]bz2/download$'
-SF_redirect
-do_overwrite () {
-  ensure_hash
-  set_var_value version "$CURRENT_VERSION"
-  set_var_value sha256 "$CURRENT_HASH"
-}
diff --git a/pkgs/development/libraries/libgssglue/default.nix b/pkgs/development/libraries/libgssglue/default.nix
new file mode 100644
index 00000000000..612946f73ed
--- /dev/null
+++ b/pkgs/development/libraries/libgssglue/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, kerberos }:
+
+stdenv.mkDerivation rec {
+  name = "libgssglue-0.4";
+
+  src = fetchurl {
+    url = "http://www.citi.umich.edu/projects/nfsv4/linux/libgssglue/${name}.tar.gz";
+    sha256 = "0fh475kxzlabwz30wz3bf7i8kfqiqzhfahayx3jj79rba1sily9z";
+  };
+
+  postPatch = ''
+    sed s:/etc/gssapi_mech.conf:$out/etc/gssapi_mech.conf: -i src/g_initialize.c
+  '';
+
+  postInstall = ''
+    mkdir -p $out/etc
+    cat <<EOF > $out/etc/gssapi_mech.conf
+    ${kerberos}/lib/libgssapi_krb5.so mechglue_internal_krb5_init
+    EOF
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://www.citi.umich.edu/projects/nfsv4/linux/;
+    description = "Exports a gssapi interface which calls other random gssapi libraries";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ corngood ];
+  };
+}
diff --git a/pkgs/development/libraries/libguestfs/default.nix b/pkgs/development/libraries/libguestfs/default.nix
index bfdd0cf8fd7..e659b31d974 100644
--- a/pkgs/development/libraries/libguestfs/default.nix
+++ b/pkgs/development/libraries/libguestfs/default.nix
@@ -2,7 +2,10 @@
 , ncurses, cpio, gperf, perl, cdrkit, flex, bison, qemu, pcre, augeas, libxml2
 , acl, libcap, libcap_ng, libconfig, systemd, fuse, yajl, libvirt, hivex
 , gmp, readline, file, libintlperl, GetoptLong, SysVirt, numactl, xen, libapparmor
-, getopt, perlPackages, ocamlPackages }:
+, getopt, perlPackages, ocamlPackages
+, javaSupport ? false, jdk ? null }:
+
+assert javaSupport -> jdk != null;
 
 stdenv.mkDerivation rec {
   name = "libguestfs-${version}";
@@ -24,7 +27,8 @@ stdenv.mkDerivation rec {
     cdrkit flex bison qemu pcre augeas libxml2 acl libcap libcap_ng libconfig
     systemd fuse yajl libvirt gmp readline file hivex libintlperl GetoptLong
     SysVirt numactl xen libapparmor getopt perlPackages.ModuleBuild
-  ] ++ (with ocamlPackages; [ ocaml findlib ocamlbuild ocaml_libvirt ocaml_gettext ounit ]);
+  ] ++ (with ocamlPackages; [ ocaml findlib ocamlbuild ocaml_libvirt ocaml_gettext ounit ])
+    ++ stdenv.lib.optional javaSupport jdk;
 
   prePatch = ''
     # build-time scripts
@@ -40,7 +44,8 @@ stdenv.mkDerivation rec {
     # some scripts hardcore /usr/bin/env which is not available in the build env
     patchShebangs .
   '';
-  configureFlags = "--disable-appliance --disable-daemon";
+  configureFlags = [ "--disable-appliance" "--disable-daemon" ]
+    ++ stdenv.lib.optionals (!javaSupport) [ "--disable-java" "--without-java" ];
   patches = [ ./libguestfs-syms.patch ];
   NIX_CFLAGS_COMPILE="-I${libxml2.dev}/include/libxml2/";
   installFlags = "REALLY_INSTALL=yes";
diff --git a/pkgs/development/libraries/libhttpseverywhere/default.nix b/pkgs/development/libraries/libhttpseverywhere/default.nix
index 88a3ebbc4fb..c3405148242 100644
--- a/pkgs/development/libraries/libhttpseverywhere/default.nix
+++ b/pkgs/development/libraries/libhttpseverywhere/default.nix
@@ -1,7 +1,8 @@
-{stdenv, fetchurl, gnome3, glib, json_glib, libxml2, libarchive, libsoup, gobjectIntrospection, meson, ninja, pkgconfig,  valadoc}:
+{ stdenv, fetchurl, pkgconfig, meson, ninja, valadoc
+, gnome3, glib, json_glib, libarchive, libsoup, gobjectIntrospection }:
 
 stdenv.mkDerivation rec {
-  major = "0.4";
+  major = "0.6";
   minor = "5";
   version = "${major}.${minor}";
 
@@ -9,16 +10,20 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/libhttpseverywhere/${major}/libhttpseverywhere-${version}.tar.xz";
-    sha256 = "07sgcw285rl9wqr5k7srs3fj7fhgrrw6w780jx8wy8jw2bfwlvj2";
+    sha256 = "0ksf6vqjyjii29dvy5147dmgqlqsq4d70xxai0p2prkx4jrwgj3z";
   };
 
-  nativeBuildInputs = [ gnome3.vala valadoc  gobjectIntrospection meson ninja pkgconfig ];
-  buildInputs = [ glib gnome3.libgee libxml2 json_glib libsoup libarchive ];
+  nativeBuildInputs = [ gnome3.vala gobjectIntrospection meson ninja pkgconfig valadoc ];
+  buildInputs = [ glib gnome3.libgee json_glib libsoup libarchive ];
+
+  mesonFlags = "-Denable_valadoc=true";
 
   doCheck = true;
 
   checkPhase = "./httpseverywhere_test";
 
+  outputs = [ "out" "devdoc" ];
+
   meta = {
     description = "library to use HTTPSEverywhere in desktop applications";
     homepage    = https://git.gnome.org/browse/libhttpseverywhere;
diff --git a/pkgs/development/libraries/libiberty/default.nix b/pkgs/development/libraries/libiberty/default.nix
index 1f5ab2cf096..6608a3393b1 100644
--- a/pkgs/development/libraries/libiberty/default.nix
+++ b/pkgs/development/libraries/libiberty/default.nix
@@ -1,15 +1,18 @@
-{ stdenv, lib, fetchurl, gcc, staticBuild ? false }:
+{ stdenv, fetchurl, gcc, staticBuild ? false }:
 
 stdenv.mkDerivation rec {
   name = "libiberty-${gcc.cc.version}";
 
   inherit (gcc.cc) src;
 
+  outputs = [ "out" "dev" ];
+
   postUnpack = "sourceRoot=\${sourceRoot}/libiberty";
 
-  configureFlags = [ "--enable-install-libiberty" ] ++ lib.optional (!staticBuild) "--enable-shared";
+  configureFlags = [ "--enable-install-libiberty" ]
+    ++ stdenv.lib.optional (!staticBuild) "--enable-shared";
 
-  postInstall = lib.optionalString (!staticBuild) ''
+  postInstall = stdenv.lib.optionalString (!staticBuild) ''
     cp pic/libiberty.a $out/lib*/libiberty.a
   '';
 
@@ -17,7 +20,7 @@ stdenv.mkDerivation rec {
     homepage = http://gcc.gnu.org/;
     license = licenses.lgpl2;
     description = "Collection of subroutines used by various GNU programs";
-    maintainers = with maintainers; [ abbradar ];
+    maintainers = with maintainers; [ abbradar ericson2314 ];
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/libindicate/default.nix b/pkgs/development/libraries/libindicate/default.nix
index 9f75f17caee..9c7e48f8f6a 100644
--- a/pkgs/development/libraries/libindicate/default.nix
+++ b/pkgs/development/libraries/libindicate/default.nix
@@ -4,7 +4,7 @@
 , pkgconfig, autoconf
 , glib, dbus_glib, libdbusmenu-glib
 , gtkVersion, gtk2 ? null, gtk3 ? null
-, pythonPackages, gobjectIntrospection, vala_0_23, gnome_doc_utils
+, pythonPackages, gobjectIntrospection, vala, gnome_doc_utils
 , monoSupport ? false, mono ? null, gtk-sharp-2_0 ? null
  }:
 
@@ -24,11 +24,11 @@ in stdenv.mkDerivation rec {
     sha256 = "10am0ymajx633b33anf6b79j37k61z30v9vaf5f9fwk1x5cw1q21";
   };
 
-  nativeBuildInputs = [ pkgconfig autoconf ];
+  nativeBuildInputs = [ pkgconfig autoconf gobjectIntrospection vala gnome_doc_utils ];
 
   buildInputs = [
     glib dbus_glib libdbusmenu-glib
-    python pygobject2 pygtk gobjectIntrospection vala_0_23 gnome_doc_utils
+    python pygobject2 pygtk
   ] ++ (if gtkVersion == "2"
     then [ gtk2 ] ++ optionals monoSupport [ mono gtk-sharp-2_0 ]
     else [ gtk3 ]);
diff --git a/pkgs/development/libraries/libinput/default.nix b/pkgs/development/libraries/libinput/default.nix
index d39a71e16da..a0f7807786e 100644
--- a/pkgs/development/libraries/libinput/default.nix
+++ b/pkgs/development/libraries/libinput/default.nix
@@ -16,11 +16,11 @@ in
 with stdenv.lib;
 stdenv.mkDerivation rec {
   name = "libinput-${version}";
-  version = "1.9.1";
+  version = "1.9.3";
 
   src = fetchurl {
     url = "http://www.freedesktop.org/software/libinput/${name}.tar.xz";
-    sha256 = "1y3559146zlfizncky1jlly226i66vwikxhpdkw0jg8v47j0sy7h";
+    sha256 = "09wkc5qqk1k2a68cwfy4x853z8z35wf2qkijh66kacsvc2fjq394";
   };
 
   outputs = [ "out" "dev" ];
@@ -50,8 +50,6 @@ stdenv.mkDerivation rec {
 
   doCheck = testsSupport;
 
-  checkPhase = "meson test";
-
   meta = {
     description = "Handles input devices in Wayland compositors and provides a generic X.Org input driver";
     homepage    = http://www.freedesktop.org/wiki/Software/libinput;
diff --git a/pkgs/development/libraries/libjpeg-turbo/default.nix b/pkgs/development/libraries/libjpeg-turbo/default.nix
index 77f9d999de4..4ec0e5ebd9f 100644
--- a/pkgs/development/libraries/libjpeg-turbo/default.nix
+++ b/pkgs/development/libraries/libjpeg-turbo/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   name = "libjpeg-turbo-${version}";
-  version = "1.5.2";
+  version = "1.5.3";
 
   src = fetchurl {
     url = "mirror://sourceforge/libjpeg-turbo/${name}.tar.gz";
-    sha256 = "0a5m0psfp5952y5vrcs0nbdz1y9wqzg2ms0xwrx752034wxr964h";
+    sha256 = "08r5b5mywwrxv4axvq80dm31cklz81grczlzlxr2xqa6pgi90j5j";
   }; # github releases still need autotools, surprisingly
 
   patches =
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
+  doCheck = true; # not cross;
   checkTarget = "test";
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/libjson-rpc-cpp/default.nix b/pkgs/development/libraries/libjson-rpc-cpp/default.nix
index 7c0bc358ea9..87cae224685 100644
--- a/pkgs/development/libraries/libjson-rpc-cpp/default.nix
+++ b/pkgs/development/libraries/libjson-rpc-cpp/default.nix
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
              -DCMAKE_BUILD_TYPE=Release
   '';
 
-  installPhase = '' 
+  installPhase = ''
     mkdir -p $out
 
     function fixRunPath {
@@ -56,6 +56,8 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ cmake jsoncpp argtable curl libmicrohttpd doxygen catch ];
 
+  enableParallelBuilding = true;
+
   meta = with stdenv.lib; {
     description = "C++ framework for json-rpc (json remote procedure call)";
     homepage = https://github.com/cinemast/libjson-rpc-cpp;
diff --git a/pkgs/development/libraries/libkeyfinder/default.nix b/pkgs/development/libraries/libkeyfinder/default.nix
index 326d9c4f9d7..93f3b2a4f84 100644
--- a/pkgs/development/libraries/libkeyfinder/default.nix
+++ b/pkgs/development/libraries/libkeyfinder/default.nix
@@ -34,6 +34,5 @@ stdenv.mkDerivation rec {
     homepage = http://www.ibrahimshaath.co.uk/keyfinder/;
     license = licenses.gpl3Plus;
     platforms = platforms.linux;
-    maintainers = with maintainers; [ nckx ];
   };
 }
diff --git a/pkgs/development/libraries/liblcf/default.nix b/pkgs/development/libraries/liblcf/default.nix
new file mode 100644
index 00000000000..95b6b657fa2
--- /dev/null
+++ b/pkgs/development/libraries/liblcf/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, expat, icu }:
+
+stdenv.mkDerivation rec {
+  name = "liblcf-${version}";
+  version = "0.5.3";
+
+  src = fetchFromGitHub {
+    owner = "EasyRPG";
+    repo = "liblcf";
+    rev = version;
+    sha256 = "1y3pbl3jxan9f0cb1rxkibqjc0h23jm3jlwlv0xxn2pgw8l0fk34";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  buildInputs = [ expat icu ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/EasyRPG/liblcf;
+    license = licenses.mit;
+    maintainers = with maintainers; [ yegortimoshenko ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/liblouis/default.nix b/pkgs/development/libraries/liblouis/default.nix
new file mode 100644
index 00000000000..d3ddb99adad
--- /dev/null
+++ b/pkgs/development/libraries/liblouis/default.nix
@@ -0,0 +1,57 @@
+{ fetchFromGitHub, stdenv, autoreconfHook, pkgconfig, gettext, python3
+, texinfo, help2man, libyaml, perl
+}:
+
+let
+  version = "3.4.0";
+in stdenv.mkDerivation rec {
+  name = "liblouis-${version}";
+
+  src = fetchFromGitHub {
+    owner = "liblouis";
+    repo = "liblouis";
+    rev = "v${version}";
+    sha256 = "1b3vf6sq2iffdvj0r2q5g5k198camy3sq2nwfz391brpwivsnayh";
+  };
+
+  outputs = [ "out" "dev" "man" "info" "doc" ];
+
+  nativeBuildInputs = [
+    autoreconfHook pkgconfig gettext python3
+    # Docs, man, info
+    texinfo help2man
+  ];
+
+  buildInputs = [
+    # lou_checkYaml
+    libyaml
+    # maketable.d
+    perl
+  ];
+
+  configureFlags = [
+    # Required by Python bindings
+    "--enable-ucs4"
+  ];
+
+  postPatch = ''
+    patchShebangs tests
+    substituteInPlace python/louis/__init__.py.in --replace "###LIBLOUIS_SONAME###" "$out/lib/liblouis.so"
+  '';
+
+  postInstall = ''
+    pushd python
+    python setup.py install --prefix="$out" --optimize=1
+    popd
+  '';
+
+  doCheck = true;
+
+  meta = with stdenv.lib; {
+    description = "Open-source braille translator and back-translator";
+    homepage = http://liblouis.org/;
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/development/libraries/liblscp/default.nix b/pkgs/development/libraries/liblscp/default.nix
index c89b21de0d6..1a5a4baf808 100644
--- a/pkgs/development/libraries/liblscp/default.nix
+++ b/pkgs/development/libraries/liblscp/default.nix
@@ -1,19 +1,19 @@
-{ stdenv, fetchsvn, autoconf, automake, libtool, pkgconfig }:
+{ stdenv, fetchurl, autoconf, automake, libtool, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "liblscp-svn-${version}";
-  version = "2319";
+  name = "liblscp-${version}";
+  version = "0.6.0";
 
-  src = fetchsvn {
-    url = "https://svn.linuxsampler.org/svn/liblscp/trunk";
-    rev = "${version}";
-    sha256 = "0jgdy9gi9n8x2pqrbll9158vhx8293lnxv8vzl0szcincslgk7hi";
+  src = fetchurl {
+    url = "https://download.linuxsampler.org/packages/${name}.tar.gz";
+    sha256 = "1rl7ssdzj0z3658yvdijmb27n2lcwmplx4qxg5mwrm07pvs7i75k";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ autoconf automake libtool ];
+  nativeBuildInputs = [ autoconf automake libtool pkgconfig ];
 
-  preConfigure = "make -f Makefile.svn";
+  preConfigure = "make -f Makefile.git";
+
+  enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
     homepage = http://www.linuxsampler.org;
diff --git a/pkgs/development/libraries/libmicrohttpd/default.nix b/pkgs/development/libraries/libmicrohttpd/default.nix
index 68156c0c217..35928e6dbf9 100644
--- a/pkgs/development/libraries/libmicrohttpd/default.nix
+++ b/pkgs/development/libraries/libmicrohttpd/default.nix
@@ -1,11 +1,12 @@
 { stdenv, fetchurl, libgcrypt, curl, gnutls, pkgconfig, libiconv, libintlOrEmpty }:
 
 stdenv.mkDerivation rec {
-  name = "libmicrohttpd-0.9.55";
+  name = "libmicrohttpd-${version}";
+  version = "0.9.58";
 
   src = fetchurl {
     url = "mirror://gnu/libmicrohttpd/${name}.tar.gz";
-    sha256 = "1y6h1slav5l6k8zyb01dpw65dscdgxxgfa3a0z9qnn7jr66sn70c";
+    sha256 = "1wq17qvizis7bsyvyw1gnfycvivssncngziddnyrbzv2dhvy24bs";
   };
 
   outputs = [ "out" "dev" "devdoc" "info" ];
diff --git a/pkgs/development/libraries/libminc/default.nix b/pkgs/development/libraries/libminc/default.nix
index 217ce20c6cf..673b572c089 100644
--- a/pkgs/development/libraries/libminc/default.nix
+++ b/pkgs/development/libraries/libminc/default.nix
@@ -1,12 +1,14 @@
-{ stdenv, fetchurl, cmake, zlib, netcdf, hdf5 }:
+{ stdenv, fetchFromGitHub, cmake, zlib, netcdf, hdf5 }:
 
 stdenv.mkDerivation rec {
-  _name = "libminc";
-  name  = "${_name}-2.3.00";
+  name = "${pname}-2.3.00";
+  pname = "libminc";
 
-  src = fetchurl {
-    url = "https://github.com/BIC-MNI/${_name}/archive/${_name}-2-3-00.tar.gz";
-    sha256 = "04ngqx4wkssxs9qqcgq2bvfs1cldcycmpcx587wy3b3m6lwf004c";
+  src = fetchFromGitHub {
+    owner = "BIC-MNI";
+    repo = pname;
+    rev = builtins.replaceStrings [ "." ] [ "-" ] name;
+    sha256 = "1gv1rq1q1brhglll2256cm6sns77ph6fvgbzk3ihkzq46y07yi9s";
   };
 
   nativeBuildInputs = [ cmake ];
@@ -18,6 +20,8 @@ stdenv.mkDerivation rec {
   checkPhase = "ctest";
   doCheck = true;
 
+  enableParallelBuilding = true;
+
   meta = with stdenv.lib; {
     homepage = https://github.com/BIC-MNI/libminc;
     description = "Medical imaging library based on HDF5";
diff --git a/pkgs/development/libraries/libmpack/default.nix b/pkgs/development/libraries/libmpack/default.nix
index 9375a381052..2754c726da2 100644
--- a/pkgs/development/libraries/libmpack/default.nix
+++ b/pkgs/development/libraries/libmpack/default.nix
@@ -2,21 +2,18 @@
 
 stdenv.mkDerivation rec {
   name = "libmpack-${version}";
-  version = "1.0.3-rev${rev}";
-  rev = "80bd55ea677e70b041f65a4b99438c1f059cce4b";
+  version = "1.0.5";
   src = fetchFromGitHub {
     owner = "tarruda";
     repo = "libmpack";
-    inherit rev;
-    sha256 = "1whnbgxd5580h59kvc2xgx6ymw7nk9kz6r4ajgsfv6c6h2xbwbl3";
+    rev = version;
+    sha256 = "0rai5djdkjz7bsn025k5489in7r1amagw1pib0z4qns6b52kiar2";
   };
-  LIBTOOL = "libtool";
-  buildInputs = [ libtool ];
-  installPhase = ''
-    mkdir -p $out/lib/libmpack
-    cp -R build/* $out/lib/libmpack
-    rm -rf $out/lib/libmpack/debug
-  '';
+
+  nativeBuildInputs = [ libtool ];
+
+  makeFlags = [ "LIBTOOL=libtool" "PREFIX=$(out)" ];
+
   meta = with stdenv.lib; {
     description = "Simple implementation of msgpack in C";
     homepage = https://github.com/tarruda/libmpack/;
diff --git a/pkgs/development/libraries/libmpc/default.nix b/pkgs/development/libraries/libmpc/default.nix
index 4be59af6f0c..97366d24c36 100644
--- a/pkgs/development/libraries/libmpc/default.nix
+++ b/pkgs/development/libraries/libmpc/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   name = "libmpc-${version}"; # to avoid clash with the MPD client
 
   src = fetchurl {
-    url = "http://www.multiprecision.org/mpc/download/mpc-${version}.tar.gz";
+    url = "https://ftp.gnu.org/gnu/mpc/mpc-${version}.tar.gz";
     sha256 = "1hzci2zrrd7v3g1jk35qindq05hbl0bhjcyyisq9z209xb3fqzb1";
   };
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   CFLAGS = "-I${gmp.dev}/include";
 
-  doCheck = hostPlatform == buildPlatform;
+  doCheck = true; # not cross;
 
   meta = {
     description = "Library for multiprecision complex arithmetic with exact rounding";
diff --git a/pkgs/development/libraries/libmsgpack/1.4.nix b/pkgs/development/libraries/libmsgpack/1.4.nix
deleted file mode 100644
index 2779162feb8..00000000000
--- a/pkgs/development/libraries/libmsgpack/1.4.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{ callPackage, fetchFromGitHub, ... } @ args:
-
-callPackage ./generic.nix (args // rec {
-  version = "1.4.2";
-
-  src = fetchFromGitHub {
-    owner = "msgpack";
-    repo = "msgpack-c";
-    rev = "cpp-${version}";
-    sha256 = "0zlanifi5hmm303pzykpidq5jbapl891zwkwhkllfn8ab1jvzbaa";
-  };
-})
diff --git a/pkgs/development/libraries/libmsgpack/2.0.nix b/pkgs/development/libraries/libmsgpack/2.0.nix
deleted file mode 100644
index d8282b12687..00000000000
--- a/pkgs/development/libraries/libmsgpack/2.0.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{ callPackage, fetchFromGitHub, ... } @ args:
-
-callPackage ./generic.nix (args // rec {
-  version = "2.0.0";
-
-  src = fetchFromGitHub {
-    owner  = "msgpack";
-    repo   = "msgpack-c";
-    rev    = "cpp-${version}";
-    sha256 = "189m44pwpcpf7g4yhzfla4djqyp2kl54wxmwfaj94gwgj5s370i7";
-  };
-})
diff --git a/pkgs/development/libraries/libmypaint/default.nix b/pkgs/development/libraries/libmypaint/default.nix
new file mode 100644
index 00000000000..0583d94ef7f
--- /dev/null
+++ b/pkgs/development/libraries/libmypaint/default.nix
@@ -0,0 +1,32 @@
+{stdenv, autoconf, automake, fetchFromGitHub, glib, intltool, json_c, libtool, pkgconfig}:
+
+let
+  version = "1.3.0";
+in stdenv.mkDerivation rec {
+  name = "libmypaint-${version}";
+
+  src = fetchFromGitHub {
+    owner = "mypaint";
+    repo = "libmypaint";
+    rev = "v${version}";
+    sha256 = "0b7aynr6ggigwhjkfzi8x3dwz15blj4grkg9hysbgjh6lvzpy9jc";
+  };
+
+  nativeBuildInputs = [ autoconf automake intltool libtool pkgconfig ];
+
+  buildInputs = [ glib ];
+
+  propagatedBuildInputs = [ json_c ]; # for libmypaint.pc
+
+  doCheck = true;
+
+  preConfigure = "./autogen.sh";
+
+  meta = with stdenv.lib; {
+    homepage = http://mypaint.org/;
+    description = "Library for making brushstrokes which is used by MyPaint and other projects";
+    license = licenses.isc;
+    maintainers = with maintainers; [ goibhniu jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/development/libraries/libmysqlconnectorcpp/default.nix b/pkgs/development/libraries/libmysqlconnectorcpp/default.nix
index 3905ba1b271..c184e647d28 100644
--- a/pkgs/development/libraries/libmysqlconnectorcpp/default.nix
+++ b/pkgs/development/libraries/libmysqlconnectorcpp/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   cmakeFlags = [ "-DMYSQL_LIB_DIR=${mysql}/lib" ];
 
   meta = {
-    homepage = http://dev.mysql.com/downloads/connector/cpp/;
+    homepage = https://dev.mysql.com/downloads/connector/cpp/;
     description = "C++ library for connecting to mysql servers.";
     license = stdenv.lib.licenses.gpl2;
     platforms = stdenv.lib.platforms.unix;
diff --git a/pkgs/development/libraries/libnetfilter_conntrack/default.nix b/pkgs/development/libraries/libnetfilter_conntrack/default.nix
index a94bf28cd97..17dea7b3d7d 100644
--- a/pkgs/development/libraries/libnetfilter_conntrack/default.nix
+++ b/pkgs/development/libraries/libnetfilter_conntrack/default.nix
@@ -24,6 +24,5 @@ stdenv.mkDerivation rec {
     homepage = http://netfilter.org/projects/libnetfilter_conntrack/;
     license = licenses.gpl2Plus;
     platforms = platforms.linux;
-    maintainers = with maintainers; [ nckx ];
   };
 }
diff --git a/pkgs/development/libraries/libnetfilter_log/default.nix b/pkgs/development/libraries/libnetfilter_log/default.nix
index e3c8447549d..f660cd7a781 100644
--- a/pkgs/development/libraries/libnetfilter_log/default.nix
+++ b/pkgs/development/libraries/libnetfilter_log/default.nix
@@ -24,6 +24,6 @@ stdenv.mkDerivation rec {
     homepage = http://netfilter.org/projects/libnetfilter_log/;
     license = licenses.gpl2Plus;
     platforms = platforms.linux;
-    maintainers = with maintainers; [ orivej nckx ];
+    maintainers = with maintainers; [ orivej ];
   };
 }
diff --git a/pkgs/development/libraries/libnetfilter_queue/default.nix b/pkgs/development/libraries/libnetfilter_queue/default.nix
index 5de9409b729..12a45d088ef 100644
--- a/pkgs/development/libraries/libnetfilter_queue/default.nix
+++ b/pkgs/development/libraries/libnetfilter_queue/default.nix
@@ -1,11 +1,12 @@
 { stdenv, fetchurl, pkgconfig, libmnl, libnfnetlink }:
 
 stdenv.mkDerivation rec {
-  name = "libnetfilter_queue-1.0.2";
+  version = "1.0.3";
+  name = "libnetfilter_queue-${version}";
 
   src = fetchurl {
-    url = "ftp://ftp.netfilter.org/pub/libnetfilter_queue/${name}.tar.bz2";
-    sha256 = "0chsmj9ky80068vn458ijz9sh4sk5yc08dw2d6b8yddybpmr1143";
+    url = "https://www.netfilter.org/projects/libnetfilter_queue/files/${name}.tar.bz2";
+    sha256 = "0x77m1fvbqzz5z64jz59fb6j8dvv8b9pg4fmznqwax4x6imjcncq";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/libnftnl/default.nix b/pkgs/development/libraries/libnftnl/default.nix
index 074c1a9dfd2..ad8c7626661 100644
--- a/pkgs/development/libraries/libnftnl/default.nix
+++ b/pkgs/development/libraries/libnftnl/default.nix
@@ -1,11 +1,12 @@
 { stdenv, fetchurl, pkgconfig, libmnl }:
 
 stdenv.mkDerivation rec {
-  name = "libnftnl-1.0.7";
+  version = "1.0.9";
+  name = "libnftnl-${version}";
 
   src = fetchurl {
-    url = "http://netfilter.org/projects/libnftnl/files/${name}.tar.bz2";
-    sha256 = "10irjrylcfkbp11617yr19vpfhgl54w0kw02jhj0i1abqv5nxdlv";
+    url = "https://netfilter.org/projects/libnftnl/files/${name}.tar.bz2";
+    sha256 = "0d9nkdbdck8sg6msysqyv3m9kjr9sjif5amf26dfa0g3mqjdihgy";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/libopcodes/default.nix b/pkgs/development/libraries/libopcodes/default.nix
new file mode 100644
index 00000000000..d6d6989761b
--- /dev/null
+++ b/pkgs/development/libraries/libopcodes/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, buildPackages
+, fetchurl, autoreconfHook264, bison, binutils-raw
+, libiberty, libbfd
+}:
+
+stdenv.mkDerivation rec {
+  name = "libopcodes-${version}";
+  inherit (binutils-raw.bintools) version src;
+
+  outputs = [ "out" "dev" ];
+
+  patches = binutils-raw.bintools.patches ++ [
+    ../../tools/misc/binutils/build-components-separately.patch
+  ];
+
+  # We just want to build libopcodes
+  postPatch = ''
+    cd opcodes
+    find . ../include/opcode -type f -exec sed {} -i -e 's/"bfd.h"/<bfd.h>/' \;
+  '';
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ autoreconfHook264 bison ];
+  buildInputs = [ libiberty ];
+  # dis-asm.h includes bfd.h
+  propagatedBuildInputs = [ libbfd ];
+
+  configurePlatforms = [ "build" "host" ];
+  configureFlags = [
+    "--enable-targets=all" "--enable-64-bit-bfd"
+    "--enable-install-libbfd"
+    "--enable-shared"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A library from binutils for manipulating machine code";
+    homepage = http://www.gnu.org/software/binutils/;
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ ericson2314 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/development/libraries/libosinfo/default.nix b/pkgs/development/libraries/libosinfo/default.nix
index db534d20c89..a0924e791e3 100644
--- a/pkgs/development/libraries/libosinfo/default.nix
+++ b/pkgs/development/libraries/libosinfo/default.nix
@@ -1,23 +1,43 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gobjectIntrospection, libsoup
-, libxslt, check, vala_0_23 ? null
+{ stdenv, fetchurl, pkgconfig, intltool, gobjectIntrospection, gtk_doc, docbook_xsl
+, glib, libsoup, libxml2, libxslt, check, curl, perl, hwdata, osinfo-db, vala ? null
 }:
 
 stdenv.mkDerivation rec {
-  name = "libosinfo-0.2.12";
+  name = "libosinfo-1.1.0";
 
   src = fetchurl {
-    url = "https://fedorahosted.org/releases/l/i/libosinfo/${name}.tar.gz";
-    sha256 = "1vcg8ylh7q69s9y6hj94dqfffwfbann3i28yqgfc01navf6yl07s";
+    url = "https://releases.pagure.org/libosinfo/${name}.tar.gz";
+    sha256 = "0diigllgni6m0sc2h8aid6hmyaq9qb54pm5305m0irfsm2j463v0";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [
-    intltool gobjectIntrospection libsoup libxslt check vala_0_23
+  outputs = [ "out" "dev" "devdoc" ];
+
+  nativeBuildInputs = [
+    pkgconfig vala intltool gobjectIntrospection gtk_doc docbook_xsl
+  ] ++ stdenv.lib.optionals doCheck checkInputs;
+  checkInputs = [ check curl perl ];
+  buildInputs = [ glib libsoup libxml2 libxslt ];
+
+  patches = [
+    ./osinfo-db-data-dir.patch
+  ];
+
+  postPatch = ''
+    patchShebangs .
+    substituteInPlace osinfo/osinfo_loader.c --subst-var-by OSINFO_DB_DATA_DIR "${osinfo-db}/share"
+  '';
+
+  configureFlags = [
+    "--with-usb-ids-path=${hwdata}/data/hwdata/usb.ids"
+    "--with-pci-ids-path=${hwdata}/data/hwdata/pci.ids"
+    "--enable-gtk-doc"
   ];
 
+  doCheck = true;
+
   meta = with stdenv.lib; {
-    description = "Info about OSs, hypervisors and (virtual) hardware devices";
-    homepage = http://libosinfo.org/;
+    description = "GObject based library API for managing information about operating systems, hypervisors and the (virtual) hardware devices they can support";
+    homepage = https://libosinfo.org/;
     license = licenses.lgpl2Plus;
     platforms = platforms.linux;
     maintainers = [ maintainers.bjornfor ];
diff --git a/pkgs/development/libraries/libosinfo/osinfo-db-data-dir.patch b/pkgs/development/libraries/libosinfo/osinfo-db-data-dir.patch
new file mode 100644
index 00000000000..8d202a92d09
--- /dev/null
+++ b/pkgs/development/libraries/libosinfo/osinfo-db-data-dir.patch
@@ -0,0 +1,11 @@
+--- a/osinfo/osinfo_loader.c
++++ b/osinfo/osinfo_loader.c
+@@ -2304,7 +2304,7 @@
+     } else {
+         path = g_getenv("OSINFO_SYSTEM_DIR");
+         if (!path)
+-            path = DATA_DIR "/osinfo";
++            path = "@OSINFO_DB_DATA_DIR@/osinfo";
+ 
+         file = g_file_new_for_path(path);
+     }
diff --git a/pkgs/development/libraries/libp11/default.nix b/pkgs/development/libraries/libp11/default.nix
index 26e754317df..54e2616e782 100644
--- a/pkgs/development/libraries/libp11/default.nix
+++ b/pkgs/development/libraries/libp11/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "libp11-${version}";
-  version = "0.4.4";
+  version = "0.4.7";
 
   src = fetchFromGitHub {
     owner = "OpenSC";
     repo = "libp11";
     rev = name;
-    sha256 = "1jnpnwipmw3skw112qff36w046nyz5amiil228rn5divpkvx4axa";
+    sha256 = "0n1i0pxj6l0vdq8gpdwfp5p9qd7wkymg0lpy6a17ix8hpqsljlhr";
   };
 
   makeFlags = [ "DESTDIR=$(out)" "PREFIX=" ];
diff --git a/pkgs/development/libraries/libpcap/default.nix b/pkgs/development/libraries/libpcap/default.nix
index 0cd9d758725..bef5f9a9da3 100644
--- a/pkgs/development/libraries/libpcap/default.nix
+++ b/pkgs/development/libraries/libpcap/default.nix
@@ -26,6 +26,15 @@ stdenv.mkDerivation rec {
       url    = "https://sources.debian.net/data/main/libp/libpcap/1.8.1-3/debian/patches/disable-remote.diff";
       sha256 = "0dvjax9c0spvq8cdjnkbnm65wlzaml259yragf95kzg611vszfmj";
     })
+    # See https://github.com/wjt/bustle/commit/f62cf6bfa662af4ae39effbbd4891bc619e3b4e9
+    (fetchpatch {
+      url    = "https://github.com/the-tcpdump-group/libpcap/commit/2be9c29d45fb1fab8e9549342a30c160b7dea3e1.patch";
+      sha256 = "1g8mh942vr0abn48g0bdvi4gmhq1bz0l80276603y7064qhy3wq5";
+    })
+    (fetchpatch {
+      url    = "https://github.com/the-tcpdump-group/libpcap/commit/1a6b088a88886eac782008f37a7219a32b86da45.patch";
+      sha256 = "1n5ylm7ch3i1lh4y2q16b0vabgym8g8mqiqxpqcdkjdn05c1wflr";
+    })
   ];
 
   preInstall = ''mkdir -p $out/bin'';
diff --git a/pkgs/development/libraries/libpng/default.nix b/pkgs/development/libraries/libpng/default.nix
index c4a6a246b90..5ad9cf1e7b7 100644
--- a/pkgs/development/libraries/libpng/default.nix
+++ b/pkgs/development/libraries/libpng/default.nix
@@ -30,7 +30,7 @@ in stdenv.mkDerivation rec {
 
   # it's hard to cross-run tests and some check programs didn't compile anyway
   makeFlags = stdenv.lib.optional (!doCheck) "check_PROGRAMS=";
-  doCheck = hostPlatform == buildPlatform;
+  doCheck = true; # not cross;
 
   passthru = { inherit zlib; };
 
diff --git a/pkgs/development/libraries/libpsl/default.nix b/pkgs/development/libraries/libpsl/default.nix
index c35c7e1bc0f..b1100d00f3e 100644
--- a/pkgs/development/libraries/libpsl/default.nix
+++ b/pkgs/development/libraries/libpsl/default.nix
@@ -64,6 +64,5 @@ in stdenv.mkDerivation rec {
     homepage = http://rockdaboot.github.io/libpsl/;
     license = licenses.mit;
     platforms = with platforms; linux ++ darwin;
-    maintainers = with maintainers; [ nckx ];
   };
 }
diff --git a/pkgs/development/libraries/libqmatrixclient/default.nix b/pkgs/development/libraries/libqmatrixclient/default.nix
new file mode 100644
index 00000000000..f537013d2fe
--- /dev/null
+++ b/pkgs/development/libraries/libqmatrixclient/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchFromGitHub, cmake
+, qtbase }:
+
+# This doesn't actually do anything really yet as it doesn't support dynamic building
+# When it does, quaternion and tensor should use it
+
+stdenv.mkDerivation rec {
+  name = "libqmatrixclient-${version}";
+  version = "0.2";
+
+  src = fetchFromGitHub {
+    owner  = "QMatrixClient";
+    repo   = "libqmatrixclient";
+    rev    = "v${version}-q0.0.5";
+    sha256 = "1m53yxsqjxv2jq0h1xipwsgaj5rca4fk4cl3azgvmf19l9yn00ck";
+  };
+
+  buildInputs = [ qtbase ];
+
+  nativeBuildInputs = [ cmake ];
+
+  enableParallelBuilding = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm644 -t $out/lib *.a
+
+    runHook postInstall
+  '';
+
+  meta = with stdenv.lib; {
+    description= "A Qt5 library to write cross-platfrom clients for Matrix";
+    homepage = https://matrix.org/docs/projects/sdk/libqmatrixclient.html;
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ peterhoeg ];
+    hydraPlatforms = [ ];
+  };
+}
diff --git a/pkgs/development/libraries/librdf/redland.nix b/pkgs/development/libraries/librdf/redland.nix
index 8e6fa005635..402af5d6f58 100644
--- a/pkgs/development/libraries/librdf/redland.nix
+++ b/pkgs/development/libraries/librdf/redland.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ perl pkgconfig ];
 
   buildInputs = [ openssl libxslt curl pcre libxml2 ]
-    ++ stdenv.lib.optional withMysql mysql
+    ++ stdenv.lib.optional withMysql mysql.connector-c
     ++ stdenv.lib.optional withSqlite sqlite
     ++ stdenv.lib.optional withPostgresql postgresql
     ++ stdenv.lib.optional withBdb db;
diff --git a/pkgs/development/libraries/libre/default.nix b/pkgs/development/libraries/libre/default.nix
index 8bef305a0ec..d65fdc83396 100644
--- a/pkgs/development/libraries/libre/default.nix
+++ b/pkgs/development/libraries/libre/default.nix
@@ -1,16 +1,13 @@
 {stdenv, fetchurl, zlib, openssl}:
 stdenv.mkDerivation rec {
-  version = "0.5.1";
+  version = "0.5.6";
   name = "libre-${version}";
-  src=fetchurl {
+  src = fetchurl {
     url = "http://www.creytiv.com/pub/re-${version}.tar.gz";
-    sha256 = "1qs6gpflgwic2pp1nplhhyl585h9q0kf74h5z29ajr5ij0j65rsa";
+    sha256 = "0sfz5c7b05crahblanrrvwca092qaqzhjkbkva58jbqnmlk9h4d3";
   };
-  buildInputs = [zlib openssl];
-  makeFlags = [
-    "USE_ZLIB=1" "USE_OPENSSL=1" 
-    ''PREFIX=$(out)''
-  ]
+  buildInputs = [ zlib openssl ];
+  makeFlags = [ "USE_ZLIB=1" "USE_OPENSSL=1" "PREFIX=$(out)" ]
   ++ stdenv.lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${stdenv.cc.cc}"
   ++ stdenv.lib.optional (stdenv.cc.libc != null) "SYSROOT=${stdenv.lib.getDev stdenv.cc.libc}"
   ;
diff --git a/pkgs/development/libraries/librem/default.nix b/pkgs/development/libraries/librem/default.nix
index a3e98d260ce..f6e041e5732 100644
--- a/pkgs/development/libraries/librem/default.nix
+++ b/pkgs/development/libraries/librem/default.nix
@@ -1,10 +1,10 @@
 {stdenv, fetchurl, zlib, openssl, libre}:
 stdenv.mkDerivation rec {
-  version = "0.5.0";
+  version = "0.5.2";
   name = "librem-${version}";
   src=fetchurl {
     url = "http://www.creytiv.com/pub/rem-${version}.tar.gz";
-    sha256 = "1n1ajy1ccw0xw6bndad4js2pnj977s2angzs7lawadh7x5wnalbb";
+    sha256 = "1sv4986yyq42irk9alwp20gc3r5y0r6kix15sl8qmljgxn0lxigv";
   };
   buildInputs = [zlib openssl libre];
   makeFlags = [
diff --git a/pkgs/development/libraries/librep/setup-hook.sh b/pkgs/development/libraries/librep/setup-hook.sh
index 420d63d6c51..4d875b69330 100644
--- a/pkgs/development/libraries/librep/setup-hook.sh
+++ b/pkgs/development/libraries/librep/setup-hook.sh
@@ -2,4 +2,4 @@ addRepDLLoadPath () {
     addToSearchPath REP_DL_LOAD_PATH $1/lib/rep
 }
 
-envHooks+=(addRepDLLoadPath)
+addEnvHooks "$hostOffset" addRepDLLoadPath
diff --git a/pkgs/development/libraries/libressl/default.nix b/pkgs/development/libraries/libressl/default.nix
index 4818a720a30..ae03ef7ecb9 100644
--- a/pkgs/development/libraries/libressl/default.nix
+++ b/pkgs/development/libraries/libressl/default.nix
@@ -33,7 +33,7 @@ in {
   };
 
   libressl_2_6 = generic {
-    version = "2.6.2";
-    sha256 = "0y64grb2zx98rjp2lbwihyhbml4z5ih3v7ydbxdvmabj5d4x4adh";
+    version = "2.6.4";
+    sha256 = "07yi37a2ghsgj2b4w30q1s4d2inqnix7ika1m21y57p9z71212k3";
   };
 }
diff --git a/pkgs/development/libraries/libsecret/default.nix b/pkgs/development/libraries/libsecret/default.nix
index 0f8207e83c8..75438e00570 100644
--- a/pkgs/development/libraries/libsecret/default.nix
+++ b/pkgs/development/libraries/libsecret/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, glib, pkgconfig, intltool, libxslt, docbook_xsl, gtk_doc
-, libgcrypt, gobjectIntrospection, vala_0_32 }:
+, libgcrypt, gobjectIntrospection, vala_0_38 }:
 let
   version = "0.18.5";
 in
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ glib ];
   nativeBuildInputs = [ pkgconfig intltool libxslt docbook_xsl ];
-  buildInputs = [ libgcrypt gobjectIntrospection vala_0_32 ];
+  buildInputs = [ libgcrypt gobjectIntrospection vala_0_38 ];
   # optional: build docs with gtk-doc? (probably needs a flag as well)
 
   meta = {
diff --git a/pkgs/development/libraries/libserialport/default.nix b/pkgs/development/libraries/libserialport/default.nix
index 812847ea123..90f0afa5796 100644
--- a/pkgs/development/libraries/libserialport/default.nix
+++ b/pkgs/development/libraries/libserialport/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
   name = "libserialport-0.1.1";
 
   src = fetchurl {
-    url = "http://sigrok.org/download/source/libserialport/${name}.tar.gz";
+    url = "https://sigrok.org/download/source/libserialport/${name}.tar.gz";
     sha256 = "17ajlwgvyyrap8z7f16zcs59pksvncwbmd3mzf98wj7zqgczjaja";
   };
 
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "Cross-platform shared library for serial port access";
-    homepage = http://sigrok.org/;
+    homepage = https://sigrok.org/;
     license = licenses.gpl3Plus;
     # macOS, Windows and Android is also supported (according to upstream).
     platforms = platforms.linux;
diff --git a/pkgs/development/libraries/libsexy/default.nix b/pkgs/development/libraries/libsexy/default.nix
index c8751c3e5dd..49cdb2c95ba 100644
--- a/pkgs/development/libraries/libsexy/default.nix
+++ b/pkgs/development/libraries/libsexy/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
 
   meta = with stdenv.lib; {
     description = "A collection of GTK+ widgets";
-    homepage = http://blog.chipx86.com/tag/libsexy/;
+    homepage = https://blog.chipx86.com/tag/libsexy/;
     license = licenses.lgpl21;
     maintainers = with maintainers; [ ];
     platforms = platforms.unix;
diff --git a/pkgs/development/libraries/libsigcxx/default.nix b/pkgs/development/libraries/libsigcxx/default.nix
index 4a309a87f2e..f6bfff78fa2 100644
--- a/pkgs/development/libraries/libsigcxx/default.nix
+++ b/pkgs/development/libraries/libsigcxx/default.nix
@@ -10,11 +10,6 @@ stdenv.mkDerivation rec {
     url = "mirror://gnome/sources/libsigc++/${ver_maj}/${name}.tar.xz";
     sha256 = "f843d6346260bfcb4426259e314512b99e296e8ca241d771d21ac64f28298d81";
   };
-  patches = [(fetchpatch {
-    url = "https://anonscm.debian.org/cgit/collab-maint/libsigc++-2.0.git/plain"
-      + "/debian/patches/0002-Enforce-c-11-via-pkg-config.patch?id=d451a4d195b1";
-    sha256 = "19g19473syp2z3kg8vdrli89lm9kcvaqajkqfmdig1vfpkbq0nci";
-  })];
 
   nativeBuildInputs = [ pkgconfig gnum4 ];
 
diff --git a/pkgs/development/libraries/libsigsegv/2.5.nix b/pkgs/development/libraries/libsigsegv/2.5.nix
deleted file mode 100644
index fd453defe71..00000000000
--- a/pkgs/development/libraries/libsigsegv/2.5.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{ stdenv, fetchurl
-, enableSigbusFix ? false # required by kernels < 3.18.6
-}:
-
-stdenv.mkDerivation rec {
-  name = "libsigsegv-2.5";
-
-  src = fetchurl {
-    url = "mirror://gnu/libsigsegv/${name}.tar.gz";
-    sha256 = "0fvcsq9msi63vrbpvks6mqkrnls5cfy6bzww063sqhk2h49vsyyg";
-  };
-
-  patches = stdenv.lib.optional enableSigbusFix ./sigbus_fix.patch;
-
-  meta = {
-    homepage = http://libsigsegv.sf.net;
-    description = "A library for handling page faults in user mode";
-    branch = "2.5";
-    platforms = stdenv.lib.platforms.linux;
-  };
-
-  doCheck = true;
-}
diff --git a/pkgs/development/libraries/libsigsegv/default.nix b/pkgs/development/libraries/libsigsegv/default.nix
index 8e1079bfbc8..8152c1ea852 100644
--- a/pkgs/development/libraries/libsigsegv/default.nix
+++ b/pkgs/development/libraries/libsigsegv/default.nix
@@ -4,16 +4,16 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "libsigsegv-2.11";
+  name = "libsigsegv-2.12";
 
   src = fetchurl {
     url = "mirror://gnu/libsigsegv/${name}.tar.gz";
-    sha256 = "063swdvq7mbmc1clv0rnh20grwln1zfc2qnm0sa1hivcxyr2wz6x";
+    sha256 = "1dlhqf4igzpqayms25lkhycjq1ccavisx8cnb3y4zapbkqsszq9s";
   };
 
   patches = if enableSigbusFix then [ ./sigbus_fix.patch ] else null;
 
-  doCheck = hostPlatform == buildPlatform;
+  doCheck = true; # not cross;
 
   meta = {
     homepage = http://www.gnu.org/software/libsigsegv/;
diff --git a/pkgs/development/libraries/libskk/default.nix b/pkgs/development/libraries/libskk/default.nix
new file mode 100644
index 00000000000..5e36d068869
--- /dev/null
+++ b/pkgs/development/libraries/libskk/default.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchurl, fetchFromGitHub,
+  libtool, gettext, pkgconfig,
+  vala, gnome_common, gobjectIntrospection,
+  libgee, json_glib, skk-dicts }:
+
+stdenv.mkDerivation rec {
+  name = "libskk-${version}";
+  version = "1.0.3";
+
+  src = fetchFromGitHub {
+    owner = "ueno";
+    repo = "libskk";
+    rev = version;
+    sha256 = "092bjir866f350s4prq9q0yg34s91vmr8wbgf2vh3kcax1yj1axm";
+  };
+
+  buildInputs = [ skk-dicts ];
+  nativeBuildInputs = [ vala gnome_common gobjectIntrospection libtool gettext pkgconfig ];
+  propagatedBuildInputs = [ libgee json_glib ];
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  # link SKK-JISYO.L from skkdicts for the bundled tool `skk`
+  preInstall = ''
+    dictDir=$out/share/skk
+    mkdir -p $dictDir
+    ln -s ${skk-dicts}/share/SKK-JISYO.L $dictDir/
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "A library to deal with Japanese kana-to-kanji conversion method";
+    longDescription = ''
+      Libskk is a library that implements basic features of SKK including:
+      new word registration, completion, numeric conversion, abbrev mode, kuten input,
+      hankaku-katakana input, Lisp expression evaluation (concat only), and re-conversion.
+      It also supports various typing rules including: romaji-to-kana, AZIK, TUT-Code, and NICOLA,
+      as well as various dictionary types including: file dictionary (such as SKK-JISYO.[SML]),
+      user dictionary, skkserv, and CDB format dictionary.
+    '';
+    homepage = https://github.com/ueno/libskk;
+    license = stdenv.lib.licenses.gpl3Plus;
+    maintainers = with stdenv.lib.maintainers; [ yuriaisaka ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/libsnark/darwin-fix-clock-gettime.patch b/pkgs/development/libraries/libsnark/darwin-fix-clock-gettime.patch
new file mode 100644
index 00000000000..2eee84d1c4b
--- /dev/null
+++ b/pkgs/development/libraries/libsnark/darwin-fix-clock-gettime.patch
@@ -0,0 +1,41 @@
+Adapted from https://github.com/zcash/libsnark/pull/10
+
+diff --git a/depends/libff/libff/common/profiling.cpp b/depends/libff/libff/common/profiling.cpp
+index f2a1985..319149c 100755
+--- a/depends/libff/libff/common/profiling.cpp
++++ b/depends/libff/libff/common/profiling.cpp
+@@ -27,6 +27,13 @@
+ #include <proc/readproc.h>
+ #endif
+ 
++#ifdef __MACH__
++#include <time.h>
++#include <sys/time.h>
++#include <mach/clock.h>
++#include <mach/mach.h>
++#endif
++
+ namespace libff {
+ 
+ long long get_nsec_time()
+@@ -42,10 +49,20 @@ long long get_nsec_cpu_time()
+ 	return 0;
+ #else
+     ::timespec ts;
++#ifdef __MACH__
++    clock_serv_t cclock;
++    mach_timespec_t mts;
++    host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
++    clock_get_time(cclock, &mts);
++    mach_port_deallocate(mach_task_self(), cclock);
++    ts.tv_sec = mts.tv_sec;
++    ts.tv_nsec = mts.tv_nsec;
++#else
+     if ( ::clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) )
+         throw ::std::runtime_error("clock_gettime(CLOCK_PROCESS_CPUTIME_ID) failed");
+         // If we expected this to work, don't silently ignore failures, because that would hide the problem and incur an unnecessarily system-call overhead. So if we ever observe this exception, we should probably add a suitable #ifdef .
+         //TODO: clock_gettime(CLOCK_PROCESS_CPUTIME_ID) is not supported by native Windows. What about Cygwin? Should we #ifdef on CLOCK_PROCESS_CPUTIME_ID or on __linux__?
++#endif
+     return ts.tv_sec * 1000000000ll + ts.tv_nsec;
+ #endif
+ }
diff --git a/pkgs/development/libraries/libsnark/default.nix b/pkgs/development/libraries/libsnark/default.nix
new file mode 100644
index 00000000000..578053bbb42
--- /dev/null
+++ b/pkgs/development/libraries/libsnark/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, openssl, boost, gmp, procps, fetchpatch, patchutils }:
+
+let
+  rev = "9e6b19ff15bc19fba5da1707ba18e7f160e5ed07";
+  inherit (stdenv) lib;
+in stdenv.mkDerivation rec {
+  name = "libsnark-pre${version}";
+  version = stdenv.lib.substring 0 8 rev;
+
+  buildInputs = [ cmake pkgconfig openssl boost gmp ] ++ lib.optional stdenv.hostPlatform.isLinux procps;
+
+  cmakeFlags = lib.optionals stdenv.hostPlatform.isDarwin [ "-DWITH_PROCPS=OFF" "-DWITH_SUPERCOP=OFF" ];
+
+  src = fetchFromGitHub {
+    inherit rev;
+    owner           = "scipr-lab";
+    repo            = "libsnark";
+    sha256          = "13f02qp2fmfhvxlp4xi69m0l8r5nq913l2f0zwdk7hl46lprfdca";
+    fetchSubmodules = true;
+  };
+
+  patches = [ ./darwin-fix-clock-gettime.patch ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "C++ library for zkSNARKs";
+    homepage = https://github.com/scipr-lab/libsnark;
+    license = licenses.mit;
+    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+  };
+}
diff --git a/pkgs/development/libraries/libsndfile/default.nix b/pkgs/development/libraries/libsndfile/default.nix
index 53d927219e2..a68b5b2b6d5 100644
--- a/pkgs/development/libraries/libsndfile/default.nix
+++ b/pkgs/development/libraries/libsndfile/default.nix
@@ -11,25 +11,30 @@ stdenv.mkDerivation rec {
   };
 
   patches = [
-    # CVE-2017-12562
     (fetchurl {
-       url = "https://github.com/erikd/libsndfile/commit/cf7a8182c2642c50f1cf90dddea9ce96a8bad2e8.patch";
-       sha256 = "1jg3wq30wdn9nv52mcyv6jyi4d80h4r1h9p96czcria7l91yh4sy";
+      name = "CVE-2017-12562.patch";
+      url = "https://github.com/erikd/libsndfile/commit/cf7a8182c2642c50f1cf90dddea9ce96a8bad2e8.patch";
+      sha256 = "1jg3wq30wdn9nv52mcyv6jyi4d80h4r1h9p96czcria7l91yh4sy";
     })
-    # CVE-2017-6892
     (fetchurl {
-       url = "https://github.com/erikd/libsndfile/commit/f833c53cb596e9e1792949f762e0b33661822748.patch";
-       sha256 = "05xkmz2ihc1zcj73sbmj1ikrv9qlcym2bkp1v6ak7w53ky619mwq";
+      name = "CVE-2017-6892.patch";
+      url = "https://github.com/erikd/libsndfile/commit/f833c53cb596e9e1792949f762e0b33661822748.patch";
+      sha256 = "05xkmz2ihc1zcj73sbmj1ikrv9qlcym2bkp1v6ak7w53ky619mwq";
     })
-    # CVE-2017-8361, CVE-2017-8363, CVE-2017-8363
     (fetchurl {
-       url = "https://github.com/erikd/libsndfile/commit/fd0484aba8e51d16af1e3a880f9b8b857b385eb3.patch";
-       sha256 = "0ccndnvjzx5fw18zvy03vnb29rr81h5vsh1m16msqbxk8ibndln2";
+      name = "CVE-2017-8361+CVE-2017-8363+CVE-2017-8365.patch";
+      url = "https://github.com/erikd/libsndfile/commit/fd0484aba8e51d16af1e3a880f9b8b857b385eb3.patch";
+      sha256 = "0ccndnvjzx5fw18zvy03vnb29rr81h5vsh1m16msqbxk8ibndln2";
     })
-    # CVE-2017-8362
     (fetchurl {
-       url = "https://github.com/erikd/libsndfile/commit/ef1dbb2df1c0e741486646de40bd638a9c4cd808.patch";
-       sha256 = "1xyv30ga71cpy4wx5f76sc4dma91la2lcc6s9f3pk9rndyi7gj9x";
+      name = "CVE-2017-8362.patch";
+      url = "https://github.com/erikd/libsndfile/commit/ef1dbb2df1c0e741486646de40bd638a9c4cd808.patch";
+      sha256 = "1xyv30ga71cpy4wx5f76sc4dma91la2lcc6s9f3pk9rndyi7gj9x";
+    })
+    (fetchurl {
+      name = "CVE-2017-14634.patch";
+      url = "https://github.com/erikd/libsndfile/commit/85c877d5072866aadbe8ed0c3e0590fbb5e16788.patch";
+      sha256 = "0kc7vp22qsxidhvmlc6nfamw7k92n0hcfpmwhb3gaksjamwhb2df";
     })
   ];
 
diff --git a/pkgs/development/libraries/libsoundio/default.nix b/pkgs/development/libraries/libsoundio/default.nix
index 18d18941b88..7803b2a5ff1 100644
--- a/pkgs/development/libraries/libsoundio/default.nix
+++ b/pkgs/development/libraries/libsoundio/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, alsaLib, libjack2, libpulseaudio }:
+{ stdenv, fetchFromGitHub, cmake, alsaLib, libjack2, libpulseaudio, AudioUnit }:
 
 stdenv.mkDerivation rec {
   version = "1.1.0";
@@ -11,7 +11,13 @@ stdenv.mkDerivation rec {
     sha256 = "0mw197l4bci1cjc2z877gxwsvk8r43dr7qiwci2hwl2cjlcnqr2p";
   };
 
-  buildInputs = [ cmake alsaLib libjack2 libpulseaudio ];
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ libjack2 libpulseaudio ]
+    ++ stdenv.lib.optional stdenv.isLinux alsaLib
+    ++ stdenv.lib.optional stdenv.isDarwin AudioUnit;
+
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-Wno-strict-prototypes";
 
   meta = with stdenv.lib; {
     description = "Cross platform audio input and output";
diff --git a/pkgs/development/libraries/libsoup/default.nix b/pkgs/development/libraries/libsoup/default.nix
index 229a92d84bf..e8d48bf668b 100644
--- a/pkgs/development/libraries/libsoup/default.nix
+++ b/pkgs/development/libraries/libsoup/default.nix
@@ -1,18 +1,18 @@
-{ stdenv, fetchurl, glib, libxml2, pkgconfig
+{ stdenv, fetchurl, fetchpatch, glib, libxml2, pkgconfig
 , gnomeSupport ? true, libgnome_keyring3, sqlite, glib_networking, gobjectIntrospection
-, valaSupport ? true, vala_0_32
+, valaSupport ? true, vala_0_38
 , libintlOrEmpty
 , intltool, python }:
 let
   majorVersion = "2.60";
-  version = "${majorVersion}.0";
+  version = "${majorVersion}.2";
 in
 stdenv.mkDerivation {
   name = "libsoup-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/libsoup/${majorVersion}/libsoup-${version}.tar.xz";
-    sha256 = "b324edbecda0884143c0853b4a2bd5bd37fb3761f12f293c621ff34b9acdc84c";
+    sha256 = "7263cfe18872e2e652c196f5667e514616d9c97c861dfca82a65a55f45f0da01";
   };
 
   prePatch = ''
@@ -22,10 +22,19 @@ stdenv.mkDerivation {
      substituteInPlace libsoup/Makefile.in --replace "\$(DESTDIR)\$(vapidir)" "\$(DESTDIR)\$(girdir)/../vala/vapi"
   '';
 
+  patches = [
+    # remove for >= 2.60.3
+    (fetchpatch {
+      name = "buffer-overflow.patch"; # https://bugzilla.gnome.org/show_bug.cgi?id=788037
+      url = "https://git.gnome.org/browse/libsoup/patch/?id=b79689833ba";
+      sha256 = "1azbk540mbm4c6ip54ixbg9d6w7nkls9y81fzm3csq9a5786r3d3";
+    })
+  ];
+
   outputs = [ "out" "dev" ];
 
   buildInputs = libintlOrEmpty ++ [ intltool python sqlite ]
-    ++ stdenv.lib.optionals valaSupport [ vala_0_32 ];
+    ++ stdenv.lib.optionals valaSupport [ vala_0_38 ];
   nativeBuildInputs = [ pkgconfig ];
   propagatedBuildInputs = [ glib libxml2 gobjectIntrospection ]
     ++ stdenv.lib.optionals gnomeSupport [ libgnome_keyring3 ];
diff --git a/pkgs/development/libraries/libsrs2/default.nix b/pkgs/development/libraries/libsrs2/default.nix
index a2e94c33ce3..7d9ea25e9d2 100644
--- a/pkgs/development/libraries/libsrs2/default.nix
+++ b/pkgs/development/libraries/libsrs2/default.nix
@@ -5,14 +5,14 @@ stdenv.mkDerivation rec {
   version = "1.0.18";
 
   src = fetchurl {
-    url = "http://www.libsrs2.org/srs/libsrs2-${version}.tar.gz";
+    url = "https://www.libsrs2.org/srs/libsrs2-${version}.tar.gz";
     sha256 = "9d1191b705d7587a5886736899001d04168392bbb6ed6345a057ade50943a492";
   };
 
   meta = {
     description = "The next generation SRS library from the original designer of SRS";
     license = with lib.licenses; [ gpl2 bsd3 ];
-    homepage = http://www.libsrs2.org/;
+    homepage = https://www.libsrs2.org/;
     platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/libstatgrab/default.nix b/pkgs/development/libraries/libstatgrab/default.nix
index 036bb806f68..72d73e35848 100644
--- a/pkgs/development/libraries/libstatgrab/default.nix
+++ b/pkgs/development/libraries/libstatgrab/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   buildInputs = [] ++ stdenv.lib.optional stdenv.isDarwin IOKit;
 
   meta = with stdenv.lib; {
-    homepage = http://www.i-scream.org/libstatgrab/;
+    homepage = https://www.i-scream.org/libstatgrab/;
     description = "A library that provides cross platforms access to statistics about the running system";
     license = licenses.gpl2;
     platforms = platforms.unix;
diff --git a/pkgs/development/libraries/libstdc++5/default.nix b/pkgs/development/libraries/libstdc++5/default.nix
index baea981ca4a..f8397052b77 100644
--- a/pkgs/development/libraries/libstdc++5/default.nix
+++ b/pkgs/development/libraries/libstdc++5/default.nix
@@ -21,13 +21,13 @@ stdenv.mkDerivation rec {
       name = "siginfo.patch";
       url = "https://git.archlinux.org/svntogit/packages.git/plain/trunk/siginfo.patch?h=packages/libstdc%2B%2B5&id=e36ee8ed9bb5942db14cf6249a2ead14974a2bfa";
       sha256 = "15zldbm33yba293dgrgsbv3j332hkc3iqpyc8fa7zl42mh9qk22j";
-      addPrefixes = true;
+      extraPrefix = "";
     })
     (fetchpatch {
       name = "gcc-3.4.3-no_multilib_amd64.patch";
       url = "https://git.archlinux.org/svntogit/packages.git/plain/trunk/gcc-3.4.3-no_multilib_amd64.patch?h=packages/libstdc%2B%2B5&id=e36ee8ed9bb5942db14cf6249a2ead14974a2bfa";
       sha256 = "11m5lc51b0addhc4yq4rz0dwpv6k73rrj73wya3lqdk8rly6cjpm";
-      addPrefixes = true;
+      extraPrefix = "";
     })
     # Required because of glibc 2.26
     ./struct-ucontext.patch
@@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
     # being generated to make sure that they use our glibc.
     EXTRA_FLAGS="-I$NIX_FIXINC_DUMMY $(cat $NIX_CC/nix-support/libc-cflags) -O2"
 
-    extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $(cat $NIX_CC/nix-support/libc-ldflags) $(cat $NIX_CC/nix-support/libc-ldflags-before)"
+    extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $(cat $NIX_BINTOOLS/nix-support/libc-ldflags) $(cat $NIX_BINTOOLS/nix-support/libc-ldflags-before)"
     for i in $extraLDFlags; do
       EXTRA_FLAGS="$EXTRA_FLAGS -Wl,$i"
     done
diff --git a/pkgs/development/libraries/libstroke/default.nix b/pkgs/development/libraries/libstroke/default.nix
index 29fa8fc339f..bd54b3aa343 100644
--- a/pkgs/development/libraries/libstroke/default.nix
+++ b/pkgs/development/libraries/libstroke/default.nix
@@ -4,8 +4,8 @@ stdenv.mkDerivation {
   name = "libstroke-0.5.1";
 
   src = fetchurl {
-    url = http://etla.net/libstroke/libstroke-0.5.1.tar.gz;
-    sha256 = "0da9f5fde66feaf6697ba069baced8fb3772c3ddc609f39861f92788f5c7772d";
+    url = https://web.archive.org/web/20161204100704/http://etla.net/libstroke/libstroke-0.5.1.tar.gz;
+    sha256 = "0bbpqzsqh9zrc6cg62f6vp1p4dzvv37blsd0gdlzdskgwvyzba8d";
   };
 
   buildInputs = [ automake autoconf x11 ];
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
 
   meta = {
     description = "Libstroke, a library for simple gesture recognition";
-    homepage = http://etla.net/libstroke/;
+    homepage = https://web.archive.org/web/20161204100704/http://etla.net/libstroke/;
     license = stdenv.lib.licenses.gpl2;
 
     longDescription =
diff --git a/pkgs/development/libraries/libsvm/default.nix b/pkgs/development/libraries/libsvm/default.nix
index a366baf27e3..8d3d2f4c60c 100644
--- a/pkgs/development/libraries/libsvm/default.nix
+++ b/pkgs/development/libraries/libsvm/default.nix
@@ -5,7 +5,7 @@ stdenv.mkDerivation rec {
   version = "3.20";
 
   src = fetchurl {
-    url = "http://www.csie.ntu.edu.tw/~cjlin/libsvm/libsvm-${version}.tar.gz";
+    url = "https://www.csie.ntu.edu.tw/~cjlin/libsvm/libsvm-${version}.tar.gz";
     sha256 = "1gj5v5zp1qnsnv0iwxq0ikhf8262d3s5dq6syr6yqkglps0284hg";
   };
 
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "A library for support vector machines";
-    homepage = http://www.csie.ntu.edu.tw/~cjlin/libsvm/;
+    homepage = https://www.csie.ntu.edu.tw/~cjlin/libsvm/;
     license = licenses.bsd3;
     maintainers = [ maintainers.spwhitt ];
     platforms = platforms.unix;
diff --git a/pkgs/development/libraries/libtasn1/default.nix b/pkgs/development/libraries/libtasn1/default.nix
index 7fa53fe162b..ccdc3aba611 100644
--- a/pkgs/development/libraries/libtasn1/default.nix
+++ b/pkgs/development/libraries/libtasn1/default.nix
@@ -19,7 +19,8 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
   outputBin = "dev";
 
-  buildInputs = [ perl texinfo ];
+  nativeBuildInputs = [ texinfo ];
+  buildInputs = [ perl ];
 
   doCheck = true;
 
diff --git a/pkgs/development/libraries/libtiff/default.nix b/pkgs/development/libraries/libtiff/default.nix
index ee21f3df7ac..0f95b6d34c7 100644
--- a/pkgs/development/libraries/libtiff/default.nix
+++ b/pkgs/development/libraries/libtiff/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
+  doCheck = true; # not cross;
 
   meta = with stdenv.lib; {
     description = "Library and utilities for working with the TIFF image file format";
diff --git a/pkgs/development/libraries/libtiger/default.nix b/pkgs/development/libraries/libtiger/default.nix
index aa5de3f2a5f..bd0084dbaaf 100644
--- a/pkgs/development/libraries/libtiger/default.nix
+++ b/pkgs/development/libraries/libtiger/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libkate, pango, cairo, pkgconfig }:
+{ stdenv, lib, fetchurl, libkate, pango, cairo, pkgconfig, darwin }:
 
 stdenv.mkDerivation rec {
   name = "libtiger-0.3.4";
@@ -9,11 +9,13 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ libkate pango cairo ];
+  buildInputs = [ libkate pango cairo ]
+    ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.ApplicationServices;
 
   meta = {
     homepage = https://code.google.com/archive/p/libtiger/;
     description = "A rendering library for Kate streams using Pango and Cairo";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ matthewbauer ];
   };
 }
diff --git a/pkgs/development/libraries/libtomcrypt/default.nix b/pkgs/development/libraries/libtomcrypt/default.nix
index 13fa71e60dc..46f3a982b0c 100644
--- a/pkgs/development/libraries/libtomcrypt/default.nix
+++ b/pkgs/development/libraries/libtomcrypt/default.nix
@@ -1,27 +1,34 @@
-{stdenv, fetchurl, libtool}:
+{ stdenv, fetchurl, libtool }:
 
-stdenv.mkDerivation {
-  name = "libtomcrypt-1.17";
+stdenv.mkDerivation rec {
+  name = "libtomcrypt-${version}";
+  version = "1.18.0";
 
   src = fetchurl {
-    url = "https://github.com/libtom/libtomcrypt/releases/download/1.17/crypt-1.17.tar.bz2";
-    sha256 = "e33b47d77a495091c8703175a25c8228aff043140b2554c08a3c3cd71f79d116";
+    url = "https://github.com/libtom/libtomcrypt/releases/download/v${version}/crypt-${version}.tar.xz";
+    sha256 = "0ymqi0zf5gzn8pq4mnylwgg6pskml2v1p9rsjrqspyja65mgb7fs";
   };
 
-  buildInputs = [libtool];
+  nativeBuildInputs = [ libtool ];
+
+  postPatch = ''
+    substituteInPlace makefile.shared --replace "LT:=glibtool" "LT:=libtool"
+  '';
 
   preBuild = ''
-    makeFlagsArray=(LIBPATH=$out/lib INCPATH=$out/include \
-      DATAPATH=$out/share/doc/libtomcrypt/pdf \
+    makeFlagsArray=(PREFIX=$out \
       INSTALL_GROUP=$(id -g) \
       INSTALL_USER=$(id -u))
   '';
 
   makefile = "makefile.shared";
 
-  meta = {
-    homepage = http://libtom.org/?page=features&newsitems=5&whatfile=crypt;
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = http://www.libtom.net/LibTomCrypt/;
     description = "A fairly comprehensive, modular and portable cryptographic toolkit";
-    platforms = stdenv.lib.platforms.linux;
+    license = with licenses; [ publicDomain wtfpl ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/libtommath/default.nix b/pkgs/development/libraries/libtommath/default.nix
index 8b7c06b98dc..cd13eef156d 100644
--- a/pkgs/development/libraries/libtommath/default.nix
+++ b/pkgs/development/libraries/libtommath/default.nix
@@ -1,27 +1,35 @@
-{stdenv, fetchurl, libtool}:
+{ stdenv, fetchurl, libtool }:
+
+stdenv.mkDerivation rec {
+  name = "libtommath-${version}";
+  version = "1.0.1";
 
-stdenv.mkDerivation {
-  name = "libtommath-1.0";
-  
   src = fetchurl {
-    url = https://github.com/libtom/libtommath/releases/download/v1.0/ltm-1.0.tar.xz;
-    sha256 = "0v5mpd8zqjfs2hr900w1mxifz23xylyjdqyx1i1wl7q9xvwpsflr";
+    url = "https://github.com/libtom/libtommath/releases/download/v${version}/ltm-${version}.tar.xz";
+    sha256 = "0sbccdwbkfc680id2fi0x067j23biqcjqilwkk7y9339knrjy0s7";
   };
 
-  buildInputs = [libtool];
+  nativeBuildInputs = [ libtool ];
+
+  postPatch = ''
+    substituteInPlace makefile.shared --replace "LT:=glibtool" "LT:=libtool"
+    substituteInPlace makefile_include.mk --replace "shell arch" "shell uname -m"
+  '';
 
   preBuild = ''
-    makeFlagsArray=(LIBPATH=$out/lib INCPATH=$out/include \
-      DATAPATH=$out/share/doc/libtommath/pdf \
+    makeFlagsArray=(PREFIX=$out \
       INSTALL_GROUP=$(id -g) \
       INSTALL_USER=$(id -u))
   '';
 
   makefile = "makefile.shared";
 
-  meta = {
-    homepage = http://math.libtomcrypt.com/;
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = http://www.libtom.net/LibTomMath/;
     description = "A library for integer-based number-theoretic applications";
-    platforms = stdenv.lib.platforms.unix;
+    license = with licenses; [ publicDomain wtfpl ];
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/libtorrent-rasterbar/1.0.nix b/pkgs/development/libraries/libtorrent-rasterbar/1.0.nix
deleted file mode 100644
index fbd30ac04f7..00000000000
--- a/pkgs/development/libraries/libtorrent-rasterbar/1.0.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-args@{ callPackage, fetchpatch, ... }:
-
-callPackage (import ./generic.nix {
-  version = "1.0.11";
-  sha256 = "17p34d3n29q04pvz975gfl1fyj3sg9cl5l6j673xqfq3fpyis58i";
-  patches = [
-    # Compatibility with new Boost
-    (fetchpatch {
-      url = "https://github.com/arvidn/libtorrent/commit/7eb3cf6bc6dbada3fa7bb7ff4d5981182813a0e2.patch";
-      sha256 = "07agbrii6i8q4wmgpqbln7ldhhadaf5npcinvi6hnyipsr48jbj5";
-    })
-  ];
-}) args
diff --git a/pkgs/development/libraries/libtorrent-rasterbar/default.nix b/pkgs/development/libraries/libtorrent-rasterbar/default.nix
index ff5027fd472..00ec2298617 100644
--- a/pkgs/development/libraries/libtorrent-rasterbar/default.nix
+++ b/pkgs/development/libraries/libtorrent-rasterbar/default.nix
@@ -1,6 +1,6 @@
 args@{ callPackage, ... }:
 
 callPackage (import ./generic.nix {
-  version = "1.1.5";
-  sha256 = "1ifpcqw5mj2dwk23lhc2vpb47mg3j573v5z4zp8dkczpz7wg5jxq";
+  version = "1.1.6";
+  sha256 = "1xlh0sqypjbx0imw3bkbjwgwb4bm6zl7c0y01p0xsw8ncfmwjll7";
 }) args
diff --git a/pkgs/development/libraries/libtorrent-rasterbar/generic.nix b/pkgs/development/libraries/libtorrent-rasterbar/generic.nix
index 315385cba6c..8c85864f87a 100644
--- a/pkgs/development/libraries/libtorrent-rasterbar/generic.nix
+++ b/pkgs/development/libraries/libtorrent-rasterbar/generic.nix
@@ -38,6 +38,6 @@ stdenv.mkDerivation rec {
     description = "A C++ BitTorrent implementation focusing on efficiency and scalability";
     license = licenses.bsd3;
     maintainers = [ maintainers.phreedom ];
-    platforms = platforms.linux;
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/libtoxcore/default.nix b/pkgs/development/libraries/libtoxcore/default.nix
index af9c38a9634..a742be3c1e4 100644
--- a/pkgs/development/libraries/libtoxcore/default.nix
+++ b/pkgs/development/libraries/libtoxcore/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   name = "libtoxcore-${version}";
-  version = "0.1.10";
+  version = "0.1.11";
 
   src = fetchFromGitHub {
     owner  = "TokTok";
     repo   = "c-toxcore";
     rev    = "v${version}";
-    sha256 = "1d3f7lnlxra2lhih838bvlahxqv50j35g9kfyzspq971sb5z30mv";
+    sha256 = "1fya5gfiwlpk6fxhalv95n945ymvp2iidiyksrjw1xw95fzsp1ij";
   };
 
   cmakeFlags = [
@@ -37,7 +37,8 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   meta = with stdenv.lib; {
-    description = "P2P FOSS instant messaging application aimed to replace Skype with crypto";
+    description = "P2P FOSS instant messaging application aimed to replace Skype";
+    homepage = https://tox.chat;
     license = licenses.gpl3Plus;
     maintainers = with maintainers; [ peterhoeg ];
     platforms = platforms.all;
diff --git a/pkgs/development/libraries/libtoxcore/old-api.nix b/pkgs/development/libraries/libtoxcore/old-api.nix
deleted file mode 100644
index 5757e94559a..00000000000
--- a/pkgs/development/libraries/libtoxcore/old-api.nix
+++ /dev/null
@@ -1,59 +0,0 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, libsodium, ncurses, libopus
-, libvpx, check, libconfig, pkgconfig }:
-
-let
-  version = "4c220e336330213b151a0c20307d0a1fce04ac9e";
-  date = "20150126";
-
-in stdenv.mkDerivation rec {
-  name = "tox-core-old-${date}-${builtins.substring 0 7 version}";
-
-  src = fetchFromGitHub {
-    owner  = "irungentoo";
-    repo   = "toxcore";
-    rev    = version;
-    sha256 = "152yamak9ykl8dgkx1qzyrpa3f4xr1s8lgcb5k58r9lb1iwnhvqc";
-  };
-
-  NIX_LDFLAGS = "-lgcc_s";
-
-  postPatch = ''
-    # within Nix chroot builds, localhost is unresolvable
-    sed -i -e '/DEFTESTCASE(addr_resolv_localhost)/d' \
-      auto_tests/network_test.c
-    # takes WAAAY too long (~10 minutes) and would timeout
-    sed -i -e '/DEFTESTCASE[^(]*(many_clients\>/d' \
-      auto_tests/tox_test.c
-  '';
-
-  configureFlags = [
-    "--with-libsodium-headers=${libsodium.dev}/include"
-    "--with-libsodium-libs=${libsodium.out}/lib"
-    "--enable-ntox"
-    "--enable-daemon"
-  ];
-
-  buildInputs = [
-    autoreconfHook libsodium ncurses
-    check libconfig pkgconfig
-  ] ++ stdenv.lib.optionals (!stdenv.isArm) [
-    libopus
-  ];
-
-  propagatedBuildInputs = stdenv.lib.optionals (!stdenv.isArm) [ libvpx ];
-
-  # Some tests fail randomly due to timeout. This kind of problem is well known
-  # by upstream: https://github.com/irungentoo/toxcore/issues/{950,1054}
-  # They don't recommend running tests on 50core machines with other cpu-bound
-  # tests running in parallel.
-  #
-  # NOTE: run the tests locally on your machine before upgrading this package!
-  doCheck = false;
-
-  meta = with stdenv.lib; {
-    description = "P2P FOSS instant messaging application aimed to replace Skype with crypto";
-    license = licenses.gpl3Plus;
-    maintainers = with maintainers; [ viric jgeerds ];
-    platforms = platforms.all;
-  };
-}
diff --git a/pkgs/development/libraries/libu2f-host/default.nix b/pkgs/development/libraries/libu2f-host/default.nix
index 48d55f17c57..b0d6598fc63 100644
--- a/pkgs/development/libraries/libu2f-host/default.nix
+++ b/pkgs/development/libraries/libu2f-host/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, json_c, hidapi }:
 
 stdenv.mkDerivation rec {
-  name = "libu2f-host-1.1.1";
+  name = "libu2f-host-1.1.4";
 
   src = fetchurl {
     url = "https://developers.yubico.com/libu2f-host/Releases/${name}.tar.xz";
-    sha256 = "0g0f012w0c00cvj5g319x2b8prbh0d3fcac9960cy7xsd8chckg1";
+    sha256 = "0vvs2p3b25cbybccv3f4ridnp7sg5i4hkzx3hx48ldcn1l1fqhv0";
   };
 
   nativeBuildInputs = [ pkgconfig ];
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = https://developers.yubico.com/libu2f-host;
-    description = "A C library and command-line tool thati mplements the host-side of the U2F protocol";
+    description = "A C library and command-line tool that implements the host-side of the U2F protocol";
     license = licenses.bsd2;
     platforms = platforms.unix;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/development/libraries/libunistring/clang.patch b/pkgs/development/libraries/libunistring/clang.patch
deleted file mode 100644
index fdcbc0d528d..00000000000
--- a/pkgs/development/libraries/libunistring/clang.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/lib/stdint.in.h b/lib/stdint.in.h
-index 997e406..e0827f5 100644
---- a/lib/stdint.in.h
-+++ b/lib/stdint.in.h
-@@ -53,7 +53,8 @@
-      in <inttypes.h> would reinclude us, skipping our contents because
-      _GL_STDINT_H is defined.
-      The include_next requires a split double-inclusion guard.  */
--# @INCLUDE_NEXT@ @NEXT_STDINT_H@
-+# include <inttypes.h>
-+// # @INCLUDE_NEXT@ @NEXT_STDINT_H@
- #endif
- 
- #if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
diff --git a/pkgs/development/libraries/libunistring/default.nix b/pkgs/development/libraries/libunistring/default.nix
index 42376b61f42..e1b8c04b4ce 100644
--- a/pkgs/development/libraries/libunistring/default.nix
+++ b/pkgs/development/libraries/libunistring/default.nix
@@ -1,28 +1,25 @@
 { fetchurl, stdenv, libiconv }:
 
 stdenv.mkDerivation rec {
-  name = "libunistring-0.9.7";
+  name = "libunistring-${version}";
+  version = "0.9.8";
 
   src = fetchurl {
     url = "mirror://gnu/libunistring/${name}.tar.gz";
-    sha256 = "1ra1baz2187kbw9im47g6kqb5mx9plq703mkjxaval8rxv5q3q4w";
+    sha256 = "1x9wnpzg7vxyjpnzab6vw0afbcijfbd57qrrkqrppynh0nyz54mp";
   };
 
-  patches = stdenv.lib.optionals stdenv.isDarwin [ ./clang.patch stdenv.secure-format-patch ];
-
   outputs = [ "out" "dev" "info" "doc" ];
 
   propagatedBuildInputs = stdenv.lib.optional (!stdenv.isLinux) libiconv;
 
-  enableParallelBuilding = false;
-
   configureFlags = [
     "--with-libiconv-prefix=${libiconv}"
   ];
 
-  # XXX: There are test failures on non-GNU systems, see
-  # http://lists.gnu.org/archive/html/bug-libunistring/2010-02/msg00004.html .
-  doCheck = (stdenv ? glibc) && (stdenv.hostPlatform == stdenv.buildPlatform);
+  doCheck = true;
+
+  enableParallelBuilding = true;
 
   meta = {
     homepage = http://www.gnu.org/software/libunistring/;
diff --git a/pkgs/development/libraries/libunity/default.nix b/pkgs/development/libraries/libunity/default.nix
deleted file mode 100644
index 66890f08ff3..00000000000
--- a/pkgs/development/libraries/libunity/default.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ stdenv, fetchurl, vala_0_23, python, intltool, pkgconfig
-, glib, libgee_0_6, gtk3, dee, libdbusmenu-glib
-}:
-
-stdenv.mkDerivation rec {
-  name = "libunity-${version}";
-  version = "6.12.0";
-
-  src = fetchurl {
-    url = "https://launchpad.net/libunity/6.0/${version}/+download/${name}.tar.gz";
-    sha256 = "1nadapl3390x98q1wv2yarh60hzi7ck0d1s8zz9xsiq3zz6msbjd";
-  };
-
-  buildInputs = [ glib libgee_0_6 gtk3 ];
-  propagatedBuildInputs = [ dee libdbusmenu-glib ];
-  nativeBuildInputs = [ vala_0_23 python intltool pkgconfig ];
-
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
-    description = "A library for instrumenting- and integrating with all aspects of the Unity shell";
-    homepage = https://launchpad.net/libunity;
-    license = licenses.lgpl3;
-    platforms = platforms.linux;
-    maintainers = with maintainers; [ abbradar ];
-  };
-}
diff --git a/pkgs/development/libraries/libusb1/default.nix b/pkgs/development/libraries/libusb1/default.nix
index dd2f1edc5f2..44638b4dfd5 100644
--- a/pkgs/development/libraries/libusb1/default.nix
+++ b/pkgs/development/libraries/libusb1/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, systemd ? null, libobjc, IOKit }:
 
 stdenv.mkDerivation rec {
-  name = "libusb-1.0.20";
+  name = "libusb-1.0.21";
 
   src = fetchurl {
     url = "mirror://sourceforge/libusb/${name}.tar.bz2";
-    sha256 = "1zzp6hc7r7m3gl6zjbmzn92zkih4664cckaf49l1g5hapa8721fb";
+    sha256 = "0jw2n5kdnrqvp7zh792fd6mypzzfap6jp4gfcmq4n6c1kb79rkkx";
   };
 
   outputs = [ "out" "dev" ]; # get rid of propagating systemd closure
diff --git a/pkgs/development/libraries/libuv/default.nix b/pkgs/development/libraries/libuv/default.nix
index 8dea502a4ff..4075505f8dd 100644
--- a/pkgs/development/libraries/libuv/default.nix
+++ b/pkgs/development/libraries/libuv/default.nix
@@ -2,14 +2,14 @@
 , ApplicationServices, CoreServices }:
 
 stdenv.mkDerivation rec {
-  version = "1.15.0";
+  version = "1.18.0";
   name = "libuv-${version}";
 
   src = fetchFromGitHub {
     owner = "libuv";
     repo = "libuv";
     rev = "v${version}";
-    sha256 = "092hxqjvbb6d03h3msc38359w2kixba1ansyrsbyqq8iqiqwnkw0";
+    sha256 = "0s71c2y4ll3vp463hsdk74q4hr7wprkxc2a4agw3za2hhzcb95pd";
   };
 
   postPatch = let
diff --git a/pkgs/development/libraries/libva-utils/default.nix b/pkgs/development/libraries/libva-utils/default.nix
new file mode 100644
index 00000000000..fad72105912
--- /dev/null
+++ b/pkgs/development/libraries/libva-utils/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkgconfig
+, libdrm, libva
+}:
+
+stdenv.mkDerivation rec {
+  name = "libva-utils-${version}";
+  inherit (libva) version;
+
+  src = fetchFromGitHub {
+    owner  = "01org";
+    repo   = "libva-utils";
+    rev    = version;
+    sha256 = "02n51cvp8bzzjk4fargwvgh7z71y8spg24hqgaawbp3p3ahh7xxi";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+
+  buildInputs = [ libdrm libva ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "VAAPI tools: Video Acceleration API";
+    homepage = http://www.freedesktop.org/wiki/Software/vaapi;
+    license = licenses.mit;
+    maintainers = with maintainers; [ garbas ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/development/libraries/libva/default.nix b/pkgs/development/libraries/libva/default.nix
index 031ac781651..dca548a6f9d 100644
--- a/pkgs/development/libraries/libva/default.nix
+++ b/pkgs/development/libraries/libva/default.nix
@@ -1,36 +1,43 @@
-{ stdenv, lib, fetchurl, libX11, pkgconfig, libXext, libdrm, libXfixes, wayland, libffi
+{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkgconfig
+, libXext, libdrm, libXfixes, wayland, libffi, libX11
 , mesa_noglu
 , minimal ? true, libva
 }:
 
 stdenv.mkDerivation rec {
-  name = "libva-${version}";
-  version = "1.7.3";
-
-  src = fetchurl {
-    url = "http://www.freedesktop.org/software/vaapi/releases/libva/${name}.tar.bz2";
-    sha256 = "1ndrf136rlw03xag7j1xpmf9015d1h0dpnv6v587jnh6k2a17g12";
+  name = "libva-${lib.optionalString (!minimal) "full-"}${version}";
+  version = "2.0.0";
+
+  src = fetchFromGitHub {
+    owner  = "01org";
+    repo   = "libva";
+    rev    = version;
+    sha256 = "1x8rlmv5wfqjz3j87byrxb4d9vp5b4lrrin2fx254nwl3aqy15hy";
   };
 
-  outputs = [ "bin" "dev" "out" ];
+  outputs = [ "dev" "out" ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
 
   buildInputs = [ libdrm ]
     ++ lib.optionals (!minimal) [ libva libX11 libXext libXfixes wayland libffi mesa_noglu ];
   # TODO: share libs between minimal and !minimal - perhaps just symlink them
 
-  configureFlags =
-    [ "--with-drivers-path=${mesa_noglu.driverLink}/lib/dri" ] ++
-    lib.optionals (!minimal) [ "--enable-glx" ];
+  enableParallelBuilding = true;
+
+  configureFlags = [
+    "--with-drivers-path=${mesa_noglu.driverLink}/lib/dri"
+  ] ++ lib.optionals (!minimal) [ "--enable-glx" ];
 
-  installFlags = [ "dummy_drv_video_ladir=$(out)/lib/dri" ];
+  installFlags = [
+    "dummy_drv_video_ladir=$(out)/lib/dri"
+  ];
 
   meta = with stdenv.lib; {
+    description = "VAAPI library: Video Acceleration API";
     homepage = http://www.freedesktop.org/wiki/Software/vaapi;
     license = licenses.mit;
-    description = "VAAPI library: Video Acceleration API";
-    platforms = platforms.unix;
     maintainers = with maintainers; [ garbas ];
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/libvdpau/default.nix b/pkgs/development/libraries/libvdpau/default.nix
index ceb42fe2bfc..eccee83fa85 100644
--- a/pkgs/development/libraries/libvdpau/default.nix
+++ b/pkgs/development/libraries/libvdpau/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
   name = "libvdpau-1.1.1";
 
   src = fetchurl {
-    url = "http://people.freedesktop.org/~aplattner/vdpau/${name}.tar.bz2";
+    url = "https://people.freedesktop.org/~aplattner/vdpau/${name}.tar.bz2";
     sha256 = "857a01932609225b9a3a5bf222b85e39b55c08787d0ad427dbd9ec033d58d736";
   };
 
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   installFlags = [ "moduledir=$(out)/lib/vdpau" ];
 
   meta = with stdenv.lib; {
-    homepage = http://people.freedesktop.org/~aplattner/vdpau/;
+    homepage = https://people.freedesktop.org/~aplattner/vdpau/;
     description = "Library to use the Video Decode and Presentation API for Unix (VDPAU)";
     license = licenses.mit; # expat version
     platforms = platforms.unix;
diff --git a/pkgs/development/libraries/libvirt-glib/default.nix b/pkgs/development/libraries/libvirt-glib/default.nix
index e41ab5fe5a3..83b2983d9c4 100644
--- a/pkgs/development/libraries/libvirt-glib/default.nix
+++ b/pkgs/development/libraries/libvirt-glib/default.nix
@@ -16,7 +16,9 @@ in stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [
     libvirt glib libxml2 intltool libtool yajl nettle libgcrypt
-    python pygobject2 gobjectIntrospection libcap_ng numactl xen libapparmor
+    python pygobject2 gobjectIntrospection libcap_ng numactl libapparmor
+  ] ++ stdenv.lib.optionals stdenv.isx86_64 [
+    xen
   ];
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/libvirt/default.nix b/pkgs/development/libraries/libvirt/default.nix
index ff72cc84d26..2dbf80e71f7 100644
--- a/pkgs/development/libraries/libvirt/default.nix
+++ b/pkgs/development/libraries/libvirt/default.nix
@@ -4,19 +4,19 @@
 , iproute, iptables, readline, lvm2, utillinux, systemd, libpciaccess, gettext
 , libtasn1, ebtables, libgcrypt, yajl, pmutils, libcap_ng, libapparmor
 , dnsmasq, libnl, libpcap, libxslt, xhtml1, numad, numactl, perlPackages
-, curl, libiconv, gmp, xen, zfs, parted, qemu
+, curl, libiconv, gmp, xen, zfs, parted
 }:
 
 with stdenv.lib;
 
-# if you update, also bump pythonPackages.libvirt or it will break
+# if you update, also bump <nixpkgs/pkgs/development/python-modules/libvirt/default.nix> or it will break
 stdenv.mkDerivation rec {
   name = "libvirt-${version}";
-  version = "3.8.0";
+  version = "3.10.0";
 
   src = fetchurl {
     url = "http://libvirt.org/sources/${name}.tar.xz";
-    sha256 = "1y83z4jb2by6ara0nw4sivh7svqcrw97yfhqwdscxl4y10saisvk";
+    sha256 = "03kb37iv3dvvdlslznlc0njvjpmq082lczmsslz5p4fcwb50kwfz";
   };
 
   patches = [ ./build-on-bsd.patch ];
@@ -27,9 +27,11 @@ stdenv.mkDerivation rec {
     libxslt xhtml1 perlPackages.XMLXPath curl libpcap
   ] ++ optionals stdenv.isLinux [
     libpciaccess devicemapper lvm2 utillinux systemd libnl numad zfs
-    libapparmor libcap_ng numactl xen attr parted
+    libapparmor libcap_ng numactl attr parted
+  ] ++ optionals (stdenv.isLinux && stdenv.isx86_64) [
+    xen
   ] ++ optionals stdenv.isDarwin [
-     libiconv gmp
+    libiconv gmp
   ];
 
   preConfigure = optionalString stdenv.isLinux ''
@@ -39,8 +41,6 @@ stdenv.mkDerivation rec {
 
     # the path to qemu-kvm will be stored in VM's .xml and .save files
     # do not use "''${qemu_kvm}/bin/qemu-kvm" to avoid bound VMs to particular qemu derivations
-    substituteInPlace src/qemu/qemu_capabilities.c \
-      --replace '"/usr/libexec/qemu-kvm"' '"/run/libvirt/nix-emulators/${if stdenv.isAarch64 then "qemu-system-aarch64" else "qemu-kvm"}"'
     substituteInPlace src/lxc/lxc_conf.c \
       --replace 'lxc_path,' '"/run/libvirt/nix-emulators/libvirt_lxc",'
   '' + ''
@@ -89,7 +89,7 @@ stdenv.mkDerivation rec {
     substituteInPlace $out/lib/systemd/system/libvirtd.service --replace /bin/kill ${coreutils}/bin/kill
     rm $out/lib/systemd/system/{virtlockd,virtlogd}.*
     wrapProgram $out/sbin/libvirtd \
-      --prefix PATH : ${makeBinPath [ iptables iproute pmutils numad numactl qemu ]}
+      --prefix PATH : /run/libvirt/nix-emulators:${makeBinPath [ iptables iproute pmutils numad numactl ]}
   '';
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/libvncserver/default.nix b/pkgs/development/libraries/libvncserver/default.nix
index f7e477ff34a..b325c9b246c 100644
--- a/pkgs/development/libraries/libvncserver/default.nix
+++ b/pkgs/development/libraries/libvncserver/default.nix
@@ -1,12 +1,8 @@
 {stdenv, fetchurl,
-  libtool, libjpeg, openssl, libX11, libXdamage, xproto, damageproto, 
-  xextproto, libXext, fixesproto, libXfixes, xineramaproto, libXinerama, 
-  libXrandr, randrproto, libXtst, zlib, libgcrypt, autoreconfHook
-  , systemd, pkgconfig, libpng
+ libtool, libjpeg, openssl, zlib, libgcrypt, autoreconfHook, pkgconfig, libpng,
+ systemd
 }:
 
-assert stdenv.isLinux;
-
 let
   s = # Generated upstream information
   rec {
@@ -16,27 +12,25 @@ let
     url="https://github.com/LibVNC/libvncserver/archive/LibVNCServer-${version}.tar.gz";
     sha256="15189n09r1pg2nqrpgxqrcvad89cdcrca9gx6qhm6akjf81n6g8r";
   };
-  buildInputs = [
-    libtool libjpeg openssl libX11 libXdamage xproto damageproto
-    xextproto libXext fixesproto libXfixes xineramaproto libXinerama
-    libXrandr randrproto libXtst zlib libgcrypt autoreconfHook systemd
-    pkgconfig libpng
-  ];
 in
 stdenv.mkDerivation {
   inherit (s) name version;
-  inherit buildInputs;
   src = fetchurl {
     inherit (s) url sha256;
   };
   preConfigure = ''
     sed -e 's@/usr/include/linux@${stdenv.cc.libc}/include/linux@g' -i configure
   '';
+  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  buildInputs = [
+    libtool libjpeg openssl libgcrypt libpng
+  ] ++ stdenv.lib.optional stdenv.isLinux systemd;
+  propagatedBuildInputs = [ zlib ];
   meta = {
     inherit (s) version;
     description =  "VNC server library";
     license = stdenv.lib.licenses.gpl2Plus ;
     maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
+    platforms = stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/libvorbis/default.nix b/pkgs/development/libraries/libvorbis/default.nix
index 682fcca98a3..f59237ee164 100644
--- a/pkgs/development/libraries/libvorbis/default.nix
+++ b/pkgs/development/libraries/libvorbis/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libogg, pkgconfig }:
+{ stdenv, fetchurl, libogg, pkgconfig, fetchpatch }:
 
 stdenv.mkDerivation rec {
   name = "libvorbis-1.3.5";
@@ -10,6 +10,23 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "doc" ];
 
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/xiph/vorbis/commit/a79ec216cd119069c68b8f3542c6a425a74ab993.patch";
+      sha256 = "0xhsa96n3dlh2l85bxpz4b9m78mfxfgi2ibhjp77110a0nvkjr6h";
+      name = "CVE-2017-14633";
+    })
+    (fetchpatch {
+      url = "https://github.com/xiph/vorbis/commit/c1c2831fc7306d5fbd7bc800324efd12b28d327f.patch";
+      sha256 = "17lb86105im6fc0h0cx5sn94p004jsdbbs2vj1m9ll6z9yb4rxwc";
+      name = "CVE-2017-14632";
+    })
+    (fetchpatch {
+      url = "https://gitlab.xiph.org/xiph/vorbis/uploads/a68cf70fa10c8081a633f77b5c6576b7/0001-CVE-2017-14160-make-sure-we-don-t-overflow.patch";
+      sha256 = "0v21p59cb3z77ch1v6q5dcrd733h91f3m8ifnd7kkkr8gzn17d5x";
+      name = "CVE-2017-14160";
+    })
+  ];
 
   nativeBuildInputs = [ pkgconfig ];
   propagatedBuildInputs = [ libogg ];
@@ -17,7 +34,7 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   meta = with stdenv.lib; {
-    homepage = http://xiph.org/vorbis/;
+    homepage = https://xiph.org/vorbis/;
     license = licenses.bsd3;
     maintainers = [ maintainers.ehmry ];
     platforms = platforms.all;
diff --git a/pkgs/development/libraries/libvpx/default.nix b/pkgs/development/libraries/libvpx/default.nix
index 4b50fe090e3..1e96ff9bb1a 100644
--- a/pkgs/development/libraries/libvpx/default.nix
+++ b/pkgs/development/libraries/libvpx/default.nix
@@ -173,7 +173,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "WebM VP8/VP9 codec SDK";
-    homepage    = http://www.webmproject.org/;
+    homepage    = https://www.webmproject.org/;
     license     = licenses.bsd3;
     maintainers = with maintainers; [ codyopel ];
     platforms   = platforms.all;
diff --git a/pkgs/development/libraries/libwnck/3.x.nix b/pkgs/development/libraries/libwnck/3.x.nix
index ed775fb4593..6a835157d96 100644
--- a/pkgs/development/libraries/libwnck/3.x.nix
+++ b/pkgs/development/libraries/libwnck/3.x.nix
@@ -1,11 +1,16 @@
 {stdenv, fetchurl, pkgconfig, libX11, gtk3, intltool}:
 
-stdenv.mkDerivation {
-  name = "libwnck-3.4.7";
+stdenv.mkDerivation rec{
+  name = "libwnck-${version}";
+  version = "${majorVer}.${minorVer}.${patchVer}";
+
+  majorVer = "3";
+  minorVer = "24";
+  patchVer = "1";
 
   src = fetchurl {
-    url = mirror://gnome/sources/libwnck/3.4/libwnck-3.4.7.tar.xz;
-    sha256 = "d48ac9c7f50c0d563097f63d07bcc83744c7d92a1b4ef65e5faeab32b5ccb723";
+    url = "mirror://gnome/sources/libwnck/${majorVer}.${minorVer}/${name}.tar.xz";
+    sha256 = "010zk9zvydggxqnxfml3scml5yxmpjy90irpqcayrzw26lldr9mg";
   };
 
   outputs = [ "out" "dev" "devdoc" ];
diff --git a/pkgs/development/libraries/libx86emu/default.nix b/pkgs/development/libraries/libx86emu/default.nix
index ee32d9418dd..b745098bd64 100644
--- a/pkgs/development/libraries/libx86emu/default.nix
+++ b/pkgs/development/libraries/libx86emu/default.nix
@@ -1,27 +1,29 @@
-{ stdenv, fetchurl, perl }:
+{ stdenv, fetchFromGitHub, perl }:
 
 stdenv.mkDerivation rec {
   name = "libx86emu-${version}";
-  version = "1.5";
+  version = "1.12";
 
-  src = fetchurl {
-    url = "https://github.com/wfeldt/libx86emu/archive/${version}.tar.gz";
-    sha256 = "1im6w6m0bl6ajynx4hc028lad8v10whv4y7w9zxndzh3j4mi3aa8";
+  src = fetchFromGitHub {
+    owner = "wfeldt";
+    repo = "libx86emu";
+    rev = version;
+    sha256 = "0dlzvwdkk0vc6qf0a0zzbxki3pig1mda8p3fa54rxqaxkwp4mqr6";
   };
 
-  buildInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
 
+  postUnpack = "rm $sourceRoot/git2log";
   patchPhase = ''
     # VERSION is usually generated using Git
     echo "${version}" > VERSION
-    sed -i 's|/usr/|/|g' Makefile
+    substituteInPlace Makefile --replace "/usr" "/"
   '';
 
-  makeFlags = [ "shared" ];
+  buildFlags = [ "shared" ];
+  enableParallelBuilding = true;
 
-  installPhase = ''
-    make install DESTDIR=$out/ LIBDIR=lib
-  '';
+  installFlags = [ "DESTDIR=$(out)" "LIBDIR=/lib" ];
 
   meta = with stdenv.lib; {
     description = "x86 emulation library";
diff --git a/pkgs/development/libraries/libxc/default.nix b/pkgs/development/libraries/libxc/default.nix
new file mode 100644
index 00000000000..1c4cdd81d7c
--- /dev/null
+++ b/pkgs/development/libraries/libxc/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, gfortran, perl }:
+
+let
+  version = "3.0.1";
+
+in stdenv.mkDerivation {
+  name = "libxc-${version}";
+  src = fetchurl {
+    url = "http://www.tddft.org/programs/octopus/down.php?file=libxc/${version}/libxc-${version}.tar.gz";
+    sha256 = "1xyac89yx03vm86rvk07ps1d39xss3amw46a1k53mv30mgr94rl3";
+  };
+
+  buildInputs = [ gfortran ];
+  nativeBuildInputs = [ perl ];
+
+  preConfigure = ''
+    patchShebangs ./
+  '';
+
+  configureFlags = [ "--enable-shared" ];
+
+  doCheck = true;
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Library of exchange-correlation functionals for density-functional theory";
+    homepage = http://octopus-code.org/wiki/Libxc;
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ markuskowa ];
+  };
+}
diff --git a/pkgs/development/libraries/libxcomp/default.nix b/pkgs/development/libraries/libxcomp/default.nix
index f38c7a90032..68f8c44a8ec 100644
--- a/pkgs/development/libraries/libxcomp/default.nix
+++ b/pkgs/development/libraries/libxcomp/default.nix
@@ -23,6 +23,5 @@ stdenv.mkDerivation rec {
     homepage = http://wiki.x2go.org/doku.php/wiki:libs:nx-libs;
     license = licenses.gpl2;
     platforms = platforms.linux;
-    maintainers = with maintainers; [ nckx ];
   };
 }
diff --git a/pkgs/development/libraries/libxl/default.nix b/pkgs/development/libraries/libxl/default.nix
new file mode 100644
index 00000000000..035bfa8d6dc
--- /dev/null
+++ b/pkgs/development/libraries/libxl/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "libxl";
+  version = "3.8.1";
+
+  src = fetchurl {
+    url = "http://www.libxl.com/download/${name}-lin-${version}.tar.gz";
+    sha256 = "1zdbahhyhr70s8hygwp43j9z4zmglyrr782hkcm1078yvkr2f2fm";
+  };
+
+  phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
+
+  installPhase = ''
+    mkdir $out
+    cp -rva include_c include_cpp license.txt $out/
+    cp -rva lib64 $out/lib
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A lbrary for parsing excel files";
+    license     = licenses.unfree;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [  ];
+  };
+}
diff --git a/pkgs/development/libraries/libxml2/default.nix b/pkgs/development/libraries/libxml2/default.nix
index bf38a954d60..b19f4a2953f 100644
--- a/pkgs/development/libraries/libxml2/default.nix
+++ b/pkgs/development/libraries/libxml2/default.nix
@@ -10,11 +10,11 @@ let
 
 in stdenv.mkDerivation rec {
   name = "libxml2-${version}";
-  version = "2.9.5";
+  version = "2.9.7";
 
   src = fetchurl {
     url = "http://xmlsoft.org/sources/${name}.tar.gz";
-    sha256 = "0f6d5nkvcfx8yqis2dwrnv6qaj0nhiifz49y657vmrwwxvnc2ca0";
+    sha256 = "034hylzspvkm0p4bczqbf8q05a7r2disr8dz725x4bin61ymwg7n";
   };
 
   outputs = [ "bin" "dev" "out" "man" "doc" ]
diff --git a/pkgs/development/libraries/libxmlxx/default.nix b/pkgs/development/libraries/libxmlxx/default.nix
index 23b36db8fe1..226fe5be536 100644
--- a/pkgs/development/libraries/libxmlxx/default.nix
+++ b/pkgs/development/libraries/libxmlxx/default.nix
@@ -10,6 +10,8 @@ stdenv.mkDerivation rec {
     sha256 = "1sb3akryklvh2v6m6dihdnbpf1lkx441v972q9hlz1sq6bfspm2a";
   };
 
+  outputs = [ "out" "devdoc" ];
+
   nativeBuildInputs = [ pkgconfig perl ];
 
   propagatedBuildInputs = [ libxml2 glibmm ];
diff --git a/pkgs/development/libraries/libxmlxx/v3.nix b/pkgs/development/libraries/libxmlxx/v3.nix
index 646fdfbac4f..5e1e947b8f7 100644
--- a/pkgs/development/libraries/libxmlxx/v3.nix
+++ b/pkgs/development/libraries/libxmlxx/v3.nix
@@ -10,6 +10,8 @@ stdenv.mkDerivation rec {
     sha256 = "19kik79fmg61nv0by0a5f9wchrcfjwzvih4v2waw01hqflhqvp0r";
   };
 
+  outputs = [ "out" "devdoc" ];
+
   nativeBuildInputs = [ pkgconfig perl ];
 
   buildInputs = [ glibmm ];
diff --git a/pkgs/development/libraries/libxslt/default.nix b/pkgs/development/libraries/libxslt/default.nix
index 1c27b6e3233..2f913093873 100644
--- a/pkgs/development/libraries/libxslt/default.nix
+++ b/pkgs/development/libraries/libxslt/default.nix
@@ -10,7 +10,9 @@ assert pythonSupport -> libxml2.pythonSupport;
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
-  name = "libxslt-1.1.29";
+  pname = "libxslt";
+  version = "1.1.29";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "http://xmlsoft.org/sources/${name}.tar.gz";
@@ -51,7 +53,7 @@ stdenv.mkDerivation rec {
     moveToOutput share/man/man1 "$bin"
   '' + optionalString pythonSupport ''
     mkdir -p $py/nix-support
-    echo ${libxml2.py} >> $py/nix-support/propagated-native-build-inputs
+    echo ${libxml2.py} >> $py/nix-support/propagated-build-inputs
     moveToOutput lib/python2.7 "$py"
   '';
 
diff --git a/pkgs/development/libraries/libzip/default.nix b/pkgs/development/libraries/libzip/default.nix
index 850bb27e364..131b64c1c7f 100644
--- a/pkgs/development/libraries/libzip/default.nix
+++ b/pkgs/development/libraries/libzip/default.nix
@@ -5,7 +5,7 @@ stdenv.mkDerivation rec {
   version = "1.3.0";
 
   src = fetchurl {
-    url = "http://www.nih.at/libzip/${name}.tar.gz";
+    url = "https://www.nih.at/libzip/${name}.tar.gz";
     sha256 = "1633dvjc08zwwhzqhnv62rjf1abx8y5njmm8y16ik9iwd07ka6d9";
   };
 
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    homepage = http://www.nih.at/libzip;
+    homepage = https://www.nih.at/libzip;
     description = "A C library for reading, creating and modifying zip archives";
     platforms = stdenv.lib.platforms.unix;
   };
diff --git a/pkgs/development/libraries/lightning/default.nix b/pkgs/development/libraries/lightning/default.nix
index 5868fdf8b63..b4a33bbe7df 100644
--- a/pkgs/development/libraries/lightning/default.nix
+++ b/pkgs/development/libraries/lightning/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, binutils }:
+{ stdenv, fetchurl, libopcodes }:
 
 with stdenv.lib;
 stdenv.mkDerivation rec {
@@ -11,8 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "19j9nwl88k660045s40cbz5zrl1wpd2mcxnnc8qqnnaj311a58qz";
   };
 
-  # Needs libopcodes.so from binutils for 'make check'
-  buildInputs = [ binutils ];
+  buildInputs = stdenv.lib.optional doCheck libopcodes;
 
   doCheck = true;
 
diff --git a/pkgs/development/libraries/lightstep-tracer-cpp/default.nix b/pkgs/development/libraries/lightstep-tracer-cpp/default.nix
index 9aea42082c5..f5660e93d79 100644
--- a/pkgs/development/libraries/lightstep-tracer-cpp/default.nix
+++ b/pkgs/development/libraries/lightstep-tracer-cpp/default.nix
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
 
   meta = with lib; {
     description = "Distributed tracing system built on top of the OpenTracing standard";
-    homepage = "http://lightstep.com/";
+    homepage = "https://lightstep.com/";
     license = licenses.mit;
     platforms = platforms.linux;
     maintainers = with maintainers; [ cstrahan ];
diff --git a/pkgs/development/libraries/lzo/default.nix b/pkgs/development/libraries/lzo/default.nix
index e8f8a6ab9bb..c7667b554f4 100644
--- a/pkgs/development/libraries/lzo/default.nix
+++ b/pkgs/development/libraries/lzo/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
+  doCheck = true; # not cross;
 
   meta = with stdenv.lib; {
     description = "Real-time data (de)compression library";
@@ -30,6 +30,5 @@ stdenv.mkDerivation rec {
     license = licenses.gpl2Plus;
 
     platforms = platforms.all;
-    maintainers = with maintainers; [ nckx ];
   };
 }
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index fe34a8bb88f..d343bd1112d 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -66,7 +66,7 @@ let
 in
 
 let
-  version = "17.2.4";
+  version = "17.2.8";
   branch  = head (splitString "." version);
   driverLink = "/run/opengl-driver" + optionalString stdenv.isi686 "-32";
 in
@@ -79,9 +79,9 @@ stdenv.mkDerivation {
       "ftp://ftp.freedesktop.org/pub/mesa/mesa-${version}.tar.xz"
       "ftp://ftp.freedesktop.org/pub/mesa/${version}/mesa-${version}.tar.xz"
       "ftp://ftp.freedesktop.org/pub/mesa/older-versions/${branch}.x/${version}/mesa-${version}.tar.xz"
-      "https://launchpad.net/mesa/trunk/${version}/+download/mesa-${version}.tar.xz"
+      "https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz"
     ];
-    sha256 = "0l75q9l4g15y66rqk2swqvj18qj60hpimv0f97jk44bfrpz0i92v";
+    sha256 = "0pq9kmmyllgd63d936f3x1zsg7sqaswx47khbn0gvbgari2h753f";
   };
 
   prePatch = "patchShebangs .";
@@ -98,7 +98,7 @@ stdenv.mkDerivation {
 
   # TODO: Figure out how to enable opencl without having a runtime dependency on clang
   configureFlags = [
-    "--sysconfdir=/etc"
+    "--sysconfdir=${driverLink}/etc"
     "--localstatedir=/var"
     "--with-dri-driverdir=$(drivers)/lib/dri"
     "--with-dri-searchpath=${driverLink}/lib/dri"
@@ -197,7 +197,6 @@ stdenv.mkDerivation {
   '';
 
   # TODO:
-  #  @vcunat isn't sure if drirc will be found when in $out/etc/;
   #  check $out doesn't depend on llvm: builder failures are ignored
   #  for some reason grep -qv '${llvmPackages.llvm}' -R "$out";
   postFixup = ''
@@ -214,7 +213,7 @@ stdenv.mkDerivation {
 
   meta = with stdenv.lib; {
     description = "An open source implementation of OpenGL";
-    homepage = http://www.mesa3d.org/;
+    homepage = https://www.mesa3d.org/;
     license = licenses.mit; # X11 variant, in most files
     platforms = platforms.mesaPlatforms;
     maintainers = with maintainers; [ eduarrrd vcunat ];
diff --git a/pkgs/development/libraries/microsoft_gsl/default.nix b/pkgs/development/libraries/microsoft_gsl/default.nix
index b419eccfe79..1c10bd6f8fc 100644
--- a/pkgs/development/libraries/microsoft_gsl/default.nix
+++ b/pkgs/development/libraries/microsoft_gsl/default.nix
@@ -1,5 +1,10 @@
-{ stdenv, fetchgit, cmake }:
+{ stdenv, fetchgit, cmake
+, hostPlatform, buildPlatform
+}:
 
+let
+  nativeBuild = hostPlatform == buildPlatform;
+in
 stdenv.mkDerivation rec {
   name = "microsoft_gsl-${version}";
   version = "2017-02-13";
@@ -10,8 +15,11 @@ stdenv.mkDerivation rec {
     sha256 = "03d17mnx6n175aakin313308q14wzvaa9pd0m1yfk6ckhha4qf35";
   };
 
-  # build phase just runs the unit tests
-  buildInputs = [ cmake ];
+
+  # build phase just runs the unit tests, so skip it if
+  # we're doing a cross build
+  nativeBuildInputs = [ cmake ];
+  buildPhase = if nativeBuild then "make" else "true";
 
   installPhase = ''
     mkdir -p $out/include
@@ -20,9 +28,9 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "Functions and types that are suggested for use by the C++ Core Guidelines";
-    homepage = https://github.com/Microsoft/GSL;
-    license = licenses.mit;
-    platforms = platforms.all;
-    maintainers = with maintainers; [ xwvvvvwx ];
+    homepage    = https://github.com/Microsoft/GSL;
+    license     = licenses.mit;
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ thoughtpolice xwvvvvwx ];
   };
 }
diff --git a/pkgs/development/libraries/mlt/qt-5.nix b/pkgs/development/libraries/mlt/qt-5.nix
index f3bdc005247..7111a78381d 100644
--- a/pkgs/development/libraries/mlt/qt-5.nix
+++ b/pkgs/development/libraries/mlt/qt-5.nix
@@ -69,7 +69,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "Open source multimedia framework, designed for television broadcasting";
-    homepage = http://www.mltframework.org/;
+    homepage = https://www.mltframework.org/;
     license = licenses.gpl3;
     maintainers = [ maintainers.goibhniu ];
     platforms = platforms.linux;
diff --git a/pkgs/development/libraries/mongoc/default.nix b/pkgs/development/libraries/mongoc/default.nix
index 4cba89d9206..2a933ef7840 100644
--- a/pkgs/development/libraries/mongoc/default.nix
+++ b/pkgs/development/libraries/mongoc/default.nix
@@ -12,8 +12,10 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ pkgconfig which perl ];
-  buildInputs = [ openssl zlib snappy ];
-  propagatedBuildInputs = [ libbson ];
+  buildInputs = [ openssl zlib ];
+  propagatedBuildInputs = [ libbson snappy ];
+
+  enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
     description = "The official C client library for MongoDB";
diff --git a/pkgs/development/libraries/mp4v2/default.nix b/pkgs/development/libraries/mp4v2/default.nix
index de8e5f78646..736c31b442a 100644
--- a/pkgs/development/libraries/mp4v2/default.nix
+++ b/pkgs/development/libraries/mp4v2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ stdenv, lib, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "mp4v2-2.0.0";
@@ -18,10 +18,12 @@ stdenv.mkDerivation rec {
 
   hardeningDisable = [ "format" ];
 
+  enableParallelBuilding = true;
+
   meta = {
     homepage = https://code.google.com/archive/p/mp4v2/;
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.mpl11;
+    platforms = lib.platforms.unix;
+    license = lib.licenses.mpl11;
   };
 }
diff --git a/pkgs/development/libraries/mpfr/default.nix b/pkgs/development/libraries/mpfr/default.nix
index 6be199af193..fe364f22f9a 100644
--- a/pkgs/development/libraries/mpfr/default.nix
+++ b/pkgs/development/libraries/mpfr/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     stdenv.lib.optional hostPlatform.isSunOS "--disable-thread-safe" ++
     stdenv.lib.optional hostPlatform.is64bit "--with-pic";
 
-  doCheck = hostPlatform == buildPlatform;
+  doCheck = true; # not cross;
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/mps/default.nix b/pkgs/development/libraries/mps/default.nix
index 4e4ddfb6389..5a841f165ca 100644
--- a/pkgs/development/libraries/mps/default.nix
+++ b/pkgs/development/libraries/mps/default.nix
@@ -5,7 +5,7 @@ stdenv.mkDerivation rec {
   version = "1.116.0";
 
   src = fetchurl {
-    url    = "http://www.ravenbrook.com/project/mps/release/${version}/mps-kit-${version}.tar.gz";
+    url    = "https://www.ravenbrook.com/project/mps/release/${version}/mps-kit-${version}.tar.gz";
     sha256 = "1k7vnanpgawnj84x2xs6md57pfib9p7c3acngqzkl3c2aqw8qay0";
   };
 
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "A flexible memory management and garbage collection library";
-    homepage    = "http://www.ravenbrook.com/project/mps";
+    homepage    = "https://www.ravenbrook.com/project/mps";
     license     = stdenv.lib.licenses.sleepycat;
     platforms   = stdenv.lib.platforms.linux;
     maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix
index b8c7ff2f07d..0dd7b37e1a6 100644
--- a/pkgs/development/libraries/ncurses/default.nix
+++ b/pkgs/development/libraries/ncurses/default.nix
@@ -11,18 +11,23 @@
 }:
 
 stdenv.mkDerivation rec {
-  version = if abiVersion == "5" then "5.9" else "6.0-20170902";
+  version = if abiVersion == "5" then "5.9" else "6.0-20171125";
   name = "ncurses-${version}";
 
   src = fetchurl (if abiVersion == "5" then {
     url = "mirror://gnu/ncurses/${name}.tar.gz";
     sha256 = "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh";
   } else {
-    url = "ftp://ftp.invisible-island.net/ncurses/current/${name}.tgz";
-    sha256 = "1cks4gsz4148jw6wpqia4w5jx7cfxr29g2kmpvp0ssmvwczh8dr4";
+    urls = [
+      "ftp://ftp.invisible-island.net/ncurses/current/${name}.tgz"
+      "https://invisible-mirror.net/archives/ncurses/current/${name}.tgz"
+    ];
+    sha256 = "11adzj0k82nlgpfrflabvqn2m7fmhp2y6pd7ivmapynxqb9vvb92";
   });
 
-  patches = [ ./clang.patch ] ++ lib.optional (abiVersion == "5" && stdenv.cc.isGNU) ./gcc-5.patch;
+  # Unnecessarily complicated in order to avoid mass-rebuilds
+  patches = lib.optional (!stdenv.cc.isClang || abiVersion == "5") ./clang.patch
+    ++ lib.optional (stdenv.cc.isGNU && abiVersion == "5") ./gcc-5.patch;
 
   outputs = [ "out" "dev" "man" ];
   setOutputFlags = false; # some aren't supported
@@ -37,10 +42,11 @@ 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";
 
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [
     pkgconfig
   ] ++ lib.optionals (buildPlatform != hostPlatform) [
-    buildPackages.ncurses buildPackages.stdenv.cc
+    buildPackages.ncurses
   ];
   buildInputs = lib.optional (mouseSupport && stdenv.isLinux) gpm;
 
diff --git a/pkgs/development/libraries/ndpi/default.nix b/pkgs/development/libraries/ndpi/default.nix
index f1232d7d253..c84cddc897c 100644
--- a/pkgs/development/libraries/ndpi/default.nix
+++ b/pkgs/development/libraries/ndpi/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     longDescription = ''
       nDPI is a library for deep-packet inspection based on OpenDPI.
     '';
-    homepage = http://www.ntop.org/products/deep-packet-inspection/ndpi/;
+    homepage = https://www.ntop.org/products/deep-packet-inspection/ndpi/;
     license = with licenses; lgpl3;
     maintainers = with maintainers; [ takikawa ];
     platforms = with platforms; unix;
diff --git a/pkgs/development/libraries/netcdf-cxx4/default.nix b/pkgs/development/libraries/netcdf-cxx4/default.nix
index de9023a5710..d67fdc110f0 100644
--- a/pkgs/development/libraries/netcdf-cxx4/default.nix
+++ b/pkgs/development/libraries/netcdf-cxx4/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "C++ API to manipulate netcdf files";
-    homepage = http://www.unidata.ucar.edu/software/netcdf/;
+    homepage = https://www.unidata.ucar.edu/software/netcdf/;
     license = stdenv.lib.licenses.free;
     platforms = stdenv.lib.platforms.unix;
   };
diff --git a/pkgs/development/libraries/nettle/default.nix b/pkgs/development/libraries/nettle/default.nix
index 3923daad6f4..5b998926f0a 100644
--- a/pkgs/development/libraries/nettle/default.nix
+++ b/pkgs/development/libraries/nettle/default.nix
@@ -1,10 +1,10 @@
 { callPackage, fetchurl, ... } @ args:
 
 callPackage ./generic.nix (args // rec {
-  version = "3.3";
+  version = "3.4";
 
   src = fetchurl {
     url = "mirror://gnu/nettle/nettle-${version}.tar.gz";
-    sha256 = "07mif3af077763vc35s1x8vzhzlgqcgxh67c1xr13jnhslkjd526";
+    sha256 = "150y8655h629wn946dvzasq16qxsc1m9nf58mifvhl350bgl4ymf";
   };
 })
diff --git a/pkgs/development/libraries/newt/default.nix b/pkgs/development/libraries/newt/default.nix
index e00decca2ff..c4e019bf3ac 100644
--- a/pkgs/development/libraries/newt/default.nix
+++ b/pkgs/development/libraries/newt/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   '';
 
   crossAttrs = {
-    makeFlags = "CROSS_COMPILE=${stdenv.cc.prefix}";
+    makeFlags = "CROSS_COMPILE=${stdenv.cc.targetPrefix}";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/nspr/default.nix b/pkgs/development/libraries/nspr/default.nix
index 8f7bebf649c..2930de508e9 100644
--- a/pkgs/development/libraries/nspr/default.nix
+++ b/pkgs/development/libraries/nspr/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl
 , CoreServices ? null }:
 
-let version = "4.16"; in
+let version = "4.17"; in
 
 stdenv.mkDerivation {
   name = "nspr-${version}";
 
   src = fetchurl {
     url = "mirror://mozilla/nspr/releases/v${version}/src/nspr-${version}.tar.gz";
-    sha256 = "1l9wlnb9y0bzicv448jjl9kssqn044dc2qrkwzp4ll35fvch4ccv";
+    sha256 = "158hdn285dsb5rys8wl1wi32dd1axwhqq0r8fwny4aj157m0l2jr";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/nss/ckpem.patch b/pkgs/development/libraries/nss/ckpem.patch
new file mode 100644
index 00000000000..c1a65a6c0b2
--- /dev/null
+++ b/pkgs/development/libraries/nss/ckpem.patch
@@ -0,0 +1,11 @@
+--- nss/lib/ckfw/pem/ckpem.h	2018-01-03 13:36:12.000000000 -0800
++++ nss/lib/ckfw/pem/ckpem.h	2018-01-03 13:36:20.000000000 -0800
+@@ -156,8 +156,6 @@
+ NSS_EXTERN_DATA pemInternalObject nss_pem_data[];
+ NSS_EXTERN_DATA const PRUint32               nss_pem_nObjects;
+ 
+-  PRBool          logged_in;
+-
+ /* our raw object data array */
+ NSS_EXTERN_DATA pemInternalObject nss_pem_data[];
+ NSS_EXTERN_DATA const PRUint32               nss_pem_nObjects;
diff --git a/pkgs/development/libraries/nss/default.nix b/pkgs/development/libraries/nss/default.nix
index 5f0918d6451..47f5c1ef5cf 100644
--- a/pkgs/development/libraries/nss/default.nix
+++ b/pkgs/development/libraries/nss/default.nix
@@ -9,11 +9,11 @@ let
 
 in stdenv.mkDerivation rec {
   name = "nss-${version}";
-  version = "3.32.1";
+  version = "3.33";
 
   src = fetchurl {
-    url = "mirror://mozilla/security/nss/releases/NSS_3_32_1_RTM/src/${name}.tar.gz";
-    sha256 = "0lj6c94102aa81bnjisnix09zfjly9aa1d6vrzxmcjmzynkrrrad";
+    url = "mirror://mozilla/security/nss/releases/NSS_3_33_RTM/src/${name}.tar.gz";
+    sha256 = "1r44qa4j7sri50mxxbnrpm6fxprwrhv76whi7bfq73j06syxmw4q";
   };
 
   buildInputs = [ perl zlib sqlite ];
@@ -28,6 +28,7 @@ in stdenv.mkDerivation rec {
     [
       # Based on http://patch-tracker.debian.org/patch/series/dl/nss/2:3.15.4-1/85_security_load.patch
       ./85_security_load.patch
+      ./ckpem.patch
     ];
 
   patchFlags = "-p0";
@@ -45,7 +46,8 @@ in stdenv.mkDerivation rec {
     "NSS_ENABLE_ECC=1"
     "USE_SYSTEM_ZLIB=1"
     "NSS_USE_SYSTEM_SQLITE=1"
-  ] ++ stdenv.lib.optional stdenv.is64bit "USE_64=1";
+  ] ++ stdenv.lib.optional stdenv.is64bit "USE_64=1"
+    ++ stdenv.lib.optional stdenv.isDarwin "CCC=clang++";
 
   NIX_CFLAGS_COMPILE = "-Wno-error";
 
@@ -84,15 +86,22 @@ in stdenv.mkDerivation rec {
 
   postFixup = ''
     for libname in freebl3 nssdbm3 softokn3
-    do
-      libfile="$out/lib/lib$libname.so"
-      LD_LIBRARY_PATH=$out/lib $out/bin/shlibsign -v -i "$libfile"
+    do '' +
+    (if stdenv.isDarwin
+     then ''
+       libfile="$out/lib/lib$libname.dylib"
+       DYLD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \
+     '' else ''
+       libfile="$out/lib/lib$libname.so"
+       LD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \
+     '') + ''
+        $out/bin/shlibsign -v -i "$libfile"
     done
 
     moveToOutput bin "$tools"
     moveToOutput bin/nss-config "$dev"
     moveToOutput lib/libcrmf.a "$dev" # needed by firefox, for example
-    rm "$out"/lib/*.a
+    rm -f "$out"/lib/*.a
   '';
 
   meta = {
diff --git a/pkgs/development/libraries/ogre/1.9.x.nix b/pkgs/development/libraries/ogre/1.9.x.nix
new file mode 100644
index 00000000000..b3b6e918bde
--- /dev/null
+++ b/pkgs/development/libraries/ogre/1.9.x.nix
@@ -0,0 +1,46 @@
+{ fetchFromGitHub, stdenv, lib
+, cmake, mesa
+, freetype, freeimage, zziplib, randrproto, libXrandr
+, libXaw, freeglut, libXt, libpng, boost, ois
+, xproto, libX11, libXmu, libSM, pkgconfig
+, libXxf86vm, xf86vidmodeproto, libICE
+, renderproto, libXrender
+, withNvidiaCg ? false, nvidia_cg_toolkit
+, withSamples ? false }:
+
+stdenv.mkDerivation rec {
+  pname = "ogre";
+  version = "1.9.1";
+  name = "${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "OGRECave";
+    repo = "ogre";
+    rev = "v${version}";
+    sha256 = "11lfgzqaps3728dswrq3cbwk7aicigyz08q4hfyy6ikc6m35r4wg";
+  };
+
+  cmakeFlags = [ "-DOGRE_BUILD_SAMPLES=${toString withSamples}" ]
+    ++ map (x: "-DOGRE_BUILD_PLUGIN_${x}=on")
+           ([ "BSP" "OCTREE" "PCZ" "PFX" ] ++ lib.optional withNvidiaCg "CG")
+    ++ map (x: "-DOGRE_BUILD_RENDERSYSTEM_${x}=on") [ "GL" ];
+
+  enableParallelBuilding = true;
+
+  buildInputs =
+   [ cmake mesa
+     freetype freeimage zziplib randrproto libXrandr
+     libXaw freeglut libXt libpng boost ois
+     xproto libX11 libXmu libSM pkgconfig
+     libXxf86vm xf86vidmodeproto libICE
+     renderproto libXrender
+   ] ++ lib.optional withNvidiaCg nvidia_cg_toolkit;
+
+  meta = {
+    description = "A 3D engine";
+    homepage = http://www.ogre3d.org/;
+    maintainers = [ stdenv.lib.maintainers.raskin ];
+    platforms = stdenv.lib.platforms.linux;
+    license = stdenv.lib.licenses.mit;
+  };
+}
diff --git a/pkgs/development/libraries/ogre/default.nix b/pkgs/development/libraries/ogre/default.nix
index aba02827665..e0d6d2fa41c 100644
--- a/pkgs/development/libraries/ogre/default.nix
+++ b/pkgs/development/libraries/ogre/default.nix
@@ -9,11 +9,11 @@
 , withSamples ? false }:
 
 stdenv.mkDerivation {
-  name = "ogre-1.9-hg-20160322";
+  name = "ogre-1.10.11";
 
   src = fetchurl {
-     url = "https://bitbucket.org/sinbad/ogre/get/v1-9.tar.gz";
-     sha256 = "0w3argjy1biaxwa3c80zxxgll67wjp8czd83p87awlcvwzdk5mz9";
+     url = "https://bitbucket.org/sinbad/ogre/get/v1-10-11.tar.gz";
+     sha256 = "1zwvlx5dz9nwjazhnrhzb0w8ilpa84r0hrxrmmy69pgr1p1yif5a";
   };
 
   cmakeFlags = [ "-DOGRE_BUILD_SAMPLES=${toString withSamples}" ]
@@ -34,7 +34,7 @@ stdenv.mkDerivation {
 
   meta = {
     description = "A 3D engine";
-    homepage = http://www.ogre3d.org/;
+    homepage = https://www.ogre3d.org/;
     maintainers = [ stdenv.lib.maintainers.raskin ];
     platforms = stdenv.lib.platforms.linux;
     license = stdenv.lib.licenses.mit;
diff --git a/pkgs/development/libraries/ogrepaged/default.nix b/pkgs/development/libraries/ogrepaged/default.nix
index 2408c3e4904..e4045bcd5dc 100644
--- a/pkgs/development/libraries/ogrepaged/default.nix
+++ b/pkgs/development/libraries/ogrepaged/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, pkgconfig, ois, ogre, libX11, boost }:
+{ stdenv, fetchurl, fetchpatch, cmake, pkgconfig, ois, ogre, libX11, boost }:
 
 stdenv.mkDerivation rec {
   name = "ogre-paged-${version}";
@@ -9,6 +9,23 @@ stdenv.mkDerivation rec {
     sha256 = "17j7rw9wbkynxbhm2lay3qgjnnagb2vd5jn9iijnn2lf8qzbgy82";
   };
 
+  patches = [
+    # These patches come from https://github.com/RigsOfRods/ogre-pagedgeometry/pull/6
+    # and make ogre-paged build with ogre-1.10.
+    (fetchpatch {
+      url = "https://github.com/RigsOfRods/ogre-pagedgeometry/commit/2d4df577decba37ec3cdafc965deae0f6d31fe45.patch";
+      sha256 = "0mdqa9w1p6cmli6976v4wi0sw9r4p5prkj7lzfd1877wk11c9c73";
+    })
+    (fetchpatch {
+      url = "https://github.com/RigsOfRods/ogre-pagedgeometry/commit/4d81789ec6f55e294a5ad040ea7abe2b415cbc92.patch";
+      sha256 = "17q8djdz2y3g46azxc3idhyvi6vf0sqkxld4bbyp3l9zn7dq76rp";
+    })
+    (fetchpatch {
+      url = "https://github.com/RigsOfRods/ogre-pagedgeometry/commit/10f7c5ce5b422e9cbac59d466f3567a24c8831a4.patch";
+      sha256 = "1kk0dbadzg73ai99l3w04q51sil36vzbkaqc79mdwy0vjrn4ardb";
+    })
+  ];
+
   buildInputs = [ ois ogre libX11 boost ];
   nativeBuildInputs = [ cmake pkgconfig ];
 
diff --git a/pkgs/development/libraries/opencascade/default.nix b/pkgs/development/libraries/opencascade/default.nix
index 58f9019d6e0..c2fba26ba68 100644
--- a/pkgs/development/libraries/opencascade/default.nix
+++ b/pkgs/development/libraries/opencascade/default.nix
@@ -10,6 +10,12 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ mesa tcl tk file libXmu libtool qt4 ftgl freetype cmake ];
 
+  # Fix for glibc 2.26
+  postPatch = ''
+    sed -i -e 's/^\( *#include <\)x\(locale.h>\)//' \
+      src/Standard/Standard_CLocaleSentry.hxx
+  '';
+
   preConfigure = ''
     cmakeFlags="$cmakeFlags -DOCE_INSTALL_PREFIX=$out"
   '';
diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix
index e6cb75d3b3d..356e1e336ac 100644
--- a/pkgs/development/libraries/opencv/3.x.nix
+++ b/pkgs/development/libraries/opencv/3.x.nix
@@ -1,6 +1,7 @@
 { lib, stdenv
-, fetchurl, fetchFromGitHub
-, cmake, pkgconfig, unzip, zlib, pcre, hdf5, protobuf
+, fetchurl, fetchFromGitHub, fetchpatch
+, cmake, pkgconfig, unzip, zlib, pcre, hdf5
+, caffe, glog, boost, google-gflags, protobuf
 , config
 
 , enableJPEG      ? true, libjpeg
@@ -14,34 +15,39 @@
 
 , enableCuda      ? (config.cudaSupport or false), cudatoolkit
 
+, enableUnfree    ? false
 , enableIpp       ? false
-, enableContrib   ? false  #, caffe, glog, boost, google-gflags
+, enableContrib   ? false
 , enablePython    ? false, pythonPackages
 , enableGtk2      ? false, gtk2
 , enableGtk3      ? false, gtk3
+, enableVtk       ? false, vtk
 , enableFfmpeg    ? false, ffmpeg
 , enableGStreamer ? false, gst_all_1
 , enableTesseract ? false, tesseract, leptonica
+, enableOvis      ? false, ogre
+, enableGPhoto2   ? false, libgphoto2
+, enableDC1394    ? false, libdc1394
 , enableDocs      ? false, doxygen, graphviz-nox
 
-, AVFoundation, Cocoa, QTKit
+, AVFoundation, Cocoa, QTKit, VideoDecodeAcceleration, bzip2
 }:
 
 let
-  version = "3.3.0";
+  version = "3.4.0";
 
   src = fetchFromGitHub {
     owner  = "opencv";
     repo   = "opencv";
     rev    = version;
-    sha256 = "0266kg337wij9rz602z5088jn2fq56aqpxxflf0fbh28kygchvk4";
+    sha256 = "1nc14kvsjwaisv7d1r6f0hn7na9zr2cm2zh3hd3r9qwm3g78xnac";
   };
 
   contribSrc = fetchFromGitHub {
     owner  = "opencv";
     repo   = "opencv_contrib";
     rev    = version;
-    sha256 = "0qxdvzdszzlpsya1pn4d2r9z4j98isxrgk15a2wwa3dqjmgv880d";
+    sha256 = "1cxw7nra3f1hng057c6hi1ynsyqdazd69irjdgn8xjg6q9h76br0";
   };
 
   # Contrib must be built in order to enable Tesseract support:
@@ -52,16 +58,16 @@ let
     src = fetchFromGitHub {
       owner  = "opencv";
       repo   = "opencv_3rdparty";
-      rev    = "a62e20676a60ee0ad6581e217fe7e4bada3b95db";
-      sha256 = "04idycc479l7fidj6r107sv65iszndswm287ms3nh896jbpbaxbv";
+      rev    = "dfe3162c237af211e98b8960018b564bc209261d";
+      sha256 = "1k5xiwdi5r2y3fs5g70lpknxqi4pj32w6l311gfwng3q1cb2crif";
     } + "/ippicv";
-    files = let name = platform : "ippicv_2017u2_${platform}_20170418.tgz"; in
+    files = let name = platform : "ippicv_2017u3_${platform}_general_20170822.tgz"; in
       if stdenv.system == "x86_64-linux" then
-      { ${name "lnx_intel64"} = "87cbdeb627415d8e4bc811156289fa3a"; }
+      { ${name "lnx_intel64"} = "4e0352ce96473837b1d671ce87f17359"; }
       else if stdenv.system == "i686-linux" then
-      { ${name "lnx_ia32"}    = "f2cece00d802d4dea86df52ed095257e"; }
+      { ${name "lnx_ia32"}    = "dcdb0ba4b123f240596db1840cd59a76"; }
       else if stdenv.system == "x86_64-darwin" then
-      { ${name "mac_intel64"} = "0c25953c99dbb499ff502485a9356d8d"; }
+      { ${name "mac_intel64"} = "c1ebb5dfa5b7f54b0c44e1917805a463"; }
       else
       throw "ICV is not available for this platform (or not yet supported by this package)";
     dst = ".cache/ippicv";
@@ -104,6 +110,21 @@ let
     dst = ".cache/xfeatures2d/boostdesc";
   };
 
+  # See opencv_contrib/modules/face/CMakeLists.txt
+  face = {
+    src = fetchFromGitHub {
+      owner  = "opencv";
+      repo   = "opencv_3rdparty";
+      rev    = "8afa57abc8229d611c4937165d20e2a2d9fc5a12";
+      sha256 = "061lsvqdidq9xa2hwrcvwi9ixflr2c2lfpc8drr159g68zi8bp4v";
+    };
+    files = {
+      "face_landmark_model.dat" = "7505c44ca4eb54b4ab1e4777cb96ac05";
+    };
+    dst = ".cache/data";
+  };
+
+  # See opencv/cmake/OpenCVDownload.cmake
   installExtraFiles = extra : with lib; ''
     mkdir -p "${extra.dst}"
   '' + concatStrings (mapAttrsToList (name : md5 : ''
@@ -121,14 +142,23 @@ let
     dst  = ".cache/tiny_dnn";
   };
 
-  opencvFlag = name: enabled: "-DWITH_${name}=${if enabled then "ON" else "OFF"}";
+  opencvFlag = name: enabled: "-DWITH_${name}=${printEnabled enabled}";
 
+  printEnabled = enabled : if enabled then "ON" else "OFF";
 in
 
 stdenv.mkDerivation rec {
   name = "opencv-${version}";
   inherit version src;
 
+  patches = [
+    # Fix for: https://github.com/opencv/opencv/issues/10474
+    (fetchpatch {
+      url = "https://github.com/opencv/opencv/commit/ea5a3e557f93844fdb5e54e3e8acfc5f61c6fd9f.patch";
+      sha256 = "1w7jmqlrx73ydh9jjsnnic5xz8r04kxbjpzkcfyb91v3az9132r1";
+    })
+  ];
+
   postUnpack = lib.optionalString buildContrib ''
     cp --no-preserve=mode -r "${contribSrc}/modules" "$NIX_BUILD_TOP/opencv_contrib"
   '';
@@ -150,16 +180,19 @@ stdenv.mkDerivation rec {
 
       ${installExtraFiles vgg}
       ${installExtraFiles boostdesc}
+      ${installExtraFiles face}
 
       mkdir -p "${tinyDnn.dst}"
       ln -s "${tinyDnn.src}" "${tinyDnn.dst}/${tinyDnn.md5}-${tinyDnn.name}"
     '');
 
   buildInputs =
-       [ zlib pcre hdf5 protobuf ]
+       [ zlib pcre hdf5 glog boost google-gflags protobuf ]
+    ++ lib.optional (!stdenv.isDarwin) caffe
     ++ lib.optional enablePython pythonPackages.python
     ++ lib.optional enableGtk2 gtk2
     ++ lib.optional enableGtk3 gtk3
+    ++ lib.optional enableVtk vtk
     ++ lib.optional enableJPEG libjpeg
     ++ lib.optional enablePNG libpng
     ++ lib.optional enableTIFF libtiff
@@ -167,7 +200,12 @@ stdenv.mkDerivation rec {
     ++ lib.optionals enableEXR [ openexr ilmbase ]
     ++ lib.optional enableJPEG2K jasper
     ++ lib.optional enableFfmpeg ffmpeg
+    ++ lib.optionals (enableFfmpeg && stdenv.isDarwin)
+                     [ VideoDecodeAcceleration bzip2 ]
     ++ lib.optionals enableGStreamer (with gst_all_1; [ gstreamer gst-plugins-base ])
+    ++ lib.optional enableOvis ogre
+    ++ lib.optional enableGPhoto2 libgphoto2
+    ++ lib.optional enableDC1394 libdc1394
     ++ lib.optional enableEigen eigen
     ++ lib.optional enableOpenblas openblas
     # There is seemingly no compile-time flag for Tesseract.  It's
@@ -175,12 +213,7 @@ stdenv.mkDerivation rec {
     # tesseract & leptonica.
     ++ lib.optionals enableTesseract [ tesseract leptonica ]
     ++ lib.optional enableCuda cudatoolkit
-
-    # These are only needed for the currently disabled
-    # cnn_3dobj and dnn_modern modules
-    # ++ lib.optionals buildContrib [ caffe glog boost google-gflags ]
-
-    ++ lib.optionals stdenv.isDarwin [ AVFoundation Cocoa QTKit ]
+    ++ lib.optionals stdenv.isDarwin [ AVFoundation Cocoa QTKit VideoDecodeAcceleration bzip2 ]
     ++ lib.optionals enableDocs [ doxygen graphviz-nox ];
 
   propagatedBuildInputs = lib.optional enablePython pythonPackages.numpy;
@@ -190,9 +223,10 @@ stdenv.mkDerivation rec {
   NIX_CFLAGS_COMPILE = lib.optional enableEXR "-I${ilmbase.dev}/include/OpenEXR";
 
   cmakeFlags = [
+    "-DWITH_OPENMP=ON"
     "-DBUILD_PROTOBUF=OFF"
     "-DPROTOBUF_UPDATE_FILES=ON"
-    "-DWITH_OPENMP=ON"
+    "-DOPENCV_ENABLE_NONFREE=${printEnabled enableUnfree}"
     (opencvFlag "IPP" enableIpp)
     (opencvFlag "TIFF" enableTIFF)
     (opencvFlag "JASPER" enableJPEG2K)
@@ -205,17 +239,14 @@ stdenv.mkDerivation rec {
   ] ++ lib.optionals enableCuda [
     "-DCUDA_FAST_MATH=ON"
     "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/gcc"
-  ] ++ lib.optionals buildContrib [
-         # the cnn_3dobj module fails to build
-         "-DBUILD_opencv_cnn_3dobj=OFF"
-
-         # the dnn_modern module causes:
-         # https://github.com/opencv/opencv_contrib/issues/823
-         #
-         # On OS X its dependency tiny-dnn-1.0.0a3 also fails to build.
-         "-DBUILD_opencv_dnn_modern=OFF"
-       ]
-    ++ lib.optionals stdenv.isDarwin ["-DWITH_OPENCL=OFF" "-DWITH_LAPACK=OFF"];
+  ]
+    ++ lib.optionals stdenv.isDarwin [
+      "-DWITH_OPENCL=OFF"
+      "-DWITH_LAPACK=OFF"
+
+      # On OS X the tiny-dnn-1.0.0a3 dependency of dnn_modern fails to build.
+      "-DBUILD_opencv_dnn_modern=OFF"
+    ];
 
   enableParallelBuilding = true;
 
@@ -230,7 +261,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Open Computer Vision Library with more than 500 algorithms";
     homepage = http://opencv.org/;
-    license = stdenv.lib.licenses.bsd3;
+    license = with stdenv.lib.licenses; if enableUnfree then unfree else bsd3;
     maintainers = with stdenv.lib.maintainers; [viric mdaiter basvandijk];
     platforms = with stdenv.lib.platforms; linux ++ darwin;
   };
diff --git a/pkgs/development/libraries/opencv/default.nix b/pkgs/development/libraries/opencv/default.nix
index aadd108620a..cbac7210a10 100644
--- a/pkgs/development/libraries/opencv/default.nix
+++ b/pkgs/development/libraries/opencv/default.nix
@@ -85,7 +85,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "Open Computer Vision Library with more than 500 algorithms";
-    homepage = http://opencv.org/;
+    homepage = https://opencv.org/;
     license = licenses.bsd3;
     maintainers = with maintainers; [ viric ];
     platforms = platforms.linux ++ platforms.darwin;
diff --git a/pkgs/development/libraries/opendbx/default.nix b/pkgs/development/libraries/opendbx/default.nix
index 37afa3fd507..48ec5141e34 100644
--- a/pkgs/development/libraries/opendbx/default.nix
+++ b/pkgs/development/libraries/opendbx/default.nix
@@ -12,10 +12,10 @@ stdenv.mkDerivation rec {
   };
 
   preConfigure = ''
-    export CPPFLAGS="-I${getDev mysql.client}/include/mysql"
-    export LDFLAGS="-L${getLib mysql.client}/lib/mysql -L${getLib postgresql}/lib"
+    export CPPFLAGS="-I${mysql.connector-c}/include/mysql"
+    export LDFLAGS="-L${mysql.connector-c}/lib/mysql -L${postgresql}/lib"
     configureFlagsArray=(--with-backends="mysql pgsql sqlite3")
   '';
 
-  buildInputs = [ readline mysql.client postgresql sqlite ];
+  buildInputs = [ readline mysql.connector-c postgresql sqlite ];
 }
diff --git a/pkgs/development/libraries/openexr/default.nix b/pkgs/development/libraries/openexr/default.nix
index 27a9860c868..8d5a6bb65a9 100644
--- a/pkgs/development/libraries/openexr/default.nix
+++ b/pkgs/development/libraries/openexr/default.nix
@@ -1,13 +1,17 @@
-{ lib, stdenv, fetchurl, autoconf, automake, libtool, pkgconfig, zlib, ilmbase }:
+{ lib, stdenv, fetchurl, fetchpatch, autoconf, automake, libtool, pkgconfig, zlib, ilmbase }:
 
 stdenv.mkDerivation rec {
   name = "openexr-${lib.getVersion ilmbase}";
 
   src = fetchurl {
     url = "http://download.savannah.nongnu.org/releases/openexr/${name}.tar.gz";
-    sha256 = "0ca2j526n4wlamrxb85y2jrgcv0gf21b3a19rr0gh4rjqkv1581n";
+    sha256 = "1kdf2gqznsdinbd5vcmqnif442nyhdf9l7ckc51410qm2gv5m6lg";
   };
 
+  patches = [
+    ./bootstrap.patch
+  ];
+
   outputs = [ "bin" "dev" "out" "doc" ];
 
   preConfigure = ''
@@ -20,8 +24,6 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  patches = [ ./bootstrap.patch ];
-
   meta = with stdenv.lib; {
     homepage = http://www.openexr.com/;
     license = licenses.bsd3;
diff --git a/pkgs/development/libraries/openjpeg/2.1.nix b/pkgs/development/libraries/openjpeg/2.1.nix
index ae8710e58a2..d18c971dc11 100644
--- a/pkgs/development/libraries/openjpeg/2.1.nix
+++ b/pkgs/development/libraries/openjpeg/2.1.nix
@@ -1,37 +1,8 @@
 { callPackage, fetchpatch, ... } @ args:
 
 callPackage ./generic.nix (args // rec {
-  version = "2.1.2";
-  branch = "2.1";
-  revision = "v2.1.2";
-  sha256 = "0kdcl9sqjz0vagli4ad6bxq1r8ma086m0prpkm5x3dxp37hpjp8h";
-
-  patches = [
-    # Fetched from https://github.com/szukw000/openjpeg/commit/cadff5fb6e73398de26a92e96d3d7cac893af255
-    # Referenced from https://bugzilla.redhat.com/show_bug.cgi?id=1405135
-    # Put in our source code to make sure we don't lose it, since that
-    # referenced commit is someone else's fork, and not actually up-stream.
-    ./CVE-2016-9580-and-CVE-2016-9581.patch
-
-    (fetchpatch {
-      url = "https://bugzilla.suse.com/attachment.cgi?id=707359&action=diff&context=patch&collapsed=&headers=1&format=raw";
-      name = "CVE-2016-9112.patch";
-      sha256 = "18hqx73wdzfybr5n5k6pzhbhdlmawiqbjci8n82zykxiyfgp18pd";
-    })
-    (fetchpatch {
-      url = "https://bugzilla.suse.com/attachment.cgi?id=707354&action=diff&context=patch&collapsed=&headers=1&format=raw";
-      name = "CVE-2016-9114.patch";
-      sha256 = "0qam3arw9kdbh4501xim2pyldl708dnpyjwvjmwc9gc7hcq4gfi3";
-    })
-    (fetchpatch {
-      url = "https://bugzilla.suse.com/attachment.cgi?id=707356&action=diff&context=patch&collapsed=&headers=1&format=raw";
-      name = "CVE-2016-9116.patch";
-      sha256 = "0yyb3pxqi5sr44a48bacngzp206j4z49lzkg6hbkz1nra9na61a3";
-    })
-    (fetchpatch {
-      url = "https://bugzilla.suse.com/attachment.cgi?id=707358&action=diff&context=patch&collapsed=&headers=1&format=raw";
-      name = "CVE-2016-9118.patch";
-      sha256 = "125n8bmh07y7697s0y82ypb39rxgj0bdn8rcywbvamscagwg2wy9";
-    })
-  ];
+  version = "2.3.0";
+  branch = "2.3";
+  revision = "v${version}";
+  sha256 = "08plxrnfl33sn2vh5nwbsngyv6b1sfpplvx881crm1v1ai10m2lz";
 })
diff --git a/pkgs/development/libraries/openjpeg/CVE-2016-9580-and-CVE-2016-9581.patch b/pkgs/development/libraries/openjpeg/CVE-2016-9580-and-CVE-2016-9581.patch
deleted file mode 100644
index 064e7419c34..00000000000
--- a/pkgs/development/libraries/openjpeg/CVE-2016-9580-and-CVE-2016-9581.patch
+++ /dev/null
@@ -1,242 +0,0 @@
-From cadff5fb6e73398de26a92e96d3d7cac893af255 Mon Sep 17 00:00:00 2001
-From: szukw000 <szukw000@arcor.de>
-Date: Fri, 9 Dec 2016 08:29:55 +0100
-Subject: [PATCH] These changes repair bugs of #871 and #872
-
----
- src/bin/jp2/converttif.c | 107 +++++++++++++++++++++++++++++++----------------
- 1 file changed, 70 insertions(+), 37 deletions(-)
-
-diff --git a/src/bin/jp2/converttif.c b/src/bin/jp2/converttif.c
-index 143d3be..c690f8b 100644
---- a/src/bin/jp2/converttif.c
-+++ b/src/bin/jp2/converttif.c
-@@ -553,20 +553,18 @@ static void tif_32sto16u(const OPJ_INT32* pSrc, OPJ_UINT16* pDst, OPJ_SIZE_T len
- 
- int imagetotif(opj_image_t * image, const char *outfile)
- {
--	int width, height;
--	int bps,adjust, sgnd;
--	int tiPhoto;
-+	uint32 width, height, bps, tiPhoto;
-+	int adjust, sgnd;
- 	TIFF *tif;
- 	tdata_t buf;
--	tsize_t strip_size;
-+	tmsize_t strip_size, rowStride;
- 	OPJ_UINT32 i, numcomps;
--	OPJ_SIZE_T rowStride;
- 	OPJ_INT32* buffer32s = NULL;
- 	OPJ_INT32 const* planes[4];
- 	convert_32s_PXCX cvtPxToCx = NULL;
- 	convert_32sXXx_C1R cvt32sToTif = NULL;
- 
--	bps = (int)image->comps[0].prec;
-+	bps = (uint32)image->comps[0].prec;
- 	planes[0] = image->comps[0].data;
- 	
- 	numcomps = image->numcomps;
-@@ -674,13 +672,13 @@ int imagetotif(opj_image_t * image, const char *outfile)
- 			break;
- 	}
- 	sgnd = (int)image->comps[0].sgnd;
--	adjust = sgnd ? 1 << (image->comps[0].prec - 1) : 0;
--	width   = (int)image->comps[0].w;
--	height  = (int)image->comps[0].h;
-+	adjust = sgnd ? (int)(1 << (image->comps[0].prec - 1)) : 0;
-+	width   = (uint32)image->comps[0].w;
-+	height  = (uint32)image->comps[0].h;
- 	
- 	TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, width);
- 	TIFFSetField(tif, TIFFTAG_IMAGELENGTH, height);
--	TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, numcomps);
-+	TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, (uint32)numcomps);
- 	TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bps);
- 	TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
- 	TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
-@@ -688,8 +686,8 @@ int imagetotif(opj_image_t * image, const char *outfile)
- 	TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, 1);
- 	
- 	strip_size = TIFFStripSize(tif);
--	rowStride = ((OPJ_SIZE_T)width * numcomps * (OPJ_SIZE_T)bps + 7U) / 8U;
--	if (rowStride != (OPJ_SIZE_T)strip_size) {
-+	rowStride = (width * numcomps * bps + 7U) / 8U;
-+	if (rowStride != strip_size) {
- 		fprintf(stderr, "Invalid TIFF strip size\n");
- 		TIFFClose(tif);
- 		return 1;
-@@ -699,7 +697,7 @@ int imagetotif(opj_image_t * image, const char *outfile)
- 		TIFFClose(tif);
- 		return 1;
- 	}
--	buffer32s = (OPJ_INT32 *)malloc((OPJ_SIZE_T)width * numcomps * sizeof(OPJ_INT32));
-+	buffer32s = (OPJ_INT32 *)malloc((OPJ_SIZE_T)(width * numcomps * sizeof(OPJ_INT32)));
- 	if (buffer32s == NULL) {
- 		_TIFFfree(buf);
- 		TIFFClose(tif);
-@@ -1211,20 +1209,19 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
- 	TIFF *tif;
- 	tdata_t buf;
- 	tstrip_t strip;
--	tsize_t strip_size;
-+	tmsize_t strip_size;
- 	int j, currentPlane, numcomps = 0, w, h;
- 	OPJ_COLOR_SPACE color_space = OPJ_CLRSPC_UNKNOWN;
- 	opj_image_cmptparm_t cmptparm[4]; /* RGBA */
- 	opj_image_t *image = NULL;
- 	int has_alpha = 0;
--	unsigned short tiBps, tiPhoto, tiSf, tiSpp, tiPC;
--	unsigned int tiWidth, tiHeight;
-+	uint32 tiBps, tiPhoto, tiSf, tiSpp, tiPC, tiWidth, tiHeight;
- 	OPJ_BOOL is_cinema = OPJ_IS_CINEMA(parameters->rsiz);
- 	convert_XXx32s_C1R cvtTifTo32s = NULL;
- 	convert_32s_CXPX cvtCxToPx = NULL;
- 	OPJ_INT32* buffer32s = NULL;
- 	OPJ_INT32* planes[4];
--	OPJ_SIZE_T rowStride;
-+	tmsize_t rowStride;
- 	
- 	tif = TIFFOpen(filename, "r");
- 	
-@@ -1243,22 +1240,35 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
- 	TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &tiSpp);
- 	TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &tiPhoto);
- 	TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &tiPC);
--	w= (int)tiWidth;
--	h= (int)tiHeight;
--	
--	if(tiBps > 16U) {
--		fprintf(stderr,"tiftoimage: Bits=%d, Only 1 to 16 bits implemented\n",tiBps);
--		fprintf(stderr,"\tAborting\n");
-+
-+	if(tiSpp == 0 || tiSpp > 4) { /* should be 1 ... 4 */
-+		fprintf(stderr,"tiftoimage: Bad value for samples per pixel == %hu.\n"
-+		 "\tAborting.\n", tiSpp);
-+		TIFFClose(tif);
-+		return NULL;
-+	}
-+	if(tiBps > 16U || tiBps == 0) {
-+		fprintf(stderr,"tiftoimage: Bad values for Bits == %d.\n"
-+		 "\tMax. 16 Bits are allowed here.\n\tAborting.\n",tiBps);
- 		TIFFClose(tif);
- 		return NULL;
- 	}
- 	if(tiPhoto != PHOTOMETRIC_MINISBLACK && tiPhoto != PHOTOMETRIC_RGB) {
--		fprintf(stderr,"tiftoimage: Bad color format %d.\n\tOnly RGB(A) and GRAY(A) has been implemented\n",(int) tiPhoto);
-+		fprintf(stderr,"tiftoimage: Bad color format %d.\n"
-+		 "\tOnly RGB(A) and GRAY(A) has been implemented\n",(int) tiPhoto);
- 		fprintf(stderr,"\tAborting\n");
- 		TIFFClose(tif);
- 		return NULL;
- 	}
--	
-+	if(tiWidth == 0 || tiHeight == 0) {
-+		fprintf(stderr,"tiftoimage: Bad values for width(%u) "
-+		 "and/or height(%u)\n\tAborting.\n",tiWidth,tiHeight);
-+		TIFFClose(tif);
-+		return NULL;
-+	}
-+	w= (int)tiWidth;
-+	h= (int)tiHeight;
-+
- 	switch (tiBps) {
- 		case 1:
- 		case 2:
-@@ -1312,7 +1322,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
- 		
- 		TIFFGetFieldDefaulted(tif, TIFFTAG_EXTRASAMPLES,
- 													&extrasamples, &sampleinfo);
--		
-+
- 		if(extrasamples >= 1)
- 		{
- 			switch(sampleinfo[0])
-@@ -1333,7 +1343,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
- 		else /* extrasamples == 0 */
- 			if(tiSpp == 4 || tiSpp == 2) has_alpha = 1;
- 	}
--	
-+
- 	/* initialize image components */
- 	memset(&cmptparm[0], 0, 4 * sizeof(opj_image_cmptparm_t));
- 	
-@@ -1346,7 +1356,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
- 	} else {
- 		is_cinema = 0U;
- 	}
--	
-+
- 	if(tiPhoto == PHOTOMETRIC_RGB) /* RGB(A) */
- 	{
- 		numcomps = 3 + has_alpha;
-@@ -1384,10 +1394,24 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
- 	image->x0 = (OPJ_UINT32)parameters->image_offset_x0;
- 	image->y0 = (OPJ_UINT32)parameters->image_offset_y0;
- 	image->x1 =	!image->x0 ? (OPJ_UINT32)(w - 1) * (OPJ_UINT32)subsampling_dx + 1 :
--	image->x0 + (OPJ_UINT32)(w - 1) * (OPJ_UINT32)subsampling_dx + 1;
-+	 image->x0 + (OPJ_UINT32)(w - 1) * (OPJ_UINT32)subsampling_dx + 1;
-+	if(image->x1 <= image->x0) {
-+		fprintf(stderr,"tiftoimage: Bad value for image->x1(%d) vs. "
-+		 "image->x0(%d)\n\tAborting.\n",image->x1,image->x0);
-+		TIFFClose(tif);
-+		opj_image_destroy(image);
-+		return NULL;
-+	}
- 	image->y1 =	!image->y0 ? (OPJ_UINT32)(h - 1) * (OPJ_UINT32)subsampling_dy + 1 :
--	image->y0 + (OPJ_UINT32)(h - 1) * (OPJ_UINT32)subsampling_dy + 1;
--
-+	 image->y0 + (OPJ_UINT32)(h - 1) * (OPJ_UINT32)subsampling_dy + 1;
-+	if(image->y1 <= image->y0) {
-+		fprintf(stderr,"tiftoimage: Bad value for image->y1(%d) vs. "
-+		 "image->y0(%d)\n\tAborting.\n",image->y1,image->y0);
-+		TIFFClose(tif);
-+		opj_image_destroy(image);
-+		return NULL;
-+	}
-+	
- 	for(j = 0; j < numcomps; j++)
- 	{
- 		planes[j] = image->comps[j].data;
-@@ -1395,15 +1419,15 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
- 	image->comps[numcomps - 1].alpha = (OPJ_UINT16)(1 - (numcomps & 1));
- 		
- 	strip_size = TIFFStripSize(tif);
--	
-+
- 	buf = _TIFFmalloc(strip_size);
- 	if (buf == NULL) {
- 		TIFFClose(tif);
- 		opj_image_destroy(image);
- 		return NULL;
- 	}
--	rowStride = ((OPJ_SIZE_T)w * tiSpp * tiBps + 7U) / 8U;
--	buffer32s = (OPJ_INT32 *)malloc((OPJ_SIZE_T)w * tiSpp * sizeof(OPJ_INT32));
-+	rowStride = (w * tiSpp * tiBps + 7U) / 8U;
-+	buffer32s = (OPJ_INT32 *)malloc((OPJ_SIZE_T)(w * tiSpp * sizeof(OPJ_INT32)));
- 	if (buffer32s == NULL) {
- 		_TIFFfree(buf);
- 		TIFFClose(tif);
-@@ -1421,11 +1445,20 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
- 		for(; (h > 0) && (strip < TIFFNumberOfStrips(tif)); strip++)
- 		{
- 				const OPJ_UINT8 *dat8;
--				OPJ_SIZE_T ssize;
-+				tmsize_t ssize;
- 				
--				ssize = (OPJ_SIZE_T)TIFFReadEncodedStrip(tif, strip, buf, strip_size);
-+				ssize = TIFFReadEncodedStrip(tif, strip, buf, strip_size);
-+				if(ssize < 1 || ssize > strip_size) {
-+					fprintf(stderr,"tiftoimage: Bad value for ssize(%ld) "
-+                     "vs. strip_size(%ld).\n\tAborting.\n",ssize,strip_size);
-+					_TIFFfree(buf);
-+					_TIFFfree(buffer32s);
-+					TIFFClose(tif);
-+					opj_image_destroy(image);
-+					return NULL;
-+				}
- 				dat8 = (const OPJ_UINT8*)buf;
--				
-+
- 				while (ssize >= rowStride) {
- 					cvtTifTo32s(dat8, buffer32s, (OPJ_SIZE_T)w * tiSpp);
- 					cvtCxToPx(buffer32s, planes, (OPJ_SIZE_T)w);
diff --git a/pkgs/development/libraries/openldap/default.nix b/pkgs/development/libraries/openldap/default.nix
index 475ac496e7e..56118c9bbb2 100644
--- a/pkgs/development/libraries/openldap/default.nix
+++ b/pkgs/development/libraries/openldap/default.nix
@@ -57,7 +57,7 @@ stdenv.mkDerivation rec {
   meta = with stdenv.lib; {
     homepage    = http://www.openldap.org/;
     description = "An open source implementation of the Lightweight Directory Access Protocol";
-    maintainers = with maintainers; [ lovek323 mornfall ];
+    maintainers = with maintainers; [ lovek323 ];
     platforms   = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/openmpi/default.nix b/pkgs/development/libraries/openmpi/default.nix
index 2d08f37c8c2..35d72c6cbec 100644
--- a/pkgs/development/libraries/openmpi/default.nix
+++ b/pkgs/development/libraries/openmpi/default.nix
@@ -44,7 +44,7 @@ in stdenv.mkDerivation rec {
     homepage = http://www.open-mpi.org/;
     description = "Open source MPI-2 implementation";
     longDescription = "The Open MPI Project is an open source MPI-2 implementation that is developed and maintained by a consortium of academic, research, and industry partners. Open MPI is therefore able to combine the expertise, technologies, and resources from all across the High Performance Computing community in order to build the best MPI library available. Open MPI offers advantages for system and software vendors, application developers and computer science researchers.";
-    maintainers = [ stdenv.lib.maintainers.mornfall ];
+    maintainers = [ ];
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/opensaml-cpp/default.nix b/pkgs/development/libraries/opensaml-cpp/default.nix
index c2c102ccf9b..659c4fb7cff 100644
--- a/pkgs/development/libraries/opensaml-cpp/default.nix
+++ b/pkgs/development/libraries/opensaml-cpp/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   name = "opensaml-cpp-${version}";
-  version = "2.6.0";
+  version = "2.6.1";
 
   src = fetchgit {
     url = "https://git.shibboleth.net/git/cpp-opensaml.git";
-    rev = "61193de29e4c9f1ccff7ed7e1f42c2748c62be77";
-    sha256 = "1jlxa1f2qn0kd15fzjqp80apxn42v47wg3mx1vk424m31rhi00xr";
+    rev = version;
+    sha256 = "0wjb6jyvh4hwpy1pvhh63i821746nqijysrd4vasbirkf4h6z7nx";
   };
 
   buildInputs = [ boost openssl log4shib xercesc xml-security-c xml-tooling-c zlib ];
diff --git a/pkgs/development/libraries/openslp/CVE-2016-4912.patch b/pkgs/development/libraries/openslp/CVE-2016-4912.patch
new file mode 100644
index 00000000000..06223deda89
--- /dev/null
+++ b/pkgs/development/libraries/openslp/CVE-2016-4912.patch
@@ -0,0 +1,11 @@
+--- a/common/slp_xmalloc.c
++++ b/common/slp_xmalloc.c
+@@ -206,7 +206,7 @@ void * _xrealloc(const char * file, int line, void * ptr, size_t size)
+          if (newptr == 0)
+             return 0;
+          memcpy(newptr, ptr, x->size);
+-         _xfree(file, line, x);
++         _xfree(file, line, ptr);
+       }
+       return newptr;
+    }
diff --git a/pkgs/development/libraries/openslp/default.nix b/pkgs/development/libraries/openslp/default.nix
index 3ab3f68cde5..3e178d92013 100644
--- a/pkgs/development/libraries/openslp/default.nix
+++ b/pkgs/development/libraries/openslp/default.nix
@@ -19,6 +19,7 @@ stdenv.mkDerivation {
       url = "https://src.fedoraproject.org/cgit/rpms/openslp.git/plain/openslp-2.0.0-cve-2016-7567.patch";
       sha256 = "0zp61axx93b7nrbsyhn2x4dnw7n9y6g4rys21hyqxk4khrnc2yr9";
     })
+    ./CVE-2016-4912.patch
   ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix
index 68e88cc57d0..94c49af8c4f 100644
--- a/pkgs/development/libraries/openssl/default.nix
+++ b/pkgs/development/libraries/openssl/default.nix
@@ -1,5 +1,6 @@
 { stdenv, fetchurl, buildPackages, perl
 , hostPlatform
+, fetchpatch
 , withCryptodev ? false, cryptodevHeaders
 , enableSSL2 ? false
 }:
@@ -107,13 +108,20 @@ let
 in {
 
   openssl_1_0_2 = common {
-    version = "1.0.2m";
-    sha256 = "03vvlfnxx4lhxc83ikfdl6jqph4h52y7lb7li03va6dkqrgg2vwc";
+    version = "1.0.2n";
+    sha256 = "1zm82pyq5a9jm10q6iv7d3dih3xwjds4x30fqph3k317byvsn2rp";
   };
 
   openssl_1_1_0 = common {
     version = "1.1.0g";
     sha256 = "1bvka2wf33w2vxv7yw578nnjqyhz2b3chvfb0l4k2ffscw950kfy";
+    patches = [
+      (fetchpatch {
+        name = "CVE-2017-3738.patch";
+        url = "https://github.com/openssl/openssl/commit/563066.patch";
+        sha256 = "0ni9fwpxf8raw8b58pfa15akbqmxx4q64v0ldsm4b9dqhbxf8mkz";
+      })
+    ];
   };
 
 }
diff --git a/pkgs/development/libraries/openwsman/default.nix b/pkgs/development/libraries/openwsman/default.nix
index b179ca8803c..1aa0f268457 100644
--- a/pkgs/development/libraries/openwsman/default.nix
+++ b/pkgs/development/libraries/openwsman/default.nix
@@ -1,16 +1,20 @@
-{ fetchurl, stdenv, autoconf, automake, libtool, pkgconfig, libxml2, curl, cmake, pam, sblim-sfcc }:
+{ stdenv, fetchFromGitHub, cmake, pkgconfig
+, curl, libxml2, pam, sblim-sfcc }:
 
 stdenv.mkDerivation rec {
-  version = "2.6.0";
   name = "openwsman-${version}";
+  version = "2.6.5";
 
-  src = fetchurl {
-    url = "https://github.com/Openwsman/openwsman/archive/v${version}.tar.gz";
-    sha256 = "0gw2dsjxzpchg3s85kplwgp9xhd9l7q4fh37iy7r203pvir4k6s4";
+  src = fetchFromGitHub {
+    owner  = "Openwsman";
+    repo   = "openwsman";
+    rev    = "v${version}";
+    sha256 = "1r0zslgpcr4m20car4s3hsccy10xcb39qhpw3dhpjv42xsvvs5xv";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ autoconf automake libtool libxml2 curl cmake pam sblim-sfcc ];
+  nativeBuildInputs = [ cmake pkgconfig ];
+
+  buildInputs = [ curl libxml2 pam sblim-sfcc ];
 
   cmakeFlags = [
     "-DCMAKE_BUILD_RUBY_GEM=no"
@@ -22,18 +26,13 @@ stdenv.mkDerivation rec {
 
   configureFlags = "--disable-more-warnings";
 
-  meta = {
-    description = "Openwsman server implementation and client api with bindings";
-
-    homepage = https://github.com/Openwsman/openwsman;
-    downloadPage = "https://github.com/Openwsman/openwsman/releases";
-
-    maintainers = [ stdenv.lib.maintainers.deepfire ];
-
-    license = stdenv.lib.licenses.bsd3;
-
-    platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
-
+  meta = with stdenv.lib; {
+    description  = "Openwsman server implementation and client API with bindings";
+    downloadPage = https://github.com/Openwsman/openwsman/releases;
+    homepage     = https://openwsman.github.io;
+    license      = licenses.bsd3;
+    maintainers  = with maintainers; [ deepfire ];
+    platforms    = platforms.linux; # PAM is not available on Darwin
     inherit version;
   };
 }
diff --git a/pkgs/development/libraries/oracle-instantclient/default.nix b/pkgs/development/libraries/oracle-instantclient/default.nix
index d0085752623..1c629c13779 100644
--- a/pkgs/development/libraries/oracle-instantclient/default.nix
+++ b/pkgs/development/libraries/oracle-instantclient/default.nix
@@ -4,10 +4,12 @@
 
 assert odbcSupport -> unixODBC != null;
 
-let optional = stdenv.lib.optional;
-    optionalString  = stdenv.lib.optionalString;
-    requireSource = version: part: hash: (requireFile rec {
-      name = "oracle-instantclient12.1-${part}-${version}.x86_64.rpm";
+with stdenv.lib;
+
+let
+    baseVersion = "12.2";
+    requireSource = version: rel: part: hash: (requireFile rec {
+      name = "oracle-instantclient${baseVersion}-${part}-${version}-${rel}.x86_64.rpm";
       message = ''
         This Nix expression requires that ${name} already
         be part of the store. Download the file
@@ -24,13 +26,13 @@ let optional = stdenv.lib.optional;
       sha256 = hash;
     });
 in stdenv.mkDerivation rec {
-  version = "12.1.0.2.0-1";
+  version = "${baseVersion}.0.1.0";
   name = "oracle-instantclient-${version}";
 
-  srcBase = (requireSource version "basic" "f0e51e247cc3f210b950fd939ab1f696de9ca678d1eb179ba49ac73acb9a20ed");
-  srcDevel = (requireSource version "devel" "13b638882f07d6cfc06c85dc6b9eb5cac37064d3d594194b6b09d33483a08296");
-  srcSqlplus = (requireSource version "sqlplus" "16d87w1lii0ag47c8srnr7v4wfm9q4hy6gka8m3v6gp9cc065vam");
-  srcOdbc = optionalString odbcSupport (requireSource version "odbc" "d3aa1a4957a2f15ced05921dab551ba823aa7925d8fcb58d5b3a7f624e4df063");
+  srcBase = (requireSource version "1" "basic" "43c4bfa938af741ae0f9964a656f36a0700849f5780a2887c8e9f1be14fe8b66");
+  srcDevel = (requireSource version "1" "devel" "4c7ad8d977f9f908e47c5e71ce56c2a40c7dc83cec8a5c106b9ff06d45bb3442");
+  srcSqlplus = (requireSource version "1" "sqlplus" "303e82820a10f78e401e2b07d4eebf98b25029454d79f06c46e5f9a302ce5552");
+  srcOdbc = optionalString odbcSupport (requireSource version "2" "odbc" "e870c84d2d4be6f77c0760083b82b7ffbb15a4bf5c93c4e6c84f36d6ed4dfdf1");
 
   buildInputs = [ glibc patchelf rpmextract ] ++
     optional odbcSupport unixODBC;
@@ -41,15 +43,13 @@ in stdenv.mkDerivation rec {
     ${rpmextract}/bin/rpmextract "${srcBase}"
     ${rpmextract}/bin/rpmextract "${srcDevel}"
     ${rpmextract}/bin/rpmextract "${srcSqlplus}"
-    ${optionalString odbcSupport ''
-        ${rpmextract}/bin/rpmextract "${srcOdbc}"
-    ''}
-
+    '' + optionalString odbcSupport ''${rpmextract}/bin/rpmextract ${srcOdbc}
+    '' + ''
     mkdir -p "$out/"{bin,include,lib,"share/${name}/demo/"}
-    mv "usr/share/oracle/12.1/client64/demo/"* "$out/share/${name}/demo/"
-    mv "usr/include/oracle/12.1/client64/"* "$out/include/"
-    mv "usr/lib/oracle/12.1/client64/lib/"* "$out/lib/"
-    mv "usr/lib/oracle/12.1/client64/bin/"* "$out/bin/"
+    mv "usr/share/oracle/${baseVersion}/client64/demo/"* "$out/share/${name}/demo/"
+    mv "usr/include/oracle/${baseVersion}/client64/"* "$out/include/"
+    mv "usr/lib/oracle/${baseVersion}/client64/lib/"* "$out/lib/"
+    mv "usr/lib/oracle/${baseVersion}/client64/bin/"* "$out/bin/"
     ln -s "$out/bin/sqlplus" "$out/bin/sqlplus64"
 
     for lib in $out/lib/lib*.so; do
@@ -84,7 +84,7 @@ in stdenv.mkDerivation rec {
       command line SQL client.
     '';
     license = licenses.unfree;
-    platforms = platforms.linux;
+    platforms = [ "x86_64-linux" ];
     maintainers = with maintainers; [ pesterhazy ];
   };
 }
diff --git a/pkgs/development/libraries/pango/default.nix b/pkgs/development/libraries/pango/default.nix
index 85032677aae..3806926fa24 100644
--- a/pkgs/development/libraries/pango/default.nix
+++ b/pkgs/development/libraries/pango/default.nix
@@ -6,14 +6,14 @@ with stdenv.lib;
 
 let
   ver_maj = "1.40";
-  ver_min = "12";
+  ver_min = "14";
 in
 stdenv.mkDerivation rec {
   name = "pango-${ver_maj}.${ver_min}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/pango/${ver_maj}/${name}.tar.xz";
-    sha256 = "75f1a9a8e4e2b28cbc078b50c1fa927ee4ded994d1ade97c5603e2d1f3161cfc";
+    sha256 = "90af1beaa7bf9e4c52db29ec251ec4fd0a8f2cc185d521ad1f88d01b3a6a17e3";
   };
 
   outputs = [ "bin" "dev" "out" "devdoc" ];
diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix
index e6055151301..b34c9ff31f2 100644
--- a/pkgs/development/libraries/pcre/default.nix
+++ b/pkgs/development/libraries/pcre/default.nix
@@ -33,6 +33,9 @@ in stdenv.mkDerivation rec {
 
   buildInputs = optional (hostPlatform.libc == "msvcrt") windows.mingw_w64_pthreads;
 
+  # https://bugs.exim.org/show_bug.cgi?id=2173
+  patches = [ ./stacksize-detection.patch ];
+
   doCheck = !(with hostPlatform; isCygwin || isFreeBSD) && hostPlatform == buildPlatform;
     # XXX: test failure on Cygwin
     # we are running out of stack on both freeBSDs on Hydra
diff --git a/pkgs/development/libraries/pcre/stacksize-detection.patch b/pkgs/development/libraries/pcre/stacksize-detection.patch
new file mode 100644
index 00000000000..4bc97069b1e
--- /dev/null
+++ b/pkgs/development/libraries/pcre/stacksize-detection.patch
@@ -0,0 +1,16 @@
+diff --git a/pcre_exec.c b/pcre_exec.c
+--- a/pcre_exec.c
++++ b/pcre_exec.c
+@@ -509,6 +509,12 @@
+                  (e.g. stopped by repeated call or recursion limit)
+ */
+ 
++#ifdef __GNUC__
++static int
++match(REGISTER PCRE_PUCHAR eptr, REGISTER const pcre_uchar *ecode,
++  PCRE_PUCHAR mstart, int offset_top, match_data *md, eptrblock *eptrb,
++  unsigned int rdepth) __attribute__((noinline,noclone));
++#endif
+ static int
+ match(REGISTER PCRE_PUCHAR eptr, REGISTER const pcre_uchar *ecode,
+   PCRE_PUCHAR mstart, int offset_top, match_data *md, eptrblock *eptrb,
diff --git a/pkgs/development/libraries/pcre2/default.nix b/pkgs/development/libraries/pcre2/default.nix
index 3b698ff74cf..9603e45a8b4 100644
--- a/pkgs/development/libraries/pcre2/default.nix
+++ b/pkgs/development/libraries/pcre2/default.nix
@@ -20,14 +20,21 @@ stdenv.mkDerivation rec {
       url = "https://vcs.pcre.org/pcre2/code/trunk/src/pcre2_ucd.c?view=patch&r1=316&r2=670&sortby=date";
       sha256 = "10yzglvbn7h06hg7zffr5zh378i5jihvx7d5gggkynws79vgwvfr";
       stripLen = 2;
-      addPrefixes = true;
+      extraPrefix = "";
     })
     (fetchpatch {
       name = "CVE-2017-7186-part2.patch";
       url = "https://vcs.pcre.org/pcre2/code/trunk/src/pcre2_internal.h?view=patch&r1=600&r2=670&sortby=date";
       sha256 = "1bggk7vd5hg0bjg96lj4h1lacmr6grq68dm6iz1n7vg3zf7virjn";
       stripLen = 2;
-      addPrefixes = true;
+      extraPrefix = "";
+    })
+    (fetchpatch {
+      name = "CVE-2017-8786.patch";
+      url = "https://vcs.pcre.org/pcre2/code/trunk/src/pcre2test.c?r1=692&r2=697&view=patch";
+      sha256 = "1c629nzrk4il2rfclwyc1a373q58m4q9ys9wr91zhl4skfk7x19b";
+      stripLen = 2;
+      extraPrefix = "";
     })
   ];
 
diff --git a/pkgs/development/libraries/physfs/default.nix b/pkgs/development/libraries/physfs/default.nix
index 43bcef0f2d3..e29af17f35d 100644
--- a/pkgs/development/libraries/physfs/default.nix
+++ b/pkgs/development/libraries/physfs/default.nix
@@ -1,23 +1,41 @@
-{stdenv, fetchurl, cmake}:
+{ stdenv, fetchurl, cmake, doxygen
+, zlib }:
 
-stdenv.mkDerivation rec {
-  name = "physfs-2.0.3";
+let
+  generic = version: sha256:
+  stdenv.mkDerivation rec {
+    name = "physfs-${version}";
 
-  src = fetchurl {
-    url = "${meta.homepage}/downloads/${name}.tar.bz2";
-    sha256 = "0sbbyqzqhyf0g68fcvvv20n3928j0x6ik1njmhn1yigvq2bj11na";
-  };
+    src = fetchurl {
+      url = "${meta.homepage}/downloads/${name}.tar.bz2";
+      inherit sha256;
+    };
+
+    nativeBuildInputs = [ cmake doxygen ];
+
+    buildInputs = [ zlib ];
 
-  nativeBuildInputs = [ cmake ];
+    enableParallelBuilding = true;
 
-  patchPhase = ''
-    sed s,-Werror,, -i CMakeLists.txt
-  '';
+    patchPhase = ''
+      sed s,-Werror,, -i CMakeLists.txt
+    '';
 
-  meta = {
-    homepage = http://icculus.org/physfs/;
-    description = "Library to provide abstract access to various archives";
-    license = stdenv.lib.licenses.free;
-    platforms = stdenv.lib.platforms.linux;
+    doInstallCheck = true;
+
+    installCheckPhase = ''
+      ./test_physfs --version
+    '';
+
+    meta = with stdenv.lib; {
+      homepage = http://icculus.org/physfs/;
+      description = "Library to provide abstract access to various archives";
+      license = licenses.free;
+      platforms = platforms.linux;
+    };
   };
+
+in {
+  physfs_2 = generic "2.0.3" "0sbbyqzqhyf0g68fcvvv20n3928j0x6ik1njmhn1yigvq2bj11na";
+  physfs   = generic "3.0.1" "1wgj2zqpnfbnyyi1i7bq5pshcc9n5cvwlpzp8im67nb8662ryyxp";
 }
diff --git a/pkgs/development/libraries/physics/fastjet/default.nix b/pkgs/development/libraries/physics/fastjet/default.nix
index 93c4320e78a..780dcc3770f 100644
--- a/pkgs/development/libraries/physics/fastjet/default.nix
+++ b/pkgs/development/libraries/physics/fastjet/default.nix
@@ -1,15 +1,20 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, python2 }:
 
 stdenv.mkDerivation rec {
   name = "fastjet-${version}";
-  version = "3.2.0";
+  version = "3.3.0";
 
   src = fetchurl {
     url = "http://fastjet.fr/repo/fastjet-${version}.tar.gz";
-    sha256 = "1qvmab7l4ps5xd1wvmblgpzyhkbs2gff41qgyg7r7b9nlgqjgacn";
+    sha256 = "03x75mmnlw2m0a7669k82rf9a7dgjwygf8wjbk8cdgnb82c5pnp9";
   };
 
-  configureFlags = "--enable-allcxxplugins";
+  buildInputs = [ python2 ];
+
+  configureFlags = [
+    "--enable-allcxxplugins"
+    "--enable-pyext"
+    ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/physics/lhapdf/default.nix b/pkgs/development/libraries/physics/lhapdf/default.nix
index 1a203172d2c..93e0fa99c34 100644
--- a/pkgs/development/libraries/physics/lhapdf/default.nix
+++ b/pkgs/development/libraries/physics/lhapdf/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "lhapdf-${version}";
-  version = "6.2.0";
+  version = "6.2.1";
 
   src = fetchurl {
     url = "http://www.hepforge.org/archive/lhapdf/LHAPDF-${version}.tar.gz";
-    sha256 = "0gfjps7v93n0rrdndkhp22d93y892bf76pnzdhqbish0cigkkxph";
+    sha256 = "0bi02xcmq5as0wf0jn6i3hx0qy0hj61m02sbrbzd1gwjhpccwmvd";
   };
 
   buildInputs = [ python2 ];
diff --git a/pkgs/development/libraries/physics/rivet/default.nix b/pkgs/development/libraries/physics/rivet/default.nix
index 454c868dfcd..5d533d4250a 100644
--- a/pkgs/development/libraries/physics/rivet/default.nix
+++ b/pkgs/development/libraries/physics/rivet/default.nix
@@ -2,17 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "rivet-${version}";
-  version = "2.5.4";
+  version = "2.6.0";
 
   src = fetchurl {
     url = "http://www.hepforge.org/archive/rivet/Rivet-${version}.tar.bz2";
-    sha256 = "1qi7am60f2l4krd3sbj95mbzfk82lir0wy8z27yr9ncq6qcm48kp";
+    sha256 = "1mvsa3v8d1pl2fj1dcdf8sikzm1yb2jcl0q34fyfsjw2cisxpv5f";
   };
 
-  postPatch = "patchShebangs ./src/Analyses/cat_with_lines";
-
-  pythonPath = []; # python wrapper support
-
   patches = [
     ./darwin.patch # configure relies on impure sw_vers to -Dunix
   ];
@@ -31,6 +27,13 @@ stdenv.mkDerivation rec {
   buildInputs = [ hepmc imagemagick python2 latex makeWrapper ];
   propagatedBuildInputs = [ fastjet ghostscript gsl yoda ];
 
+  preConfigure = ''
+    substituteInPlace bin/rivet-buildplugin.in \
+      --replace '"which"' '"${which}/bin/which"' \
+      --replace 'mycxx=' 'mycxx=${stdenv.cc}/bin/${if stdenv.cc.isClang or false then "clang++" else "g++"}  #' \
+      --replace 'mycxxflags="' "mycxxflags=\"-std=c++11 $NIX_CFLAGS_COMPILE $NIX_CXXSTDLIB_COMPILE $NIX_CFLAGS_LINK "
+  '';
+
   preInstall = ''
     substituteInPlace bin/make-plots \
       --replace '"which"' '"${which}/bin/which"' \
@@ -42,10 +45,6 @@ stdenv.mkDerivation rec {
       --replace '"convert"' '"${imagemagick.out}/bin/convert"'
     substituteInPlace bin/rivet \
       --replace '"less"' '"${less}/bin/less"'
-    substituteInPlace bin/rivet-buildplugin \
-      --replace '"which"' '"${which}/bin/which"' \
-      --replace 'mycxx=' 'mycxx=${stdenv.cc}/bin/${if stdenv.cc.isClang or false then "clang++" else "g++"}  #' \
-      --replace 'mycxxflags="' "mycxxflags=\"-std=c++11 $NIX_CFLAGS_COMPILE $NIX_CXXSTDLIB_COMPILE $NIX_CFLAGS_LINK "
     substituteInPlace bin/rivet-mkhtml \
       --replace '"make-plots"' \"$out/bin/make-plots\" \
       --replace '"rivet-cmphistos"' \"$out/bin/rivet-cmphistos\"
diff --git a/pkgs/development/libraries/physics/yoda/default.nix b/pkgs/development/libraries/physics/yoda/default.nix
index dd1b3305646..7519d0da03f 100644
--- a/pkgs/development/libraries/physics/yoda/default.nix
+++ b/pkgs/development/libraries/physics/yoda/default.nix
@@ -1,18 +1,19 @@
-{ stdenv, fetchurl, fetchpatch, python2Packages, root, makeWrapper, withRootSupport ? false }:
+{ stdenv, fetchurl, fetchpatch, python2Packages, root, makeWrapper, zlib, withRootSupport ? false }:
 
 stdenv.mkDerivation rec {
   name = "yoda-${version}";
-  version = "1.6.7";
+  version = "1.7.0";
 
   src = fetchurl {
     url = "http://www.hepforge.org/archive/yoda/YODA-${version}.tar.bz2";
-    sha256 = "05jyv5dypa6d4q1m8wm2qycgq1i0bgzwzzm9qqdj0b43ff2kggra";
+    sha256 = "0fyf6ld1klzlfmr5sl1jxzck4a0h14zfkrff8397rn1fqnqbzmmk";
   };
 
   pythonPath = []; # python wrapper support
 
   buildInputs = with python2Packages; [ python numpy matplotlib makeWrapper ]
     ++ stdenv.lib.optional withRootSupport root;
+  propagatedBuildInputs = [ zlib ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/pkcs11helper/default.nix b/pkgs/development/libraries/pkcs11helper/default.nix
index 9d7d7552cfc..1a1bb1800cf 100644
--- a/pkgs/development/libraries/pkcs11helper/default.nix
+++ b/pkgs/development/libraries/pkcs11helper/default.nix
@@ -2,20 +2,22 @@
 
 stdenv.mkDerivation rec {
   name = "pkcs11-helper-${version}";
-  version = "1.21";
+  version = "1.22";
 
   src = fetchFromGitHub {
     owner = "OpenSC";
     repo = "pkcs11-helper";
     rev = "${name}";
-    sha256 = "17a2cssycl7fh44xikmhszigx57vvn0h2sjsnmsy3772kfj796b1";
+    sha256 = "01v3zv6sr5phqhr2f21fl2rmcnmkp9518dkq82g1v2y9ysjksg7q";
   };
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
   buildInputs = [ openssl ];
 
+  enableParallelBuilding = true;
+
   meta = with stdenv.lib; {
-    homepage = https://www.opensc-project.org/opensc/wiki/pkcs11-helper;
+    homepage = https://github.com/OpenSC/pkcs11-helper;
     license = with licenses; [ bsd3 gpl2 ];
     description = "Library that simplifies the interaction with PKCS#11 providers";
     platforms = platforms.unix;
diff --git a/pkgs/development/libraries/png++/default.nix b/pkgs/development/libraries/png++/default.nix
index 6ca4734a4f7..ef4b3ea7e01 100644
--- a/pkgs/development/libraries/png++/default.nix
+++ b/pkgs/development/libraries/png++/default.nix
@@ -21,13 +21,17 @@ stdenv.mkDerivation rec {
 
   postCheck = "cat test/test.log";
 
-  buildInputs = [ ]
-    ++ stdenv.lib.optional docSupport doxygen;
+  buildInputs = stdenv.lib.optional docSupport doxygen;
 
   propagatedBuildInputs = [ libpng ];
 
-  makeFlags = [ "PREFIX=\${out}" ]
-    ++ stdenv.lib.optional docSupport "docs";
+  preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
+    substituteInPlace error.hpp --replace "#if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE" "#if (__clang__ || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE"
+  '' + ''
+    sed "s|\(PNGPP := .\)|PREFIX := ''${out}\n\\1|" -i Makefile
+  '';
+
+  makeFlags = stdenv.lib.optional docSupport "docs";
 
   enableParallelBuilding = true;
 
@@ -35,7 +39,7 @@ stdenv.mkDerivation rec {
     homepage = http://www.nongnu.org/pngpp/;
     description = "C++ wrapper for libpng library";
     license = licenses.bsd3;
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     maintainers = [ maintainers.ramkromberg ];
   };
 }
diff --git a/pkgs/development/libraries/poco/default.nix b/pkgs/development/libraries/poco/default.nix
index 0f971cff64d..40755913737 100644
--- a/pkgs/development/libraries/poco/default.nix
+++ b/pkgs/development/libraries/poco/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, pkgconfig, zlib, pcre, expat, sqlite, openssl, unixODBC, libmysql }:
+{ stdenv, fetchurl, cmake, pkgconfig, zlib, pcre, expat, sqlite, openssl, unixODBC, mysql }:
 
 stdenv.mkDerivation rec {
   name = "poco-${version}";
@@ -12,10 +12,9 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake pkgconfig ];
 
-  buildInputs = [ zlib pcre expat sqlite openssl unixODBC libmysql ];
+  buildInputs = [ zlib pcre expat sqlite openssl unixODBC mysql.connector-c ];
 
   cmakeFlags = [
-    "-DMYSQL_INCLUDE_DIR=${libmysql.dev}/include/mysql"
     "-DPOCO_UNBUNDLED=ON"
   ];
 
diff --git a/pkgs/development/libraries/protobuf/2.5.nix b/pkgs/development/libraries/protobuf/2.5.nix
new file mode 100644
index 00000000000..550d0b1bace
--- /dev/null
+++ b/pkgs/development/libraries/protobuf/2.5.nix
@@ -0,0 +1,10 @@
+{ callPackage, fetchurl, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "2.5.0";
+  # make sure you test also -A pythonPackages.protobuf
+  src = fetchurl {
+    url = "http://protobuf.googlecode.com/files/${version}.tar.bz2";
+    sha256 = "0xxn9gxhvsgzz2sgmihzf6pf75clr05mqj6218camwrwajpcbgqk";
+  };
+})
\ No newline at end of file
diff --git a/pkgs/development/libraries/psol/default.nix b/pkgs/development/libraries/psol/default.nix
index 5c78c1a288f..dd6037e6832 100644
--- a/pkgs/development/libraries/psol/default.nix
+++ b/pkgs/development/libraries/psol/default.nix
@@ -1,5 +1,5 @@
 { callPackage }:
 callPackage ./generic.nix {} {
-  version = "1.11.33.4";
-  sha256  = "1jq2llp0i4666rwqnx1hs4pjlpblxivvs1jkkjzlmdbsv28jzjq8";
+  version = "1.13.35.1"; # Latest beta, 2017-11-08
+  sha256  = "126823gpr3rdqakwixmr887rbvwhksr3xg14jnyzlp84q4hg1p0n";
 }
diff --git a/pkgs/development/libraries/psol/generic.nix b/pkgs/development/libraries/psol/generic.nix
index 3e82bb4975d..c61926fe13f 100644
--- a/pkgs/development/libraries/psol/generic.nix
+++ b/pkgs/development/libraries/psol/generic.nix
@@ -3,7 +3,7 @@
 { inherit version; } // fetchzip {
   inherit sha256;
   name   = "psol-${version}";
-  url    = "https://dl.google.com/dl/page-speed/psol/${version}.tar.gz";
+  url    = "https://dl.google.com/dl/page-speed/psol/${version}-x64.tar.gz";
 
   meta = {
     description = "PageSpeed Optimization Libraries";
diff --git a/pkgs/development/libraries/ptlib/default.nix b/pkgs/development/libraries/ptlib/default.nix
index c5d3d741130..f980a14aa41 100644
--- a/pkgs/development/libraries/ptlib/default.nix
+++ b/pkgs/development/libraries/ptlib/default.nix
@@ -27,6 +27,7 @@ stdenv.mkDerivation rec {
     (fetchpatch { url = http://sources.debian.net/data/main/p/ptlib/2.10.11~dfsg-2.1/debian/patches/gcc-5_support;
       sha256 = "0pf2yj0150r4cnc6nv65mclrm3dillqh1xjk7m6gsjnk9b96i5d4";
     })
+    ./ptlib-2.10.11-glibc-2.26.patch
   ];
 
   meta = with stdenv.lib; {
@@ -41,4 +42,3 @@ stdenv.mkDerivation rec {
     };
   };
 }
-
diff --git a/pkgs/development/libraries/ptlib/ptlib-2.10.11-glibc-2.26.patch b/pkgs/development/libraries/ptlib/ptlib-2.10.11-glibc-2.26.patch
new file mode 100644
index 00000000000..300c3736abf
--- /dev/null
+++ b/pkgs/development/libraries/ptlib/ptlib-2.10.11-glibc-2.26.patch
@@ -0,0 +1,13 @@
+diff --git a/src/ptlib/unix/channel.cxx b/src/ptlib/unix/channel.cxx
+index 3b17dda..2dcaa18 100644
+--- a/src/ptlib/unix/channel.cxx
++++ b/src/ptlib/unix/channel.cxx
+@@ -36,7 +36,7 @@
+ 
+ #include <ptlib.h>
+ #include <sys/ioctl.h>
+-
++#include <sys/uio.h>
+ 
+ #include "../common/pchannel.cxx"
+ 
diff --git a/pkgs/development/libraries/qca-qt5/default.nix b/pkgs/development/libraries/qca-qt5/default.nix
index 9433eb87109..0ea58e6c434 100644
--- a/pkgs/development/libraries/qca-qt5/default.nix
+++ b/pkgs/development/libraries/qca-qt5/default.nix
@@ -11,6 +11,12 @@ stdenv.mkDerivation rec {
   buildInputs = [ openssl qtbase ];
   nativeBuildInputs = [ cmake pkgconfig ];
 
+  # tells CMake to use this CA bundle file if it is accessible
+  preConfigure = ''export QC_CERTSTORE_PATH=/etc/ssl/certs/ca-certificates.crt'';
+
+  # tricks CMake into using this CA bundle file if it is not accessible (in a sandbox)
+  cmakeFlags = [ "-Dqca_CERTSTORE=/etc/ssl/certs/ca-certificates.crt" ];
+
   meta = with stdenv.lib; {
     description = "Qt 5 Cryptographic Architecture";
     homepage = http://delta.affinix.com/qca;
diff --git a/pkgs/development/libraries/qca2/default.nix b/pkgs/development/libraries/qca2/default.nix
index 2265d0df394..4976399a66a 100644
--- a/pkgs/development/libraries/qca2/default.nix
+++ b/pkgs/development/libraries/qca2/default.nix
@@ -14,6 +14,12 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
+  # tells CMake to use this CA bundle file if it is accessible
+  preConfigure = ''export QC_CERTSTORE_PATH=/etc/ssl/certs/ca-certificates.crt'';
+
+  # tricks CMake into using this CA bundle file if it is not accessible (in a sandbox)
+  cmakeFlags = [ "-Dqca_CERTSTORE=/etc/ssl/certs/ca-certificates.crt" ];
+
   meta = with stdenv.lib; {
     description = "Qt Cryptographic Architecture";
     license = "LGPL";
diff --git a/pkgs/development/libraries/qmltermwidget/default.nix b/pkgs/development/libraries/qmltermwidget/default.nix
index 2057aee3e99..79ed37dd2a9 100644
--- a/pkgs/development/libraries/qmltermwidget/default.nix
+++ b/pkgs/development/libraries/qmltermwidget/default.nix
@@ -1,12 +1,13 @@
-{ stdenv, fetchgit, qtbase, qtquick1, qmake, qtmultimedia }:
+{ stdenv, fetchFromGitHub, qtbase, qtquick1, qmake, qtmultimedia }:
 
 stdenv.mkDerivation rec {
   version = "0.1.0";
   name = "qmltermwidget-${version}";
 
-  src = fetchgit {
-    url = "https://github.com/Swordfish90/qmltermwidget.git";
-    rev = "refs/tags/v${version}";
+  src = fetchFromGitHub {
+    repo = "qmltermwidget";
+    owner = "Swordfish90";
+    rev = "v${version}";
     sha256 = "0ca500mzcqglkj0i6km0z512y3a025dbm24605xyv18l6y0l2ny3";
   };
 
diff --git a/pkgs/development/libraries/qpdf/default.nix b/pkgs/development/libraries/qpdf/default.nix
index 4cd5fb0f641..e2c80e445e7 100644
--- a/pkgs/development/libraries/qpdf/default.nix
+++ b/pkgs/development/libraries/qpdf/default.nix
@@ -1,18 +1,18 @@
-{ stdenv, fetchurl, pcre, zlib, perl }:
+{ stdenv, fetchurl, libjpeg, zlib, perl }:
 
-let version = "6.0.0";
+let version = "7.0.0";
 in
 stdenv.mkDerivation rec {
   name = "qpdf-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/qpdf/qpdf/${version}/${name}.tar.gz";
-    sha256 = "0csj2p2gkxrc0rk8ykymlsdgfas96vzf1dip3y1x7z1q9plwgzd9";
+    sha256 = "0py6p27fx4qrwq9mvcybna42b0bdi359x38lzmggxl5a9khqvl7y";
   };
 
   nativeBuildInputs = [ perl ];
 
-  buildInputs = [ pcre zlib ];
+  buildInputs = [ zlib libjpeg ];
 
   postPatch = ''
     patchShebangs qpdf/fix-qdf
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   meta = with stdenv.lib; {
     homepage = http://qpdf.sourceforge.net/;
     description = "A C++ library and set of programs that inspect and manipulate the structure of PDF files";
-    license = licenses.artistic2;
+    license = licenses.asl20; # as of 7.0.0, people may stay at artistic2
     maintainers = with maintainers; [ abbradar ];
     platforms = platforms.all;
   };
diff --git a/pkgs/development/libraries/qt-3/default.nix b/pkgs/development/libraries/qt-3/default.nix
index 6d92de001cb..1bc4fd1085e 100644
--- a/pkgs/development/libraries/qt-3/default.nix
+++ b/pkgs/development/libraries/qt-3/default.nix
@@ -49,7 +49,7 @@ stdenv.mkDerivation {
       -I${randrproto}/include" else "-no-xrandr"}
     ${if xineramaSupport then "-xinerama -L${libXinerama.out}/lib -I${libXinerama.dev}/include" else "-no-xinerama"}
     ${if cursorSupport then "-L${libXcursor.out}/lib -I${libXcursor.dev}/include" else ""}
-    ${if mysqlSupport then "-qt-sql-mysql -L${stdenv.lib.getLib mysql.client}/lib/mysql -I${mysql.client}/include/mysql" else ""}
+    ${if mysqlSupport then "-qt-sql-mysql -L${mysql.connector-c}/lib/mysql -I${mysql.connector-c}/include/mysql" else ""}
     ${if xftSupport then "-xft
       -L${libXft.out}/lib -I${libXft.dev}/include
       -L${libXft.freetype.out}/lib -I${libXft.freetype.dev}/include
diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix
index c9679d227d8..488306fc1ce 100644
--- a/pkgs/development/libraries/qt-4.x/4.8/default.nix
+++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix
@@ -67,6 +67,8 @@ stdenv.mkDerivation rec {
   patches =
     [ ./glib-2.32.patch
       ./libressl.patch
+      ./parallel-configure.patch
+      ./qt-4.8.7-unixmake-darwin.patch
       (substituteAll {
         src = ./dlopen-absolute-paths.diff;
         cups = if cups != null then stdenv.lib.getLib cups else null;
@@ -75,7 +77,19 @@ stdenv.mkDerivation rec {
         glibc = stdenv.cc.libc.out;
         openglDriver = if mesaSupported then mesa.driverLink else "/no-such-path";
       })
-    ] ++ stdenv.lib.optional gtkStyle (substituteAll ({
+      (fetchpatch {
+        name = "fix-medium-font.patch";
+        url = "http://anonscm.debian.org/cgit/pkg-kde/qt/qt4-x11.git/plain/debian/patches/"
+          + "kubuntu_39_fix_medium_font.diff?id=21b342d71c19e6d68b649947f913410fe6129ea4";
+        sha256 = "0bli44chn03c2y70w1n8l7ss4ya0b40jqqav8yxrykayi01yf95j";
+      })
+      (fetchpatch {
+        name = "qt4-gcc6.patch";
+        url = "https://git.archlinux.org/svntogit/packages.git/plain/trunk/qt4-gcc6.patch?h=packages/qt4&id=ca773a144f5abb244ac4f2749eeee9333cac001f";
+        sha256 = "07lrva7bjh6i40p7b3ml26a2jlznri8bh7y7iyx5zmvb1gfxmj34";
+      })
+    ]
+    ++ stdenv.lib.optional gtkStyle (substituteAll ({
         src = ./dlopen-gtkstyle.diff;
         # substituteAll ignores env vars starting with capital letter
         gtk = gtk2.out;
@@ -92,20 +106,7 @@ stdenv.mkDerivation rec {
     ++ stdenv.lib.optional stdenv.isAarch64 (fetchpatch {
         url = "https://src.fedoraproject.org/rpms/qt/raw/ecf530486e0fb7fe31bad26805cde61115562b2b/f/qt-aarch64.patch";
         sha256 = "1fbjh78nmafqmj7yk67qwjbhl3f6ylkp6x33b1dqxfw9gld8b3gl";
-      })
-    ++ [
-      (fetchpatch {
-        name = "fix-medium-font.patch";
-        url = "http://anonscm.debian.org/cgit/pkg-kde/qt/qt4-x11.git/plain/debian/patches/"
-          + "kubuntu_39_fix_medium_font.diff?id=21b342d71c19e6d68b649947f913410fe6129ea4";
-        sha256 = "0bli44chn03c2y70w1n8l7ss4ya0b40jqqav8yxrykayi01yf95j";
-      })
-      (fetchpatch {
-        name = "qt4-gcc6.patch";
-        url = "https://git.archlinux.org/svntogit/packages.git/plain/trunk/qt4-gcc6.patch?h=packages/qt4&id=ca773a144f5abb244ac4f2749eeee9333cac001f";
-        sha256 = "07lrva7bjh6i40p7b3ml26a2jlznri8bh7y7iyx5zmvb1gfxmj34";
-      })
-    ];
+      });
 
   preConfigure = ''
     export LD_LIBRARY_PATH="`pwd`/lib:$LD_LIBRARY_PATH"
@@ -117,6 +118,7 @@ stdenv.mkDerivation rec {
       -demosdir $TMPDIR/share/doc/${name}/demos
       -datadir $out/share/${name}
       -translationdir $out/share/${name}/translations
+      --jobs=$NIX_BUILD_CORES
     "
     unset LD # Makefile uses gcc for linking; setting LD interferes
   '' + optionalString stdenv.cc.isClang ''
@@ -128,7 +130,7 @@ stdenv.mkDerivation rec {
 
   configureFlags =
     ''
-      -v -no-separate-debug-info -release -no-fast -confirm-license -opensource
+      -v -no-separate-debug-info -release -fast -confirm-license -opensource
 
       -${if stdenv.isFreeBSD then "no-" else ""}opengl -xrender -xrandr -xinerama -xcursor -xinput -xfixes -fontconfig
       -qdbus -${if cups == null then "no-" else ""}cups -glib -dbus-linked -openssl-linked
@@ -158,13 +160,13 @@ stdenv.mkDerivation rec {
   buildInputs =
     [ cups # Qt dlopen's libcups instead of linking to it
       postgresql sqlite libjpeg libmng libtiff icu ]
-    ++ optionals (mysql != null) [ mysql.lib ]
+    ++ optionals (mysql != null) [ mysql.connector-c ]
     ++ optionals gtkStyle [ gtk2 gdk_pixbuf ]
     ++ optionals stdenv.isDarwin [ cf-private ApplicationServices OpenGL Cocoa AGL libcxx libobjc ];
 
   nativeBuildInputs = [ perl pkgconfig which ];
 
-  enableParallelBuilding = false;
+  enableParallelBuilding = true;
 
   NIX_CFLAGS_COMPILE =
     optionalString stdenv.isLinux "-std=gnu++98" # gnu++ in (Obj)C flags is no good on Darwin
@@ -183,37 +185,8 @@ stdenv.mkDerivation rec {
     sed -i 's/^\(LIBS[[:space:]]*=.*$\)/\1 -lobjc/' ./src/corelib/Makefile.Release
   '';
 
-  installPhase = optionalString stdenv.isDarwin ''
-    runHook preInstall
-    cp -r lib $out
-
-    mkdir -p $out/Applications
-    mv bin/*.app $out/Applications
-    rm -rf bin/*.app
-
-    cp -r bin $out
-
-    mkdir -p $out/share/doc/${name}
-    mkdir -p $out/lib
-    mkdir -p $out/lib/qt4/plugins
-    mkdir -p $out/lib/qt4/imports
-    mkdir -p $out/bin
-    mkdir -p $out/include
-    mkdir -p $out/share/${name}
-
-    cp -r mkspecs $out/share/${name}
-    cp -r translations $out/share/${name}
-    cp -r tools/linguist/phrasebooks $out/share/${name}
-    cp tools/porting/src/q3porting.xml $out/share/${name}
-
-    cp -r plugins $out/lib/qt4
-    cp -r imports $out/lib/qt4
-    cp -r doc/* $out/share/doc/${name}
-    runHook postInstall
-  '';
-
-  postInstall = optionalString (!stdenv.isDarwin) ''
-      rm -rf $out/tests
+  postInstall = ''
+    rm -rf $out/tests
   '';
 
   crossAttrs = {
@@ -229,11 +202,11 @@ stdenv.mkDerivation rec {
     '' + optionalString hostPlatform.isMinGW " -xplatform win32-g++-4.6";
     patches = [];
     preConfigure = ''
-      sed -i -e 's/ g++/ ${stdenv.cc.prefix}g++/' \
-        -e 's/ gcc/ ${stdenv.cc.prefix}gcc/' \
-        -e 's/ ar/ ${stdenv.cc.prefix}ar/' \
-        -e 's/ strip/ ${stdenv.cc.prefix}strip/' \
-        -e 's/ windres/ ${stdenv.cc.prefix}windres/' \
+      sed -i -e 's/ g++/ ${stdenv.cc.targetPrefix}g++/' \
+        -e 's/ gcc/ ${stdenv.cc.targetPrefix}gcc/' \
+        -e 's/ ar/ ${stdenv.cc.targetPrefix}ar/' \
+        -e 's/ strip/ ${stdenv.cc.targetPrefix}strip/' \
+        -e 's/ windres/ ${stdenv.cc.targetPrefix}windres/' \
         mkspecs/win32-g++/qmake.conf
     '';
 
@@ -251,7 +224,7 @@ stdenv.mkDerivation rec {
     homepage    = http://qt-project.org/;
     description = "A cross-platform application framework for C++";
     license     = licenses.lgpl21Plus; # or gpl3
-    maintainers = with maintainers; [ lovek323 phreedom sander ];
+    maintainers = with maintainers; [ orivej lovek323 phreedom sander ];
     platforms   = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/qt-4.x/4.8/parallel-configure.patch b/pkgs/development/libraries/qt-4.x/4.8/parallel-configure.patch
new file mode 100644
index 00000000000..b9b9d6d0a68
--- /dev/null
+++ b/pkgs/development/libraries/qt-4.x/4.8/parallel-configure.patch
@@ -0,0 +1,22 @@
+--- a/configure
++++ b/configure
+@@ -1087,2 +1087,3 @@ fi
+ #-------------------------------------------------------------------------------
++JOBS=
+ 
+@@ -2528,2 +2529,5 @@ while [ "$#" -gt 0 ]; do
+         ;;
++    jobs)
++        JOBS=-j$VAL
++        ;;
+     *)
+@@ -5072,3 +5076,3 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
+         if "$WHICH" makedepend >/dev/null 2>&1 && grep 'depend:' "$mkfile" >/dev/null 2>&1; then
+-            (cd "$outpath/qmake" && "$MAKE" -f "$mkfile" depend) >/dev/null 2>&1
++            (cd "$outpath/qmake" && "$MAKE" $JOBS -f "$mkfile" depend) >/dev/null 2>&1
+            sed "s,^.*/\([^/]*.o\):,\1:,g" "$mkfile" >"$mkfile.tmp"
+@@ -5080,3 +5084,3 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
+     QMAKE_BUILD_ERROR=no
+-    (cd "$outpath/qmake"; "$MAKE") || QMAKE_BUILD_ERROR=yes
++    (cd "$outpath/qmake"; "$MAKE" $JOBS) || QMAKE_BUILD_ERROR=yes
+     [ '!' -z "$QCONFIG_H" ] && mv -f "$QCONFIG_H" "$QMAKE_QCONFIG_H" #move qmake's qconfig.h to qconfig.h.qmake
diff --git a/pkgs/development/libraries/qt-4.x/4.8/qmake-hook.sh b/pkgs/development/libraries/qt-4.x/4.8/qmake-hook.sh
index bf716a72d0f..f288e99dd12 100644
--- a/pkgs/development/libraries/qt-4.x/4.8/qmake-hook.sh
+++ b/pkgs/development/libraries/qt-4.x/4.8/qmake-hook.sh
@@ -3,6 +3,11 @@ qmakeConfigurePhase() {
 
     $QMAKE PREFIX=$out $qmakeFlags
 
+    if ! [[ -v enableParallelBuilding ]]; then
+        enableParallelBuilding=1
+        echo "qmake4Hook: enabled parallel building"
+    fi
+
     runHook postConfigure
 }
 
diff --git a/pkgs/development/libraries/qt-4.x/4.8/qt-4.8.7-unixmake-darwin.patch b/pkgs/development/libraries/qt-4.x/4.8/qt-4.8.7-unixmake-darwin.patch
new file mode 100644
index 00000000000..99a36a24fe4
--- /dev/null
+++ b/pkgs/development/libraries/qt-4.x/4.8/qt-4.8.7-unixmake-darwin.patch
@@ -0,0 +1,11 @@
+--- a/qmake/generators/unix/unixmake.cpp
++++ b/qmake/generators/unix/unixmake.cpp
+@@ -831,7 +831,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
+             else if(project->first("TEMPLATE") == "app" && !project->isEmpty("QMAKE_STRIPFLAGS_APP"))
+                 ret += " " + var("QMAKE_STRIPFLAGS_APP");
+             if(bundle)
+-                ret = " \"" + dst_targ + "/Contents/MacOS/$(QMAKE_TARGET)\"";
++                ret += " \"" + dst_targ + "/Contents/MacOS/$(QMAKE_TARGET)\"";
+             else
+                 ret += " \"" + dst_targ + "\"";
+         }
diff --git a/pkgs/development/libraries/qt-5/5.10/default.nix b/pkgs/development/libraries/qt-5/5.10/default.nix
new file mode 100644
index 00000000000..cf66e60d569
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/default.nix
@@ -0,0 +1,124 @@
+/*
+
+# Updates
+
+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`.
+
+1. Update the URL in `pkgs/development/libraries/qt-5/$VERSION/fetch.sh`.
+2. From the top of the Nixpkgs tree, run
+   `./maintainers/scripts/fetch-kde-qt.sh > pkgs/development/libraries/qt-5/$VERSION/srcs.nix`.
+3. Update `qtCompatVersion` below if the minor version number changes.
+4. Check that the new packages build correctly.
+5. Commit the changes and open a pull request.
+
+*/
+
+{
+  newScope,
+  stdenv, fetchurl, makeSetupHook, makeWrapper,
+  bison, cups ? null, harfbuzz, mesa, perl,
+  gstreamer, gst-plugins-base, gtk3, dconf,
+
+  # options
+  developerBuild ? false,
+  decryptSslTraffic ? false,
+  debug ? false,
+}:
+
+with stdenv.lib;
+
+let
+
+  qtCompatVersion = "5.10";
+
+  mirror = "http://download.qt.io";
+  srcs = import ./srcs.nix { inherit fetchurl; inherit mirror; };
+
+  patches = {
+    qtbase = [ ./qtbase.patch ] ++ optional stdenv.isDarwin ./qtbase-darwin.patch;
+    qtdeclarative = [ ./qtdeclarative.patch ];
+    qtscript = [ ./qtscript.patch ];
+    qtserialport = [ ./qtserialport.patch ];
+    qttools = [ ./qttools.patch ];
+    qtwebengine = optional stdenv.needsPax ./qtwebengine-paxmark-mksnapshot.patch;
+    qtwebkit = [ ./qtwebkit.patch ];
+  };
+
+  mkDerivation =
+    import ../mkDerivation.nix
+    { inherit stdenv; inherit (stdenv) lib; }
+    { inherit debug; };
+
+  qtModule =
+    import ../qtModule.nix
+    { inherit mkDerivation perl; inherit (stdenv) lib; }
+    { inherit self srcs patches; };
+
+  addPackages = self: with self;
+    let
+      callPackage = self.newScope { inherit qtCompatVersion qtModule srcs; };
+    in {
+
+      inherit mkDerivation;
+
+      qtbase = callPackage ../modules/qtbase.nix {
+        inherit (srcs.qtbase) src version;
+        patches = patches.qtbase;
+        inherit bison cups harfbuzz mesa;
+        withGtk3 = true; inherit dconf gtk3;
+        inherit developerBuild decryptSslTraffic;
+      };
+
+      qtcharts = callPackage ../modules/qtcharts.nix {};
+      qtconnectivity = callPackage ../modules/qtconnectivity.nix {};
+      qtdeclarative = callPackage ../modules/qtdeclarative.nix {};
+      qtdoc = callPackage ../modules/qtdoc.nix {};
+      qtgraphicaleffects = callPackage ../modules/qtgraphicaleffects.nix {};
+      qtimageformats = callPackage ../modules/qtimageformats.nix {};
+      qtlocation = callPackage ../modules/qtlocation.nix {};
+      qtmacextras = callPackage ../modules/qtmacextras.nix {};
+      qtmultimedia = callPackage ../modules/qtmultimedia.nix {
+        inherit gstreamer gst-plugins-base;
+      };
+      qtquick1 = null;
+      qtquickcontrols = callPackage ../modules/qtquickcontrols.nix {};
+      qtquickcontrols2 = callPackage ../modules/qtquickcontrols2.nix {};
+      qtscript = callPackage ../modules/qtscript.nix {};
+      qtsensors = callPackage ../modules/qtsensors.nix {};
+      qtserialport = callPackage ../modules/qtserialport.nix {};
+      qtsvg = callPackage ../modules/qtsvg.nix {};
+      qttools = callPackage ../modules/qttools.nix {};
+      qttranslations = callPackage ../modules/qttranslations.nix {};
+      qtvirtualkeyboard = callPackage ../modules/qtvirtualkeyboard.nix {};
+      qtwayland = callPackage ../modules/qtwayland.nix {};
+      qtwebchannel = callPackage ../modules/qtwebchannel.nix {};
+      qtwebengine = callPackage ../modules/qtwebengine.nix {};
+      qtwebkit = callPackage ../modules/qtwebkit.nix {};
+      qtwebsockets = callPackage ../modules/qtwebsockets.nix {};
+      qtx11extras = callPackage ../modules/qtx11extras.nix {};
+      qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {};
+
+      env = callPackage ../qt-env.nix {};
+      full = env "qt-${qtbase.version}" ([
+        qtcharts qtconnectivity qtdeclarative qtdoc qtgraphicaleffects
+        qtimageformats qtlocation qtmultimedia qtquickcontrols qtscript
+        qtsensors qtserialport qtsvg qttools qttranslations qtwebsockets
+        qtx11extras qtxmlpatterns
+      ] ++ optional (!stdenv.isDarwin) qtwayland
+        ++ optional (stdenv.isDarwin) qtmacextras);
+
+      qmake = makeSetupHook {
+        deps = [ self.qtbase.dev ];
+        substitutions = {
+          inherit (stdenv) isDarwin;
+          qtbase_dev = self.qtbase.dev;
+          fix_qt_builtin_paths = ../hooks/fix-qt-builtin-paths.sh;
+        };
+      } ../hooks/qmake-hook.sh;
+    };
+
+   self = makeScope newScope addPackages;
+
+in self
diff --git a/pkgs/development/libraries/qt-5/5.10/fetch.sh b/pkgs/development/libraries/qt-5/5.10/fetch.sh
new file mode 100644
index 00000000000..849e76d616d
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/fetch.sh
@@ -0,0 +1,2 @@
+WGET_ARGS=( http://download.qt.io/official_releases/qt/5.10/5.10.0/submodules/ \
+            -A '*.tar.xz' )
diff --git a/pkgs/development/libraries/qt-5/5.10/qtbase-darwin.patch b/pkgs/development/libraries/qt-5/5.10/qtbase-darwin.patch
new file mode 100644
index 00000000000..e85a284f3bb
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/qtbase-darwin.patch
@@ -0,0 +1,57 @@
+diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
+index 341d3bccf2..3368234c26 100644
+--- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
++++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm
+@@ -287,7 +287,7 @@ void QScanThread::getUserConfigurations()
+     QMacAutoReleasePool pool;
+     userProfiles.clear();
+ 
+-    NSArray<NSString *> *wifiInterfaces = [CWWiFiClient interfaceNames];
++    NSArray *wifiInterfaces = [CWWiFiClient interfaceNames];
+     for (NSString *ifName in wifiInterfaces) {
+ 
+         CWInterface *wifiInterface = [[CWWiFiClient sharedWiFiClient] interfaceWithName:ifName];
+@@ -602,7 +602,7 @@ void QCoreWlanEngine::doRequestUpdate()
+ 
+     QMacAutoReleasePool pool;
+ 
+-    NSArray<NSString *> *wifiInterfaces = [CWWiFiClient interfaceNames];
++    NSArray *wifiInterfaces = [CWWiFiClient interfaceNames];
+     for (NSString *ifName in wifiInterfaces) {
+             scanThread->interfaceName = QString::fromNSString(ifName);
+             scanThread->start();
+diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
+index d1f19f2..1ac2cf1 100644
+--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
++++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
+@@ -1699,7 +1699,7 @@ void QCocoaWindow::applyContentBorderThickness(NSWindow *window)
+
+     if (!m_drawContentBorderGradient) {
+         window.styleMask = window.styleMask & ~NSTexturedBackgroundWindowMask;
+-        [window.contentView.superview setNeedsDisplay:YES];
++        [[window.contentView superview] setNeedsDisplay:YES];
+         window.titlebarAppearsTransparent = NO;
+         return;
+     }
+diff --git a/src/plugins/platforms/cocoa/qnswindow.mm b/src/plugins/platforms/cocoa/qnswindow.mm
+index e846fa0..4171cd4 100644
+--- a/src/plugins/platforms/cocoa/qnswindow.mm
++++ b/src/plugins/platforms/cocoa/qnswindow.mm
+@@ -224,7 +224,7 @@ static bool isMouseEvent(NSEvent *ev)
+     if (pw->frameStrutEventsEnabled() && isMouseEvent(theEvent)) {
+         NSPoint loc = [theEvent locationInWindow];
+         NSRect windowFrame = [self convertRectFromScreen:self.frame];
+-        NSRect contentFrame = self.contentView.frame;
++        NSRect contentFrame = [self.contentView frame];
+         if (NSMouseInRect(loc, windowFrame, NO) && !NSMouseInRect(loc, contentFrame, NO))
+             [qnsview_cast(pw->view()) handleFrameStrutMouseEvent:theEvent];
+     }
+@@ -253,7 +253,7 @@ static bool isMouseEvent(NSEvent *ev)
+ + (void)applicationActivationChanged:(NSNotification*)notification
+ {
+     const id sender = self;
+-    NSEnumerator<NSWindow*> *windowEnumerator = nullptr;
++    NSEnumerator *windowEnumerator = nullptr;
+     NSApplication *application = [NSApplication sharedApplication];
+
+ #if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12)
diff --git a/pkgs/development/libraries/qt-5/5.10/qtbase.patch b/pkgs/development/libraries/qt-5/5.10/qtbase.patch
new file mode 100644
index 00000000000..b79ce9fc356
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/qtbase.patch
@@ -0,0 +1,1119 @@
+diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf
+index 5208379f9a..92fe29a0ac 100644
+--- a/mkspecs/common/mac.conf
++++ b/mkspecs/common/mac.conf
+@@ -23,7 +23,7 @@ QMAKE_INCDIR_OPENGL     = \
+ 
+ QMAKE_FIX_RPATH         = install_name_tool -id
+ 
+-QMAKE_LFLAGS_RPATH      = -Wl,-rpath,
++QMAKE_LFLAGS_RPATH      =
+ QMAKE_LFLAGS_GCSECTIONS = -Wl,-dead_strip
+ 
+ QMAKE_LFLAGS_REL_RPATH  =
+diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
+index bb5083c925..77034f9bb6 100644
+--- a/mkspecs/features/create_cmake.prf
++++ b/mkspecs/features/create_cmake.prf
+@@ -21,7 +21,7 @@ load(cmake_functions)
+ # at cmake time whether package has been found via a symlink, and correct
+ # that to an absolute path. This is only done for installations to
+ # the /usr or / prefix.
+-CMAKE_INSTALL_LIBS_DIR = $$cmakeTargetPath($$[QT_INSTALL_LIBS])
++CMAKE_INSTALL_LIBS_DIR = $$cmakeTargetPath($$NIX_OUTPUT_OUT/lib/)
+ contains(CMAKE_INSTALL_LIBS_DIR, ^(/usr)?/lib(64)?.*): CMAKE_USR_MOVE_WORKAROUND = $$CMAKE_INSTALL_LIBS_DIR
+ 
+ CMAKE_OUT_DIR = $$MODULE_BASE_OUTDIR/lib/cmake
+@@ -47,47 +47,22 @@ split_incpath {
+         $$cmake_extra_source_includes.output
+ }
+ 
+-CMAKE_INCLUDE_DIR = $$cmakeRelativePath($$[QT_INSTALL_HEADERS], $$[QT_INSTALL_PREFIX])
+-contains(CMAKE_INCLUDE_DIR, "^\\.\\./.*") {
+-    CMAKE_INCLUDE_DIR = $$[QT_INSTALL_HEADERS]/
+-    CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True
+-}
++CMAKE_INCLUDE_DIR = $$NIX_OUTPUT_DEV/include/
++CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True
+ 
+ !exists($$first(QT.$${MODULE}_private.includes)): CMAKE_NO_PRIVATE_INCLUDES = true
+ 
+-CMAKE_LIB_DIR = $$cmakeRelativePath($$[QT_INSTALL_LIBS], $$[QT_INSTALL_PREFIX])
+-contains(CMAKE_LIB_DIR,"^\\.\\./.*") {
+-    CMAKE_LIB_DIR = $$[QT_INSTALL_LIBS]/
+-    CMAKE_LIB_DIR_IS_ABSOLUTE = True
+-} else {
+-    CMAKE_RELATIVE_INSTALL_LIBS_DIR = $$cmakeRelativePath($$[QT_INSTALL_PREFIX], $$[QT_INSTALL_LIBS])
+-    # We need to go up another two levels because the CMake files are
+-    # installed in $${CMAKE_LIB_DIR}/cmake/Qt5$${CMAKE_MODULE_NAME}
+-    CMAKE_RELATIVE_INSTALL_DIR = "$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}../../"
+-}
++CMAKE_LIB_DIR = $$NIX_OUTPUT_OUT/lib/
++CMAKE_LIB_DIR_IS_ABSOLUTE = True
+ 
+-CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
+-contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
+-    CMAKE_BIN_DIR = $$[QT_HOST_BINS]/
+-    CMAKE_BIN_DIR_IS_ABSOLUTE = True
+-}
++CMAKE_BIN_DIR = $$NIX_OUTPUT_BIN/bin/
++CMAKE_BIN_DIR_IS_ABSOLUTE = True
+ 
+-CMAKE_PLUGIN_DIR = $$cmakeRelativePath($$[QT_INSTALL_PLUGINS], $$[QT_INSTALL_PREFIX])
+-contains(CMAKE_PLUGIN_DIR, "^\\.\\./.*") {
+-    CMAKE_PLUGIN_DIR = $$[QT_INSTALL_PLUGINS]/
+-    CMAKE_PLUGIN_DIR_IS_ABSOLUTE = True
+-}
++CMAKE_PLUGIN_DIR = $$NIX_OUTPUT_PLUGIN/
++CMAKE_PLUGIN_DIR_IS_ABSOLUTE = True
+ 
+-win32:!static:!staticlib {
+-    CMAKE_DLL_DIR = $$cmakeRelativePath($$[QT_INSTALL_BINS], $$[QT_INSTALL_PREFIX])
+-    contains(CMAKE_DLL_DIR, "^\\.\\./.*") {
+-        CMAKE_DLL_DIR = $$[QT_INSTALL_BINS]/
+-        CMAKE_DLL_DIR_IS_ABSOLUTE = True
+-    }
+-} else {
+-    CMAKE_DLL_DIR = $$CMAKE_LIB_DIR
+-    CMAKE_DLL_DIR_IS_ABSOLUTE = $$CMAKE_LIB_DIR_IS_ABSOLUTE
+-}
++CMAKE_DLL_DIR = $$NIX_OUTPUT_OUT/lib/
++CMAKE_DLL_DIR_IS_ABSOLUTE = True
+ 
+ static|staticlib:CMAKE_STATIC_TYPE = true
+ 
+@@ -167,7 +142,7 @@ contains(CONFIG, plugin) {
+       cmake_target_file
+ 
+     cmake_qt5_plugin_file.files = $$cmake_target_file.output
+-    cmake_qt5_plugin_file.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME}
++    cmake_qt5_plugin_file.path = $$NIX_OUTPUT_OUT/lib/cmake/Qt5$${CMAKE_MODULE_NAME}
+     INSTALLS += cmake_qt5_plugin_file
+ 
+     return()
+@@ -314,7 +289,7 @@ exists($$cmake_macros_file.input) {
+     cmake_qt5_module_files.files += $$cmake_macros_file.output
+ }
+ 
+-cmake_qt5_module_files.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME}
++cmake_qt5_module_files.path = $$NIX_OUTPUT_OUT/lib/cmake/Qt5$${CMAKE_MODULE_NAME}
+ 
+ # We are generating cmake files. Most developers of Qt are not aware of cmake,
+ # so we require automatic tests to be available. The only module which should
+diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+index 55c74aad66..0bbc8718eb 100644
+--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
++++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+@@ -9,30 +9,6 @@ if (CMAKE_VERSION VERSION_LESS 3.0.0)
+ endif()
+ !!ENDIF
+ 
+-!!IF !isEmpty(CMAKE_USR_MOVE_WORKAROUND)
+-!!IF !isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")
+-!!ELSE
+-get_filename_component(_IMPORT_PREFIX \"${CMAKE_CURRENT_LIST_FILE}\" PATH)
+-# Use original install prefix when loaded through a
+-# cross-prefix symbolic link such as /lib -> /usr/lib.
+-get_filename_component(_realCurr \"${_IMPORT_PREFIX}\" REALPATH)
+-get_filename_component(_realOrig \"$$CMAKE_INSTALL_LIBS_DIR/cmake/Qt5$${CMAKE_MODULE_NAME}\" REALPATH)
+-if(_realCurr STREQUAL _realOrig)
+-    get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$CMAKE_INSTALL_LIBS_DIR/$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}\" ABSOLUTE)
+-else()
+-    get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
+-endif()
+-unset(_realOrig)
+-unset(_realCurr)
+-unset(_IMPORT_PREFIX)
+-!!ENDIF
+-!!ELIF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
+-!!ELSE
+-set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")
+-!!ENDIF
+-
+ !!IF !equals(TEMPLATE, aux)
+ # For backwards compatibility only. Use Qt5$${CMAKE_MODULE_NAME}_VERSION instead.
+ set(Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING "$$eval(QT.$${MODULE}.VERSION)")
+@@ -58,11 +34,7 @@ endmacro()
+ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATION IMPLIB_LOCATION)
+     set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
+ 
+-!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
+-!!ELSE
+     set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
+-!!ENDIF
+     _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
+     set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
+         \"INTERFACE_LINK_LIBRARIES\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\"
+@@ -75,11 +47,7 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI
+     )
+ 
+ !!IF !isEmpty(CMAKE_WINDOWS_BUILD)
+-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-    set(imported_implib \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
+-!!ELSE
+     set(imported_implib \"IMPORTED_IMPLIB_${Configuration}\" \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
+-!!ENDIF
+     _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_implib})
+     if(NOT \"${IMPLIB_LOCATION}\" STREQUAL \"\")
+         set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
+@@ -95,24 +63,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+ !!IF !no_module_headers
+ !!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
+     set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS
+-      \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework\"
+-      \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Headers\"
++      \"$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework\"
++      \"$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Headers\"
+     )
+ !!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
+     set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
+-        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/\"
+-        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\"
+-    )
+-!!ELSE
+-    set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
+-!!ENDIF
+-!!ELSE
+-!!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
+-    set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}\")
+-!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
+-    set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
+-        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION\"
+-        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION/$${MODULE_INCNAME}\"
++        \"$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/\"
++        \"$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\"
+     )
+ !!ELSE
+     set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
+@@ -128,7 +85,6 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+     set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
+ !!ENDIF
+ !!ENDIF
+-!!ENDIF
+ !!IF !isEmpty(CMAKE_ADD_SOURCE_INCLUDE_DIRS)
+     include(\"${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake\" OPTIONAL)
+ !!ENDIF
+@@ -280,25 +236,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+ !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
+ !!IF isEmpty(CMAKE_DEBUG_TYPE)
+ !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
+-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-    if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
+-!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
+     if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
+-!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
+         _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" )
+ !!ELSE // CMAKE_STATIC_WINDOWS_BUILD
+     if (EXISTS
+-!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
+-        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
+-!!ELSE
+         \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
+-!!ENDIF
+       AND EXISTS
+-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
+-!!ELSE
+         \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
+-!!ENDIF
+         _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
+ !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
+     endif()
+@@ -317,25 +261,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+ !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
+ !!IF isEmpty(CMAKE_RELEASE_TYPE)
+ !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
+-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-    if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
+-!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
+     if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
+-!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
+         _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" )
+ !!ELSE // CMAKE_STATIC_WINDOWS_BUILD
+     if (EXISTS
+-!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
+-        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
+-!!ELSE
+         \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
+-!!ENDIF
+       AND EXISTS
+-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
+-!!ELSE
+         \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
+-!!ENDIF
+         _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
+ !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
+     endif()
+@@ -354,11 +286,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+     macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION)
+         set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
+ 
+-!!IF isEmpty(CMAKE_PLUGIN_DIR_IS_ABSOLUTE)
+-        set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
+-!!ELSE
+         set(imported_location \"$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
+-!!ENDIF
+         _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
+         set_target_properties(Qt5::${Plugin} PROPERTIES
+             \"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
+diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
+index e645ba5803..a0e5c68b7e 100644
+--- a/mkspecs/features/mac/default_post.prf
++++ b/mkspecs/features/mac/default_post.prf
+@@ -24,166 +24,3 @@ qt {
+         }
+     }
+ }
+-
+-# Add the same default rpaths as Xcode does for new projects.
+-# This is especially important for iOS/tvOS/watchOS where no other option is possible.
+-!no_default_rpath {
+-    QMAKE_RPATHDIR += @executable_path/Frameworks
+-    equals(TEMPLATE, lib):!plugin:lib_bundle: QMAKE_RPATHDIR += @loader_path/Frameworks
+-}
+-
+-# Don't pass -headerpad_max_install_names when using Bitcode.
+-# In that case the linker emits a warning stating that the flag is ignored when
+-# used with bitcode, for reasons that cannot be determined (rdar://problem/20748962).
+-# Using this flag is also unnecessary in practice on UIKit platforms since they
+-# are sandboxed, and only UIKit platforms support bitcode to begin with.
+-!bitcode: QMAKE_LFLAGS += $$QMAKE_LFLAGS_HEADERPAD
+-
+-app_extension_api_only {
+-    QMAKE_CFLAGS              += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
+-    QMAKE_CXXFLAGS            += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
+-    QMAKE_CXXFLAGS_PRECOMPILE += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
+-    QMAKE_LFLAGS              += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
+-}
+-
+-macx-xcode {
+-    !isEmpty(QMAKE_XCODE_DEBUG_INFORMATION_FORMAT) {
+-        debug_information_format.name = DEBUG_INFORMATION_FORMAT
+-        debug_information_format.value = $$QMAKE_XCODE_DEBUG_INFORMATION_FORMAT
+-        debug_information_format.build = debug
+-        QMAKE_MAC_XCODE_SETTINGS += debug_information_format
+-    }
+-
+-    QMAKE_XCODE_ARCHS =
+-
+-    arch_device.name = "ARCHS[sdk=$${device.sdk}*]"
+-    arch_device.value = $$QMAKE_APPLE_DEVICE_ARCHS
+-    QMAKE_XCODE_ARCHS += $$QMAKE_APPLE_DEVICE_ARCHS
+-    QMAKE_MAC_XCODE_SETTINGS += arch_device
+-
+-    simulator {
+-        arch_simulator.name = "ARCHS[sdk=$${simulator.sdk}*]"
+-        arch_simulator.value = $$QMAKE_APPLE_SIMULATOR_ARCHS
+-        QMAKE_XCODE_ARCHS += $$QMAKE_APPLE_SIMULATOR_ARCHS
+-        QMAKE_MAC_XCODE_SETTINGS += arch_simulator
+-    }
+-
+-    only_active_arch.name = ONLY_ACTIVE_ARCH
+-    only_active_arch.value = YES
+-    only_active_arch.build = debug
+-    QMAKE_MAC_XCODE_SETTINGS += only_active_arch
+-} else {
+-    device|!simulator: VALID_DEVICE_ARCHS = $$QMAKE_APPLE_DEVICE_ARCHS
+-    simulator: VALID_SIMULATOR_ARCHS = $$QMAKE_APPLE_SIMULATOR_ARCHS
+-    VALID_ARCHS = $$VALID_DEVICE_ARCHS $$VALID_SIMULATOR_ARCHS
+-
+-    isEmpty(VALID_ARCHS): \
+-        error("QMAKE_APPLE_DEVICE_ARCHS or QMAKE_APPLE_SIMULATOR_ARCHS must contain at least one architecture")
+-
+-    single_arch: VALID_ARCHS = $$first(VALID_ARCHS)
+-
+-    ACTIVE_ARCHS = $(filter $(EXPORT_VALID_ARCHS), $(ARCHS))
+-    ARCH_ARGS = $(foreach arch, $(if $(EXPORT_ACTIVE_ARCHS), $(EXPORT_ACTIVE_ARCHS), $(EXPORT_VALID_ARCHS)), -arch $(arch))
+-
+-    QMAKE_EXTRA_VARIABLES += VALID_ARCHS ACTIVE_ARCHS ARCH_ARGS
+-
+-    arch_flags = $(EXPORT_ARCH_ARGS)
+-
+-    QMAKE_CFLAGS += $$arch_flags
+-    QMAKE_CXXFLAGS += $$arch_flags
+-    QMAKE_LFLAGS += $$arch_flags
+-
+-    QMAKE_PCH_ARCHS = $$VALID_ARCHS
+-
+-    macos: deployment_target = $$QMAKE_MACOSX_DEPLOYMENT_TARGET
+-    ios: deployment_target = $$QMAKE_IOS_DEPLOYMENT_TARGET
+-    tvos: deployment_target = $$QMAKE_TVOS_DEPLOYMENT_TARGET
+-    watchos: deployment_target = $$QMAKE_WATCHOS_DEPLOYMENT_TARGET
+-
+-    # If we're doing a simulator and device build, device and simulator
+-    # architectures use different paths and flags for the sysroot and
+-    # deployment target switch, so we must multiplex them across multiple
+-    # architectures using -Xarch. Otherwise we fall back to the simple path.
+-    # This is not strictly necessary, but results in cleaner command lines
+-    # and makes it easier for people to override EXPORT_VALID_ARCHS to limit
+-    # individual rules to a different set of architecture(s) from the overall
+-    # build (such as machtest in QtCore).
+-    simulator:device {
+-        QMAKE_XARCH_CFLAGS =
+-        QMAKE_XARCH_LFLAGS =
+-        QMAKE_EXTRA_VARIABLES += QMAKE_XARCH_CFLAGS QMAKE_XARCH_LFLAGS
+-
+-        for (arch, VALID_ARCHS) {
+-            contains(VALID_SIMULATOR_ARCHS, $$arch) {
+-                sdk = $$simulator.sdk
+-                version_identifier = $$simulator.deployment_identifier
+-            } else {
+-                sdk = $$device.sdk
+-                version_identifier = $$device.deployment_identifier
+-            }
+-
+-            version_min_flags = \
+-                -Xarch_$${arch} \
+-                -m$${version_identifier}-version-min=$$deployment_target
+-            QMAKE_XARCH_CFLAGS_$${arch} = $$version_min_flags \
+-                -Xarch_$${arch} \
+-                -isysroot$$xcodeSDKInfo(Path, $$sdk)
+-            QMAKE_XARCH_LFLAGS_$${arch} = $$version_min_flags \
+-                -Xarch_$${arch} \
+-                -Wl,-syslibroot,$$xcodeSDKInfo(Path, $$sdk)
+-
+-            QMAKE_XARCH_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS_$${arch})
+-            QMAKE_XARCH_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS_$${arch})
+-
+-            QMAKE_EXTRA_VARIABLES += \
+-                QMAKE_XARCH_CFLAGS_$${arch} \
+-                QMAKE_XARCH_LFLAGS_$${arch}
+-        }
+-
+-        QMAKE_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS)
+-        QMAKE_CXXFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS)
+-        QMAKE_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS)
+-    } else {
+-        simulator: \
+-            version_identifier = $$simulator.deployment_identifier
+-        else: \
+-            version_identifier = $$device.deployment_identifier
+-        version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
+-        QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag
+-        QMAKE_CXXFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag
+-        QMAKE_LFLAGS += -Wl,-syslibroot,$$QMAKE_MAC_SDK_PATH $$version_min_flag
+-    }
+-
+-    # Enable precompiled headers for multiple architectures
+-    QMAKE_CFLAGS_USE_PRECOMPILE =
+-    for (arch, VALID_ARCHS) {
+-        icc_pch_style: \
+-            use_flag = "-pch-use "
+-        else: \
+-            use_flag = -include
+-
+-        # Only use Xarch with multi-arch, as the option confuses ccache
+-        count(VALID_ARCHS, 1, greaterThan): \
+-            QMAKE_CFLAGS_USE_PRECOMPILE += \
+-                -Xarch_$${arch}
+-
+-        QMAKE_CFLAGS_USE_PRECOMPILE += \
+-            $${use_flag}${QMAKE_PCH_OUTPUT_$${arch}}
+-    }
+-    icc_pch_style {
+-        QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE -include ${QMAKE_PCH_INPUT}
+-        QMAKE_CFLAGS_USE_PRECOMPILE =
+-    } else {
+-        QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
+-        QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
+-        QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
+-    }
+-
+-    QMAKE_PCH_OUTPUT_EXT = _${QMAKE_PCH_ARCH}$${QMAKE_PCH_OUTPUT_EXT}
+-}
+-
+-cache(QMAKE_XCODE_DEVELOPER_PATH, stash)
+-!isEmpty(QMAKE_XCODE_VERSION): \
+-    cache(QMAKE_XCODE_VERSION, stash)
+-
+-QMAKE_XCODE_LIBRARY_SUFFIX = $$qtPlatformTargetSuffix()
+diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
+index 44636f2288..3b01424e67 100644
+--- a/mkspecs/features/mac/default_pre.prf
++++ b/mkspecs/features/mac/default_pre.prf
+@@ -1,56 +1,2 @@
+ CONFIG = asset_catalogs rez $$CONFIG
+ load(default_pre)
+-
+-isEmpty(QMAKE_XCODE_DEVELOPER_PATH) {
+-    # Get path of Xcode's Developer directory
+-    QMAKE_XCODE_DEVELOPER_PATH = $$system("/usr/bin/xcode-select --print-path 2>/dev/null")
+-    isEmpty(QMAKE_XCODE_DEVELOPER_PATH): \
+-        error("Xcode path is not set. Please use xcode-select to choose Xcode installation path.")
+-
+-    # Make sure Xcode path is valid
+-    !exists($$QMAKE_XCODE_DEVELOPER_PATH): \
+-        error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}. Please use xcode-select to choose Xcode installation path.")
+-}
+-
+-isEmpty(QMAKE_XCODEBUILD_PATH): \
+-    QMAKE_XCODEBUILD_PATH = $$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null")
+-
+-!isEmpty(QMAKE_XCODEBUILD_PATH) {
+-    # Make sure Xcode is set up properly
+-    !system("/usr/bin/xcrun xcodebuild -license check 2>/dev/null"): \
+-        error("Xcode not set up properly. You need to confirm the license agreement by running 'sudo xcrun xcodebuild -license accept'.")
+-
+-    isEmpty(QMAKE_XCODE_VERSION) {
+-        # Extract Xcode version using xcodebuild
+-        xcode_version = $$system("/usr/bin/xcrun xcodebuild -version")
+-        QMAKE_XCODE_VERSION = $$member(xcode_version, 1)
+-        isEmpty(QMAKE_XCODE_VERSION): error("Could not resolve Xcode version.")
+-        unset(xcode_version)
+-    }
+-}
+-
+-isEmpty(QMAKE_TARGET_BUNDLE_PREFIX) {
+-    QMAKE_XCODE_PREFERENCES_FILE = $$(HOME)/Library/Preferences/com.apple.dt.Xcode.plist
+-    exists($$QMAKE_XCODE_PREFERENCES_FILE): \
+-        QMAKE_TARGET_BUNDLE_PREFIX = $$system("/usr/libexec/PlistBuddy -c 'print IDETemplateOptions:bundleIdentifierPrefix' $$QMAKE_XCODE_PREFERENCES_FILE 2>/dev/null")
+-
+-    !isEmpty(_QMAKE_CACHE_):!isEmpty(QMAKE_TARGET_BUNDLE_PREFIX): \
+-        cache(QMAKE_TARGET_BUNDLE_PREFIX)
+-}
+-
+-QMAKE_ASSET_CATALOGS_APP_ICON = AppIcon
+-
+-# Make the default debug info format for static debug builds
+-# DWARF instead of DWARF with dSYM. This cuts down build times
+-# for application debug builds significantly, as Xcode doesn't
+-# have to pull out all the DWARF info from the Qt static libs
+-# and put it into a dSYM file. We don't need that dSYM file in
+-# the first place, since the information is available in the
+-# object files inside the archives (static libraries).
+-macx-xcode:qtConfig(static): \
+-    QMAKE_XCODE_DEBUG_INFORMATION_FORMAT = dwarf
+-
+-# This variable is used by the xcode_dynamic_library_suffix
+-# feature, which allows Xcode to choose the Qt libraries to link to
+-# at build time, depending on the current Xcode SDK and configuration.
+-QMAKE_XCODE_LIBRARY_SUFFIX_SETTING = QT_LIBRARY_SUFFIX
+diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
+index 3f6dc076ca..e69de29bb2 100644
+--- a/mkspecs/features/mac/sdk.prf
++++ b/mkspecs/features/mac/sdk.prf
+@@ -1,58 +0,0 @@
+-
+-isEmpty(QMAKE_MAC_SDK): \
+-    error("QMAKE_MAC_SDK must be set when using CONFIG += sdk.")
+-
+-contains(QMAKE_MAC_SDK, .*/.*): \
+-    error("QMAKE_MAC_SDK can only contain short-form SDK names (eg. macosx, iphoneos)")
+-
+-defineReplace(xcodeSDKInfo) {
+-    info = $$1
+-    equals(info, "Path"): \
+-        info = --show-sdk-path
+-    equals(info, "PlatformPath"): \
+-        info = --show-sdk-platform-path
+-    equals(info, "SDKVersion"): \
+-        info = --show-sdk-version
+-    sdk = $$2
+-    isEmpty(sdk): \
+-        sdk = $$QMAKE_MAC_SDK
+-
+-    isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}) {
+-        QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("/usr/bin/xcrun --sdk $$sdk $$info 2>/dev/null")
+-        # --show-sdk-platform-path won't work for Command Line Tools; this is fine
+-        # only used by the XCTest backend to testlib
+-        isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}):if(!isEmpty(QMAKE_XCODEBUILD_PATH)|!equals(info, "--show-sdk-platform-path")): \
+-            error("Could not resolve SDK $$info for \'$$sdk\'")
+-        cache(QMAKE_MAC_SDK.$${sdk}.$${info}, set stash, QMAKE_MAC_SDK.$${sdk}.$${info})
+-    }
+-
+-    return($$eval(QMAKE_MAC_SDK.$${sdk}.$${info}))
+-}
+-
+-QMAKE_MAC_SDK_PATH = $$xcodeSDKInfo(Path)
+-QMAKE_MAC_SDK_PLATFORM_PATH = $$xcodeSDKInfo(PlatformPath)
+-QMAKE_MAC_SDK_VERSION = $$xcodeSDKInfo(SDKVersion)
+-
+-sysrootified =
+-for(val, QMAKE_INCDIR_OPENGL): sysrootified += $${QMAKE_MAC_SDK_PATH}$$val
+-QMAKE_INCDIR_OPENGL = $$sysrootified
+-
+-QMAKESPEC_NAME = $$basename(QMAKESPEC)
+-
+-# Resolve SDK version of various tools
+-for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_LINK QMAKE_LINK_SHLIB QMAKE_ACTOOL)) {
+-    tool_variable = QMAKE_MAC_SDK.$${QMAKESPEC_NAME}.$${QMAKE_MAC_SDK}.$${tool}
+-    !isEmpty($$tool_variable) {
+-        $$tool = $$eval($$tool_variable)
+-        next()
+-    }
+-
+-    value = $$eval($$tool)
+-    isEmpty(value): next()
+-
+-    sysrooted = $$system("/usr/bin/xcrun -sdk $$QMAKE_MAC_SDK -find $$first(value) 2>/dev/null")
+-    isEmpty(sysrooted): next()
+-
+-    $$tool = $$sysrooted $$member(value, 1, -1)
+-    cache($$tool_variable, set stash, $$tool)
+-}
+diff --git a/mkspecs/features/qml_module.prf b/mkspecs/features/qml_module.prf
+index 4db0040dc5..65d6da1f4d 100644
+--- a/mkspecs/features/qml_module.prf
++++ b/mkspecs/features/qml_module.prf
+@@ -23,13 +23,8 @@ for(qmlf, AUX_QML_FILES): fq_aux_qml_files += $$absolute_path($$qmlf, $$_PRO_FIL
+ 
+ load(qt_build_paths)
+ 
+-qml1_target {
+-    DESTDIR = $$MODULE_BASE_OUTDIR/imports/$$TARGETPATH
+-    instbase = $$[QT_INSTALL_IMPORTS]
+-} else {
+-    DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
+-    instbase = $$[QT_INSTALL_QML]
+-}
++DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
++instbase = $$NIX_OUTPUT_QML
+ 
+ !qml1_target:static: CONFIG += builtin_resources
+ 
+diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf
+index d49f4c49c1..097dcd7d39 100644
+--- a/mkspecs/features/qml_plugin.prf
++++ b/mkspecs/features/qml_plugin.prf
+@@ -48,13 +48,8 @@ exists($$QMLTYPEFILE): AUX_QML_FILES += $$QMLTYPEFILE
+ 
+ load(qt_build_paths)
+ 
+-qml1_target {
+-    DESTDIR = $$MODULE_BASE_OUTDIR/imports/$$TARGETPATH
+-    instbase = $$[QT_INSTALL_IMPORTS]
+-} else {
+-    DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
+-    instbase = $$[QT_INSTALL_QML]
+-}
++DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
++instbase = $$NIX_OUTPUT_QML
+ 
+ target.path = $$instbase/$$TARGETPATH
+ INSTALLS += target
+diff --git a/mkspecs/features/qt_app.prf b/mkspecs/features/qt_app.prf
+index 883f8ca215..81db8eb2d4 100644
+--- a/mkspecs/features/qt_app.prf
++++ b/mkspecs/features/qt_app.prf
+@@ -33,7 +33,7 @@ host_build:force_bootstrap {
+     target.path = $$[QT_HOST_BINS]
+ } else {
+     !build_pass:qtConfig(debug_and_release): CONFIG += release
+-    target.path = $$[QT_INSTALL_BINS]
++    target.path = $$NIX_OUTPUT_BIN/bin
+     CONFIG += relative_qt_rpath  # Qt's tools and apps should be relocatable
+ }
+ INSTALLS += target
+diff --git a/mkspecs/features/qt_build_paths.prf b/mkspecs/features/qt_build_paths.prf
+index 1848f00e90..2af93675c5 100644
+--- a/mkspecs/features/qt_build_paths.prf
++++ b/mkspecs/features/qt_build_paths.prf
+@@ -23,6 +23,6 @@ exists($$MODULE_BASE_INDIR/.git): \
+ !force_independent {
+     # If the module is not built independently, everything ends up in qtbase.
+     # This is the case in non-prefix builds, except for selected modules.
+-    MODULE_BASE_OUTDIR = $$[QT_HOST_PREFIX]
+-    MODULE_QMAKE_OUTDIR = $$[QT_HOST_PREFIX]
++    MODULE_BASE_OUTDIR = $$NIX_OUTPUT_OUT
++    MODULE_QMAKE_OUTDIR = $$NIX_OUTPUT_OUT
+ }
+diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
+index f4ae5bde80..6d4c6d223f 100644
+--- a/mkspecs/features/qt_common.prf
++++ b/mkspecs/features/qt_common.prf
+@@ -32,8 +32,8 @@ contains(TEMPLATE, .*lib) {
+         qqt_libdir = \$\$\$\$[QT_HOST_LIBS]
+         qt_libdir = $$[QT_HOST_LIBS]
+     } else {
+-        qqt_libdir = \$\$\$\$[QT_INSTALL_LIBS]
+-        qt_libdir = $$[QT_INSTALL_LIBS]
++        qqt_libdir = \$\$\$\$NIX_OUTPUT_OUT/lib
++        qt_libdir = $$NIX_OUTPUT_OUT/lib
+     }
+     contains(QMAKE_DEFAULT_LIBDIRS, $$qt_libdir) {
+         lib_replace.match = "[^ ']*$$rplbase/lib"
+diff --git a/mkspecs/features/qt_docs.prf b/mkspecs/features/qt_docs.prf
+index 72dde61a40..f891a2baed 100644
+--- a/mkspecs/features/qt_docs.prf
++++ b/mkspecs/features/qt_docs.prf
+@@ -45,7 +45,7 @@ QMAKE_DOCS_OUTPUTDIR = $$QMAKE_DOCS_BASE_OUTDIR/$$QMAKE_DOCS_TARGETDIR
+ 
+ QDOC += -outputdir $$shell_quote($$QMAKE_DOCS_OUTPUTDIR)
+ !build_online_docs: \
+-    QDOC += -installdir $$shell_quote($$[QT_INSTALL_DOCS])
++    QDOC += -installdir $$shell_quote($$NIX_OUTPUT_DOC)
+ PREP_DOC_INDEXES =
+ DOC_INDEXES =
+ !isEmpty(QTREPOS) {
+@@ -64,8 +64,8 @@ DOC_INDEXES =
+         DOC_INDEXES += -indexdir $$shell_quote($$qrep/doc)
+ } else {
+     prepare_docs: \
+-        PREP_DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get])
+-    DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get])
++        PREP_DOC_INDEXES += -indexdir $$shell_quote($$NIX_OUTPUT_DOC)
++    DOC_INDEXES += -indexdir $$shell_quote($$NIX_OUTPUT_DOC)
+ }
+ 
+ qtattributionsscanner.target = qtattributionsscanner
+@@ -88,12 +88,12 @@ prepare_docs {
+     qch_docs.commands = $$QHELPGENERATOR $$shell_quote($$QMAKE_DOCS_OUTPUTDIR/$${QMAKE_DOCS_TARGET}.qhp) -o $$shell_quote($$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch)
+ 
+     inst_html_docs.files = $$QMAKE_DOCS_OUTPUTDIR
+-    inst_html_docs.path = $$[QT_INSTALL_DOCS]
++    inst_html_docs.path = $$NIX_OUTPUT_DOC
+     inst_html_docs.CONFIG += no_check_exist directory no_default_install no_build
+     INSTALLS += inst_html_docs
+ 
+     inst_qch_docs.files = $$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch
+-    inst_qch_docs.path = $$[QT_INSTALL_DOCS]
++    inst_qch_docs.path = $$NIX_OUTPUT_DOC
+     inst_qch_docs.CONFIG += no_check_exist no_default_install no_build
+     INSTALLS += inst_qch_docs
+ 
+diff --git a/mkspecs/features/qt_example_installs.prf b/mkspecs/features/qt_example_installs.prf
+index 668669e4cd..eb4840a0aa 100644
+--- a/mkspecs/features/qt_example_installs.prf
++++ b/mkspecs/features/qt_example_installs.prf
+@@ -82,7 +82,7 @@ sourcefiles += \
+     $$SOURCES $$HEADERS $$FORMS $$RESOURCES $$TRANSLATIONS \
+     $$DBUS_ADAPTORS $$DBUS_INTERFACES
+ addInstallFiles(sources.files, $$sourcefiles)
+-sources.path = $$[QT_INSTALL_EXAMPLES]/$$probase
++sources.path = $$NIX_OUTPUT_DEV/share/examples/$$probase
+ INSTALLS += sources
+ 
+ check_examples {
+diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
+index 1903e509c8..ae7b585989 100644
+--- a/mkspecs/features/qt_functions.prf
++++ b/mkspecs/features/qt_functions.prf
+@@ -69,7 +69,7 @@ defineTest(qtHaveModule) {
+ defineTest(qtPrepareTool) {
+     cmd = $$eval(QT_TOOL.$${2}.binary)
+     isEmpty(cmd) {
+-        cmd = $$[QT_HOST_BINS]/$$2
++        cmd = $$system("command -v $$2")
+         exists($${cmd}.pl) {
+             $${1}_EXE = $${cmd}.pl
+             cmd = perl -w $$system_path($${cmd}.pl)
+diff --git a/mkspecs/features/qt_installs.prf b/mkspecs/features/qt_installs.prf
+index 90d84cc535..387481bfc6 100644
+--- a/mkspecs/features/qt_installs.prf
++++ b/mkspecs/features/qt_installs.prf
+@@ -12,16 +12,10 @@
+ #library
+ !qt_no_install_library {
+     win32 {
+-       host_build: \
+-           dlltarget.path = $$[QT_HOST_BINS]
+-       else: \
+-           dlltarget.path = $$[QT_INSTALL_BINS]
++        dlltarget.path = $$NIX_OUTPUT_BIN/bin
+        INSTALLS += dlltarget
+     }
+-    host_build: \
+-        target.path = $$[QT_HOST_LIBS]
+-    else: \
+-        target.path = $$[QT_INSTALL_LIBS]
++    target.path = $$NIX_OUTPUT_OUT/lib
+     !static: target.CONFIG = no_dll
+     INSTALLS += target
+ }
+@@ -29,33 +23,33 @@
+ #headers
+ qt_install_headers {
+     class_headers.files = $$SYNCQT.HEADER_CLASSES
+-    class_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME
++    class_headers.path = $$NIX_OUTPUT_DEV/include/$$MODULE_INCNAME
+     INSTALLS += class_headers
+ 
+     targ_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.INJECTED_HEADER_FILES
+-    targ_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME
++    targ_headers.path = $$NIX_OUTPUT_DEV/include/$$MODULE_INCNAME
+     INSTALLS += targ_headers
+ 
+     private_headers.files = $$SYNCQT.PRIVATE_HEADER_FILES $$SYNCQT.INJECTED_PRIVATE_HEADER_FILES
+-    private_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME/private
++    private_headers.path = $$NIX_OUTPUT_DEV/include/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME/private
+     INSTALLS += private_headers
+ 
+     qpa_headers.files = $$SYNCQT.QPA_HEADER_FILES
+-    qpa_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME/qpa
++    qpa_headers.path = $$NIX_OUTPUT_DEV/include/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME/qpa
+     INSTALLS += qpa_headers
+ }
+ 
+ #module
+ qt_install_module {
+     !isEmpty(MODULE_PRI) {
+-        pritarget.path = $$[QT_HOST_DATA]/mkspecs/modules
++        pritarget.path = $$NIX_OUTPUT_DEV/mkspecs/modules
+         pritarget.files = $$MODULE_PRI
+         INSTALLS += pritarget
+     } else: isEmpty(MODULE_PRIVATE_PRI) {
+         warning("Project $$basename(_PRO_FILE_) is a module, but has not defined MODULE_PRI, which is required for Qt to expose the module to other projects.")
+     }
+     !isEmpty(MODULE_PRIVATE_PRI) {
+-        privpritarget.path = $$[QT_HOST_DATA]/mkspecs/modules
++        privpritarget.path = $$NIX_OUTPUT_DEV/mkspecs/modules
+         privpritarget.files = $$MODULE_PRIVATE_PRI
+         INSTALLS += privpritarget
+     }
+diff --git a/mkspecs/features/qt_plugin.prf b/mkspecs/features/qt_plugin.prf
+index 62e1b69fde..abd63123f9 100644
+--- a/mkspecs/features/qt_plugin.prf
++++ b/mkspecs/features/qt_plugin.prf
+@@ -88,7 +88,7 @@ CONFIG(static, static|shared)|prefix_build {
+     }
+ }
+ 
+-target.path = $$[QT_INSTALL_PLUGINS]/$$PLUGIN_TYPE
++target.path = $$NIX_OUTPUT_PLUGIN/$$PLUGIN_TYPE
+ INSTALLS += target
+ 
+ TARGET = $$qt5LibraryTarget($$TARGET)
+diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
+index 545b9a3d1e..6ac0cdefe4 100644
+--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
++++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
+@@ -3,7 +3,7 @@ if (NOT TARGET Qt5::qmake)
+     add_executable(Qt5::qmake IMPORTED)
+ 
+ !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
++    set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
+ !!ELSE
+     set(imported_location \"$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
+ !!ENDIF
+@@ -18,7 +18,7 @@ if (NOT TARGET Qt5::moc)
+     add_executable(Qt5::moc IMPORTED)
+ 
+ !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
++    set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
+ !!ELSE
+     set(imported_location \"$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
+ !!ENDIF
+@@ -35,7 +35,7 @@ if (NOT TARGET Qt5::rcc)
+     add_executable(Qt5::rcc IMPORTED)
+ 
+ !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
++    set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
+ !!ELSE
+     set(imported_location \"$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
+ !!ENDIF
+@@ -133,7 +133,7 @@ if (NOT TARGET Qt5::WinMain)
+ !!IF !isEmpty(CMAKE_RELEASE_TYPE)
+     set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+ !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
++    set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
+ !!ELSE
+     set(imported_location \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
+ !!ENDIF
+@@ -147,7 +147,7 @@ if (NOT TARGET Qt5::WinMain)
+     set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+ 
+ !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\")
++    set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\")
+ !!ELSE
+     set(imported_location \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\")
+ !!ENDIF
+diff --git a/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in b/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
+index c357237d0e..6f0c75de3c 100644
+--- a/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
++++ b/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
+@@ -1,6 +1,6 @@
+ 
+ !!IF isEmpty(CMAKE_HOST_DATA_DIR_IS_ABSOLUTE)
+-set(_qt5_corelib_extra_includes \"${_qt5Core_install_prefix}/$${CMAKE_HOST_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
++set(_qt5_corelib_extra_includes \"$$NIX_OUTPUT_DEV/$${CMAKE_HOST_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
+ !!ELSE
+ set(_qt5_corelib_extra_includes \"$${CMAKE_HOST_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
+ !!ENDIF
+diff --git a/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in b/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
+index 706304cf34..546420f6ad 100644
+--- a/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
++++ b/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
+@@ -1,6 +1,6 @@
+ 
+ !!IF isEmpty(CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE)
+-set(_qt5_corelib_extra_includes \"${_qt5Core_install_prefix}/$${CMAKE_INSTALL_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
++set(_qt5_corelib_extra_includes \"$$NIX_OUTPUT_DEV/$${CMAKE_INSTALL_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
+ !!ELSE
+ set(_qt5_corelib_extra_includes \"$${CMAKE_INSTALL_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
+ !!ENDIF
+diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
+index 609e52d9d2..f0f29ce61f 100644
+--- a/src/corelib/kernel/qcoreapplication.cpp
++++ b/src/corelib/kernel/qcoreapplication.cpp
+@@ -2580,6 +2580,15 @@ QStringList QCoreApplication::libraryPaths()
+         QStringList *app_libpaths = new QStringList;
+         coreappdata()->app_libpaths.reset(app_libpaths);
+ 
++        // Add library paths derived from PATH
++        const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
++        const QString plugindir = QStringLiteral("../" NIXPKGS_QT_PLUGIN_PREFIX);
++        for (const QString &path: paths) {
++            if (!path.isEmpty()) {
++                app_libpaths->append(QDir::cleanPath(path + QDir::separator() + plugindir));
++            }
++        }
++
+         const QByteArray libPathEnv = qgetenv("QT_PLUGIN_PATH");
+         if (!libPathEnv.isEmpty()) {
+             QStringList paths = QFile::decodeName(libPathEnv).split(QDir::listSeparator(), QString::SkipEmptyParts);
+diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp
+index bcc1285472..a77eb472a3 100644
+--- a/src/corelib/tools/qtimezoneprivate_tz.cpp
++++ b/src/corelib/tools/qtimezoneprivate_tz.cpp
+@@ -70,7 +70,11 @@ typedef QHash<QByteArray, QTzTimeZone> QTzTimeZoneHash;
+ // Parse zone.tab table, assume lists all installed zones, if not will need to read directories
+ static QTzTimeZoneHash loadTzTimeZones()
+ {
+-    QString path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
++    // Try TZDIR first, in case we're running on NixOS.
++    QString path = QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/zone.tab");
++    // Fallback to traditional paths in case we are not on NixOS.
++    if (!QFile::exists(path))
++        path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
+     if (!QFile::exists(path))
+         path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
+ 
+@@ -644,12 +648,16 @@ void QTzTimeZonePrivate::init(const QByteArray &ianaId)
+         if (!tzif.open(QIODevice::ReadOnly))
+             return;
+     } else {
+-        // Open named tz, try modern path first, if fails try legacy path
+-        tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
++        // Try TZDIR first, in case we're running on NixOS
++        tzif.setFileName(QFile::decodeName(qgetenv("TZDIR")) + QStringLiteral("/") + QString::fromLocal8Bit(ianaId));
+         if (!tzif.open(QIODevice::ReadOnly)) {
+-            tzif.setFileName(QLatin1String("/usr/lib/zoneinfo/") + QString::fromLocal8Bit(ianaId));
+-            if (!tzif.open(QIODevice::ReadOnly))
+-                return;
++            // Open named tz, try modern path first, if fails try legacy path
++            tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
++            if (!tzif.open(QIODevice::ReadOnly)) {
++                tzif.setFileName(QLatin1String("/usr/lib/zoneinfo/") + QString::fromLocal8Bit(ianaId));
++                if (!tzif.open(QIODevice::ReadOnly))
++                    return;
++            }
+         }
+     }
+ 
+diff --git a/src/dbus/Qt5DBusConfigExtras.cmake.in b/src/dbus/Qt5DBusConfigExtras.cmake.in
+index 1d947159e2..b36865fc48 100644
+--- a/src/dbus/Qt5DBusConfigExtras.cmake.in
++++ b/src/dbus/Qt5DBusConfigExtras.cmake.in
+@@ -2,11 +2,7 @@
+ if (NOT TARGET Qt5::qdbuscpp2xml)
+     add_executable(Qt5::qdbuscpp2xml IMPORTED)
+ 
+-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
+-!!ELSE
+-    set(imported_location \"$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
+-!!ENDIF
++    set(imported_location \"$$NIX_OUTPUT_DEV/bin/qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
+     _qt5_DBus_check_file_exists(${imported_location})
+ 
+     set_target_properties(Qt5::qdbuscpp2xml PROPERTIES
+@@ -17,11 +13,7 @@ endif()
+ if (NOT TARGET Qt5::qdbusxml2cpp)
+     add_executable(Qt5::qdbusxml2cpp IMPORTED)
+ 
+-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
+-!!ELSE
+-    set(imported_location \"$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
+-!!ENDIF
++    set(imported_location \"$$NIX_OUTPUT_DEV/bin/qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
+     _qt5_DBus_check_file_exists(${imported_location})
+ 
+     set_target_properties(Qt5::qdbusxml2cpp PROPERTIES
+diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
+index 07869efd7d..fb4183bada 100644
+--- a/src/gui/Qt5GuiConfigExtras.cmake.in
++++ b/src/gui/Qt5GuiConfigExtras.cmake.in
+@@ -2,7 +2,7 @@
+ !!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE)
+ 
+ !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
+-set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR/QtANGLE\")
++set(Qt5Gui_EGL_INCLUDE_DIRS \"$$NIX_OUTPUT_DEV/$$CMAKE_INCLUDE_DIR/QtANGLE\")
+ !!ELSE
+ set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR/QtANGLE\")
+ !!ENDIF
+@@ -17,13 +17,13 @@ macro(_populate_qt5gui_gl_target_properties TargetName Configuration LIB_LOCATIO
+     set_property(TARGET Qt5::${TargetName} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
+ 
+ !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5Gui_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
++    set(imported_location \"$$NIX_OUTPUT_OUT/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
+ !!ELSE
+     set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
+ !!ENDIF
+ 
+ !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+-    set(imported_implib \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
++    set(imported_implib \"$$NIX_OUTPUT_OUT/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
+ !!ELSE
+     set(imported_implib \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
+ !!ENDIF
+diff --git a/src/network/kernel/qdnslookup_unix.cpp b/src/network/kernel/qdnslookup_unix.cpp
+index 1da00813ce..0bf877afcb 100644
+--- a/src/network/kernel/qdnslookup_unix.cpp
++++ b/src/network/kernel/qdnslookup_unix.cpp
+@@ -92,7 +92,7 @@ static bool resolveLibraryInternal()
+     if (!lib.load())
+ #endif
+     {
+-        lib.setFileName(QLatin1String("resolv"));
++        lib.setFileName(QLatin1String(NIXPKGS_LIBRESOLV));
+         if (!lib.load())
+             return false;
+     }
+diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
+index 8d2cffc304..9730fb33f2 100644
+--- a/src/network/kernel/qhostinfo_unix.cpp
++++ b/src/network/kernel/qhostinfo_unix.cpp
+@@ -98,7 +98,7 @@ static bool resolveLibraryInternal()
+     if (!lib.load())
+ #endif
+     {
+-        lib.setFileName(QLatin1String("resolv"));
++        lib.setFileName(QLatin1String(NIXPKGS_LIBRESOLV));
+         if (!lib.load())
+             return false;
+     }
+diff --git a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
+index b5a0a5bbeb..6c20305f4d 100644
+--- a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
++++ b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
+@@ -265,12 +265,9 @@ void TableGenerator::initPossibleLocations()
+     m_possibleLocations.reserve(7);
+     if (qEnvironmentVariableIsSet("QTCOMPOSE"))
+         m_possibleLocations.append(QString::fromLocal8Bit(qgetenv("QTCOMPOSE")));
+-    m_possibleLocations.append(QStringLiteral("/usr/share/X11/locale"));
+-    m_possibleLocations.append(QStringLiteral("/usr/local/share/X11/locale"));
+-    m_possibleLocations.append(QStringLiteral("/usr/lib/X11/locale"));
+-    m_possibleLocations.append(QStringLiteral("/usr/local/lib/X11/locale"));
+     m_possibleLocations.append(QStringLiteral(X11_PREFIX "/share/X11/locale"));
+     m_possibleLocations.append(QStringLiteral(X11_PREFIX "/lib/X11/locale"));
++    m_possibleLocations.append(QLatin1String(NIXPKGS_QTCOMPOSE));
+ }
+ 
+ QString TableGenerator::findComposeFile()
+diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
+index 3bc8590d36..2a78fde518 100644
+--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
++++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
+@@ -580,7 +580,14 @@ QFunctionPointer QGLXContext::getProcAddress(const char *procName)
+ #if QT_CONFIG(library)
+                 extern const QString qt_gl_library_name();
+ //                QLibrary lib(qt_gl_library_name());
++                // Check system library paths first
+                 QLibrary lib(QLatin1String("GL"));
++#ifdef NIXPKGS_MESA_GL
++                if (!lib.load()) {
++                    // Fallback to Mesa driver
++                    lib.setFileName(QLatin1String(NIXPKGS_MESA_GL));
++                }
++#endif // NIXPKGS_MESA_GL
+                 glXGetProcAddressARB = (qt_glXGetProcAddressARB) lib.resolve("glXGetProcAddressARB");
+ #endif
+             }
+diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
+index da63360333..95e34e2e50 100644
+--- a/src/plugins/platforms/xcb/qxcbcursor.cpp
++++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
+@@ -311,10 +311,10 @@ QXcbCursor::QXcbCursor(QXcbConnection *conn, QXcbScreen *screen)
+ #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
+     static bool function_ptrs_not_initialized = true;
+     if (function_ptrs_not_initialized) {
+-        QLibrary xcursorLib(QLatin1String("Xcursor"), 1);
++        QLibrary xcursorLib(QLatin1String(NIXPKGS_LIBXCURSOR), 1);
+         bool xcursorFound = xcursorLib.load();
+         if (!xcursorFound) { // try without the version number
+-            xcursorLib.setFileName(QLatin1String("Xcursor"));
++            xcursorLib.setFileName(QLatin1String(NIXPKGS_LIBXCURSOR));
+             xcursorFound = xcursorLib.load();
+         }
+         if (xcursorFound) {
+diff --git a/src/plugins/platformthemes/gtk3/main.cpp b/src/plugins/platformthemes/gtk3/main.cpp
+index c4cd66c33b..b6f2691587 100644
+--- a/src/plugins/platformthemes/gtk3/main.cpp
++++ b/src/plugins/platformthemes/gtk3/main.cpp
+@@ -39,6 +39,7 @@
+ 
+ #include <qpa/qplatformthemeplugin.h>
+ #include "qgtk3theme.h"
++#include <QFile>
+ 
+ QT_BEGIN_NAMESPACE
+ 
+@@ -54,8 +55,22 @@ public:
+ QPlatformTheme *QGtk3ThemePlugin::create(const QString &key, const QStringList &params)
+ {
+     Q_UNUSED(params);
+-    if (!key.compare(QLatin1String(QGtk3Theme::name), Qt::CaseInsensitive))
++    if (!key.compare(QLatin1String(QGtk3Theme::name), Qt::CaseInsensitive)) {
++
++#ifdef NIXPKGS_QGTK3_XDG_DATA_DIRS
++        QStringList XDG_DATA_DIRS = QFile::decodeName(qgetenv("XDG_DATA_DIRS")).split(':');
++        XDG_DATA_DIRS << QLatin1String(NIXPKGS_QGTK3_XDG_DATA_DIRS);
++        qputenv("XDG_DATA_DIRS", QFile::encodeName(XDG_DATA_DIRS.join(':')));
++#endif
++
++#ifdef NIXPKGS_QGTK3_GIO_EXTRA_MODULES
++        QStringList GIO_EXTRA_MODULES = QFile::decodeName(qgetenv("GIO_EXTRA_MODULES")).split(':');
++        GIO_EXTRA_MODULES << QLatin1String(NIXPKGS_QGTK3_GIO_EXTRA_MODULES);
++        qputenv("GIO_EXTRA_MODULES", QFile::encodeName(GIO_EXTRA_MODULES.join(':')));
++#endif
++
+         return new QGtk3Theme;
++    }
+ 
+     return 0;
+ }
+diff --git a/src/testlib/qtestassert.h b/src/testlib/qtestassert.h
+index 6498ea84ef..d821ced7fc 100644
+--- a/src/testlib/qtestassert.h
++++ b/src/testlib/qtestassert.h
+@@ -44,10 +44,13 @@
+ 
+ QT_BEGIN_NAMESPACE
+ 
+-
++#if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
++#define QTEST_ASSERT(cond) do { } while ((false) && (cond))
++#define QTEST_ASSERT_X(cond, where, what) do { } while ((false) && (cond))
++#else
+ #define QTEST_ASSERT(cond) do { if (!(cond)) qt_assert(#cond,__FILE__,__LINE__); } while (false)
+-
+ #define QTEST_ASSERT_X(cond, where, what) do { if (!(cond)) qt_assert_x(where, what,__FILE__,__LINE__); } while (false)
++#endif
+ 
+ QT_END_NAMESPACE
+ 
+diff --git a/src/widgets/Qt5WidgetsConfigExtras.cmake.in b/src/widgets/Qt5WidgetsConfigExtras.cmake.in
+index 99d87e2e46..a4eab2aa72 100644
+--- a/src/widgets/Qt5WidgetsConfigExtras.cmake.in
++++ b/src/widgets/Qt5WidgetsConfigExtras.cmake.in
+@@ -3,7 +3,7 @@ if (NOT TARGET Qt5::uic)
+     add_executable(Qt5::uic IMPORTED)
+ 
+ !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5Widgets_install_prefix}/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
++    set(imported_location \"$$NIX_OUTPUT_DEV/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
+ !!ELSE
+     set(imported_location \"$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
+ !!ENDIF
diff --git a/pkgs/development/libraries/qt-5/5.10/qtdeclarative.patch b/pkgs/development/libraries/qt-5/5.10/qtdeclarative.patch
new file mode 100644
index 00000000000..01a975c14ec
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/qtdeclarative.patch
@@ -0,0 +1,33 @@
+diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
+index a7cafa1a9..e17ffd35b 100644
+--- a/src/qml/qml/qqmlimport.cpp
++++ b/src/qml/qml/qqmlimport.cpp
+@@ -1737,6 +1737,15 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
+     QString installImportsPath =  QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
+     addImportPath(installImportsPath);
+ 
++    // Add import paths derived from PATH
++    const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
++    const QString qmldir = QStringLiteral("../" NIXPKGS_QML2_IMPORT_PREFIX);
++    for (const QString &path: paths) {
++        if (!path.isEmpty()) {
++            addImportPath(QDir::cleanPath(path + QDir::separator() + qmldir));
++        }
++    }
++
+     // env import paths
+     if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QML2_IMPORT_PATH"))) {
+         const QString envImportPath = qEnvironmentVariable("QML2_IMPORT_PATH");
+diff --git a/tools/qmlcachegen/qmlcache.prf b/tools/qmlcachegen/qmlcache.prf
+index 330da358b..cdf570205 100644
+--- a/tools/qmlcachegen/qmlcache.prf
++++ b/tools/qmlcachegen/qmlcache.prf
+@@ -44,7 +44,7 @@ defineReplace(qmlCacheOutputFileName) {
+ }
+ 
+ qmlcacheinst.base = $$QMLCACHE_DESTDIR
+-qmlcacheinst.path = $$[QT_INSTALL_QML]/$$TARGETPATH
++qmlcacheinst.path = $$NIX_OUTPUT_QML/$$TARGETPATH
+ qmlcacheinst.CONFIG = no_check_exist
+ 
+ qmlcachegen.input = CACHEGEN_FILES
diff --git a/pkgs/development/libraries/qt-5/5.6/qtscript/0001-glib-2.32.patch b/pkgs/development/libraries/qt-5/5.10/qtscript.patch
index 887e107b6c1..5508dec1280 100644
--- a/pkgs/development/libraries/qt-5/5.6/qtscript/0001-glib-2.32.patch
+++ b/pkgs/development/libraries/qt-5/5.10/qtscript.patch
@@ -1,12 +1,3 @@
-From abd80356449bb36c8adcc5c9ca1df6b47715d265 Mon Sep 17 00:00:00 2001
-From: Thomas Tuegel <ttuegel@gmail.com>
-Date: Sun, 23 Aug 2015 09:13:34 -0500
-Subject: [PATCH] glib-2.32
-
----
- src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
 diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
 index 1f6d25e..087c3fb 100644
 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
@@ -20,6 +11,3 @@ index 1f6d25e..087c3fb 100644
  typedef struct _GCond GCond;
  #endif
  
--- 
-2.5.0
-
diff --git a/pkgs/development/libraries/qt-5/5.6/qtserialport/qtserialport-dlopen-udev.patch b/pkgs/development/libraries/qt-5/5.10/qtserialport.patch
index 65bb64710eb..f25524e80bc 100644
--- a/pkgs/development/libraries/qt-5/5.6/qtserialport/qtserialport-dlopen-udev.patch
+++ b/pkgs/development/libraries/qt-5/5.10/qtserialport.patch
@@ -1,8 +1,8 @@
-Index: qtserialport-opensource-src-5.8.0/src/serialport/qtudev_p.h
-===================================================================
---- qtserialport-opensource-src-5.8.0.orig/src/serialport/qtudev_p.h
-+++ qtserialport-opensource-src-5.8.0/src/serialport/qtudev_p.h
-@@ -111,9 +111,17 @@ inline QFunctionPointer resolveSymbol(QL
+diff --git a/src/serialport/qtudev_p.h b/src/serialport/qtudev_p.h
+index af2dab2..8e17f64 100644
+--- a/src/serialport/qtudev_p.h
++++ b/src/serialport/qtudev_p.h
+@@ -111,9 +111,17 @@ inline QFunctionPointer resolveSymbol(QLibrary *udevLibrary, const char *symbolN
  inline bool resolveSymbols(QLibrary *udevLibrary)
  {
      if (!udevLibrary->isLoaded()) {
diff --git a/pkgs/development/libraries/qt-5/5.10/qttools.patch b/pkgs/development/libraries/qt-5/5.10/qttools.patch
new file mode 100644
index 00000000000..fbba439ef7a
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/qttools.patch
@@ -0,0 +1,71 @@
+diff --git a/src/assistant/help/Qt5HelpConfigExtras.cmake.in b/src/assistant/help/Qt5HelpConfigExtras.cmake.in
+index 3b97923a..63336bd5 100644
+--- a/src/assistant/help/Qt5HelpConfigExtras.cmake.in
++++ b/src/assistant/help/Qt5HelpConfigExtras.cmake.in
+@@ -2,11 +2,10 @@
+ if (NOT TARGET Qt5::qcollectiongenerator)
+     add_executable(Qt5::qcollectiongenerator IMPORTED)
+ 
+-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5Help_install_prefix}/$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\")
+-!!ELSE
+     set(imported_location \"$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\")
+-!!ENDIF
++    if(NOT EXISTS \"${imported_location}\")
++        set(imported_location \"$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\")
++    endif()
+     _qt5_Help_check_file_exists(${imported_location})
+ 
+     set_target_properties(Qt5::qcollectiongenerator PROPERTIES
+@@ -17,11 +16,7 @@ endif()
+ if (NOT TARGET Qt5::qhelpgenerator)
+     add_executable(Qt5::qhelpgenerator IMPORTED)
+ 
+-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5Help_install_prefix}/$${CMAKE_BIN_DIR}qhelpgenerator$$CMAKE_BIN_SUFFIX\")
+-!!ELSE
+     set(imported_location \"$${CMAKE_BIN_DIR}qhelpgenerator$$CMAKE_BIN_SUFFIX\")
+-!!ENDIF
+     _qt5_Help_check_file_exists(${imported_location})
+ 
+     set_target_properties(Qt5::qhelpgenerator PROPERTIES
+diff --git a/src/linguist/Qt5LinguistToolsConfig.cmake.in b/src/linguist/Qt5LinguistToolsConfig.cmake.in
+index 4318b16f..d60db4ff 100644
+--- a/src/linguist/Qt5LinguistToolsConfig.cmake.in
++++ b/src/linguist/Qt5LinguistToolsConfig.cmake.in
+@@ -44,11 +44,7 @@ endmacro()
+ if (NOT TARGET Qt5::lrelease)
+     add_executable(Qt5::lrelease IMPORTED)
+ 
+-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5_linguisttools_install_prefix}/$${CMAKE_BIN_DIR}lrelease$$CMAKE_BIN_SUFFIX\")
+-!!ELSE
+     set(imported_location \"$${CMAKE_BIN_DIR}lrelease$$CMAKE_BIN_SUFFIX\")
+-!!ENDIF
+     _qt5_LinguistTools_check_file_exists(${imported_location})
+ 
+     set_target_properties(Qt5::lrelease PROPERTIES
+@@ -59,11 +55,7 @@ endif()
+ if (NOT TARGET Qt5::lupdate)
+     add_executable(Qt5::lupdate IMPORTED)
+ 
+-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5_linguisttools_install_prefix}/$${CMAKE_BIN_DIR}lupdate$$CMAKE_BIN_SUFFIX\")
+-!!ELSE
+     set(imported_location \"$${CMAKE_BIN_DIR}lupdate$$CMAKE_BIN_SUFFIX\")
+-!!ENDIF
+     _qt5_LinguistTools_check_file_exists(${imported_location})
+ 
+     set_target_properties(Qt5::lupdate PROPERTIES
+@@ -74,11 +66,7 @@ endif()
+ if (NOT TARGET Qt5::lconvert)
+     add_executable(Qt5::lconvert IMPORTED)
+ 
+-!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
+-    set(imported_location \"${_qt5_linguisttools_install_prefix}/$${CMAKE_BIN_DIR}lconvert$$CMAKE_BIN_SUFFIX\")
+-!!ELSE
+     set(imported_location \"$${CMAKE_BIN_DIR}lconvert$$CMAKE_BIN_SUFFIX\")
+-!!ENDIF
+     _qt5_LinguistTools_check_file_exists(${imported_location})
+ 
+     set_target_properties(Qt5::lconvert PROPERTIES
diff --git a/pkgs/development/libraries/qt-5/5.10/qtwebengine-paxmark-mksnapshot.patch b/pkgs/development/libraries/qt-5/5.10/qtwebengine-paxmark-mksnapshot.patch
new file mode 100644
index 00000000000..e1621b005c6
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/qtwebengine-paxmark-mksnapshot.patch
@@ -0,0 +1,48 @@
+diff --git a/src/3rdparty/chromium/v8/src/v8.gyp b/chromium/v8/src/v8.gyp
+index e7e19f5059..934448c7d8 100644
+--- a/src/3rdparty/chromium/v8/src/v8.gyp
++++ b/src/3rdparty/chromium/v8/src/v8.gyp
+@@ -35,6 +35,7 @@
+     'v8_extra_library_files%': [],
+     'v8_experimental_extra_library_files%': [],
+     'mksnapshot_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mksnapshot<(EXECUTABLE_SUFFIX)',
++    'mksnapshot_u_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mksnapshot_u<(EXECUTABLE_SUFFIX)',
+     'v8_os_page_size%': 0,
+   },
+   'includes': ['../gypfiles/toolchain.gypi', '../gypfiles/features.gypi', 'inspector/inspector.gypi'],
+@@ -2576,7 +2577,7 @@
+         ]
+     },
+     {
+-      'target_name': 'mksnapshot',
++      'target_name': 'mksnapshot_u',
+       'type': 'executable',
+       'dependencies': [
+         'v8_base',
+@@ -2606,5 +2607,26 @@
+         }],
+       ],
+     },
++    {
++      'target_name': 'mksnapshot',
++      'type': 'executable',
++      'dependencies': ['mksnapshot_u'],
++      'actions': [
++        {
++          'action_name': 'paxmark_m_mksnapshot',
++          'inputs': [
++            '<(mksnapshot_u_exec)',
++          ],
++          'outputs': [
++            '<(mksnapshot_exec)',
++          ],
++          'action': [
++            'sh',
++            '-c',
++            'cp <(mksnapshot_u_exec) <(mksnapshot_exec) && paxctl -czexm <(mksnapshot_exec)',
++          ],
++        },
++      ],
++    },
+   ],
+ }
diff --git a/pkgs/development/libraries/qt-5/5.10/qtwebkit.patch b/pkgs/development/libraries/qt-5/5.10/qtwebkit.patch
new file mode 100644
index 00000000000..c78cb58f564
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/qtwebkit.patch
@@ -0,0 +1,77 @@
+diff --git a/Source/WTF/WTF.pri b/Source/WTF/WTF.pri
+index 69e4cd1f3..3f729a75e 100644
+--- a/Source/WTF/WTF.pri
++++ b/Source/WTF/WTF.pri
+@@ -12,7 +12,7 @@ mac {
+     # Mac OS does ship libicu but not the associated header files.
+     # Therefore WebKit provides adequate header files.
+     INCLUDEPATH = $${ROOT_WEBKIT_DIR}/Source/WTF/icu $$INCLUDEPATH
+-    LIBS += -licucore
++    LIBS += /usr/lib/libicucore.dylib
+ } else:!use?(wchar_unicode): {
+     win32 {
+         CONFIG(static, static|shared) {
+diff --git a/Source/WebCore/plugins/qt/PluginPackageQt.cpp b/Source/WebCore/plugins/qt/PluginPackageQt.cpp
+index a923d49aa..46772a4bb 100644
+--- a/Source/WebCore/plugins/qt/PluginPackageQt.cpp
++++ b/Source/WebCore/plugins/qt/PluginPackageQt.cpp
+@@ -136,7 +136,11 @@ static void initializeGtk(QLibrary* module = 0)
+         }
+     }
+ 
++#ifdef NIXPKGS_LIBGTK2
++    QLibrary library(QLatin1String(NIXPKGS_LIBGTK2), 0);
++#else
+     QLibrary library(QLatin1String("libgtk-x11-2.0"), 0);
++#endif
+     if (library.load()) {
+         typedef void *(*gtk_init_check_ptr)(int*, char***);
+         gtk_init_check_ptr gtkInitCheck = (gtk_init_check_ptr)library.resolve("gtk_init_check");
+diff --git a/Source/WebCore/plugins/qt/PluginViewQt.cpp b/Source/WebCore/plugins/qt/PluginViewQt.cpp
+index de06a2fea..86fe39ef1 100644
+--- a/Source/WebCore/plugins/qt/PluginViewQt.cpp
++++ b/Source/WebCore/plugins/qt/PluginViewQt.cpp
+@@ -697,7 +697,11 @@ static Display *getPluginDisplay()
+     // support gdk based plugins (like flash) that use a different X connection.
+     // The code below has the same effect as this one:
+     // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default());
++#ifdef NIXPKGS_LIBGDK2
++    QLibrary library(QLatin1String(NIXPKGS_LIBGDK2), 0);
++#else
+     QLibrary library(QLatin1String("libgdk-x11-2.0"), 0);
++#endif
+     if (!library.load())
+         return 0;
+ 
+diff --git a/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp b/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
+index 8de65216b..38f5c05e5 100644
+--- a/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
++++ b/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
+@@ -53,7 +53,11 @@ static void messageHandler(QtMsgType type, const QMessageLogContext&, const QStr
+ 
+ static bool initializeGtk()
+ {
++#ifdef NIXPKGS_LIBGTK2
++    QLibrary gtkLibrary(QLatin1String(NIXPKGS_LIBGTK2), 0);
++#else
+     QLibrary gtkLibrary(QLatin1String("libgtk-x11-2.0"), 0);
++#endif
+     if (!gtkLibrary.load())
+         return false;
+     typedef void* (*gtk_init_ptr)(void*, void*);
+diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
+index d734ff684..0f6ff63d1 100644
+--- a/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
++++ b/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
+@@ -64,7 +64,11 @@ static Display* getPluginDisplay()
+     // The code below has the same effect as this one:
+     // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default());
+ 
++#ifdef NIXPKGS_LIBGDK2
++    QLibrary library(QLatin1String(NIXPKGS_LIBGDK2), 0);
++#else
+     QLibrary library(QLatin1String("libgdk-x11-2.0"), 0);
++#endif
+     if (!library.load())
+         return 0;
+ 
diff --git a/pkgs/development/libraries/qt-5/5.10/srcs.nix b/pkgs/development/libraries/qt-5/5.10/srcs.nix
new file mode 100644
index 00000000000..5369169aa67
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.10/srcs.nix
@@ -0,0 +1,341 @@
+# DO NOT EDIT! This file is generated automatically by fetch-kde-qt.sh
+{ fetchurl, mirror }:
+
+{
+  qt3d = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qt3d-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1arlplfpqdk0qki7bs1pp16y9cwa0awn071p551jg4y74xr7wi8j";
+      name = "qt3d-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtactiveqt = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtactiveqt-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0x6nbi5hlbr1pncbd8zzkwmqi04gcy64q3bjy5w45rg6zws41mzr";
+      name = "qtactiveqt-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtandroidextras = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtandroidextras-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1ifb49px86abaf4znmlis9wyyxq132nlgj3fyqppbx1sranikygk";
+      name = "qtandroidextras-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtbase = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtbase-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0qpp56cbw1sfz5ayhj2mskb07cl6jd1ijayg29y624qa6b6phmgx";
+      name = "qtbase-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtcanvas3d = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtcanvas3d-everywhere-src-5.10.0.tar.xz";
+      sha256 = "11r98mdxy833kcnywlsjrfaqhax7m3b6yhb56072qvr30rpn52fj";
+      name = "qtcanvas3d-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtcharts = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtcharts-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1vri3f7wyg84w6j84452g8h2p7sk7k01r0xszpn4klv7hi52rkhj";
+      name = "qtcharts-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtconnectivity = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtconnectivity-everywhere-src-5.10.0.tar.xz";
+      sha256 = "19k9n6gzrbg0sbgyhhcl5gv0d4b2gjwmz5966gn6b424fblf4grf";
+      name = "qtconnectivity-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtdatavis3d = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtdatavis3d-everywhere-src-5.10.0.tar.xz";
+      sha256 = "06363x449k7wkqrd7c0y6b5vqlpwssnkl0g5s1bhp8lkl3bw81lj";
+      name = "qtdatavis3d-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtdeclarative = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtdeclarative-everywhere-src-5.10.0.tar.xz";
+      sha256 = "07kicxzbwiqwkg1x2k6447rwzvzn31cv1yyggc1m8r84lny4vjsw";
+      name = "qtdeclarative-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtdoc = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtdoc-everywhere-src-5.10.0.tar.xz";
+      sha256 = "01z4ikqrnnx9mzf5pvk4i2lqks4xai32fs9qqbqnsp0qrrcb1jfn";
+      name = "qtdoc-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtgamepad = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtgamepad-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1rl77rsfgs69cdv75nfjp9w66mndwi211wix5cwl46d7i3wm0xak";
+      name = "qtgamepad-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtgraphicaleffects = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtgraphicaleffects-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0c2y0ixxncn5xslpxciigq1gfaxd3n7wkcf14k4iy5i15w8nkfcp";
+      name = "qtgraphicaleffects-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtimageformats = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtimageformats-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1z7lnw85apzf6ph3dgnbb6py17qzpgww92kz31n6vbv5z62bigwi";
+      name = "qtimageformats-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtlocation = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtlocation-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1iw5m9v5p6l6mivjvj7g1macpqf2n21mg4wg0hza36dwrz3wwkfq";
+      name = "qtlocation-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtmacextras = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtmacextras-everywhere-src-5.10.0.tar.xz";
+      sha256 = "08n8na36j9c15hvicqfs7h915m2av5xd5v0azf7660z0q9lk9zb3";
+      name = "qtmacextras-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtmultimedia = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtmultimedia-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0vw0i5jgn4q63g5ijwwrb6835qdaxcw7sfcjffbqfbdwqgyk70q0";
+      name = "qtmultimedia-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtnetworkauth = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtnetworkauth-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1lnqi1qpy9j5pi2lcmdihf81lspxv6hgdg5jmbqqdqxwzblgpnpc";
+      name = "qtnetworkauth-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtpurchasing = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtpurchasing-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0mkxslc8qc6sclpngllby3bb86qq5csrsz0xrc14nwmbkhwksxwc";
+      name = "qtpurchasing-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtquickcontrols = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtquickcontrols-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0ab19raip9828br21qqaglr4y0kqmxix882r13sfxlnm4ivyycx1";
+      name = "qtquickcontrols-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtquickcontrols2 = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtquickcontrols2-everywhere-src-5.10.0.tar.xz";
+      sha256 = "18d1b5aivaqgs1px61glkyclkky60xd7yzy1vwa1f89sg8j711w1";
+      name = "qtquickcontrols2-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtremoteobjects = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtremoteobjects-everywhere-src-5.10.0.tar.xz";
+      sha256 = "01bf1ykqxb4d8wz58vxy15yj4jsaqhi258k05dhy7ygdvfgscdnz";
+      name = "qtremoteobjects-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtscript = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtscript-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1z6a14x9yj0p2znc0vny8y4zkdvm5fp42rnisnf9rynakkqg5wkc";
+      name = "qtscript-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtscxml = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtscxml-everywhere-src-5.10.0.tar.xz";
+      sha256 = "142qysd5s706r62gap62s89xm7334i1ys29dqsp09av9n7b1kfsb";
+      name = "qtscxml-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtsensors = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtsensors-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0w9rzqc0hva4521i5j298lrsvys3jqddmqd80cxj9nsvnapwb66d";
+      name = "qtsensors-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtserialbus = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtserialbus-everywhere-src-5.10.0.tar.xz";
+      sha256 = "06rr0191zy5yxqzxiv0c6dvshncjg8kdc33lszk41pajv624fn9z";
+      name = "qtserialbus-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtserialport = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtserialport-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0mqlhdp20jl6agv58mszznsikmi1dflhalkpfbgpiafjzzczx075";
+      name = "qtserialport-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtspeech = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtspeech-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1hashidb33f1215f0azjby1lh8iw7v2bvxp08mqvdk02jld9w5br";
+      name = "qtspeech-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtsvg = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtsvg-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1c77wnpzjz4wwic5if876y5v1n44v2g2nhjmcs25cc8awz5afaja";
+      name = "qtsvg-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qttools = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qttools-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0cpybii2yznk6gwaa2cz83rk3cpzzm6l4wvn4n2xwdbrgdsdrx8z";
+      name = "qttools-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qttranslations = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qttranslations-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1gmrisf08nsrni7fyjlz5ggfgfzzkjpq3g7l2hc6vq5g04vbskgc";
+      name = "qttranslations-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtvirtualkeyboard = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtvirtualkeyboard-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0mqb9sgvq7djd2lz4q4p6p9f0c23cfhk447zx4axvv1mldjxsb9c";
+      name = "qtvirtualkeyboard-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtwayland = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtwayland-everywhere-src-5.10.0.tar.xz";
+      sha256 = "14sb0227rzqzf5z8dz8b9nzkk5rwq6hrfxifz603iy4mdijzjmsn";
+      name = "qtwayland-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtwebchannel = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtwebchannel-everywhere-src-5.10.0.tar.xz";
+      sha256 = "18rml5xyb9chz8wrfamsgx4z32kkjbk1rc47ynvhn49mcbf2897j";
+      name = "qtwebchannel-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtwebengine = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtwebengine-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1yb7jpydxg0dwdrx0iv7i5dq4wb9ld1iff8zpjdj8yl4xy4mkgx8";
+      name = "qtwebengine-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtwebglplugin = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtwebglplugin-everywhere-src-5.10.0.tar.xz";
+      sha256 = "0hgwb5lll3275knnj3ms04y1n0i6gph9kac2246ixmcq8sc7a2k7";
+      name = "qtwebglplugin-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtwebsockets = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtwebsockets-everywhere-src-5.10.0.tar.xz";
+      sha256 = "00wlyhw7h2axyhinksfm912jfa3n73szxdccz5dlir8742i0zaqp";
+      name = "qtwebsockets-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtwebview = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtwebview-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1955fkc7a22d7a0y2n7kz7r1md56v2s5qvyb3h68szs60zjnk3xa";
+      name = "qtwebview-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtwinextras = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtwinextras-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1mx5qihmh3awqcr9k3z2chxz8273bi5ha90v7f4fqr2vk3g6w4yd";
+      name = "qtwinextras-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtx11extras = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtx11extras-everywhere-src-5.10.0.tar.xz";
+      sha256 = "11jp0a40jqwcdq7isyip4f4mq2d58c9fx1kvg9g71m92n52ffyfb";
+      name = "qtx11extras-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtxmlpatterns = {
+    version = "5.10.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.10/5.10.0/submodules/qtxmlpatterns-everywhere-src-5.10.0.tar.xz";
+      sha256 = "1hq3sbimbhaiw570d2cd84jhki0n2jw2x2s7iq92m53y4akbr2mh";
+      name = "qtxmlpatterns-everywhere-src-5.10.0.tar.xz";
+    };
+  };
+  qtwebkit = {
+    version = "5.9.1";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtwebkit-opensource-src-5.9.1.tar.xz";
+      sha256 = "1ksjn1vjbfhdm4y4rg08ag4krk87ahp7qcdcpwll42l0rnz61998";
+      name = "qtwebkit-opensource-src-5.9.1.tar.xz";
+    };
+  };
+  qtwebkit-examples = {
+    version = "5.9.1";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtwebkit-examples-opensource-src-5.9.1.tar.xz";
+      sha256 = "1l2l7ycgqql6rf4gx6sjhsqjapdhvy6vxaxssax3l938nkk4vkp4";
+      name = "qtwebkit-examples-opensource-src-5.9.1.tar.xz";
+    };
+  };
+}
diff --git a/pkgs/development/libraries/qt-5/5.6/default.nix b/pkgs/development/libraries/qt-5/5.6/default.nix
index 8b01ce2749c..1200884a30c 100644
--- a/pkgs/development/libraries/qt-5/5.6/default.nix
+++ b/pkgs/development/libraries/qt-5/5.6/default.nix
@@ -33,7 +33,7 @@ existing packages here and modify it as necessary.
   # options
   developerBuild ? false,
   decryptSslTraffic ? false,
-  debug ? null,
+  debug ? false,
 }:
 
 with stdenv.lib;
@@ -51,8 +51,7 @@ let
     qtscript = [ ./qtscript.patch ];
     qtserialport = [ ./qtserialport.patch ];
     qttools = [ ./qttools.patch ];
-    qtwebengine =
-      [ ./qtwebengine.patch ]
+    qtwebengine = [ ./qtwebengine-seccomp.patch ]
       ++ optional stdenv.needsPax ./qtwebengine-paxmark-mksnapshot.patch;
     qtwebkit = [ ./qtwebkit.patch ];
   };
diff --git a/pkgs/development/libraries/qt-5/5.6/fetch.sh b/pkgs/development/libraries/qt-5/5.6/fetch.sh
index 3aa539cda03..ee3a5ddf8de 100644
--- a/pkgs/development/libraries/qt-5/5.6/fetch.sh
+++ b/pkgs/development/libraries/qt-5/5.6/fetch.sh
@@ -1,3 +1,3 @@
-WGET_ARGS=( http://download.qt.io/official_releases/qt/5.6/5.6.2/submodules/ \
-            http://download.qt.io/community_releases/5.6/5.6.2/ \
+WGET_ARGS=( http://download.qt.io/official_releases/qt/5.6/5.6.3/submodules/ \
+            http://download.qt.io/community_releases/5.6/5.6.3/ \
             -A '*.tar.xz' )
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase.patch b/pkgs/development/libraries/qt-5/5.6/qtbase.patch
index 0e21a17665b..d8322cbc199 100644
--- a/pkgs/development/libraries/qt-5/5.6/qtbase.patch
+++ b/pkgs/development/libraries/qt-5/5.6/qtbase.patch
@@ -1,5 +1,5 @@
 diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
-index 11fb52a0b1..a4cca1fdcb 100644
+index 11fb52a0b1..614fdbb046 100644
 --- a/mkspecs/features/create_cmake.prf
 +++ b/mkspecs/features/create_cmake.prf
 @@ -21,7 +21,7 @@ load(cmake_functions)
@@ -35,7 +35,7 @@ index 11fb52a0b1..a4cca1fdcb 100644
 -    # installed in $${CMAKE_LIB_DIR}/cmake/Qt5$${CMAKE_MODULE_NAME}
 -    CMAKE_RELATIVE_INSTALL_DIR = "$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}../../"
 -}
-+CMAKE_LIB_DIR = $$NIX_OUTPUT_DEV/lib/
++CMAKE_LIB_DIR = $$NIX_OUTPUT_OUT/lib/
 +CMAKE_LIB_DIR_IS_ABSOLUTE = True
  
 -CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
@@ -64,7 +64,7 @@ index 11fb52a0b1..a4cca1fdcb 100644
 -    CMAKE_DLL_DIR = $$CMAKE_LIB_DIR
 -    CMAKE_DLL_DIR_IS_ABSOLUTE = $$CMAKE_LIB_DIR_IS_ABSOLUTE
 -}
-+CMAKE_DLL_DIR = $$NIX_OUTPUT_DEV/lib/
++CMAKE_DLL_DIR = $$NIX_OUTPUT_OUT/lib/
 +CMAKE_DLL_DIR_IS_ABSOLUTE = True
  
  static|staticlib:CMAKE_STATIC_TYPE = true
@@ -248,7 +248,7 @@ index d2358cae4b..61d8cc0471 100644
          set_target_properties(Qt5::${Plugin} PROPERTIES
              \"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
 diff --git a/mkspecs/features/qml_module.prf b/mkspecs/features/qml_module.prf
-index b09d42a0a4..f076265bdd 100644
+index 47ebe78400..25aa2b93e7 100644
 --- a/mkspecs/features/qml_module.prf
 +++ b/mkspecs/features/qml_module.prf
 @@ -17,10 +17,7 @@ fq_qml_files = $$_PRO_FILE_PWD_/qmldir
@@ -310,7 +310,7 @@ index 1848f00e90..2af93675c5 100644
 +    MODULE_QMAKE_OUTDIR = $$NIX_OUTPUT_OUT
  }
 diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
-index c1809468af..0a12ec24db 100644
+index 08b3f3e5af..5ffeafd9d8 100644
 --- a/mkspecs/features/qt_common.prf
 +++ b/mkspecs/features/qt_common.prf
 @@ -30,8 +30,8 @@ contains(TEMPLATE, .*lib) {
@@ -377,7 +377,7 @@ index 4c68cfd72f..f422f18266 100644
  
      check_examples {
 diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
-index 4a1d265a8b..abe0da95f6 100644
+index 4a1d265a8b..d346424b5b 100644
 --- a/mkspecs/features/qt_functions.prf
 +++ b/mkspecs/features/qt_functions.prf
 @@ -70,7 +70,7 @@ defineTest(qtHaveModule) {
@@ -385,7 +385,7 @@ index 4a1d265a8b..abe0da95f6 100644
      cmd = $$eval(QT_TOOL.$${2}.binary)
      isEmpty(cmd) {
 -        cmd = $$[QT_HOST_BINS]/$$2
-+        cmd = $$system("type -p $$2")
++        cmd = $$system("command -v $$2")
          exists($${cmd}.pl) {
              cmd = perl -w $$system_path($${cmd}.pl)
          } else: contains(QMAKE_HOST.os, Windows) {
@@ -539,7 +539,7 @@ index 706304cf34..546420f6ad 100644
  set(_qt5_corelib_extra_includes \"$${CMAKE_INSTALL_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
  !!ENDIF
 diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
-index f5b15207cc..f85e0524bb 100644
+index bd3c12ce97..a796775970 100644
 --- a/src/corelib/kernel/qcoreapplication.cpp
 +++ b/src/corelib/kernel/qcoreapplication.cpp
 @@ -2533,6 +2533,15 @@ QStringList QCoreApplication::libraryPaths()
@@ -628,7 +628,7 @@ index 1d947159e2..b36865fc48 100644
  
      set_target_properties(Qt5::qdbusxml2cpp PROPERTIES
 diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
-index 07869efd7d..37b95d1b6b 100644
+index 07869efd7d..fb4183bada 100644
 --- a/src/gui/Qt5GuiConfigExtras.cmake.in
 +++ b/src/gui/Qt5GuiConfigExtras.cmake.in
 @@ -2,7 +2,7 @@
@@ -652,7 +652,7 @@ index 07869efd7d..37b95d1b6b 100644
  
  !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
 -    set(imported_implib \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
-+    set(imported_implib \"$$NIX_OUTPUT_DEV/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
++    set(imported_implib \"$$NIX_OUTPUT_OUT/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
  !!ELSE
      set(imported_implib \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
  !!ENDIF
@@ -705,7 +705,7 @@ index 68caaeb6dc..fef4a81474 100644
              // specific curves requested, but not possible to set -> error
              sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocket::tr("OpenSSL version too old, need at least v1.0.2"));
 diff --git a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
-index 44f1d7e6ba..e24fe54326 100644
+index 338c7ca3be..dd52114bac 100644
 --- a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
 +++ b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
 @@ -251,12 +251,9 @@ void TableGenerator::initPossibleLocations()
@@ -723,7 +723,7 @@ index 44f1d7e6ba..e24fe54326 100644
  
  QString TableGenerator::findComposeFile()
 diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
-index 9bdedcc830..2559b2066b 100644
+index c2b7a562a9..4fa5f6d6a5 100644
 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
 +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
 @@ -570,7 +570,14 @@ void (*QGLXContext::getProcAddress(const QByteArray &procName)) ()
@@ -742,7 +742,7 @@ index 9bdedcc830..2559b2066b 100644
  #endif
              }
 diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
-index b321ed95dc..9e7a72521c 100644
+index 4646ced954..ff3111f393 100644
 --- a/src/plugins/platforms/xcb/qxcbcursor.cpp
 +++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
 @@ -303,10 +303,10 @@ QXcbCursor::QXcbCursor(QXcbConnection *conn, QXcbScreen *screen)
@@ -758,6 +758,28 @@ index b321ed95dc..9e7a72521c 100644
              xcursorFound = xcursorLib.load();
          }
          if (xcursorFound) {
+diff --git a/src/testlib/qtestassert.h b/src/testlib/qtestassert.h
+index ca3e02ca06..28dd73d772 100644
+--- a/src/testlib/qtestassert.h
++++ b/src/testlib/qtestassert.h
+@@ -38,10 +38,13 @@
+ 
+ QT_BEGIN_NAMESPACE
+ 
+-
+-#define QTEST_ASSERT(cond) do { if (!(cond)) qt_assert(#cond,__FILE__,__LINE__); } while (0)
+-
+-#define QTEST_ASSERT_X(cond, where, what) do { if (!(cond)) qt_assert_x(where, what,__FILE__,__LINE__); } while (0)
++#if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
++#define QTEST_ASSERT(cond) do { } while ((false) && (cond))
++#define QTEST_ASSERT_X(cond, where, what) do { } while ((false) && (cond))
++#else
++#define QTEST_ASSERT(cond) do { if (!(cond)) qt_assert(#cond,__FILE__,__LINE__); } while (false)
++#define QTEST_ASSERT_X(cond, where, what) do { if (!(cond)) qt_assert_x(where, what,__FILE__,__LINE__); } while (false)
++#endif
+ 
+ QT_END_NAMESPACE
+ 
 diff --git a/src/widgets/Qt5WidgetsConfigExtras.cmake.in b/src/widgets/Qt5WidgetsConfigExtras.cmake.in
 index 99d87e2e46..a4eab2aa72 100644
 --- a/src/widgets/Qt5WidgetsConfigExtras.cmake.in
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/cmake-paths-darwin.patch b/pkgs/development/libraries/qt-5/5.6/qtbase/cmake-paths-darwin.patch
deleted file mode 100644
index 9d42314e4cc..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/cmake-paths-darwin.patch
+++ /dev/null
@@ -1,384 +0,0 @@
-Index: qtbase-opensource-src-5.6.1/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
-+++ qtbase-opensource-src-5.6.1/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
-@@ -9,30 +9,6 @@ if (CMAKE_VERSION VERSION_LESS 3.0.0)
- endif()
- !!ENDIF
- 
--!!IF !isEmpty(CMAKE_USR_MOVE_WORKAROUND)
--!!IF !isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")
--!!ELSE
--get_filename_component(_IMPORT_PREFIX \"${CMAKE_CURRENT_LIST_FILE}\" PATH)
--# Use original install prefix when loaded through a
--# cross-prefix symbolic link such as /lib -> /usr/lib.
--get_filename_component(_realCurr \"${_IMPORT_PREFIX}\" REALPATH)
--get_filename_component(_realOrig \"$$CMAKE_INSTALL_LIBS_DIR/cmake/Qt5$${CMAKE_MODULE_NAME}\" REALPATH)
--if(_realCurr STREQUAL _realOrig)
--    get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$CMAKE_INSTALL_LIBS_DIR/$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}\" ABSOLUTE)
--else()
--    get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
--endif()
--unset(_realOrig)
--unset(_realCurr)
--unset(_IMPORT_PREFIX)
--!!ENDIF
--!!ELIF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
--!!ELSE
--set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")
--!!ENDIF
--
- !!IF !equals(TEMPLATE, aux)
- # For backwards compatibility only. Use Qt5$${CMAKE_MODULE_NAME}_VERSION instead.
- set(Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING "$$eval(QT.$${MODULE}.MAJOR_VERSION).$$eval(QT.$${MODULE}.MINOR_VERSION).$$eval(QT.$${MODULE}.PATCH_VERSION)")
-@@ -59,7 +35,10 @@ macro(_populate_$${CMAKE_MODULE_NAME}_ta
-     set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
- 
- !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
-+    set(imported_location \"@NIX_OUT@/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
-+    if(NOT EXISTS \"${imported_location}\")
-+        set(imported_location \"@NIX_DEV@/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
-+    endif()
- !!ELSE
-     set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
- !!ENDIF
-@@ -74,45 +53,17 @@ macro(_populate_$${CMAKE_MODULE_NAME}_ta
-         \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\"
-     )
- 
--!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
--!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--    set(imported_implib \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
--!!ELSE
--    set(imported_implib \"IMPORTED_IMPLIB_${Configuration}\" \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
--!!ENDIF
--    _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_implib})
--    if(NOT \"${IMPLIB_LOCATION}\" STREQUAL \"\")
--        set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
--        \"IMPORTED_IMPLIB_${Configuration}\" ${imported_implib}
--        )
--    endif()
--!!ENDIF
- endmacro()
- !!ENDIF
- 
- if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
- 
- !!IF !no_module_headers
--!!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
--    set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS
--      \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework\"
--      \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Headers\"
--    )
--!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
--    set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
--        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/\"
--        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\"
--    )
--!!ELSE
--    set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
--!!ENDIF
--!!ELSE
- !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
--    set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}\")
-+    set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"@NIX_OUT@/lib\" \"@NIX_OUT@/lib/$${MODULE_INCNAME}.framework/Headers\")
- !!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
-     set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
--        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION\"
--        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION/$${MODULE_INCNAME}\"
-+        \"\"
-     )
- !!ELSE
-     set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
-@@ -128,7 +80,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME
-     set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
- !!ENDIF
- !!ENDIF
--!!ENDIF
-+
- !!IF !isEmpty(CMAKE_ADD_SOURCE_INCLUDE_DIRS)
-     include(\"${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake\" OPTIONAL)
- !!ENDIF
-@@ -253,28 +205,19 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME
- 
- !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
- !!IF isEmpty(CMAKE_DEBUG_TYPE)
--!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
--!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--    if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
--!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
--    if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
--!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
--        _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" )
--!!ELSE // CMAKE_STATIC_WINDOWS_BUILD
-     if (EXISTS
- !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
--        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
-+        \"@NIX_OUT@/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
- !!ELSE
-         \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
- !!ENDIF
-       AND EXISTS
- !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
-+        \"@NIX_DEV@/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
- !!ELSE
-         \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
- !!ENDIF
-         _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
--!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
-     endif()
- !!ENDIF // CMAKE_DEBUG_TYPE
- !!ENDIF // CMAKE_FIND_OTHER_LIBRARY_BUILD
-@@ -282,36 +225,23 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME
- !!ENDIF // CMAKE_RELEASE_TYPE
- 
- !!IF !isEmpty(CMAKE_DEBUG_TYPE)
--!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
--    _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" )
--!!ELSE
-     _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
--!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
- 
- !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
- !!IF isEmpty(CMAKE_RELEASE_TYPE)
--!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
--!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--    if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
--!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
--    if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
--!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
--        _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" )
--!!ELSE // CMAKE_STATIC_WINDOWS_BUILD
-     if (EXISTS
- !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
--        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
-+        \"@NIX_OUT@/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
- !!ELSE
-         \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
- !!ENDIF
-       AND EXISTS
- !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
-+        \"@NIX_DEV@/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
- !!ELSE
-         \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
- !!ENDIF
-         _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
--!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
-     endif()
- !!ENDIF // CMAKE_RELEASE_TYPE
- !!ENDIF // CMAKE_FIND_OTHER_LIBRARY_BUILD
-@@ -328,11 +258,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME
-     macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION)
-         set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
- 
--!!IF isEmpty(CMAKE_PLUGIN_DIR_IS_ABSOLUTE)
--        set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
--!!ELSE
--        set(imported_location \"$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
--!!ENDIF
-+        set(imported_location \"${PLUGIN_LOCATION}\")
-         _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
-         set_target_properties(Qt5::${Plugin} PROPERTIES
-             \"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
-Index: qtbase-opensource-src-5.6.1/src/gui/Qt5GuiConfigExtras.cmake.in
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/src/gui/Qt5GuiConfigExtras.cmake.in
-+++ qtbase-opensource-src-5.6.1/src/gui/Qt5GuiConfigExtras.cmake.in
-@@ -2,7 +2,7 @@
- !!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE)
- 
- !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
--set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR/QtANGLE\")
-+set(Qt5Gui_EGL_INCLUDE_DIRS \"@NIX_DEV@/$$CMAKE_INCLUDE_DIR/QtANGLE\")
- !!ELSE
- set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR/QtANGLE\")
- !!ENDIF
-@@ -17,13 +17,13 @@ macro(_populate_qt5gui_gl_target_propert
-     set_property(TARGET Qt5::${TargetName} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
- 
- !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5Gui_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
-+    set(imported_location \"@NIX_OUT@/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
- !!ELSE
-     set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
- !!ENDIF
- 
- !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--    set(imported_implib \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
-+    set(imported_implib \"@NIX_DEV@/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
- !!ELSE
-     set(imported_implib \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
- !!ENDIF
-Index: qtbase-opensource-src-5.6.1/src/widgets/Qt5WidgetsConfigExtras.cmake.in
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/src/widgets/Qt5WidgetsConfigExtras.cmake.in
-+++ qtbase-opensource-src-5.6.1/src/widgets/Qt5WidgetsConfigExtras.cmake.in
-@@ -3,7 +3,7 @@ if (NOT TARGET Qt5::uic)
-     add_executable(Qt5::uic IMPORTED)
- 
- !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5Widgets_install_prefix}/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
-+    set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
- !!ELSE
-     set(imported_location \"$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
- !!ENDIF
-Index: qtbase-opensource-src-5.6.1/src/corelib/Qt5CoreConfigExtras.cmake.in
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/src/corelib/Qt5CoreConfigExtras.cmake.in
-+++ qtbase-opensource-src-5.6.1/src/corelib/Qt5CoreConfigExtras.cmake.in
-@@ -3,7 +3,7 @@ if (NOT TARGET Qt5::qmake)
-     add_executable(Qt5::qmake IMPORTED)
- 
- !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
-+    set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
- !!ELSE
-     set(imported_location \"$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
- !!ENDIF
-@@ -18,7 +18,7 @@ if (NOT TARGET Qt5::moc)
-     add_executable(Qt5::moc IMPORTED)
- 
- !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
-+    set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
- !!ELSE
-     set(imported_location \"$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
- !!ENDIF
-@@ -35,7 +35,7 @@ if (NOT TARGET Qt5::rcc)
-     add_executable(Qt5::rcc IMPORTED)
- 
- !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
-+    set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
- !!ELSE
-     set(imported_location \"$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
- !!ENDIF
-@@ -131,7 +131,7 @@ if (NOT TARGET Qt5::WinMain)
- !!IF !isEmpty(CMAKE_RELEASE_TYPE)
-     set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
- !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
-+    set(imported_location \"@NIX_DEV@/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
- !!ELSE
-     set(imported_location \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
- !!ENDIF
-@@ -145,7 +145,7 @@ if (NOT TARGET Qt5::WinMain)
-     set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
- 
- !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\")
-+    set(imported_location \"@NIX_DEV@/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\")
- !!ELSE
-     set(imported_location \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\")
- !!ENDIF
-Index: qtbase-opensource-src-5.6.1/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
-+++ qtbase-opensource-src-5.6.1/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
-@@ -1,6 +1,6 @@
- 
- !!IF isEmpty(CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE)
--set(_qt5_corelib_extra_includes \"${_qt5Core_install_prefix}/$${CMAKE_INSTALL_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
-+set(_qt5_corelib_extra_includes \"@NIX_DEV@/$${CMAKE_INSTALL_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
- !!ELSE
- set(_qt5_corelib_extra_includes \"$${CMAKE_INSTALL_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
- !!ENDIF
-Index: qtbase-opensource-src-5.6.1/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
-+++ qtbase-opensource-src-5.6.1/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
-@@ -1,6 +1,6 @@
- 
- !!IF isEmpty(CMAKE_HOST_DATA_DIR_IS_ABSOLUTE)
--set(_qt5_corelib_extra_includes \"${_qt5Core_install_prefix}/$${CMAKE_HOST_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
-+set(_qt5_corelib_extra_includes \"@NIX_DEV@/$${CMAKE_HOST_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
- !!ELSE
- set(_qt5_corelib_extra_includes \"$${CMAKE_HOST_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
- !!ENDIF
-Index: qtbase-opensource-src-5.6.1/src/dbus/Qt5DBusConfigExtras.cmake.in
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/src/dbus/Qt5DBusConfigExtras.cmake.in
-+++ qtbase-opensource-src-5.6.1/src/dbus/Qt5DBusConfigExtras.cmake.in
-@@ -3,7 +3,7 @@ if (NOT TARGET Qt5::qdbuscpp2xml)
-     add_executable(Qt5::qdbuscpp2xml IMPORTED)
- 
- !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
-+    set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
- !!ELSE
-     set(imported_location \"$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
- !!ENDIF
-@@ -18,7 +18,7 @@ if (NOT TARGET Qt5::qdbusxml2cpp)
-     add_executable(Qt5::qdbusxml2cpp IMPORTED)
- 
- !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
-+    set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
- !!ELSE
-     set(imported_location \"$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
- !!ENDIF
-Index: qtbase-opensource-src-5.6.1/mkspecs/features/create_cmake.prf
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/mkspecs/features/create_cmake.prf
-+++ qtbase-opensource-src-5.6.1/mkspecs/features/create_cmake.prf
-@@ -136,28 +136,28 @@ contains(CONFIG, plugin) {
- 
-     win32 {
-         isEmpty(CMAKE_STATIC_TYPE) {
--            CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${TARGET}.dll
--            CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${TARGET}d.dll
-+            CMAKE_PLUGIN_LOCATION_RELEASE = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/$${TARGET}.dll
-+            CMAKE_PLUGIN_LOCATION_DEBUG = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/$${TARGET}d.dll
-         } else:mingw {
--            CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${TARGET}.a
--            CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${TARGET}d.a
-+            CMAKE_PLUGIN_LOCATION_RELEASE = $${CMAKE_PLUGIN_DIR}/$$PLUGIN_TYPE/lib$${TARGET}.a
-+            CMAKE_PLUGIN_LOCATION_DEBUG = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/lib$${TARGET}d.a
-         } else {                         # MSVC static
--            CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${TARGET}.lib
--            CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${TARGET}d.lib
-+            CMAKE_PLUGIN_LOCATION_RELEASE = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/$${TARGET}.lib
-+            CMAKE_PLUGIN_LOCATION_DEBUG = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/$${TARGET}d.lib
-         }
-     } else {
-         mac {
-             isEmpty(CMAKE_STATIC_TYPE): CMAKE_PlUGIN_EXT = .dylib
-             else: CMAKE_PlUGIN_EXT = .a
- 
--            CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
--            CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
-+            CMAKE_PLUGIN_LOCATION_RELEASE = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
-+            CMAKE_PLUGIN_LOCATION_DEBUG = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
-         } else {
-             isEmpty(CMAKE_STATIC_TYPE): CMAKE_PlUGIN_EXT = .so
-             else: CMAKE_PlUGIN_EXT = .a
- 
--            CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
--            CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
-+            CMAKE_PLUGIN_LOCATION_RELEASE = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
-+            CMAKE_PLUGIN_LOCATION_DEBUG = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
-         }
-     }
-     cmake_target_file.input = $$PWD/data/cmake/Qt5PluginTarget.cmake.in
-Index: qtbase-opensource-src-5.6.1/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
-+++ qtbase-opensource-src-5.6.1/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
-@@ -2,10 +2,10 @@
- add_library(Qt5::$$CMAKE_PLUGIN_NAME MODULE IMPORTED)
- 
- !!IF !isEmpty(CMAKE_RELEASE_TYPE)
--_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\")
-+_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"@NIX_OUT@/$${CMAKE_PLUGIN_LOCATION_RELEASE}\")
- !!ENDIF
- !!IF !isEmpty(CMAKE_DEBUG_TYPE)
--_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\")
-+_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"@NIX_OUT@/$${CMAKE_PLUGIN_LOCATION_DEBUG}\")
- !!ENDIF
- 
- list(APPEND Qt5$${CMAKE_MODULE_NAME}_PLUGINS Qt5::$$CMAKE_PLUGIN_NAME)
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/cmake-paths.patch b/pkgs/development/libraries/qt-5/5.6/qtbase/cmake-paths.patch
deleted file mode 100644
index ca8a4266375..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/cmake-paths.patch
+++ /dev/null
@@ -1,385 +0,0 @@
-Index: qtbase-opensource-src-5.6.1/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
-+++ qtbase-opensource-src-5.6.1/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
-@@ -9,30 +9,6 @@ if (CMAKE_VERSION VERSION_LESS 3.0.0)
- endif()
- !!ENDIF
- 
--!!IF !isEmpty(CMAKE_USR_MOVE_WORKAROUND)
--!!IF !isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")
--!!ELSE
--get_filename_component(_IMPORT_PREFIX \"${CMAKE_CURRENT_LIST_FILE}\" PATH)
--# Use original install prefix when loaded through a
--# cross-prefix symbolic link such as /lib -> /usr/lib.
--get_filename_component(_realCurr \"${_IMPORT_PREFIX}\" REALPATH)
--get_filename_component(_realOrig \"$$CMAKE_INSTALL_LIBS_DIR/cmake/Qt5$${CMAKE_MODULE_NAME}\" REALPATH)
--if(_realCurr STREQUAL _realOrig)
--    get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$CMAKE_INSTALL_LIBS_DIR/$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}\" ABSOLUTE)
--else()
--    get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
--endif()
--unset(_realOrig)
--unset(_realCurr)
--unset(_IMPORT_PREFIX)
--!!ENDIF
--!!ELIF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
--!!ELSE
--set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")
--!!ENDIF
--
- !!IF !equals(TEMPLATE, aux)
- # For backwards compatibility only. Use Qt5$${CMAKE_MODULE_NAME}_VERSION instead.
- set(Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING "$$eval(QT.$${MODULE}.MAJOR_VERSION).$$eval(QT.$${MODULE}.MINOR_VERSION).$$eval(QT.$${MODULE}.PATCH_VERSION)")
-@@ -59,7 +35,10 @@ macro(_populate_$${CMAKE_MODULE_NAME}_ta
-     set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
- 
- !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
-+    set(imported_location \"@NIX_OUT@/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
-+    if(NOT EXISTS \"${imported_location}\")
-+        set(imported_location \"@NIX_DEV@/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
-+    endif()
- !!ELSE
-     set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
- !!ENDIF
-@@ -74,45 +53,18 @@ macro(_populate_$${CMAKE_MODULE_NAME}_ta
-         \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\"
-     )
- 
--!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
--!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--    set(imported_implib \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
--!!ELSE
--    set(imported_implib \"IMPORTED_IMPLIB_${Configuration}\" \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
--!!ENDIF
--    _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_implib})
--    if(NOT \"${IMPLIB_LOCATION}\" STREQUAL \"\")
--        set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
--        \"IMPORTED_IMPLIB_${Configuration}\" ${imported_implib}
--        )
--    endif()
--!!ENDIF
- endmacro()
- !!ENDIF
- 
- if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
- 
- !!IF !no_module_headers
--!!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
--    set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS
--      \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework\"
--      \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Headers\"
--    )
--!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
--    set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
--        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/\"
--        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\"
--    )
--!!ELSE
--    set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
--!!ENDIF
--!!ELSE
- !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
--    set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}\")
-+    set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"@NIX_DEV@/$$CMAKE_INCLUDE_DIR\" \"@NIX_DEV@/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}\")
- !!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
-     set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
--        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION\"
--        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION/$${MODULE_INCNAME}\"
-+        \"@NIX_DEV@/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION\"
-+        \"@NIX_DEV@/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION/$${MODULE_INCNAME}\"
-     )
- !!ELSE
-     set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
-@@ -128,7 +80,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME
-     set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
- !!ENDIF
- !!ENDIF
--!!ENDIF
-+
- !!IF !isEmpty(CMAKE_ADD_SOURCE_INCLUDE_DIRS)
-     include(\"${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake\" OPTIONAL)
- !!ENDIF
-@@ -253,28 +205,19 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME
- 
- !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
- !!IF isEmpty(CMAKE_DEBUG_TYPE)
--!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
--!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--    if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
--!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
--    if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
--!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
--        _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" )
--!!ELSE // CMAKE_STATIC_WINDOWS_BUILD
-     if (EXISTS
- !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
--        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
-+        \"@NIX_OUT@/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
- !!ELSE
-         \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
- !!ENDIF
-       AND EXISTS
- !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
-+        \"@NIX_DEV@/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
- !!ELSE
-         \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
- !!ENDIF
-         _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
--!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
-     endif()
- !!ENDIF // CMAKE_DEBUG_TYPE
- !!ENDIF // CMAKE_FIND_OTHER_LIBRARY_BUILD
-@@ -282,36 +225,23 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME
- !!ENDIF // CMAKE_RELEASE_TYPE
- 
- !!IF !isEmpty(CMAKE_DEBUG_TYPE)
--!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
--    _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" )
--!!ELSE
-     _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
--!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
- 
- !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
- !!IF isEmpty(CMAKE_RELEASE_TYPE)
--!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
--!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--    if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
--!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
--    if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
--!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
--        _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" )
--!!ELSE // CMAKE_STATIC_WINDOWS_BUILD
-     if (EXISTS
- !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
--        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
-+        \"@NIX_OUT@/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
- !!ELSE
-         \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
- !!ENDIF
-       AND EXISTS
- !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
-+        \"@NIX_DEV@/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
- !!ELSE
-         \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
- !!ENDIF
-         _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
--!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
-     endif()
- !!ENDIF // CMAKE_RELEASE_TYPE
- !!ENDIF // CMAKE_FIND_OTHER_LIBRARY_BUILD
-@@ -328,11 +258,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME
-     macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION)
-         set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
- 
--!!IF isEmpty(CMAKE_PLUGIN_DIR_IS_ABSOLUTE)
--        set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
--!!ELSE
--        set(imported_location \"$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
--!!ENDIF
-+        set(imported_location \"${PLUGIN_LOCATION}\")
-         _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
-         set_target_properties(Qt5::${Plugin} PROPERTIES
-             \"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
-Index: qtbase-opensource-src-5.6.1/src/gui/Qt5GuiConfigExtras.cmake.in
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/src/gui/Qt5GuiConfigExtras.cmake.in
-+++ qtbase-opensource-src-5.6.1/src/gui/Qt5GuiConfigExtras.cmake.in
-@@ -2,7 +2,7 @@
- !!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE)
- 
- !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
--set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR/QtANGLE\")
-+set(Qt5Gui_EGL_INCLUDE_DIRS \"@NIX_DEV@/$$CMAKE_INCLUDE_DIR/QtANGLE\")
- !!ELSE
- set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR/QtANGLE\")
- !!ENDIF
-@@ -17,13 +17,13 @@ macro(_populate_qt5gui_gl_target_propert
-     set_property(TARGET Qt5::${TargetName} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
- 
- !!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5Gui_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
-+    set(imported_location \"@NIX_OUT@/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
- !!ELSE
-     set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
- !!ENDIF
- 
- !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--    set(imported_implib \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
-+    set(imported_implib \"@NIX_DEV@/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
- !!ELSE
-     set(imported_implib \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
- !!ENDIF
-Index: qtbase-opensource-src-5.6.1/src/widgets/Qt5WidgetsConfigExtras.cmake.in
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/src/widgets/Qt5WidgetsConfigExtras.cmake.in
-+++ qtbase-opensource-src-5.6.1/src/widgets/Qt5WidgetsConfigExtras.cmake.in
-@@ -3,7 +3,7 @@ if (NOT TARGET Qt5::uic)
-     add_executable(Qt5::uic IMPORTED)
- 
- !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5Widgets_install_prefix}/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
-+    set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
- !!ELSE
-     set(imported_location \"$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\")
- !!ENDIF
-Index: qtbase-opensource-src-5.6.1/src/corelib/Qt5CoreConfigExtras.cmake.in
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/src/corelib/Qt5CoreConfigExtras.cmake.in
-+++ qtbase-opensource-src-5.6.1/src/corelib/Qt5CoreConfigExtras.cmake.in
-@@ -3,7 +3,7 @@ if (NOT TARGET Qt5::qmake)
-     add_executable(Qt5::qmake IMPORTED)
- 
- !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
-+    set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
- !!ELSE
-     set(imported_location \"$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
- !!ENDIF
-@@ -18,7 +18,7 @@ if (NOT TARGET Qt5::moc)
-     add_executable(Qt5::moc IMPORTED)
- 
- !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
-+    set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
- !!ELSE
-     set(imported_location \"$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
- !!ENDIF
-@@ -35,7 +35,7 @@ if (NOT TARGET Qt5::rcc)
-     add_executable(Qt5::rcc IMPORTED)
- 
- !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
-+    set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
- !!ELSE
-     set(imported_location \"$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
- !!ENDIF
-@@ -131,7 +131,7 @@ if (NOT TARGET Qt5::WinMain)
- !!IF !isEmpty(CMAKE_RELEASE_TYPE)
-     set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
- !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
-+    set(imported_location \"@NIX_DEV@/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
- !!ELSE
-     set(imported_location \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\")
- !!ENDIF
-@@ -145,7 +145,7 @@ if (NOT TARGET Qt5::WinMain)
-     set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
- 
- !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\")
-+    set(imported_location \"@NIX_DEV@/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\")
- !!ELSE
-     set(imported_location \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\")
- !!ENDIF
-Index: qtbase-opensource-src-5.6.1/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
-+++ qtbase-opensource-src-5.6.1/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
-@@ -1,6 +1,6 @@
- 
- !!IF isEmpty(CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE)
--set(_qt5_corelib_extra_includes \"${_qt5Core_install_prefix}/$${CMAKE_INSTALL_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
-+set(_qt5_corelib_extra_includes \"@NIX_DEV@/$${CMAKE_INSTALL_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
- !!ELSE
- set(_qt5_corelib_extra_includes \"$${CMAKE_INSTALL_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
- !!ENDIF
-Index: qtbase-opensource-src-5.6.1/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
-+++ qtbase-opensource-src-5.6.1/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
-@@ -1,6 +1,6 @@
- 
- !!IF isEmpty(CMAKE_HOST_DATA_DIR_IS_ABSOLUTE)
--set(_qt5_corelib_extra_includes \"${_qt5Core_install_prefix}/$${CMAKE_HOST_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
-+set(_qt5_corelib_extra_includes \"@NIX_DEV@/$${CMAKE_HOST_DATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
- !!ELSE
- set(_qt5_corelib_extra_includes \"$${CMAKE_HOST_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
- !!ENDIF
-Index: qtbase-opensource-src-5.6.1/src/dbus/Qt5DBusConfigExtras.cmake.in
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/src/dbus/Qt5DBusConfigExtras.cmake.in
-+++ qtbase-opensource-src-5.6.1/src/dbus/Qt5DBusConfigExtras.cmake.in
-@@ -3,7 +3,7 @@ if (NOT TARGET Qt5::qdbuscpp2xml)
-     add_executable(Qt5::qdbuscpp2xml IMPORTED)
- 
- !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
-+    set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
- !!ELSE
-     set(imported_location \"$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\")
- !!ENDIF
-@@ -18,7 +18,7 @@ if (NOT TARGET Qt5::qdbusxml2cpp)
-     add_executable(Qt5::qdbusxml2cpp IMPORTED)
- 
- !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
-+    set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
- !!ELSE
-     set(imported_location \"$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\")
- !!ENDIF
-Index: qtbase-opensource-src-5.6.1/mkspecs/features/create_cmake.prf
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/mkspecs/features/create_cmake.prf
-+++ qtbase-opensource-src-5.6.1/mkspecs/features/create_cmake.prf
-@@ -136,28 +136,28 @@ contains(CONFIG, plugin) {
- 
-     win32 {
-         isEmpty(CMAKE_STATIC_TYPE) {
--            CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${TARGET}.dll
--            CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${TARGET}d.dll
-+            CMAKE_PLUGIN_LOCATION_RELEASE = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/$${TARGET}.dll
-+            CMAKE_PLUGIN_LOCATION_DEBUG = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/$${TARGET}d.dll
-         } else:mingw {
--            CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${TARGET}.a
--            CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${TARGET}d.a
-+            CMAKE_PLUGIN_LOCATION_RELEASE = $${CMAKE_PLUGIN_DIR}/$$PLUGIN_TYPE/lib$${TARGET}.a
-+            CMAKE_PLUGIN_LOCATION_DEBUG = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/lib$${TARGET}d.a
-         } else {                         # MSVC static
--            CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${TARGET}.lib
--            CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${TARGET}d.lib
-+            CMAKE_PLUGIN_LOCATION_RELEASE = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/$${TARGET}.lib
-+            CMAKE_PLUGIN_LOCATION_DEBUG = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/$${TARGET}d.lib
-         }
-     } else {
-         mac {
-             isEmpty(CMAKE_STATIC_TYPE): CMAKE_PlUGIN_EXT = .dylib
-             else: CMAKE_PlUGIN_EXT = .a
- 
--            CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
--            CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
-+            CMAKE_PLUGIN_LOCATION_RELEASE = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
-+            CMAKE_PLUGIN_LOCATION_DEBUG = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
-         } else {
-             isEmpty(CMAKE_STATIC_TYPE): CMAKE_PlUGIN_EXT = .so
-             else: CMAKE_PlUGIN_EXT = .a
- 
--            CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
--            CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
-+            CMAKE_PLUGIN_LOCATION_RELEASE = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
-+            CMAKE_PLUGIN_LOCATION_DEBUG = $${CMAKE_PLUGIN_DIR}$$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
-         }
-     }
-     cmake_target_file.input = $$PWD/data/cmake/Qt5PluginTarget.cmake.in
-Index: qtbase-opensource-src-5.6.1/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
-+++ qtbase-opensource-src-5.6.1/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
-@@ -2,10 +2,10 @@
- add_library(Qt5::$$CMAKE_PLUGIN_NAME MODULE IMPORTED)
- 
- !!IF !isEmpty(CMAKE_RELEASE_TYPE)
--_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\")
-+_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"@NIX_OUT@/$${CMAKE_PLUGIN_LOCATION_RELEASE}\")
- !!ENDIF
- !!IF !isEmpty(CMAKE_DEBUG_TYPE)
--_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\")
-+_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"@NIX_OUT@/$${CMAKE_PLUGIN_LOCATION_DEBUG}\")
- !!ENDIF
- 
- list(APPEND Qt5$${CMAKE_MODULE_NAME}_PLUGINS Qt5::$$CMAKE_PLUGIN_NAME)
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/compose-search-path.patch b/pkgs/development/libraries/qt-5/5.6/qtbase/compose-search-path.patch
deleted file mode 100644
index 230ca4167db..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/compose-search-path.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Index: qtbase-opensource-src-5.6.0/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
-===================================================================
---- qtbase-opensource-src-5.6.0.orig/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
-+++ qtbase-opensource-src-5.6.0/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
-@@ -251,10 +251,7 @@ void TableGenerator::initPossibleLocatio
-     // the QTCOMPOSE environment variable
-     if (qEnvironmentVariableIsSet("QTCOMPOSE"))
-         m_possibleLocations.append(QString::fromLocal8Bit(qgetenv("QTCOMPOSE")));
--    m_possibleLocations.append(QStringLiteral("/usr/share/X11/locale"));
--    m_possibleLocations.append(QStringLiteral("/usr/local/share/X11/locale"));
--    m_possibleLocations.append(QStringLiteral("/usr/lib/X11/locale"));
--    m_possibleLocations.append(QStringLiteral("/usr/local/lib/X11/locale"));
-+    m_possibleLocations.append(QStringLiteral("${libX11}/share/X11/locale"));
-     m_possibleLocations.append(QStringLiteral(X11_PREFIX "/share/X11/locale"));
-     m_possibleLocations.append(QStringLiteral(X11_PREFIX "/lib/X11/locale"));
- }
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/decrypt-ssl-traffic.patch b/pkgs/development/libraries/qt-5/5.6/qtbase/decrypt-ssl-traffic.patch
deleted file mode 100644
index 495db07cfbb..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/decrypt-ssl-traffic.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: qtbase-opensource-src-5.5.1/src/network/ssl/qsslsocket_openssl.cpp
-===================================================================
---- qtbase-opensource-src-5.5.1.orig/src/network/ssl/qsslsocket_openssl.cpp
-+++ qtbase-opensource-src-5.5.1/src/network/ssl/qsslsocket_openssl.cpp
-@@ -48,7 +48,7 @@
- ****************************************************************************/
- 
- //#define QSSLSOCKET_DEBUG
--//#define QT_DECRYPT_SSL_TRAFFIC
-+#define QT_DECRYPT_SSL_TRAFFIC
- 
- #include "qssl_p.h"
- #include "qsslsocket_openssl_p.h"
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.6/qtbase/default.nix
deleted file mode 100644
index f2e18233d91..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/default.nix
+++ /dev/null
@@ -1,325 +0,0 @@
-{ stdenv, lib, fetchgit, copyPathsToStore
-, srcs, qtCompatVersion
-
-, xlibs, libX11, libxcb, libXcursor, libXext, libXrender, libXi
-, xcbutil, xcbutilimage, xcbutilkeysyms, xcbutilwm, libxkbcommon
-, fontconfig, freetype, harfbuzz
-, openssl, dbus, glib, udev, libxml2, libxslt, pcre16
-, zlib, libjpeg, libpng, libtiff, sqlite, icu
-
-, coreutils, bison, flex, gdb, gperf, lndir
-, patchelf, perl, pkgconfig, python2
-, darwin, libiconv
-
-# optional dependencies
-, cups ? null
-, mysql ? null, postgresql ? null
-
-# options
-, mesaSupported ? (!stdenv.isDarwin)
-, mesa
-, buildExamples ? false
-, buildTests ? false
-, developerBuild ? false
-, decryptSslTraffic ? false
-}:
-
-let
-  system-x86_64 = lib.elem stdenv.system lib.platforms.x86_64;
-in
-
-stdenv.mkDerivation {
-
-  name = "qtbase-${srcs.qtbase.version}";
-  inherit (srcs.qtbase) src version;
-  inherit qtCompatVersion;
-
-  outputs = [ "out" "dev" ];
-
-  patches =
-    copyPathsToStore (lib.readPathsFromFile ./. ./series)
-    ++ [(if stdenv.isDarwin then ./cmake-paths-darwin.patch else ./cmake-paths.patch)]
-    ++ lib.optional decryptSslTraffic ./decrypt-ssl-traffic.patch
-    ++ lib.optionals mesaSupported [ ./dlopen-gl.patch ./mkspecs-libgl.patch ];
-
-  postPatch =
-    ''
-      substituteInPlace configure --replace /bin/pwd pwd
-      substituteInPlace src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls
-      sed -e 's@/\(usr\|opt\)/@/var/empty/@g' -i config.tests/*/*.test -i mkspecs/*/*.conf
-
-      sed -i 's/PATHS.*NO_DEFAULT_PATH//' "src/corelib/Qt5Config.cmake.in"
-      sed -i 's/PATHS.*NO_DEFAULT_PATH//' "src/corelib/Qt5CoreMacros.cmake"
-      sed -i 's/NO_DEFAULT_PATH//' "src/gui/Qt5GuiConfigExtras.cmake.in"
-      sed -i 's/PATHS.*NO_DEFAULT_PATH//' "mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in"
-
-      substituteInPlace src/network/kernel/qdnslookup_unix.cpp \
-        --replace "@glibc@" "${stdenv.cc.libc.out}"
-      substituteInPlace src/network/kernel/qhostinfo_unix.cpp \
-        --replace "@glibc@" "${stdenv.cc.libc.out}"
-
-      substituteInPlace src/network/ssl/qsslsocket_openssl_symbols.cpp \
-        --replace "@openssl@" "${openssl.out}"
-    '' + lib.optionalString stdenv.isLinux ''
-      substituteInPlace src/plugins/platforms/xcb/qxcbcursor.cpp \
-        --replace "@libXcursor@" "${libXcursor.out}"
-
-      substituteInPlace src/dbus/qdbus_symbols.cpp \
-        --replace "@dbus_libs@" "${dbus.lib}"
-
-      substituteInPlace \
-        src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp \
-        --replace "@libX11@" "${libX11.out}"
-    '' + lib.optionalString mesaSupported ''
-      substituteInPlace \
-        src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp \
-        --replace "@mesa_lib@" "${mesa.out}"
-      substituteInPlace mkspecs/common/linux.conf \
-        --replace "@mesa_lib@" "${mesa.out}" \
-        --replace "@mesa_inc@" "${mesa.dev or mesa}"
-    '' + lib.optionalString stdenv.isDarwin ''
-      sed -i \
-          -e 's|! /usr/bin/xcode-select --print-path >/dev/null 2>&1;|false;|' \
-          -e 's|! /usr/bin/xcrun -find xcodebuild >/dev/null 2>&1;|false;|' \
-          -e 's|sysroot=$(/usr/bin/xcodebuild -sdk $sdk -version Path 2>/dev/null)|sysroot=/nonsense|' \
-          -e 's|QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX`|QMAKE_CXX="clang++"\nQMAKE_CONF_COMPILER="clang++"|' \
-          -e 's|XCRUN=`/usr/bin/xcrun -sdk macosx clang -v 2>&1`|XCRUN="clang -v 2>&1"|' \
-          -e 's#sdk_val=$(/usr/bin/xcrun -sdk $sdk -find $(echo $val | cut -d \x27 \x27 -f 1))##' \
-          -e 's#val=$(echo $sdk_val $(echo $val | cut -s -d \x27 \x27 -f 2-))##' \
-          ./configure
-      sed -i '3,$d' ./mkspecs/features/mac/default_pre.prf
-      sed -i '26,$d' ./mkspecs/features/mac/default_post.prf
-      sed -i '1,$d' ./mkspecs/features/mac/sdk.prf
-      sed 's/QMAKE_LFLAGS_RPATH      = -Wl,-rpath,/QMAKE_LFLAGS_RPATH      =/' -i ./mkspecs/common/mac.conf
-    '';
-    # Note on the above: \x27 is a way if including a single-quote
-    # character in the sed string arguments.
-
-  qtPluginPrefix = "lib/qt-${qtCompatVersion}/plugins";
-  qtQmlPrefix = "lib/qt-${qtCompatVersion}/qml";
-  qtDocPrefix = "share/doc/qt-${qtCompatVersion}";
-
-  setOutputFlags = false;
-  preConfigure = ''
-    export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms:$LD_LIBRARY_PATH"
-    export MAKEFLAGS=-j$NIX_BUILD_CORES
-    # We need to set LD to CXX or otherwise we get nasty compile errors
-    export LD=$CXX
-
-    configureFlags+="\
-        -plugindir $out/$qtPluginPrefix \
-        -qmldir $out/$qtQmlPrefix \
-        -docdir $out/$qtDocPrefix"
-
-    NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QT_PLUGIN_PREFIX=\"$qtPluginPrefix\""
-    NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QPA_PLATFORM_PLUGIN_PATH=\"''${!outputLib}/$qtPluginPrefix/platforms\""
-
-    unset LD
-  '';
-
-  prefixKey = "-prefix ";
-
-  # -no-eglfs, -no-directfb, -no-linuxfb and -no-kms because of the current minimalist mesa
-  # TODO Remove obsolete and useless flags once the build will be totally mastered
-  configureFlags = ''
-    -verbose
-    -confirm-license
-    -opensource
-
-    -release
-    -shared
-    -c++11
-    ${lib.optionalString developerBuild "-developer-build"}
-    -largefile
-    -accessibility
-    -optimized-qmake
-    -strip
-    -no-reduce-relocations
-    -system-proxies
-    -pkg-config
-
-    -gui
-    -widgets
-    -opengl desktop
-    -qml-debug
-    -iconv
-    -icu
-    -pch
-
-    ${lib.optionalString (!system-x86_64) "-no-sse2"}
-    -no-sse3
-    -no-ssse3
-    -no-sse4.1
-    -no-sse4.2
-    -no-avx
-    -no-avx2
-    -no-mips_dsp
-    -no-mips_dspr2
-
-    -system-zlib
-    -system-libpng
-    -system-libjpeg
-    -system-harfbuzz
-    -system-pcre
-    -openssl-linked
-
-    -system-sqlite
-    -${if mysql != null then "plugin" else "no"}-sql-mysql
-    -${if postgresql != null then "plugin" else "no"}-sql-psql
-
-    -make libs
-    -make tools
-    -${lib.optionalString (buildExamples == false) "no"}make examples
-    -${lib.optionalString (buildTests == false) "no"}make tests
-  '' + lib.optionalString (!stdenv.isDarwin) ''
-    -no-rpath
-    -glib
-    -xcb
-    -qpa xcb
-
-    -${lib.optionalString (cups == null) "no-"}cups
-
-    -no-eglfs
-    -no-directfb
-    -no-linuxfb
-    -no-kms
-
-    -system-xcb
-    -system-xkbcommon
-    -dbus-linked
-  '' + lib.optionalString stdenv.isDarwin ''
-    -platform macx-clang
-    -no-use-gold-linker
-    -no-fontconfig
-    -qt-freetype
-  '';
-
-  # PostgreSQL autodetection fails sporadically because Qt omits the "-lpq" flag
-  # if dependency paths contain the string "pq", which can occur in the hash.
-  # To prevent these failures, we need to override PostgreSQL detection.
-  PSQL_LIBS = lib.optionalString (postgresql != null) "-L${postgresql.lib}/lib -lpq";
-
-  propagatedBuildInputs = [
-    libxml2 libxslt openssl pcre16 sqlite zlib
-
-    # Text rendering
-    harfbuzz icu
-
-    # Image formats
-    libjpeg libpng libtiff
-  ]
-  ++ lib.optional mesaSupported mesa
-  ++ lib.optionals (!stdenv.isDarwin) [
-    dbus glib udev
-
-    # Text rendering
-    fontconfig freetype
-    # X11 libs
-    xlibs.libXcomposite libX11 libxcb libXext libXrender libXi
-    xcbutil xcbutilimage xcbutilkeysyms xcbutilwm libxkbcommon
-  ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
-    ApplicationServices CoreServices AppKit Carbon OpenGL AGL Cocoa
-    DiskArbitration darwin.cf-private libiconv
-  ]);
-
-  buildInputs =
-    [ bison flex gperf ]
-    ++ lib.optional developerBuild gdb
-    ++ lib.optional (cups != null) cups
-    ++ lib.optional (mysql != null) mysql.lib
-    ++ lib.optional (postgresql != null) postgresql;
-
-  nativeBuildInputs = [ lndir perl pkgconfig python2 ] ++ lib.optional (!stdenv.isDarwin) patchelf;
-
-  # freetype-2.5.4 changed signedness of some struct fields
-  NIX_CFLAGS_COMPILE = "-Wno-error=sign-compare"
-    + lib.optionalString stdenv.isDarwin " -D__MAC_OS_X_VERSION_MAX_ALLOWED=1090 -D__AVAILABILITY_INTERNAL__MAC_10_10=__attribute__((availability(macosx,introduced=10.10)))";
-  # Note that nixpkgs's objc4 is from macOS 10.11 while the SDK is
-  # 10.9 which necessitates the above macro definition that mentions
-  # 10.10
-
-  postInstall = ''
-    find "$out" -name "*.cmake" | while read file; do
-        substituteInPlace "$file" \
-            --subst-var-by NIX_OUT "''${!outputLib}" \
-            --subst-var-by NIX_DEV "''${!outputDev}" \
-            --subst-var-by NIX_BIN "''${!outputBin}"
-    done
-  '';
-
-  preFixup = ''
-    # We cannot simply set these paths in configureFlags because libQtCore retains
-    # references to the paths it was built with.
-    moveToOutput "bin" "$dev"
-    moveToOutput "include" "$dev"
-    moveToOutput "mkspecs" "$dev"
-
-    # The destination directory must exist or moveToOutput will do nothing
-    mkdir -p "$dev/share"
-    moveToOutput "share/doc" "$dev"
-  '';
-
-  # Don't move .prl files on darwin because they end up in
-  # "dev/lib/Foo.framework/Foo.prl" which interferes with subsequent
-  # use of lndir in the qtbase setup-hook. On Linux, the .prl files
-  # are in lib, and so do not cause a subsequent recreation of deep
-  # framework directory trees.
-  postFixup =
-    ''
-      # Don't retain build-time dependencies like gdb.
-      sed '/QMAKE_DEFAULT_.*DIRS/ d' -i $dev/mkspecs/qconfig.pri
-
-      # Move libtool archives and qmake projects
-      if [ "z''${!outputLib}" != "z''${!outputDev}" ]; then
-          pushd "''${!outputLib}"
-          find lib -name '*.a' -o -name '*.la'${if stdenv.isDarwin then "" else "-o -name '*.prl'"} | \
-              while read -r file; do
-                  mkdir -p "''${!outputDev}/$(dirname "$file")"
-                  mv "''${!outputLib}/$file" "''${!outputDev}/$file"
-              done
-          popd
-      fi
-    ''
-
-    # fixup .pc file (where to find 'moc' etc.)
-    + lib.optionalString (!stdenv.isDarwin) ''
-      sed -i "$dev/lib/pkgconfig/Qt5Core.pc" \
-          -e "/^host_bins=/ c host_bins=$dev/bin"
-    ''
-
-    # Don't move .prl files on darwin because they end up in
-    # "dev/lib/Foo.framework/Foo.prl" which interferes with subsequent
-    # use of lndir in the qtbase setup-hook. On Linux, the .prl files
-    # are in lib, and so do not cause a subsequent recreation of deep
-    # framework directory trees.
-    + lib.optionalString stdenv.isDarwin ''
-      fixDarwinDylibNames_rpath() {
-        local flags=()
-
-        for fn in "$@"; do
-          flags+=(-change "@rpath/$fn.framework/Versions/5/$fn" "$out/lib/$fn.framework/Versions/5/$fn")
-        done
-
-        for fn in "$@"; do
-          echo "$fn: fixing dylib"
-          install_name_tool -id "$out/lib/$fn.framework/Versions/5/$fn" "''${flags[@]}" "$out/lib/$fn.framework/Versions/5/$fn"
-        done
-      }
-      fixDarwinDylibNames_rpath "QtConcurrent" "QtPrintSupport" "QtCore" "QtSql" "QtDBus" "QtTest" "QtGui" "QtWidgets" "QtNetwork" "QtXml" "QtOpenGL"
-    '';
-
-  inherit lndir;
-  setupHook = if stdenv.isDarwin
-              then ../../qtbase-setup-hook-darwin.sh
-              else ../../qtbase-setup-hook.sh;
-
-  enableParallelBuilding = true;
-
-  meta = with lib; {
-    homepage = http://www.qt.io;
-    description = "A cross-platform application framework for C++";
-    license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ];
-    maintainers = with maintainers; [ qknight ttuegel ];
-    platforms = platforms.unix;
-  };
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-dbus.patch b/pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-dbus.patch
deleted file mode 100644
index 2bc526a72bd..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-dbus.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: qtbase-opensource-src-5.6.1/src/dbus/qdbus_symbols.cpp
-===================================================================
---- qtbase-opensource-src-5.6.1.orig/src/dbus/qdbus_symbols.cpp
-+++ qtbase-opensource-src-5.6.1/src/dbus/qdbus_symbols.cpp
-@@ -90,7 +90,7 @@ bool qdbus_loadLibDBus()
- #ifdef Q_OS_WIN
-         QLatin1String("dbus-1"),
- #endif
--        QLatin1String("libdbus-1")
-+        QLatin1String("@dbus_libs@/lib/libdbus-1")
-     };
- 
-     lib->unload();
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-gl.patch b/pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-gl.patch
deleted file mode 100644
index ea3073ced50..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-gl.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Index: qtbase-opensource-src-5.5.1/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
-===================================================================
---- qtbase-opensource-src-5.5.1.orig/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
-+++ qtbase-opensource-src-5.5.1/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
-@@ -563,7 +563,12 @@ void (*QGLXContext::getProcAddress(const
-             {
-                 extern const QString qt_gl_library_name();
- //                QLibrary lib(qt_gl_library_name());
-+                // Check system library paths first
-                 QLibrary lib(QLatin1String("GL"));
-+                if (!lib.load()) {
-+                    // Fallback to Mesa driver
-+                    lib.setFileName(QLatin1String("@mesa_lib@/lib/libGL"));
-+                }
-                 glXGetProcAddressARB = (qt_glXGetProcAddressARB) lib.resolve("glXGetProcAddressARB");
-             }
-         }
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-libXcursor.patch b/pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-libXcursor.patch
deleted file mode 100644
index 3e2e8ab349d..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-libXcursor.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Index: qtbase-opensource-src-5.6.0/src/plugins/platforms/xcb/qxcbcursor.cpp
-===================================================================
---- qtbase-opensource-src-5.6.0.orig/src/plugins/platforms/xcb/qxcbcursor.cpp
-+++ qtbase-opensource-src-5.6.0/src/plugins/platforms/xcb/qxcbcursor.cpp
-@@ -303,10 +303,10 @@ QXcbCursor::QXcbCursor(QXcbConnection *c
- #if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY)
-     static bool function_ptrs_not_initialized = true;
-     if (function_ptrs_not_initialized) {
--        QLibrary xcursorLib(QLatin1String("Xcursor"), 1);
-+        QLibrary xcursorLib(QLatin1String("@libXcursor@/lib/libXcursor"), 1);
-         bool xcursorFound = xcursorLib.load();
-         if (!xcursorFound) { // try without the version number
--            xcursorLib.setFileName(QLatin1String("Xcursor"));
-+            xcursorLib.setFileName(QLatin1String("@libXcursor@/lib/Xcursor"));
-             xcursorFound = xcursorLib.load();
-         }
-         if (xcursorFound) {
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-openssl.patch b/pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-openssl.patch
deleted file mode 100644
index 1d97aad9406..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-openssl.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Index: qtbase-opensource-src-5.6.0/src/network/ssl/qsslsocket_openssl_symbols.cpp
-===================================================================
---- qtbase-opensource-src-5.6.0.orig/src/network/ssl/qsslsocket_openssl_symbols.cpp
-+++ qtbase-opensource-src-5.6.0/src/network/ssl/qsslsocket_openssl_symbols.cpp
-@@ -652,8 +652,8 @@ static QPair<QLibrary*, QLibrary*> loadO
- #endif
- #if defined(SHLIB_VERSION_NUMBER) && !defined(Q_OS_QNX) // on QNX, the libs are always libssl.so and libcrypto.so
-     // first attempt: the canonical name is libssl.so.<SHLIB_VERSION_NUMBER>
--    libssl->setFileNameAndVersion(QLatin1String("ssl"), QLatin1String(SHLIB_VERSION_NUMBER));
--    libcrypto->setFileNameAndVersion(QLatin1String("crypto"), QLatin1String(SHLIB_VERSION_NUMBER));
-+    libssl->setFileNameAndVersion(QLatin1String("@openssl@/lib/libssl"), QLatin1String(SHLIB_VERSION_NUMBER));
-+    libcrypto->setFileNameAndVersion(QLatin1String("@openssl@/lib/libcrypto"), QLatin1String(SHLIB_VERSION_NUMBER));
-     if (libcrypto->load() && libssl->load()) {
-         // libssl.so.<SHLIB_VERSION_NUMBER> and libcrypto.so.<SHLIB_VERSION_NUMBER> found
-         return pair;
-@@ -670,8 +670,8 @@ static QPair<QLibrary*, QLibrary*> loadO
-     //  OS X's /usr/lib/libssl.dylib, /usr/lib/libcrypto.dylib will be picked up in the third
-     //    attempt, _after_ <bundle>/Contents/Frameworks has been searched.
-     //  iOS does not ship a system libssl.dylib, libcrypto.dylib in the first place.
--    libssl->setFileNameAndVersion(QLatin1String("ssl"), -1);
--    libcrypto->setFileNameAndVersion(QLatin1String("crypto"), -1);
-+    libssl->setFileNameAndVersion(QLatin1String("@openssl@/lib/libssl"), -1);
-+    libcrypto->setFileNameAndVersion(QLatin1String("@openssl@/lib/libcrypto"), -1);
-     if (libcrypto->load() && libssl->load()) {
-         // libssl.so.0 and libcrypto.so.0 found
-         return pair;
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-resolv.patch b/pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-resolv.patch
deleted file mode 100644
index e9d3c2734d1..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-resolv.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Index: qtbase-opensource-src-5.6.2/src/network/kernel/qdnslookup_unix.cpp
-===================================================================
---- qtbase-opensource-src-5.6.2.orig/src/network/kernel/qdnslookup_unix.cpp
-+++ qtbase-opensource-src-5.6.2/src/network/kernel/qdnslookup_unix.cpp
-@@ -83,7 +83,7 @@ static bool resolveLibraryInternal()
-     if (!lib.load())
- #endif
-     {
--        lib.setFileName(QLatin1String("resolv"));
-+        lib.setFileName(QLatin1String("@glibc@/lib/resolv"));
-         if (!lib.load())
-             return false;
-     }
-Index: qtbase-opensource-src-5.6.2/src/network/kernel/qhostinfo_unix.cpp
-===================================================================
---- qtbase-opensource-src-5.6.2.orig/src/network/kernel/qhostinfo_unix.cpp
-+++ qtbase-opensource-src-5.6.2/src/network/kernel/qhostinfo_unix.cpp
-@@ -94,7 +94,7 @@ static bool resolveLibraryInternal()
-     if (!lib.load())
- #endif
-     {
--        lib.setFileName(QLatin1String("resolv"));
-+        lib.setFileName(QLatin1String("@glibc@/lib/libresolv"));
-         if (!lib.load())
-             return false;
-     }
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/library-paths.patch b/pkgs/development/libraries/qt-5/5.6/qtbase/library-paths.patch
deleted file mode 100644
index fecbce59050..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/library-paths.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Index: qtbase-opensource-src-5.6.2/src/corelib/kernel/qcoreapplication.cpp
-===================================================================
---- qtbase-opensource-src-5.6.2.orig/src/corelib/kernel/qcoreapplication.cpp
-+++ qtbase-opensource-src-5.6.2/src/corelib/kernel/qcoreapplication.cpp
-@@ -2533,6 +2533,15 @@ QStringList QCoreApplication::libraryPat
-         QStringList *app_libpaths = new QStringList;
-         coreappdata()->app_libpaths.reset(app_libpaths);
- 
-+        // Add library paths derived from PATH
-+        const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
-+        const QString plugindir = QStringLiteral("../" NIXPKGS_QT_PLUGIN_PREFIX);
-+        for (const QString &path: paths) {
-+            if (!path.isEmpty()) {
-+                app_libpaths->append(QDir::cleanPath(path + QDir::separator() + plugindir));
-+            }
-+        }
-+
-         const QByteArray libPathEnv = qgetenv("QT_PLUGIN_PATH");
-         if (!libPathEnv.isEmpty()) {
-             QStringList paths = QFile::decodeName(libPathEnv).split(QDir::listSeparator(), QString::SkipEmptyParts);
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/libressl.patch b/pkgs/development/libraries/qt-5/5.6/qtbase/libressl.patch
deleted file mode 100644
index c721a6be747..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/libressl.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 81494e67eccba04fc3fe554d76a9ca6fe7f2250e Mon Sep 17 00:00:00 2001
-From: hasufell <hasufell@gentoo.org>
-Date: Sat, 10 Oct 2015 01:15:01 +0200
-Subject: [PATCH] Fix compilation with libressl
-
-By additionally checking for defined(SSL_CTRL_SET_CURVES), which
-is defined in openssl, but not in libressl.
----
- src/network/ssl/qsslcontext_openssl.cpp | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-Index: qtbase-opensource-src-5.6.0/src/network/ssl/qsslcontext_openssl.cpp
-===================================================================
---- qtbase-opensource-src-5.6.0.orig/src/network/ssl/qsslcontext_openssl.cpp
-+++ qtbase-opensource-src-5.6.0/src/network/ssl/qsslcontext_openssl.cpp
-@@ -340,7 +340,7 @@ init_context:
- 
-     const QVector<QSslEllipticCurve> qcurves = sslContext->sslConfiguration.ellipticCurves();
-     if (!qcurves.isEmpty()) {
--#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC)
-+#if OPENSSL_VERSION_NUMBER >= 0x10002000L && defined(SSL_CTRL_SET_CURVES) && !defined(OPENSSL_NO_EC)
-         // Set the curves to be used
-         if (q_SSLeay() >= 0x10002000L) {
-             // SSL_CTX_ctrl wants a non-const pointer as last argument,
-@@ -354,7 +354,7 @@ init_context:
-                 return sslContext;
-             }
-         } else
--#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC)
-+#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L && defined(SSL_CTRL_SET_CURVES) && !defined(OPENSSL_NO_EC)
-         {
-             // specific curves requested, but not possible to set -> error
-             sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocket::tr("OpenSSL version too old, need at least v1.0.2"));
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/mkspecs-libgl.patch b/pkgs/development/libraries/qt-5/5.6/qtbase/mkspecs-libgl.patch
deleted file mode 100644
index fda3d3e3653..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/mkspecs-libgl.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Index: qtbase-opensource-src-5.5.1/mkspecs/common/linux.conf
-===================================================================
---- qtbase-opensource-src-5.5.1.orig/mkspecs/common/linux.conf
-+++ qtbase-opensource-src-5.5.1/mkspecs/common/linux.conf
-@@ -12,8 +12,8 @@ QMAKE_INCDIR            =
- QMAKE_LIBDIR            =
- QMAKE_INCDIR_X11        =
- QMAKE_LIBDIR_X11        =
--QMAKE_INCDIR_OPENGL     =
--QMAKE_LIBDIR_OPENGL     =
-+QMAKE_INCDIR_OPENGL     = @mesa_inc@/include
-+QMAKE_LIBDIR_OPENGL     = @mesa_lib@/lib
- QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL
- QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL
- QMAKE_INCDIR_EGL        =
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/qpa-platform-plugin-path.patch b/pkgs/development/libraries/qt-5/5.6/qtbase/qpa-platform-plugin-path.patch
deleted file mode 100644
index 32d9dcad622..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/qpa-platform-plugin-path.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-Index: qtbase-opensource-src-5.6.2/src/gui/kernel/qplatformintegrationfactory.cpp
-===================================================================
---- qtbase-opensource-src-5.6.2.orig/src/gui/kernel/qplatformintegrationfactory.cpp
-+++ qtbase-opensource-src-5.6.2/src/gui/kernel/qplatformintegrationfactory.cpp
-@@ -67,9 +67,10 @@ QPlatformIntegration *QPlatformIntegrati
-     // Try loading the plugin from platformPluginPath first:
-     if (!platformPluginPath.isEmpty()) {
-         QCoreApplication::addLibraryPath(platformPluginPath);
--        if (QPlatformIntegration *ret = loadIntegration(directLoader(), platform, paramList, argc, argv))
--            return ret;
-     }
-+    QCoreApplication::addLibraryPath(QStringLiteral(NIXPKGS_QPA_PLATFORM_PLUGIN_PATH));
-+    if (QPlatformIntegration *ret = loadIntegration(directLoader(), platform, paramList, argc, argv))
-+        return ret;
-     if (QPlatformIntegration *ret = loadIntegration(loader(), platform, paramList, argc, argv))
-         return ret;
- #else
-@@ -95,15 +96,16 @@ QStringList QPlatformIntegrationFactory:
-     QStringList list;
-     if (!platformPluginPath.isEmpty()) {
-         QCoreApplication::addLibraryPath(platformPluginPath);
--        list = directLoader()->keyMap().values();
--        if (!list.isEmpty()) {
--            const QString postFix = QStringLiteral(" (from ")
--                                    + QDir::toNativeSeparators(platformPluginPath)
--                                    + QLatin1Char(')');
--            const QStringList::iterator end = list.end();
--            for (QStringList::iterator it = list.begin(); it != end; ++it)
--                (*it).append(postFix);
--        }
-+    }
-+    QCoreApplication::addLibraryPath(QStringLiteral(NIXPKGS_QPA_PLATFORM_PLUGIN_PATH));
-+    list = directLoader()->keyMap().values();
-+    if (!list.isEmpty()) {
-+        const QString postFix = QStringLiteral(" (from ")
-+            + QDir::toNativeSeparators(platformPluginPath)
-+            + QLatin1Char(')');
-+        const QStringList::iterator end = list.end();
-+        for (QStringList::iterator it = list.begin(); it != end; ++it)
-+            (*it).append(postFix);
-     }
-     list.append(loader()->keyMap().values());
-     return list;
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/series b/pkgs/development/libraries/qt-5/5.6/qtbase/series
deleted file mode 100644
index bacb3a4ed89..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/series
+++ /dev/null
@@ -1,9 +0,0 @@
-dlopen-resolv.patch
-tzdir.patch
-dlopen-libXcursor.patch
-dlopen-openssl.patch
-dlopen-dbus.patch
-xdg-config-dirs.patch
-library-paths.patch
-compose-search-path.patch
-libressl.patch
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/tzdir.patch b/pkgs/development/libraries/qt-5/5.6/qtbase/tzdir.patch
deleted file mode 100644
index f197211ded7..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/tzdir.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-Index: qtbase-opensource-src-5.6.2/src/corelib/tools/qtimezoneprivate_tz.cpp
-===================================================================
---- qtbase-opensource-src-5.6.2.orig/src/corelib/tools/qtimezoneprivate_tz.cpp
-+++ qtbase-opensource-src-5.6.2/src/corelib/tools/qtimezoneprivate_tz.cpp
-@@ -64,7 +64,10 @@ typedef QHash<QByteArray, QTzTimeZone> Q
- // Parse zone.tab table, assume lists all installed zones, if not will need to read directories
- static QTzTimeZoneHash loadTzTimeZones()
- {
--    QString path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
-+    QString path = qgetenv("TZDIR");
-+    path += "/zone.tab";
-+    if (!QFile::exists(path))
-+        path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
-     if (!QFile::exists(path))
-         path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
- 
-@@ -636,12 +639,18 @@ void QTzTimeZonePrivate::init(const QByt
-         if (!tzif.open(QIODevice::ReadOnly))
-             return;
-     } else {
--        // Open named tz, try modern path first, if fails try legacy path
--        tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
-+        // Try TZDIR first
-+        QString zoneinfoDir = qgetenv("TZDIR");
-+        zoneinfoDir += "/" + QString::fromLocal8Bit(ianaId);
-+        tzif.setFileName(zoneinfoDir);
-         if (!tzif.open(QIODevice::ReadOnly)) {
--            tzif.setFileName(QLatin1String("/usr/lib/zoneinfo/") + QString::fromLocal8Bit(ianaId));
--            if (!tzif.open(QIODevice::ReadOnly))
--                return;
-+            // Open named tz, try modern path first, if fails try legacy path
-+            tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
-+            if (!tzif.open(QIODevice::ReadOnly)) {
-+                tzif.setFileName(QLatin1String("/usr/lib/zoneinfo/") + QString::fromLocal8Bit(ianaId));
-+                if (!tzif.open(QIODevice::ReadOnly))
-+                    return;
-+            }
-         }
-     }
- 
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/xdg-config-dirs.patch b/pkgs/development/libraries/qt-5/5.6/qtbase/xdg-config-dirs.patch
deleted file mode 100644
index 8756cbe9f5f..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtbase/xdg-config-dirs.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-Index: qtbase-opensource-src-5.6.0/src/corelib/io/qsettings.cpp
-===================================================================
---- qtbase-opensource-src-5.6.0.orig/src/corelib/io/qsettings.cpp
-+++ qtbase-opensource-src-5.6.0/src/corelib/io/qsettings.cpp
-@@ -1155,6 +1155,24 @@ QConfFileSettingsPrivate::QConfFileSetti
-     if (!application.isEmpty())
-         confFiles[F_System | F_Application].reset(QConfFile::fromName(systemPath + appFile, false));
-     confFiles[F_System | F_Organization].reset(QConfFile::fromName(systemPath + orgFile, false));
-+
-+#if !defined(Q_OS_WIN)
-+    // Add directories specified in $XDG_CONFIG_DIRS
-+    const QString pathEnv = QString::fromLocal8Bit(getenv("XDG_CONFIG_DIRS"));
-+    if (!pathEnv.isEmpty()) {
-+        const QStringList pathEntries = pathEnv.split(QLatin1Char(':'), QString::SkipEmptyParts);
-+        if (!pathEntries.isEmpty()) {
-+            int j = 4; // This is the number of confFiles set above -- we need to start adding $XDG_CONFIG_DIRS after those.
-+            for (int k = 0; k < pathEntries.size() && j < NumConfFiles - 1; ++k) {
-+                const QString& path = pathEntries.at(k);
-+                if (!application.isEmpty())
-+                    confFiles[j++].reset(QConfFile::fromName(path + QDir::separator() + appFile, false));
-+                confFiles[j++].reset(QConfFile::fromName(path + QDir::separator() + orgFile, false));
-+            }
-+        }
-+    }
-+#endif
-+
- #else
-     QString confName = getPath(format, QSettings::UserScope) + org;
-     if (!application.isEmpty())
-Index: qtbase-opensource-src-5.6.0/src/corelib/io/qsettings_p.h
-===================================================================
---- qtbase-opensource-src-5.6.0.orig/src/corelib/io/qsettings_p.h
-+++ qtbase-opensource-src-5.6.0/src/corelib/io/qsettings_p.h
-@@ -241,7 +241,7 @@ public:
-         F_Organization = 0x1,
-         F_User = 0x0,
-         F_System = 0x2,
--        NumConfFiles = 4
-+        NumConfFiles = 40 // HACK: increase NumConfFiles from 4 to 40 in order to accommodate more paths in $XDG_CONFIG_DIRS -- ellis
- #else
-         SandboxConfFile = 0,
-         NumConfFiles = 1
diff --git a/pkgs/development/libraries/qt-5/5.6/qtconnectivity.nix b/pkgs/development/libraries/qt-5/5.6/qtconnectivity.nix
deleted file mode 100644
index 95cd6fea79b..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtconnectivity.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ qtSubmodule, qtbase, qtdeclarative }:
-
-qtSubmodule {
-  name = "qtconnectivity";
-  qtInputs = [ qtbase qtdeclarative ];
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtdeclarative/default.nix b/pkgs/development/libraries/qt-5/5.6/qtdeclarative/default.nix
deleted file mode 100644
index 57b8e53b215..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtdeclarative/default.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{ qtSubmodule, lib, copyPathsToStore, python2, qtbase, qtsvg, qtxmlpatterns }:
-
-qtSubmodule {
-  name = "qtdeclarative";
-  patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
-  qtInputs = [ qtbase qtsvg qtxmlpatterns ];
-  nativeBuildInputs = [ python2 ];
-
-  preConfigure = ''
-    NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QML2_IMPORT_PREFIX=\"$qtQmlPrefix\""
-  '';
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtdeclarative/import-paths.patch b/pkgs/development/libraries/qt-5/5.6/qtdeclarative/import-paths.patch
deleted file mode 100644
index a942d837c30..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtdeclarative/import-paths.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Index: qtdeclarative-opensource-src-5.6.2/src/qml/qml/qqmlimport.cpp
-===================================================================
---- qtdeclarative-opensource-src-5.6.2.orig/src/qml/qml/qqmlimport.cpp
-+++ qtdeclarative-opensource-src-5.6.2/src/qml/qml/qqmlimport.cpp
-@@ -1568,6 +1568,15 @@ QQmlImportDatabase::QQmlImportDatabase(Q
-     QString installImportsPath =  QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
-     addImportPath(installImportsPath);
- 
-+    // Add import paths derived from PATH
-+    const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
-+    const QString qmldir = QStringLiteral("../" NIXPKGS_QML2_IMPORT_PREFIX);
-+    for (const QString &path: paths) {
-+        if (!path.isEmpty()) {
-+            addImportPath(QDir::cleanPath(path + QDir::separator() + qmldir));
-+        }
-+    }
-+
-     // env import paths
-     if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QML2_IMPORT_PATH"))) {
-         const QByteArray envImportPath = qgetenv("QML2_IMPORT_PATH");
diff --git a/pkgs/development/libraries/qt-5/5.6/qtdeclarative/series b/pkgs/development/libraries/qt-5/5.6/qtdeclarative/series
deleted file mode 100644
index 38abb916a50..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtdeclarative/series
+++ /dev/null
@@ -1 +0,0 @@
-import-paths.patch
diff --git a/pkgs/development/libraries/qt-5/5.6/qtdoc.nix b/pkgs/development/libraries/qt-5/5.6/qtdoc.nix
deleted file mode 100644
index 578ea6ba0b2..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtdoc.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ qtSubmodule, qtdeclarative }:
-
-qtSubmodule {
-  name = "qtdoc";
-  qtInputs = [ qtdeclarative ];
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtenginio.nix b/pkgs/development/libraries/qt-5/5.6/qtenginio.nix
deleted file mode 100644
index b860a73ef89..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtenginio.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ qtSubmodule, qtdeclarative }:
-
-qtSubmodule {
-  name = "qtenginio";
-  qtInputs = [ qtdeclarative ];
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtgraphicaleffects.nix b/pkgs/development/libraries/qt-5/5.6/qtgraphicaleffects.nix
deleted file mode 100644
index 3273f12eb83..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtgraphicaleffects.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ qtSubmodule, qtdeclarative }:
-
-qtSubmodule {
-  name = "qtgraphicaleffects";
-  qtInputs = [ qtdeclarative ];
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtimageformats.nix b/pkgs/development/libraries/qt-5/5.6/qtimageformats.nix
deleted file mode 100644
index 03d0fffbe80..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtimageformats.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ qtSubmodule, qtbase }:
-
-qtSubmodule {
-  name = "qtimageformats";
-  qtInputs = [ qtbase ];
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtlocation.nix b/pkgs/development/libraries/qt-5/5.6/qtlocation.nix
deleted file mode 100644
index 1e134057c4b..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtlocation.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ qtSubmodule, qtbase, qtmultimedia }:
-
-qtSubmodule {
-  name = "qtlocation";
-  qtInputs = [ qtbase qtmultimedia ];
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtmultimedia.nix b/pkgs/development/libraries/qt-5/5.6/qtmultimedia.nix
deleted file mode 100644
index 20e6e364799..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtmultimedia.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-{ qtSubmodule, qtbase, qtdeclarative, pkgconfig
-, alsaLib, gstreamer, gst-plugins-base, libpulseaudio
-}:
-
-qtSubmodule {
-  name = "qtmultimedia";
-  qtInputs = [ qtbase qtdeclarative ];
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [
-    alsaLib gstreamer gst-plugins-base libpulseaudio
-  ];
-  qmakeFlags = [ "GST_VERSION=1.0" ];
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtquickcontrols.nix b/pkgs/development/libraries/qt-5/5.6/qtquickcontrols.nix
deleted file mode 100644
index 93a864621b8..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtquickcontrols.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ qtSubmodule, qtdeclarative }:
-
-qtSubmodule {
-  name = "qtquickcontrols";
-  qtInputs = [ qtdeclarative ];
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtquickcontrols2.nix b/pkgs/development/libraries/qt-5/5.6/qtquickcontrols2.nix
deleted file mode 100644
index 19750f2fd99..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtquickcontrols2.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ qtSubmodule, qtdeclarative }:
-
-qtSubmodule {
-  name = "qtquickcontrols2";
-  qtInputs = [ qtdeclarative ];
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtscript/default.nix b/pkgs/development/libraries/qt-5/5.6/qtscript/default.nix
deleted file mode 100644
index 127766e2ebd..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtscript/default.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{ qtSubmodule, qtbase, qttools }:
-
-qtSubmodule {
-  name = "qtscript";
-  qtInputs = [ qtbase qttools ];
-  patches = [ ./0001-glib-2.32.patch ];
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtsensors.nix b/pkgs/development/libraries/qt-5/5.6/qtsensors.nix
deleted file mode 100644
index 61e64dc47e4..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtsensors.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ qtSubmodule, qtbase, qtdeclarative }:
-
-qtSubmodule {
-  name = "qtsensors";
-  qtInputs = [ qtbase qtdeclarative ];
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtserialport/0001-dlopen-serialport-udev.patch b/pkgs/development/libraries/qt-5/5.6/qtserialport/0001-dlopen-serialport-udev.patch
deleted file mode 100644
index 9893fdff9a5..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtserialport/0001-dlopen-serialport-udev.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From d81c2c870b9bea8fb8e6b85baefb06542f568338 Mon Sep 17 00:00:00 2001
-From: Thomas Tuegel <ttuegel@gmail.com>
-Date: Sun, 23 Aug 2015 09:16:02 -0500
-Subject: [PATCH] dlopen serialport udev
-
----
- src/serialport/qtudev_p.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/serialport/qtudev_p.h b/src/serialport/qtudev_p.h
-index 6f2cabd..81b9849 100644
---- a/src/serialport/qtudev_p.h
-+++ b/src/serialport/qtudev_p.h
-@@ -105,10 +105,9 @@ inline QFunctionPointer resolveSymbol(QLibrary *udevLibrary, const char *symbolN
- inline bool resolveSymbols(QLibrary *udevLibrary)
- {
-     if (!udevLibrary->isLoaded()) {
--        udevLibrary->setFileNameAndVersion(QStringLiteral("udev"), 1);
-+        udevLibrary->setFileNameAndVersion(QLatin1String(NIXPKGS_LIBUDEV), 1);
-         if (!udevLibrary->load()) {
--            udevLibrary->setFileNameAndVersion(QStringLiteral("udev"), 0);
-+            udevLibrary->setFileNameAndVersion(QLatin1String(NIXPKGS_LIBUDEV), 0);
-             if (!udevLibrary->load()) {
-                 qWarning("Failed to load the library: %s, supported version(s): %i and %i", qPrintable(udevLibrary->fileName()), 1, 0);
-                 return false;
--- 
-2.5.0
-
diff --git a/pkgs/development/libraries/qt-5/5.6/qtserialport/default.nix b/pkgs/development/libraries/qt-5/5.6/qtserialport/default.nix
deleted file mode 100644
index 925e8a808f2..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtserialport/default.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{ stdenv, qtSubmodule, lib, copyPathsToStore, qtbase, substituteAll, systemd }:
-
-let inherit (lib) getLib optional; in
-
-qtSubmodule {
-  name = "qtserialport";
-  qtInputs = [ qtbase ];
-  patches =  copyPathsToStore (lib.readPathsFromFile ./. ./series);
-  NIX_CFLAGS_COMPILE =
-    optional stdenv.isLinux
-    ''-DNIXPKGS_LIBUDEV="${getLib systemd}/lib/libudev"'';
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtserialport/series b/pkgs/development/libraries/qt-5/5.6/qtserialport/series
deleted file mode 100644
index 83f4abf094e..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtserialport/series
+++ /dev/null
@@ -1 +0,0 @@
-qtserialport-dlopen-udev.patch
diff --git a/pkgs/development/libraries/qt-5/5.6/qtsvg.nix b/pkgs/development/libraries/qt-5/5.6/qtsvg.nix
deleted file mode 100644
index b9ccac7cf93..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtsvg.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ qtSubmodule, qtbase }:
-
-qtSubmodule {
-  name = "qtsvg";
-  qtInputs = [ qtbase ];
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qttools/cmake-paths.patch b/pkgs/development/libraries/qt-5/5.6/qttools/cmake-paths.patch
deleted file mode 100644
index fe5bcadbe9a..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qttools/cmake-paths.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-Index: qttools-opensource-src-5.5.1/src/assistant/help/Qt5HelpConfigExtras.cmake.in
-===================================================================
---- qttools-opensource-src-5.5.1.orig/src/assistant/help/Qt5HelpConfigExtras.cmake.in
-+++ qttools-opensource-src-5.5.1/src/assistant/help/Qt5HelpConfigExtras.cmake.in
-@@ -2,11 +2,10 @@
- if (NOT TARGET Qt5::qcollectiongenerator)
-     add_executable(Qt5::qcollectiongenerator IMPORTED)
- 
--!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5Help_install_prefix}/$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\")
--!!ELSE
--    set(imported_location \"$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\")
--!!ENDIF
-+    set(imported_location \"@NIX_OUT@/$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\")
-+    if(NOT EXISTS \"${imported_location}\")
-+        set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}qcollectiongenerator$$CMAKE_BIN_SUFFIX\")
-+    endif()
-     _qt5_Help_check_file_exists(${imported_location})
- 
-     set_target_properties(Qt5::qcollectiongenerator PROPERTIES
-Index: qttools-opensource-src-5.5.1/src/linguist/Qt5LinguistToolsConfig.cmake.in
-===================================================================
---- qttools-opensource-src-5.5.1.orig/src/linguist/Qt5LinguistToolsConfig.cmake.in
-+++ qttools-opensource-src-5.5.1/src/linguist/Qt5LinguistToolsConfig.cmake.in
-@@ -44,11 +44,10 @@ endmacro()
- if (NOT TARGET Qt5::lrelease)
-     add_executable(Qt5::lrelease IMPORTED)
- 
--!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5_linguisttools_install_prefix}/$${CMAKE_BIN_DIR}lrelease$$CMAKE_BIN_SUFFIX\")
--!!ELSE
--    set(imported_location \"$${CMAKE_BIN_DIR}lrelease$$CMAKE_BIN_SUFFIX\")
--!!ENDIF
-+    set(imported_location \"@NIX_OUT@/$${CMAKE_BIN_DIR}lrelease$$CMAKE_BIN_SUFFIX\")
-+    if(NOT EXISTS \"${imported_location}\")
-+        set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}lrelease$$CMAKE_BIN_SUFFIX\")
-+    endif()
-     _qt5_LinguistTools_check_file_exists(${imported_location})
- 
-     set_target_properties(Qt5::lrelease PROPERTIES
-@@ -59,11 +58,10 @@ endif()
- if (NOT TARGET Qt5::lupdate)
-     add_executable(Qt5::lupdate IMPORTED)
- 
--!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5_linguisttools_install_prefix}/$${CMAKE_BIN_DIR}lupdate$$CMAKE_BIN_SUFFIX\")
--!!ELSE
--    set(imported_location \"$${CMAKE_BIN_DIR}lupdate$$CMAKE_BIN_SUFFIX\")
--!!ENDIF
-+    set(imported_location \"@NIX_OUT@/$${CMAKE_BIN_DIR}lupdate$$CMAKE_BIN_SUFFIX\")
-+    if(NOT EXISTS \"${imported_location}\")
-+        set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}lupdate$$CMAKE_BIN_SUFFIX\")
-+    endif()
-     _qt5_LinguistTools_check_file_exists(${imported_location})
- 
-     set_target_properties(Qt5::lupdate PROPERTIES
-@@ -74,11 +72,10 @@ endif()
- if (NOT TARGET Qt5::lconvert)
-     add_executable(Qt5::lconvert IMPORTED)
- 
--!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
--    set(imported_location \"${_qt5_linguisttools_install_prefix}/$${CMAKE_BIN_DIR}lconvert$$CMAKE_BIN_SUFFIX\")
--!!ELSE
--    set(imported_location \"$${CMAKE_BIN_DIR}lconvert$$CMAKE_BIN_SUFFIX\")
--!!ENDIF
-+    set(imported_location \"@NIX_OUT@/$${CMAKE_BIN_DIR}lconvert$$CMAKE_BIN_SUFFIX\")
-+    if(NOT EXISTS \"${imported_location}\")
-+        set(imported_location \"@NIX_DEV@/$${CMAKE_BIN_DIR}lconvert$$CMAKE_BIN_SUFFIX\")
-+    endif()
-     _qt5_LinguistTools_check_file_exists(${imported_location})
- 
-     set_target_properties(Qt5::lconvert PROPERTIES
diff --git a/pkgs/development/libraries/qt-5/5.6/qttools/default.nix b/pkgs/development/libraries/qt-5/5.6/qttools/default.nix
deleted file mode 100644
index 57b1b46a9c5..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qttools/default.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{ qtSubmodule, lib, copyPathsToStore, qtbase }:
-
-qtSubmodule {
-  name = "qttools";
-  qtInputs = [ qtbase ];
-  patches = copyPathsToStore (lib.readPathsFromFile ./. ./series);
-  postFixup = ''
-    moveToOutput "bin/qdbus" "$out"
-    moveToOutput "bin/qdbusviewer" "$out"
-    moveToOutput "bin/qtpaths" "$out"
-  '';
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qttools/series b/pkgs/development/libraries/qt-5/5.6/qttools/series
deleted file mode 100644
index 6cc1d3b87bc..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qttools/series
+++ /dev/null
@@ -1 +0,0 @@
-cmake-paths.patch
diff --git a/pkgs/development/libraries/qt-5/5.6/qttranslations.nix b/pkgs/development/libraries/qt-5/5.6/qttranslations.nix
deleted file mode 100644
index 50fc8cf6826..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qttranslations.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ qtSubmodule, qttools }:
-
-qtSubmodule {
-  name = "qttranslations";
-  qtInputs = [ qttools ];
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwayland.nix b/pkgs/development/libraries/qt-5/5.6/qtwayland.nix
deleted file mode 100644
index 6d887f7c650..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtwayland.nix
+++ /dev/null
@@ -1,8 +0,0 @@
-{ qtSubmodule, qtbase, qtquickcontrols, wayland, pkgconfig }:
-
-qtSubmodule {
-  name = "qtwayland";
-  qtInputs = [ qtbase qtquickcontrols ];
-  buildInputs = [ wayland ];
-  nativeBuildInputs = [ pkgconfig ];
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebchannel.nix b/pkgs/development/libraries/qt-5/5.6/qtwebchannel.nix
deleted file mode 100644
index fd7a3c52026..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtwebchannel.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{ qtSubmodule, qtbase, qtdeclarative }:
-
-qtSubmodule {
-  name = "qtwebchannel";
-  qtInputs = [ qtbase qtdeclarative ];
-}
-
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebengine-seccomp.patch b/pkgs/development/libraries/qt-5/5.6/qtwebengine-seccomp.patch
new file mode 100644
index 00000000000..bf6af805982
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.6/qtwebengine-seccomp.patch
@@ -0,0 +1,24 @@
+Backported to Qt 5.6 for epoll_pwait fix on newer glibc
+Part of upstream Chromium's 4e8083b4ab953ba298aedfc4e79d464be15e4012
+Review URL: https://codereview.chromium.org/1613883002
+---
+diff --git a/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+index 10278dc5fc9b..b30b3e6acef6 100644
+--- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -414,6 +414,7 @@ bool SyscallSets::IsAllowedEpoll(int sysno) {
+     case __NR_epoll_create:
+     case __NR_epoll_wait:
+ #endif
++    case __NR_epoll_pwait:
+     case __NR_epoll_create1:
+     case __NR_epoll_ctl:
+       return true;
+@@ -421,7 +422,6 @@ bool SyscallSets::IsAllowedEpoll(int sysno) {
+ #if defined(__x86_64__)
+     case __NR_epoll_ctl_old:
+ #endif
+-    case __NR_epoll_pwait:
+ #if defined(__x86_64__)
+     case __NR_epoll_wait_old:
+ #endif
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebengine.patch b/pkgs/development/libraries/qt-5/5.6/qtwebengine.patch
deleted file mode 100644
index 65a604d2534..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtwebengine.patch
+++ /dev/null
@@ -1,874 +0,0 @@
---- a/src/3rdparty/chromium/tools/clang/scripts/update.py	2016-05-26 04:58:54.000000000 -0800
-+++ b/src/3rdparty/chromium/tools/clang/scripts/update.py	2016-11-04 08:35:34.956154012 -0800
-@@ -3,12 +3,12 @@
- # Use of this source code is governed by a BSD-style license that can be
- # found in the LICENSE file.
- 
--"""Windows can't run .sh files, so this is a Python implementation of
--update.sh. This script should replace update.sh on all platforms eventually."""
-+"""This script is used to download prebuilt clang binaries.
-+
-+It is also used by package.py to build the prebuilt clang binaries."""
- 
- import argparse
--import contextlib
--import cStringIO
-+import distutils.spawn
- import glob
- import os
- import pipes
-@@ -18,6 +18,7 @@
- import stat
- import sys
- import tarfile
-+import tempfile
- import time
- import urllib2
- import zipfile
-@@ -25,19 +26,16 @@
- # Do NOT CHANGE this if you don't know what you're doing -- see
- # https://code.google.com/p/chromium/wiki/UpdatingClang
- # Reverting problematic clang rolls is safe, though.
--# Note: this revision is only used for Windows. Other platforms use update.sh.
--# TODO(thakis): Use the same revision on Windows and non-Windows.
--# TODO(thakis): Remove update.sh, use update.py everywhere.
--LLVM_WIN_REVISION = '239674'
-+CLANG_REVISION = '239674'
- 
- use_head_revision = 'LLVM_FORCE_HEAD_REVISION' in os.environ
- if use_head_revision:
--  LLVM_WIN_REVISION = 'HEAD'
-+  CLANG_REVISION = 'HEAD'
- 
- # This is incremented when pushing a new build of Clang at the same revision.
- CLANG_SUB_REVISION=1
- 
--PACKAGE_VERSION = "%s-%s" % (LLVM_WIN_REVISION, CLANG_SUB_REVISION)
-+PACKAGE_VERSION = "%s-%s" % (CLANG_REVISION, CLANG_SUB_REVISION)
- 
- # Path constants. (All of these should be absolute paths.)
- THIS_DIR = os.path.abspath(os.path.dirname(__file__))
-@@ -50,17 +48,26 @@
- CHROME_TOOLS_SHIM_DIR = os.path.join(LLVM_DIR, 'tools', 'chrometools')
- LLVM_BUILD_DIR = os.path.join(CHROMIUM_DIR, 'third_party', 'llvm-build',
-                               'Release+Asserts')
--COMPILER_RT_BUILD_DIR = os.path.join(LLVM_BUILD_DIR, '32bit-compiler-rt')
-+COMPILER_RT_BUILD_DIR = os.path.join(LLVM_BUILD_DIR, 'compiler-rt')
- CLANG_DIR = os.path.join(LLVM_DIR, 'tools', 'clang')
- LLD_DIR = os.path.join(LLVM_DIR, 'tools', 'lld')
--COMPILER_RT_DIR = os.path.join(LLVM_DIR, 'projects', 'compiler-rt')
-+# compiler-rt is built as part of the regular LLVM build on Windows to get
-+# the 64-bit runtime, and out-of-tree elsewhere.
-+# TODO(thakis): Try to unify this.
-+if sys.platform == 'win32':
-+  COMPILER_RT_DIR = os.path.join(LLVM_DIR, 'projects', 'compiler-rt')
-+else:
-+  COMPILER_RT_DIR = os.path.join(LLVM_DIR, 'compiler-rt')
- LIBCXX_DIR = os.path.join(LLVM_DIR, 'projects', 'libcxx')
- LIBCXXABI_DIR = os.path.join(LLVM_DIR, 'projects', 'libcxxabi')
- LLVM_BUILD_TOOLS_DIR = os.path.abspath(
-     os.path.join(LLVM_DIR, '..', 'llvm-build-tools'))
--STAMP_FILE = os.path.join(LLVM_DIR, '..', 'llvm-build', 'cr_build_revision')
-+STAMP_FILE = os.path.normpath(
-+    os.path.join(LLVM_DIR, '..', 'llvm-build', 'cr_build_revision'))
- BINUTILS_DIR = os.path.join(THIRD_PARTY_DIR, 'binutils')
--VERSION = '3.7.0'
-+VERSION = '3.8.0'
-+ANDROID_NDK_DIR = os.path.join(
-+    CHROMIUM_DIR, 'third_party', 'android_tools', 'ndk')
- 
- # URL for pre-built binaries.
- CDS_URL = 'https://commondatastorage.googleapis.com/chromium-browser-clang'
-@@ -74,40 +81,75 @@
-   """Download url into output_file."""
-   CHUNK_SIZE = 4096
-   TOTAL_DOTS = 10
--  sys.stdout.write('Downloading %s ' % url)
--  sys.stdout.flush()
--  response = urllib2.urlopen(url)
--  total_size = int(response.info().getheader('Content-Length').strip())
--  bytes_done = 0
--  dots_printed = 0
-+  num_retries = 3
-+  retry_wait_s = 5  # Doubled at each retry.
-+
-   while True:
--    chunk = response.read(CHUNK_SIZE)
--    if not chunk:
--      break
--    output_file.write(chunk)
--    bytes_done += len(chunk)
--    num_dots = TOTAL_DOTS * bytes_done / total_size
--    sys.stdout.write('.' * (num_dots - dots_printed))
--    sys.stdout.flush()
--    dots_printed = num_dots
--  print ' Done.'
-+    try:
-+      sys.stdout.write('Downloading %s ' % url)
-+      sys.stdout.flush()
-+      response = urllib2.urlopen(url)
-+      total_size = int(response.info().getheader('Content-Length').strip())
-+      bytes_done = 0
-+      dots_printed = 0
-+      while True:
-+        chunk = response.read(CHUNK_SIZE)
-+        if not chunk:
-+          break
-+        output_file.write(chunk)
-+        bytes_done += len(chunk)
-+        num_dots = TOTAL_DOTS * bytes_done / total_size
-+        sys.stdout.write('.' * (num_dots - dots_printed))
-+        sys.stdout.flush()
-+        dots_printed = num_dots
-+      if bytes_done != total_size:
-+        raise urllib2.URLError("only got %d of %d bytes" %
-+                               (bytes_done, total_size))
-+      print ' Done.'
-+      return
-+    except urllib2.URLError as e:
-+      sys.stdout.write('\n')
-+      print e
-+      if num_retries == 0 or isinstance(e, urllib2.HTTPError) and e.code == 404:
-+        raise e
-+      num_retries -= 1
-+      print 'Retrying in %d s ...' % retry_wait_s
-+      time.sleep(retry_wait_s)
-+      retry_wait_s *= 2
-+
-+
-+def EnsureDirExists(path):
-+  if not os.path.exists(path):
-+    print "Creating directory %s" % path
-+    os.makedirs(path)
-+
-+
-+def DownloadAndUnpack(url, output_dir):
-+  with tempfile.TemporaryFile() as f:
-+    DownloadUrl(url, f)
-+    f.seek(0)
-+    EnsureDirExists(output_dir)
-+    if url.endswith('.zip'):
-+      zipfile.ZipFile(f).extractall(path=output_dir)
-+    else:
-+      tarfile.open(mode='r:gz', fileobj=f).extractall(path=output_dir)
- 
- 
- def ReadStampFile():
-   """Return the contents of the stamp file, or '' if it doesn't exist."""
-   try:
-     with open(STAMP_FILE, 'r') as f:
--      return f.read()
-+      return f.read().rstrip()
-   except IOError:
-     return ''
- 
- 
- def WriteStampFile(s):
-   """Write s to the stamp file."""
--  if not os.path.exists(os.path.dirname(STAMP_FILE)):
--    os.makedirs(os.path.dirname(STAMP_FILE))
-+  EnsureDirExists(os.path.dirname(STAMP_FILE))
-   with open(STAMP_FILE, 'w') as f:
-     f.write(s)
-+    f.write('\n')
- 
- 
- def GetSvnRevision(svn_repo):
-@@ -129,6 +171,13 @@
-   shutil.rmtree(dir, onerror=ChmodAndRetry)
- 
- 
-+def RmCmakeCache(dir):
-+  """Delete CMakeCache.txt files under dir recursively."""
-+  for dirpath, _, files in os.walk(dir):
-+    if 'CMakeCache.txt' in files:
-+      os.remove(os.path.join(dirpath, 'CMakeCache.txt'))
-+
-+
- def RunCommand(command, msvc_arch=None, env=None, fail_hard=True):
-   """Run command and return success (True) or failure; or if fail_hard is
-      True, exit on failure.  If msvc_arch is set, runs the command in a
-@@ -170,8 +219,8 @@
- def CopyDirectoryContents(src, dst, filename_filter=None):
-   """Copy the files from directory src to dst
-   with an optional filename filter."""
--  if not os.path.exists(dst):
--    os.makedirs(dst)
-+  dst = os.path.realpath(dst)  # realpath() in case dst ends in /..
-+  EnsureDirExists(dst)
-   for root, _, files in os.walk(src):
-     for f in files:
-       if filename_filter and not re.match(filename_filter, f):
-@@ -181,9 +230,9 @@
- 
- def Checkout(name, url, dir):
-   """Checkout the SVN module at url into dir. Use name for the log message."""
--  print "Checking out %s r%s into '%s'" % (name, LLVM_WIN_REVISION, dir)
-+  print "Checking out %s r%s into '%s'" % (name, CLANG_REVISION, dir)
- 
--  command = ['svn', 'checkout', '--force', url + '@' + LLVM_WIN_REVISION, dir]
-+  command = ['svn', 'checkout', '--force', url + '@' + CLANG_REVISION, dir]
-   if RunCommand(command, fail_hard=False):
-     return
- 
-@@ -195,120 +244,9 @@
-   RunCommand(command)
- 
- 
--def RevertPreviouslyPatchedFiles():
--  print 'Reverting previously patched files'
--  files = [
--    '%(clang)s/test/Index/crash-recovery-modules.m',
--    '%(clang)s/unittests/libclang/LibclangTest.cpp',
--    '%(compiler_rt)s/lib/asan/asan_rtl.cc',
--    '%(compiler_rt)s/test/asan/TestCases/Linux/new_array_cookie_test.cc',
--    '%(llvm)s/test/DebugInfo/gmlt.ll',
--    '%(llvm)s/lib/CodeGen/SpillPlacement.cpp',
--    '%(llvm)s/lib/CodeGen/SpillPlacement.h',
--    '%(llvm)s/lib/Transforms/Instrumentation/MemorySanitizer.cpp',
--    '%(clang)s/test/Driver/env.c',
--    '%(clang)s/lib/Frontend/InitPreprocessor.cpp',
--    '%(clang)s/test/Frontend/exceptions.c',
--    '%(clang)s/test/Preprocessor/predefined-exceptions.m',
--    '%(llvm)s/test/Bindings/Go/go.test',
--    '%(clang)s/lib/Parse/ParseExpr.cpp',
--    '%(clang)s/lib/Parse/ParseTemplate.cpp',
--    '%(clang)s/lib/Sema/SemaDeclCXX.cpp',
--    '%(clang)s/lib/Sema/SemaExprCXX.cpp',
--    '%(clang)s/test/SemaCXX/default2.cpp',
--    '%(clang)s/test/SemaCXX/typo-correction-delayed.cpp',
--    '%(compiler_rt)s/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc',
--    '%(compiler_rt)s/test/tsan/signal_segv_handler.cc',
--    '%(compiler_rt)s/lib/sanitizer_common/sanitizer_coverage_libcdep.cc',
--    '%(compiler_rt)s/cmake/config-ix.cmake',
--    '%(compiler_rt)s/CMakeLists.txt',
--    '%(compiler_rt)s/lib/ubsan/ubsan_platform.h',
--    ]
--  for f in files:
--    f = f % {
--        'clang': CLANG_DIR,
--        'compiler_rt': COMPILER_RT_DIR,
--        'llvm': LLVM_DIR,
--        }
--    if os.path.exists(f):
--      os.remove(f)  # For unversioned files.
--      RunCommand(['svn', 'revert', f])
--
--
--def ApplyLocalPatches():
--  # There's no patch program on Windows by default.  We don't need patches on
--  # Windows yet, and maybe this not working on Windows will motivate us to
--  # remove patches over time.
--  assert sys.platform != 'win32'
--
--  # Apply patch for tests failing with --disable-pthreads (llvm.org/PR11974)
--  clang_patches = [ r"""\
----- test/Index/crash-recovery-modules.m	(revision 202554)
--+++ test/Index/crash-recovery-modules.m	(working copy)
--@@ -12,6 +12,8 @@
-- 
-- // REQUIRES: crash-recovery
-- // REQUIRES: shell
--+// XFAIL: *
--+//    (PR11974)
-- 
-- @import Crash;
--""", r"""\
----- unittests/libclang/LibclangTest.cpp (revision 215949)
--+++ unittests/libclang/LibclangTest.cpp (working copy)
--@@ -431,7 +431,7 @@
--   EXPECT_EQ(0U, clang_getNumDiagnostics(ClangTU));
-- }
--
---TEST_F(LibclangReparseTest, ReparseWithModule) {
--+TEST_F(LibclangReparseTest, DISABLED_ReparseWithModule) {
--   const char *HeaderTop = "#ifndef H\n#define H\nstruct Foo { int bar;";
--   const char *HeaderBottom = "\n};\n#endif\n";
--   const char *MFile = "#include \"HeaderFile.h\"\nint main() {"
--"""
--      ]
--
--  # This Go bindings test doesn't work after bootstrap on Linux, PR21552.
--  llvm_patches = [ r"""\
----- test/Bindings/Go/go.test    (revision 223109)
--+++ test/Bindings/Go/go.test    (working copy)
--@@ -1,3 +1,3 @@
---; RUN: llvm-go test llvm.org/llvm/bindings/go/llvm
--+; RUN: true
-- 
-- ; REQUIRES: shell
--"""
--      ]
--
--  # The UBSan run-time, which is now bundled with the ASan run-time, doesn't
--  # work on Mac OS X 10.8 (PR23539).
--  compiler_rt_patches = [ r"""\
----- CMakeLists.txt	(revision 241602)
--+++ CMakeLists.txt	(working copy)
--@@ -305,6 +305,7 @@
--       list(APPEND SANITIZER_COMMON_SUPPORTED_OS iossim)
--     endif()
--   endif()
--+  set(SANITIZER_MIN_OSX_VERSION "10.7")
--   if(SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.7")
--     message(FATAL_ERROR "Too old OS X version: ${SANITIZER_MIN_OSX_VERSION}")
--   endif()
--"""
--      ]
--
--  for path, patches in [(LLVM_DIR, llvm_patches),
--                        (CLANG_DIR, clang_patches),
--                        (COMPILER_RT_DIR, compiler_rt_patches)]:
--    print 'Applying patches in', path
--    for patch in patches:
--      print patch
--      p = subprocess.Popen( ['patch', '-p0', '-d', path], stdin=subprocess.PIPE)
--      (stdout, stderr) = p.communicate(input=patch)
--      if p.returncode != 0:
--        raise RuntimeError('stdout %s, stderr %s' % (stdout, stderr))
--
--
- def DeleteChromeToolsShim():
-+  OLD_SHIM_DIR = os.path.join(LLVM_DIR, 'tools', 'zzz-chrometools')
-+  shutil.rmtree(OLD_SHIM_DIR, ignore_errors=True)
-   shutil.rmtree(CHROME_TOOLS_SHIM_DIR, ignore_errors=True)
- 
- 
-@@ -337,6 +275,25 @@
-     f.write('endif (CHROMIUM_TOOLS_SRC)\n')
- 
- 
-+def MaybeDownloadHostGcc(args):
-+  """Downloads gcc 4.8.2 if needed and makes sure args.gcc_toolchain is set."""
-+  if not sys.platform.startswith('linux') or args.gcc_toolchain:
-+    return
-+
-+  if subprocess.check_output(['gcc', '-dumpversion']).rstrip() < '4.7.0':
-+    # We need a newer gcc version.
-+    gcc_dir = os.path.join(LLVM_BUILD_TOOLS_DIR, 'gcc482precise')
-+    if not os.path.exists(gcc_dir):
-+      print 'Downloading pre-built GCC 4.8.2...'
-+      DownloadAndUnpack(
-+          CDS_URL + '/tools/gcc482precise.tgz', LLVM_BUILD_TOOLS_DIR)
-+    args.gcc_toolchain = gcc_dir
-+  else:
-+    # Always set gcc_toolchain; llvm-symbolizer needs the bundled libstdc++.
-+    args.gcc_toolchain = \
-+        os.path.dirname(os.path.dirname(distutils.spawn.find_executable('gcc')))
-+
-+
- def AddCMakeToPath():
-   """Download CMake and add it to PATH."""
-   if sys.platform == 'win32':
-@@ -345,20 +302,10 @@
-                              'cmake-3.2.2-win32-x86', 'bin')
-   else:
-     suffix = 'Darwin' if sys.platform == 'darwin' else 'Linux'
--    zip_name = 'cmake310_%s.tgz' % suffix
--    cmake_dir = os.path.join(LLVM_BUILD_TOOLS_DIR, 'cmake310', 'bin')
-+    zip_name = 'cmake322_%s.tgz' % suffix
-+    cmake_dir = os.path.join(LLVM_BUILD_TOOLS_DIR, 'cmake322', 'bin')
-   if not os.path.exists(cmake_dir):
--    if not os.path.exists(LLVM_BUILD_TOOLS_DIR):
--      os.makedirs(LLVM_BUILD_TOOLS_DIR)
--    # The cmake archive is smaller than 20 MB, small enough to keep in memory:
--    with contextlib.closing(cStringIO.StringIO()) as f:
--      DownloadUrl(CDS_URL + '/tools/' + zip_name, f)
--      f.seek(0)
--      if zip_name.endswith('.zip'):
--        zipfile.ZipFile(f).extractall(path=LLVM_BUILD_TOOLS_DIR)
--      else:
--        tarfile.open(mode='r:gz', fileobj=f).extractall(path=
--            LLVM_BUILD_TOOLS_DIR)
-+    DownloadAndUnpack(CDS_URL + '/tools/' + zip_name, LLVM_BUILD_TOOLS_DIR)
-   os.environ['PATH'] = cmake_dir + os.pathsep + os.environ.get('PATH', '')
- 
- vs_version = None
-@@ -383,37 +330,61 @@
- 
- def UpdateClang(args):
-   print 'Updating Clang to %s...' % PACKAGE_VERSION
--  if ReadStampFile() == PACKAGE_VERSION:
--    print 'Already up to date.'
--    return 0
-+
-+  need_gold_plugin = 'LLVM_DOWNLOAD_GOLD_PLUGIN' in os.environ or (
-+      sys.platform.startswith('linux') and
-+      'buildtype=Official' in os.environ.get('GYP_DEFINES', '') and
-+      'branding=Chrome' in os.environ.get('GYP_DEFINES', ''))
-+
-+  if ReadStampFile() == PACKAGE_VERSION and not args.force_local_build:
-+    print 'Clang is already up to date.'
-+    if not need_gold_plugin or os.path.exists(
-+        os.path.join(LLVM_BUILD_DIR, "lib/LLVMgold.so")):
-+      return 0
- 
-   # Reset the stamp file in case the build is unsuccessful.
-   WriteStampFile('')
- 
-   if not args.force_local_build:
-     cds_file = "clang-%s.tgz" %  PACKAGE_VERSION
--    cds_full_url = CDS_URL + '/Win/' + cds_file
-+    if sys.platform == 'win32':
-+      cds_full_url = CDS_URL + '/Win/' + cds_file
-+    elif sys.platform == 'darwin':
-+      cds_full_url = CDS_URL + '/Mac/' + cds_file
-+    else:
-+      assert sys.platform.startswith('linux')
-+      cds_full_url = CDS_URL + '/Linux_x64/' + cds_file
- 
--    # Check if there's a prebuilt binary and if so just fetch that. That's
--    # faster, and goma relies on having matching binary hashes on client and
--    # server too.
--    print 'Trying to download prebuilt clang'
--
--    # clang packages are smaller than 50 MB, small enough to keep in memory.
--    with contextlib.closing(cStringIO.StringIO()) as f:
--      try:
--        DownloadUrl(cds_full_url, f)
--        f.seek(0)
--        tarfile.open(mode='r:gz', fileobj=f).extractall(path=LLVM_BUILD_DIR)
--        print 'clang %s unpacked' % PACKAGE_VERSION
--        WriteStampFile(PACKAGE_VERSION)
--        return 0
--      except urllib2.HTTPError:
--        print 'Did not find prebuilt clang %s, building locally' % cds_file
-+    print 'Downloading prebuilt clang'
-+    if os.path.exists(LLVM_BUILD_DIR):
-+      RmTree(LLVM_BUILD_DIR)
-+    try:
-+      DownloadAndUnpack(cds_full_url, LLVM_BUILD_DIR)
-+      print 'clang %s unpacked' % PACKAGE_VERSION
-+      # Download the gold plugin if requested to by an environment variable.
-+      # This is used by the CFI ClusterFuzz bot, and it's required for official
-+      # builds on linux.
-+      if need_gold_plugin:
-+        RunCommand(['python', CHROMIUM_DIR+'/build/download_gold_plugin.py'])
-+      WriteStampFile(PACKAGE_VERSION)
-+      return 0
-+    except urllib2.URLError:
-+      print 'Failed to download prebuilt clang %s' % cds_file
-+      print 'Use --force-local-build if you want to build locally.'
-+      print 'Exiting.'
-+      return 1
-+
-+  if args.with_android and not os.path.exists(ANDROID_NDK_DIR):
-+    print 'Android NDK not found at ' + ANDROID_NDK_DIR
-+    print 'The Android NDK is needed to build a Clang whose -fsanitize=address'
-+    print 'works on Android. See '
-+    print 'http://code.google.com/p/chromium/wiki/AndroidBuildInstructions'
-+    print 'for how to install the NDK, or pass --without-android.'
-+    return 1
- 
-+  MaybeDownloadHostGcc(args)
-   AddCMakeToPath()
- 
--  RevertPreviouslyPatchedFiles()
-   DeleteChromeToolsShim()
- 
-   Checkout('LLVM', LLVM_REPO_URL + '/llvm/trunk', LLVM_DIR)
-@@ -429,10 +400,24 @@
-     # into it too (since OS X 10.6 doesn't have libc++abi.dylib either).
-     Checkout('libcxxabi', LLVM_REPO_URL + '/libcxxabi/trunk', LIBCXXABI_DIR)
- 
--  if args.with_patches and sys.platform != 'win32':
--    ApplyLocalPatches()
--
-   cc, cxx = None, None
-+  libstdcpp = None
-+  if args.gcc_toolchain:  # This option is only used on Linux.
-+    # Use the specified gcc installation for building.
-+    cc = os.path.join(args.gcc_toolchain, 'bin', 'gcc')
-+    cxx = os.path.join(args.gcc_toolchain, 'bin', 'g++')
-+
-+    if not os.access(cc, os.X_OK):
-+      print 'Invalid --gcc-toolchain: "%s"' % args.gcc_toolchain
-+      print '"%s" does not appear to be valid.' % cc
-+      return 1
-+
-+    # Set LD_LIBRARY_PATH to make auxiliary targets (tablegen, bootstrap
-+    # compiler, etc.) find the .so.
-+    libstdcpp = subprocess.check_output(
-+        [cxx, '-print-file-name=libstdc++.so.6']).rstrip()
-+    os.environ['LD_LIBRARY_PATH'] = os.path.dirname(libstdcpp)
-+
-   cflags = cxxflags = ldflags = []
- 
-   # LLVM uses C++11 starting in llvm 3.5. On Linux, this means libstdc++4.7+ is
-@@ -462,8 +447,7 @@
- 
-   if args.bootstrap:
-     print 'Building bootstrap compiler'
--    if not os.path.exists(LLVM_BOOTSTRAP_DIR):
--      os.makedirs(LLVM_BOOTSTRAP_DIR)
-+    EnsureDirExists(LLVM_BOOTSTRAP_DIR)
-     os.chdir(LLVM_BOOTSTRAP_DIR)
-     bootstrap_args = base_cmake_args + [
-         '-DLLVM_TARGETS_TO_BUILD=host',
-@@ -473,11 +457,16 @@
-         ]
-     if cc is not None:  bootstrap_args.append('-DCMAKE_C_COMPILER=' + cc)
-     if cxx is not None: bootstrap_args.append('-DCMAKE_CXX_COMPILER=' + cxx)
-+    RmCmakeCache('.')
-     RunCommand(['cmake'] + bootstrap_args + [LLVM_DIR], msvc_arch='x64')
-     RunCommand(['ninja'], msvc_arch='x64')
-     if args.run_tests:
-       RunCommand(['ninja', 'check-all'], msvc_arch='x64')
-     RunCommand(['ninja', 'install'], msvc_arch='x64')
-+    if args.gcc_toolchain:
-+      # Copy that gcc's stdlibc++.so.6 to the build dir, so the bootstrap
-+      # compiler can start.
-+      CopyFile(libstdcpp, os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'lib'))
- 
-     if sys.platform == 'win32':
-       cc = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang-cl.exe')
-@@ -489,6 +478,12 @@
-     else:
-       cc = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang')
-       cxx = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang++')
-+
-+    if args.gcc_toolchain:
-+      # Tell the bootstrap compiler to use a specific gcc prefix to search
-+      # for standard library headers and shared object files.
-+      cflags = ['--gcc-toolchain=' + args.gcc_toolchain]
-+      cxxflags = ['--gcc-toolchain=' + args.gcc_toolchain]
-     print 'Building final compiler'
- 
-   if sys.platform == 'darwin':
-@@ -543,7 +538,7 @@
-     binutils_incdir = os.path.join(BINUTILS_DIR, 'Linux_x64/Release/include')
- 
-   # If building at head, define a macro that plugins can use for #ifdefing
--  # out code that builds at head, but not at LLVM_WIN_REVISION or vice versa.
-+  # out code that builds at head, but not at CLANG_REVISION or vice versa.
-   if use_head_revision:
-     cflags += ['-DLLVM_FORCE_HEAD_REVISION']
-     cxxflags += ['-DLLVM_FORCE_HEAD_REVISION']
-@@ -555,8 +550,15 @@
-     deployment_env = os.environ.copy()
-     deployment_env['MACOSX_DEPLOYMENT_TARGET'] = deployment_target
- 
--  cmake_args = base_cmake_args + [
-+  cmake_args = []
-+  # TODO(thakis): Unconditionally append this to base_cmake_args instead once
-+  # compiler-rt can build with clang-cl on Windows (http://llvm.org/PR23698)
-+  cc_args = base_cmake_args if sys.platform != 'win32' else cmake_args
-+  if cc is not None:  cc_args.append('-DCMAKE_C_COMPILER=' + cc)
-+  if cxx is not None: cc_args.append('-DCMAKE_CXX_COMPILER=' + cxx)
-+  cmake_args += base_cmake_args + [
-       '-DLLVM_BINUTILS_INCDIR=' + binutils_incdir,
-+      '-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly',
-       '-DCMAKE_C_FLAGS=' + ' '.join(cflags),
-       '-DCMAKE_CXX_FLAGS=' + ' '.join(cxxflags),
-       '-DCMAKE_EXE_LINKER_FLAGS=' + ' '.join(ldflags),
-@@ -565,35 +567,44 @@
-       '-DCMAKE_INSTALL_PREFIX=' + LLVM_BUILD_DIR,
-       '-DCHROMIUM_TOOLS_SRC=%s' % os.path.join(CHROMIUM_DIR, 'tools', 'clang'),
-       '-DCHROMIUM_TOOLS=%s' % ';'.join(args.tools)]
--  # TODO(thakis): Unconditionally append this to base_cmake_args instead once
--  # compiler-rt can build with clang-cl on Windows (http://llvm.org/PR23698)
--  cc_args = base_cmake_args if sys.platform != 'win32' else cmake_args
--  if cc is not None:  cc_args.append('-DCMAKE_C_COMPILER=' + cc)
--  if cxx is not None: cc_args.append('-DCMAKE_CXX_COMPILER=' + cxx)
- 
--  if not os.path.exists(LLVM_BUILD_DIR):
--    os.makedirs(LLVM_BUILD_DIR)
-+  EnsureDirExists(LLVM_BUILD_DIR)
-   os.chdir(LLVM_BUILD_DIR)
-+  RmCmakeCache('.')
-   RunCommand(['cmake'] + cmake_args + [LLVM_DIR],
-              msvc_arch='x64', env=deployment_env)
--  RunCommand(['ninja'], msvc_arch='x64')
-+
-+  if args.gcc_toolchain:
-+    # Copy in the right stdlibc++.so.6 so clang can start.
-+    if not os.path.exists(os.path.join(LLVM_BUILD_DIR, 'lib')):
-+      os.mkdir(os.path.join(LLVM_BUILD_DIR, 'lib'))
-+    libstdcpp = subprocess.check_output(
-+        [cxx] + cxxflags + ['-print-file-name=libstdc++.so.6']).rstrip()
-+    CopyFile(libstdcpp, os.path.join(LLVM_BUILD_DIR, 'lib'))
-+
-+  # TODO(thakis): Remove "-d explain" once http://crbug.com/569337 is fixed.
-+  RunCommand(['ninja', '-d', 'explain'], msvc_arch='x64')
- 
-   if args.tools:
-     # If any Chromium tools were built, install those now.
-     RunCommand(['ninja', 'cr-install'], msvc_arch='x64')
- 
-   if sys.platform == 'darwin':
--    CopyFile(os.path.join(LLVM_BUILD_DIR, 'libc++.1.dylib'),
-+    CopyFile(os.path.join(libcxxbuild, 'libc++.1.dylib'),
-              os.path.join(LLVM_BUILD_DIR, 'bin'))
-     # See http://crbug.com/256342
-     RunCommand(['strip', '-x', os.path.join(LLVM_BUILD_DIR, 'bin', 'clang')])
-   elif sys.platform.startswith('linux'):
-     RunCommand(['strip', os.path.join(LLVM_BUILD_DIR, 'bin', 'clang')])
- 
--  # Do an x86 build of compiler-rt to get the 32-bit ASan run-time.
-+  # Do an out-of-tree build of compiler-rt.
-+  # On Windows, this is used to get the 32-bit ASan run-time.
-   # TODO(hans): Remove once the regular build above produces this.
--  if not os.path.exists(COMPILER_RT_BUILD_DIR):
--    os.makedirs(COMPILER_RT_BUILD_DIR)
-+  # On Mac and Linux, this is used to get the regular 64-bit run-time.
-+  # Do a clobbered build due to cmake changes.
-+  if os.path.isdir(COMPILER_RT_BUILD_DIR):
-+    RmTree(COMPILER_RT_BUILD_DIR)
-+  os.makedirs(COMPILER_RT_BUILD_DIR)
-   os.chdir(COMPILER_RT_BUILD_DIR)
-   # TODO(thakis): Add this once compiler-rt can build with clang-cl (see
-   # above).
-@@ -606,11 +617,17 @@
-       '-DCMAKE_CXX_FLAGS=' + ' '.join(cxxflags)]
-   if sys.platform != 'win32':
-     compiler_rt_args += ['-DLLVM_CONFIG_PATH=' +
--                         os.path.join(LLVM_BUILD_DIR, 'bin', 'llvm-config')]
--  RunCommand(['cmake'] + compiler_rt_args + [LLVM_DIR],
--              msvc_arch='x86', env=deployment_env)
-+                         os.path.join(LLVM_BUILD_DIR, 'bin', 'llvm-config'),
-+                        '-DSANITIZER_MIN_OSX_VERSION="10.7"']
-+  # compiler-rt is part of the llvm checkout on Windows but a stand-alone
-+  # directory elsewhere, see the TODO above COMPILER_RT_DIR.
-+  RmCmakeCache('.')
-+  RunCommand(['cmake'] + compiler_rt_args +
-+             [LLVM_DIR if sys.platform == 'win32' else COMPILER_RT_DIR],
-+             msvc_arch='x86', env=deployment_env)
-   RunCommand(['ninja', 'compiler-rt'], msvc_arch='x86')
- 
-+  # Copy select output to the main tree.
-   # TODO(hans): Make this (and the .gypi and .isolate files) version number
-   # independent.
-   if sys.platform == 'win32':
-@@ -620,17 +637,35 @@
-   else:
-     assert sys.platform.startswith('linux')
-     platform = 'linux'
--  asan_rt_lib_src_dir = os.path.join(COMPILER_RT_BUILD_DIR, 'lib', 'clang',
--                                     VERSION, 'lib', platform)
-+  asan_rt_lib_src_dir = os.path.join(COMPILER_RT_BUILD_DIR, 'lib', platform)
-+  if sys.platform == 'win32':
-+    # TODO(thakis): This too is due to compiler-rt being part of the checkout
-+    # on Windows, see TODO above COMPILER_RT_DIR.
-+    asan_rt_lib_src_dir = os.path.join(COMPILER_RT_BUILD_DIR, 'lib', 'clang',
-+                                       VERSION, 'lib', platform)
-   asan_rt_lib_dst_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang',
-                                      VERSION, 'lib', platform)
--  CopyDirectoryContents(asan_rt_lib_src_dir, asan_rt_lib_dst_dir,
--                        r'^.*-i386\.lib$')
--  CopyDirectoryContents(asan_rt_lib_src_dir, asan_rt_lib_dst_dir,
--                        r'^.*-i386\.dll$')
-+  # Blacklists:
-+  CopyDirectoryContents(os.path.join(asan_rt_lib_src_dir, '..', '..'),
-+                        os.path.join(asan_rt_lib_dst_dir, '..', '..'),
-+                        r'^.*blacklist\.txt$')
-+  # Headers:
-+  if sys.platform != 'win32':
-+    CopyDirectoryContents(
-+        os.path.join(COMPILER_RT_BUILD_DIR, 'include/sanitizer'),
-+        os.path.join(LLVM_BUILD_DIR, 'lib/clang', VERSION, 'include/sanitizer'))
-+  # Static and dynamic libraries:
-+  CopyDirectoryContents(asan_rt_lib_src_dir, asan_rt_lib_dst_dir)
-+  if sys.platform == 'darwin':
-+    for dylib in glob.glob(os.path.join(asan_rt_lib_dst_dir, '*.dylib')):
-+      # Fix LC_ID_DYLIB for the ASan dynamic libraries to be relative to
-+      # @executable_path.
-+      # TODO(glider): this is transitional. We'll need to fix the dylib
-+      # name either in our build system, or in Clang. See also
-+      # http://crbug.com/344836.
-+      subprocess.call(['install_name_tool', '-id',
-+                       '@executable_path/' + os.path.basename(dylib), dylib])
- 
--  CopyFile(os.path.join(asan_rt_lib_src_dir, '..', '..', 'asan_blacklist.txt'),
--           os.path.join(asan_rt_lib_dst_dir, '..', '..'))
- 
-   if sys.platform == 'win32':
-     # Make an extra copy of the sanitizer headers, to be put on the include path
-@@ -640,22 +675,67 @@
-     aux_sanitizer_include_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang',
-                                              VERSION, 'include_sanitizer',
-                                              'sanitizer')
--    if not os.path.exists(aux_sanitizer_include_dir):
--      os.makedirs(aux_sanitizer_include_dir)
-+    EnsureDirExists(aux_sanitizer_include_dir)
-     for _, _, files in os.walk(sanitizer_include_dir):
-       for f in files:
-         CopyFile(os.path.join(sanitizer_include_dir, f),
-                  aux_sanitizer_include_dir)
- 
-+  if args.with_android:
-+    make_toolchain = os.path.join(
-+        ANDROID_NDK_DIR, 'build', 'tools', 'make-standalone-toolchain.sh')
-+    for target_arch in ['aarch64', 'arm', 'i686']:
-+      # Make standalone Android toolchain for target_arch.
-+      toolchain_dir = os.path.join(
-+          LLVM_BUILD_DIR, 'android-toolchain-' + target_arch)
-+      RunCommand([
-+          make_toolchain,
-+          '--platform=android-' + ('21' if target_arch == 'aarch64' else '19'),
-+          '--install-dir="%s"' % toolchain_dir,
-+          '--system=linux-x86_64',
-+          '--stl=stlport',
-+          '--toolchain=' + {
-+              'aarch64': 'aarch64-linux-android-4.9',
-+              'arm': 'arm-linux-androideabi-4.9',
-+              'i686': 'x86-4.9',
-+          }[target_arch]])
-+      # Android NDK r9d copies a broken unwind.h into the toolchain, see
-+      # http://crbug.com/357890
-+      for f in glob.glob(os.path.join(toolchain_dir, 'include/c++/*/unwind.h')):
-+        os.remove(f)
-+
-+      # Build ASan runtime for Android in a separate build tree.
-+      build_dir = os.path.join(LLVM_BUILD_DIR, 'android-' + target_arch)
-+      if not os.path.exists(build_dir):
-+        os.mkdir(os.path.join(build_dir))
-+      os.chdir(build_dir)
-+      cflags = ['--target=%s-linux-androideabi' % target_arch,
-+                '--sysroot=%s/sysroot' % toolchain_dir,
-+                '-B%s' % toolchain_dir]
-+      android_args = base_cmake_args + [
-+        '-DCMAKE_C_COMPILER=' + os.path.join(LLVM_BUILD_DIR, 'bin/clang'),
-+        '-DCMAKE_CXX_COMPILER=' + os.path.join(LLVM_BUILD_DIR, 'bin/clang++'),
-+        '-DLLVM_CONFIG_PATH=' + os.path.join(LLVM_BUILD_DIR, 'bin/llvm-config'),
-+        '-DCMAKE_C_FLAGS=' + ' '.join(cflags),
-+        '-DCMAKE_CXX_FLAGS=' + ' '.join(cflags),
-+        '-DANDROID=1']
-+      RmCmakeCache('.')
-+      RunCommand(['cmake'] + android_args + [COMPILER_RT_DIR])
-+      RunCommand(['ninja', 'libclang_rt.asan-%s-android.so' % target_arch])
-+
-+      # And copy it into the main build tree.
-+      runtime = 'libclang_rt.asan-%s-android.so' % target_arch
-+      for root, _, files in os.walk(build_dir):
-+        if runtime in files:
-+          shutil.copy(os.path.join(root, runtime), asan_rt_lib_dst_dir)
-+
-   # Run tests.
-   if args.run_tests or use_head_revision:
-     os.chdir(LLVM_BUILD_DIR)
--    RunCommand(GetVSVersion().SetupScript('x64') +
--               ['&&', 'ninja', 'cr-check-all'])
-+    RunCommand(['ninja', 'cr-check-all'], msvc_arch='x64')
-   if args.run_tests:
-     os.chdir(LLVM_BUILD_DIR)
--    RunCommand(GetVSVersion().SetupScript('x64') +
--               ['&&', 'ninja', 'check-all'])
-+    RunCommand(['ninja', 'check-all'], msvc_arch='x64')
- 
-   WriteStampFile(PACKAGE_VERSION)
-   print 'Clang update was successful.'
-@@ -663,31 +743,6 @@
- 
- 
- def main():
--  if not sys.platform in ['win32', 'cygwin']:
--    # For non-Windows, fall back to update.sh.
--    # TODO(hans): Make update.py replace update.sh completely.
--
--    # This script is called by gclient. gclient opens its hooks subprocesses
--    # with (stdout=subprocess.PIPE, stderr=subprocess.STDOUT) and then does
--    # custom output processing that breaks printing '\r' characters for
--    # single-line updating status messages as printed by curl and wget.
--    # Work around this by setting stderr of the update.sh process to stdin (!):
--    # gclient doesn't redirect stdin, and while stdin itself is read-only, a
--    # dup()ed sys.stdin is writable, try
--    #   fd2 = os.dup(sys.stdin.fileno()); os.write(fd2, 'hi')
--    # TODO: Fix gclient instead, http://crbug.com/95350
--    if '--no-stdin-hack' in sys.argv:
--      sys.argv.remove('--no-stdin-hack')
--      stderr = None
--    else:
--      try:
--        stderr = os.fdopen(os.dup(sys.stdin.fileno()))
--      except:
--        stderr = sys.stderr
--    return subprocess.call(
--        [os.path.join(os.path.dirname(__file__), 'update.sh')] + sys.argv[1:],
--        stderr=stderr)
--
-   parser = argparse.ArgumentParser(description='Build Clang.')
-   parser.add_argument('--bootstrap', action='store_true',
-                       help='first build clang with CC, then with itself.')
-@@ -695,26 +750,24 @@
-                       help="run only if the script thinks clang is needed")
-   parser.add_argument('--force-local-build', action='store_true',
-                       help="don't try to download prebuild binaries")
-+  parser.add_argument('--gcc-toolchain', help='set the version for which gcc '
-+                      'version be used for building; --gcc-toolchain=/opt/foo '
-+                      'picks /opt/foo/bin/gcc')
-   parser.add_argument('--print-revision', action='store_true',
-                       help='print current clang revision and exit.')
-+  parser.add_argument('--print-clang-version', action='store_true',
-+                      help='print current clang version (e.g. x.y.z) and exit.')
-   parser.add_argument('--run-tests', action='store_true',
-                       help='run tests after building; only for local builds')
-   parser.add_argument('--tools', nargs='*',
-                       help='select which chrome tools to build',
-                       default=['plugins', 'blink_gc_plugin'])
--  parser.add_argument('--without-patches', action='store_false',
--                      help="don't apply patches (default)", dest='with_patches',
--                      default=True)
--
--  # For now, these flags are only used for the non-Windows flow, but argparser
--  # gets mad if it sees a flag it doesn't recognize.
--  parser.add_argument('--no-stdin-hack', action='store_true')
--
-+  parser.add_argument('--without-android', action='store_false',
-+                      help='don\'t build Android ASan runtime (linux only)',
-+                      dest='with_android',
-+                      default=sys.platform.startswith('linux'))
-   args = parser.parse_args()
- 
--  if re.search(r'\b(make_clang_dir)=', os.environ.get('GYP_DEFINES', '')):
--    print 'Skipping Clang update (make_clang_dir= was set in GYP_DEFINES).'
--    return 0
-   if args.if_needed:
-     is_clang_required = False
-     # clang is always used on Mac and Linux.
-@@ -730,8 +783,16 @@
-       is_clang_required = True
-     if not is_clang_required:
-       return 0
-+    if re.search(r'\b(make_clang_dir)=', os.environ.get('GYP_DEFINES', '')):
-+      print 'Skipping Clang update (make_clang_dir= was set in GYP_DEFINES).'
-+      return 0
-+
-+  if use_head_revision:
-+    # TODO(hans): Remove after the next roll.
-+    global VERSION
-+    VERSION = '3.9.0'
- 
--  global LLVM_WIN_REVISION, PACKAGE_VERSION
-+  global CLANG_REVISION, PACKAGE_VERSION
-   if args.print_revision:
-     if use_head_revision:
-       print GetSvnRevision(LLVM_DIR)
-@@ -739,6 +800,10 @@
-       print PACKAGE_VERSION
-     return 0
- 
-+  if args.print_clang_version:
-+    sys.stdout.write(VERSION)
-+    return 0
-+
-   # Don't buffer stdout, so that print statements are immediately flushed.
-   # Do this only after --print-revision has been handled, else we'll get
-   # an error message when this script is run from gn for some reason.
-@@ -747,12 +812,13 @@
-   if use_head_revision:
-     # Use a real revision number rather than HEAD to make sure that the stamp
-     # file logic works.
--    LLVM_WIN_REVISION = GetSvnRevision(LLVM_REPO_URL)
--    PACKAGE_VERSION = LLVM_WIN_REVISION + '-0'
-+    CLANG_REVISION = GetSvnRevision(LLVM_REPO_URL)
-+    PACKAGE_VERSION = CLANG_REVISION + '-0'
- 
-     args.force_local_build = True
--    # Skip local patches when using HEAD: they probably don't apply anymore.
--    args.with_patches = False
-+    if 'OS=android' not in os.environ.get('GYP_DEFINES', ''):
-+      # Only build the Android ASan rt on ToT bots when targetting Android.
-+      args.with_android = False
- 
-   return UpdateClang(args)
- 
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebengine/default.nix b/pkgs/development/libraries/qt-5/5.6/qtwebengine/default.nix
deleted file mode 100644
index 7ffc42fe7f6..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtwebengine/default.nix
+++ /dev/null
@@ -1,90 +0,0 @@
-{ qtSubmodule, qtquickcontrols, qtlocation, qtwebchannel
-
-, xlibs, libXcursor, libXScrnSaver, libXrandr, libXtst
-, fontconfig, freetype, harfbuzz, icu, dbus
-, zlib, minizip, libjpeg, libpng, libtiff, libwebp, libopus
-, jsoncpp, protobuf, libvpx, srtp, snappy, nss, libevent
-, alsaLib
-, libcap
-, pciutils
-
-, bison, flex, git, which, gperf
-, coreutils
-, pkgconfig, python2
-
-, lib, stdenv # lib.optional, needsPax
-}:
-
-qtSubmodule {
-  name = "qtwebengine";
-  qtInputs = [ qtquickcontrols qtlocation qtwebchannel ];
-  buildInputs = [ bison flex git which gperf ];
-  nativeBuildInputs = [ pkgconfig python2 coreutils ];
-  doCheck = true;
-
-  enableParallelBuilding = true;
-
-  preConfigure = ''
-    export MAKEFLAGS=-j$NIX_BUILD_CORES
-    substituteInPlace ./src/3rdparty/chromium/build/common.gypi \
-      --replace /bin/echo ${coreutils}/bin/echo
-    substituteInPlace ./src/3rdparty/chromium/v8/build/toolchain.gypi \
-      --replace /bin/echo ${coreutils}/bin/echo
-    substituteInPlace ./src/3rdparty/chromium/v8/build/standalone.gypi \
-      --replace /bin/echo ${coreutils}/bin/echo
-
-    # hardcode paths for which default path resolution does not work in nix
-    sed -i -e 's,\(static QString potentialResourcesPath =\).*,\1 QLatin1String("'$out'/resources");,' src/core/web_engine_library_info.cpp
-    sed -i -e 's,\(static QString processPath\),\1 = QLatin1String("'$out'/libexec/QtWebEngineProcess"),' src/core/web_engine_library_info.cpp
-    sed -i -e 's,\(static QString potentialLocalesPath =\).*,\1 QLatin1String("'$out'/translations/qtwebengine_locales");,' src/core/web_engine_library_info.cpp
-
-    # fix default SSL bundle location
-    sed -i -e 's,/cert.pem,/certs/ca-bundle.crt,' src/3rdparty/chromium/third_party/boringssl/src/crypto/x509/x509_def.c
-
-    configureFlags+="\
-        -plugindir $out/$qtPluginPrefix \
-        -qmldir $out/$qtQmlPrefix \
-        -docdir $out/$qtDocPrefix"
-  '';
-  propagatedBuildInputs = [
-    # Image formats
-    libjpeg libpng libtiff libwebp
-
-    # Video formats
-    srtp libvpx
-
-    # Audio formats
-    libopus
-
-    # Text rendering
-    harfbuzz icu
-  ]
-  ++ lib.optionals (!stdenv.isDarwin) [
-    dbus zlib minizip snappy nss protobuf jsoncpp libevent
-
-    # Audio formats
-    alsaLib
-
-    # Text rendering
-    fontconfig freetype
-
-    libcap
-    pciutils
-
-    # X11 libs
-    xlibs.xrandr libXScrnSaver libXcursor libXrandr xlibs.libpciaccess libXtst
-    xlibs.libXcomposite
-  ];
-  patches = [
-    ./chromium-clang-update-py.patch
-  ] ++ stdenv.lib.optional stdenv.needsPax ./qtwebengine-paxmark-mksnapshot.patch;
-
-  postInstall = ''
-    cat > $out/libexec/qt.conf <<EOF
-    [Paths]
-    Prefix = ..
-    EOF
-
-    paxmark m $out/libexec/QtWebEngineProcess
-  '';
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebkit.patch b/pkgs/development/libraries/qt-5/5.6/qtwebkit.patch
index 310d2745825..da1658554e4 100644
--- a/pkgs/development/libraries/qt-5/5.6/qtwebkit.patch
+++ b/pkgs/development/libraries/qt-5/5.6/qtwebkit.patch
@@ -1,3 +1,48 @@
+diff --git a/Source/JavaScriptCore/API/JSStringRef.cpp b/Source/JavaScriptCore/API/JSStringRef.cpp
+index 812f3d413..77a3fd0f4 100644
+--- a/Source/JavaScriptCore/API/JSStringRef.cpp
++++ b/Source/JavaScriptCore/API/JSStringRef.cpp
+@@ -37,7 +37,7 @@ using namespace WTF::Unicode;
+ JSStringRef JSStringCreateWithCharacters(const JSChar* chars, size_t numChars)
+ {
+     initializeThreading();
+-    return OpaqueJSString::create(chars, numChars).leakRef();
++    return OpaqueJSString::create(reinterpret_cast<const UChar*>(chars), numChars).leakRef();
+ }
+ 
+ JSStringRef JSStringCreateWithUTF8CString(const char* string)
+@@ -62,7 +62,7 @@ JSStringRef JSStringCreateWithUTF8CString(const char* string)
+ JSStringRef JSStringCreateWithCharactersNoCopy(const JSChar* chars, size_t numChars)
+ {
+     initializeThreading();
+-    return OpaqueJSString::create(StringImpl::createWithoutCopying(chars, numChars, WTF::DoesNotHaveTerminatingNullCharacter)).leakRef();
++    return OpaqueJSString::create(StringImpl::createWithoutCopying(reinterpret_cast<const UChar*>(chars), numChars, WTF::DoesNotHaveTerminatingNullCharacter)).leakRef();
+ }
+ 
+ JSStringRef JSStringRetain(JSStringRef string)
+@@ -83,7 +83,7 @@ size_t JSStringGetLength(JSStringRef string)
+ 
+ const JSChar* JSStringGetCharactersPtr(JSStringRef string)
+ {
+-    return string->characters();
++    return reinterpret_cast<const JSChar*>(string->characters());
+ }
+ 
+ size_t JSStringGetMaximumUTF8CStringSize(JSStringRef string)
+diff --git a/Source/JavaScriptCore/runtime/DateConversion.cpp b/Source/JavaScriptCore/runtime/DateConversion.cpp
+index 0b57f012d..05e27338b 100644
+--- a/Source/JavaScriptCore/runtime/DateConversion.cpp
++++ b/Source/JavaScriptCore/runtime/DateConversion.cpp
+@@ -107,7 +107,8 @@ String formatDateTime(const GregorianDateTime& t, DateTimeFormat format, bool as
+ #if OS(WINDOWS)
+             TIME_ZONE_INFORMATION timeZoneInformation;
+             GetTimeZoneInformation(&timeZoneInformation);
+-            const WCHAR* timeZoneName = t.isDST() ? timeZoneInformation.DaylightName : timeZoneInformation.StandardName;
++            const WCHAR* winTimeZoneName = t.isDST() ? timeZoneInformation.DaylightName : timeZoneInformation.StandardName;
++            String timeZoneName(reinterpret_cast<const UChar*>(winTimeZoneName));
+ #else
+             struct tm gtm = t;
+             char timeZoneName[70];
 diff --git a/Source/WTF/WTF.pri b/Source/WTF/WTF.pri
 index 1f4866d66..bb61e4ba3 100644
 --- a/Source/WTF/WTF.pri
@@ -11,6 +56,20 @@ index 1f4866d66..bb61e4ba3 100644
  } else:!use?(wchar_unicode): {
      win32 {
          CONFIG(static, static|shared) {
+diff --git a/Source/WTF/wtf/TypeTraits.h b/Source/WTF/wtf/TypeTraits.h
+index 9df2c95cf..f5d6121fd 100644
+--- a/Source/WTF/wtf/TypeTraits.h
++++ b/Source/WTF/wtf/TypeTraits.h
+@@ -72,6 +72,9 @@ namespace WTF {
+     template<> struct IsInteger<unsigned long>      { static const bool value = true; };
+     template<> struct IsInteger<long long>          { static const bool value = true; };
+     template<> struct IsInteger<unsigned long long> { static const bool value = true; };
++#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(_HAS_CHAR16_T_LANGUAGE_SUPPORT) && _HAS_CHAR16_T_LANGUAGE_SUPPORT)
++    template<> struct IsInteger<char16_t>           { static const bool value = true; };
++#endif
+ #if !COMPILER(MSVC) || defined(_NATIVE_WCHAR_T_DEFINED)
+     template<> struct IsInteger<wchar_t>            { static const bool value = true; };
+ #endif
 diff --git a/Source/WebCore/plugins/qt/PluginPackageQt.cpp b/Source/WebCore/plugins/qt/PluginPackageQt.cpp
 index a923d49aa..46772a4bb 100644
 --- a/Source/WebCore/plugins/qt/PluginPackageQt.cpp
@@ -59,6 +118,19 @@ index 8de65216b..38f5c05e5 100644
      if (!gtkLibrary.load())
          return false;
      typedef void* (*gtk_init_ptr)(void*, void*);
+diff --git a/Source/WebKit2/Shared/API/c/WKString.cpp b/Source/WebKit2/Shared/API/c/WKString.cpp
+index cbac67dd8..23400a64e 100644
+--- a/Source/WebKit2/Shared/API/c/WKString.cpp
++++ b/Source/WebKit2/Shared/API/c/WKString.cpp
+@@ -55,7 +55,7 @@ size_t WKStringGetLength(WKStringRef stringRef)
+ size_t WKStringGetCharacters(WKStringRef stringRef, WKChar* buffer, size_t bufferLength)
+ {
+     COMPILE_ASSERT(sizeof(WKChar) == sizeof(UChar), WKStringGetCharacters_sizeof_WKChar_matches_UChar);
+-    return (toImpl(stringRef)->getCharacters(static_cast<UChar*>(buffer), bufferLength));
++    return (toImpl(stringRef)->getCharacters(reinterpret_cast<UChar*>(buffer), bufferLength));
+ }
+ 
+ size_t WKStringGetMaximumUTF8CStringSize(WKStringRef stringRef)
 diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
 index d734ff684..0f6ff63d1 100644
 --- a/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebkit/0001-dlopen-webkit-nsplugin.patch b/pkgs/development/libraries/qt-5/5.6/qtwebkit/0001-dlopen-webkit-nsplugin.patch
deleted file mode 100644
index 0eeacce1bc0..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtwebkit/0001-dlopen-webkit-nsplugin.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 862ce7d357a3ec32683ac6ec7c0ebdc9346b44ba Mon Sep 17 00:00:00 2001
-From: Thomas Tuegel <ttuegel@gmail.com>
-Date: Sun, 23 Aug 2015 09:18:54 -0500
-Subject: [PATCH 1/3] dlopen webkit nsplugin
-
----
- Source/WebCore/plugins/qt/PluginPackageQt.cpp                        | 2 +-
- Source/WebCore/plugins/qt/PluginViewQt.cpp                           | 2 +-
- Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/Source/WebCore/plugins/qt/PluginPackageQt.cpp b/Source/WebCore/plugins/qt/PluginPackageQt.cpp
-index a923d49..2731d05 100644
---- a/Source/WebCore/plugins/qt/PluginPackageQt.cpp
-+++ b/Source/WebCore/plugins/qt/PluginPackageQt.cpp
-@@ -136,7 +136,7 @@ static void initializeGtk(QLibrary* module = 0)
-         }
-     }
- 
--    QLibrary library(QLatin1String("libgtk-x11-2.0"), 0);
-+    QLibrary library(QLatin1String("@gtk@/lib/libgtk-x11-2.0"), 0);
-     if (library.load()) {
-         typedef void *(*gtk_init_check_ptr)(int*, char***);
-         gtk_init_check_ptr gtkInitCheck = (gtk_init_check_ptr)library.resolve("gtk_init_check");
-diff --git a/Source/WebCore/plugins/qt/PluginViewQt.cpp b/Source/WebCore/plugins/qt/PluginViewQt.cpp
-index de06a2f..363bde5 100644
---- a/Source/WebCore/plugins/qt/PluginViewQt.cpp
-+++ b/Source/WebCore/plugins/qt/PluginViewQt.cpp
-@@ -697,7 +697,7 @@ static Display *getPluginDisplay()
-     // support gdk based plugins (like flash) that use a different X connection.
-     // The code below has the same effect as this one:
-     // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default());
--    QLibrary library(QLatin1String("libgdk-x11-2.0"), 0);
-+    QLibrary library(QLatin1String("@gdk_pixbuf@/lib/libgdk-x11-2.0"), 0);
-     if (!library.load())
-         return 0;
- 
-diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
-index d734ff6..62a2197 100644
---- a/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
-+++ b/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
-@@ -64,7 +64,7 @@ static Display* getPluginDisplay()
-     // The code below has the same effect as this one:
-     // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default());
- 
--    QLibrary library(QLatin1String("libgdk-x11-2.0"), 0);
-+    QLibrary library(QLatin1String("@gdk_pixbuf@/libgdk-x11-2.0"), 0);
-     if (!library.load())
-         return 0;
- 
--- 
-2.5.0
-
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebkit/0002-dlopen-webkit-gtk.patch b/pkgs/development/libraries/qt-5/5.6/qtwebkit/0002-dlopen-webkit-gtk.patch
deleted file mode 100644
index bb5d1f74364..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtwebkit/0002-dlopen-webkit-gtk.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 6a407d30357c2551abceac75c82f4a1688e47437 Mon Sep 17 00:00:00 2001
-From: Thomas Tuegel <ttuegel@gmail.com>
-Date: Sun, 23 Aug 2015 09:19:16 -0500
-Subject: [PATCH 2/3] dlopen webkit gtk
-
----
- Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp b/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
-index 8de6521..0b25748 100644
---- a/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
-+++ b/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
-@@ -53,7 +53,7 @@ static void messageHandler(QtMsgType type, const QMessageLogContext&, const QStr
- 
- static bool initializeGtk()
- {
--    QLibrary gtkLibrary(QLatin1String("libgtk-x11-2.0"), 0);
-+    QLibrary gtkLibrary(QLatin1String("@gtk@/lib/libgtk-x11-2.0"), 0);
-     if (!gtkLibrary.load())
-         return false;
-     typedef void* (*gtk_init_ptr)(void*, void*);
--- 
-2.5.0
-
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebkit/0003-dlopen-webkit-udev.patch b/pkgs/development/libraries/qt-5/5.6/qtwebkit/0003-dlopen-webkit-udev.patch
deleted file mode 100644
index 19de7d99c85..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtwebkit/0003-dlopen-webkit-udev.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 864020dd47c3b6d532d9f26b82185904cf9324f2 Mon Sep 17 00:00:00 2001
-From: Thomas Tuegel <ttuegel@gmail.com>
-Date: Sun, 23 Aug 2015 09:19:29 -0500
-Subject: [PATCH 3/3] dlopen webkit udev
-
----
- Source/WebCore/platform/qt/GamepadsQt.cpp | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/Source/WebCore/platform/qt/GamepadsQt.cpp b/Source/WebCore/platform/qt/GamepadsQt.cpp
-index 60ff317..da8ac69 100644
---- a/Source/WebCore/platform/qt/GamepadsQt.cpp
-+++ b/Source/WebCore/platform/qt/GamepadsQt.cpp
-@@ -111,13 +111,12 @@ private:
-     bool load()
-     {
-         m_libUdev.setLoadHints(QLibrary::ResolveAllSymbolsHint);
--        m_libUdev.setFileNameAndVersion(QStringLiteral("udev"), 1);
-+        m_libUdev.setFileNameAndVersion(QLatin1String(NIXPKGS_LIBUDEV), 1);
-         m_loaded = m_libUdev.load();
-         if (resolveMethods())
-             return true;
- 
--        m_libUdev.setFileNameAndVersion(QStringLiteral("udev"), 0);
-+        m_libUdev.setFileNameAndVersion(QLatin1String(NIXPKGS_LIBUDEV), 0);
-         m_loaded = m_libUdev.load();
-         return resolveMethods();
-     }
--- 
-2.5.0
-
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebkit/default.nix b/pkgs/development/libraries/qt-5/5.6/qtwebkit/default.nix
deleted file mode 100644
index 664281aac31..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtwebkit/default.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ qtSubmodule, stdenv, copyPathsToStore, lib
-, qtdeclarative, qtlocation, qtsensors
-, fontconfig, gdk_pixbuf, gtk2, libwebp, libxml2, libxslt
-, sqlite, systemd, glib, gst_all_1
-, bison2, flex, gdb, gperf, perl, pkgconfig, python2, ruby
-, darwin
-, substituteAll
-, flashplayerFix ? false
-}:
-
-let inherit (lib) optional optionals getLib; in
-
-qtSubmodule {
-  name = "qtwebkit";
-  qtInputs = [ qtdeclarative qtlocation qtsensors ];
-  buildInputs = [ fontconfig libwebp libxml2 libxslt sqlite glib gst_all_1.gstreamer gst_all_1.gst-plugins-base ]
-    ++ optionals (stdenv.isDarwin) (with darwin.apple_sdk.frameworks; [ OpenGL ]);
-  nativeBuildInputs = [
-    bison2 flex gdb gperf perl pkgconfig python2 ruby
-  ];
-
-  __impureHostDeps = optionals (stdenv.isDarwin) [
-    "/usr/lib/libicucore.dylib"
-  ];
-
-  patches =  copyPathsToStore (lib.readPathsFromFile ./. ./series);
-
-  NIX_CFLAGS_COMPILE =
-    optionals flashplayerFix
-      [
-        ''-DNIXPKGS_LIBGTK2="${getLib gtk2}/lib/libgtk-x11-2.0"''
-        ''-DNIXPKGS_LIBGDK2="${getLib gdk_pixbuf}/lib/libgdk-x11-2.0"''
-      ]
-    ++ optional (!stdenv.isDarwin) ''-DNIXPKGS_LIBUDEV="${getLib systemd}/lib/libudev"'';
-
-  # Hack to avoid TMPDIR in RPATHs.
-  preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
-
-  meta.maintainers = with stdenv.lib.maintainers; [ abbradar periklis ];
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebkit/qtwebkit-dlopen-gtk.patch b/pkgs/development/libraries/qt-5/5.6/qtwebkit/qtwebkit-dlopen-gtk.patch
deleted file mode 100644
index e34eda592af..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtwebkit/qtwebkit-dlopen-gtk.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-Index: qtwebkit-opensource-src-5.8.0/Source/WebCore/plugins/qt/PluginPackageQt.cpp
-===================================================================
---- qtwebkit-opensource-src-5.8.0.orig/Source/WebCore/plugins/qt/PluginPackageQt.cpp
-+++ qtwebkit-opensource-src-5.8.0/Source/WebCore/plugins/qt/PluginPackageQt.cpp
-@@ -136,7 +136,11 @@ static void initializeGtk(QLibrary* modu
-         }
-     }
- 
-+#ifdef NIXPKGS_LIBGTK2
-+    QLibrary library(QLatin1String(NIXPKGS_LIBGTK2), 0);
-+#else
-     QLibrary library(QLatin1String("libgtk-x11-2.0"), 0);
-+#endif
-     if (library.load()) {
-         typedef void *(*gtk_init_check_ptr)(int*, char***);
-         gtk_init_check_ptr gtkInitCheck = (gtk_init_check_ptr)library.resolve("gtk_init_check");
-Index: qtwebkit-opensource-src-5.8.0/Source/WebCore/plugins/qt/PluginViewQt.cpp
-===================================================================
---- qtwebkit-opensource-src-5.8.0.orig/Source/WebCore/plugins/qt/PluginViewQt.cpp
-+++ qtwebkit-opensource-src-5.8.0/Source/WebCore/plugins/qt/PluginViewQt.cpp
-@@ -697,7 +697,11 @@ static Display *getPluginDisplay()
-     // support gdk based plugins (like flash) that use a different X connection.
-     // The code below has the same effect as this one:
-     // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default());
-+#ifdef NIXPKGS_LIBGDK2
-+    QLibrary library(QLatin1String(NIXPKGS_LIBGDK2), 0);
-+#else
-     QLibrary library(QLatin1String("libgdk-x11-2.0"), 0);
-+#endif
-     if (!library.load())
-         return 0;
- 
-Index: qtwebkit-opensource-src-5.8.0/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
-===================================================================
---- qtwebkit-opensource-src-5.8.0.orig/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
-+++ qtwebkit-opensource-src-5.8.0/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
-@@ -64,7 +64,11 @@ static Display* getPluginDisplay()
-     // The code below has the same effect as this one:
-     // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default());
- 
-+#ifdef NIXPKGS_LIBGDK2
-+    QLibrary library(QLatin1String(NIXPKGS_LIBGDK2), 0);
-+#else
-     QLibrary library(QLatin1String("libgdk-x11-2.0"), 0);
-+#endif
-     if (!library.load())
-         return 0;
- 
-Index: qtwebkit-opensource-src-5.8.0/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
-===================================================================
---- qtwebkit-opensource-src-5.8.0.orig/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
-+++ qtwebkit-opensource-src-5.8.0/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
-@@ -53,7 +53,11 @@ static void messageHandler(QtMsgType typ
- 
- static bool initializeGtk()
- {
-+#ifdef NIXPKGS_LIBGTK2
-+    QLibrary gtkLibrary(QLatin1String(NIXPKGS_LIBGTK2), 0);
-+#else
-     QLibrary gtkLibrary(QLatin1String("libgtk-x11-2.0"), 0);
-+#endif
-     if (!gtkLibrary.load())
-         return false;
-     typedef void* (*gtk_init_ptr)(void*, void*);
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebkit/qtwebkit-dlopen-udev.patch b/pkgs/development/libraries/qt-5/5.6/qtwebkit/qtwebkit-dlopen-udev.patch
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtwebkit/qtwebkit-dlopen-udev.patch
+++ /dev/null
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebkit/qtwebkit-icu-59.patch b/pkgs/development/libraries/qt-5/5.6/qtwebkit/qtwebkit-icu-59.patch
deleted file mode 100644
index add365b5dd6..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtwebkit/qtwebkit-icu-59.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From: Konstantin Tokarev <annulen@yandex.ru>
-Date: Thu, 4 May 2017 12:12:37 +0000 (+0300)
-Subject: Fix compilation with ICU 59
-X-Git-Url: https://codereview.qt-project.org/gitweb?p=qt%2Fqtwebkit.git;a=commitdiff_plain;h=bf172ae289a1348842005a9421797970f9b72060;hp=821eaaadc9d63d03aca65cf757230b520daaaa7c
-
-Fix compilation with ICU 59
-
-Upstream fix: https://bugs.webkit.org/show_bug.cgi?id=171612
-
-Task-number: QTBUG-60532
-Change-Id: I6014feea213aa70ebe40b09d9d1a03fd1ed3c843
-Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
----
-
-diff --git a/Source/JavaScriptCore/API/JSStringRef.cpp b/Source/JavaScriptCore/API/JSStringRef.cpp
-index 812f3d4..77a3fd0 100644
---- a/Source/JavaScriptCore/API/JSStringRef.cpp
-+++ b/Source/JavaScriptCore/API/JSStringRef.cpp
-@@ -37,7 +37,7 @@ using namespace WTF::Unicode;
- JSStringRef JSStringCreateWithCharacters(const JSChar* chars, size_t numChars)
- {
-     initializeThreading();
--    return OpaqueJSString::create(chars, numChars).leakRef();
-+    return OpaqueJSString::create(reinterpret_cast<const UChar*>(chars), numChars).leakRef();
- }
- 
- JSStringRef JSStringCreateWithUTF8CString(const char* string)
-@@ -62,7 +62,7 @@ JSStringRef JSStringCreateWithUTF8CString(const char* string)
- JSStringRef JSStringCreateWithCharactersNoCopy(const JSChar* chars, size_t numChars)
- {
-     initializeThreading();
--    return OpaqueJSString::create(StringImpl::createWithoutCopying(chars, numChars, WTF::DoesNotHaveTerminatingNullCharacter)).leakRef();
-+    return OpaqueJSString::create(StringImpl::createWithoutCopying(reinterpret_cast<const UChar*>(chars), numChars, WTF::DoesNotHaveTerminatingNullCharacter)).leakRef();
- }
- 
- JSStringRef JSStringRetain(JSStringRef string)
-@@ -83,7 +83,7 @@ size_t JSStringGetLength(JSStringRef string)
- 
- const JSChar* JSStringGetCharactersPtr(JSStringRef string)
- {
--    return string->characters();
-+    return reinterpret_cast<const JSChar*>(string->characters());
- }
- 
- size_t JSStringGetMaximumUTF8CStringSize(JSStringRef string)
-diff --git a/Source/JavaScriptCore/runtime/DateConversion.cpp b/Source/JavaScriptCore/runtime/DateConversion.cpp
-index 0b57f01..05e2733 100644
---- a/Source/JavaScriptCore/runtime/DateConversion.cpp
-+++ b/Source/JavaScriptCore/runtime/DateConversion.cpp
-@@ -107,7 +107,8 @@ String formatDateTime(const GregorianDateTime& t, DateTimeFormat format, bool as
- #if OS(WINDOWS)
-             TIME_ZONE_INFORMATION timeZoneInformation;
-             GetTimeZoneInformation(&timeZoneInformation);
--            const WCHAR* timeZoneName = t.isDST() ? timeZoneInformation.DaylightName : timeZoneInformation.StandardName;
-+            const WCHAR* winTimeZoneName = t.isDST() ? timeZoneInformation.DaylightName : timeZoneInformation.StandardName;
-+            String timeZoneName(reinterpret_cast<const UChar*>(winTimeZoneName));
- #else
-             struct tm gtm = t;
-             char timeZoneName[70];
-diff --git a/Source/WTF/wtf/TypeTraits.h b/Source/WTF/wtf/TypeTraits.h
-index 9df2c95..f5d6121 100644
---- a/Source/WTF/wtf/TypeTraits.h
-+++ b/Source/WTF/wtf/TypeTraits.h
-@@ -72,6 +72,9 @@ namespace WTF {
-     template<> struct IsInteger<unsigned long>      { static const bool value = true; };
-     template<> struct IsInteger<long long>          { static const bool value = true; };
-     template<> struct IsInteger<unsigned long long> { static const bool value = true; };
-+#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(_HAS_CHAR16_T_LANGUAGE_SUPPORT) && _HAS_CHAR16_T_LANGUAGE_SUPPORT)
-+    template<> struct IsInteger<char16_t>           { static const bool value = true; };
-+#endif
- #if !COMPILER(MSVC) || defined(_NATIVE_WCHAR_T_DEFINED)
-     template<> struct IsInteger<wchar_t>            { static const bool value = true; };
- #endif
-diff --git a/Source/WebKit2/Shared/API/c/WKString.cpp b/Source/WebKit2/Shared/API/c/WKString.cpp
-index cbac67d..23400a6 100644
---- a/Source/WebKit2/Shared/API/c/WKString.cpp
-+++ b/Source/WebKit2/Shared/API/c/WKString.cpp
-@@ -55,7 +55,7 @@ size_t WKStringGetLength(WKStringRef stringRef)
- size_t WKStringGetCharacters(WKStringRef stringRef, WKChar* buffer, size_t bufferLength)
- {
-     COMPILE_ASSERT(sizeof(WKChar) == sizeof(UChar), WKStringGetCharacters_sizeof_WKChar_matches_UChar);
--    return (toImpl(stringRef)->getCharacters(static_cast<UChar*>(buffer), bufferLength));
-+    return (toImpl(stringRef)->getCharacters(reinterpret_cast<UChar*>(buffer), bufferLength));
- }
- 
- size_t WKStringGetMaximumUTF8CStringSize(WKStringRef stringRef)
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebkit/qtwebkit-icucore-darwin.patch b/pkgs/development/libraries/qt-5/5.6/qtwebkit/qtwebkit-icucore-darwin.patch
deleted file mode 100644
index 63c653da94e..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtwebkit/qtwebkit-icucore-darwin.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: qtwebkit-opensource-src-5.8.0/Source/WTF/WTF.pri
-===================================================================
---- qtwebkit-opensource-src-5.8.0.orig/Source/WTF/WTF.pri
-+++ qtwebkit-opensource-src-5.8.0/Source/WTF/WTF.pri
-@@ -12,7 +12,7 @@ mac {
-     # Mac OS does ship libicu but not the associated header files.
-     # Therefore WebKit provides adequate header files.
-     INCLUDEPATH = $${ROOT_WEBKIT_DIR}/Source/WTF/icu $$INCLUDEPATH
--    LIBS += -licucore
-+    LIBS += /usr/lib/libicucore.dylib
- } else:!use?(wchar_unicode): {
-     win32 {
-         CONFIG(static, static|shared) {
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebkit/series b/pkgs/development/libraries/qt-5/5.6/qtwebkit/series
deleted file mode 100644
index 7828e491c08..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtwebkit/series
+++ /dev/null
@@ -1,4 +0,0 @@
-qtwebkit-dlopen-gtk.patch
-qtwebkit-dlopen-udev.patch
-qtwebkit-icucore-darwin.patch
-qtwebkit-icu-59.patch
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebsockets.nix b/pkgs/development/libraries/qt-5/5.6/qtwebsockets.nix
deleted file mode 100644
index fbdfbbcf0db..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtwebsockets.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ qtSubmodule, qtbase, qtdeclarative }:
-
-qtSubmodule {
-  name = "qtwebsockets";
-  qtInputs = [ qtbase qtdeclarative ];
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtx11extras.nix b/pkgs/development/libraries/qt-5/5.6/qtx11extras.nix
deleted file mode 100644
index a765161e2d7..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtx11extras.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ qtSubmodule, qtbase }:
-
-qtSubmodule {
-  name = "qtx11extras";
-  qtInputs = [ qtbase ];
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/qtxmlpatterns.nix b/pkgs/development/libraries/qt-5/5.6/qtxmlpatterns.nix
deleted file mode 100644
index 9a8ddbba2bd..00000000000
--- a/pkgs/development/libraries/qt-5/5.6/qtxmlpatterns.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ qtSubmodule, qtbase }:
-
-qtSubmodule {
-  name = "qtxmlpatterns";
-  qtInputs = [ qtbase ];
-}
diff --git a/pkgs/development/libraries/qt-5/5.6/srcs.nix b/pkgs/development/libraries/qt-5/5.6/srcs.nix
index 3f6c3ae6699..87d35a43d86 100644
--- a/pkgs/development/libraries/qt-5/5.6/srcs.nix
+++ b/pkgs/development/libraries/qt-5/5.6/srcs.nix
@@ -3,259 +3,307 @@
 
 {
   qt3d = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qt3d-opensource-src-5.6.2.tar.xz";
-      sha256 = "0hg91j3brsbh75why6j0527z5myk1r9s7q9z45q6qp0gdvdqc5x2";
-      name = "qt3d-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qt3d-opensource-src-5.6.3.tar.xz";
+      sha256 = "1zkzc3wh2i89nacb55mbgl09zhrjbrxg9ir626bsvz15x4q5ml0h";
+      name = "qt3d-opensource-src-5.6.3.tar.xz";
     };
   };
   qtactiveqt = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtactiveqt-opensource-src-5.6.2.tar.xz";
-      sha256 = "1a3mai3d0l2a8gyjkjng1r7y9y27yppxc5rdzxsgc4kq58rflghw";
-      name = "qtactiveqt-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtactiveqt-opensource-src-5.6.3.tar.xz";
+      sha256 = "00qscqjpkv5ssrjdwwcjp9q1rqgp8lsdjjksjpyyg4v6knd74s0i";
+      name = "qtactiveqt-opensource-src-5.6.3.tar.xz";
     };
   };
   qtandroidextras = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtandroidextras-opensource-src-5.6.2.tar.xz";
-      sha256 = "164mkmzswqwjzhs9cwdq361yb60bx6is37740jglrjxgss1phmhr";
-      name = "qtandroidextras-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtandroidextras-opensource-src-5.6.3.tar.xz";
+      sha256 = "1v19p1pqcdicylj3hd2lbm5swqddydlv9aqmws3qwsc2vwh15d4n";
+      name = "qtandroidextras-opensource-src-5.6.3.tar.xz";
     };
   };
   qtbase = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtbase-opensource-src-5.6.2.tar.xz";
-      sha256 = "11z73qgzbyj1cwjdkng94cz46wam8frsw0bs705gx0nrqn9swvig";
-      name = "qtbase-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtbase-opensource-src-5.6.3.tar.xz";
+      sha256 = "18ad7cxln61276cm8h8hzm0y6svw6b5m5nbm1niif9pwlqlqbx7y";
+      name = "qtbase-opensource-src-5.6.3.tar.xz";
     };
   };
   qtcanvas3d = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtcanvas3d-opensource-src-5.6.2.tar.xz";
-      sha256 = "1bd01ag2p1445ffckyyi3sxi4vssflp95kmbrj99dy83dc04sn6p";
-      name = "qtcanvas3d-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtcanvas3d-opensource-src-5.6.3.tar.xz";
+      sha256 = "1zsn3xbsqapivfg80cldjlh7z07nf88958a7g6dm7figkwahx7p9";
+      name = "qtcanvas3d-opensource-src-5.6.3.tar.xz";
+    };
+  };
+  qtcharts = {
+    version = "2.1.3";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtcharts-opensource-src-2.1.3.tar.xz";
+      sha256 = "0bvxmqx7094mq1svrv1i1jp6vl87r2mp7k9n3gqpixjmqaqsjdpn";
+      name = "qtcharts-opensource-src-2.1.3.tar.xz";
     };
   };
   qtconnectivity = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtconnectivity-opensource-src-5.6.2.tar.xz";
-      sha256 = "1ygdmd7fh2fhhyv58zxl1lglr85iajs9gv6c0pv64gbhw0ijjrqv";
-      name = "qtconnectivity-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtconnectivity-opensource-src-5.6.3.tar.xz";
+      sha256 = "1pnc0zmps5iw5yhn2w0wl8cnyxhcy88d3rnaiv62ljpsccynwh7s";
+      name = "qtconnectivity-opensource-src-5.6.3.tar.xz";
+    };
+  };
+  qtdatavis3d = {
+    version = "1.2.3";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtdatavis3d-opensource-src-1.2.3.tar.xz";
+      sha256 = "0rqhr6s3fic91r6r1g2ws57j6ixvkh4zhcwh7savs1risx374vya";
+      name = "qtdatavis3d-opensource-src-1.2.3.tar.xz";
     };
   };
   qtdeclarative = {
-    version = "5.6.2";
+    version = "5.6.3";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtdeclarative-opensource-src-5.6.3.tar.xz";
+      sha256 = "1z4ih5jbydnk5dz0arhvwc54fjw7fynqx3rhm6f8lsyis19w0gzn";
+      name = "qtdeclarative-opensource-src-5.6.3.tar.xz";
+    };
+  };
+  qtdeclarative-render2d = {
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtdeclarative-opensource-src-5.6.2.tar.xz";
-      sha256 = "1nh989jp2gdp5bxa62n3g1whs2pzrl44sh4ca6x9icrnpj3ak1h0";
-      name = "qtdeclarative-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtdeclarative-render2d-opensource-src-5.6.3.tar.xz";
+      sha256 = "0r2qn8l3wh73cj75rq34zmc6rgl7v11c31pjdcsybad76nw5wb2p";
+      name = "qtdeclarative-render2d-opensource-src-5.6.3.tar.xz";
     };
   };
   qtdoc = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtdoc-opensource-src-5.6.2.tar.xz";
-      sha256 = "0s78c5bpj4lcx63x2y5a6scxv6sszvs4dlj4qy86jkwmm7m1wsgn";
-      name = "qtdoc-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtdoc-opensource-src-5.6.3.tar.xz";
+      sha256 = "11zhlry8hlql1q3pm4mf7qyky9i2irxqdrr9nr5m93wjyfsjbh7f";
+      name = "qtdoc-opensource-src-5.6.3.tar.xz";
     };
   };
   qtenginio = {
-    version = "1.6.2";
+    version = "1.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtenginio-opensource-src-1.6.2.tar.xz";
-      sha256 = "1hywpl1x9lbpqqjdw5wwwhx0gg0j7y260iqaz47anxaa466w7zwh";
-      name = "qtenginio-opensource-src-1.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtenginio-opensource-src-1.6.3.tar.xz";
+      sha256 = "04ir5pa8wpkc7cq08s0b69a0vhkr7479ixn3m2vww4jm6l5hc1yr";
+      name = "qtenginio-opensource-src-1.6.3.tar.xz";
     };
   };
   qtgraphicaleffects = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtgraphicaleffects-opensource-src-5.6.2.tar.xz";
-      sha256 = "0pp71gqfgbl5ra15jp8kr4p3sl9gs7cv4x6vjv9i5a3j5jn0z7qy";
-      name = "qtgraphicaleffects-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtgraphicaleffects-opensource-src-5.6.3.tar.xz";
+      sha256 = "1vcrm4jfmxjlw23dnwf45mzq2z5s4fz6j2znknr25ca5bqnmjhn7";
+      name = "qtgraphicaleffects-opensource-src-5.6.3.tar.xz";
     };
   };
   qtimageformats = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtimageformats-opensource-src-5.6.2.tar.xz";
-      sha256 = "1r27s5dy9c016ia5xgpbs7nfvmmrnd051dmsrv5r7hyscaz57cag";
-      name = "qtimageformats-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtimageformats-opensource-src-5.6.3.tar.xz";
+      sha256 = "1hs8b258xsbc4xb4844mas9ka54f5cfhhszblawwjxn9j0ydmr7g";
+      name = "qtimageformats-opensource-src-5.6.3.tar.xz";
     };
   };
   qtlocation = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtlocation-opensource-src-5.6.2.tar.xz";
-      sha256 = "0fnj51f6fll1z1xsfp3g73al70hsg993gh1k7aa0y8nhdqh9b2bs";
-      name = "qtlocation-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtlocation-opensource-src-5.6.3.tar.xz";
+      sha256 = "0rhlmyi5kkhl1bimaj1fmp36v7x5r79j3flgx9dv27rkric1ra5p";
+      name = "qtlocation-opensource-src-5.6.3.tar.xz";
     };
   };
   qtmacextras = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtmacextras-opensource-src-5.6.2.tar.xz";
-      sha256 = "05chq7dqgvlfzpqf1y9inxp0kx6hfzwbc5kswpp6gsnsyfln6ll5";
-      name = "qtmacextras-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtmacextras-opensource-src-5.6.3.tar.xz";
+      sha256 = "10v2a058yv6k76gg9dgpy4fc0xd652dknzsw5432gm8d9391382i";
+      name = "qtmacextras-opensource-src-5.6.3.tar.xz";
     };
   };
   qtmultimedia = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtmultimedia-opensource-src-5.6.2.tar.xz";
-      sha256 = "1bwcpc1s6yjvgpqbn22k4mdfjy9lhs89bbzwlgj5psy0qskp16nb";
-      name = "qtmultimedia-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtmultimedia-opensource-src-5.6.3.tar.xz";
+      sha256 = "0ihvbv0ldravbrx6406ps0z8y6521iz6h58n5ws44xq3m2g06dmf";
+      name = "qtmultimedia-opensource-src-5.6.3.tar.xz";
+    };
+  };
+  qtpurchasing = {
+    version = "5.6.3";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtpurchasing-opensource-src-5.6.3.tar.xz";
+      sha256 = "0lf269jzd6y4x5bxjwgz9dpw7hxmc6sp39qpxwlswd505cf0wgd7";
+      name = "qtpurchasing-opensource-src-5.6.3.tar.xz";
     };
   };
   qtquickcontrols = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtquickcontrols-opensource-src-5.6.2.tar.xz";
-      sha256 = "0b0h8svlzvq23kcmam7ng697bzcq4x3haymmn7gj40p15clz5l2y";
-      name = "qtquickcontrols-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtquickcontrols-opensource-src-5.6.3.tar.xz";
+      sha256 = "13nvn0d2i4lf4igc1xqf7m98n4j66az1bi02zzv5m18vyb40zfri";
+      name = "qtquickcontrols-opensource-src-5.6.3.tar.xz";
     };
   };
   qtquickcontrols2 = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtquickcontrols2-opensource-src-5.6.2.tar.xz";
-      sha256 = "1hgydll95by0rvfpv3sprxq0hkdrpacynaaq2jzaw0a7m881gp09";
-      name = "qtquickcontrols2-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtquickcontrols2-opensource-src-5.6.3.tar.xz";
+      sha256 = "1jw1zykrx8aa9p781hc74h9za7lnnm4ifpdyqa4ahbdy193phl7c";
+      name = "qtquickcontrols2-opensource-src-5.6.3.tar.xz";
     };
   };
   qtscript = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtscript-opensource-src-5.6.2.tar.xz";
-      sha256 = "03hi2j64l0mgs8p0w1jaz53zsa4lfpbgskydaxxiiqnaf6rgcvp0";
-      name = "qtscript-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtscript-opensource-src-5.6.3.tar.xz";
+      sha256 = "12dkf2s1l9y9cwdyayg2mpnwvx14kq93pymp3iy3fw1s1vfj11zh";
+      name = "qtscript-opensource-src-5.6.3.tar.xz";
     };
   };
   qtsensors = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtsensors-opensource-src-5.6.2.tar.xz";
-      sha256 = "09rl0njijl3cgh6l3pfij2rhnsg10axkl37llkbz1wmlma0r1057";
-      name = "qtsensors-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtsensors-opensource-src-5.6.3.tar.xz";
+      sha256 = "0ws96fmk5zz9szrw9x1dwa6gnv9rpv1q0h9ax9z5m1kiapfd80km";
+      name = "qtsensors-opensource-src-5.6.3.tar.xz";
     };
   };
   qtserialbus = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtserialbus-opensource-src-5.6.2.tar.xz";
-      sha256 = "09pqr9f6kl3wq4858vksbzxnrrnqxblivmayjf126lwi2q4n14mk";
-      name = "qtserialbus-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtserialbus-opensource-src-5.6.3.tar.xz";
+      sha256 = "17lskz4r549hc02riv0a3jdjbyaq4y4a94xd3jhy454lhzirpj3i";
+      name = "qtserialbus-opensource-src-5.6.3.tar.xz";
     };
   };
   qtserialport = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtserialport-opensource-src-5.6.2.tar.xz";
-      sha256 = "0xpkjkn6w0g3p7hmm12b2c96f7q98rmk2dcn321x4arcmldjhxmg";
-      name = "qtserialport-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtserialport-opensource-src-5.6.3.tar.xz";
+      sha256 = "06mfkd88rcn4p8pfzsyqbfg956vwwcql0khchjgx3bh34zp1yb88";
+      name = "qtserialport-opensource-src-5.6.3.tar.xz";
     };
   };
   qtsvg = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtsvg-opensource-src-5.6.2.tar.xz";
-      sha256 = "0kmwr3fphs7ddgxmqzy53f8p2hbp1gfmjdaig5vswc8vcszn38zp";
-      name = "qtsvg-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtsvg-opensource-src-5.6.3.tar.xz";
+      sha256 = "1v6wz8fcgsh4lfv68bhavms0l1z3mcn8vggakc3m8rdl2wsih3qh";
+      name = "qtsvg-opensource-src-5.6.3.tar.xz";
     };
   };
   qttools = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qttools-opensource-src-5.6.2.tar.xz";
-      sha256 = "1dz1i5wwhgb9li095mnmc33mwpbd8nf7sdrc2x3pl9c6hwqv8ayv";
-      name = "qttools-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qttools-opensource-src-5.6.3.tar.xz";
+      sha256 = "09krlrgcglylsv7xx4r681v7zmyy6nr8j18482skrmsqh21vlqqs";
+      name = "qttools-opensource-src-5.6.3.tar.xz";
     };
   };
   qttranslations = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qttranslations-opensource-src-5.6.2.tar.xz";
-      sha256 = "08d4xyk7njkdbd3m48dzmvdm8ma3s4x8h4jm1ip20wqngi23nybx";
-      name = "qttranslations-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qttranslations-opensource-src-5.6.3.tar.xz";
+      sha256 = "1avcfymi9bxk02i1rqh89c6hnvf4bg9qry94z29g1r62c80lxvbd";
+      name = "qttranslations-opensource-src-5.6.3.tar.xz";
+    };
+  };
+  qtvirtualkeyboard = {
+    version = "2.0";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtvirtualkeyboard-opensource-src-2.0.tar.xz";
+      sha256 = "1v0saqz76h9gnb13b8mri4jq93i7f1gr7hj81zj3vz433s2klm0x";
+      name = "qtvirtualkeyboard-opensource-src-2.0.tar.xz";
     };
   };
   qtwayland = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtwayland-opensource-src-5.6.2.tar.xz";
-      sha256 = "11kciqnqfyzjfnx1m666g35v98jdazsg083h9fv2g5kiyjck2p03";
-      name = "qtwayland-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtwayland-opensource-src-5.6.3.tar.xz";
+      sha256 = "18ys14fzjybx02aj85vyqzsp89ypv2c6vfpklxzslwyvn9w54iss";
+      name = "qtwayland-opensource-src-5.6.3.tar.xz";
     };
   };
   qtwebchannel = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtwebchannel-opensource-src-5.6.2.tar.xz";
-      sha256 = "0lhskzqcijz9x6h8p80ff5dd6ni7zqm23nzljdqbggaibzpzs3kh";
-      name = "qtwebchannel-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtwebchannel-opensource-src-5.6.3.tar.xz";
+      sha256 = "04q7wmdnv4pskah2s5nnrzbsb207fvkj333m69wkqrc64anb1ccf";
+      name = "qtwebchannel-opensource-src-5.6.3.tar.xz";
     };
   };
   qtwebengine = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtwebengine-opensource-src-5.6.2.tar.xz";
-      sha256 = "0h4pyc7r2fx8qsiw3663jd1hg1fid5yv7wil06njpcm8w541c2ig";
-      name = "qtwebengine-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtwebengine-opensource-src-5.6.3.tar.xz";
+      sha256 = "19xpvnjwrjpj6wx7sy1cs1r1ibnh5hqfk9w9rnqf5h7n77xnk780";
+      name = "qtwebengine-opensource-src-5.6.3.tar.xz";
     };
   };
   qtwebkit = {
-    version = "5.6.2";
+    version = "5.6.3";
+    src = fetchurl {
+      url = "${mirror}/community_releases/5.6/5.6.3/qtwebkit-opensource-src-5.6.3.tar.xz";
+      sha256 = "15iqgaw3jznfq1mdg1mmr7pn8w3qhw964h5m36vg3ywqayr6p309";
+      name = "qtwebkit-opensource-src-5.6.3.tar.xz";
+    };
+  };
+  qtwebkit-examples = {
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/community_releases/5.6/5.6.2/qtwebkit-opensource-src-5.6.2.tar.xz";
-      sha256 = "0rirszy092pmdvy4vzqkk4p9wwxv8qx4zkp84rxkd5ah3j5np2jj";
-      name = "qtwebkit-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/community_releases/5.6/5.6.3/qtwebkit-examples-opensource-src-5.6.3.tar.xz";
+      sha256 = "17hnls8j4wz0kyzzq7m3105lqz71zsxr0hya7i23pl4qc8affv1d";
+      name = "qtwebkit-examples-opensource-src-5.6.3.tar.xz";
     };
   };
   qtwebsockets = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtwebsockets-opensource-src-5.6.2.tar.xz";
-      sha256 = "0ddsnnp3sn423ryqqa1060cqlbdcp7ncj3zhabifaswfzyxx9n9w";
-      name = "qtwebsockets-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtwebsockets-opensource-src-5.6.3.tar.xz";
+      sha256 = "1sr8q0wqw4xwcdl6nvnv04pcjxb0fbs4ywrkcghdz2bcc52r0hx2";
+      name = "qtwebsockets-opensource-src-5.6.3.tar.xz";
     };
   };
   qtwebview = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtwebview-opensource-src-5.6.2.tar.xz";
-      sha256 = "1mjix4w71x1w86ykcdhsl7gg7xv9dn2pw6yiaxrp6pxvvk73cyjs";
-      name = "qtwebview-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtwebview-opensource-src-5.6.3.tar.xz";
+      sha256 = "076q9g2ca41v8lyhn7354rs8w2ca0wp2hsxc76zprzghi5p4b2kn";
+      name = "qtwebview-opensource-src-5.6.3.tar.xz";
     };
   };
   qtwinextras = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtwinextras-opensource-src-5.6.2.tar.xz";
-      sha256 = "1s375b1bf8cqs73mg8chwvj0npr01hpyrwv75srqnxkp61avi1gr";
-      name = "qtwinextras-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtwinextras-opensource-src-5.6.3.tar.xz";
+      sha256 = "0nmhvd1g18w12q6i8s87aq7rwikcn1m8m9m0a02l3p22xvimkxzf";
+      name = "qtwinextras-opensource-src-5.6.3.tar.xz";
     };
   };
   qtx11extras = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtx11extras-opensource-src-5.6.2.tar.xz";
-      sha256 = "1v8cnhas3rynqz7b8wryry2qhblrnmnd3v39gdki1hzfz8fdxzvi";
-      name = "qtx11extras-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtx11extras-opensource-src-5.6.3.tar.xz";
+      sha256 = "0zv70z5z48wlg0q2zd7nbp7i0wimdcalns6yg0mjp7v2w2b8wyhy";
+      name = "qtx11extras-opensource-src-5.6.3.tar.xz";
     };
   };
   qtxmlpatterns = {
-    version = "5.6.2";
+    version = "5.6.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.6/5.6.2/submodules/qtxmlpatterns-opensource-src-5.6.2.tar.xz";
-      sha256 = "1k428wj8iffm6rrbvwbw0hksr99xqsxww8iahbk8r38qpzpg6vbw";
-      name = "qtxmlpatterns-opensource-src-5.6.2.tar.xz";
+      url = "${mirror}/official_releases/qt/5.6/5.6.3/submodules/qtxmlpatterns-opensource-src-5.6.3.tar.xz";
+      sha256 = "1xjimf88j2s5jrqgr9ki82zmis8r979rrzq4k6dxw43k1ngzyqd4";
+      name = "qtxmlpatterns-opensource-src-5.6.3.tar.xz";
     };
   };
 }
diff --git a/pkgs/development/libraries/qt-5/5.9/default.nix b/pkgs/development/libraries/qt-5/5.9/default.nix
index 879f7f198c9..9afa818c36e 100644
--- a/pkgs/development/libraries/qt-5/5.9/default.nix
+++ b/pkgs/development/libraries/qt-5/5.9/default.nix
@@ -6,9 +6,9 @@ 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`.
 
-1. Update the URL in `maintainers/scripts/generate-qt.sh`.
+1. Update the URL in `pkgs/development/libraries/qt-5/$VERSION/fetch.sh`.
 2. From the top of the Nixpkgs tree, run
-   `./maintainers/scripts/generate-qt.sh > pkgs/development/libraries/qt-5/$VERSION/srcs.nix`.
+   `./maintainers/scripts/fetch-kde-qt.sh > pkgs/development/libraries/qt-5/$VERSION/srcs.nix`.
 3. Update `qtCompatVersion` below if the minor version number changes.
 4. Check that the new packages build correctly.
 5. Commit the changes and open a pull request.
@@ -24,7 +24,7 @@ top-level attribute to `top-level/all-packages.nix`.
   # options
   developerBuild ? false,
   decryptSslTraffic ? false,
-  debug ? null,
+  debug ? false,
 }:
 
 with stdenv.lib;
@@ -91,6 +91,7 @@ let
       qtsvg = callPackage ../modules/qtsvg.nix {};
       qttools = callPackage ../modules/qttools.nix {};
       qttranslations = callPackage ../modules/qttranslations.nix {};
+      qtvirtualkeyboard = callPackage ../modules/qtvirtualkeyboard.nix {};
       qtwayland = callPackage ../modules/qtwayland.nix {};
       qtwebchannel = callPackage ../modules/qtwebchannel.nix {};
       qtwebengine = callPackage ../modules/qtwebengine.nix {};
@@ -104,7 +105,7 @@ let
         qtcharts qtconnectivity qtdeclarative qtdoc qtgraphicaleffects
         qtimageformats qtlocation qtmultimedia qtquickcontrols qtscript
         qtsensors qtserialport qtsvg qttools qttranslations qtwebsockets
-        qtx11extras qtxmlpatterns
+        qtx11extras qtxmlpatterns qtvirtualkeyboard
       ] ++ optional (!stdenv.isDarwin) qtwayland
         ++ optional (stdenv.isDarwin) qtmacextras);
 
diff --git a/pkgs/development/libraries/qt-5/5.9/fetch.sh b/pkgs/development/libraries/qt-5/5.9/fetch.sh
index 2ae85bba391..103fa4e09ab 100644
--- a/pkgs/development/libraries/qt-5/5.9/fetch.sh
+++ b/pkgs/development/libraries/qt-5/5.9/fetch.sh
@@ -1,2 +1,2 @@
-WGET_ARGS=( http://download.qt.io/official_releases/qt/5.9/5.9.1/submodules/ \
+WGET_ARGS=( http://download.qt.io/official_releases/qt/5.9/5.9.3/submodules/ \
             -A '*.tar.xz' )
diff --git a/pkgs/development/libraries/qt-5/5.9/qtbase.patch b/pkgs/development/libraries/qt-5/5.9/qtbase.patch
index 4f6ed98ba29..086ddf4fe3e 100644
--- a/pkgs/development/libraries/qt-5/5.9/qtbase.patch
+++ b/pkgs/development/libraries/qt-5/5.9/qtbase.patch
@@ -12,7 +12,7 @@ index 5208379f9a..92fe29a0ac 100644
  
  QMAKE_LFLAGS_REL_RPATH  =
 diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
-index bb5083c925..da8e2cb386 100644
+index bb5083c925..77034f9bb6 100644
 --- a/mkspecs/features/create_cmake.prf
 +++ b/mkspecs/features/create_cmake.prf
 @@ -21,7 +21,7 @@ load(cmake_functions)
@@ -48,7 +48,7 @@ index bb5083c925..da8e2cb386 100644
 -    # installed in $${CMAKE_LIB_DIR}/cmake/Qt5$${CMAKE_MODULE_NAME}
 -    CMAKE_RELATIVE_INSTALL_DIR = "$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}../../"
 -}
-+CMAKE_LIB_DIR = $$NIX_OUTPUT_DEV/lib/
++CMAKE_LIB_DIR = $$NIX_OUTPUT_OUT/lib/
 +CMAKE_LIB_DIR_IS_ABSOLUTE = True
  
 -CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
@@ -77,7 +77,7 @@ index bb5083c925..da8e2cb386 100644
 -    CMAKE_DLL_DIR = $$CMAKE_LIB_DIR
 -    CMAKE_DLL_DIR_IS_ABSOLUTE = $$CMAKE_LIB_DIR_IS_ABSOLUTE
 -}
-+CMAKE_DLL_DIR = $$NIX_OUTPUT_DEV/lib/
++CMAKE_DLL_DIR = $$NIX_OUTPUT_OUT/lib/
 +CMAKE_DLL_DIR_IS_ABSOLUTE = True
  
  static|staticlib:CMAKE_STATIC_TYPE = true
@@ -101,7 +101,7 @@ index bb5083c925..da8e2cb386 100644
  # We are generating cmake files. Most developers of Qt are not aware of cmake,
  # so we require automatic tests to be available. The only module which should
 diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
-index 17da8b979e..d648ab4058 100644
+index 55c74aad66..0bbc8718eb 100644
 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
 +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
 @@ -9,30 +9,6 @@ if (CMAKE_VERSION VERSION_LESS 3.0.0)
@@ -261,10 +261,10 @@ index 17da8b979e..d648ab4058 100644
          set_target_properties(Qt5::${Plugin} PROPERTIES
              \"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
 diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
-index 395ac34001..a0e5c68b7e 100644
+index e645ba5803..a0e5c68b7e 100644
 --- a/mkspecs/features/mac/default_post.prf
 +++ b/mkspecs/features/mac/default_post.prf
-@@ -24,165 +24,3 @@ qt {
+@@ -24,166 +24,3 @@ qt {
          }
      }
  }
@@ -427,14 +427,15 @@ index 395ac34001..a0e5c68b7e 100644
 -}
 -
 -cache(QMAKE_XCODE_DEVELOPER_PATH, stash)
--cache(QMAKE_XCODE_VERSION, stash)
+-!isEmpty(QMAKE_XCODE_VERSION): \
+-    cache(QMAKE_XCODE_VERSION, stash)
 -
 -QMAKE_XCODE_LIBRARY_SUFFIX = $$qtPlatformTargetSuffix()
 diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
-index e21e749ee9..3b01424e67 100644
+index 44636f2288..3b01424e67 100644
 --- a/mkspecs/features/mac/default_pre.prf
 +++ b/mkspecs/features/mac/default_pre.prf
-@@ -1,51 +1,2 @@
+@@ -1,56 +1,2 @@
  CONFIG = asset_catalogs rez $$CONFIG
  load(default_pre)
 -
@@ -447,18 +448,23 @@ index e21e749ee9..3b01424e67 100644
 -    # Make sure Xcode path is valid
 -    !exists($$QMAKE_XCODE_DEVELOPER_PATH): \
 -        error("Xcode is not installed in $${QMAKE_XCODE_DEVELOPER_PATH}. Please use xcode-select to choose Xcode installation path.")
+-}
+-
+-isEmpty(QMAKE_XCODEBUILD_PATH): \
+-    QMAKE_XCODEBUILD_PATH = $$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null")
 -
+-!isEmpty(QMAKE_XCODEBUILD_PATH) {
 -    # Make sure Xcode is set up properly
--    isEmpty($$list($$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null"))): \
--        error("Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.")
--}
+-    !system("/usr/bin/xcrun xcodebuild -license check 2>/dev/null"): \
+-        error("Xcode not set up properly. You need to confirm the license agreement by running 'sudo xcrun xcodebuild -license accept'.")
 -
--isEmpty(QMAKE_XCODE_VERSION) {
--    # Extract Xcode version using xcodebuild
--    xcode_version = $$system("/usr/bin/xcodebuild -version")
--    QMAKE_XCODE_VERSION = $$member(xcode_version, 1)
--    isEmpty(QMAKE_XCODE_VERSION): error("Could not resolve Xcode version.")
--    unset(xcode_version)
+-    isEmpty(QMAKE_XCODE_VERSION) {
+-        # Extract Xcode version using xcodebuild
+-        xcode_version = $$system("/usr/bin/xcrun xcodebuild -version")
+-        QMAKE_XCODE_VERSION = $$member(xcode_version, 1)
+-        isEmpty(QMAKE_XCODE_VERSION): error("Could not resolve Xcode version.")
+-        unset(xcode_version)
+-    }
 -}
 -
 -isEmpty(QMAKE_TARGET_BUNDLE_PREFIX) {
@@ -487,10 +493,10 @@ index e21e749ee9..3b01424e67 100644
 -# at build time, depending on the current Xcode SDK and configuration.
 -QMAKE_XCODE_LIBRARY_SUFFIX_SETTING = QT_LIBRARY_SUFFIX
 diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
-index 68ab7e4053..e69de29bb2 100644
+index 3f6dc076ca..e69de29bb2 100644
 --- a/mkspecs/features/mac/sdk.prf
 +++ b/mkspecs/features/mac/sdk.prf
-@@ -1,49 +0,0 @@
+@@ -1,58 +0,0 @@
 -
 -isEmpty(QMAKE_MAC_SDK): \
 -    error("QMAKE_MAC_SDK must be set when using CONFIG += sdk.")
@@ -500,13 +506,22 @@ index 68ab7e4053..e69de29bb2 100644
 -
 -defineReplace(xcodeSDKInfo) {
 -    info = $$1
+-    equals(info, "Path"): \
+-        info = --show-sdk-path
+-    equals(info, "PlatformPath"): \
+-        info = --show-sdk-platform-path
+-    equals(info, "SDKVersion"): \
+-        info = --show-sdk-version
 -    sdk = $$2
 -    isEmpty(sdk): \
 -        sdk = $$QMAKE_MAC_SDK
 -
 -    isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}) {
--        QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("/usr/bin/xcodebuild -sdk $$sdk -version $$info 2>/dev/null")
--        isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}): error("Could not resolve SDK $$info for \'$$sdk\'")
+-        QMAKE_MAC_SDK.$${sdk}.$${info} = $$system("/usr/bin/xcrun --sdk $$sdk $$info 2>/dev/null")
+-        # --show-sdk-platform-path won't work for Command Line Tools; this is fine
+-        # only used by the XCTest backend to testlib
+-        isEmpty(QMAKE_MAC_SDK.$${sdk}.$${info}):if(!isEmpty(QMAKE_XCODEBUILD_PATH)|!equals(info, "--show-sdk-platform-path")): \
+-            error("Could not resolve SDK $$info for \'$$sdk\'")
 -        cache(QMAKE_MAC_SDK.$${sdk}.$${info}, set stash, QMAKE_MAC_SDK.$${sdk}.$${info})
 -    }
 -
@@ -581,10 +596,10 @@ index d49f4c49c1..097dcd7d39 100644
  target.path = $$instbase/$$TARGETPATH
  INSTALLS += target
 diff --git a/mkspecs/features/qt_app.prf b/mkspecs/features/qt_app.prf
-index cb84ae0da8..45e16f4302 100644
+index 883f8ca215..81db8eb2d4 100644
 --- a/mkspecs/features/qt_app.prf
 +++ b/mkspecs/features/qt_app.prf
-@@ -29,7 +29,7 @@ host_build:force_bootstrap {
+@@ -33,7 +33,7 @@ host_build:force_bootstrap {
      target.path = $$[QT_HOST_BINS]
  } else {
      !build_pass:qtConfig(debug_and_release): CONFIG += release
@@ -607,7 +622,7 @@ index 1848f00e90..2af93675c5 100644
 +    MODULE_QMAKE_OUTDIR = $$NIX_OUTPUT_OUT
  }
 diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
-index 1e138730b3..b7ba74dc3f 100644
+index fb96d1b6a0..508ed17d30 100644
 --- a/mkspecs/features/qt_common.prf
 +++ b/mkspecs/features/qt_common.prf
 @@ -32,8 +32,8 @@ contains(TEMPLATE, .*lib) {
@@ -661,20 +676,20 @@ index 72dde61a40..f891a2baed 100644
      INSTALLS += inst_qch_docs
  
 diff --git a/mkspecs/features/qt_example_installs.prf b/mkspecs/features/qt_example_installs.prf
-index 0a008374e5..5e7cd92f6f 100644
+index 668669e4cd..eb4840a0aa 100644
 --- a/mkspecs/features/qt_example_installs.prf
 +++ b/mkspecs/features/qt_example_installs.prf
-@@ -73,7 +73,7 @@ probase = $$relative_path($$_PRO_FILE_PWD_, $$dirname(_QMAKE_CONF_)/examples)
-         $$SOURCES $$HEADERS $$FORMS $$RESOURCES $$TRANSLATIONS \
-         $$DBUS_ADAPTORS $$DBUS_INTERFACES
-     addInstallFiles(sources.files, $$sourcefiles)
--    sources.path = $$[QT_INSTALL_EXAMPLES]/$$probase
-+    sources.path = $$NIX_OUTPUT_DEV/share/examples/$$probase
-     INSTALLS += sources
- 
-     check_examples {
+@@ -82,7 +82,7 @@ sourcefiles += \
+     $$SOURCES $$HEADERS $$FORMS $$RESOURCES $$TRANSLATIONS \
+     $$DBUS_ADAPTORS $$DBUS_INTERFACES
+ addInstallFiles(sources.files, $$sourcefiles)
+-sources.path = $$[QT_INSTALL_EXAMPLES]/$$probase
++sources.path = $$NIX_OUTPUT_DEV/share/examples/$$probase
+ INSTALLS += sources
+ 
+ check_examples {
 diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
-index c00fdb73f8..6d8ba132cb 100644
+index 1903e509c8..ae7b585989 100644
 --- a/mkspecs/features/qt_functions.prf
 +++ b/mkspecs/features/qt_functions.prf
 @@ -69,7 +69,7 @@ defineTest(qtHaveModule) {
@@ -682,7 +697,7 @@ index c00fdb73f8..6d8ba132cb 100644
      cmd = $$eval(QT_TOOL.$${2}.binary)
      isEmpty(cmd) {
 -        cmd = $$[QT_HOST_BINS]/$$2
-+        cmd = $$system("type -p $$2")
++        cmd = $$system("command -v $$2")
          exists($${cmd}.pl) {
              $${1}_EXE = $${cmd}.pl
              cmd = perl -w $$system_path($${cmd}.pl)
@@ -836,7 +851,7 @@ index 706304cf34..546420f6ad 100644
  set(_qt5_corelib_extra_includes \"$${CMAKE_INSTALL_DATA_DIR}mkspecs/$${CMAKE_MKSPEC}\")
  !!ENDIF
 diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
-index 39e7c71a9c..dced1f2811 100644
+index cba279c184..5ae3fd62e5 100644
 --- a/src/corelib/kernel/qcoreapplication.cpp
 +++ b/src/corelib/kernel/qcoreapplication.cpp
 @@ -2533,6 +2533,15 @@ QStringList QCoreApplication::libraryPaths()
@@ -856,7 +871,7 @@ index 39e7c71a9c..dced1f2811 100644
          if (!libPathEnv.isEmpty()) {
              QStringList paths = QFile::decodeName(libPathEnv).split(QDir::listSeparator(), QString::SkipEmptyParts);
 diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp
-index 1714c9802f..fd2ebb1336 100644
+index 4fdc2e36ac..d3ec222543 100644
 --- a/src/corelib/tools/qtimezoneprivate_tz.cpp
 +++ b/src/corelib/tools/qtimezoneprivate_tz.cpp
 @@ -70,7 +70,11 @@ typedef QHash<QByteArray, QTzTimeZone> QTzTimeZoneHash;
@@ -872,7 +887,7 @@ index 1714c9802f..fd2ebb1336 100644
      if (!QFile::exists(path))
          path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
  
-@@ -643,12 +647,16 @@ void QTzTimeZonePrivate::init(const QByteArray &ianaId)
+@@ -645,12 +649,16 @@ void QTzTimeZonePrivate::init(const QByteArray &ianaId)
          if (!tzif.open(QIODevice::ReadOnly))
              return;
      } else {
@@ -925,7 +940,7 @@ index 1d947159e2..b36865fc48 100644
  
      set_target_properties(Qt5::qdbusxml2cpp PROPERTIES
 diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
-index 07869efd7d..37b95d1b6b 100644
+index 07869efd7d..fb4183bada 100644
 --- a/src/gui/Qt5GuiConfigExtras.cmake.in
 +++ b/src/gui/Qt5GuiConfigExtras.cmake.in
 @@ -2,7 +2,7 @@
@@ -949,7 +964,7 @@ index 07869efd7d..37b95d1b6b 100644
  
  !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
 -    set(imported_implib \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
-+    set(imported_implib \"$$NIX_OUTPUT_DEV/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
++    set(imported_implib \"$$NIX_OUTPUT_OUT/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
  !!ELSE
      set(imported_implib \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
  !!ENDIF
@@ -967,7 +982,7 @@ index 1da00813ce..0bf877afcb 100644
              return false;
      }
 diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
-index cf08a15f96..2310488298 100644
+index 9a24938284..74962b4ae2 100644
 --- a/src/network/kernel/qhostinfo_unix.cpp
 +++ b/src/network/kernel/qhostinfo_unix.cpp
 @@ -102,7 +102,7 @@ static bool resolveLibraryInternal()
@@ -1002,7 +1017,7 @@ index c92d8fc3f8..6008063bcf 100644
              // specific curves requested, but not possible to set -> error
              sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocket::tr("OpenSSL version too old, need at least v1.0.2"));
 diff --git a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
-index ca9f7af127..a337ad73bf 100644
+index b5a0a5bbeb..6c20305f4d 100644
 --- a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
 +++ b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
 @@ -265,12 +265,9 @@ void TableGenerator::initPossibleLocations()
@@ -1020,7 +1035,7 @@ index ca9f7af127..a337ad73bf 100644
  
  QString TableGenerator::findComposeFile()
 diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
-index 7640a711a9..ef9a14d38b 100644
+index e2e573f0e1..1c8289f81e 100644
 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
 +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
 @@ -580,7 +580,14 @@ QFunctionPointer QGLXContext::getProcAddress(const char *procName)
@@ -1039,11 +1054,11 @@ index 7640a711a9..ef9a14d38b 100644
  #endif
              }
 diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
-index d257ab1242..75853af4e4 100644
+index 7c62c2e2b3..fefa40e0f6 100644
 --- a/src/plugins/platforms/xcb/qxcbcursor.cpp
 +++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
 @@ -311,10 +311,10 @@ QXcbCursor::QXcbCursor(QXcbConnection *conn, QXcbScreen *screen)
- #if defined(XCB_USE_XLIB) && QT_CONFIG(library)
+ #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
      static bool function_ptrs_not_initialized = true;
      if (function_ptrs_not_initialized) {
 -        QLibrary xcursorLib(QLatin1String("Xcursor"), 1);
@@ -1091,6 +1106,26 @@ index c4cd66c33b..b6f2691587 100644
  
      return 0;
  }
+diff --git a/src/testlib/qtestassert.h b/src/testlib/qtestassert.h
+index 6498ea84ef..d821ced7fc 100644
+--- a/src/testlib/qtestassert.h
++++ b/src/testlib/qtestassert.h
+@@ -44,10 +44,13 @@
+ 
+ QT_BEGIN_NAMESPACE
+ 
+-
++#if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
++#define QTEST_ASSERT(cond) do { } while ((false) && (cond))
++#define QTEST_ASSERT_X(cond, where, what) do { } while ((false) && (cond))
++#else
+ #define QTEST_ASSERT(cond) do { if (!(cond)) qt_assert(#cond,__FILE__,__LINE__); } while (false)
+-
+ #define QTEST_ASSERT_X(cond, where, what) do { if (!(cond)) qt_assert_x(where, what,__FILE__,__LINE__); } while (false)
++#endif
+ 
+ QT_END_NAMESPACE
+ 
 diff --git a/src/widgets/Qt5WidgetsConfigExtras.cmake.in b/src/widgets/Qt5WidgetsConfigExtras.cmake.in
 index 99d87e2e46..a4eab2aa72 100644
 --- a/src/widgets/Qt5WidgetsConfigExtras.cmake.in
diff --git a/pkgs/development/libraries/qt-5/5.9/srcs.nix b/pkgs/development/libraries/qt-5/5.9/srcs.nix
index 247800b7578..df7846ca386 100644
--- a/pkgs/development/libraries/qt-5/5.9/srcs.nix
+++ b/pkgs/development/libraries/qt-5/5.9/srcs.nix
@@ -3,275 +3,275 @@
 
 {
   qt3d = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qt3d-opensource-src-5.9.1.tar.xz";
-      sha256 = "15j9znfnxch1n6fwz9ngi30msdzh0wlpykl53cs8g2fp2awfa7sg";
-      name = "qt3d-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qt3d-opensource-src-5.9.3.tar.xz";
+      sha256 = "0gr7wvd3p8i2frj9nkfxffxapwqx6i4wh171ymvcsg2qy0r534lp";
+      name = "qt3d-opensource-src-5.9.3.tar.xz";
     };
   };
   qtactiveqt = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtactiveqt-opensource-src-5.9.1.tar.xz";
-      sha256 = "07zq60xg7nnlny7qgj6dk1ibg3fzhbdh78gpd0s6x1n822iyislg";
-      name = "qtactiveqt-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtactiveqt-opensource-src-5.9.3.tar.xz";
+      sha256 = "16aka3y7a6mhs0yfm7vbq8v5gbh2ifmk4v2hl04iacindq9f5v2r";
+      name = "qtactiveqt-opensource-src-5.9.3.tar.xz";
     };
   };
   qtandroidextras = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtandroidextras-opensource-src-5.9.1.tar.xz";
-      sha256 = "0nq879jsa2z1l5q3n0hhiv15mzfm5c6s7zfblcc10sgim90p5mjj";
-      name = "qtandroidextras-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtandroidextras-opensource-src-5.9.3.tar.xz";
+      sha256 = "0f653qmzvr3rjjgipjbcxvp5wq9fbaz1b4bvj7g868s2d9gpqp9n";
+      name = "qtandroidextras-opensource-src-5.9.3.tar.xz";
     };
   };
   qtbase = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtbase-opensource-src-5.9.1.tar.xz";
-      sha256 = "1ikm896jzyfyjv2qv8n3fd81sxb4y24zkygx36865ygzyvlj36mw";
-      name = "qtbase-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtbase-opensource-src-5.9.3.tar.xz";
+      sha256 = "10lrkarvs7dpx9rlj7sjcc0pzi42098x8nqnhmydr4bnbq048z4y";
+      name = "qtbase-opensource-src-5.9.3.tar.xz";
     };
   };
   qtcanvas3d = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtcanvas3d-opensource-src-5.9.1.tar.xz";
-      sha256 = "10fy8wqfw2yhha6lyky5g1a72137aj8pji7mk0wjnggh629z12sb";
-      name = "qtcanvas3d-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtcanvas3d-opensource-src-5.9.3.tar.xz";
+      sha256 = "1g0a606fgal4x17ly0qrj05pb0k8riwh7nj4g3jip05g8iwb2f2y";
+      name = "qtcanvas3d-opensource-src-5.9.3.tar.xz";
     };
   };
   qtcharts = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtcharts-opensource-src-5.9.1.tar.xz";
-      sha256 = "180df5v7i1ki8hc3lgi6jcfdyz7f19pb73dvfkw402wa2gfcna3k";
-      name = "qtcharts-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtcharts-opensource-src-5.9.3.tar.xz";
+      sha256 = "1sb99ncmh84bz0xzq55chgic7jk61awnfvi7ld4gq5ap3nl865zc";
+      name = "qtcharts-opensource-src-5.9.3.tar.xz";
     };
   };
   qtconnectivity = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtconnectivity-opensource-src-5.9.1.tar.xz";
-      sha256 = "1mbzmqix0388iq20a1ljd1pgdq259rm1xzp9kx8gigqpamqqnqs0";
-      name = "qtconnectivity-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtconnectivity-opensource-src-5.9.3.tar.xz";
+      sha256 = "0j86rspn4xgwq1ddc1mpq1kq0ib2c0ag6rsn9ly2xs4iimp1x2g2";
+      name = "qtconnectivity-opensource-src-5.9.3.tar.xz";
     };
   };
   qtdatavis3d = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtdatavis3d-opensource-src-5.9.1.tar.xz";
-      sha256 = "14d1q07winh6n1bkc616dapwfnsfkcjyg5zngdqjdj9mza8ang13";
-      name = "qtdatavis3d-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtdatavis3d-opensource-src-5.9.3.tar.xz";
+      sha256 = "0s636ix44akrjx47gv9qj2ac02q8clnwj3acfr28p6pagm46k7vh";
+      name = "qtdatavis3d-opensource-src-5.9.3.tar.xz";
     };
   };
   qtdeclarative = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtdeclarative-opensource-src-5.9.1.tar.xz";
-      sha256 = "1zwlxrgraxhlsdkwsai3pjbz7f3a6rsnsg2mjrpay6cz3af6rznj";
-      name = "qtdeclarative-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtdeclarative-opensource-src-5.9.3.tar.xz";
+      sha256 = "01wlk17zf47yzx7cc3cp617gj70yadllj2rsfk78879c0v96cpsh";
+      name = "qtdeclarative-opensource-src-5.9.3.tar.xz";
     };
   };
   qtdoc = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtdoc-opensource-src-5.9.1.tar.xz";
-      sha256 = "1d2kk9wzm2261ap87nyf743a4662gll03gz5yh5qi7k620lk372x";
-      name = "qtdoc-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtdoc-opensource-src-5.9.3.tar.xz";
+      sha256 = "0aki592arm3r08y9cq8863jp9zzkvgx7sc48426n30m6q9valsg5";
+      name = "qtdoc-opensource-src-5.9.3.tar.xz";
     };
   };
   qtgamepad = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtgamepad-opensource-src-5.9.1.tar.xz";
-      sha256 = "055w4649zi93q1sl32ngqwgnl2vxw1idnm040s9gjgjb67gi81zi";
-      name = "qtgamepad-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtgamepad-opensource-src-5.9.3.tar.xz";
+      sha256 = "14vari5cq10a0z02559l2m1v78g7ygnyqf1ilkmy2f0kr36wm7y6";
+      name = "qtgamepad-opensource-src-5.9.3.tar.xz";
     };
   };
   qtgraphicaleffects = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtgraphicaleffects-opensource-src-5.9.1.tar.xz";
-      sha256 = "1zsr3a5dsmpvrb5h4m4h42wqmkvkks3d8mmyrx4k0mfr6s7c71jz";
-      name = "qtgraphicaleffects-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtgraphicaleffects-opensource-src-5.9.3.tar.xz";
+      sha256 = "1nghl39sqsjamjn6pfmxmgga6z9vwzv2zbgc92amrfxxr2dh42vr";
+      name = "qtgraphicaleffects-opensource-src-5.9.3.tar.xz";
     };
   };
   qtimageformats = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtimageformats-opensource-src-5.9.1.tar.xz";
-      sha256 = "0iwa3dys5rv706cpxwhmgircv783pmlyl1yrsc5i0rha643y7zkr";
-      name = "qtimageformats-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtimageformats-opensource-src-5.9.3.tar.xz";
+      sha256 = "1p95wzm46j49c5br45g0pmlz3n3fl93j1ipzmnpmq9y2pbfhkcyl";
+      name = "qtimageformats-opensource-src-5.9.3.tar.xz";
     };
   };
   qtlocation = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtlocation-opensource-src-5.9.1.tar.xz";
-      sha256 = "058mgvlaml9rkfhkpr1n3avhi12zlva131sqhbwj4lwwyqfkri2b";
-      name = "qtlocation-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtlocation-opensource-src-5.9.3.tar.xz";
+      sha256 = "1qacqz6l7zljqszblhgzg5y1v4mgki59k45ag7yc2iw7vrf45zc0";
+      name = "qtlocation-opensource-src-5.9.3.tar.xz";
     };
   };
   qtmacextras = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtmacextras-opensource-src-5.9.1.tar.xz";
-      sha256 = "0096g9l2hwsiwlzfjkw7rhkdnyvb5gzjzyjjg9kqfnsagbwscv11";
-      name = "qtmacextras-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtmacextras-opensource-src-5.9.3.tar.xz";
+      sha256 = "0piv3q49vhpjxafdicizcw13am49h0ybfhb37vai0x1wbrlvhdiy";
+      name = "qtmacextras-opensource-src-5.9.3.tar.xz";
     };
   };
   qtmultimedia = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtmultimedia-opensource-src-5.9.1.tar.xz";
-      sha256 = "1r76zvbv6wwb7lgw9jwlx382iyw34i1amxaypb5bg3j1niqvx3z4";
-      name = "qtmultimedia-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtmultimedia-opensource-src-5.9.3.tar.xz";
+      sha256 = "19iqh8xpspzlmpzh05bx5rchlslbfy2pp00xv52496yf9b95i5g7";
+      name = "qtmultimedia-opensource-src-5.9.3.tar.xz";
     };
   };
   qtnetworkauth = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtnetworkauth-opensource-src-5.9.1.tar.xz";
-      sha256 = "1fgax3p7lqcz29z2n1qxnfpkj3wxq1x9bfx61q6nss1fs74pxzra";
-      name = "qtnetworkauth-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtnetworkauth-opensource-src-5.9.3.tar.xz";
+      sha256 = "0fdz5q47xbiij3mi5lzhvxpq4jp9fm929v9kyvcyadz86mp3f8nz";
+      name = "qtnetworkauth-opensource-src-5.9.3.tar.xz";
     };
   };
   qtpurchasing = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtpurchasing-opensource-src-5.9.1.tar.xz";
-      sha256 = "0b1hlaq6rb7d6b6h8kqd26klcpzf9vcdjrv610kdj0drb00jg3ss";
-      name = "qtpurchasing-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtpurchasing-opensource-src-5.9.3.tar.xz";
+      sha256 = "00yfdd00frgf7fs9s0vyn1c6c4abxgld5rfgkzms3y6n6lcphs0j";
+      name = "qtpurchasing-opensource-src-5.9.3.tar.xz";
     };
   };
   qtquickcontrols = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtquickcontrols-opensource-src-5.9.1.tar.xz";
-      sha256 = "0bpc465q822phw3dcbddn70wj1fjlc2hxskkp1z9gl7r23hx03jj";
-      name = "qtquickcontrols-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtquickcontrols-opensource-src-5.9.3.tar.xz";
+      sha256 = "09p2q3max4xrlw5svbhn11y9cgrvcjsj88xw4c0kq91cgnyyw3ih";
+      name = "qtquickcontrols-opensource-src-5.9.3.tar.xz";
     };
   };
   qtquickcontrols2 = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtquickcontrols2-opensource-src-5.9.1.tar.xz";
-      sha256 = "1zq86kqz85wm3n84jcxkxw5x1mrhkqzldkigf8xm3l8j24rf0fr0";
-      name = "qtquickcontrols2-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtquickcontrols2-opensource-src-5.9.3.tar.xz";
+      sha256 = "0hq888qq8q7dglpyzif64pplqjxfrqjpkvbcx0ycq35darls5ai1";
+      name = "qtquickcontrols2-opensource-src-5.9.3.tar.xz";
     };
   };
   qtremoteobjects = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtremoteobjects-opensource-src-5.9.1.tar.xz";
-      sha256 = "10kwq0fgmi6zsqhb6s1nkcydpyl8d8flzdpgmyj50c4h2xhg2km0";
-      name = "qtremoteobjects-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtremoteobjects-opensource-src-5.9.3.tar.xz";
+      sha256 = "0z6qd381r6a7gdrsknlkkbhq9mmdqi040kfrvgm6mfa69336f4dk";
+      name = "qtremoteobjects-opensource-src-5.9.3.tar.xz";
     };
   };
   qtscript = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtscript-opensource-src-5.9.1.tar.xz";
-      sha256 = "13qq2mjfhqdcvkmzrgxg1gr5kww1ygbwb7r71xxl6rjzbn30hshp";
-      name = "qtscript-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtscript-opensource-src-5.9.3.tar.xz";
+      sha256 = "0rjm6nph1nssfpknp4i682bvk7363y4a2f74060vcm7ib2pzl2xq";
+      name = "qtscript-opensource-src-5.9.3.tar.xz";
     };
   };
   qtscxml = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtscxml-opensource-src-5.9.1.tar.xz";
-      sha256 = "1m3b6wg5hqasdfc5igpj9bq3czql5kkvvn3rx1ig508kdlh5i5s0";
-      name = "qtscxml-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtscxml-opensource-src-5.9.3.tar.xz";
+      sha256 = "06x8hs3p7bfgnl6b2fjld4s41acw1rbnxbcgkprgw2fxxnl1zxfq";
+      name = "qtscxml-opensource-src-5.9.3.tar.xz";
     };
   };
   qtsensors = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtsensors-opensource-src-5.9.1.tar.xz";
-      sha256 = "1772x7r6y9xv2sv0w2dfz2yhagsq5bpa9kdpzg0qikccmabr7was";
-      name = "qtsensors-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtsensors-opensource-src-5.9.3.tar.xz";
+      sha256 = "1hfsih5iy4fi6mnpw2shf1lzx9hxcdc1arspad1mark17l5s4pmr";
+      name = "qtsensors-opensource-src-5.9.3.tar.xz";
     };
   };
   qtserialbus = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtserialbus-opensource-src-5.9.1.tar.xz";
-      sha256 = "1hzk377c3zl4dm5hxwvpxg2w096m160448y9df6v6l8xpzpzxafa";
-      name = "qtserialbus-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtserialbus-opensource-src-5.9.3.tar.xz";
+      sha256 = "0f39qh05mp54frpn5sy9k5vfw5zb2gg72qaqz81mwlck2xg78qpg";
+      name = "qtserialbus-opensource-src-5.9.3.tar.xz";
     };
   };
   qtserialport = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtserialport-opensource-src-5.9.1.tar.xz";
-      sha256 = "0sbsc7n701kxl16r247a907zg2afmbx1xlml5jkc6a9956zqbzp1";
-      name = "qtserialport-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtserialport-opensource-src-5.9.3.tar.xz";
+      sha256 = "1pxb679cx77vk39ik7j0k91a57wqa63d4g4riw3r2gpcay8kxpac";
+      name = "qtserialport-opensource-src-5.9.3.tar.xz";
     };
   };
   qtspeech = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtspeech-opensource-src-5.9.1.tar.xz";
-      sha256 = "00daxkf8iwf6n9rhkkv3isv5qa8wijwzb0zy1f6zlm3vcc8fz75c";
-      name = "qtspeech-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtspeech-opensource-src-5.9.3.tar.xz";
+      sha256 = "1c4rpf3by620fx8lrvmc38r60cikqczqh2rfcm7ixz3x8cj60lh1";
+      name = "qtspeech-opensource-src-5.9.3.tar.xz";
     };
   };
   qtsvg = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtsvg-opensource-src-5.9.1.tar.xz";
-      sha256 = "1rg2q4snh2g4n93zmk995swwkl0ab1jr9ka9xpj56ddifkw99wlr";
-      name = "qtsvg-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtsvg-opensource-src-5.9.3.tar.xz";
+      sha256 = "1wjx9ymk2h19l9kk76jh87bnhhj955f9a93akvwwzfwg1jk2hrnz";
+      name = "qtsvg-opensource-src-5.9.3.tar.xz";
     };
   };
   qttools = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qttools-opensource-src-5.9.1.tar.xz";
-      sha256 = "1s50kh3sg5wc5gqhwwznnibh7jcnfginnmkv66w62mm74k7mdsy4";
-      name = "qttools-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qttools-opensource-src-5.9.3.tar.xz";
+      sha256 = "1zw4j8ymwcpn7dx1dlbxpmx5lfp26rag7pysap1xry9m7vg3hb24";
+      name = "qttools-opensource-src-5.9.3.tar.xz";
     };
   };
   qttranslations = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qttranslations-opensource-src-5.9.1.tar.xz";
-      sha256 = "0sdjiqli15fmkbqvhhgjfavff906sg56jx5xf8bg6xzd2j5544ja";
-      name = "qttranslations-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qttranslations-opensource-src-5.9.3.tar.xz";
+      sha256 = "1ncvj1qlcgrm0zqdlq2bkb0hc8dyisz8m7bszxyx4kyxg7n5gb20";
+      name = "qttranslations-opensource-src-5.9.3.tar.xz";
     };
   };
   qtvirtualkeyboard = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtvirtualkeyboard-opensource-src-5.9.1.tar.xz";
-      sha256 = "0k79sqa8bg6gkbsk16320gnila1iiwpnl3vx03rysm5bqdnnlx3b";
-      name = "qtvirtualkeyboard-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtvirtualkeyboard-opensource-src-5.9.3.tar.xz";
+      sha256 = "1zrj4pjy98dskzycjswbkm4m2j6k1j4150h0w7vdrw1681s3ycdr";
+      name = "qtvirtualkeyboard-opensource-src-5.9.3.tar.xz";
     };
   };
   qtwayland = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtwayland-opensource-src-5.9.1.tar.xz";
-      sha256 = "1yizvbmh26mx1ffq0qaci02g2wihy68ld0y7r3z8nx3v5acb236g";
-      name = "qtwayland-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtwayland-opensource-src-5.9.3.tar.xz";
+      sha256 = "0vazcmpqdka3llmyg7m99lw0ngrydmw74p9nd04544xdn128r3ih";
+      name = "qtwayland-opensource-src-5.9.3.tar.xz";
     };
   };
   qtwebchannel = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtwebchannel-opensource-src-5.9.1.tar.xz";
-      sha256 = "003h09mla82f2znb8jjigx13ivc68ikgv7w04594yy7qdmd5yhl0";
-      name = "qtwebchannel-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtwebchannel-opensource-src-5.9.3.tar.xz";
+      sha256 = "0n438mk01sh2bbqakc1m3s65qqmi75m4n4hymad8wcgijfr9a9v3";
+      name = "qtwebchannel-opensource-src-5.9.3.tar.xz";
     };
   };
   qtwebengine = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtwebengine-opensource-src-5.9.1.tar.xz";
-      sha256 = "00b4d18m54pbxa1hm6ijh2mrd4wmrs7lkplys8b4liw8j7mpx8zn";
-      name = "qtwebengine-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtwebengine-opensource-src-5.9.3.tar.xz";
+      sha256 = "0dqxawc9vfffz6ygdn5mdpl79rrqfx18jy2d1w81q9w7zm113bj5";
+      name = "qtwebengine-opensource-src-5.9.3.tar.xz";
     };
   };
   qtwebkit = {
@@ -291,43 +291,43 @@
     };
   };
   qtwebsockets = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtwebsockets-opensource-src-5.9.1.tar.xz";
-      sha256 = "0r1lya2jj3wfci82zfn0vk6vr8sk9k7xiphnkb0panhb8di769q1";
-      name = "qtwebsockets-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtwebsockets-opensource-src-5.9.3.tar.xz";
+      sha256 = "1phic630ah85ajxp6iqrw9bpg0y8s88y45ygkc1wcasmbgzrs1nf";
+      name = "qtwebsockets-opensource-src-5.9.3.tar.xz";
     };
   };
   qtwebview = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtwebview-opensource-src-5.9.1.tar.xz";
-      sha256 = "0qmxrh4y3i9n8x6yhrlnahcn75cc2xwlc8mi4g8n2d83c3x7pxyn";
-      name = "qtwebview-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtwebview-opensource-src-5.9.3.tar.xz";
+      sha256 = "1i99fy86gydpfsfc4my5d9vxjywfrzbqxk66cb3yf2ac57j66mpf";
+      name = "qtwebview-opensource-src-5.9.3.tar.xz";
     };
   };
   qtwinextras = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtwinextras-opensource-src-5.9.1.tar.xz";
-      sha256 = "1x7f944f3g2ml3mm594qv6jlvl5dzzsxq86yinp7av0lhnyrxk0s";
-      name = "qtwinextras-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtwinextras-opensource-src-5.9.3.tar.xz";
+      sha256 = "1lj4qa51ymhpvk0bdp6xf6b3n1k39kihns5lvp6xq1w2mljn6phl";
+      name = "qtwinextras-opensource-src-5.9.3.tar.xz";
     };
   };
   qtx11extras = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtx11extras-opensource-src-5.9.1.tar.xz";
-      sha256 = "00fn3bps48gjyw0pdqvvl9scknxdpmacby6hvdrdccc3jll0wgd6";
-      name = "qtx11extras-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtx11extras-opensource-src-5.9.3.tar.xz";
+      sha256 = "1gpjgca4xvyy0r743kh2ys128r14fh6j8bdphnmmi5v2pf6bzq74";
+      name = "qtx11extras-opensource-src-5.9.3.tar.xz";
     };
   };
   qtxmlpatterns = {
-    version = "5.9.1";
+    version = "5.9.3";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.1/submodules/qtxmlpatterns-opensource-src-5.9.1.tar.xz";
-      sha256 = "094wwap2fsl23cys6rxh2ciw0gxbbiqbshnn4qs1n6xdjrj6i15m";
-      name = "qtxmlpatterns-opensource-src-5.9.1.tar.xz";
+      url = "${mirror}/official_releases/qt/5.9/5.9.3/submodules/qtxmlpatterns-opensource-src-5.9.3.tar.xz";
+      sha256 = "1fphhqr3v3vzjp2vbv16bc1vs879wn7aqlabgcpkhqx92ak6d76g";
+      name = "qtxmlpatterns-opensource-src-5.9.3.tar.xz";
     };
   };
 }
diff --git a/pkgs/development/libraries/qt-5/hooks/fix-qt-module-paths.sh b/pkgs/development/libraries/qt-5/hooks/fix-qt-module-paths.sh
index 916981b5299..33682f6f3c6 100644
--- a/pkgs/development/libraries/qt-5/hooks/fix-qt-module-paths.sh
+++ b/pkgs/development/libraries/qt-5/hooks/fix-qt-module-paths.sh
@@ -15,8 +15,8 @@ fixQtModulePaths () {
             if grep -q '\$\$QT_MODULE_' "${pr:?}"; then
                 echo "fixQtModulePaths: Fixing module paths in \`${pr:?}'..."
                 sed -i "${pr:?}" \
-                    -e "s|\\\$\\\$QT_MODULE_LIB_BASE|$dev/lib|g" \
-                    -e "s|\\\$\\\$QT_MODULE_HOST_LIB_BASE|$dev/lib|g" \
+                    -e "s|\\\$\\\$QT_MODULE_LIB_BASE|$lib/lib|g" \
+                    -e "s|\\\$\\\$QT_MODULE_HOST_LIB_BASE|$lib/lib|g" \
                     -e "s|\\\$\\\$QT_MODULE_INCLUDE_BASE|$dev/include|g" \
                     -e "s|\\\$\\\$QT_MODULE_BIN_BASE|$dev/bin|g"
             fi
@@ -27,13 +27,6 @@ fixQtModulePaths () {
         echo "fixQtModulePaths: Warning: \`$dir' does not exist"
     fi
 
-    if [ "z$dev" != "z$lib" ]; then
-        if [ -d "$lib/lib" ]; then
-            mkdir -p "$dev/lib"
-            lndir -silent "$lib/lib" "$dev/lib"
-        fi
-    fi
-
     if [ "z$bin" != "z$dev" ]; then
         if [ -d "$bin/bin" ]; then
             mkdir -p "$dev/bin"
diff --git a/pkgs/development/libraries/qt-5/hooks/fix-qt-static-libs.sh b/pkgs/development/libraries/qt-5/hooks/fix-qt-static-libs.sh
deleted file mode 100644
index 2a20e77e7ba..00000000000
--- a/pkgs/development/libraries/qt-5/hooks/fix-qt-static-libs.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-# fixQtStaticLibs
-#
-# Usage: fixQtStaticLibs _lib_ _dev_
-#
-# Find static Qt libraries in output _lib_ and move them to the corresponding
-# path in output _dev_. Any QMake library definitions (*.prl files) are also
-# moved and library paths are patched.
-#
-fixQtStaticLibs() {
-    local lib="$1"
-    local dev="$2"
-
-    pushd "$lib"
-    if [ -d "lib" ]; then
-        find lib \( -name '*.a' -o -name '*.la' -o -name '*.prl' \) -print0 | \
-            while read -r -d $'\0' file; do
-                mkdir -p "$dev/$(dirname "$file")"
-                mv "$lib/$file" "$dev/$file"
-            done
-    fi
-    popd
-
-    if [ -d "$dev" ]; then
-        find "$dev" -name '*.prl' | while read prl; do
-            echo "fixQtStaticLibs: Fixing built-in paths in \`$prl'..."
-            sed -i "$prl" \
-                -e '/^QMAKE_PRL_BUILD_DIR =/d' \
-                -e '/^QMAKE_PRO_INPUT =/d' \
-                -e "s|-L\\\$\\\$NIX_OUTPUT_OUT/lib|-L$lib/lib -L$dev/lib|g"
-        done
-    fi
-}
diff --git a/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh b/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
index 17d3db65849..eef2c7d24df 100644
--- a/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
+++ b/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
@@ -10,6 +10,11 @@ qmakeConfigurePhase() {
           NIX_OUTPUT_PLUGIN=${!outputBin}/${qtPluginPrefix:?} \
           $qmakeFlags
 
+    if ! [[ -v enableParallelBuilding ]]; then
+        enableParallelBuilding=1
+        echo "qmake: enabled parallel building"
+    fi
+
     runHook postConfigure
 }
 
diff --git a/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh b/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
index 258b2d09f20..3a558153988 100644
--- a/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
+++ b/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
@@ -4,7 +4,6 @@ qtDocPrefix=@qtDocPrefix@
 
 . @fix_qt_builtin_paths@
 . @fix_qt_module_paths@
-. @fix_qt_static_libs@
 
 providesQtRuntime() {
     [ -d "$1/$qtPluginPrefix" ] || [ -d "$1/$qtQmlPrefix" ]
@@ -33,29 +32,16 @@ addToQMAKEPATH() {
 # package depending on the building package. (This is necessary in case
 # the building package does not provide runtime dependencies itself and so
 # would not be propagated to the user environment.)
-qtCrossEnvHook() {
-    addToQMAKEPATH "$1"
-    if providesQtRuntime "$1"; then
-        if [ "z${!outputBin}" != "z${!outputDev}" ]; then
-            propagatedBuildInputs+=" $1"
-        fi
-        propagatedUserEnvPkgs+=" $1"
-    fi
-}
-crossEnvHooks+=(qtCrossEnvHook)
-
 qtEnvHook() {
     addToQMAKEPATH "$1"
     if providesQtRuntime "$1"; then
         if [ "z${!outputBin}" != "z${!outputDev}" ]; then
-            propagatedNativeBuildInputs+=" $1"
+            propagatedBuildInputs+=" $1"
         fi
-        if [ -z "$crossConfig" ]; then
         propagatedUserEnvPkgs+=" $1"
-        fi
     fi
 }
-envHooks+=(qtEnvHook)
+envHostTargetHooks+=(qtEnvHook)
 
 postPatchMkspecs() {
     local bin="${!outputBin}"
@@ -76,12 +62,3 @@ postPatchMkspecs() {
 if [ -z "$dontPatchMkspecs" ]; then
     postPhases="${postPhases}${postPhases:+ }postPatchMkspecs"
 fi
-
-postMoveQtStaticLibs() {
-    if [ "z${!outputLib}" != "z${!outputDev}" ]; then
-        fixQtStaticLibs "${!outputLib}" "${!outputDev}"
-    fi
-}
-if [ -z "$dontMoveQtStaticLibs" ]; then
-    postPhases="${postPhases}${postPhases:+ }postMoveQtStaticLibs"
-fi
diff --git a/pkgs/development/libraries/qt-5/mkDerivation.nix b/pkgs/development/libraries/qt-5/mkDerivation.nix
index ef105092fe2..739c9b4a160 100644
--- a/pkgs/development/libraries/qt-5/mkDerivation.nix
+++ b/pkgs/development/libraries/qt-5/mkDerivation.nix
@@ -11,17 +11,20 @@ let
 
     qmakeFlags =
       (args.qmakeFlags or [])
-      ++ optional (debug != null)
-          (if debug then "CONFIG+=debug" else "CONFIG+=release");
+      ++ [ ("CONFIG+=" + (if debug then "debug" else "release")) ];
+
+    NIX_CFLAGS_COMPILE =
+      optional (!debug) "-DQT_NO_DEBUG"
+      ++ lib.toList (args.NIX_CFLAGS_COMPILE or []);
 
     cmakeFlags =
       (args.cmakeFlags or [])
-      ++ [ "-DBUILD_TESTING=OFF" ]
-      ++ optional (debug != null)
-          (if debug then "-DCMAKE_BUILD_TYPE=Debug"
-                    else "-DCMAKE_BUILD_TYPE=Release");
+      ++ [
+        "-DBUILD_TESTING=OFF"
+        ("-DCMAKE_BUILD_TYPE=" + (if debug then "Debug" else "Release"))
+      ];
 
-    enableParallelBuilding = args.enableParallelBuilding or false;
+    enableParallelBuilding = args.enableParallelBuilding or true;
 
   };
 in
diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix
index 902d4f01bf8..aa4449504bb 100644
--- a/pkgs/development/libraries/qt-5/modules/qtbase.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix
@@ -3,7 +3,7 @@
   src, patches, version, qtCompatVersion,
 
   coreutils, bison, flex, gdb, gperf, lndir, patchelf, perl, pkgconfig, python2,
-  ruby,
+  ruby, which,
   # darwin support
   darwin, libiconv, libcxx,
 
@@ -31,6 +31,7 @@ assert withGtk3 -> gtk3 != null;
 
 let
   system-x86_64 = lib.elem stdenv.system lib.platforms.x86_64;
+  compareVersion = v: builtins.compareVersions version v;
 in
 
 stdenv.mkDerivation {
@@ -47,40 +48,43 @@ stdenv.mkDerivation {
 
       # Image formats
       libjpeg libpng libtiff
+      (if compareVersion "5.9.0" >= 0 then pcre2 else pcre16)
     ]
-    ++ (if builtins.compareVersions version "5.9.0" >= 0
-           then [ pcre2 ] else [ pcre16 ])
-
-    ++ lib.optional (mesaSupported && !stdenv.isDarwin) mesa
-
-    ++ lib.optionals (!stdenv.isDarwin) [
-      dbus glib udev
-
-      # Text rendering
-      fontconfig freetype
-
-      # X11 libs
-      libX11 libXcomposite libXext libXi libXrender libxcb libxkbcommon xcbutil
-      xcbutilimage xcbutilkeysyms xcbutilrenderutil xcbutilwm
-    ]
-
-    ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
-      AGL AppKit ApplicationServices Carbon Cocoa
-      CoreAudio CoreBluetooth CoreLocation CoreServices
-      DiskArbitration Foundation OpenGL
-      darwin.libobjc libiconv
-    ]);
-
-  buildInputs = [ ]
-    ++ lib.optional (!stdenv.isDarwin && withGtk3) gtk3
-    ++ lib.optional (!stdenv.isDarwin) libinput
+    ++ (
+      if stdenv.isDarwin
+      then with darwin.apple_sdk.frameworks;
+        [
+          AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth
+          CoreLocation CoreServices DiskArbitration Foundation OpenGL
+          darwin.libobjc libiconv
+        ]
+      else
+        [
+          dbus glib udev
+
+          # Text rendering
+          fontconfig freetype
+
+          # X11 libs
+          libX11 libXcomposite libXext libXi libXrender libxcb libxkbcommon xcbutil
+          xcbutilimage xcbutilkeysyms xcbutilrenderutil xcbutilwm
+        ]
+        ++ lib.optional mesaSupported mesa
+    );
+
+  buildInputs =
+    lib.optionals (!stdenv.isDarwin)
+    (
+      [ libinput ]
+      ++ lib.optional withGtk3 gtk3
+    )
     ++ lib.optional developerBuild gdb
     ++ lib.optional (cups != null) cups
-    ++ lib.optional (mysql != null) mysql.lib
+    ++ lib.optional (mysql != null) mysql.connector-c
     ++ lib.optional (postgresql != null) postgresql;
 
   nativeBuildInputs =
-    [ bison flex gperf lndir perl pkgconfig python2 ]
+    [ bison flex gperf lndir perl pkgconfig python2 which ]
     ++ lib.optional (!stdenv.isDarwin) patchelf;
 
   propagatedNativeBuildInputs = [ lndir ];
@@ -89,11 +93,9 @@ stdenv.mkDerivation {
 
   inherit patches;
 
-  fix_qt_static_libs = ../hooks/fix-qt-static-libs.sh;
   fix_qt_builtin_paths = ../hooks/fix-qt-builtin-paths.sh;
   fix_qt_module_paths = ../hooks/fix-qt-module-paths.sh;
   preHook = ''
-    . "$fix_qt_static_libs"
     . "$fix_qt_builtin_paths"
     . "$fix_qt_module_paths"
     . ${../hooks/move-qt-dev-tools.sh}
@@ -118,30 +120,35 @@ stdenv.mkDerivation {
       sed -i '/PATHS.*NO_DEFAULT_PATH/ d' mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
     ''
 
-    + lib.optionalString (mesaSupported && !stdenv.isDarwin) ''
-      sed -i mkspecs/common/linux.conf \
-          -e "/^QMAKE_INCDIR_OPENGL/ s|$|${mesa.dev or mesa}/include|" \
-          -e "/^QMAKE_LIBDIR_OPENGL/ s|$|${mesa.out}/lib|"
-    ''
-
-    + lib.optionalString stdenv.isDarwin ''
-      sed -i \
-          -e 's|! /usr/bin/xcode-select --print-path >/dev/null 2>&1;|false;|' \
-          -e 's|! /usr/bin/xcrun -find xcodebuild >/dev/null 2>&1;|false;|' \
-          -e 's|sysroot=$(/usr/bin/xcodebuild -sdk $sdk -version Path 2>/dev/null)|sysroot=/nonsense|' \
-          -e 's|sysroot=$(/usr/bin/xcrun --sdk $sdk --show-sdk-path 2>/dev/null)|sysroot=/nonsense|' \
-          -e 's|QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX`|QMAKE_CXX="clang++"\nQMAKE_CONF_COMPILER="clang++"|' \
-          -e 's|XCRUN=`/usr/bin/xcrun -sdk macosx clang -v 2>&1`|XCRUN="clang -v 2>&1"|' \
-          -e 's#sdk_val=$(/usr/bin/xcrun -sdk $sdk -find $(echo $val | cut -d \x27 \x27 -f 1))##' \
-          -e 's#val=$(echo $sdk_val $(echo $val | cut -s -d \x27 \x27 -f 2-))##' \
-          ./configure
-          substituteInPlace ./mkspecs/common/mac.conf \
-              --replace "/System/Library/Frameworks/OpenGL.framework/" "${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework/"
-          substituteInPlace ./mkspecs/common/mac.conf \
-              --replace "/System/Library/Frameworks/AGL.framework/" "${darwin.apple_sdk.frameworks.AGL}/Library/Frameworks/AGL.framework/"
-     '';
-     # Note on the above: \x27 is a way if including a single-quote
-     # character in the sed string arguments.
+    + (
+      if stdenv.isDarwin
+      then
+        ''
+          sed -i \
+              -e 's|! /usr/bin/xcode-select --print-path >/dev/null 2>&1;|false;|' \
+              -e 's|! /usr/bin/xcrun -find xcodebuild >/dev/null 2>&1;|false;|' \
+              -e 's|sysroot=$(/usr/bin/xcodebuild -sdk $sdk -version Path 2>/dev/null)|sysroot=/nonsense|' \
+              -e 's|sysroot=$(/usr/bin/xcrun --sdk $sdk --show-sdk-path 2>/dev/null)|sysroot=/nonsense|' \
+              -e 's|QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX`|QMAKE_CXX="clang++"\nQMAKE_CONF_COMPILER="clang++"|' \
+              -e 's|XCRUN=`/usr/bin/xcrun -sdk macosx clang -v 2>&1`|XCRUN="clang -v 2>&1"|' \
+              -e 's#sdk_val=$(/usr/bin/xcrun -sdk $sdk -find $(echo $val | cut -d \x27 \x27 -f 1))##' \
+              -e 's#val=$(echo $sdk_val $(echo $val | cut -s -d \x27 \x27 -f 2-))##' \
+              ./configure
+              substituteInPlace ./mkspecs/common/mac.conf \
+                  --replace "/System/Library/Frameworks/OpenGL.framework/" "${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework/"
+              substituteInPlace ./mkspecs/common/mac.conf \
+                  --replace "/System/Library/Frameworks/AGL.framework/" "${darwin.apple_sdk.frameworks.AGL}/Library/Frameworks/AGL.framework/"
+        ''
+        # Note on the above: \x27 is a way if including a single-quote
+        # character in the sed string arguments.
+      else
+        lib.optionalString mesaSupported
+          ''
+            sed -i mkspecs/common/linux.conf \
+                -e "/^QMAKE_INCDIR_OPENGL/ s|$|${mesa.dev or mesa}/include|" \
+                -e "/^QMAKE_LIBDIR_OPENGL/ s|$|${mesa.out}/lib|"
+          ''
+    );
 
   qtPluginPrefix = "lib/qt-${qtCompatVersion}/plugins";
   qtQmlPrefix = "lib/qt-${qtCompatVersion}/qml";
@@ -150,7 +157,7 @@ stdenv.mkDerivation {
   setOutputFlags = false;
   preConfigure = ''
     export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms:$LD_LIBRARY_PATH"
-    ${lib.optionalString (builtins.compareVersions version "5.9.0" < 0) ''
+    ${lib.optionalString (compareVersion "5.9.0" < 0) ''
     # We need to set LD to CXX or otherwise we get nasty compile errors
     export LD=$CXX
     ''}
@@ -189,24 +196,25 @@ stdenv.mkDerivation {
       ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"''
     ]
 
-    ++ lib.optional (mesaSupported && !stdenv.isDarwin)
-       ''-DNIXPKGS_MESA_GL="${mesa.out}/lib/libGL"''
-
-    ++ lib.optionals (!stdenv.isDarwin && withGtk3)
-    [
-      ''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"''
-      ''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"''
-    ]
-
-    ++ lib.optionals stdenv.isDarwin
-    [
-      "-Wno-missing-sysroot"
-      "-D__MAC_OS_X_VERSION_MAX_ALLOWED=1090"
-      "-D__AVAILABILITY_INTERNAL__MAC_10_10=__attribute__((availability(macosx,introduced=10.10)))"
-      # Note that nixpkgs's objc4 is from macOS 10.11 while the SDK is
-      # 10.9 which necessitates the above macro definition that mentions
-      # 10.10
-    ]
+    ++ (
+      if stdenv.isDarwin
+      then
+        [
+          "-Wno-missing-sysroot"
+          "-D__MAC_OS_X_VERSION_MAX_ALLOWED=1090"
+          "-D__AVAILABILITY_INTERNAL__MAC_10_10=__attribute__((availability(macosx,introduced=10.10)))"
+          # Note that nixpkgs's objc4 is from macOS 10.11 while the SDK is
+          # 10.9 which necessitates the above macro definition that mentions
+          # 10.10
+        ]
+      else
+        lib.optional mesaSupported ''-DNIXPKGS_MESA_GL="${mesa.out}/lib/libGL"''
+        ++ lib.optionals withGtk3
+          [
+            ''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"''
+            ''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"''
+          ]
+    )
 
     ++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC";
 
@@ -232,8 +240,15 @@ stdenv.mkDerivation {
       "-strip"
       "-system-proxies"
       "-pkg-config"
+
+      "-gui"
+      "-widgets"
+      "-opengl desktop"
+      "-qml-debug"
+      "-icu"
+      "-pch"
     ]
-    ++ lib.optionals (builtins.compareVersions version "5.9.0" < 0)
+    ++ lib.optionals (compareVersion "5.9.0" < 0)
     [
       "-c++11"
       "-no-reduce-relocations"
@@ -242,18 +257,11 @@ stdenv.mkDerivation {
       "-developer-build"
       "-no-warnings-are-errors"
     ]
-    ++ [
-      "-gui"
-      "-widgets"
-      "-opengl desktop"
-      "-qml-debug"
-      "-icu"
-      "-pch"
-    ]
-
-    ++ (if builtins.compareVersions version "5.9.0" >= 0
-           then [ (if system-x86_64 then "-sse2" else "-no-sse2") ]
-           else lib.optional (!system-x86_64) "-no-sse2")
+    ++ (
+      if (!system-x86_64)
+      then [ "-no-sse2" ]
+      else lib.optional (compareVersion "5.9.0" >= 0) [ "-sse2" ]
+    )
     ++ [
       "-no-sse3"
       "-no-ssse3"
@@ -277,46 +285,50 @@ stdenv.mkDerivation {
 
       "-make libs"
       "-make tools"
-      ''-${lib.optionalString (buildExamples == false) "no"}make examples''
-      ''-${lib.optionalString (buildTests == false) "no"}make tests''
+      ''-${lib.optionalString (!buildExamples) "no"}make examples''
+      ''-${lib.optionalString (!buildTests) "no"}make tests''
       "-v"
     ]
 
-    ++ lib.optionals (!stdenv.isDarwin) [
-      "-${lib.optionalString (builtins.compareVersions version "5.9.0" < 0) "no-"}rpath"
-
-      "-system-xcb"
-      "-xcb"
-      "-qpa xcb"
-
-      "-system-xkbcommon"
-      "-libinput"
-      "-xkbcommon-evdev"
-
-      "-no-eglfs"
-      "-no-gbm"
-      "-no-kms"
-      "-no-linuxfb"
-
-      ''-${lib.optionalString (cups == null) "no-"}cups''
-      "-dbus-linked"
-      "-glib"
-      "-system-libjpeg"
-      "-system-libpng"
-      # gold linker of binutils 2.28 generates duplicate symbols
-      # TODO: remove for newer version of binutils 
-      "-no-use-gold-linker"
-    ]
-    ++ lib.optional withGtk3 "-gtk"
-    ++ lib.optional (builtins.compareVersions version "5.9.0" >= 0) "-inotify"
-
-    ++ lib.optionals stdenv.isDarwin [
-      "-platform macx-clang"
-      "-no-use-gold-linker"
-      "-no-fontconfig"
-      "-qt-freetype"
-      "-qt-libpng"
-    ];
+    ++ (
+      if stdenv.isDarwin
+      then
+        [
+          "-platform macx-clang"
+          "-no-use-gold-linker"
+          "-no-fontconfig"
+          "-qt-freetype"
+          "-qt-libpng"
+        ]
+      else
+        [
+          "-${lib.optionalString (compareVersion "5.9.0" < 0) "no-"}rpath"
+
+          "-system-xcb"
+          "-xcb"
+          "-qpa xcb"
+
+          "-system-xkbcommon"
+          "-libinput"
+          "-xkbcommon-evdev"
+
+          "-no-eglfs"
+          "-no-gbm"
+          "-no-kms"
+          "-no-linuxfb"
+
+          ''-${lib.optionalString (cups == null) "no-"}cups''
+          "-dbus-linked"
+          "-glib"
+          "-system-libjpeg"
+          "-system-libpng"
+          # gold linker of binutils 2.28 generates duplicate symbols
+          # TODO: remove for newer version of binutils
+          "-no-use-gold-linker"
+        ]
+        ++ lib.optional withGtk3 "-gtk"
+        ++ lib.optional (compareVersion "5.9.0" >= 0) "-inotify"
+    );
 
   enableParallelBuilding = true;
 
@@ -349,38 +361,37 @@ stdenv.mkDerivation {
       fixQtBuiltinPaths "''${!outputDev}" '*.pr?'
     ''
 
-    # Move static libraries and QMake library definitions into $dev.
-    + ''
-      fixQtStaticLibs "''${!outputLib}" "''${!outputDev}"
-    ''
-
     # Move development tools to $dev
     + ''
       moveQtDevTools
       moveToOutput bin "$dev"
     ''
 
-    # fixup .pc file (where to find 'moc' etc.)
-    + lib.optionalString (!stdenv.isDarwin) ''
-      sed -i "$dev/lib/pkgconfig/Qt5Core.pc" \
-          -e "/^host_bins=/ c host_bins=$dev/bin"
-    ''
-
-    + lib.optionalString stdenv.isDarwin ''
-      fixDarwinDylibNames_rpath() {
-        local flags=()
-
-        for fn in "$@"; do
-          flags+=(-change "@rpath/$fn.framework/Versions/5/$fn" "$out/lib/$fn.framework/Versions/5/$fn")
-        done
-
-        for fn in "$@"; do
-          echo "$fn: fixing dylib"
-          install_name_tool -id "$out/lib/$fn.framework/Versions/5/$fn" "''${flags[@]}" "$out/lib/$fn.framework/Versions/5/$fn"
-        done
-      }
-      fixDarwinDylibNames_rpath "QtConcurrent" "QtPrintSupport" "QtCore" "QtSql" "QtDBus" "QtTest" "QtGui" "QtWidgets" "QtNetwork" "QtXml" "QtOpenGL"
-    '';
+    + (
+      if stdenv.isDarwin
+      then
+        ''
+          fixDarwinDylibNames_rpath() {
+            local flags=()
+
+            for fn in "$@"; do
+              flags+=(-change "@rpath/$fn.framework/Versions/5/$fn" "$out/lib/$fn.framework/Versions/5/$fn")
+            done
+
+            for fn in "$@"; do
+              echo "$fn: fixing dylib"
+              install_name_tool -id "$out/lib/$fn.framework/Versions/5/$fn" "''${flags[@]}" "$out/lib/$fn.framework/Versions/5/$fn"
+            done
+          }
+          fixDarwinDylibNames_rpath "QtConcurrent" "QtPrintSupport" "QtCore" "QtSql" "QtDBus" "QtTest" "QtGui" "QtWidgets" "QtNetwork" "QtXml" "QtOpenGL"
+        ''
+      else
+        # fixup .pc file (where to find 'moc' etc.)
+        ''
+          sed -i "$dev/lib/pkgconfig/Qt5Core.pc" \
+              -e "/^host_bins=/ c host_bins=$dev/bin"
+        ''
+    );
 
   setupHook = ../hooks/qtbase-setup-hook.sh;
 
diff --git a/pkgs/development/libraries/qt-5/modules/qttools.nix b/pkgs/development/libraries/qt-5/modules/qttools.nix
index ae6bd18cb14..622d841b405 100644
--- a/pkgs/development/libraries/qt-5/modules/qttools.nix
+++ b/pkgs/development/libraries/qt-5/modules/qttools.nix
@@ -1,4 +1,4 @@
-{ qtModule, lib, qtbase }:
+{ qtModule, stdenv, lib, qtbase }:
 
 with lib;
 
@@ -28,6 +28,8 @@ qtModule {
     "bin/qhelpgenerator"
     "bin/qtplugininfo"
     "bin/qthelpconverter"
+  ] ++ optionals stdenv.isDarwin [
+    "bin/macdeployqt"
   ];
 
   setupHook = ../hooks/qttools-setup-hook.sh;
diff --git a/pkgs/development/libraries/qt-5/modules/qtvirtualkeyboard.nix b/pkgs/development/libraries/qt-5/modules/qtvirtualkeyboard.nix
new file mode 100644
index 00000000000..2ba720c8eed
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/modules/qtvirtualkeyboard.nix
@@ -0,0 +1,6 @@
+{ qtModule, qtbase, qtdeclarative, qtsvg, hunspell  }:
+
+qtModule {
+  name = "qtvirtualkeyboard";
+  qtInputs = [ qtbase qtdeclarative qtsvg hunspell ];
+}
diff --git a/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix b/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix
new file mode 100644
index 00000000000..2f0e39eb5c9
--- /dev/null
+++ b/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, qmake4Hook , qt4, libX11, libXext }:
+
+stdenv.mkDerivation rec {
+  name = "qtstyleplugin-kvantum-qt4-${version}";
+  version = "0.10.4";
+
+  src = fetchFromGitHub {
+    owner = "tsujan";
+    repo = "Kvantum";
+    rev = "0527bb03f2252269fd382e11181a34ca72c96b4b";
+    sha256 = "0ky44s1fgqxraywagx1mv07yz76ppgiz3prq447db78wkwqg2d8p";
+  };
+
+  nativeBuildInputs = [ qmake4Hook ];
+  buildInputs = [ qt4 libX11 libXext ];
+
+  postUnpack = "sourceRoot=\${sourceRoot}/Kvantum";
+
+  buildPhase = ''
+    qmake kvantum.pro
+    make
+  '';
+
+  installPhase = ''
+    mkdir $TMP/kvantum
+    make INSTALL_ROOT="$TMP/kvantum" install
+    mv $TMP/kvantum/usr/ $out
+    mv $TMP/kvantum/${qt4}/lib $out
+  '';
+
+  meta = with stdenv.lib; {
+    description = "SVG-based Qt4 theme engine";
+    homepage = "https://github.com/tsujan/Kvantum";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bugworm ];
+  };
+}
diff --git a/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix b/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix
new file mode 100644
index 00000000000..5085d9bf5ef
--- /dev/null
+++ b/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub, qmake, qtbase, qtsvg, qtx11extras, libX11, libXext, qttools }:
+
+stdenv.mkDerivation rec {
+  name = "qtstyleplugin-kvantum-${version}";
+  version = "0.10.4";
+
+  src = fetchFromGitHub {
+    owner = "tsujan";
+    repo = "Kvantum";
+    rev = "0527bb03f2252269fd382e11181a34ca72c96b4b";
+    sha256 = "0ky44s1fgqxraywagx1mv07yz76ppgiz3prq447db78wkwqg2d8p";
+  };
+
+  nativeBuildInputs = [ qmake qttools ];
+  buildInputs = [ qtbase qtsvg qtx11extras libX11 libXext  ];
+
+  postUnpack = "sourceRoot=\${sourceRoot}/Kvantum";
+
+  postInstall= ''
+    mkdir -p $out/$qtPluginPrefix/styles
+    mv $NIX_QT5_TMP/$qtPluginPrefix/styles/libkvantum.so $out/$qtPluginPrefix/styles/libkvantum.so
+  '';
+
+  meta = with stdenv.lib; {
+    description = "SVG-based Qt5 theme engine plus a config tool and extra themes";
+    homepage = "https://github.com/tsujan/Kvantum";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bugworm ];
+  };
+}
diff --git a/pkgs/development/libraries/qwt/6_qt4.nix b/pkgs/development/libraries/qwt/6_qt4.nix
index 0315ae72709..79b182b33b2 100644
--- a/pkgs/development/libraries/qwt/6_qt4.nix
+++ b/pkgs/development/libraries/qwt/6_qt4.nix
@@ -1,20 +1,32 @@
-{ stdenv, fetchurl, qt4, qmake4Hook }:
+{ stdenv, fetchurl, qt4, qmake4Hook, AGL }:
 
 stdenv.mkDerivation rec {
-  name = "qwt-6.1.2";
+  name = "qwt-6.1.3";
 
   src = fetchurl {
     url = "mirror://sourceforge/qwt/${name}.tar.bz2";
-    sha256 = "031x4hz1jpbirv9k35rqb52bb9mf2w7qav89qv1yfw1r3n6z221b";
+    sha256 = "0cwp63s03dw351xavb3pzbjlqvx7kj88wv7v4a2b18m9f97d7v7k";
   };
 
-  buildInputs = [ qt4 ];
+  buildInputs = [
+    qt4
+  ] ++ stdenv.lib.optionals stdenv.isDarwin [ AGL ];
+
   nativeBuildInputs = [ qmake4Hook ];
 
+  enableParallelBuilding = true;
+
   postPatch = ''
     sed -e "s|QWT_INSTALL_PREFIX.*=.*|QWT_INSTALL_PREFIX = $out|g" -i qwtconfig.pri
   '';
 
+  # qwt.framework output includes a relative reference to itself, which breaks dependents
+  preFixup =
+    stdenv.lib.optionalString stdenv.isDarwin ''
+      echo "Attempting to repair qwt"
+      install_name_tool -id "$out/lib/qwt.framework/Versions/6/qwt" "$out/lib/qwt.framework/Versions/6/qwt"
+    '';
+
   qmakeFlags = [ "-after doc.path=$out/share/doc/${name}" ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/rabbitmq-c/default.nix b/pkgs/development/libraries/rabbitmq-c/default.nix
index 0ab9cd1df04..13c0198ba50 100644
--- a/pkgs/development/libraries/rabbitmq-c/default.nix
+++ b/pkgs/development/libraries/rabbitmq-c/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "rabbitmq-c-${version}";
-  version = "0.7.1";
+  version = "0.8.0";
 
   src = fetchFromGitHub {
     owner = "alanxz";
     repo = "rabbitmq-c";
     rev = "v${version}";
-    sha256 = "084zlir59zc505nxd4m2g9d355m9a8y94gbjaqmjz9kym8lpayd1";
+    sha256 = "0vjh1q3hyzrq1iiddy28vvwpwwn4px00mjc2hqp4zgfpis2xlqbj";
   };
 
   buildInputs = [ cmake openssl popt xmlto ];
diff --git a/pkgs/development/libraries/readline/6.3.nix b/pkgs/development/libraries/readline/6.3.nix
index 1183f46b8db..75c25e12d66 100644
--- a/pkgs/development/libraries/readline/6.3.nix
+++ b/pkgs/development/libraries/readline/6.3.nix
@@ -16,6 +16,12 @@ stdenv.mkDerivation rec {
 
   patchFlags = "-p0";
 
+  configureFlags =
+    stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
+    [ # This test requires running host code
+      "bash_cv_wcwidth_broken=no"
+    ];
+
   patches =
     [ ./link-against-ncurses.patch
       ./no-arch_only-6.3.patch
diff --git a/pkgs/development/libraries/rep-gtk/setup-hook.sh b/pkgs/development/libraries/rep-gtk/setup-hook.sh
index 420d63d6c51..4d875b69330 100644
--- a/pkgs/development/libraries/rep-gtk/setup-hook.sh
+++ b/pkgs/development/libraries/rep-gtk/setup-hook.sh
@@ -2,4 +2,4 @@ addRepDLLoadPath () {
     addToSearchPath REP_DL_LOAD_PATH $1/lib/rep
 }
 
-envHooks+=(addRepDLLoadPath)
+addEnvHooks "$hostOffset" addRepDLLoadPath
diff --git a/pkgs/development/libraries/rote/default.nix b/pkgs/development/libraries/rote/default.nix
index 524afd7cf4d..195db9a1685 100644
--- a/pkgs/development/libraries/rote/default.nix
+++ b/pkgs/development/libraries/rote/default.nix
@@ -26,6 +26,5 @@ stdenv.mkDerivation rec {
     homepage = http://rote.sourceforge.net/;
     license = licenses.lgpl21;
     platforms = platforms.linux;
-    maintainers = with maintainers; [ nckx ];
   };
 }
diff --git a/pkgs/development/libraries/safefile/default.nix b/pkgs/development/libraries/safefile/default.nix
index 5cef2576b71..159bad4c68e 100644
--- a/pkgs/development/libraries/safefile/default.nix
+++ b/pkgs/development/libraries/safefile/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{ stdenv, fetchurl, path }:
 stdenv.mkDerivation rec {
   name = "${pname}-${version}";
   pname = "safefile";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   passthru = {
     updateScript = ''
       cd ${toString ./.}
-      ${toString <nixpkgs/pkgs/build-support/upstream-updater/update-walker.sh>} default.nix
+      ${toString path}/pkgs/build-support/upstream-updater/update-walker.sh default.nix
     '';
   };
 
diff --git a/pkgs/development/libraries/sblim-sfcc/default.nix b/pkgs/development/libraries/sblim-sfcc/default.nix
index 016cc6f0472..ba0b8f4e996 100644
--- a/pkgs/development/libraries/sblim-sfcc/default.nix
+++ b/pkgs/development/libraries/sblim-sfcc/default.nix
@@ -1,30 +1,28 @@
-{ fetchgit, stdenv, autoconf, automake, libtool, curl }:
+{ stdenv, fetchFromGitHub, autoreconfHook, curl }:
 
 stdenv.mkDerivation rec {
-  version = "2.2.9";
   name = "sblim-sfcc-${version}";
+  version = "2.2.9"; # this is technically 2.2.9-preview
 
-  src = fetchgit {
-    url = "https://github.com/kkaempf/sblim-sfcc.git";
-    rev = "f70fecb410a53531e4fe99d39cf81b581819cac9";
-    sha256 = "1hsxim284qzldh599gf6khxj80g8q5263xl3lj3hdndxbhbs843v";
+  src = fetchFromGitHub {
+    owner  = "kkaempf";
+    repo   = "sblim-sfcc";
+    rev    = "514a76af2020fd6dc6fc380df76cbe27786a76a2";
+    sha256 = "06c1mskl9ixbf26v88w0lvn6v2xd6n5f0jd5mckqrn9j4vmh70hs";
   };
 
-  preConfigure = "./autoconfiscate.sh";
+  buildInputs = [ curl ];
 
-  buildInputs = [ autoconf automake libtool curl ];
+  nativeBuildInputs = [ autoreconfHook ];
 
-  meta = {
-    description = "Small Footprint CIM Client Library";
-
-    homepage = https://sourceforge.net/projects/sblim/;
-
-    maintainers = [ stdenv.lib.maintainers.deepfire ];
-
-    license = stdenv.lib.licenses.cpl10;
-
-    platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
+  enableParallelBuilding = true;
 
+  meta = with stdenv.lib; {
+    description = "Small Footprint CIM Client Library";
+    homepage    = https://sourceforge.net/projects/sblim/;
+    license     = licenses.cpl10;
+    maintainers = with maintainers; [ deepfire ];
+    platforms   = platforms.unix;
     inherit version;
   };
 }
diff --git a/pkgs/development/libraries/science/math/arpack/default.nix b/pkgs/development/libraries/science/math/arpack/default.nix
index fe90d41ccb2..77cb7cf1f2b 100644
--- a/pkgs/development/libraries/science/math/arpack/default.nix
+++ b/pkgs/development/libraries/science/math/arpack/default.nix
@@ -4,22 +4,24 @@
 with stdenv.lib;
 
 let
-  version = "3.3.0";
+  version = "3.5.0";
 in
 stdenv.mkDerivation {
   name = "arpack-${version}";
 
   src = fetchurl {
     url = "https://github.com/opencollab/arpack-ng/archive/${version}.tar.gz";
-    sha256 = "1cz53wqzcf6czmcpfb3vb61xi0rn5bwhinczl65hpmbrglg82ndd";
+    sha256 = "0f8jx3fifmj9qdp289zr7r651y1q48k1jya859rqxq62mvis7xsh";
   };
 
   nativeBuildInputs = [ autoconf automake gettext libtool ];
   buildInputs = [ gfortran openblas ];
 
+  doCheck = true;
+
   BLAS_LIBS = "-L${openblas}/lib -lopenblas";
 
-  FFLAGS = optional openblas.blas64 "-fdefault-integer-8";
+  INTERFACE64 = optional openblas.blas64 "1";
 
   preConfigure = ''
     ./bootstrap
diff --git a/pkgs/development/libraries/science/math/atlas/default.nix b/pkgs/development/libraries/science/math/atlas/default.nix
index c6797ef05ac..7fad5c312a0 100644
--- a/pkgs/development/libraries/science/math/atlas/default.nix
+++ b/pkgs/development/libraries/science/math/atlas/default.nix
@@ -100,6 +100,10 @@ stdenv.mkDerivation {
     fi
   '';
 
+  # 1. /buildATLAS/build/bin/ATLrun.sh: multiple segfaults.
+  # 2. "atlas does its own parallel builds"
+  enableParallelBuilding = false;
+
   meta = {
     homepage = http://math-atlas.sourceforge.net/;
     description = "Automatically Tuned Linear Algebra Software (ATLAS)";
diff --git a/pkgs/development/libraries/science/math/cudnn/default.nix b/pkgs/development/libraries/science/math/cudnn/default.nix
index 574899d3a89..d6e55e7bf73 100644
--- a/pkgs/development/libraries/science/math/cudnn/default.nix
+++ b/pkgs/development/libraries/science/math/cudnn/default.nix
@@ -30,16 +30,16 @@ in
   };
 
   cudnn_cudatoolkit8 = generic rec {
-    version = "7.0.3";
+    version = "7.0.5";
     cudatoolkit = cudatoolkit8;
     srcName = "cudnn-${cudatoolkit.majorVersion}-linux-x64-v7.tgz";
-    sha256 = "0gzwadxcyirr2zgiikdapnm860x3gcfwfxh5xn3s47zaa03x4kg4";
+    sha256 = "9e0b31735918fe33a79c4b3e612143d33f48f61c095a3b993023cdab46f6d66e";
   };
 
   cudnn_cudatoolkit9 = generic rec {
-    version = "7.0.3";
+    version = "7.0.5";
     cudatoolkit = cudatoolkit9;
     srcName = "cudnn-${cudatoolkit.majorVersion}-linux-x64-v7.tgz";
-    sha256 = "1ycy413cq9y9yxj20djqv05aarn3qzcy2md3dvvjpvhc269kwn09";
+    sha256 = "1a3e076447d5b9860c73d9bebe7087ffcb7b0c8814fd1e506096435a2ad9ab0e";
   };
 }
diff --git a/pkgs/development/libraries/science/math/fenics/default.nix b/pkgs/development/libraries/science/math/fenics/default.nix
index 9d40baafe65..1825a6f1bb2 100644
--- a/pkgs/development/libraries/science/math/fenics/default.nix
+++ b/pkgs/development/libraries/science/math/fenics/default.nix
@@ -158,7 +158,7 @@ stdenv.mkDerivation {
   meta = {
     description = "The FEniCS Problem Solving Environment in Python and C++";
     homepage = http://fenicsproject.org/;
-    platforms = stdenv.lib.platforms.all;
+    platforms = stdenv.lib.platforms.darwin;
     license = stdenv.lib.licenses.lgpl3;
   };
 }
diff --git a/pkgs/development/libraries/science/math/nccl/default.nix b/pkgs/development/libraries/science/math/nccl/default.nix
new file mode 100644
index 00000000000..c4deccff5b7
--- /dev/null
+++ b/pkgs/development/libraries/science/math/nccl/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchFromGitHub
+, gcc5, eject, cudatoolkit
+}:
+
+stdenv.mkDerivation rec {
+  name = "cudatoolkit-${cudatoolkit.majorVersion}-nccl-${version}";
+  version = "1.3.4-1";
+
+  src = fetchFromGitHub {
+    owner = "NVIDIA";
+    repo = "nccl";
+    rev = "v${version}";
+    sha256 = "0fvnrfn572lc6i2a3xyhbifm53ivcrr46z6cqr3b0bwb1iq79m7q";
+  };
+
+  nativeBuildInputs = [
+    gcc5
+    eject
+  ];
+
+  propagatedBuildInputs = [
+    cudatoolkit
+  ];
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "CUDA_HOME=${cudatoolkit}"
+    "CUDA_LIB=${cudatoolkit.lib}/lib"
+  ];
+
+  meta = with stdenv.lib; {
+    description = ''
+      NVIDIA Collective Communications Library.
+      Multi-GPU and multi-node collective communication primitives.
+    '';
+    homepage = https://developer.nvidia.com/nccl;
+    license = licenses.bsd3;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ hyphon81 ];
+  };
+}
diff --git a/pkgs/development/libraries/science/math/openblas/default.nix b/pkgs/development/libraries/science/math/openblas/default.nix
index 7edc39c11f5..42eaf71942e 100644
--- a/pkgs/development/libraries/science/math/openblas/default.nix
+++ b/pkgs/development/libraries/science/math/openblas/default.nix
@@ -12,6 +12,14 @@ let blas64_ = blas64; in
 let
   # To add support for a new platform, add an element to this set.
   configs = {
+    armv6l-linux = {
+      BINARY = "32";
+      TARGET = "ARMV6";
+      DYNAMIC_ARCH = "0";
+      CC = "gcc";
+      USE_OPENMP = "1";
+    };
+
     armv7l-linux = {
       BINARY = "32";
       TARGET = "ARMV7";
@@ -20,6 +28,14 @@ let
       USE_OPENMP = "1";
     };
 
+    aarch64-linux = {
+      BINARY = "64";
+      TARGET = "ARMV8";
+      DYNAMIC_ARCH = "1";
+      CC = "gcc";
+      USE_OPENMP = "1";
+    };
+
     i686-linux = {
       BINARY = "32";
       TARGET = "P2";
diff --git a/pkgs/development/libraries/serd/default.nix b/pkgs/development/libraries/serd/default.nix
index 96855067523..96449a8ed96 100644
--- a/pkgs/development/libraries/serd/default.nix
+++ b/pkgs/development/libraries/serd/default.nix
@@ -1,22 +1,21 @@
-{ stdenv, fetchurl, pcre, pkgconfig, python }:
+{ stdenv, fetchurl, pkgconfig, python }:
 
 stdenv.mkDerivation rec {
   name = "serd-${version}";
-  version = "0.26.0";
+  version = "0.28.0";
 
   src = fetchurl {
     url = "http://download.drobilla.net/${name}.tar.bz2";
-    sha256 = "164j43am4hka2vbzw4n52zy7rafgp6kmkgbcbvap368az644mr73";
+    sha256 = "1v4ai4zyj1q3255nghicns9817jkwb3bh60ssprsjmnjfj41mwhx";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ pcre python ];
+  nativeBuildInputs = [ pkgconfig python ];
 
-  configurePhase = "${python.interpreter} waf configure --prefix=$out";
+  configurePhase = "python waf configure --prefix=$out";
 
-  buildPhase = "${python.interpreter} waf";
+  buildPhase = "python waf";
 
-  installPhase = "${python.interpreter} waf install";
+  installPhase = "python waf install";
 
   meta = with stdenv.lib; {
     homepage = http://drobilla.net/software/serd;
diff --git a/pkgs/development/libraries/serf/default.nix b/pkgs/development/libraries/serf/default.nix
index 001199cd821..81dff49571d 100644
--- a/pkgs/development/libraries/serf/default.nix
+++ b/pkgs/development/libraries/serf/default.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
         APU="$(echo "${aprutil.dev}"/bin/*-config)" CC="${
           if stdenv.cc.isClang then "clang" else "${stdenv.cc}/bin/gcc"
         }" ${
-          if (stdenv.isDarwin || stdenv.isCygwin) then "" else "GSSAPI=\"${kerberos}\""
+          if (stdenv.isDarwin || stdenv.isCygwin) then "" else "GSSAPI=\"${kerberos.dev}\""
         }
   '';
 
diff --git a/pkgs/development/libraries/shibboleth-sp/default.nix b/pkgs/development/libraries/shibboleth-sp/default.nix
index 219cda38bc2..74f861297d1 100644
--- a/pkgs/development/libraries/shibboleth-sp/default.nix
+++ b/pkgs/development/libraries/shibboleth-sp/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   name = "shibboleth-sp-${version}";
-  version = "2.6.0";
+  version = "2.6.1";
 
   src = fetchgit {
     url = "https://git.shibboleth.net/git/cpp-sp.git";
-    rev = "9ebba5c3a16d03769f436e383e4c4cdaa33f5509";
-    sha256 = "1b5r4nd098lnjwr2g13f04ycqv5fvbrhpwg6fsdk8xy9cigvfzxj";
+    rev = version;
+    sha256 = "01q13p7gc0janjfml6zs46na8qnval8hc833fk2wrnmi4w9xw4fd";
   };
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
diff --git a/pkgs/development/libraries/skalibs/default.nix b/pkgs/development/libraries/skalibs/default.nix
index b87662a6e34..29cc477a279 100644
--- a/pkgs/development/libraries/skalibs/default.nix
+++ b/pkgs/development/libraries/skalibs/default.nix
@@ -2,7 +2,7 @@
 
 let
 
-  version = "2.4.0.1";
+  version = "2.6.0.1";
 
 in stdenv.mkDerivation rec {
 
@@ -11,7 +11,7 @@ in stdenv.mkDerivation rec {
   src = fetchgit {
     url = "git://git.skarnet.org/skalibs";
     rev = "refs/tags/v${version}";
-    sha256 = "1sdzm2vd9mxlwxbmjajb6n1n13dpsavdap2nbbnyx4wnzixxx9k7";
+    sha256 = "0skdv3wff1i78hb0y771apw0cak5rzxbwbh6l922snfm01z9k1ws";
   };
 
   dontDisableStatic = true;
diff --git a/pkgs/development/libraries/slib/setup-hook.sh b/pkgs/development/libraries/slib/setup-hook.sh
index 62b72d6dc0a..3c7e91e8188 100644
--- a/pkgs/development/libraries/slib/setup-hook.sh
+++ b/pkgs/development/libraries/slib/setup-hook.sh
@@ -10,4 +10,4 @@ addSlibPath () {
     fi
 }
 
-envHooks+=(addSlibPath)
+addEnvHooks "$hostOffset" addSlibPath
diff --git a/pkgs/development/libraries/smpeg2/default.nix b/pkgs/development/libraries/smpeg2/default.nix
index 10386a7b33e..3207bdb3a7f 100644
--- a/pkgs/development/libraries/smpeg2/default.nix
+++ b/pkgs/development/libraries/smpeg2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchsvn, autoconf, automake, libtool, m4, pkgconfig, makeWrapper, SDL2 }:
+{ stdenv, darwin, fetchsvn, autoconf, automake, libtool, m4, pkgconfig, makeWrapper, SDL2 }:
 
 stdenv.mkDerivation rec {
   name = "smpeg2-svn${version}";
@@ -17,7 +17,8 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoconf automake pkgconfig makeWrapper ];
 
-  buildInputs = [ SDL2 ];
+  buildInputs = [ SDL2 ]
+    ++ stdenv.lib.optional stdenv.isDarwin darwin.libobjc;
 
   preConfigure = ''
     sh autogen.sh
@@ -37,7 +38,7 @@ stdenv.mkDerivation rec {
     homepage = http://icculus.org/smpeg/;
     description = "SDL2 MPEG Player Library";
     license = licenses.lgpl2;
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     maintainers = with maintainers; [ orivej ];
   };
 }
diff --git a/pkgs/development/libraries/snappy/default.nix b/pkgs/development/libraries/snappy/default.nix
index c5e52124cee..8f37302cec5 100644
--- a/pkgs/development/libraries/snappy/default.nix
+++ b/pkgs/development/libraries/snappy/default.nix
@@ -1,24 +1,27 @@
-{ stdenv, fetchurl, pkgconfig }:
+{ stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   name = "snappy-${version}";
-  version = "1.1.4";
+  version = "1.1.7";
 
-  src = fetchurl {
-    url = "http://github.com/google/snappy/releases/download/${version}/"
-        + "snappy-${version}.tar.gz";
-    sha256 = "0mq0nz8gbi1sp3y6xcg0a6wbvnd6gc717f3vh2xrjmfj5w9gwjqk";
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "snappy";
+    rev = "${version}";
+    sha256 = "1x7r8sjmdqlqjz0xfiwdyrqpgaj5yrvrgb28ivgpvnxgar5qv6m2";
   };
 
-  outputs = [ "out" "dev" "doc" ];
+  patches = [ ./disable-benchmark.patch ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  outputs = [ "out" "dev" ];
 
-  # -DNDEBUG for speed
-  configureFlags = [ "CXXFLAGS=-DNDEBUG" ];
+  nativeBuildInputs = [ cmake ];
 
-  # SIGILL on darwin
-  doCheck = !stdenv.isDarwin;
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DCMAKE_SKIP_BUILD_RPATH=OFF" ];
+
+  checkTarget = "test";
+
+  doCheck = true;
 
   meta = with stdenv.lib; {
     homepage = https://google.github.io/snappy/;
diff --git a/pkgs/development/libraries/snappy/disable-benchmark.patch b/pkgs/development/libraries/snappy/disable-benchmark.patch
new file mode 100644
index 00000000000..c891c13fe74
--- /dev/null
+++ b/pkgs/development/libraries/snappy/disable-benchmark.patch
@@ -0,0 +1,5 @@
+--- a/snappy-test.cc
++++ b/snappy-test.cc
+@@ -46 +46 @@
+-DEFINE_bool(run_microbenchmarks, true,
++DEFINE_bool(run_microbenchmarks, false,
diff --git a/pkgs/development/libraries/sord/default.nix b/pkgs/development/libraries/sord/default.nix
index 57f81aa4613..995ac631580 100644
--- a/pkgs/development/libraries/sord/default.nix
+++ b/pkgs/development/libraries/sord/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, python, serd }:
+{ stdenv, fetchurl, pkgconfig, python, serd, pcre }:
 
 stdenv.mkDerivation rec {
   name = "sord-${version}";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ python serd ];
+  buildInputs = [ python serd pcre ];
 
   configurePhase = "${python.interpreter} waf configure --prefix=$out";
 
diff --git a/pkgs/development/libraries/speechd/default.nix b/pkgs/development/libraries/speechd/default.nix
index ee45c0d1c65..b27fd0843bc 100644
--- a/pkgs/development/libraries/speechd/default.nix
+++ b/pkgs/development/libraries/speechd/default.nix
@@ -1,29 +1,70 @@
-{ fetchurl, lib, stdenv, intltool, libtool, pkgconfig, glib, dotconf, libsndfile
-, libao, python3Packages
-, withEspeak ? false, espeak
+{ stdenv, pkgconfig, fetchurl, python3Packages
+, intltool, itstool, libtool, texinfo, autoreconfHook
+, glib, dotconf, libsndfile
+, withLibao ? true, libao
+, withPulse ? false, libpulseaudio
+, withAlsa ? false, alsaLib
+, withOss ? false
+, withFlite ? true, flite
+# , withFestival ? false, festival-freebsoft-utils
+, withEspeak ? true, espeak, sonic, pcaudiolib
 , withPico ? true, svox
+# , withIvona ? false, libdumbtts
 }:
 
-stdenv.mkDerivation rec {
+let
+  inherit (stdenv.lib) optional optionals;
+  inherit (python3Packages) python pyxdg wrapPython;
+
+  # speechd hard-codes espeak, even when built without support for it.
+  selectedDefaultModule =
+    if withEspeak then
+      "espeak-ng"
+    else if withPico then
+      "pico"
+    else if withFlite then
+      "flite"
+    else
+      throw "You need to enable at least one output module.";
+in stdenv.mkDerivation rec {
   name = "speech-dispatcher-${version}";
-  version = "0.8.5";
+  version = "0.8.8";
 
   src = fetchurl {
     url = "http://www.freebsoft.org/pub/projects/speechd/${name}.tar.gz";
-    sha256 = "18jlxnhlahyi6njc6l6576hfvmzivjjgfjyd2n7vvrvx9inphjrb";
+    sha256 = "1wvck00w9ixildaq6hlhnf6wa576y02ac96lp6932h3k1n08jaiw";
   };
 
-  buildInputs = [ intltool libtool glib dotconf libsndfile libao python3Packages.python ]
-             ++ lib.optional withEspeak espeak
-             ++ lib.optional withPico svox;
-  nativeBuildInputs = [ pkgconfig python3Packages.wrapPython ];
+  nativeBuildInputs = [ pkgconfig autoreconfHook intltool libtool itstool texinfo wrapPython ];
+
+  buildInputs = [ glib dotconf libsndfile libao libpulseaudio alsaLib python ]
+    ++ optionals withEspeak [ espeak sonic pcaudiolib ]
+    ++ optional withFlite flite
+    ++ optional withPico svox
+    # TODO: add flint/festival support with festival-freebsoft-utils package
+    # ++ optional withFestival festival-freebsoft-utils
+    # TODO: add Ivona support with libdumbtts package
+    # ++ optional withIvona libdumbtts
+  ;
 
-  hardeningDisable = [ "format" ];
+  pythonPath = [ pyxdg ];
 
-  pythonPath = with python3Packages; [ pyxdg ];
+  configureFlags = [
+    # Audio method falls back from left to right.
+    "--with-default-audio-method=\"libao,pulse,alsa,oss\""
+  ] ++ optional withPulse "--with-pulse"
+    ++ optional withAlsa "--with-alsa"
+    ++ optional withLibao "--with-libao"
+    ++ optional withOss "--with-oss"
+    ++ optional withEspeak "--with-espeak-ng"
+    ++ optional withPico "--with-pico"
+    # ++ optional withFestival "--with-flint"
+    # ++ optional withIvona "--with-ivona"
+  ;
 
-  postPatch = lib.optionalString withPico ''
-    sed -i 's,/usr/share/pico/lang/,${svox}/share/pico/lang/,g' src/modules/pico.c
+  postPatch = ''
+    substituteInPlace config/speechd.conf --replace "DefaultModule espeak" "DefaultModule ${selectedDefaultModule}"
+    substituteInPlace src/modules/pico.c --replace "/usr/share/pico/lang" "${svox}/share/pico/lang"
   '';
 
   postInstall = ''
@@ -32,8 +73,9 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "Common interface to speech synthesis";
-    homepage = http://www.freebsoft.org/speechd;
+    homepage = https://devel.freebsoft.org/speechd;
     license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ berce ];
     platforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/speex/default.nix b/pkgs/development/libraries/speex/default.nix
index 602359965f1..173b460a0ab 100644
--- a/pkgs/development/libraries/speex/default.nix
+++ b/pkgs/development/libraries/speex/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   ];
 
   meta = with stdenv.lib; {
-    homepage = http://www.speex.org/;
+    homepage = https://www.speex.org/;
     description = "An Open Source/Free Software patent-free audio compression format designed for speech";
     license = licenses.bsd3;
     platforms = platforms.unix;
diff --git a/pkgs/development/libraries/swc/default.nix b/pkgs/development/libraries/swc/default.nix
deleted file mode 100644
index bbc3aa20dd6..00000000000
--- a/pkgs/development/libraries/swc/default.nix
+++ /dev/null
@@ -1,34 +0,0 @@
-{ lib, stdenv, fetchurl, pkgconfig
-, wld, wayland, xwayland, fontconfig, pixman, libdrm, libinput, libevdev, libxkbcommon, libxcb, xcbutilwm
-}:
-
-stdenv.mkDerivation rec {
-  name = "swc-${version}";
-  version = "git-2016-02-09";
-  repo = "https://github.com/michaelforney/swc";
-  rev = "1da0ef13fddc572accea12439a4471b4d2f64ddd";
-
-  src = fetchurl {
-    url = "${repo}/archive/${rev}.tar.gz";
-    sha256 = "d1894612d8aa1ce828efb78f1570290f84bba6563e21eb777e08c3c3859b7bbe";
-  };
-
-  nativeBuildInputs = [ pkgconfig ];
-
-  buildInputs = [ wld wayland xwayland fontconfig pixman libdrm libinput libevdev libxkbcommon libxcb xcbutilwm ];
-
-  prePatch = ''
-    substituteInPlace launch/local.mk --replace 4755 755
-  '';
-
-  makeFlags = "PREFIX=$(out)";
-  installPhase = "PREFIX=$out make install";
-
-  meta = {
-    description = "A library for making a simple Wayland compositor";
-    homepage    = repo;
-    license     = lib.licenses.mit;
-    platforms   = lib.platforms.linux;
-    maintainers = with lib.maintainers; [ ];
-  };
-}
diff --git a/pkgs/development/libraries/taglib/1.9.nix b/pkgs/development/libraries/taglib/1.9.nix
index 71b8a764eed..1caa8a376fb 100644
--- a/pkgs/development/libraries/taglib/1.9.nix
+++ b/pkgs/development/libraries/taglib/1.9.nix
@@ -8,10 +8,9 @@ stdenv.mkDerivation rec {
     sha256 = "06n7gnbcqa3r6c9gv00y0y1r48dyyazm6yj403i7ma0r2k6p3lvj";
   };
 
-  cmakeFlags = "-DWITH_ASF=ON -DWITH_MP4=ON";
+  nativeBuildInputs = [ cmake ];
 
   buildInputs = [ zlib ];
-  nativeBuildInputs = [ cmake ];
 
   meta = {
     homepage = http://developer.kde.org/~wheeler/taglib.html;
diff --git a/pkgs/development/libraries/taglib/default.nix b/pkgs/development/libraries/taglib/default.nix
index 602aab852cc..67db6e5097d 100644
--- a/pkgs/development/libraries/taglib/default.nix
+++ b/pkgs/development/libraries/taglib/default.nix
@@ -1,24 +1,40 @@
-{stdenv, fetchurl, zlib, cmake}:
+{stdenv, fetchurl, zlib, cmake, fetchpatch}:
 
 stdenv.mkDerivation rec {
-  name = "taglib-1.10";
+  name = "taglib-1.11.1";
 
   src = fetchurl {
-    url = "http://taglib.github.io/releases/${name}.tar.gz";
-    sha256 = "1alv6vp72p0x9i9yscmz2a71anjwqy53y9pbcbqxvc1c0i82vhr4";
+    url = "http://taglib.org/releases/${name}.tar.gz";
+    sha256 = "0ssjcdjv4qf9liph5ry1kngam1y7zp8fzr9xv4wzzrma22kabldn";
   };
 
-  cmakeFlags = "-DWITH_ASF=ON -DWITH_MP4=ON";
+  patches = [
+    (fetchpatch {
+      # https://github.com/taglib/taglib/issues/829
+      name = "CVE-2017-12678.patch";
+      url = "https://github.com/taglib/taglib/commit/eb9ded1206f18.patch";
+      sha256 = "1bvpxsvmlpi3by7myzss9kkpdkv405612n8ff68mw1ambj8h1m90";
+    })
+  ];
 
-  buildInputs = [ zlib ];
   nativeBuildInputs = [ cmake ];
 
-  meta = {
-    homepage = http://developer.kde.org/~wheeler/taglib.html;
-    repositories.git = git://github.com/taglib/taglib.git;
+  buildInputs = [ zlib ];
 
-    description = "A library for reading and editing the meta-data of several popular audio formats";
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
+
+  meta = with stdenv.lib; {
+    homepage = http://taglib.org/;
+    repositories.git = git://github.com/taglib/taglib.git;
+    description = "A library for reading and editing audio file metadata.";
+    longDescription = ''
+      TagLib is a library for reading and editing the meta-data of several
+      popular audio formats. Currently it supports both ID3v1 and ID3v2 for MP3
+      files, Ogg Vorbis comments and ID3 tags and Vorbis comments in FLAC, MPC,
+      Speex, WavPack, TrueAudio, WAV, AIFF, MP4 and ASF files.
+    '';
+    license = with licenses; [ lgpl3 mpl11 ];
     inherit (cmake.meta) platforms;
-    maintainers = [ ];
+    maintainers = with maintainers; [ ttuegel ];
   };
 }
diff --git a/pkgs/development/libraries/telepathy/qt/default.nix b/pkgs/development/libraries/telepathy/qt/default.nix
index 93d69d5a8d9..18888df5c52 100644
--- a/pkgs/development/libraries/telepathy/qt/default.nix
+++ b/pkgs/development/libraries/telepathy/qt/default.nix
@@ -4,51 +4,37 @@
 let
   inherit (python2Packages) python dbus-python;
 in stdenv.mkDerivation rec {
-  name = "telepathy-qt-0.9.6.1";
+  name = "telepathy-qt-0.9.7";
 
   src = fetchurl {
     url = "http://telepathy.freedesktop.org/releases/telepathy-qt/${name}.tar.gz";
-    sha256 = "1y51c6rxk5qvmab98c8rnmrlyk27hnl248casvbq3cd93sav8vj9";
+    sha256 = "0krxd4hhfx6r0ja19wh3848j7gn1rv8jrnakgmkbmi7bww5x7fi1";
   };
 
-  patches = let
-    mkUrl = hash: "http://cgit.freedesktop.org/telepathy/telepathy-qt/patch/?id=" + hash;
-    in [
-      (fetchpatch {
-        name = "gst-1.6.patch";
-        url = mkUrl "ec4a3d62b68a57254515f01fc5ea3325ffb1dbfb";
-        sha256 = "1rh7n3xyrwpvpa3haqi35qn4mfz4396ha43w4zsqpmcyda9y65v2";
-      })
-      (fetchpatch {
-        name = "parallel-make-1.patch";
-        url = mkUrl "1e1f53e9d91684918c34ec50392f86287e001a1e";
-        sha256 = "1f9nk0bi90armb9zay53c7cz70zcwqqwli7sb9wgw76rmwqhl8qw";
-      })
-      (fetchpatch {
-        name = "parallel-make-2.patch";
-        url = mkUrl "7389dc990c67d4269f3a79c924c054e87f2e4ac5";
-        sha256 = "0mvdvyy76kpaxacljidf06wd43fr2qripr4mwsakjs3hxb1pkk57";
-      })
-    ];
-
   nativeBuildInputs = [ cmake pkgconfig python ];
-  propagatedBuildInputs = [ qtbase dbus_glib telepathy_farstream telepathy_glib dbus-python ];
-
-  buildInputs = stdenv.lib.optional doCheck dbus_daemon;
-
-  cmakeFlags = "-DDESIRED_QT_VERSION=${builtins.substring 0 1 qtbase.version}";
-
-  # should be removable after the next update
-  NIX_CFLAGS_COMPILE = [ "-Wno-error" ];
-
-  preBuild = ''
-    NIX_CFLAGS_COMPILE+=" `pkg-config --cflags dbus-glib-1`"
-  '';
+  propagatedBuildInputs = [ qtbase telepathy_farstream telepathy_glib ];
+  buildInputs = [ dbus_glib ];
+  checkInputs = [ dbus_daemon dbus-python ];
+
+  patches = [
+    # https://github.com/TelepathyIM/telepathy-qt/issues/25
+    (fetchpatch {
+      url = https://github.com/TelepathyIM/telepathy-qt/commit/d654dc70dbec7097e96e6d96ca74ab1b5b00ef8c.patch;
+      sha256 = "1jzd9b9rqh3c8xlq8dr7c0r8aabzf5ywv2gpkk6phh3xwngzrfbh";
+    })
+  ];
+
+  # No point in building tests if they are not run
+  # On 0.9.7, they do not even build with QT4
+  cmakeFlags = stdenv.lib.optional (!doCheck) "-DENABLE_TESTS=OFF";
 
   enableParallelBuilding = true;
   doCheck = false; # giving up for now
 
-  meta = {
-    platforms = stdenv.lib.platforms.linux;
+  meta = with stdenv.lib; {
+    description = "Telepathy Qt bindings";
+    homepage = https://telepathy.freedesktop.org/components/telepathy-qt/;
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/theft/default.nix b/pkgs/development/libraries/theft/default.nix
index a0110c5f22b..2a1180533ce 100644
--- a/pkgs/development/libraries/theft/default.nix
+++ b/pkgs/development/libraries/theft/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A C library for property-based testing";
     platforms = stdenv.lib.platforms.linux;
-    homepage = "http://github.com/silentbicycle/theft/";
+    homepage = "https://github.com/silentbicycle/theft/";
     license = stdenv.lib.licenses.isc;
     maintainers = [ stdenv.lib.maintainers.kquick ];
   };
diff --git a/pkgs/development/libraries/tntdb/default.nix b/pkgs/development/libraries/tntdb/default.nix
index d11a5c344c9..75a494cfbde 100644
--- a/pkgs/development/libraries/tntdb/default.nix
+++ b/pkgs/development/libraries/tntdb/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0js79dbvkic30bzw1pf26m64vs2ssw2sbj55w1dc0sy69dlv4fh9";
   };
 
-  buildInputs = [ cxxtools postgresql mysql sqlite zlib openssl ];
+  buildInputs = [ cxxtools postgresql mysql.connector-c sqlite zlib openssl ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/tremor/default.nix b/pkgs/development/libraries/tremor/default.nix
index fec256e703f..5e08a61cd1b 100644
--- a/pkgs/development/libraries/tremor/default.nix
+++ b/pkgs/development/libraries/tremor/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    homepage = http://xiph.org/tremor/;
+    homepage = https://xiph.org/tremor/;
     description = "Fixed-point version of the Ogg Vorbis decoder";
     license = stdenv.lib.licenses.bsd3;
     platforms = stdenv.lib.platforms.unix;
diff --git a/pkgs/development/libraries/udunits/default.nix b/pkgs/development/libraries/udunits/default.nix
index 8fa974a95e2..b8ffc16f905 100644
--- a/pkgs/development/libraries/udunits/default.nix
+++ b/pkgs/development/libraries/udunits/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     buildInputs = [ expat ];
 
     meta = with stdenv.lib; {
-      homepage = http://www.unidata.ucar.edu/software/udunits/;
+      homepage = https://www.unidata.ucar.edu/software/udunits/;
       description = "A C-based package for the programatic handling of units of physical quantities";
       license = licenses.bsdOriginal;
       platforms = platforms.linux;
diff --git a/pkgs/development/libraries/unicorn-emu/default.nix b/pkgs/development/libraries/unicorn-emu/default.nix
new file mode 100644
index 00000000000..9f9d8e62de5
--- /dev/null
+++ b/pkgs/development/libraries/unicorn-emu/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, bash, pkgconfig, python }:
+
+stdenv.mkDerivation rec {
+  name    = "unicorn-emulator-${version}";
+  version = "1.0.1";
+
+  src = fetchurl {
+    url    = "https://github.com/unicorn-engine/unicorn/archive/${version}.tar.gz";
+    sha256 = "0z01apwmvhvdldm372ww9pjfn45awkw3m90c0h4v0nj0ihmlysis";
+  };
+
+  configurePhase = '' patchShebangs make.sh '';
+  buildPhase = '' ./make.sh '';
+  installPhase = '' env PREFIX=$out ./make.sh install '';
+
+  nativeBuildInputs = [ pkgconfig python ];
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Lightweight multi-platform CPU emulator library";
+    homepage    = "http://www.unicorn-engine.org";
+    license     = stdenv.lib.licenses.bsd3;
+    platforms   = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/pkgs/development/libraries/unixODBCDrivers/default.nix b/pkgs/development/libraries/unixODBCDrivers/default.nix
index 233fdd90254..badcb7e661b 100644
--- a/pkgs/development/libraries/unixODBCDrivers/default.nix
+++ b/pkgs/development/libraries/unixODBCDrivers/default.nix
@@ -37,19 +37,12 @@
     };
 
     nativeBuildInputs = [ cmake ];
-    buildInputs = [ unixODBC mariadb.lib ];
+    buildInputs = [ unixODBC mariadb.connector-c ];
 
     cmakeFlags = [
-      "-DMARIADB_INCLUDE_DIR=${mariadb.lib}/include/mysql"
+      "-DMARIADB_INCLUDE_DIR=${mariadb.connector-c}/include/mariadb"
     ];
 
-    preConfigure = ''
-      sed -i \
-        -e 's,mariadb_config,mysql_config,g' \
-        -e 's,libmariadbclient,libmysqlclient,g' \
-        cmake/FindMariaDB.cmake
-    '';
-
     passthru = {
       fancyName = "MariaDB";
       driver = "lib/libmyodbc3-3.51.12.so";
@@ -60,7 +53,6 @@
       homepage =  https://downloads.mariadb.org/connector-odbc/;
       license = licenses.gpl2;
       platforms = platforms.linux;
-      broken = true;
     };
   };
 
diff --git a/pkgs/development/libraries/usbredir/default.nix b/pkgs/development/libraries/usbredir/default.nix
index e4e053805af..4735375de1f 100644
--- a/pkgs/development/libraries/usbredir/default.nix
+++ b/pkgs/development/libraries/usbredir/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   };
 
   # Works around bunch of "format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint64_t {aka long long unsigned int}'" warnings
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isi686 "-Wno-error=format";
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!stdenv.is64bit) "-Wno-error=format";
 
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ libusb ];
diff --git a/pkgs/development/libraries/v8/default.nix b/pkgs/development/libraries/v8/default.nix
index c2cd5a01516..4d49fdce3a9 100644
--- a/pkgs/development/libraries/v8/default.nix
+++ b/pkgs/development/libraries/v8/default.nix
@@ -7,13 +7,11 @@
 assert readline != null;
 
 let
-  arch = if stdenv.isArm
-         then if stdenv.is64bit
-              then"arm64"
-              else "arm"
-         else if stdenv.is64bit
-              then"x64"
-              else "ia32";
+  arch = if stdenv.isx86_64 then "x64"
+            else if stdenv.isi686 then "ia32"
+            else if stdenv.isAarch64 then "arm64"
+            else if stdenv.isArm then "arm"
+            else throw "Unknown architecture for v8";
   git_url = "https://chromium.googlesource.com";
   clangFlag = if stdenv.isDarwin then "1" else "0";
   sharedFlag = if static then "static_library" else "shared_library";
@@ -172,6 +170,8 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
+  dontUpdateAutotoolsGnuConfigScripts = if stdenv.isAarch64 then true else null;
+
   # the `libv8_libplatform` target is _only_ built as a static library,
   # and is expected to be statically linked in when needed.
   # see the following link for further commentary:
diff --git a/pkgs/development/libraries/vaapi-intel/default.nix b/pkgs/development/libraries/vaapi-intel/default.nix
index dcb44a408a8..7bd036cf2e5 100644
--- a/pkgs/development/libraries/vaapi-intel/default.nix
+++ b/pkgs/development/libraries/vaapi-intel/default.nix
@@ -1,14 +1,16 @@
-{ stdenv, fetchurl, gnum4, pkgconfig, python2
-, intel-gpu-tools, libdrm, libva, libX11, mesa_noglu, wayland
+{ stdenv, fetchFromGitHub, autoreconfHook, gnum4, pkgconfig, python2
+, intel-gpu-tools, libdrm, libva, libX11, mesa_noglu, wayland, libXext
 }:
 
 stdenv.mkDerivation rec {
   name = "intel-vaapi-driver-${version}";
-  version = "1.8.2";
+  inherit (libva) version;
 
-  src = fetchurl {
-    url = "http://www.freedesktop.org/software/vaapi/releases/libva-intel-driver/${name}.tar.bz2";
-    sha256 = "00mpcvininwr5c4wyhp16s4bddg7vclxxjm2sfq5h7lifjcxyv46";
+  src = fetchFromGitHub {
+    owner  = "01org";
+    repo   = "libva-intel-driver";
+    rev    = version;
+    sha256 = "1832nnva3d33wv52bj59bv62q7a807sdxjqqq0my7l9x7a4qdkzz";
   };
 
   patchPhase = ''
@@ -25,12 +27,14 @@ stdenv.mkDerivation rec {
     "--enable-wayland"
   ];
 
-  nativeBuildInputs = [ gnum4 pkgconfig python2 ];
+  nativeBuildInputs = [ autoreconfHook gnum4 pkgconfig python2 ];
 
-  buildInputs = [ intel-gpu-tools libdrm libva libX11 mesa_noglu wayland ];
+  buildInputs = [ intel-gpu-tools libdrm libva libX11 libXext mesa_noglu wayland ];
+
+  enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
-    homepage = http://cgit.freedesktop.org/vaapi/intel-driver/;
+    homepage = https://cgit.freedesktop.org/vaapi/intel-driver/;
     license = licenses.mit;
     description = "Intel driver for the VAAPI library";
     platforms = platforms.unix;
diff --git a/pkgs/development/libraries/vaapi-vdpau/default.nix b/pkgs/development/libraries/vaapi-vdpau/default.nix
index 4522ecc1bb6..f0089110c3c 100644
--- a/pkgs/development/libraries/vaapi-vdpau/default.nix
+++ b/pkgs/development/libraries/vaapi-vdpau/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
 
 
   meta = {
-    homepage = http://cgit.freedesktop.org/vaapi/vdpau-driver/;
+    homepage = https://cgit.freedesktop.org/vaapi/vdpau-driver/;
     license = stdenv.lib.licenses.gpl2Plus;
     description = "VDPAU driver for the VAAPI library";
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/development/libraries/vapoursynth/default.nix b/pkgs/development/libraries/vapoursynth/default.nix
index 6864db12f18..24c4a50d874 100644
--- a/pkgs/development/libraries/vapoursynth/default.nix
+++ b/pkgs/development/libraries/vapoursynth/default.nix
@@ -12,13 +12,13 @@ with stdenv.lib;
 
 stdenv.mkDerivation rec {
   name = "vapoursynth-${version}";
-  version = "R39";
+  version = "R40";
 
   src = fetchFromGitHub {
     owner  = "vapoursynth";
     repo   = "vapoursynth";
     rev    = version;
-    sha256 = "0cw7w8xiwhxhwykydy13m44wm9vn9hrsi30z6017ngga9d84fhqy";
+    sha256 = "1ycc3fdhhryp7hap80z3qmh89br31kcswzp8ai3wlc07zfvcrfck";
   };
 
   nativeBuildInputs = [ pkgconfig autoreconfHook nasm ];
diff --git a/pkgs/development/libraries/vigra/default.nix b/pkgs/development/libraries/vigra/default.nix
index 324d977c72e..438b4eda454 100644
--- a/pkgs/development/libraries/vigra/default.nix
+++ b/pkgs/development/libraries/vigra/default.nix
@@ -28,7 +28,7 @@ in stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "Novel computer vision C++ library with customizable algorithms and data structures";
-    homepage = http://hci.iwr.uni-heidelberg.de/vigra;
+    homepage = https://hci.iwr.uni-heidelberg.de/vigra;
     license = licenses.mit;
     maintainers = [ maintainers.viric ];
     platforms = platforms.linux;
diff --git a/pkgs/development/libraries/vmime/default.nix b/pkgs/development/libraries/vmime/default.nix
index 9bef1b27e9c..e0398487abc 100644
--- a/pkgs/development/libraries/vmime/default.nix
+++ b/pkgs/development/libraries/vmime/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   ];
 
   meta = {
-    homepage = http://www.vmime.org/;
+    homepage = https://www.vmime.org/;
     description = "Free mail library for C++";
     license = stdenv.lib.licenses.gpl3;
     maintainers = with stdenv.lib.maintainers; [viric];
diff --git a/pkgs/development/libraries/vmmlib/default.nix b/pkgs/development/libraries/vmmlib/default.nix
index ccdf2b05e7e..18b9278539f 100644
--- a/pkgs/development/libraries/vmmlib/default.nix
+++ b/pkgs/development/libraries/vmmlib/default.nix
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
             computations and frustum culling classes, and spatial data structures'';
 
     license     = licenses.bsd2;
-    homepage    = http://github.com/VMML/vmmlib/;
+    homepage    = https://github.com/VMML/vmmlib/;
     maintainers = [ maintainers.adev ];
     platforms   = platforms.all;
   };
diff --git a/pkgs/development/libraries/vulkan-loader/default.nix b/pkgs/development/libraries/vulkan-loader/default.nix
index 8330f7f44f3..5110dd1db64 100644
--- a/pkgs/development/libraries/vulkan-loader/default.nix
+++ b/pkgs/development/libraries/vulkan-loader/default.nix
@@ -3,12 +3,12 @@
   libXext, wayland, mesa_noglu, makeWrapper }:
 
 let
-  version = "1.0.42.2";
+  version = "1.0.61.1";
   src = fetchFromGitHub {
     owner = "KhronosGroup";
     repo = "Vulkan-LoaderAndValidationLayers";
     rev = "sdk-${version}";
-    sha256 = "0na1ax2cgv6w29213mby56mndfsj3iizj3n5pbpy4s4p7ij9kdgn";
+    sha256 = "043kw6wnrpdplnb40x6n9rgf3gygsn9jiv91y458sydbhalfr945";
   };
 in
 
@@ -48,11 +48,12 @@ stdenv.mkDerivation rec {
     sed -i "s:\\./lib:$out/lib/lib:g" "$out/share/vulkan/"*/*.json
     mkdir -p $dev/include
     cp -rv ../include $dev/
+    mkdir -p $demos/share/vulkan-demos
+    cp demos/*.spv demos/*.ppm $demos/share/vulkan-demos
     mkdir -p $demos/bin
-    cp demos/*.spv demos/*.ppm $demos/bin
-    find demos -type f -executable -not -name vulkaninfo -exec cp {} $demos/bin \;
+    find demos -type f -executable -not -name vulkaninfo -exec cp -v {} $demos/bin \;
     for p in cube cubepp; do
-      wrapProgram $demos/bin/$p --run "cd $demos/bin"
+      wrapProgram $demos/bin/$p --run "cd $demos/share/vulkan-demos"
     done
   '';
 
diff --git a/pkgs/development/libraries/wayland/default.nix b/pkgs/development/libraries/wayland/default.nix
index 836a4527b50..a5b7a6a99ce 100644
--- a/pkgs/development/libraries/wayland/default.nix
+++ b/pkgs/development/libraries/wayland/default.nix
@@ -8,11 +8,11 @@ assert expat != null;
 
 stdenv.mkDerivation rec {
   name = "wayland-${version}";
-  version = "1.12.0";
+  version = "1.14.0";
 
   src = fetchurl {
-    url = "http://wayland.freedesktop.org/releases/${name}.tar.xz";
-    sha256 = "d6b4135cba0188abcb7275513c72dede751d6194f6edc5b82183a3ba8b821ab1";
+    url = "https://wayland.freedesktop.org/releases/${name}.tar.xz";
+    sha256 = "1f3sla6h0bw15fz8pjc67jhwj7pwmfdc7qlj42j5k9v116ycm07d";
   };
 
   configureFlags = [ "--with-scanner" "--disable-documentation" ];
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "Reference implementation of the wayland protocol";
-    homepage    = http://wayland.freedesktop.org/;
+    homepage    = https://wayland.freedesktop.org/;
     license     = lib.licenses.mit;
     platforms   = lib.platforms.linux;
     maintainers = with lib.maintainers; [ codyopel wkennington ];
diff --git a/pkgs/development/libraries/wayland/protocols.nix b/pkgs/development/libraries/wayland/protocols.nix
index 436de5609e5..5b1495ccbe1 100644
--- a/pkgs/development/libraries/wayland/protocols.nix
+++ b/pkgs/development/libraries/wayland/protocols.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   name = "wayland-protocols-${version}";
-  version = "1.10";
+  version = "1.11";
 
   src = fetchurl {
     url = "http://wayland.freedesktop.org/releases/${name}.tar.xz";
-    sha256 = "5719c51d7354864983171c5083e93a72ac99229e2b460c4bb10513de08839c0a";
+    sha256 = "0138psvx6fv8z5x2p6xi4iij6m5k62c0qyfsb45xgcf5a4fyxz1s";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/webkitgtk/2.18.nix b/pkgs/development/libraries/webkitgtk/2.18.nix
index d83da0402ba..d3e3163a8af 100644
--- a/pkgs/development/libraries/webkitgtk/2.18.nix
+++ b/pkgs/development/libraries/webkitgtk/2.18.nix
@@ -1,22 +1,25 @@
 { stdenv, fetchurl, perl, python2, ruby, bison, gperf, cmake
 , pkgconfig, gettext, gobjectIntrospection, libnotify, gnutls
-, gtk2, gtk3, wayland, libwebp, enchant, xlibs, libxkbcommon, epoxy, at_spi2_core
+, gtk3, wayland, libwebp, enchant, xlibs, libxkbcommon, epoxy, at_spi2_core
 , libxml2, libsoup, libsecret, libxslt, harfbuzz, libpthreadstubs, pcre, nettle, libtasn1, p11_kit
 , libidn, libedit, readline, mesa, libintlOrEmpty
 , enableGeoLocation ? true, geoclue2, sqlite
+, enableGtk2Plugins ? false, gtk2 ? null
 , gst-plugins-base, gst-plugins-bad
 }:
 
 assert enableGeoLocation -> geoclue2 != null;
+assert enableGtk2Plugins -> gtk2 != null;
+assert stdenv.isDarwin -> !enableGtk2Plugins;
 
 with stdenv.lib;
 stdenv.mkDerivation rec {
   name = "webkitgtk-${version}";
-  version = "2.18.2";
+  version = "2.18.6";
 
   meta = {
     description = "Web content rendering engine, GTK+ port";
-    homepage = http://webkitgtk.org/;
+    homepage = https://webkitgtk.org/;
     license = licenses.bsd2;
     platforms = with platforms; linux ++ darwin;
     hydraPlatforms = [];
@@ -42,7 +45,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://webkitgtk.org/releases/${name}.tar.xz";
-    sha256 = "1ry8zvv6k01g9p7agg326n0ziqpqjxd49h5w1b2is6rjnpqv6k5i";
+    sha256 = "0g5cpdijjv5hlrbi4i4dh97yrh5apnyvm90wpr9f84hgyk12r4ck";
   };
 
   # see if we can clean this up....
@@ -59,14 +62,13 @@ stdenv.mkDerivation rec {
   "-DPORT=GTK"
   "-DUSE_LIBHYPHEN=0"
   ]
+  ++ optional (!enableGtk2Plugins) "-DENABLE_PLUGIN_PROCESS_GTK2=OFF"
   ++ optional stdenv.isLinux "-DENABLE_GLES2=ON"
   ++ optionals stdenv.isDarwin [
   "-DUSE_SYSTEM_MALLOC=ON"
   "-DUSE_ACCELERATE=0"
   "-DENABLE_INTROSPECTION=ON"
   "-DENABLE_MINIBROWSER=OFF"
-  "-DENABLE_PLUGIN_PROCESS_GTK2=OFF"
-  "-DENABLE_MINIBROWSER=OFF"
   "-DENABLE_VIDEO=ON"
   "-DENABLE_QUARTZ_TARGET=ON"
   "-DENABLE_X11_TARGET=OFF"
@@ -85,10 +87,11 @@ stdenv.mkDerivation rec {
   ];
 
   buildInputs = libintlOrEmpty ++ [
-    gtk2 libwebp enchant libnotify gnutls pcre nettle libidn
+    libwebp enchant libnotify gnutls pcre nettle libidn
     libxml2 libsecret libxslt harfbuzz libpthreadstubs libtasn1 p11_kit
     sqlite gst-plugins-base gst-plugins-bad libxkbcommon epoxy at_spi2_core
   ] ++ optional enableGeoLocation geoclue2
+    ++ optional enableGtk2Plugins gtk2
     ++ (with xlibs; [ libXdmcp libXt libXtst ])
     ++ optionals stdenv.isDarwin [ libedit readline mesa ]
     ++ optional stdenv.isLinux wayland;
diff --git a/pkgs/development/libraries/websocket++/default.nix b/pkgs/development/libraries/websocket++/default.nix
index fbfc460db96..8a0ec2523b9 100644
--- a/pkgs/development/libraries/websocket++/default.nix
+++ b/pkgs/development/libraries/websocket++/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ cmake ];
 
   meta = with stdenv.lib; {
-    homepage = http://www.zaphoyd.com/websocketpp/;
+    homepage = https://www.zaphoyd.com/websocketpp/;
     description = "C++/Boost Asio based websocket client/server library";
     license = licenses.bsd3;
     platforms = platforms.unix;
diff --git a/pkgs/development/libraries/wiredtiger/default.nix b/pkgs/development/libraries/wiredtiger/default.nix
index e4b95fc1cb9..9d11b98b1cb 100644
--- a/pkgs/development/libraries/wiredtiger/default.nix
+++ b/pkgs/development/libraries/wiredtiger/default.nix
@@ -71,5 +71,6 @@ stdenv.mkDerivation rec {
     license = licenses.gpl2;
     platforms = intersectLists platforms.unix platforms.x86_64;
     maintainers = with maintainers; [ wkennington ];
+    broken = true; # Broken by f689a6d1c6796c4a4f116ffec6c4624379e04bc9.
   };
 }
diff --git a/pkgs/development/libraries/wld/default.nix b/pkgs/development/libraries/wld/default.nix
deleted file mode 100644
index 1dd5858ec72..00000000000
--- a/pkgs/development/libraries/wld/default.nix
+++ /dev/null
@@ -1,30 +0,0 @@
-{ lib, stdenv, fetchurl, pkgconfig
-, wayland, fontconfig, pixman, freetype, libdrm
-}:
-
-stdenv.mkDerivation rec {
-  name = "wld-${version}";
-  version = "git-2015-09-01";
-  repo = "https://github.com/michaelforney/wld";
-  rev = "efe0a1ed1856a2e4a1893ed0f2d7dde43b5627f0";
-
-  src = fetchurl {
-    url = "${repo}/archive/${rev}.tar.gz";
-    sha256 = "09388f7828e18c75e7b8d41454903886a725d7a868f60e66c128bd7d2e953ee1";
-  };
-
-  nativeBuildInputs = [ pkgconfig ];
-
-  buildInputs = [ wayland fontconfig pixman freetype libdrm ];
-
-  makeFlags = "PREFIX=$(out)";
-  installPhase = "PREFIX=$out make install";
-
-  meta = {
-    description = "A primitive drawing library targeted at Wayland";
-    homepage    = repo;
-    license     = lib.licenses.mit;
-    platforms   = lib.platforms.linux;
-    maintainers = with lib.maintainers; [ ];
-  };
-}
diff --git a/pkgs/development/libraries/wlroots/default.nix b/pkgs/development/libraries/wlroots/default.nix
index 79bd8bb9665..c32f0a3b938 100644
--- a/pkgs/development/libraries/wlroots/default.nix
+++ b/pkgs/development/libraries/wlroots/default.nix
@@ -1,30 +1,44 @@
 { stdenv, fetchFromGitHub, meson, ninja, pkgconfig
 , wayland, mesa_noglu, wayland-protocols, libinput, libxkbcommon, pixman
-, xcbutilwm, libX11, libcap
+, xcbutilwm, libX11, libcap, xcbutilimage
 }:
 
 let pname = "wlroots";
-    version = "unstable-2017-10-31";
+    version = "unstable-2017-12-22";
 in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchFromGitHub {
     owner = "swaywm";
     repo = "wlroots";
-    rev = "7200d643363e988edf6777c38e7f8fcd451a2c50";
-    sha256 = "179raymkni1xzaph32zdhg7nfin0xfzrlnbnxkcr266k9y8k66ac";
+    rev = "0a370c529806077a11638e7fa856d5fbb539496b";
+    sha256 = "0h3i0psn5595dncv53l5m2mf13k9wcv3qi16vla5ckpskykc0xx6";
   };
 
   # TODO: Temporary workaround for compilation errors
-  patches = [ ./libdrm.patch ./no-werror.patch ];
+  patches = [ ./libdrm.patch ]; #./no-werror.patch
+
+  # $out for the library and $bin for rootston
+  outputs = [ "out" "bin" ];
 
   nativeBuildInputs = [ meson ninja pkgconfig ];
 
   buildInputs = [
     wayland mesa_noglu wayland-protocols libinput libxkbcommon pixman
-    xcbutilwm libX11 libcap
+    xcbutilwm libX11 libcap xcbutilimage
   ];
 
+  # Install rootston (the reference compositor) to $bin
+  postInstall = ''
+    mkdir -p $bin/bin
+    cp rootston/rootston $bin/bin/
+    mkdir $bin/lib
+    cp libwlroots.so $bin/lib/
+    patchelf --set-rpath "$bin/lib:${stdenv.lib.makeLibraryPath buildInputs}" $bin/bin/rootston
+    mkdir $bin/etc
+    cp ../rootston/rootston.ini.example $bin/etc/rootston.ini
+  '';
+
   meta = with stdenv.lib; {
     description = "A modular Wayland compositor library";
     inherit (src.meta) homepage;
diff --git a/pkgs/development/libraries/wt/default.nix b/pkgs/development/libraries/wt/default.nix
index 3adf4f1497f..37819c2a98e 100644
--- a/pkgs/development/libraries/wt/default.nix
+++ b/pkgs/development/libraries/wt/default.nix
@@ -1,42 +1,56 @@
-{ stdenv, fetchFromGitHub, cmake, boost, pkgconfig, doxygen, qt48Full, libharu
-, pango, fcgi, firebird, libmysql, postgresql, graphicsmagick, glew, openssl
+{ stdenv, fetchFromGitHub, cmake, boost165, pkgconfig, doxygen, qt48Full, libharu
+, pango, fcgi, firebird, mysql, postgresql, graphicsmagick, glew, openssl
 , pcre
 }:
 
-stdenv.mkDerivation rec {
-  name = "wt-${version}";
-  version = "4.0.0";
+let
+  generic =
+    { version, sha256 }:
+    stdenv.mkDerivation rec {
+      name = "wt-${version}";
 
-  src = fetchFromGitHub {
-    owner = "kdeforche";
-    repo = "wt";
-    rev = version;
-    sha256 = "1451xxvnx6mlvxg0jxlr1mfv5v18h2214kijk5kacilqashfc43i";
-  };
+      src = fetchFromGitHub {
+        owner = "kdeforche";
+        repo = "wt";
+        rev = version;
+        inherit sha256;
+      };
 
-  enableParallelBuilding = true;
+      enableParallelBuilding = true;
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [
-    cmake boost doxygen qt48Full libharu
-    pango fcgi firebird libmysql postgresql graphicsmagick glew
-    openssl pcre
-  ];
+      nativeBuildInputs = [ pkgconfig ];
+      buildInputs = [
+        cmake boost165 doxygen qt48Full libharu
+        pango fcgi firebird mysql.connector-c postgresql graphicsmagick glew
+        openssl pcre
+      ];
 
-  cmakeFlags = [
-    "-DWT_WRASTERIMAGE_IMPLEMENTATION=GraphicsMagick"
-    "-DWT_CPP_11_MODE=-std=c++11"
-    "-DGM_PREFIX=${graphicsmagick}"
-    "-DMYSQL_PREFIX=${libmysql.dev}"
-    "--no-warn-unused-cli"
-  ];
+      cmakeFlags = [
+        "-DWT_WRASTERIMAGE_IMPLEMENTATION=GraphicsMagick"
+        "-DWT_CPP_11_MODE=-std=c++11"
+        "-DGM_PREFIX=${graphicsmagick}"
+        "-DMYSQL_PREFIX=${mysql.connector-c}"
+        "--no-warn-unused-cli"
+      ];
 
-  meta = with stdenv.lib; {
-    homepage = https://www.webtoolkit.eu/wt;
-    description = "C++ library for developing web applications";
-    platforms = platforms.linux;
-    license = licenses.gpl2;
-    maintainers = [ maintainers.juliendehos ];
+      meta = with stdenv.lib; {
+        homepage = https://www.webtoolkit.eu/wt;
+        description = "C++ library for developing web applications";
+        platforms = platforms.linux;
+        license = licenses.gpl2;
+        maintainers = with maintainers; [ juliendehos willibutz ];
+      };
+    };
+in {
+  wt3 = generic {
+    # with the next version update the version pinning of boost should be omitted
+    version = "3.3.9";
+    sha256 = "1mkflhvzzzxkc5yzvr6nk34j0ldpwxjxb6n7xml59h3j3px3ixjm";
   };
-}
 
+  wt4 = generic {
+    # with the next version update the version pinning of boost should be omitted
+    version = "4.0.2";
+    sha256 = "0r729gjd1sy0pcmir2r7ga33mp5cr5b4gvf44852q65hw2577w1x";
+  };
+}
diff --git a/pkgs/development/libraries/wxsqlite3/default.nix b/pkgs/development/libraries/wxsqlite3/default.nix
index a0600399784..49f12842533 100644
--- a/pkgs/development/libraries/wxsqlite3/default.nix
+++ b/pkgs/development/libraries/wxsqlite3/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Cocoa darwin.stubs.setfile darwin.stubs.rez darwin.stubs.derez ];
 
   meta = with stdenv.lib; {
-    homepage = http://utelle.github.io/wxsqlite3/ ;
+    homepage = https://utelle.github.io/wxsqlite3/ ;
     description = "A C++ wrapper around the public domain SQLite 3.x for wxWidgets";
     platforms = platforms.unix;
     maintainers = with maintainers; [ vrthra ];
diff --git a/pkgs/development/libraries/wxwidgets/3.1/default.nix b/pkgs/development/libraries/wxwidgets/3.1/default.nix
new file mode 100644
index 00000000000..4b410a307bb
--- /dev/null
+++ b/pkgs/development/libraries/wxwidgets/3.1/default.nix
@@ -0,0 +1,16 @@
+{ stdenv, fetchFromGitHub
+, wxGTK30
+}:
+
+with stdenv.lib;
+
+wxGTK30.overrideAttrs (oldAttrs : rec {
+    name = "wxwidgets-${version}";
+    version = "3.1.0";
+    src = fetchFromGitHub {
+        owner = "wxWidgets";
+        repo = "wxWidgets";
+        rev = "v${version}";
+        sha256 = "14kl1rsngm70v3mbyv1mal15iz2b18k97avjx8jn7s81znha1c7f";
+    };
+})
\ No newline at end of file
diff --git a/pkgs/development/libraries/x265/default.nix b/pkgs/development/libraries/x265/default.nix
index 29d7ddf1fdc..418829e7af8 100644
--- a/pkgs/development/libraries/x265/default.nix
+++ b/pkgs/development/libraries/x265/default.nix
@@ -16,14 +16,14 @@ in
 
 stdenv.mkDerivation rec {
   name = "x265-${version}";
-  version = "2.5";
+  version = "2.6";
 
   src = fetchurl {
     urls = [
       "http://get.videolan.org/x265/x265_${version}.tar.gz"
       "https://github.com/videolan/x265/archive/${version}.tar.gz"
     ];
-    sha256 = "05rxbnfcc8yl05q3xqkl1kk90k7zn5ih305r46dxnzjaa2djalrf";
+    sha256 = "1gyd94jkwdii9308m07nymsbxrmrcl81c0j8i10zhslr2mj07w0v";
   };
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/xapian/default.nix b/pkgs/development/libraries/xapian/default.nix
index 23fee81e0a5..482c765dcda 100644
--- a/pkgs/development/libraries/xapian/default.nix
+++ b/pkgs/development/libraries/xapian/default.nix
@@ -27,7 +27,7 @@ let
 
     meta = with stdenv.lib; {
       description = "Search engine library";
-      homepage = http://xapian.org/;
+      homepage = https://xapian.org/;
       license = licenses.gpl2Plus;
       maintainers = with maintainers; [ chaoflow ];
       platforms = platforms.unix;
@@ -36,5 +36,5 @@ let
 in {
   # xapian-ruby needs 1.2.22 as of 2017-05-06
   xapian_1_2_22 = generic "1.2.22" "0zsji22n0s7cdnbgj0kpil05a6bgm5cfv0mvx12d8ydg7z58g6r6";
-  xapian_1_4_4 = generic "1.4.4" "1n9j2w2as0flih3hgim7gprfxsx6gimijs91rxsjsi8shjlqbad6";
+  xapian_1_4 = generic "1.4.5" "0axhqrj202hbll9mcx1qdm8gsqj19216w3z02gyjbycxvr9gkdc5";
 }
diff --git a/pkgs/development/libraries/xapian/tools/omega/default.nix b/pkgs/development/libraries/xapian/tools/omega/default.nix
index 2923bfc1fc6..09c2171945e 100644
--- a/pkgs/development/libraries/xapian/tools/omega/default.nix
+++ b/pkgs/development/libraries/xapian/tools/omega/default.nix
@@ -6,7 +6,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://oligarchy.co.uk/xapian/${version}/xapian-omega-${version}.tar.xz";
-    sha256 = "0pl9gs0sbavxykfgrkm8syswqnfynmmqhf8429bv8a5qjh5pkp8l";
+    sha256 = "0zji8ckp4h5xdy2wbir3lvk680w1g1l4h5swmaxsx7ah12lkrjcr";
   };
 
   buildInputs = [ xapian perl pcre zlib libmagic ];
diff --git a/pkgs/development/libraries/xcb-util-cursor/HEAD.nix b/pkgs/development/libraries/xcb-util-cursor/HEAD.nix
index 81ac75489ba..17f8646b517 100644
--- a/pkgs/development/libraries/xcb-util-cursor/HEAD.nix
+++ b/pkgs/development/libraries/xcb-util-cursor/HEAD.nix
@@ -13,9 +13,9 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "XCB cursor library (libxcursor port)";
-    homepage    = http://cgit.freedesktop.org/xcb/util-cursor;
+    homepage    = https://cgit.freedesktop.org/xcb/util-cursor;
     license     = licenses.mit;
-    maintainer  = with maintainers; [ lovek323 ];
+    maintainers = with maintainers; [ lovek323 ];
     platforms   = platforms.linux ++ platforms.darwin;
   };
 
diff --git a/pkgs/development/libraries/xml-tooling-c/default.nix b/pkgs/development/libraries/xml-tooling-c/default.nix
index f2d7711c9f0..8e1d71fab3f 100644
--- a/pkgs/development/libraries/xml-tooling-c/default.nix
+++ b/pkgs/development/libraries/xml-tooling-c/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   name = "xml-tooling-c-${version}";
-  version = "1.6.0";
+  version = "1.6.3";
 
   src = fetchgit {
     url = "https://git.shibboleth.net/git/cpp-xmltooling.git";
-    rev = "db08101c3854518a59096be95ed6564838381744";
-    sha256 = "0rhzvxm4z3pm28kpk34hayhm12bjjms2kygv1z68vnz8ijzgcinq";
+    rev = version;
+    sha256 = "09z2pp3yy3kqx22vwgxyi3s0vlpdv9camw8dpi3q8piff6zxak3q";
   };
 
   buildInputs = [ boost curl openssl log4shib xercesc xml-security-c ];
diff --git a/pkgs/development/libraries/yajl/default.nix b/pkgs/development/libraries/yajl/default.nix
index c6ab03df10a..02e1e96cabd 100644
--- a/pkgs/development/libraries/yajl/default.nix
+++ b/pkgs/development/libraries/yajl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, ruby }:
+{ stdenv, fetchurl, cmake }:
 
 stdenv.mkDerivation rec {
   name = "yajl-2.1.0";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "0f6yrjc05aa26wfi7lqn2gslm19m6rm81b30ksllpkappvh162ji";
   };
 
-  buildInputs = [ cmake ruby ];
+  nativeBuildInputs = [ cmake ];
 
   meta = {
     description = "Yet Another JSON Library";
diff --git a/pkgs/development/libraries/zeitgeist/default.nix b/pkgs/development/libraries/zeitgeist/default.nix
index ed84dec365e..3c50de6cc6b 100644
--- a/pkgs/development/libraries/zeitgeist/default.nix
+++ b/pkgs/development/libraries/zeitgeist/default.nix
@@ -14,8 +14,6 @@ stdenv.mkDerivation rec {
     sha256 = "0vw6m0azycqabbz8f0fd8xsh5kf6j3ig4wpqlhw6sklvf44ii5b8";
   };
 
-  NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0";
-
   configureScript = "./autogen.sh";
 
   configureFlags = [ "--with-session-bus-services-dir=$(out)/share/dbus-1/services" ];
diff --git a/pkgs/development/libraries/zeromq/4.x.nix b/pkgs/development/libraries/zeromq/4.x.nix
index 030246db318..eea0fb727b0 100644
--- a/pkgs/development/libraries/zeromq/4.x.nix
+++ b/pkgs/development/libraries/zeromq/4.x.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "zeromq-${version}";
-  version = "4.2.2";
+  version = "4.2.3";
 
   src = fetchFromGitHub {
     owner = "zeromq";
     repo = "libzmq";
     rev = "v${version}";
-    sha256 = "09317g4zkalp3k11x6vbidcm4qf02ciml1wxgp3742lrlgcblgxy";
+    sha256 = "1yadf4vz4m49lpwwwscxs6wf4v9dgqgxkwgwpby9lvb4pv8qbmaf";
   };
 
   nativeBuildInputs = [ cmake asciidoc ];
diff --git a/pkgs/development/libraries/zimg/default.nix b/pkgs/development/libraries/zimg/default.nix
index b5bb73e3e33..00973350e18 100644
--- a/pkgs/development/libraries/zimg/default.nix
+++ b/pkgs/development/libraries/zimg/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec{
   name = "zimg-${version}";
-  version = "2.6.1";
+  version = "2.7";
 
   src = fetchFromGitHub {
     owner  = "sekrit-twc";
     repo   = "zimg";
     rev    = "release-${version}";
-    sha256 = "08hynzcxz95a4i67k5cn6isafdb6xjgd0x0miyhlnp2xc220zfqj";
+    sha256 = "1jvx3a523mzkc54rrjab9kz66kc6q1snry9ymwmsx7rrd3kv3j6m";
   };
 
   nativeBuildInputs = [ autoreconfHook ];
diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix
index ceb4bb9f370..de2e0b62f9e 100644
--- a/pkgs/development/libraries/zlib/default.nix
+++ b/pkgs/development/libraries/zlib/default.nix
@@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
   ];
 
   makeFlags = [
-    "PREFIX=${stdenv.cc.prefix}"
+    "PREFIX=${stdenv.cc.targetPrefix}"
   ] ++ stdenv.lib.optionals (hostPlatform.libc == "msvcrt") [
     "-f" "win32/Makefile.gcc"
   ] ++ stdenv.lib.optionals (!static) [
diff --git a/pkgs/development/libraries/zxcvbn-c/default.nix b/pkgs/development/libraries/zxcvbn-c/default.nix
new file mode 100644
index 00000000000..1ba07394348
--- /dev/null
+++ b/pkgs/development/libraries/zxcvbn-c/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchFromGitHub }:
+stdenv.mkDerivation rec {
+  name = "zxcvbn-c-${version}";
+  version = "2.3";
+
+  src = fetchFromGitHub {
+    owner = "tsyrogit";
+    repo = "zxcvbn-c";
+    rev = "v${version}";
+    sha256 = "1m097b4qq1r3kk4b236pc3mpaj22il9fh43ifagad5wy54x8zf7b";
+  };
+
+  installPhase = ''
+    install -D -t $out/lib libzxcvbn.so*
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/tsyrogit/zxcvbn-c;
+    description = "A C/C++ implementation of the zxcvbn password strength estimation";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ xurei ];
+  };
+}