summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
authorFranz Pletz <fpletz@fnordicwalking.de>2019-12-26 14:16:15 +0100
committerFranz Pletz <fpletz@fnordicwalking.de>2019-12-26 14:17:36 +0100
commit77b6c3cd06a679140fb5a44f81f904497007f333 (patch)
treee8ed1606b326cdafba719cc2a14c527c1b601f2e /pkgs/development/libraries
parent602bccd1a8262d4e6bd787838d21fc3c2c1c50ba (diff)
parent4d2dd1554618831f0a5b159b8a4dff86612c02a9 (diff)
downloadnixpkgs-77b6c3cd06a679140fb5a44f81f904497007f333.tar
nixpkgs-77b6c3cd06a679140fb5a44f81f904497007f333.tar.gz
nixpkgs-77b6c3cd06a679140fb5a44f81f904497007f333.tar.bz2
nixpkgs-77b6c3cd06a679140fb5a44f81f904497007f333.tar.lz
nixpkgs-77b6c3cd06a679140fb5a44f81f904497007f333.tar.xz
nixpkgs-77b6c3cd06a679140fb5a44f81f904497007f333.tar.zst
nixpkgs-77b6c3cd06a679140fb5a44f81f904497007f333.zip
Merge remote-tracking branch 'origin/master' into gcc-9
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/AntTweakBar/default.nix4
-rw-r--r--pkgs/development/libraries/CGAL/4.nix28
-rw-r--r--pkgs/development/libraries/CGAL/default.nix4
-rw-r--r--pkgs/development/libraries/SDL/setup-hook.sh6
-rw-r--r--pkgs/development/libraries/SDL2/default.nix16
-rw-r--r--pkgs/development/libraries/SDL2/setup-hook.sh2
-rw-r--r--pkgs/development/libraries/ace/default.nix4
-rw-r--r--pkgs/development/libraries/agda/Agda-Sheaves/default.nix2
-rw-r--r--pkgs/development/libraries/agda/TotalParserCombinators/default.nix2
-rw-r--r--pkgs/development/libraries/agda/agda-base/default.nix2
-rw-r--r--pkgs/development/libraries/agda/agda-iowa-stdlib/default.nix2
-rw-r--r--pkgs/development/libraries/agda/agda-prelude/default.nix2
-rw-r--r--pkgs/development/libraries/agda/agda-stdlib/default.nix3
-rw-r--r--pkgs/development/libraries/agda/bitvector/default.nix2
-rw-r--r--pkgs/development/libraries/agda/categories/default.nix2
-rw-r--r--pkgs/development/libraries/agda/pretty/default.nix2
-rw-r--r--pkgs/development/libraries/allegro/5.nix4
-rw-r--r--pkgs/development/libraries/allegro/default.nix4
-rw-r--r--pkgs/development/libraries/aqbanking/libchipcard.nix2
-rw-r--r--pkgs/development/libraries/arb/default.nix5
-rw-r--r--pkgs/development/libraries/argp-standalone/default.nix2
-rw-r--r--pkgs/development/libraries/armadillo/default.nix4
-rw-r--r--pkgs/development/libraries/arrayfire/default.nix60
-rw-r--r--pkgs/development/libraries/arrow-cpp/default.nix6
-rw-r--r--pkgs/development/libraries/aspell/default.nix14
-rw-r--r--pkgs/development/libraries/at-spi2-atk/default.nix4
-rw-r--r--pkgs/development/libraries/at-spi2-core/default.nix3
-rw-r--r--pkgs/development/libraries/audio/libmysofa/default.nix4
-rw-r--r--pkgs/development/libraries/bamf/default.nix49
-rw-r--r--pkgs/development/libraries/bamf/gtester2xunit-python3.patch53
-rw-r--r--pkgs/development/libraries/bcg729/default.nix43
-rw-r--r--pkgs/development/libraries/bctoolbox/default.nix24
-rw-r--r--pkgs/development/libraries/belle-sip/default.nix17
-rw-r--r--pkgs/development/libraries/boehm-gc/7.6.6.nix6
-rw-r--r--pkgs/development/libraries/boehm-gc/default.nix14
-rw-r--r--pkgs/development/libraries/boehm-gc/mcfgthread.patch11
-rw-r--r--pkgs/development/libraries/boost/1.71.nix15
-rw-r--r--pkgs/development/libraries/boost/generic.nix4
-rw-r--r--pkgs/development/libraries/box2d/default.nix4
-rw-r--r--pkgs/development/libraries/boxfort/default.nix47
-rw-r--r--pkgs/development/libraries/bullet/default.nix4
-rw-r--r--pkgs/development/libraries/bullet/roboschool-fork.nix4
-rw-r--r--pkgs/development/libraries/c-blosc/default.nix2
-rw-r--r--pkgs/development/libraries/caf/default.nix21
-rw-r--r--pkgs/development/libraries/cairo/default.nix4
-rw-r--r--pkgs/development/libraries/catch2/default.nix4
-rw-r--r--pkgs/development/libraries/check/default.nix4
-rw-r--r--pkgs/development/libraries/chipmunk/default.nix4
-rw-r--r--pkgs/development/libraries/cl/default.nix4
-rw-r--r--pkgs/development/libraries/clipper/default.nix3
-rw-r--r--pkgs/development/libraries/cln/default.nix6
-rw-r--r--pkgs/development/libraries/clutter/default.nix4
-rw-r--r--pkgs/development/libraries/codec2/default.nix12
-rw-r--r--pkgs/development/libraries/cogl/default.nix12
-rw-r--r--pkgs/development/libraries/coin3d/default.nix4
-rw-r--r--pkgs/development/libraries/coprthr/default.nix38
-rw-r--r--pkgs/development/libraries/coredumper/default.nix18
-rw-r--r--pkgs/development/libraries/cppzmq/default.nix4
-rw-r--r--pkgs/development/libraries/criterion/default.nix49
-rw-r--r--pkgs/development/libraries/csfml/default.nix6
-rw-r--r--pkgs/development/libraries/dav1d/default.nix4
-rw-r--r--pkgs/development/libraries/dconf/default.nix55
-rw-r--r--pkgs/development/libraries/dleyna-core/setup-hook.sh2
-rw-r--r--pkgs/development/libraries/dlib/default.nix4
-rw-r--r--pkgs/development/libraries/egl-wayland/default.nix79
-rw-r--r--pkgs/development/libraries/egl-wayland/eglmesaext.patch12
-rw-r--r--pkgs/development/libraries/enet/default.nix2
-rw-r--r--pkgs/development/libraries/exempi/default.nix3
-rw-r--r--pkgs/development/libraries/faudio/default.nix4
-rw-r--r--pkgs/development/libraries/fdk-aac/default.nix4
-rw-r--r--pkgs/development/libraries/ffmpeg-full/default.nix9
-rw-r--r--pkgs/development/libraries/ffmpeg/2.8.nix4
-rw-r--r--pkgs/development/libraries/ffmpeg/3.4.nix4
-rw-r--r--pkgs/development/libraries/ffmpeg/4.nix4
-rw-r--r--pkgs/development/libraries/ffmpeg/generic.nix16
-rw-r--r--pkgs/development/libraries/ffms/default.nix2
-rw-r--r--pkgs/development/libraries/flatpak/default.nix12
-rw-r--r--pkgs/development/libraries/fltk/1.4.nix8
-rw-r--r--pkgs/development/libraries/fltk/default.nix8
-rw-r--r--pkgs/development/libraries/folly/default.nix4
-rw-r--r--pkgs/development/libraries/fontconfig-ultimate/default.nix49
-rw-r--r--pkgs/development/libraries/fontconfig/make-fonts-cache.nix2
-rw-r--r--pkgs/development/libraries/forge/default.nix4
-rw-r--r--pkgs/development/libraries/fox/fox-1.6.nix4
-rw-r--r--pkgs/development/libraries/fplll/default.nix50
-rw-r--r--pkgs/development/libraries/freeglut/default.nix4
-rw-r--r--pkgs/development/libraries/freenect/default.nix4
-rw-r--r--pkgs/development/libraries/freetds/default.nix2
-rw-r--r--pkgs/development/libraries/fribidi/default.nix8
-rw-r--r--pkgs/development/libraries/ftgl/default.nix4
-rw-r--r--pkgs/development/libraries/gaia/default.nix87
-rw-r--r--pkgs/development/libraries/garmintools/default.nix3
-rw-r--r--pkgs/development/libraries/gcab/default.nix69
-rw-r--r--pkgs/development/libraries/gcab/installed-tests-path.patch21
-rw-r--r--pkgs/development/libraries/gcr/default.nix71
-rw-r--r--pkgs/development/libraries/gdal/2.4.0.nix9
-rw-r--r--pkgs/development/libraries/gdal/default.nix10
-rw-r--r--pkgs/development/libraries/gdk-pixbuf/default.nix11
-rw-r--r--pkgs/development/libraries/gdk-pixbuf/setup-hook.sh6
-rw-r--r--pkgs/development/libraries/gegl/4.0.nix3
-rw-r--r--pkgs/development/libraries/geoip/default.nix2
-rw-r--r--pkgs/development/libraries/gettext/CVE-2018-18751-bison.patch323
-rw-r--r--pkgs/development/libraries/gettext/default.nix28
-rw-r--r--pkgs/development/libraries/gettext/gettext-setup-hook.sh2
-rw-r--r--pkgs/development/libraries/gettext/gettext.git-2336451ed68d91ff4b5ae1acbc1eca30e47a86a9.patch82
-rw-r--r--pkgs/development/libraries/giflib/default.nix2
-rw-r--r--pkgs/development/libraries/gjs/default.nix86
-rw-r--r--pkgs/development/libraries/gle/default.nix4
-rw-r--r--pkgs/development/libraries/glfw/3.x.nix11
-rw-r--r--pkgs/development/libraries/glib-networking/default.nix2
-rw-r--r--pkgs/development/libraries/glib/default.nix4
-rw-r--r--pkgs/development/libraries/glib/setup-hook.sh8
-rw-r--r--pkgs/development/libraries/glibc/2.27-CVE-2019-19126.patch18
-rw-r--r--pkgs/development/libraries/glibc/common.nix5
-rw-r--r--pkgs/development/libraries/glm/default.nix2
-rw-r--r--pkgs/development/libraries/glog/default.nix11
-rw-r--r--pkgs/development/libraries/gloox/default.nix6
-rw-r--r--pkgs/development/libraries/glui/default.nix42
-rw-r--r--pkgs/development/libraries/gmime/3.nix4
-rw-r--r--pkgs/development/libraries/gmp/6.x.nix4
-rw-r--r--pkgs/development/libraries/gnu-efi/default.nix14
-rw-r--r--pkgs/development/libraries/gnutls/default.nix4
-rw-r--r--pkgs/development/libraries/goffice/default.nix4
-rw-r--r--pkgs/development/libraries/gom/default.nix3
-rw-r--r--pkgs/development/libraries/gpgme/default.nix2
-rw-r--r--pkgs/development/libraries/graphene/default.nix2
-rw-r--r--pkgs/development/libraries/grib-api/default.nix20
-rw-r--r--pkgs/development/libraries/grpc/default.nix14
-rw-r--r--pkgs/development/libraries/gstreamer/bad/default.nix252
-rw-r--r--pkgs/development/libraries/gstreamer/base/default.nix176
-rw-r--r--pkgs/development/libraries/gstreamer/core/default.nix107
-rw-r--r--pkgs/development/libraries/gstreamer/core/setup-hook.sh2
-rw-r--r--pkgs/development/libraries/gstreamer/ges/default.nix65
-rw-r--r--pkgs/development/libraries/gstreamer/good/default.nix155
-rw-r--r--pkgs/development/libraries/gstreamer/legacy/gst-plugins-base/default.nix6
-rw-r--r--pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh2
-rw-r--r--pkgs/development/libraries/gstreamer/libav/default.nix55
-rw-r--r--pkgs/development/libraries/gstreamer/rtsp-server/default.nix52
-rw-r--r--pkgs/development/libraries/gstreamer/ugly/default.nix85
-rw-r--r--pkgs/development/libraries/gstreamer/vaapi/default.nix83
-rw-r--r--pkgs/development/libraries/gstreamer/validate/default.nix46
-rw-r--r--pkgs/development/libraries/gtest/default.nix4
-rw-r--r--pkgs/development/libraries/gtk-engine-bluecurve/default.nix21
-rw-r--r--pkgs/development/libraries/gtk-engine-murrine/default.nix21
-rw-r--r--pkgs/development/libraries/gtk-engines/default.nix19
-rw-r--r--pkgs/development/libraries/gtk/hooks/drop-icon-theme-cache.sh2
-rw-r--r--pkgs/development/libraries/gtkspell/3.nix2
-rw-r--r--pkgs/development/libraries/gvfs/default.nix4
-rw-r--r--pkgs/development/libraries/harfbuzz/default.nix4
-rw-r--r--pkgs/development/libraries/hunspell/default.nix2
-rw-r--r--pkgs/development/libraries/hyphen/default.nix27
-rw-r--r--pkgs/development/libraries/icu/base.nix12
-rw-r--r--pkgs/development/libraries/ilmbase/default.nix16
-rw-r--r--pkgs/development/libraries/incrtcl/default.nix6
-rw-r--r--pkgs/development/libraries/intel-gmmlib/default.nix4
-rw-r--r--pkgs/development/libraries/intel-media-sdk/default.nix6
-rw-r--r--pkgs/development/libraries/irrlicht/default.nix4
-rw-r--r--pkgs/development/libraries/jasper/default.nix5
-rwxr-xr-xpkgs/development/libraries/java/hsqldb/builder.sh6
-rw-r--r--pkgs/development/libraries/java/hsqldb/default.nix36
-rw-r--r--pkgs/development/libraries/java/smack/default.nix2
-rw-r--r--pkgs/development/libraries/java/swt/default.nix4
-rw-r--r--pkgs/development/libraries/jbig2dec/default.nix6
-rw-r--r--pkgs/development/libraries/jitterentropy/default.nix3
-rw-r--r--pkgs/development/libraries/jsoncpp/default.nix14
-rw-r--r--pkgs/development/libraries/kde-frameworks/default.nix5
-rw-r--r--pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh4
-rw-r--r--pkgs/development/libraries/kde-frameworks/fetch.sh2
-rw-r--r--pkgs/development/libraries/kde-frameworks/kcalendarcore.nix16
-rw-r--r--pkgs/development/libraries/kde-frameworks/ki18n.nix4
-rw-r--r--pkgs/development/libraries/kde-frameworks/kio/default.nix1
-rw-r--r--pkgs/development/libraries/kde-frameworks/kwindowsystem/platform-plugins-path.patch16
-rw-r--r--pkgs/development/libraries/kde-frameworks/srcs.nix648
-rw-r--r--pkgs/development/libraries/khronos-ocl-icd-loader/default.nix26
-rw-r--r--pkgs/development/libraries/khronos-ocl-icd-loader/tracing.patch13
-rw-r--r--pkgs/development/libraries/ldns/default.nix37
-rw-r--r--pkgs/development/libraries/leatherman/default.nix4
-rw-r--r--pkgs/development/libraries/leptonica/default.nix4
-rw-r--r--pkgs/development/libraries/libaal/default.nix2
-rw-r--r--pkgs/development/libraries/libagar/default.nix6
-rw-r--r--pkgs/development/libraries/libao/default.nix2
-rw-r--r--pkgs/development/libraries/libappindicator/default.nix38
-rw-r--r--pkgs/development/libraries/libcdaudio/default.nix2
-rw-r--r--pkgs/development/libraries/libcec/default.nix5
-rw-r--r--pkgs/development/libraries/libcerf/default.nix15
-rw-r--r--pkgs/development/libraries/libco-canonical/default.nix15
-rw-r--r--pkgs/development/libraries/libdigidocpp/default.nix4
-rw-r--r--pkgs/development/libraries/libebml/default.nix4
-rw-r--r--pkgs/development/libraries/libexif/default.nix25
-rw-r--r--pkgs/development/libraries/libextractor/default.nix6
-rw-r--r--pkgs/development/libraries/libffi/3.2.1-cygwin.patch10
-rw-r--r--pkgs/development/libraries/libffi/default.nix48
-rw-r--r--pkgs/development/libraries/libfido2/default.nix6
-rw-r--r--pkgs/development/libraries/libfilezilla/default.nix4
-rw-r--r--pkgs/development/libraries/libfprint/default.nix40
-rw-r--r--pkgs/development/libraries/libftdi/1.x.nix6
-rw-r--r--pkgs/development/libraries/libgcrypt/default.nix3
-rw-r--r--pkgs/development/libraries/libgdata/default.nix2
-rw-r--r--pkgs/development/libraries/libglvnd/default.nix16
-rw-r--r--pkgs/development/libraries/libgnomekbd/default.nix20
-rw-r--r--pkgs/development/libraries/libgnurl/default.nix6
-rw-r--r--pkgs/development/libraries/libgpg-error/default.nix2
-rw-r--r--pkgs/development/libraries/libgpod/default.nix14
-rw-r--r--pkgs/development/libraries/libgudev/default.nix1
-rw-r--r--pkgs/development/libraries/libhandy/default.nix4
-rw-r--r--pkgs/development/libraries/libheif/default.nix6
-rw-r--r--pkgs/development/libraries/libical/default.nix4
-rw-r--r--pkgs/development/libraries/libicns/default.nix18
-rw-r--r--pkgs/development/libraries/libiconv/setup-hook.sh2
-rw-r--r--pkgs/development/libraries/libid3tag/default.nix2
-rw-r--r--pkgs/development/libraries/libidn2/default.nix4
-rw-r--r--pkgs/development/libraries/libindicate/default.nix66
-rw-r--r--pkgs/development/libraries/libinput/default.nix5
-rw-r--r--pkgs/development/libraries/libisds/default.nix34
-rw-r--r--pkgs/development/libraries/libisoburn/default.nix4
-rw-r--r--pkgs/development/libraries/liblouis/default.nix4
-rw-r--r--pkgs/development/libraries/libmad/001-mips_removal_h_constraint.patch73
-rw-r--r--pkgs/development/libraries/libmad/default.nix56
-rw-r--r--pkgs/development/libraries/libmad/optimize.diff77
-rw-r--r--pkgs/development/libraries/libmad/pkgconfig.patch117
-rw-r--r--pkgs/development/libraries/libmaxminddb/default.nix4
-rw-r--r--pkgs/development/libraries/libmbim/default.nix4
-rw-r--r--pkgs/development/libraries/libmicrohttpd/default.nix4
-rw-r--r--pkgs/development/libraries/libminc/default.nix11
-rw-r--r--pkgs/development/libraries/libmodule/default.nix4
-rw-r--r--pkgs/development/libraries/libmpeg2/default.nix2
-rw-r--r--pkgs/development/libraries/libmypaint/default.nix8
-rw-r--r--pkgs/development/libraries/libndctl/default.nix4
-rw-r--r--pkgs/development/libraries/libnftnl/default.nix4
-rw-r--r--pkgs/development/libraries/libngspice/default.nix4
-rw-r--r--pkgs/development/libraries/libnice/default.nix53
-rw-r--r--pkgs/development/libraries/libnotify/default.nix27
-rw-r--r--pkgs/development/libraries/libofx/default.nix24
-rw-r--r--pkgs/development/libraries/libosmium/default.nix4
-rw-r--r--pkgs/development/libraries/libowfat/default.nix1
-rw-r--r--pkgs/development/libraries/libplacebo/default.nix6
-rw-r--r--pkgs/development/libraries/libpng/12.nix2
-rw-r--r--pkgs/development/libraries/libpng/default.nix2
-rw-r--r--pkgs/development/libraries/libpsl/default.nix42
-rw-r--r--pkgs/development/libraries/libpwquality/default.nix4
-rw-r--r--pkgs/development/libraries/libqalculate/default.nix4
-rw-r--r--pkgs/development/libraries/libraspberrypi/default.nix25
-rw-r--r--pkgs/development/libraries/libraw/default.nix7
-rw-r--r--pkgs/development/libraries/libre/default.nix3
-rw-r--r--pkgs/development/libraries/librealsense/default.nix16
-rw-r--r--pkgs/development/libraries/librem/default.nix3
-rw-r--r--pkgs/development/libraries/librsvg/default.nix4
-rw-r--r--pkgs/development/libraries/libsearpc/default.nix4
-rw-r--r--pkgs/development/libraries/libseccomp/default.nix4
-rw-r--r--pkgs/development/libraries/libsecret/default.nix4
-rw-r--r--pkgs/development/libraries/libsexy/default.nix24
-rw-r--r--pkgs/development/libraries/libsolv/default.nix5
-rw-r--r--pkgs/development/libraries/libsoup/default.nix4
-rw-r--r--pkgs/development/libraries/libspectrum/default.nix24
-rw-r--r--pkgs/development/libraries/libtcod/default.nix4
-rw-r--r--pkgs/development/libraries/libtermkey/default.nix7
-rw-r--r--pkgs/development/libraries/libtiff/CVE-2019-14973.patch384
-rw-r--r--pkgs/development/libraries/libtiff/default.nix14
-rw-r--r--pkgs/development/libraries/libtommath/default.nix4
-rw-r--r--pkgs/development/libraries/libtoxcore/default.nix6
-rw-r--r--pkgs/development/libraries/libtxc_dxtn/default.nix4
-rw-r--r--pkgs/development/libraries/libtxc_dxtn_s2tc/default.nix4
-rw-r--r--pkgs/development/libraries/liburing/default.nix2
-rw-r--r--pkgs/development/libraries/libusb1/default.nix9
-rw-r--r--pkgs/development/libraries/libuv/default.nix4
-rw-r--r--pkgs/development/libraries/libvirt-glib/default.nix4
-rw-r--r--pkgs/development/libraries/libvncserver/default.nix40
-rw-r--r--pkgs/development/libraries/libvorbis/default.nix1
-rw-r--r--pkgs/development/libraries/libvterm-neovim/default.nix6
-rw-r--r--pkgs/development/libraries/libwebp/default.nix6
-rw-r--r--pkgs/development/libraries/libwmf/default.nix2
-rw-r--r--pkgs/development/libraries/libxl/default.nix10
-rw-r--r--pkgs/development/libraries/libxml2/default.nix31
-rw-r--r--pkgs/development/libraries/libxml2/utf8-xmlErrorFuncHandler.patch30
-rw-r--r--pkgs/development/libraries/libxmlb/default.nix2
-rw-r--r--pkgs/development/libraries/libxslt/default.nix32
-rw-r--r--pkgs/development/libraries/libzip/default.nix24
-rw-r--r--pkgs/development/libraries/lightstep-tracer-cpp/default.nix39
-rw-r--r--pkgs/development/libraries/linbox/default.nix2
-rw-r--r--pkgs/development/libraries/liquidfun/default.nix4
-rw-r--r--pkgs/development/libraries/live555/default.nix4
-rw-r--r--pkgs/development/libraries/mapnik/default.nix2
-rw-r--r--pkgs/development/libraries/mbedtls/1.3.nix34
-rw-r--r--pkgs/development/libraries/mediastreamer/default.nix18
-rw-r--r--pkgs/development/libraries/mediastreamer/msopenh264.nix23
-rw-r--r--pkgs/development/libraries/mesa/default.nix4
-rw-r--r--pkgs/development/libraries/mesa/stubs.nix4
-rw-r--r--pkgs/development/libraries/mimalloc/default.nix34
-rw-r--r--pkgs/development/libraries/minizip/default.nix1
-rw-r--r--pkgs/development/libraries/mpich/default.nix4
-rw-r--r--pkgs/development/libraries/muparser/default.nix8
-rw-r--r--pkgs/development/libraries/mygui/default.nix5
-rw-r--r--pkgs/development/libraries/nanoflann/default.nix12
-rw-r--r--pkgs/development/libraries/nco/default.nix13
-rw-r--r--pkgs/development/libraries/ncurses/default.nix1
-rw-r--r--pkgs/development/libraries/ndi/default.nix60
-rw-r--r--pkgs/development/libraries/netcdf/default.nix11
-rw-r--r--pkgs/development/libraries/nghttp2/default.nix13
-rw-r--r--pkgs/development/libraries/nlohmann_json/default.nix8
-rw-r--r--pkgs/development/libraries/nspr/default.nix4
-rw-r--r--pkgs/development/libraries/nss/default.nix7
-rw-r--r--pkgs/development/libraries/nss_wrapper/default.nix4
-rw-r--r--pkgs/development/libraries/ntl/default.nix4
-rw-r--r--pkgs/development/libraries/nuspell/default.nix4
-rw-r--r--pkgs/development/libraries/ogre/1.10.x.nix4
-rw-r--r--pkgs/development/libraries/ogre/1.9.x.nix4
-rw-r--r--pkgs/development/libraries/ogre/default.nix4
-rw-r--r--pkgs/development/libraries/olm/default.nix20
-rw-r--r--pkgs/development/libraries/oniguruma/default.nix2
-rw-r--r--pkgs/development/libraries/onnxruntime/default.nix9
-rw-r--r--pkgs/development/libraries/openal-soft/default.nix8
-rw-r--r--pkgs/development/libraries/openal-soft/search-out.patch12
-rw-r--r--pkgs/development/libraries/openbabel/default.nix2
-rw-r--r--pkgs/development/libraries/openbsm/default.nix3
-rw-r--r--pkgs/development/libraries/opencolorio/default.nix2
-rw-r--r--pkgs/development/libraries/opencsg/default.nix4
-rw-r--r--pkgs/development/libraries/opencv/3.x.nix8
-rw-r--r--pkgs/development/libraries/opencv/4.x.nix2
-rw-r--r--pkgs/development/libraries/opencv/default.nix2
-rw-r--r--pkgs/development/libraries/openexr/default.nix12
-rw-r--r--pkgs/development/libraries/openexrid-unstable/default.nix4
-rw-r--r--pkgs/development/libraries/openh264/default.nix16
-rw-r--r--pkgs/development/libraries/openscenegraph/default.nix6
-rw-r--r--pkgs/development/libraries/ortp/default.nix9
-rw-r--r--pkgs/development/libraries/p11-kit/default.nix4
-rw-r--r--pkgs/development/libraries/pango/default.nix23
-rw-r--r--pkgs/development/libraries/pangox-compat/default.nix21
-rw-r--r--pkgs/development/libraries/partio/default.nix4
-rw-r--r--pkgs/development/libraries/pcaudiolib/default.nix8
-rw-r--r--pkgs/development/libraries/pcre/default.nix2
-rw-r--r--pkgs/development/libraries/pcre2/default.nix4
-rw-r--r--pkgs/development/libraries/phonon/backends/gstreamer.nix41
-rw-r--r--pkgs/development/libraries/phonon/backends/vlc.nix45
-rw-r--r--pkgs/development/libraries/phonon/default.nix59
-rw-r--r--pkgs/development/libraries/physics/apfel/default.nix4
-rw-r--r--pkgs/development/libraries/physics/applgrid/default.nix5
-rw-r--r--pkgs/development/libraries/physics/fastjet-contrib/default.nix40
-rw-r--r--pkgs/development/libraries/physics/geant4/default.nix4
-rw-r--r--pkgs/development/libraries/physics/herwig/default.nix20
-rw-r--r--pkgs/development/libraries/physics/pythia/default.nix4
-rw-r--r--pkgs/development/libraries/physics/qcdnum/default.nix3
-rw-r--r--pkgs/development/libraries/physics/rivet/default.nix6
-rw-r--r--pkgs/development/libraries/physics/thepeg/default.nix14
-rw-r--r--pkgs/development/libraries/plib/default.nix4
-rw-r--r--pkgs/development/libraries/polkit/default.nix12
-rw-r--r--pkgs/development/libraries/poppler/default.nix14
-rw-r--r--pkgs/development/libraries/precice/default.nix33
-rw-r--r--pkgs/development/libraries/prometheus-cpp/default.nix4
-rw-r--r--pkgs/development/libraries/protobuf/3.11.nix6
-rw-r--r--pkgs/development/libraries/protolock/default.nix6
-rw-r--r--pkgs/development/libraries/pybind11/default.nix47
-rw-r--r--pkgs/development/libraries/pybind11/no_test_cmake_build.patch7
-rw-r--r--pkgs/development/libraries/qgnomeplatform/default.nix17
-rw-r--r--pkgs/development/libraries/qpdf/default.nix4
-rw-r--r--pkgs/development/libraries/qt-3/default.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.11/fetch.sh1
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtbase-fixguicmake.patch30
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtbase.patch1106
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtdeclarative.patch46
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtscript.patch13
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtserialport.patch22
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qttools.patch86
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-no-platform-check.patch37
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtwebengine-no-build-skip.patch12
-rw-r--r--pkgs/development/libraries/qt-5/5.11/qtwebkit.patch12
-rw-r--r--pkgs/development/libraries/qt-5/5.11/srcs.nix325
-rw-r--r--pkgs/development/libraries/qt-5/5.12/default.nix1
-rw-r--r--pkgs/development/libraries/qt-5/5.12/fetch.sh2
-rw-r--r--pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0001-qtbase-mkspecs-mac.patch41
-rw-r--r--pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0013-define-kiosurfacesuccess.patch16
-rw-r--r--pkgs/development/libraries/qt-5/5.12/srcs.nix320
-rw-r--r--pkgs/development/libraries/qt-5/5.9/default.nix179
-rw-r--r--pkgs/development/libraries/qt-5/5.9/fetch.sh1
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qtbase-fixguicmake.patch30
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qtbase-openssl_1_1.patch3985
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qtbase.patch1119
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qtdeclarative.patch33
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qtscript.patch13
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qtserialport.patch22
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qttools.patch71
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qtwebengine-clang-fix.patch38
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qtwebengine-darwin-no-platform-check.patch50
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qtwebengine-no-build-skip.patch12
-rw-r--r--pkgs/development/libraries/qt-5/5.9/qtwebkit.patch64
-rw-r--r--pkgs/development/libraries/qt-5/5.9/srcs.nix333
-rw-r--r--pkgs/development/libraries/qt-5/hooks/qmake-hook.sh4
-rw-r--r--pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh4
-rw-r--r--pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh8
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtbase.nix2
-rw-r--r--pkgs/development/libraries/qtkeychain/0002-Fix-install-name-Darwin.patch10
-rw-r--r--pkgs/development/libraries/qtkeychain/default.nix2
-rw-r--r--pkgs/development/libraries/qtpbfimageplugin/default.nix8
-rw-r--r--pkgs/development/libraries/quesoglc/default.nix4
-rw-r--r--pkgs/development/libraries/rabbitmq-c/default.nix4
-rw-r--r--pkgs/development/libraries/randomx/default.nix24
-rw-r--r--pkgs/development/libraries/range-v3/default.nix4
-rw-r--r--pkgs/development/libraries/rdkafka/default.nix4
-rw-r--r--pkgs/development/libraries/rnnoise/default.nix23
-rw-r--r--pkgs/development/libraries/rocksdb/default.nix33
-rw-r--r--pkgs/development/libraries/schroedinger/default.nix8
-rw-r--r--pkgs/development/libraries/science/biology/elastix/default.nix15
-rw-r--r--pkgs/development/libraries/science/biology/nifticlib/default.nix2
-rw-r--r--pkgs/development/libraries/science/math/QuadProgpp/default.nix2
-rw-r--r--pkgs/development/libraries/science/math/brial/default.nix4
-rw-r--r--pkgs/development/libraries/science/math/caffe2/default.nix2
-rw-r--r--pkgs/development/libraries/science/math/cudnn/default.nix11
-rw-r--r--pkgs/development/libraries/science/math/liblapack/default.nix17
-rw-r--r--pkgs/development/libraries/science/math/mkl/default.nix1
-rw-r--r--pkgs/development/libraries/science/math/or-tools/default.nix2
-rw-r--r--pkgs/development/libraries/science/math/scalapack/default.nix15
-rw-r--r--pkgs/development/libraries/science/math/scalapack/openmpi4.patch143
-rw-r--r--pkgs/development/libraries/sentencepiece/default.nix31
-rw-r--r--pkgs/development/libraries/silgraphite/graphite2.nix6
-rw-r--r--pkgs/development/libraries/simgear/default.nix4
-rw-r--r--pkgs/development/libraries/simpleitk/default.nix4
-rw-r--r--pkgs/development/libraries/slang/default.nix2
-rw-r--r--pkgs/development/libraries/smarty3/default.nix4
-rw-r--r--pkgs/development/libraries/smpeg/default.nix4
-rw-r--r--pkgs/development/libraries/snappy/default.nix2
-rw-r--r--pkgs/development/libraries/sonic/default.nix10
-rw-r--r--pkgs/development/libraries/soxt/default.nix4
-rw-r--r--pkgs/development/libraries/spandsp/default.nix1
-rw-r--r--pkgs/development/libraries/sphinxbase/default.nix2
-rw-r--r--pkgs/development/libraries/sundials/default.nix16
-rw-r--r--pkgs/development/libraries/sundials/tests-parallel.patch45
-rw-r--r--pkgs/development/libraries/tcllib/default.nix4
-rw-r--r--pkgs/development/libraries/tdb/default.nix4
-rw-r--r--pkgs/development/libraries/tepl/default.nix4
-rw-r--r--pkgs/development/libraries/tiledb/default.nix76
-rw-r--r--pkgs/development/libraries/tpm2-tss/default.nix4
-rw-r--r--pkgs/development/libraries/tre/default.nix2
-rw-r--r--pkgs/development/libraries/unixODBCDrivers/default.nix35
-rw-r--r--pkgs/development/libraries/vaapi-intel/default.nix9
-rw-r--r--pkgs/development/libraries/vaapi-vdpau/default.nix4
-rw-r--r--pkgs/development/libraries/vrpn/default.nix4
-rw-r--r--pkgs/development/libraries/vtk/default.nix6
-rw-r--r--pkgs/development/libraries/webkitgtk/2.4.nix111
-rw-r--r--pkgs/development/libraries/webkitgtk/configure.patch20
-rw-r--r--pkgs/development/libraries/webkitgtk/default.nix199
-rw-r--r--pkgs/development/libraries/webkitgtk/fix-execinfo.patch20
-rw-r--r--pkgs/development/libraries/webkitgtk/libc++.patch20
-rw-r--r--pkgs/development/libraries/webkitgtk/libglvnd-headers.patch586
-rw-r--r--pkgs/development/libraries/webkitgtk/plugin-none.patch38
-rw-r--r--pkgs/development/libraries/webkitgtk/quartz-webcore.patch22
-rw-r--r--pkgs/development/libraries/webkitgtk/webcore-svg-libxml-cflags.patch8
-rw-r--r--pkgs/development/libraries/wlroots/default.nix11
-rw-r--r--pkgs/development/libraries/wt/default.nix8
-rw-r--r--pkgs/development/libraries/wxwidgets/3.0/default.nix9
-rw-r--r--pkgs/development/libraries/wxwidgets/3.1/default.nix9
-rw-r--r--pkgs/development/libraries/xapian/default.nix2
-rw-r--r--pkgs/development/libraries/xdg-desktop-portal/default.nix8
-rw-r--r--pkgs/development/libraries/xine-lib/default.nix4
-rw-r--r--pkgs/development/libraries/yajl/default.nix2
-rw-r--r--pkgs/development/libraries/zeitgeist/default.nix69
-rw-r--r--pkgs/development/libraries/zlib/default.nix2
455 files changed, 5056 insertions, 11594 deletions
diff --git a/pkgs/development/libraries/AntTweakBar/default.nix b/pkgs/development/libraries/AntTweakBar/default.nix
index 94b36b855f2..1ae6346cbe5 100644
--- a/pkgs/development/libraries/AntTweakBar/default.nix
+++ b/pkgs/development/libraries/AntTweakBar/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl, unzip, xorg, libGLU_combined }:
+{ stdenv, fetchurl, unzip, xorg, libGLU, libGL }:
 
 stdenv.mkDerivation {
   name = "AntTweakBar-1.16";
 
-  buildInputs = [ unzip xorg.libX11 libGLU_combined ];
+  buildInputs = [ unzip xorg.libX11 libGLU libGL ];
 
   src = fetchurl {
     url = "mirror://sourceforge/project/anttweakbar/AntTweakBar_116.zip";
diff --git a/pkgs/development/libraries/CGAL/4.nix b/pkgs/development/libraries/CGAL/4.nix
new file mode 100644
index 00000000000..60c244009ce
--- /dev/null
+++ b/pkgs/development/libraries/CGAL/4.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchFromGitHub, cmake, boost, gmp, mpfr }:
+
+stdenv.mkDerivation rec {
+  version = "4.14.2";
+  name = "cgal-" + version;
+
+  src = fetchFromGitHub {
+    owner = "CGAL";
+    repo = "releases";
+    rev = "CGAL-${version}";
+    sha256 = "1p1xyws2s9h2c8hlkz1af4ix48qma160av24by6lcm8al1g44pca";
+  };
+
+  # note: optional component libCGAL_ImageIO would need zlib and opengl;
+  #   there are also libCGAL_Qt{3,4} omitted ATM
+  buildInputs = [ boost gmp mpfr ];
+  nativeBuildInputs = [ cmake ];
+
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    description = "Computational Geometry Algorithms Library";
+    homepage = http://cgal.org;
+    license = with licenses; [ gpl3Plus lgpl3Plus];
+    platforms = platforms.all;
+    maintainers = [ maintainers.raskin ];
+  };
+}
diff --git a/pkgs/development/libraries/CGAL/default.nix b/pkgs/development/libraries/CGAL/default.nix
index 95984c97001..d2d74769a1f 100644
--- a/pkgs/development/libraries/CGAL/default.nix
+++ b/pkgs/development/libraries/CGAL/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchFromGitHub, cmake, boost, gmp, mpfr }:
 
 stdenv.mkDerivation rec {
-  version = "4.14";
+  version = "5.0";
   name = "cgal-" + version;
 
   src = fetchFromGitHub {
     owner = "CGAL";
     repo = "releases";
     rev = "CGAL-${version}";
-    sha256 = "0p0s1dl5a261zwy0hxa7ylkypk45rwc6n84lx507dwdhfz4ihv12";
+    sha256 = "15r631kddphw3wsvrxrkdbq9y7m0q8kx0kwc9zq97x6ksg3v0gs3";
   };
 
   # note: optional component libCGAL_ImageIO would need zlib and opengl;
diff --git a/pkgs/development/libraries/SDL/setup-hook.sh b/pkgs/development/libraries/SDL/setup-hook.sh
index e8f96fdd1ac..553e8553a77 100644
--- a/pkgs/development/libraries/SDL/setup-hook.sh
+++ b/pkgs/development/libraries/SDL/setup-hook.sh
@@ -1,7 +1,9 @@
 addSDLPath () {
   if [ -e "$1/include/SDL" ]; then
-    export SDL_PATH="$SDL_PATH $1/include/SDL"
-    export SDL_LIB_PATH="$SDL_LIB_PATH -L$1/lib"
+    export SDL_PATH="${SDL_PATH-}${SDL_PATH:+ }$1/include/SDL"
+  fi
+  if [ -e "$1/lib" ]; then
+    export SDL_LIB_PATH="${SDL_LIB_PATH-}${SDL_LIB_PATH:+ }-L$1/lib"
   fi
 }
 
diff --git a/pkgs/development/libraries/SDL2/default.nix b/pkgs/development/libraries/SDL2/default.nix
index 8fe6bbe6113..e02ea05a726 100644
--- a/pkgs/development/libraries/SDL2/default.nix
+++ b/pkgs/development/libraries/SDL2/default.nix
@@ -75,9 +75,21 @@ stdenv.mkDerivation rec {
     ++ optional alsaSupport "--with-alsa-prefix=${alsaLib.out}/lib"
     ++ optional stdenv.isDarwin "--disable-sdltest";
 
+  # We remove libtool .la files when static libs are requested,
+  # because they make the builds of downstream libs like `SDL_tff`
+  # fail with `cannot find -lXext, `-lXcursor` etc. linker errors
+  # because the `.la` files are not pruned if static libs exist
+  # (see https://github.com/NixOS/nixpkgs/commit/fd97db43bcb05e37f6bb77f363f1e1e239d9de53)
+  # and they also don't carry the necessary `-L` paths of their
+  # X11 dependencies.
+  # For static linking, it is better to rely on `pkg-config` `.pc`
+  # files.
   postInstall = ''
-    moveToOutput lib/libSDL2main.a "$dev"
-    rm $out/lib/*.a
+    if [ "$dontDisableStatic" -eq "1" ]; then
+      rm $out/lib/*.la
+    else
+      rm $out/lib/*.a
+    fi
     moveToOutput bin/sdl2-config "$dev"
   '';
 
diff --git a/pkgs/development/libraries/SDL2/setup-hook.sh b/pkgs/development/libraries/SDL2/setup-hook.sh
index 3acce9d473c..0119926491a 100644
--- a/pkgs/development/libraries/SDL2/setup-hook.sh
+++ b/pkgs/development/libraries/SDL2/setup-hook.sh
@@ -1,6 +1,6 @@
 addSDL2Path () {
   if [ -e "$1/include/SDL2" ]; then
-    export SDL2_PATH="$SDL2_PATH $1/include/SDL2"
+    export SDL2_PATH="${SDL2_PATH-}${SDL2_PATH:+ }$1/include/SDL2"
   fi
 }
 
diff --git a/pkgs/development/libraries/ace/default.nix b/pkgs/development/libraries/ace/default.nix
index 04ab1331475..ea352772b33 100644
--- a/pkgs/development/libraries/ace/default.nix
+++ b/pkgs/development/libraries/ace/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "ace";
-  version = "6.5.6";
+  version = "6.5.7";
 
   src = fetchurl {
     url = "http://download.dre.vanderbilt.edu/previous_versions/ACE-${version}.tar.bz2";
-    sha256 = "15lfjc8r854hvjfvimhnqc3987b3cdngilhkii9rwpzginbyipi4";
+    sha256 = "0hvd7y3hs8r3r7qbllfaqrva3jrx5razcnwlws822k66v4r10cbx";
   };
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/agda/Agda-Sheaves/default.nix b/pkgs/development/libraries/agda/Agda-Sheaves/default.nix
index 6ab7455915c..62856157b4b 100644
--- a/pkgs/development/libraries/agda/Agda-Sheaves/default.nix
+++ b/pkgs/development/libraries/agda/Agda-Sheaves/default.nix
@@ -18,7 +18,7 @@ agda.mkDerivation (self: rec {
     description = "Sheaves in Agda";
     license = stdenv.lib.licenses.cc-by-40;
     platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
+    maintainers = with stdenv.lib.maintainers; [ ];
     broken = true;  # replaced by constructive-sheaf-semantics
   };
 })
diff --git a/pkgs/development/libraries/agda/TotalParserCombinators/default.nix b/pkgs/development/libraries/agda/TotalParserCombinators/default.nix
index ac9ce9dd84f..344da00d04f 100644
--- a/pkgs/development/libraries/agda/TotalParserCombinators/default.nix
+++ b/pkgs/development/libraries/agda/TotalParserCombinators/default.nix
@@ -20,7 +20,7 @@ agda.mkDerivation (self: rec {
     description = "A monadic parser combinator library which guarantees termination of parsing";
     license = stdenv.lib.licenses.mit;
     platforms = stdenv.lib.platforms.unix;
-    maintainers = with maintainers; [ fuuzetsu ];
+    maintainers = with maintainers; [ ];
     broken = true;
   };
 })
diff --git a/pkgs/development/libraries/agda/agda-base/default.nix b/pkgs/development/libraries/agda/agda-base/default.nix
index 146e44182ed..1bc9d0cb882 100644
--- a/pkgs/development/libraries/agda/agda-base/default.nix
+++ b/pkgs/development/libraries/agda/agda-base/default.nix
@@ -17,7 +17,7 @@ agda.mkDerivation (self: rec {
     description = "Base library for HoTT in Agda";
     license = stdenv.lib.licenses.bsd3;
     platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
+    maintainers = with stdenv.lib.maintainers; [ ];
     broken = true;  # largely replaced by HoTT-Agda
   };
 })
diff --git a/pkgs/development/libraries/agda/agda-iowa-stdlib/default.nix b/pkgs/development/libraries/agda/agda-iowa-stdlib/default.nix
index e2d64841985..30a03980e44 100644
--- a/pkgs/development/libraries/agda/agda-iowa-stdlib/default.nix
+++ b/pkgs/development/libraries/agda/agda-iowa-stdlib/default.nix
@@ -22,6 +22,6 @@ agda.mkDerivation (self: rec {
     description = "Agda standard library developed at Iowa";
     license = stdenv.lib.licenses.free;
     platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
+    maintainers = with stdenv.lib.maintainers; [ ];
   };
 })
diff --git a/pkgs/development/libraries/agda/agda-prelude/default.nix b/pkgs/development/libraries/agda/agda-prelude/default.nix
index a57ee6e08ba..bcdad18bede 100644
--- a/pkgs/development/libraries/agda/agda-prelude/default.nix
+++ b/pkgs/development/libraries/agda/agda-prelude/default.nix
@@ -18,6 +18,6 @@ agda.mkDerivation (self: rec {
     description = "Programming library for Agda";
     license = stdenv.lib.licenses.mit;
     platforms = stdenv.lib.platforms.unix;
-    maintainers = with maintainers; [ fuuzetsu mudri ];
+    maintainers = with maintainers; [ mudri ];
   };
 })
diff --git a/pkgs/development/libraries/agda/agda-stdlib/default.nix b/pkgs/development/libraries/agda/agda-stdlib/default.nix
index 4d071251ee8..033ba67f661 100644
--- a/pkgs/development/libraries/agda/agda-stdlib/default.nix
+++ b/pkgs/development/libraries/agda/agda-stdlib/default.nix
@@ -23,7 +23,6 @@ agda.mkDerivation (self: rec {
     description = "A standard library for use with the Agda compiler";
     license = stdenv.lib.licenses.mit;
     platforms = stdenv.lib.platforms.unix;
-    broken = stdenv.isDarwin;
-    maintainers = with maintainers; [ jwiegley fuuzetsu mudri ];
+    maintainers = with maintainers; [ jwiegley mudri ];
   };
 })
diff --git a/pkgs/development/libraries/agda/bitvector/default.nix b/pkgs/development/libraries/agda/bitvector/default.nix
index 6306bb89b5c..c09702c48d7 100644
--- a/pkgs/development/libraries/agda/bitvector/default.nix
+++ b/pkgs/development/libraries/agda/bitvector/default.nix
@@ -18,7 +18,7 @@ agda.mkDerivation (self: rec {
     description = "Sequences of bits and common operations on them";
     license = stdenv.lib.licenses.bsd3;
     platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
+    maintainers = with stdenv.lib.maintainers; [ ];
     broken = true;
   };
 })
diff --git a/pkgs/development/libraries/agda/categories/default.nix b/pkgs/development/libraries/agda/categories/default.nix
index ea232f2853d..a58afd7e866 100644
--- a/pkgs/development/libraries/agda/categories/default.nix
+++ b/pkgs/development/libraries/agda/categories/default.nix
@@ -18,7 +18,7 @@ agda.mkDerivation (self: rec {
     description = "Categories parametrized by morphism equality, in Agda";
     license = stdenv.lib.licenses.bsd3;
     platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
+    maintainers = with stdenv.lib.maintainers; [ ];
     broken = true; # doesn't work due to new agdastdlib, see #9471
   };
 })
diff --git a/pkgs/development/libraries/agda/pretty/default.nix b/pkgs/development/libraries/agda/pretty/default.nix
index 0e4f1da6e14..ffae1f6f900 100644
--- a/pkgs/development/libraries/agda/pretty/default.nix
+++ b/pkgs/development/libraries/agda/pretty/default.nix
@@ -20,7 +20,7 @@ agda.mkDerivation (self: rec {
     description = "Correct-by-Construction Pretty-Printing";
     license = stdenv.lib.licenses.mit;
     platforms = stdenv.lib.platforms.unix;
-    maintainers = with maintainers; [ fuuzetsu ];
+    maintainers = with maintainers; [ ];
     broken = true; # 2018-04-11
   };
 })
diff --git a/pkgs/development/libraries/allegro/5.nix b/pkgs/development/libraries/allegro/5.nix
index b267c62d6c7..5f5368f2866 100644
--- a/pkgs/development/libraries/allegro/5.nix
+++ b/pkgs/development/libraries/allegro/5.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchFromGitHub, fetchpatch, texinfo, libXext, xorgproto, libX11
 , libXpm, libXt, libXcursor, alsaLib, cmake, zlib, libpng, libvorbis
 , libXxf86dga, libXxf86misc
-, libXxf86vm, openal, libGLU_combined, libjpeg, flac
+, libXxf86vm, openal, libGLU, libGL, libjpeg, flac
 , libXi, libXfixes, freetype, libopus, libtheora
 , physfs, enet, pkgconfig, gtk2, pcre, libpulseaudio, libpthreadstubs
 , libXdmcp
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   buildInputs = [
     texinfo libXext xorgproto libX11 libXpm libXt libXcursor
     alsaLib cmake zlib libpng libvorbis libXxf86dga libXxf86misc
-    libXxf86vm openal libGLU_combined
+    libXxf86vm openal libGLU libGL
     libjpeg flac
     libXi libXfixes
     enet libtheora freetype physfs libopus pkgconfig gtk2 pcre libXdmcp
diff --git a/pkgs/development/libraries/allegro/default.nix b/pkgs/development/libraries/allegro/default.nix
index 6b44ec1b598..64488b25b09 100644
--- a/pkgs/development/libraries/allegro/default.nix
+++ b/pkgs/development/libraries/allegro/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, texinfo, libXext, xorgproto, libX11
 , libXpm, libXt, libXcursor, alsaLib, cmake, zlib, libpng, libvorbis
 , libXxf86dga, libXxf86misc
-, libXxf86vm, openal, libGLU_combined }:
+, libXxf86vm, openal, libGLU, libGL }:
 
 stdenv.mkDerivation rec {
   pname = "allegro";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   buildInputs = [
     texinfo libXext xorgproto libX11 libXpm libXt libXcursor
     alsaLib cmake zlib libpng libvorbis libXxf86dga libXxf86misc
-    libXxf86vm openal libGLU_combined
+    libXxf86vm openal libGLU libGL
   ];
 
   hardeningDisable = [ "format" ];
diff --git a/pkgs/development/libraries/aqbanking/libchipcard.nix b/pkgs/development/libraries/aqbanking/libchipcard.nix
index 23c300ab48a..32ec4dd06fd 100644
--- a/pkgs/development/libraries/aqbanking/libchipcard.nix
+++ b/pkgs/development/libraries/aqbanking/libchipcard.nix
@@ -25,7 +25,7 @@ in stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "Library for access to chipcards";
-    homepage = http://www2.aquamaniac.de/sites/download/packages.php?package=02&showall=1;
+    homepage = "https://www.aquamaniac.de/rdm/projects/libchipcard";
     license = licenses.lgpl21;
     maintainers = with maintainers; [ aszlig ];
     platforms = platforms.linux;
diff --git a/pkgs/development/libraries/arb/default.nix b/pkgs/development/libraries/arb/default.nix
index 0e24d556b1a..6393e25f561 100644
--- a/pkgs/development/libraries/arb/default.nix
+++ b/pkgs/development/libraries/arb/default.nix
@@ -1,12 +1,12 @@
 {stdenv, fetchFromGitHub, mpir, gmp, mpfr, flint}:
 stdenv.mkDerivation rec {
   pname = "arb";
-  version = "2.16.0";
+  version = "2.17.0";
   src = fetchFromGitHub {
     owner = "fredrik-johansson";
     repo = pname;
     rev = version;
-    sha256 = "0478671wfwy3gl26sbxh1jq1ih36z4k72waa8y2y2lvn649gb7cd";
+    sha256 = "05lpy3hkl5f8ik19aw40cqydrb932xaf2n8hbq9ib5dnk7f010p1";
   };
   buildInputs = [mpir gmp mpfr flint];
   configureFlags = [
@@ -19,6 +19,7 @@ stdenv.mkDerivation rec {
   meta = with stdenv.lib; {
     inherit version;
     description = ''A library for arbitrary-precision interval arithmetic'';
+    homepage = "http://arblib.org/";
     license = stdenv.lib.licenses.lgpl21Plus;
     maintainers = with maintainers; [ raskin timokau ];
     platforms = stdenv.lib.platforms.unix;
diff --git a/pkgs/development/libraries/argp-standalone/default.nix b/pkgs/development/libraries/argp-standalone/default.nix
index 17093deae00..8fe3bd287c1 100644
--- a/pkgs/development/libraries/argp-standalone/default.nix
+++ b/pkgs/development/libraries/argp-standalone/default.nix
@@ -43,6 +43,8 @@ stdenv.mkDerivation {
 
   doCheck = true;
 
+  makeFlags = [ "AR:=$(AR)" ];
+
   enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/armadillo/default.nix b/pkgs/development/libraries/armadillo/default.nix
index a74e883dca5..8dec9827141 100644
--- a/pkgs/development/libraries/armadillo/default.nix
+++ b/pkgs/development/libraries/armadillo/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "armadillo";
-  version = "9.800.1";
+  version = "9.800.3";
 
   src = fetchurl {
     url = "mirror://sourceforge/arma/armadillo-${version}.tar.xz";
-    sha256 = "1vnshgkz4d992kk2fwqigqfx7gx3145ryb8d2794hn2667h5gkzb";
+    sha256 = "16bm1pa5a8wsk497y9s18dyi3hax03z6g2x2z19b6z0bi3ff30d4";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/arrayfire/default.nix b/pkgs/development/libraries/arrayfire/default.nix
index 17f43a9ddfa..21e93a8cd49 100644
--- a/pkgs/development/libraries/arrayfire/default.nix
+++ b/pkgs/development/libraries/arrayfire/default.nix
@@ -1,36 +1,16 @@
 { stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig
 , cudatoolkit, opencl-clhpp, ocl-icd, fftw, fftwFloat, mkl
-, blas, openblas, boost, mesa, libGLU_combined
-, freeimage, python
+, blas, openblas, boost, mesa, libGLU, libGL
+, freeimage, python, clfft, clblas
+, doxygen, buildDocs ? false
 }:
 
 let
-  version = "3.6.4";
-
-  clfftSource = fetchFromGitHub {
-    owner = "arrayfire";
-    repo = "clFFT";
-    rev = "16925fb93338b3cac66490b5cf764953d6a5dac7";
-    sha256 = "0y35nrdz7w4n1l17myhkni3hwm37z775xn6f76xmf1ph7dbkslsc";
-    fetchSubmodules = true;
-  };
-
-  clblasSource = fetchFromGitHub {
-    owner = "arrayfire";
-    repo = "clBLAS";
-    rev = "1f3de2ae5582972f665c685b18ef0df43c1792bb";
-    sha256 = "154mz52r5hm0jrp5fqrirzzbki14c1jkacj75flplnykbl36ibjs";
-    fetchSubmodules = true;
-  };
-
-  cl2hppSource = fetchurl {
-    url = "https://github.com/KhronosGroup/OpenCL-CLHPP/releases/download/v2.0.10/cl2.hpp";
-    sha256 = "1v4q0g6b6mwwsi0kn7kbjn749j3qafb9r4ld3zdq1163ln9cwnvw";
-  };
+  strOnLinux = stdenv.lib.optionalString stdenv.isLinux;
 
-in stdenv.mkDerivation {
+in stdenv.mkDerivation rec {
   pname = "arrayfire";
-  inherit version;
+  version = "3.6.4";
 
   src = fetchurl {
     url = "http://arrayfire.com/arrayfire_source/arrayfire-full-${version}.tar.bz2";
@@ -41,21 +21,21 @@ in stdenv.mkDerivation {
     "-DAF_BUILD_OPENCL=OFF"
     "-DAF_BUILD_EXAMPLES=OFF"
     "-DBUILD_TESTING=OFF"
-    "-DCMAKE_LIBRARY_PATH=${cudatoolkit}/lib/stubs"
+    (strOnLinux "-DCMAKE_LIBRARY_PATH=${cudatoolkit}/lib/stubs")
   ];
 
   patches = [ ./no-download.patch ];
 
   postPatch = ''
     mkdir -p ./build/third_party/clFFT/src
-    cp -R --no-preserve=mode,ownership ${clfftSource}/ ./build/third_party/clFFT/src/clFFT-ext/
+    cp -R --no-preserve=mode,ownership ${clfft.src}/ ./build/third_party/clFFT/src/clFFT-ext/
     mkdir -p ./build/third_party/clBLAS/src
-    cp -R --no-preserve=mode,ownership ${clblasSource}/ ./build/third_party/clBLAS/src/clBLAS-ext/
+    cp -R --no-preserve=mode,ownership ${clblas.src}/ ./build/third_party/clBLAS/src/clBLAS-ext/
     mkdir -p ./build/include/CL
-    cp -R --no-preserve=mode,ownership ${cl2hppSource} ./build/include/CL/cl2.hpp
+    cp -R --no-preserve=mode,ownership ${opencl-clhpp}/include/CL/cl2.hpp ./build/include/CL/cl2.hpp
   '';
 
-  preBuild = ''
+  preBuild = strOnLinux ''
     export CUDA_PATH="${cudatoolkit}"
   '';
 
@@ -64,23 +44,27 @@ in stdenv.mkDerivation {
   nativeBuildInputs = [
     cmake
     pkgconfig
+    python
   ];
 
   buildInputs = [
     opencl-clhpp fftw fftwFloat
     mkl
     openblas
-    libGLU_combined
+    libGLU libGL
     mesa freeimage
-    boost.out boost.dev python
-  ] ++ (stdenv.lib.optional stdenv.isLinux [ cudatoolkit ocl-icd ]);
+    boost.out boost.dev
+  ] ++ (stdenv.lib.optional stdenv.isLinux [ cudatoolkit ocl-icd ])
+    ++ (stdenv.lib.optional buildDocs [ doxygen ]);
 
   meta = with stdenv.lib; {
-    description = "A general-purpose library that simplifies the process of developing software that targets parallel and massively-parallel architectures including CPUs, GPUs, and other hardware acceleration devices";
+    description = "A general-purpose library for parallel and massively-parallel computations";
+    longDescription = ''
+      A general-purpose library that simplifies the process of developing software that targets parallel and massively-parallel architectures including CPUs, GPUs, and other hardware acceleration devices.";
+    '';
     license = licenses.bsd3;
-    homepage = https://arrayfire.com/ ;
+    homepage = "https://arrayfire.com/";
     platforms = platforms.linux ++ platforms.darwin;
-    maintainers = with stdenv.lib.maintainers; [ chessai ];
-    inherit version;
+    maintainers = with maintainers; [ chessai ];
   };
 }
diff --git a/pkgs/development/libraries/arrow-cpp/default.nix b/pkgs/development/libraries/arrow-cpp/default.nix
index aaf228e73a6..f6f3493002a 100644
--- a/pkgs/development/libraries/arrow-cpp/default.nix
+++ b/pkgs/development/libraries/arrow-cpp/default.nix
@@ -12,12 +12,12 @@ let
 
 in stdenv.mkDerivation rec {
   pname = "arrow-cpp";
-  version = "0.15.0";
+  version = "0.15.1";
 
   src = fetchurl {
     url =
       "mirror://apache/arrow/arrow-${version}/apache-arrow-${version}.tar.gz";
-    sha256 = "0n7xrn5490r2snjl45pm2a4pr2x8a29sh8mpyi4nj5pr9f62s1yi";
+    sha256 = "1jbghpppabsix2rkxbnh41inj9lcxfz4q94p96xzxshh4g3mhb4s";
   };
 
   sourceRoot = "apache-arrow-${version}/cpp";
@@ -93,7 +93,7 @@ in stdenv.mkDerivation rec {
     ];
   in ''
     ctest -L unittest -V \
-      --exclude-regex '(${builtins.concatStringsSep "|" excludedTests})'
+      --exclude-regex '^(${builtins.concatStringsSep "|" excludedTests})$'
   '');
 
   meta = {
diff --git a/pkgs/development/libraries/aspell/default.nix b/pkgs/development/libraries/aspell/default.nix
index 5c3c6272f83..ad0f910dcbf 100644
--- a/pkgs/development/libraries/aspell/default.nix
+++ b/pkgs/development/libraries/aspell/default.nix
@@ -15,26 +15,20 @@ let
 in
 
 stdenv.mkDerivation rec {
-  name = "aspell-0.60.6.1";
+  name = "aspell-0.60.8";
 
   src = fetchurl {
     url = "mirror://gnu/aspell/${name}.tar.gz";
-    sha256 = "1qgn5psfyhbrnap275xjfrzppf5a83fb67gpql0kfqv37al869gm";
+    sha256 = "1wi60ankalmh8ds7nplz434jd7j94gdvbahdwsr539rlad8pxdzr";
   };
 
-  patches = [
-    (fetchpatch { # remove in >= 0.60.7
-      name = "gcc-7.patch";
-      url = "https://github.com/GNUAspell/aspell/commit/8089fa02122fed0a.diff";
-      sha256 = "1b3p1zy2lqr2fknddckm58hyk95hw4scf6hzjny1v9iaic2p37ix";
-    })
-  ] ++ stdenv.lib.optional searchNixProfiles ./data-dirs-from-nix-profiles.patch;
+  patches = stdenv.lib.optional searchNixProfiles ./data-dirs-from-nix-profiles.patch;
 
   postPatch = ''
     patch interfaces/cc/aspell.h < ${./clang.patch}
   '';
 
-  nativeBuildInputs = [ perl ];
+  buildInputs = [ perl ];
 
   doCheck = true;
 
diff --git a/pkgs/development/libraries/at-spi2-atk/default.nix b/pkgs/development/libraries/at-spi2-atk/default.nix
index 4af9c9ce32b..f63a341e26e 100644
--- a/pkgs/development/libraries/at-spi2-atk/default.nix
+++ b/pkgs/development/libraries/at-spi2-atk/default.nix
@@ -16,11 +16,11 @@
 
 stdenv.mkDerivation rec {
   pname = "at-spi2-atk";
-  version = "2.34.0";
+  version = "2.34.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "00250s72ii8w6lb6ww61v49y9k4cswfj0hhawqlram7bl6b7x6is";
+    sha256 = "05ncp7s5nddjinffs26mcvpbd63vk1m3cv5y530p3plgfhqgjvbp";
   };
 
   nativeBuildInputs = [ meson ninja pkgconfig ];
diff --git a/pkgs/development/libraries/at-spi2-core/default.nix b/pkgs/development/libraries/at-spi2-core/default.nix
index bda809b1a5a..84a8a6b9026 100644
--- a/pkgs/development/libraries/at-spi2-core/default.nix
+++ b/pkgs/development/libraries/at-spi2-core/default.nix
@@ -10,6 +10,7 @@
 
 , dbus
 , glib
+, dconf
 , libX11
 , libXtst # at-spi2-core can be build without X support, but due it is a client-side library, GUI-less usage is a very rare case
 , libXi
@@ -48,7 +49,7 @@ stdenv.mkDerivation rec {
   postFixup = ''
     # Cannot use wrapGAppsHook'due to a dependency cycle
     wrapProgram $out/libexec/at-spi-bus-launcher \
-      --prefix GIO_EXTRA_MODULES : "${stdenv.lib.getLib gnome3.dconf}/lib/gio/modules" \
+      --prefix GIO_EXTRA_MODULES : "${stdenv.lib.getLib dconf}/lib/gio/modules" \
       --prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}
   '';
 
diff --git a/pkgs/development/libraries/audio/libmysofa/default.nix b/pkgs/development/libraries/audio/libmysofa/default.nix
index ac8d7873123..c541159a96e 100644
--- a/pkgs/development/libraries/audio/libmysofa/default.nix
+++ b/pkgs/development/libraries/audio/libmysofa/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libmysofa";
-  version = "0.8";
+  version = "0.9";
 
   src = fetchFromGitHub {
     owner = "hoene";
     repo = "libmysofa";
     rev = "v${version}";
-    sha256 = "1gas6fp0xy57wwdvsdfq1yq2hg4zl2c074b260y7hh92z96pj22j";
+    sha256 = "14k8c31xh0v4r34h89ld440j9zri4plblmlhj5ddhdmzqmh4lr9f";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/bamf/default.nix b/pkgs/development/libraries/bamf/default.nix
index 58d44a54137..1bce315878d 100644
--- a/pkgs/development/libraries/bamf/default.nix
+++ b/pkgs/development/libraries/bamf/default.nix
@@ -1,6 +1,25 @@
-{ stdenv, autoconf, automake, libtool, gnome3, which, fetchgit, libgtop, libwnck3, glib, vala, pkgconfig
-, libstartup_notification, gobject-introspection, gtk-doc, docbook_xsl
-, xorgserver, dbus, python2, wrapGAppsHook }:
+{ stdenv
+, pantheon
+, autoconf
+, automake
+, libtool
+, gnome3
+, which
+, fetchgit
+, libgtop
+, libwnck3
+, glib
+, vala
+, pkgconfig
+, libstartup_notification
+, gobject-introspection
+, gtk-doc
+, docbook_xsl
+, xorgserver
+, dbus
+, python3
+, wrapGAppsHook
+}:
 
 stdenv.mkDerivation rec {
   pname = "bamf";
@@ -9,14 +28,16 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchgit {
-    url = https://git.launchpad.net/~unity-team/bamf;
+    url = "https://git.launchpad.net/~unity-team/bamf";
     rev = version;
     sha256 = "1klvij1wyhdj5d8sr3b16pfixc1yk8ihglpjykg7zrr1f50jfgsz";
   };
 
   nativeBuildInputs = [
+    (python3.withPackages (ps: with ps; [ lxml ])) # Tests
     autoconf
     automake
+    dbus
     docbook_xsl
     gnome3.gnome-common
     gobject-introspection
@@ -25,13 +46,8 @@ stdenv.mkDerivation rec {
     pkgconfig
     vala
     which
-    # Tests
-    python2
-    python2.pkgs.libxslt
-    python2.pkgs.libxml2
-    dbus
-    xorgserver
     wrapGAppsHook
+    xorgserver
   ];
 
   buildInputs = [
@@ -41,6 +57,11 @@ stdenv.mkDerivation rec {
     libwnck3
   ];
 
+  patches = [
+    # Port tests and checks to python3 lxml.
+    ./gtester2xunit-python3.patch
+  ];
+
   # Fix hard-coded path
   # https://bugs.launchpad.net/bamf/+bug/1780557
   postPatch = ''
@@ -49,8 +70,8 @@ stdenv.mkDerivation rec {
   '';
 
   configureFlags = [
-    "--enable-headless-tests"
     "--enable-gtk-doc"
+    "--enable-headless-tests"
   ];
 
   # fix paths
@@ -67,7 +88,9 @@ stdenv.mkDerivation rec {
   doCheck = false;
 
   # glib-2.62 deprecations
-  NIX_CFLAGS_COMPILE = [ "-DGLIB_DISABLE_DEPRECATION_WARNINGS" ];
+  NIX_CFLAGS_COMPILE = [
+    "-DGLIB_DISABLE_DEPRECATION_WARNINGS"
+  ];
 
   meta = with stdenv.lib; {
     description = "Application matching framework";
@@ -78,6 +101,6 @@ stdenv.mkDerivation rec {
     homepage = https://launchpad.net/bamf;
     license = licenses.lgpl3;
     platforms = platforms.linux;
-    maintainers = with maintainers; [ davidak ];
+    maintainers = with maintainers; [ davidak ] ++ pantheon.maintainers;
   };
 }
diff --git a/pkgs/development/libraries/bamf/gtester2xunit-python3.patch b/pkgs/development/libraries/bamf/gtester2xunit-python3.patch
new file mode 100644
index 00000000000..8dc47854194
--- /dev/null
+++ b/pkgs/development/libraries/bamf/gtester2xunit-python3.patch
@@ -0,0 +1,53 @@
+diff --git a/configure.ac b/configure.ac
+index 41cb7db..93ef0ec 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -115,9 +115,9 @@ GTK_DOC_CHECK(1.0)
+ 
+ AC_PATH_PROG([PYTHON],[python])
+ AC_MSG_CHECKING(for gtester2xunit dependencies)
+-if !($PYTHON -c "import libxslt, libxml2" 2> /dev/null); then
++if !($PYTHON -c "import lxml" 2> /dev/null); then
+   AC_MSG_RESULT([no])
+-  AC_MSG_ERROR([You need to install python-libxslt1 and python-libxml2]);
++  AC_MSG_ERROR([You need to install python-lxml]);
+ fi
+ AC_MSG_RESULT([yes])
+ 
+@@ -189,6 +189,6 @@ ${PACKAGE}-${VERSION}
+     Introspection:        ${enable_introspection}
+     Headless tests:       ${enable_headless_tests}
+     Coverage Reporting:   ${use_gcov}
+-    Export actions menus: ${enable_export_actions_menu} 
++    Export actions menus: ${enable_export_actions_menu}
+ 
+ EOF
+diff --git a/tests/gtester2xunit.py b/tests/gtester2xunit.py
+index fbe3c66..861d541 100755
+--- a/tests/gtester2xunit.py
++++ b/tests/gtester2xunit.py
+@@ -1,18 +1,17 @@
+ #! /usr/bin/python
+ from argparse import ArgumentParser
+-import libxslt
+-import libxml2
+ import sys
+ import os
++from lxml import etree
+ 
+ XSL_TRANSFORM='/usr/share/gtester2xunit/gtester.xsl'
+ 
+ def transform_file(input_filename, output_filename, xsl_file):
+-    gtester = libxml2.parseFile(xsl_file)
+-    style = libxslt.parseStylesheetDoc(gtester)
+-    doc = libxml2.parseFile(input_filename)
+-    result = style.applyStylesheet(doc, None)
+-    result.saveFormatFile(filename=output_filename, format=True)
++    gtester = etree.parse(xsl_file)
++    style = etree.XSLT(gtester)
++    doc = etree.parse(input_filename)
++    result = style(doc)
++    result.write(filename=output_filename, format=True)
+ 
+ 
+ def get_output_filename(input_filename):
diff --git a/pkgs/development/libraries/bcg729/default.nix b/pkgs/development/libraries/bcg729/default.nix
new file mode 100644
index 00000000000..4363948e830
--- /dev/null
+++ b/pkgs/development/libraries/bcg729/default.nix
@@ -0,0 +1,43 @@
+{ stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "bcg729";
+  version = "1.0.4";
+
+  src = fetchFromGitHub {
+    owner = "BelledonneCommunications";
+    repo = pname;
+    rev = version;
+    sha256 = "05s0c5ps3a763y0v34wg5zghj0cdjnq4ch7g81848xxry7q90fwa";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/BelledonneCommunications/bcg729/commit/a5907daf1b111e4ad7aab4f558f57e2af1e37e55.patch";
+      sha256 = "0445syfwj4w4chh8ak80rq77iqcr27924n1ld5snshk3d21nxd64";
+    })
+    (fetchpatch {
+      url = "https://github.com/BelledonneCommunications/bcg729/commit/697bf6653a8c7421f0e821ee8d42471246e6850f.patch";
+      sha256 = "1h3gf5sj2sg5cs5iv1lcav3lkqmd5jf4agvjzz83l89wd5f5hp5l";
+    })
+    (fetchpatch {
+      url = "https://github.com/BelledonneCommunications/bcg729/commit/d63ce04a93711820d9a6985b1d11d8d91ed8e6b6.patch";
+      sha256 = "1piwf63ci2gma6jd6b4adkvxirysvazf0vklb5pc6vx1g93nkgxs";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with stdenv.lib; {
+    description = "Opensource implementation of both encoder and decoder of the ITU G729 Annex A/B speech codec";
+    homepage = "https://linphone.org/technical-corner/bcg729";
+    changelog = "https://gitlab.linphone.org/BC/public/bcg729/raw/${version}/NEWS";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ c0bw3b ];
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/bctoolbox/default.nix b/pkgs/development/libraries/bctoolbox/default.nix
index 3f64ca2addf..a9d21a1f5a9 100644
--- a/pkgs/development/libraries/bctoolbox/default.nix
+++ b/pkgs/development/libraries/bctoolbox/default.nix
@@ -1,27 +1,23 @@
-{stdenv, fetchpatch, fetchFromGitHub, cmake, mbedtls, bcunit, srtp}:
+{ stdenv, fetchFromGitHub, cmake, bcunit, mbedtls }:
+
 stdenv.mkDerivation rec {
-  name = "${baseName}-${version}";
-  baseName = "bctoolbox";
+  pname = "bctoolbox";
   version = "0.6.0";
-  nativeBuildInputs = [cmake];
-  buildInputs = [mbedtls bcunit srtp];
-  patches = [
-    (fetchpatch {
-      name = "fix-gcc9.patch";
-      url = "https://github.com/BelledonneCommunications/bctoolbox/commit/2425a224634c7a70ae91f809bbab51771f0a30d7.patch";
-      sha256 = "0ib859mwwlr6jk6qbwp6x25pp8wgv21lh0qgdsx5hyzwdzqx1b3h";
-    })
-  ];
+
+  nativeBuildInputs = [ cmake bcunit ];
+  buildInputs = [ mbedtls ];
+
   src = fetchFromGitHub {
     owner = "BelledonneCommunications";
-    repo = baseName;
+    repo = pname;
     rev = version;
     sha256 = "1cxx243wyzkd4xnvpyqf97n0rjhfckpvw1vhwnbwshq3q6fra909";
   };
 
   meta = {
     inherit version;
-    description = ''Utilities library for Linphone'';
+    description = "Utilities library for Linphone";
+    homepage = "https://github.com/BelledonneCommunications/bctoolbox";
     license = stdenv.lib.licenses.gpl2Plus ;
     maintainers = [stdenv.lib.maintainers.raskin];
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/development/libraries/belle-sip/default.nix b/pkgs/development/libraries/belle-sip/default.nix
index d4420e40ab6..1745614f741 100644
--- a/pkgs/development/libraries/belle-sip/default.nix
+++ b/pkgs/development/libraries/belle-sip/default.nix
@@ -1,15 +1,14 @@
-{ stdenv, antlr3_4, libantlr3c, jre, polarssl, fetchFromGitHub
+{ stdenv, antlr3_4, libantlr3c, jre, mbedtls, fetchFromGitHub
   , cmake, zlib, bctoolbox
 }:
 
 stdenv.mkDerivation rec {
-  baseName = "belle-sip";
+  pname = "belle-sip";
   version = "1.6.3";
-  name = "${baseName}-${version}";
 
   src = fetchFromGitHub {
     owner = "BelledonneCommunications";
-    repo = baseName;
+    repo = pname;
     rev = version;
     sha256 = "0q70db1klvhca1af29bm9paka3gyii5hfbzrj4178gclsg7cj8fk";
   };
@@ -24,18 +23,14 @@ stdenv.mkDerivation rec {
     "-Wno-error=cast-function-type"
   ];
 
-  propagatedBuildInputs = [ antlr3_4 libantlr3c polarssl bctoolbox ];
-
-  configureFlags = [
-    "--with-polarssl=${polarssl}"
-  ];
+  propagatedBuildInputs = [ antlr3_4 libantlr3c mbedtls bctoolbox ];
 
   # Fails to build with lots of parallel jobs
   enableParallelBuilding = false;
 
   meta = with stdenv.lib; {
-    homepage = http://www.linphone.org/index.php/eng;
-    description = "A Voice-over-IP phone";
+    homepage = https://linphone.org/technical-corner/belle-sip;
+    description = "Modern library implementing SIP (RFC 3261) transport, transaction and dialog layers";
     license = licenses.gpl2;
     platforms = platforms.all;
   };
diff --git a/pkgs/development/libraries/boehm-gc/7.6.6.nix b/pkgs/development/libraries/boehm-gc/7.6.6.nix
index c2b5c7b6062..1cbbee469e6 100644
--- a/pkgs/development/libraries/boehm-gc/7.6.6.nix
+++ b/pkgs/development/libraries/boehm-gc/7.6.6.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     urls = [
-      "http://www.hboehm.info/gc/gc_source/gc-${version}.tar.gz"
+      "https://www.hboehm.info/gc/gc_source/gc-${version}.tar.gz"
       "https://github.com/ivmai/bdwgc/releases/download/v${version}/gc-${version}.tar.gz"
     ];
     sha256 = "1p1r015a7jbpvkkbgzv1y8nxrbbp6dg0mq3ksi6ji0qdz3wfss79";
@@ -63,10 +63,10 @@ stdenv.mkDerivation rec {
       C or C++ programs, though that is not its primary goal.
     '';
 
-    homepage = http://hboehm.info/gc/;
+    homepage = https://hboehm.info/gc/;
 
     # non-copyleft, X11-style license
-    license = http://hboehm.info/gc/license.txt;
+    license = https://hboehm.info/gc/license.txt;
 
     maintainers = [ ];
     platforms = stdenv.lib.platforms.all;
diff --git a/pkgs/development/libraries/boehm-gc/default.nix b/pkgs/development/libraries/boehm-gc/default.nix
index bc8b7a8c760..f061626a897 100644
--- a/pkgs/development/libraries/boehm-gc/default.nix
+++ b/pkgs/development/libraries/boehm-gc/default.nix
@@ -1,4 +1,5 @@
 { lib, stdenv, fetchurl
+, autoreconfHook
 , enableLargeConfig ? false # doc: https://github.com/ivmai/bdwgc/blob/v7.6.6/doc/README.macros#L179
 }:
 
@@ -9,7 +10,7 @@ stdenv.mkDerivation rec {
   src = fetchurl {
     urls = [
       "https://github.com/ivmai/bdwgc/releases/download/v${version}/gc-${version}.tar.gz"
-      "http://www.hboehm.info/gc/gc_source/gc-${version}.tar.gz"
+      "https://www.hboehm.info/gc/gc_source/gc-${version}.tar.gz"
     ];
     sha256 = "1798rp3mcfkgs38ynkbg2p47bq59pisrc6mn0l20pb5iczf0ssj3";
   };
@@ -22,12 +23,17 @@ stdenv.mkDerivation rec {
   '';
 
   patches = # https://github.com/ivmai/bdwgc/pull/208
-    lib.optional stdenv.hostPlatform.isRiscV ./riscv.patch;
+    lib.optional stdenv.hostPlatform.isRiscV ./riscv.patch
+    # boehm-gc whitelists GCC threading models
+    ++ lib.optional stdenv.hostPlatform.isMinGW ./mcfgthread.patch;
 
   configureFlags =
     [ "--enable-cplusplus" "--with-libatomic-ops=none" ]
     ++ lib.optional enableLargeConfig "--enable-large-config";
 
+  nativeBuildInputs =
+    lib.optional stdenv.hostPlatform.isMinGW autoreconfHook;
+
   doCheck = true; # not cross;
 
   enableParallelBuilding = true;
@@ -52,10 +58,10 @@ stdenv.mkDerivation rec {
       C or C++ programs, though that is not its primary goal.
     '';
 
-    homepage = http://hboehm.info/gc/;
+    homepage = https://hboehm.info/gc/;
 
     # non-copyleft, X11-style license
-    license = http://hboehm.info/gc/license.txt;
+    license = https://hboehm.info/gc/license.txt;
 
     maintainers = [ ];
     platforms = stdenv.lib.platforms.all;
diff --git a/pkgs/development/libraries/boehm-gc/mcfgthread.patch b/pkgs/development/libraries/boehm-gc/mcfgthread.patch
new file mode 100644
index 00000000000..c4aa996aebd
--- /dev/null
+++ b/pkgs/development/libraries/boehm-gc/mcfgthread.patch
@@ -0,0 +1,11 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -277,7 +277,7 @@ case "$THREADS" in
+         ;;
+     esac
+     ;;
+- win32)
++ win32 | mcf)
+     AC_DEFINE(GC_THREADS)
+     use_parallel_mark=$enable_parallel_mark
+     if test "${enable_parallel_mark}" != no \
diff --git a/pkgs/development/libraries/boost/1.71.nix b/pkgs/development/libraries/boost/1.71.nix
new file mode 100644
index 00000000000..f66bd4cd6fb
--- /dev/null
+++ b/pkgs/development/libraries/boost/1.71.nix
@@ -0,0 +1,15 @@
+{ stdenv, callPackage, fetchurl, fetchpatch, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "1.71.0";
+
+  src = fetchurl {
+    #url = "mirror://sourceforge/boost/boost_1_71_0.tar.bz2";
+    urls = [ 
+      "mirror://sourceforge/boost/boost_1_71_0.tar.bz2"
+      "https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.bz2"
+    ];
+    # SHA256 from http://www.boost.org/users/history/version_1_71_0.html
+    sha256 = "d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee";
+  };
+})
diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix
index f7bd189022f..2d0a5a63d6f 100644
--- a/pkgs/development/libraries/boost/generic.nix
+++ b/pkgs/development/libraries/boost/generic.nix
@@ -14,6 +14,7 @@
 , taggedLayout ? ((enableRelease && enableDebug) || (enableSingleThreaded && enableMultiThreaded) || (enableShared && enableStatic))
 , patches ? []
 , mpi ? null
+, extraB2Args ? []
 
 # Attributes inherit from specific versions
 , version, src
@@ -92,7 +93,8 @@ let
     ++ optional (mpi != null || stdenv.hostPlatform != stdenv.buildPlatform) "--user-config=user-config.jam"
     ++ optionals (stdenv.hostPlatform.libc == "msvcrt") [
     "threadapi=win32"
-  ]);
+  ] ++ extraB2Args
+  );
 
 in
 
diff --git a/pkgs/development/libraries/box2d/default.nix b/pkgs/development/libraries/box2d/default.nix
index 328ac434d85..d4b4c33f35b 100644
--- a/pkgs/development/libraries/box2d/default.nix
+++ b/pkgs/development/libraries/box2d/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip, cmake, libGLU_combined, freeglut, libX11, xorgproto
+{ stdenv, fetchurl, unzip, cmake, libGLU, libGL, freeglut, libX11, xorgproto
 , libXi, pkgconfig }:
 
 stdenv.mkDerivation rec {
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [
-    unzip cmake libGLU_combined freeglut libX11 xorgproto libXi
+    unzip cmake libGLU libGL freeglut libX11 xorgproto libXi
   ];
 
   cmakeFlags = [
diff --git a/pkgs/development/libraries/boxfort/default.nix b/pkgs/development/libraries/boxfort/default.nix
new file mode 100644
index 00000000000..95c1afd090f
--- /dev/null
+++ b/pkgs/development/libraries/boxfort/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchFromGitHub, cmake, pkg-config, gettext, libcsptr, dyncall
+, nanomsg, python37Packages }:
+
+stdenv.mkDerivation rec {
+  version = "unstable-2019-09-19";
+  pname = "boxfort";
+
+  src = fetchFromGitHub {
+    owner = "Snaipe";
+    repo = "BoxFort";
+    rev = "926bd4ce968592dbbba97ec1bb9aeca3edf29b0d";
+    sha256 = "0mzy4f8qij6ckn5578y3l4rni2470pdkjy5xww7ak99l1kh3p3v6";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [
+    dyncall
+    gettext
+    libcsptr
+    nanomsg
+  ];
+
+  checkInputs = with python37Packages; [ cram ];
+
+  cmakeFlags = [ "-DBXF_FORK_RESILIENCE=OFF" ];
+
+  doCheck = true;
+  preCheck = ''
+    export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH
+  '';
+
+  outputs = [ "dev" "out" ];
+
+  meta = with stdenv.lib; {
+    description = "Convenient & cross-platform sandboxing C library";
+    homepage = "https://github.com/Snaipe/BoxFort";
+    license = licenses.mit;
+    maintainers = with maintainers; [
+      thesola10
+      Yumasi
+    ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/development/libraries/bullet/default.nix b/pkgs/development/libraries/bullet/default.nix
index 1b6c56f13af..5b4e37eff9f 100644
--- a/pkgs/development/libraries/bullet/default.nix
+++ b/pkgs/development/libraries/bullet/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, libGLU_combined, freeglut
+{ stdenv, fetchFromGitHub, cmake, libGLU, libGL, freeglut
 , Cocoa,  OpenGL
 }:
 
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ cmake ];
-  buildInputs = stdenv.lib.optionals stdenv.isLinux [ libGLU_combined freeglut ]
+  buildInputs = stdenv.lib.optionals stdenv.isLinux [ libGLU libGL freeglut ]
     ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];
 
   patches = [ ./gwen-narrowing.patch ];
diff --git a/pkgs/development/libraries/bullet/roboschool-fork.nix b/pkgs/development/libraries/bullet/roboschool-fork.nix
index 8b0901832d1..34a9ee3b6ee 100644
--- a/pkgs/development/libraries/bullet/roboschool-fork.nix
+++ b/pkgs/development/libraries/bullet/roboschool-fork.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, libGLU_combined, freeglut
+{ stdenv, fetchFromGitHub, cmake, libGLU, libGL, freeglut
 , Cocoa,  OpenGL
 }:
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
   };
 
   nativeBuildInputs = [ cmake ];
-  buildInputs = stdenv.lib.optionals stdenv.isLinux [ libGLU_combined freeglut ]
+  buildInputs = stdenv.lib.optionals stdenv.isLinux [ libGLU libGL freeglut ]
     ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];
 
   patches = [ ./gwen-narrowing.patch ];
diff --git a/pkgs/development/libraries/c-blosc/default.nix b/pkgs/development/libraries/c-blosc/default.nix
index 196dd9ca3f9..4a9e627e544 100644
--- a/pkgs/development/libraries/c-blosc/default.nix
+++ b/pkgs/development/libraries/c-blosc/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "A blocking, shuffling and loss-less compression library";
-    homepage = http://www.blosc.org;
+    homepage = https://www.blosc.org;
     license = licenses.bsd3;
     platforms = platforms.all;
   };
diff --git a/pkgs/development/libraries/caf/default.nix b/pkgs/development/libraries/caf/default.nix
index 4a4cba31735..ecf991cb59c 100644
--- a/pkgs/development/libraries/caf/default.nix
+++ b/pkgs/development/libraries/caf/default.nix
@@ -1,23 +1,36 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ stdenv, fetchFromGitHub, cmake, openssl }:
 
 stdenv.mkDerivation rec {
   pname = "actor-framework";
-  version = "0.17.1";
+  version = "0.17.3";
 
   src = fetchFromGitHub {
     owner = "actor-framework";
     repo = "actor-framework";
     rev = version;
-    sha256 = "1xbq591m3v6pkz4z3dg2lsxr6bxv1lpz4yhdci3vi55y6x9pwyfw";
+    sha256 = "187r7vc4kpd0v6bb1y51zwqm9y1lh0m84vkwmrxn8rrp4bwdxlpj";
   };
 
   nativeBuildInputs = [ cmake ];
 
+  buildInputs = [ openssl ];
+
+  cmakeFlags = [
+    "-DCAF_NO_EXAMPLES:BOOL=TRUE"
+  ];
+
+  doCheck = true;
+  checkTarget = "test";
+  preCheck = ''
+    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib
+    export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PWD/lib
+  '';
+
   meta = with stdenv.lib; {
     description = "An open source implementation of the actor model in C++";
     homepage = http://actor-framework.org/;
     license = licenses.bsd3;
     platforms = platforms.unix;
-    maintainers = with maintainers; [ bobakker ];
+    maintainers = with maintainers; [ bobakker tobim ];
   };
 }
diff --git a/pkgs/development/libraries/cairo/default.nix b/pkgs/development/libraries/cairo/default.nix
index 82570fbf7b4..80f8f9498d7 100644
--- a/pkgs/development/libraries/cairo/default.nix
+++ b/pkgs/development/libraries/cairo/default.nix
@@ -4,8 +4,8 @@
 , gobjectSupport ? true, glib
 , xcbSupport ? x11Support, libxcb, xcbutil # no longer experimental since 1.12
 , libGLSupported ? stdenv.lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
-, glSupport ? config.cairo.gl or (libGLSupported && stdenv.isLinux && !stdenv.isAarch32 && !stdenv.isMips)
-, libGL ? null # libGLU_combined is no longer a big dependency
+, glSupport ? config.cairo.gl or (libGLSupported && stdenv.isLinux)
+, libGL ? null # libGLU libGL is no longer a big dependency
 , pdfSupport ? true
 , darwin
 }:
diff --git a/pkgs/development/libraries/catch2/default.nix b/pkgs/development/libraries/catch2/default.nix
index 19768d77a8d..86a5e52353a 100644
--- a/pkgs/development/libraries/catch2/default.nix
+++ b/pkgs/development/libraries/catch2/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "catch2";
-  version = "2.10.2";
+  version = "2.11.0";
 
   src = fetchFromGitHub {
     owner = "catchorg";
     repo = "Catch2";
     rev = "v${version}";
-    sha256="01ldfv4337s3vdhsx415d49jchpvqy61c77dhnri30ip5af0ipjs";
+    sha256="1b07drrclvxj17s67ivypr9vr27rg0m36jqnrbci6f4wsp1b0gbl";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/check/default.nix b/pkgs/development/libraries/check/default.nix
index 08610d1e9af..6a94d9a71ce 100644
--- a/pkgs/development/libraries/check/default.nix
+++ b/pkgs/development/libraries/check/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   pname = "check";
-  version = "0.12.0";
+  version = "0.13.0";
 
   src = fetchurl {
     url = "https://github.com/libcheck/check/releases/download/${version}/check-${version}.tar.gz";
-    sha256 = "0d22h8xshmbpl9hba9ch3xj8vb9ybm5akpsbbh7yj07fic4h2hj6";
+    sha256 = "02crar51gniijrrl9p8f9maibnwc33n76kw5cqr7xk3s8hqnncy4";
   };
 
   # Test can randomly fail: http://hydra.nixos.org/build/7243912
diff --git a/pkgs/development/libraries/chipmunk/default.nix b/pkgs/development/libraries/chipmunk/default.nix
index 76f722f31aa..5dd9917bc52 100644
--- a/pkgs/development/libraries/chipmunk/default.nix
+++ b/pkgs/development/libraries/chipmunk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, freeglut, libGLU_combined, glfw2, glew, libX11, xorgproto
+{ stdenv, fetchurl, cmake, freeglut, libGLU, libGL, glfw2, glew, libX11, xorgproto
 , libXi, libXmu
 }:
 
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
   buildInputs =
-    [ freeglut libGLU_combined glfw2 glew libX11 xorgproto libXi libXmu ];
+    [ freeglut libGLU libGL glfw2 glew libX11 xorgproto libXi libXmu ];
 
   postInstall = ''
     mkdir -p $out/bin
diff --git a/pkgs/development/libraries/cl/default.nix b/pkgs/development/libraries/cl/default.nix
index a7d7a0ea982..2c8ac5113b1 100644
--- a/pkgs/development/libraries/cl/default.nix
+++ b/pkgs/development/libraries/cl/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ erlang rebar opencl-headers ocl-icd ];
-  
+
   buildPhase = ''
     rebar compile
   '';
@@ -29,6 +29,8 @@ stdenv.mkDerivation rec {
     homepage = https://github.com/tonyrog/cl;
     description = "OpenCL binding for Erlang";
     license = licenses.mit;
+    # https://github.com/tonyrog/cl/issues/39
+    broken = stdenv.isAarch64;
     platforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/clipper/default.nix b/pkgs/development/libraries/clipper/default.nix
index 11752423906..ebb41fde423 100644
--- a/pkgs/development/libraries/clipper/default.nix
+++ b/pkgs/development/libraries/clipper/default.nix
@@ -15,11 +15,12 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ninja unzip ];
 
   meta = with stdenv.lib; {
+    description = "A polygon and line clipping and offsetting library (C++, C#, Delphi)";
     longDescription = ''
       The Clipper library performs line & polygon clipping - intersection, union, difference & exclusive-or,
       and line & polygon offsetting. The library is based on Vatti's clipping algorithm.
     '';
-    homepage = https://sourceforge.net/projects/polyclipping;
+    homepage = "https://sourceforge.net/projects/polyclipping";
     license = licenses.boost;
     maintainers = with maintainers; [ mpickering ];
     platforms = with platforms; unix;
diff --git a/pkgs/development/libraries/cln/default.nix b/pkgs/development/libraries/cln/default.nix
index 7adc2a365c5..dc36414fc28 100644
--- a/pkgs/development/libraries/cln/default.nix
+++ b/pkgs/development/libraries/cln/default.nix
@@ -2,18 +2,18 @@
 
 stdenv.mkDerivation rec {
   pname = "cln";
-  version = "1.3.4";
+  version = "1.3.5";
 
   src = fetchurl {
     url = "${meta.homepage}${pname}-${version}.tar.bz2";
-    sha256 = "0j5p18hwbbrchsdbnc8d2bf9ncslhflri4i950gdnq7v6g2dg69d";
+    sha256 = "0bc43v4fyxwik9gjkvm8jan74bkx9bjssv61lfh9jhhblmj010bq";
   };
 
   buildInputs = [ gmp ];
 
   meta = with stdenv.lib; {
     description = "C/C++ library for numbers, a part of GiNaC";
-    homepage = http://www.ginac.de/CLN/;
+    homepage = https://www.ginac.de/CLN/;
     license = licenses.gpl2;
     platforms = platforms.unix; # Once had cygwin problems
   };
diff --git a/pkgs/development/libraries/clutter/default.nix b/pkgs/development/libraries/clutter/default.nix
index 7095a808540..32e723671e8 100644
--- a/pkgs/development/libraries/clutter/default.nix
+++ b/pkgs/development/libraries/clutter/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libGLU_combined, libX11, libXext, libXfixes
+{ stdenv, fetchurl, pkgconfig, libGLU, libGL, libX11, libXext, libXfixes
 , libXdamage, libXcomposite, libXi, libxcb, cogl, pango, atk, json-glib
 , gobject-introspection, gtk3, gnome3, libinput, libgudev, libxkbcommon
 }:
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ gtk3 ];
   nativeBuildInputs = [ pkgconfig ];
   propagatedBuildInputs =
-    [ libX11 libGLU_combined libXext libXfixes libXdamage libXcomposite libXi cogl pango
+    [ libX11 libGL libGLU libXext libXfixes libXdamage libXcomposite libXi cogl pango
       atk json-glib gobject-introspection libxcb libinput libgudev libxkbcommon
     ];
 
diff --git a/pkgs/development/libraries/codec2/default.nix b/pkgs/development/libraries/codec2/default.nix
index 7c42a7479b1..9c31b50c028 100644
--- a/pkgs/development/libraries/codec2/default.nix
+++ b/pkgs/development/libraries/codec2/default.nix
@@ -1,15 +1,17 @@
-{ stdenv, fetchsvn, cmake } :
+{ stdenv, fetchFromGitHub, cmake } :
 
 let
-  version = "0.8";
+  version = "0.9.2";
 
 in stdenv.mkDerivation {
   pname = "codec2";
   inherit version;
 
-  src = fetchsvn {
-    url = "https://svn.code.sf.net/p/freetel/code/codec2/branches/${version}";
-    sha256 = "0qbyaqdn37253s30n6m2ric8nfdsxhkslb9h572kdx18j2yjccki";
+  src = fetchFromGitHub {
+    owner = "drowe67";
+    repo = "codec2";
+    rev = "v${version}";
+    sha256 = "1jpvr7bra8srz8jvnlbmhf8andbaavq5v01qjnp2f61za93rzwba";
   };
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/cogl/default.nix b/pkgs/development/libraries/cogl/default.nix
index 4700d9e2418..e122c1e7b12 100644
--- a/pkgs/development/libraries/cogl/default.nix
+++ b/pkgs/development/libraries/cogl/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, fetchpatch, pkgconfig, libGL, glib, gdk-pixbuf, xorg, libintl
 , pangoSupport ? true, pango, cairo, gobject-introspection, wayland, gnome3
-, mesa
+, mesa, automake, autoconf
 , gstreamerSupport ? true, gst_all_1 }:
 
 let
@@ -29,11 +29,17 @@ in stdenv.mkDerivation rec {
       url = https://bug787443.bugzilla-attachments.gnome.org/attachment.cgi?id=361056;
       sha256 = "09fyrdci4727fg6qm5aaapsbv71sf4wgfaqz8jqlyy61dibgg490";
     })
+
+    # Fix build with libglvnd headers (these headers used to be provided by mesa)
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/cogl/commit/9c4764224aded552fb855b1c2b85b26d2b894adf.patch";
+      sha256 = "1v9drpzgcd5pq2shhdcw5px7mdiggk6ga13qjbklq8xpd92ac0i1";
+    })
   ];
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig libintl ];
+  nativeBuildInputs = [ pkgconfig libintl automake autoconf ];
 
   configureFlags = [
     "--enable-introspection"
@@ -41,7 +47,7 @@ in stdenv.mkDerivation rec {
     "--enable-wayland-egl-platform"
     "--enable-wayland-egl-server"
   ] ++ stdenv.lib.optional gstreamerSupport "--enable-cogl-gst"
-    ++ stdenv.lib.optionals (!stdenv.isDarwin) [ "--enable-gles1" "--enable-gles2" ];
+  ++ stdenv.lib.optionals (!stdenv.isDarwin) [ "--enable-gles1" "--enable-gles2" ];
 
   propagatedBuildInputs = with xorg; [
       glib gdk-pixbuf gobject-introspection wayland mesa
diff --git a/pkgs/development/libraries/coin3d/default.nix b/pkgs/development/libraries/coin3d/default.nix
index 74fd12ffea2..634ac27058b 100644
--- a/pkgs/development/libraries/coin3d/default.nix
+++ b/pkgs/development/libraries/coin3d/default.nix
@@ -1,4 +1,4 @@
-{ fetchFromBitbucket, stdenv, boost, cmake, libGLU_combined }:
+{ fetchFromBitbucket, stdenv, boost, cmake, libGL, libGLU }:
 
 stdenv.mkDerivation {
   pname = "coin";
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
   '';
 
   nativeBuildInputs = [ cmake ];
-  buildInputs = [ boost libGLU_combined ];
+  buildInputs = [ boost libGL libGLU ];
 
   meta = {
     homepage = "https://bitbucket.org/Coin3D/coin/wiki/Home";
diff --git a/pkgs/development/libraries/coprthr/default.nix b/pkgs/development/libraries/coprthr/default.nix
deleted file mode 100644
index 86f4485a900..00000000000
--- a/pkgs/development/libraries/coprthr/default.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{ stdenv, fetchurl, libelf, libconfig, libevent, which, unzip, perl, python
-, bison, flex }:
-
-stdenv.mkDerivation rec {
-  pname = "coprthr";
-  version = "1.6";
-
-  src = fetchurl {
-    url    = "https://github.com/browndeer/coprthr/archive/stable-${version}.zip";
-    sha256 = "0ilx4v1ydppjnq1i0z5j0x4lmi29z39sappar7c0wqady0b5dpz9";
-  };
-
-  buildInputs =
-    [ libelf libconfig libevent which unzip perl python bison flex ];
-
-  patchPhase = ''
-    for x in src/libocl/gen_oclcall_hook.pl tools/cltrace/gen_interceptor.pl src/libocl/gen_oclcall.pl src/scripts/gen_ocl_call_vector.pl src/libstdcl/gen_clarg_setn.pl; do
-      substituteInPlace $x --replace "/usr/bin/perl" ${perl}/bin/perl
-    done
-  '';
-
-  configureFlags =
-    [ "--with-libelf=${libelf}"
-      "--with-libevent=${libevent.dev}"
-      "--with-libconfig=${libconfig}"
-      "--with-opencl-icd-path=$out/etc/OpenCL/vendors"
-      "--enable-user-install"
-    ];
-
-  meta = {
-    description = "The CO-PRocessing THReads SDK for OpenCL/STDCL";
-    homepage    = "http://www.browndeertechnology.com/coprthr.htm";
-    license     = stdenv.lib.licenses.lgpl3;
-    platforms   = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
-    broken = true;
-  };
-}
diff --git a/pkgs/development/libraries/coredumper/default.nix b/pkgs/development/libraries/coredumper/default.nix
deleted file mode 100644
index ddd0d87a551..00000000000
--- a/pkgs/development/libraries/coredumper/default.nix
+++ /dev/null
@@ -1,18 +0,0 @@
-{stdenv, fetchurl}:
-
-stdenv.mkDerivation {
-  name = "coredumper-1.1";
-  src = fetchurl {
-    url = http://google-coredumper.googlecode.com/files/coredumper-1.1.tar.gz;
-    sha256 = "1phl1zg2n17rp595dyzz9iw01gfdpsdh0l6wy2hfb5shi71h63rx";
-  };
-
-  # Doesn't build:
-  #
-  # src/elfcore.c: In function 'CreatePipeline':
-  # src/elfcore.c:1424:26: error: 'CLONE_VM' undeclared (first use in this function)
-  #                           CLONE_VM|CLONE_UNTRACED|SIGCHLD, &args, 0, 0, 0);
-  #                           ^
-  # src/elfcore.c:1424:26: note: each undeclared identifier is reported only once for each function it appears in
-  meta.broken = true;
-}
diff --git a/pkgs/development/libraries/cppzmq/default.nix b/pkgs/development/libraries/cppzmq/default.nix
index 2328bd53362..ccf38fa09fb 100644
--- a/pkgs/development/libraries/cppzmq/default.nix
+++ b/pkgs/development/libraries/cppzmq/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "cppzmq";
-  version = "4.4.1";
+  version = "4.5.0";
 
   src = fetchFromGitHub {
     owner = "zeromq";
     repo = "cppzmq";
     rev = "v${version}";
-    sha256 = "15dgkv51csfkafplf0n0vqbjdr4pxqxq44dln0dcizhsn1p0a57q";
+    sha256 = "1n34sj322ay8839q6cxivckkrhz9avy31615i5jdxfal06mgya43";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/criterion/default.nix b/pkgs/development/libraries/criterion/default.nix
new file mode 100644
index 00000000000..c2721d3839a
--- /dev/null
+++ b/pkgs/development/libraries/criterion/default.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchFromGitHub, boxfort, cmake, libcsptr, pkg-config, gettext
+, dyncall , nanomsg, python37Packages }:
+
+stdenv.mkDerivation rec {
+  version = "2.3.3";
+  pname = "criterion";
+
+  src = fetchFromGitHub {
+    owner = "Snaipe";
+    repo = "Criterion";
+    rev = "v${version}";
+    sha256 = "0y1ay8is54k3y82vagdy0jsa3nfkczpvnqfcjm5n9iarayaxaq8p";
+    fetchSubmodules = true;
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [
+    boxfort.dev
+    dyncall
+    gettext
+    libcsptr
+    nanomsg
+  ];
+
+  checkInputs = with python37Packages; [ cram ];
+
+  cmakeFlags = [ "-DCTESTS=ON" ];
+  doCheck = true;
+  preCheck = ''
+    export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH
+  '';
+  checkTarget = "criterion_tests test";
+
+  outputs = [ "dev" "out" ];
+
+  meta = with stdenv.lib; {
+    description = "A cross-platform C and C++ unit testing framework for the 21th century";
+    homepage = "https://github.com/Snaipe/Criterion";
+    license = licenses.mit;
+    maintainers = with maintainers; [
+      thesola10
+      Yumasi
+    ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/development/libraries/csfml/default.nix b/pkgs/development/libraries/csfml/default.nix
index 506aa5f475d..9bfff5c4aa8 100644
--- a/pkgs/development/libraries/csfml/default.nix
+++ b/pkgs/development/libraries/csfml/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchFromGitHub, cmake, sfml }:
 
 let
-  version = "2.4";
+  version = "2.5";
 in
 
 stdenv.mkDerivation {
@@ -10,8 +10,8 @@ stdenv.mkDerivation {
   src = fetchFromGitHub {
     owner = "SFML";
     repo  = "CSFML";
-    rev   = "b5facb85d13bff451a5fd2d088a97472a685576c";
-    sha256 = "1q716gd7c7jlxzwpq5z4rjj5lsrn71ql2djphccdf9jannllqizn";
+    rev   = version;
+    sha256 = "071magxif5nrdddzk2z34czqmz1dfws4d7dqynb2zpn7cwhwxcpm";
   };
   buildInputs = [ cmake sfml ];
   cmakeFlags = [ "-DCMAKE_MODULE_PATH=${sfml}/share/SFML/cmake/Modules/" ];
diff --git a/pkgs/development/libraries/dav1d/default.nix b/pkgs/development/libraries/dav1d/default.nix
index 8abae8b8bb3..5542a37661a 100644
--- a/pkgs/development/libraries/dav1d/default.nix
+++ b/pkgs/development/libraries/dav1d/default.nix
@@ -9,14 +9,14 @@ assert useVulkan -> withExamples;
 
 stdenv.mkDerivation rec {
   pname = "dav1d";
-  version = "0.5.1";
+  version = "0.5.2";
 
   src = fetchFromGitLab {
     domain = "code.videolan.org";
     owner = "videolan";
     repo = pname;
     rev = version;
-    sha256 = "08cgccp7xvwn24w9iab4fzi18x3m6xyvvnz36qf7clcz0aqbfb9w";
+    sha256 = "0acxlgyz6c8ckw8vfgn60y2zg2n00l5xsq5jlxvwbh5w5pkc3ahf";
   };
 
   nativeBuildInputs = [ meson ninja nasm pkgconfig ];
diff --git a/pkgs/development/libraries/dconf/default.nix b/pkgs/development/libraries/dconf/default.nix
new file mode 100644
index 00000000000..5b37088cd95
--- /dev/null
+++ b/pkgs/development/libraries/dconf/default.nix
@@ -0,0 +1,55 @@
+{ stdenv, fetchurl, meson, ninja, python3, vala, libxslt, pkgconfig, glib, bash-completion, dbus, gnome3
+, libxml2, gtk-doc, docbook_xsl, docbook_xml_dtd_42, fetchpatch }:
+
+let
+  pname = "dconf";
+in
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  version = "0.34.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
+    sha256 = "0lnsl85cp2vpzgp8pkf6l6yd2i3lp02jdvga1icfa78j2smr8fll";
+  };
+
+  patches = [
+    # Fix build with Meson 0.52
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/dconf/commit/cc32667c5d7d9ff95e65cc21f59905d8f9218394.patch";
+      sha256 = "02gfadn34bg818a7vb3crhsiahskiflcvx9l6iqwf1v269q93mr8";
+    })
+  ];
+
+  postPatch = ''
+    chmod +x meson_post_install.py tests/test-dconf.py
+    patchShebangs meson_post_install.py
+    patchShebangs tests/test-dconf.py
+  '';
+
+  outputs = [ "out" "lib" "dev" "devdoc" ];
+
+  nativeBuildInputs = [ meson ninja vala pkgconfig python3 libxslt libxml2 gtk-doc docbook_xsl docbook_xml_dtd_42 ];
+  buildInputs = [ glib bash-completion dbus ];
+
+  mesonFlags = [
+    "--sysconfdir=/etc"
+    "-Dgtk_doc=true"
+  ];
+
+  doCheck = !stdenv.isAarch32 && !stdenv.isAarch64 && !stdenv.isDarwin;
+
+  passthru = {
+    updateScript = gnome3.updateScript {
+      packageName = pname;
+      attrPath = "gnome3.${pname}";
+    };
+  };
+
+  meta = with stdenv.lib; {
+    homepage = https://wiki.gnome.org/Projects/dconf;
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = gnome3.maintainers;
+  };
+}
diff --git a/pkgs/development/libraries/dleyna-core/setup-hook.sh b/pkgs/development/libraries/dleyna-core/setup-hook.sh
index 87b5c67dff5..287ad4dc189 100644
--- a/pkgs/development/libraries/dleyna-core/setup-hook.sh
+++ b/pkgs/development/libraries/dleyna-core/setup-hook.sh
@@ -1,7 +1,7 @@
 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"
+        export DLEYNA_CONNECTOR_PATH="${DLEYNA_CONNECTOR_PATH-}${DLEYNA_CONNECTOR_PATH:+:}$1/lib/dleyna-1.0/connectors"
     fi
 }
 
diff --git a/pkgs/development/libraries/dlib/default.nix b/pkgs/development/libraries/dlib/default.nix
index aae8989c238..6d6bef21f39 100644
--- a/pkgs/development/libraries/dlib/default.nix
+++ b/pkgs/development/libraries/dlib/default.nix
@@ -7,13 +7,13 @@
 
 stdenv.mkDerivation rec {
   pname = "dlib";
-  version = "19.18";
+  version = "19.19";
 
   src = fetchFromGitHub {
     owner = "davisking";
     repo = "dlib";
     rev ="v${version}";
-    sha256 = "1kbrcf35pn2ymyr8q48ls98n2zb7rrz5207kwpisfh6k22g802ic";
+    sha256 = "0574p46zf85nx33cam4yqcg20g94kkmrvi5689r1xshprr0szghp";
   };
 
   postPatch = ''
diff --git a/pkgs/development/libraries/egl-wayland/default.nix b/pkgs/development/libraries/egl-wayland/default.nix
new file mode 100644
index 00000000000..fa2c3687ba7
--- /dev/null
+++ b/pkgs/development/libraries/egl-wayland/default.nix
@@ -0,0 +1,79 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, pkgconfig
+, meson
+, ninja
+, libX11
+, mesa
+, libGL
+, wayland
+}:
+
+let
+  eglexternalplatform = stdenv.mkDerivation {
+    pname = "eglexternalplatform";
+    version = "1.1";
+
+    src = fetchFromGitHub {
+      owner = "Nvidia";
+      repo = "eglexternalplatform";
+      rev = "7c8f8e2218e46b1a4aa9538520919747f1184d86";
+      sha256 = "0lr5s2xa1zn220ghmbsiwgmx77l156wk54c7hybia0xpr9yr2nhb";
+    };
+
+    installPhase = ''
+      mkdir -p "$out/include/"
+      cp interface/eglexternalplatform.h "$out/include/"
+      cp interface/eglexternalplatformversion.h "$out/include/"
+
+      substituteInPlace eglexternalplatform.pc \
+        --replace "/usr/include/EGL" "$out/include"
+      mkdir -p "$out/share/pkgconfig"
+      cp eglexternalplatform.pc "$out/share/pkgconfig/"
+    '';
+
+    meta = with lib; {
+      license = licenses.mit;
+    };
+  };
+
+in stdenv.mkDerivation rec {
+  pname = "egl-wayland";
+  version = "1.1.4";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "Nvidia";
+    repo = pname;
+    rev = version;
+    sha256 = "0wvamjcfycd7rgk7v14g2rin55xin9rfkxmivyay3cm08vnl7y1d";
+  };
+
+  # Add missing include
+  # https://github.com/NVIDIA/egl-wayland/pull/24
+  patches = [ ./eglmesaext.patch ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkgconfig
+  ];
+
+  buildInputs = [
+    eglexternalplatform
+    libX11
+    mesa
+    libGL
+    wayland
+  ];
+
+  meta = with lib; {
+    description = "The EGLStream-based Wayland external platform";
+    homepage = https://github.com/NVIDIA/egl-wayland/;
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ hedning ];
+  };
+}
diff --git a/pkgs/development/libraries/egl-wayland/eglmesaext.patch b/pkgs/development/libraries/egl-wayland/eglmesaext.patch
new file mode 100644
index 00000000000..9384ecff9b0
--- /dev/null
+++ b/pkgs/development/libraries/egl-wayland/eglmesaext.patch
@@ -0,0 +1,12 @@
+diff --git a/src/wayland-eglsurface.c b/src/wayland-eglsurface.c
+index 01c9cb3..45736b0 100644
+--- a/src/wayland-eglsurface.c
++++ b/src/wayland-eglsurface.c
+@@ -37,6 +37,7 @@
+ #include <sys/types.h>
+ #include <netinet/in.h>
+ #include <fcntl.h>
++#include <EGL/eglmesaext.h>
+ 
+ #define WL_EGL_WINDOW_DESTROY_CALLBACK_SINCE 3
+ 
diff --git a/pkgs/development/libraries/enet/default.nix b/pkgs/development/libraries/enet/default.nix
index c0df404e60e..bf6260ca766 100644
--- a/pkgs/development/libraries/enet/default.nix
+++ b/pkgs/development/libraries/enet/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     homepage = http://enet.bespin.org/;
     description = "Simple and robust network communication layer on top of UDP";
     license = stdenv.lib.licenses.mit;
-    maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
+    maintainers = with stdenv.lib.maintainers; [ ];
     platforms = stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/exempi/default.nix b/pkgs/development/libraries/exempi/default.nix
index 22c812ba4c2..5638db71245 100644
--- a/pkgs/development/libraries/exempi/default.nix
+++ b/pkgs/development/libraries/exempi/default.nix
@@ -19,7 +19,8 @@ stdenv.mkDerivation rec {
   doCheck = stdenv.isLinux;
 
   meta = with stdenv.lib; {
-    homepage = https://libopenraw.freedesktop.org/wiki/Exempi/;
+    description = "An implementation of XMP (Adobe's Extensible Metadata Platform)";
+    homepage = "https://libopenraw.freedesktop.org/wiki/Exempi/";
     platforms = platforms.linux ++ platforms.darwin;
     license = licenses.bsd3;
   };
diff --git a/pkgs/development/libraries/faudio/default.nix b/pkgs/development/libraries/faudio/default.nix
index b0818d79dfa..1658d69d7a1 100644
--- a/pkgs/development/libraries/faudio/default.nix
+++ b/pkgs/development/libraries/faudio/default.nix
@@ -4,13 +4,13 @@
 
 stdenv.mkDerivation rec {
 	pname = "faudio";
-  version = "19.10";
+  version = "19.12";
 
   src = fetchFromGitHub {
     owner = "FNA-XNA";
     repo = "FAudio";
     rev = version;
-    sha256 = "1z7j803nxhgvjwpxr1m5d490yji727v7pn0ghhipbrfxlwzkw1sz";
+    sha256 = "0y8dc7lnhh69wcwqma9spyxcahfhbfyg92h35sqkin6qfh5mngxr";
   };
 
 	nativeBuildInputs = [cmake];
diff --git a/pkgs/development/libraries/fdk-aac/default.nix b/pkgs/development/libraries/fdk-aac/default.nix
index 70269002e2f..16560f19c86 100644
--- a/pkgs/development/libraries/fdk-aac/default.nix
+++ b/pkgs/development/libraries/fdk-aac/default.nix
@@ -5,11 +5,11 @@
 with stdenv.lib;
 stdenv.mkDerivation rec {
   pname = "fdk-aac";
-  version = "2.0.0";
+  version = "2.0.1";
 
   src = fetchurl {
     url = "mirror://sourceforge/opencore-amr/fdk-aac/${pname}-${version}.tar.gz";
-    sha256 = "0v6rbyw9f9lpfvcg3v1qyapga5hqfnb3wp3x5yaxpwcgjw7ydmpp";
+    sha256 = "0wgjjc0dfkm2w966lc9c8ir8f671vl1ppch3mya3h58jjjm360c4";
   };
 
   configureFlags = [ ]
diff --git a/pkgs/development/libraries/ffmpeg-full/default.nix b/pkgs/development/libraries/ffmpeg-full/default.nix
index 9ab112dac12..afdc6c0f5e8 100644
--- a/pkgs/development/libraries/ffmpeg-full/default.nix
+++ b/pkgs/development/libraries/ffmpeg-full/default.nix
@@ -104,7 +104,7 @@
 #, opencl ? null # OpenCL code
 , opencore-amr ? null # AMR-NB de/encoder & AMR-WB decoder
 #, opencv ? null # Video filtering
-, openglExtlib ? false, libGLU_combined ? null # OpenGL rendering
+, openglExtlib ? false, libGL ? null, libGLU ? null # OpenGL rendering
 #, openh264 ? null # H.264/AVC encoder
 , openjpeg ? null # JPEG 2000 de/encoder
 , opensslExtlib ? false, openssl ? null
@@ -234,7 +234,7 @@ assert gnutls != null -> !opensslExtlib;
 assert libxcbshmExtlib -> libxcb != null;
 assert libxcbxfixesExtlib -> libxcb != null;
 assert libxcbshapeExtlib -> libxcb != null;
-assert openglExtlib -> libGLU_combined != null;
+assert openglExtlib -> libGL != null && libGLU != null;
 assert opensslExtlib -> gnutls == null && openssl != null && nonfreeLicensing;
 
 stdenv.mkDerivation rec {
@@ -353,6 +353,7 @@ stdenv.mkDerivation rec {
     #(enableFeature (cdio-paranoia != null && gplLicensing) "libcdio")
     (enableFeature (if isLinux then libdc1394 != null && libraw1394 != null else false) "libdc1394")
     (enableFeature (libiconv != null) "iconv")
+    (enableFeature (libjack2 != null) "libjack")
     #(enableFeature (if isLinux then libiec61883 != null && libavc1394 != null && libraw1394 != null else false) "libiec61883")
     (enableFeature (if isLinux && !isAarch64 then libmfx != null else false) "libmfx")
     (enableFeature (libmodplug != null) "libmodplug")
@@ -424,7 +425,7 @@ stdenv.mkDerivation rec {
     libxcb libXv libXext lzma openal openjpeg libpulseaudio rtmpdump opencore-amr
     samba SDL2 soxr speex vid-stab vo-amrwbenc wavpack x264 x265 xavs xvidcore
     zeromq4 zlib
-  ] ++ optional openglExtlib libGLU_combined
+  ] ++ optionals openglExtlib [ libGL libGLU ]
     ++ optionals nonfreeLicensing [ fdk_aac openssl ]
     ++ optional ((isLinux || isFreeBSD) && libva != null) libva
     ++ optional (!isAarch64 && libvmaf != null && version3Licensing) libvmaf
@@ -466,6 +467,6 @@ stdenv.mkDerivation rec {
         licenses.lgpl21Plus
     );
     platforms = platforms.all;
-    maintainers = with maintainers; [ codyopel fuuzetsu ];
+    maintainers = with maintainers; [ codyopel ];
   };
 }
diff --git a/pkgs/development/libraries/ffmpeg/2.8.nix b/pkgs/development/libraries/ffmpeg/2.8.nix
index 5ffbc215d8b..98ada9a3f09 100644
--- a/pkgs/development/libraries/ffmpeg/2.8.nix
+++ b/pkgs/development/libraries/ffmpeg/2.8.nix
@@ -1,7 +1,7 @@
 { callPackage, ... } @ args:
 
-callPackage ./generic.nix (args // rec {
+callPackage ./generic.nix (rec {
   version = "${branch}.14";
   branch = "2.8";
   sha256 = "1g6x3lyjl1zlfksizj1ys61kj97yg0xf4dlr6sr5acpbja3a26yn";
-})
+} // args)
diff --git a/pkgs/development/libraries/ffmpeg/3.4.nix b/pkgs/development/libraries/ffmpeg/3.4.nix
index bea367b2554..759fba65587 100644
--- a/pkgs/development/libraries/ffmpeg/3.4.nix
+++ b/pkgs/development/libraries/ffmpeg/3.4.nix
@@ -4,9 +4,9 @@
 , ...
 }@args:
 
-callPackage ./generic.nix (args // rec {
+callPackage ./generic.nix (rec {
   version = branch;
   branch = "3.4.6";
   sha256 = "1s20wzgxxrm56gckyb8cf1lh36hdnkdxvmmnnvdxvia4zb3grf1b";
   darwinFrameworks = [ Cocoa CoreMedia ];
-})
+} // args)
diff --git a/pkgs/development/libraries/ffmpeg/4.nix b/pkgs/development/libraries/ffmpeg/4.nix
index a0b95cecaab..387069d1618 100644
--- a/pkgs/development/libraries/ffmpeg/4.nix
+++ b/pkgs/development/libraries/ffmpeg/4.nix
@@ -4,9 +4,9 @@
 , ...
 }@args:
 
-callPackage ./generic.nix (args // rec {
+callPackage ./generic.nix (rec {
   version = "4.2.1";
   branch = "4.2";
   sha256 = "090naa6rj46pzkgh03bf51hbqdz356qqckr2pw6pykc6ysiryak8";
   darwinFrameworks = [ Cocoa CoreMedia VideoToolbox ];
-})
+} // args)
diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix
index b3310e44ae0..3424493c209 100644
--- a/pkgs/development/libraries/ffmpeg/generic.nix
+++ b/pkgs/development/libraries/ffmpeg/generic.nix
@@ -2,7 +2,9 @@
 , alsaLib, bzip2, fontconfig, freetype, gnutls, libiconv, lame, libass, libogg
 , libssh, libtheora, libva, libdrm, libvorbis, libvpx, lzma, libpulseaudio, soxr
 , x264, x265, xvidcore, zlib, libopus, speex, nv-codec-headers, dav1d
-, openglSupport ? false, libGLU_combined ? null
+, openglSupport ? false, libGLU ? null, libGL ? null
+, libmfxSupport ? false, intel-media-sdk ? null
+, libaomSupport ? false, libaom ? null
 # Build options
 , runtimeCpuDetectBuild ? true # Detect CPU capabilities at runtime
 , multithreadBuild ? true # Multithreading via pthreads/win32 threads
@@ -61,7 +63,9 @@ let
   vpxSupport = reqMin "0.6" && !isAarch32;
 in
 
-assert openglSupport -> libGLU_combined != null;
+assert openglSupport -> libGL != null && libGLU != null;
+assert libmfxSupport -> intel-media-sdk != null;
+assert libaomSupport -> libaom != null;
 
 stdenv.mkDerivation rec {
 
@@ -135,6 +139,8 @@ stdenv.mkDerivation rec {
       (ifMinVer "0.6" (enableFeature vpxSupport "libvpx"))
       (ifMinVer "2.4" "--enable-lzma")
       (ifMinVer "2.2" (enableFeature openglSupport "opengl"))
+      (ifMinVer "4.2" (enableFeature libmfxSupport "libmfx"))
+      (ifMinVer "4.2" (enableFeature libaomSupport "libaom"))
       (disDarwinOrArmFix (ifMinVer "0.9" "--enable-libpulse") "0.9" "--disable-libpulse")
       (ifMinVer "2.5" (if sdlSupport && reqMin "3.2" then "--enable-sdl2" else if sdlSupport then "--enable-sdl" else null)) # autodetected before 2.5, SDL1 support removed in 3.2 for SDL2
       (ifMinVer "1.2" "--enable-libsoxr")
@@ -162,7 +168,9 @@ stdenv.mkDerivation rec {
   buildInputs = [
     bzip2 fontconfig freetype gnutls libiconv lame libass libogg libssh libtheora
     libvdpau libvorbis lzma soxr x264 x265 xvidcore zlib libopus speex nv-codec-headers
-  ] ++ optional openglSupport libGLU_combined
+  ] ++ optionals openglSupport [ libGL libGLU ]
+    ++ optional libmfxSupport intel-media-sdk
+    ++ optional vpxSupport libaom
     ++ optional vpxSupport libvpx
     ++ optionals (!isDarwin && !isAarch32) [ libpulseaudio ] # Need to be fixed on Darwin and ARM
     ++ optional ((isLinux || isFreeBSD) && !isAarch32) libva
@@ -210,7 +218,7 @@ stdenv.mkDerivation rec {
     '';
     license = licenses.gpl3;
     platforms = platforms.all;
-    maintainers = with maintainers; [ codyopel fuuzetsu ];
+    maintainers = with maintainers; [ codyopel ];
     inherit branch;
   };
 }
diff --git a/pkgs/development/libraries/ffms/default.nix b/pkgs/development/libraries/ffms/default.nix
index c404a12f3df..30fb94aa248 100644
--- a/pkgs/development/libraries/ffms/default.nix
+++ b/pkgs/development/libraries/ffms/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     homepage = https://github.com/FFMS/ffms2/;
     description = "Libav/ffmpeg based source library for easy frame accurate access";
     license = licenses.mit;
-    maintainers = with maintainers; [ fuuzetsu ];
+    maintainers = with maintainers; [ ];
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/flatpak/default.nix b/pkgs/development/libraries/flatpak/default.nix
index edb3c27ebf5..945f1d4931f 100644
--- a/pkgs/development/libraries/flatpak/default.nix
+++ b/pkgs/development/libraries/flatpak/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, autoreconfHook, docbook_xml_dtd_412, docbook_xml_dtd_42, docbook_xml_dtd_43, docbook_xsl, which, libxml2
 , gobject-introspection, gtk-doc, intltool, libxslt, pkgconfig, xmlto, appstream-glib, substituteAll, glibcLocales, yacc, xdg-dbus-proxy, p11-kit
-, bubblewrap, bzip2, dbus, glib, gpgme, json-glib, libarchive, libcap, libseccomp, coreutils, gettext, hicolor-icon-theme, fuse
-, libsoup, lzma, ostree, polkit, python3, systemd, xorg, valgrind, glib-networking, wrapGAppsHook, gnome3, gsettings-desktop-schemas, librsvg }:
+, bubblewrap, bzip2, dbus, glib, gpgme, json-glib, libarchive, libcap, libseccomp, coreutils, gettext, hicolor-icon-theme, fuse, nixosTests
+, libsoup, lzma, ostree, polkit, python3, systemd, xorg, valgrind, glib-networking, wrapGAppsHook, dconf, gsettings-desktop-schemas, librsvg }:
 
 stdenv.mkDerivation rec {
   pname = "flatpak";
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
   ];
 
   buildInputs = [
-    bubblewrap bzip2 dbus gnome3.dconf glib gpgme json-glib libarchive libcap libseccomp
+    bubblewrap bzip2 dbus dconf glib gpgme json-glib libarchive libcap libseccomp
     libsoup lzma ostree polkit python3 systemd xorg.libXau fuse
     gsettings-desktop-schemas glib-networking
     librsvg # for flatpak-validate-icon
@@ -76,6 +76,12 @@ stdenv.mkDerivation rec {
     patchShebangs tests
   '';
 
+  passthru = {
+    tests = {
+      installedTests = nixosTests.installed-tests.flatpak;
+    };
+  };
+
   meta = with stdenv.lib; {
     description = "Linux application sandboxing and distribution framework";
     homepage = https://flatpak.org/;
diff --git a/pkgs/development/libraries/fltk/1.4.nix b/pkgs/development/libraries/fltk/1.4.nix
index eebe119d142..1fe50b402cb 100644
--- a/pkgs/development/libraries/fltk/1.4.nix
+++ b/pkgs/development/libraries/fltk/1.4.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, xlibsWrapper, xorgproto, libXi
-, freeglut, libGLU_combined, libjpeg, zlib, libXft, libpng
+, freeglut, libGLU, libGL, libjpeg, zlib, libXft, libpng
 , libtiff, freetype, Cocoa, AGL, GLUT
 }:
 
@@ -12,14 +12,14 @@ stdenv.mkDerivation {
   inherit version;
 
   src = fetchurl {
-    url = "http://fltk.org/pub/fltk/snapshots/fltk-${version}.tar.gz";
+    url = "https://www.fltk.org/pub/fltk/snapshots/fltk-${version}.tar.gz";
     sha256 = "1v8wxvxcbk99i82x2v5fpqg5vj8n7g8a38g30ry7nzcjn5sf3r63";
   };
 
   patches = stdenv.lib.optionals stdenv.isDarwin [ ./nsosv.patch ];
 
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ libGLU_combined libjpeg zlib libpng libXft ]
+  buildInputs = [ libGLU libGL libjpeg zlib libpng libXft ]
     ++ stdenv.lib.optional stdenv.isDarwin [ AGL Cocoa GLUT ];
 
   propagatedBuildInputs = [ xorgproto ]
@@ -41,7 +41,7 @@ stdenv.mkDerivation {
 
   meta = with stdenv.lib; {
     description = "A C++ cross-platform lightweight GUI library";
-    homepage = http://www.fltk.org;
+    homepage = https://www.fltk.org;
     platforms = platforms.linux ++ platforms.darwin;
     license = licenses.gpl2;
   };
diff --git a/pkgs/development/libraries/fltk/default.nix b/pkgs/development/libraries/fltk/default.nix
index a22b5eef8d2..fe7de504b4f 100644
--- a/pkgs/development/libraries/fltk/default.nix
+++ b/pkgs/development/libraries/fltk/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, xlibsWrapper, xorgproto, libXi
-, freeglut, libGLU_combined, libjpeg, zlib, libXft, libpng
+, freeglut, libGL, libGLU, libjpeg, zlib, libXft, libpng
 , libtiff, freetype, Cocoa, AGL, GLUT
 }:
 
@@ -12,14 +12,14 @@ stdenv.mkDerivation {
   inherit version;
 
   src = fetchurl {
-    url = "http://fltk.org/pub/fltk/${version}/fltk-${version}-source.tar.gz";
+    url = "https://www.fltk.org/pub/fltk/${version}/fltk-${version}-source.tar.gz";
     sha256 = "00jp24z1818k9n6nn6lx7qflqf2k13g4kxr0p8v1d37kanhb4ac7";
   };
 
   patches = stdenv.lib.optionals stdenv.isDarwin [ ./nsosv.patch ];
 
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ libGLU_combined libjpeg zlib libpng libXft ]
+  buildInputs = [ libGLU libGL libjpeg zlib libpng libXft ]
     ++ stdenv.lib.optional stdenv.isDarwin [ AGL Cocoa GLUT ];
 
   propagatedBuildInputs = [ xorgproto ]
@@ -39,7 +39,7 @@ stdenv.mkDerivation {
 
   meta = with stdenv.lib; {
     description = "A C++ cross-platform lightweight GUI library";
-    homepage = http://www.fltk.org;
+    homepage = https://www.fltk.org;
     platforms = platforms.linux ++ platforms.darwin;
     license = licenses.gpl2;
   };
diff --git a/pkgs/development/libraries/folly/default.nix b/pkgs/development/libraries/folly/default.nix
index 2dfb5e9e248..15f29ce77f5 100644
--- a/pkgs/development/libraries/folly/default.nix
+++ b/pkgs/development/libraries/folly/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   pname = "folly";
-  version = "2019.10.21.00";
+  version = "2019.11.11.00";
 
   src = fetchFromGitHub {
     owner = "facebook";
     repo = "folly";
     rev = "v${version}";
-    sha256 = "1jy0yxqzcxxs6sq8161zbdzj4ngwjs0h2aca6n9qkaj1v5jd27c7";
+    sha256 = "1sgv7sdalbs7zhz3zcc95gn2h8j2xjf7hkw2c618zc3pdn6aa58w";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/fontconfig-ultimate/default.nix b/pkgs/development/libraries/fontconfig-ultimate/default.nix
deleted file mode 100644
index b95d6dd559d..00000000000
--- a/pkgs/development/libraries/fontconfig-ultimate/default.nix
+++ /dev/null
@@ -1,49 +0,0 @@
-{ stdenv, fetchFromGitHub }:
-
-let version = "2016-04-23"; in
-stdenv.mkDerivation {
-  pname = "fontconfig-ultimate";
-  inherit version;
-
-  src = fetchFromGitHub {
-    sha256 = "1rd2n60l8bamx84q3l91pd9a0wz9h7p6ajvx1dw22qn8rah4h498";
-    rev = version;
-    repo = "fontconfig-ultimate";
-    owner = "bohoomil";
-  };
-
-  installPhase = ''
-    mkdir -p $out/etc/fonts/conf.d
-    cp conf.d.infinality/*.conf $out/etc/fonts/conf.d
-
-    # Base rendering settings will be determined by NixOS module
-    rm $out/etc/fonts/conf.d/10-base-rendering.conf
-
-    # Options controlled by NixOS module
-    rm $out/etc/fonts/conf.d/35-repl-custom.conf
-    rm $out/etc/fonts/conf.d/38-repl-*.conf
-    rm $out/etc/fonts/conf.d/82-*.conf
-    rm $out/etc/fonts/conf.d/83-*.conf
-
-    # Inclusion of local and user configs handled by global configuration
-    rm $out/etc/fonts/conf.d/29-local.conf
-    rm $out/etc/fonts/conf.d/28-user.conf
-
-    cp fontconfig_patches/fonts-settings/*.conf $out/etc/fonts/conf.d
-
-    # fix font priority issue https://github.com/bohoomil/fontconfig-ultimate/issues/173
-    mv $out/etc/fonts/conf.d/{43,60}-wqy-zenhei-sharp.conf
-
-    mkdir -p $out/etc/fonts/presets/{combi,free,ms}
-    cp fontconfig_patches/combi/*.conf $out/etc/fonts/presets/combi
-    cp fontconfig_patches/free/*.conf $out/etc/fonts/presets/free
-    cp fontconfig_patches/ms/*.conf $out/etc/fonts/presets/ms
-  '';
-
-  meta = with stdenv.lib; {
-    description = "Font configuration files, patches, scripts and source packages (Infinality & friends)";
-    homepage = https://github.com/bohoomil/fontconfig-ultimate;
-    license = licenses.mit;
-    platforms = platforms.all;
-  };
-}
diff --git a/pkgs/development/libraries/fontconfig/make-fonts-cache.nix b/pkgs/development/libraries/fontconfig/make-fonts-cache.nix
index 5b98d6523b9..f1a2e865bb7 100644
--- a/pkgs/development/libraries/fontconfig/make-fonts-cache.nix
+++ b/pkgs/development/libraries/fontconfig/make-fonts-cache.nix
@@ -2,7 +2,7 @@
 
 runCommand "fc-cache"
   {
-    buildInputs = [ fontconfig.bin ];
+    nativeBuildInputs = [ fontconfig.bin ];
     preferLocalBuild = true;
     allowSubstitutes = false;
     passAsFile = [ "fontDirs" ];
diff --git a/pkgs/development/libraries/forge/default.nix b/pkgs/development/libraries/forge/default.nix
index e6e002f16c5..83630aef9aa 100644
--- a/pkgs/development/libraries/forge/default.nix
+++ b/pkgs/development/libraries/forge/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchFromGitHub, cmake, pkgconfig
 , arrayfire, expat, fontconfig, freeimage, freetype, boost
-, mesa, libGLU_combined, glfw3, SDL2, cudatoolkit
+, mesa, libGLU, libGL, glfw3, SDL2, cudatoolkit
 }:
 
 stdenv.mkDerivation rec {
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     boost.dev
     freeimage
     mesa
-    libGLU_combined
+    libGLU libGL
     glfw3
     SDL2
     cudatoolkit
diff --git a/pkgs/development/libraries/fox/fox-1.6.nix b/pkgs/development/libraries/fox/fox-1.6.nix
index af387b7232f..bb59a34b1cc 100644
--- a/pkgs/development/libraries/fox/fox-1.6.nix
+++ b/pkgs/development/libraries/fox/fox-1.6.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, xlibsWrapper, libpng, libjpeg, libtiff, zlib, bzip2, libXcursor
-, libXrandr, libGLU_combined, libXft, libXfixes, xinput
+, libXrandr, libGLU, libGL, libXft, libXfixes, xinput
 , CoreServices }:
 
 let
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     xlibsWrapper libpng libjpeg libtiff zlib bzip2 libXcursor libXrandr
-    libXft libGLU_combined libXfixes xinput
+    libXft libGLU libGL libXfixes xinput
   ] ++ stdenv.lib.optional stdenv.isDarwin CoreServices;
 
   doCheck = true;
diff --git a/pkgs/development/libraries/fplll/default.nix b/pkgs/development/libraries/fplll/default.nix
index c2952cb47f1..f53d55c2ca9 100644
--- a/pkgs/development/libraries/fplll/default.nix
+++ b/pkgs/development/libraries/fplll/default.nix
@@ -1,22 +1,46 @@
-{stdenv, fetchFromGitHub, autoconf, automake, libtool, gettext, autoreconfHook
-, gmp, mpfr
+{ stdenv
+, fetchFromGitHub
+, fetchpatch
+, gettext
+, autoreconfHook
+, gmp
+, mpfr
 }:
+
 stdenv.mkDerivation rec {
   pname = "fplll";
-  version = "5.2.1";
+  version = "5.3.1";
+
   src = fetchFromGitHub {
-    owner = pname;
-    repo = pname;
+    owner = "fplll";
+    repo = "fplll";
     rev = version;
-    sha256 = "015qmrd7nfaysbv1hbwiprz9g6hnww1y1z1xw8f43ysb7k1b5nbg";
+    sha256 = "1bzlqavbch5smra75znh4ljr490wyx5v6hax8r9rjbgk605i33ns";
   };
-  nativeBuildInputs = [autoconf automake libtool gettext autoreconfHook];
-  buildInputs = [gmp mpfr];
-  meta = {
-    inherit version;
+
+  nativeBuildInputs = [
+    gettext
+    autoreconfHook
+  ];
+
+  buildInputs = [
+    gmp
+    mpfr
+  ];
+
+  meta = with stdenv.lib; {
     description = ''Lattice algorithms using floating-point arithmetic'';
-    license = stdenv.lib.licenses.lgpl21Plus;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.unix;
+    changelog = [
+      # Some release notes are added to the github tags, though they are not
+      # always complete.
+      "https://github.com/fplll/fplll/releases/tag/${version}"
+      # Releases are announced on this mailing list. Unfortunately it is not
+      # possible to generate a direct link to the most recent announcement, but
+      # this search should find it.
+      "https://groups.google.com/forum/#!searchin/fplll-devel/FPLLL$20${version}"
+    ];
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [raskin timokau];
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/freeglut/default.nix b/pkgs/development/libraries/freeglut/default.nix
index 8412248b617..16c35347bc5 100644
--- a/pkgs/development/libraries/freeglut/default.nix
+++ b/pkgs/development/libraries/freeglut/default.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, libXi, libXrandr, libXxf86vm, libGL, libGLU, xlibsWrapper, cmake }:
 
-let version = "3.0.0";
+let version = "3.2.1";
 in stdenv.mkDerivation {
   pname = "freeglut";
   inherit version;
 
   src = fetchurl {
     url = "mirror://sourceforge/freeglut/freeglut-${version}.tar.gz";
-    sha256 = "18knkyczzwbmyg8hr4zh8a1i5ga01np2jzd1rwmsh7mh2n2vwhra";
+    sha256 = "0s6sk49q8ijgbsrrryb7dzqx2fa744jhx1wck5cz5jia2010w06l";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/freenect/default.nix b/pkgs/development/libraries/freenect/default.nix
index 41480789a08..9520542481c 100644
--- a/pkgs/development/libraries/freenect/default.nix
+++ b/pkgs/development/libraries/freenect/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, cmake, libusb, pkgconfig, freeglut, libGLU_combined, libXi, libXmu
+{ stdenv, lib, fetchFromGitHub, cmake, libusb, pkgconfig, freeglut, libGLU, libGL, libXi, libXmu
 , GLUT, Cocoa
  }:
 
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "0vnc7z2avckh4mccqq6alsd2z7xvsh3kaslc5b0gnfxw0j269gl6";
   };
 
-  buildInputs = [ libusb freeglut libGLU_combined libXi libXmu ]
+  buildInputs = [ libusb freeglut libGLU libGL libXi libXmu ]
     ++ lib.optionals stdenv.isDarwin [ GLUT Cocoa ];
 
   nativeBuildInputs = [ cmake pkgconfig ];
diff --git a/pkgs/development/libraries/freetds/default.nix b/pkgs/development/libraries/freetds/default.nix
index 0ff9cea3d27..855ca0385df 100644
--- a/pkgs/development/libraries/freetds/default.nix
+++ b/pkgs/development/libraries/freetds/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "Libraries to natively talk to Microsoft SQL Server and Sybase databases";
-    homepage    = http://www.freetds.org;
+    homepage    = https://www.freetds.org;
     license     = licenses.lgpl2;
     maintainers = with maintainers; [ peterhoeg ];
     platforms   = platforms.all;
diff --git a/pkgs/development/libraries/fribidi/default.nix b/pkgs/development/libraries/fribidi/default.nix
index 859258f5956..3b0b30f573b 100644
--- a/pkgs/development/libraries/fribidi/default.nix
+++ b/pkgs/development/libraries/fribidi/default.nix
@@ -20,6 +20,14 @@ stdenv.mkDerivation rec {
     sha256 = "0pckda4fcn0aw32lpycwdp25r2m7vca8zspq815ppi9gkwgg5das";
   };
 
+  patches = [
+    (fetchpatch {
+      name = "CVE-2019-18397.patch";
+      url = "https://github.com/fribidi/fribidi/commit/034c6e9a1d296286305f4cfd1e0072b879f52568.patch";
+      sha256 = "102xrbf1l5gvavkxd6csx8pj3rlgcw10c0y4h4d40yhn84b1p0y8";
+    })
+  ];
+
   postPatch = ''
     patchShebangs test
   '';
diff --git a/pkgs/development/libraries/ftgl/default.nix b/pkgs/development/libraries/ftgl/default.nix
index 289a5739985..a99228efcf4 100644
--- a/pkgs/development/libraries/ftgl/default.nix
+++ b/pkgs/development/libraries/ftgl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, freetype, libGLU_combined, OpenGL }:
+{ stdenv, fetchurl, freetype, libGL, libGLU, OpenGL }:
 
 let
   name = "ftgl-2.1.3-rc5";
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
     ++ (if stdenv.isDarwin then
       [ OpenGL ]
     else
-      [ libGLU_combined ])
+      [ libGL libGLU ])
     ;
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/gaia/default.nix b/pkgs/development/libraries/gaia/default.nix
new file mode 100644
index 00000000000..b154f80c1dd
--- /dev/null
+++ b/pkgs/development/libraries/gaia/default.nix
@@ -0,0 +1,87 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, libyaml
+, swig
+, eigen
+, pkgconfig
+, wafHook
+, makeWrapper
+, qt4
+, pythonPackages
+, pythonSupport ? false
+# Default to false since it breaks the build, see https://github.com/MTG/gaia/issues/11
+, stlfacadeSupport ? false
+, assertsSupport ? true
+, cyclopsSupport ? true
+}:
+
+assert pythonSupport -> pythonPackages != null;
+
+stdenv.mkDerivation rec {
+  pname = "gaia";
+  version = "2.4.6";
+
+  src = fetchFromGitHub {
+    owner = "MTG";
+    repo = "gaia";
+    rev = "v${version}";
+    sha256 = "03vmdq7ca4f7zp2f4sxyqa8sdpdma3mn9fz4z7d93qryl0bhi7z3";
+  };
+
+  # Fix installation error when waf tries to put files in /etc/
+  prePatch = ''
+  '' + lib.optionalString cyclopsSupport ''
+    substituteInPlace src/wscript \
+      --replace "/etc/cyclops" "$out/etc/cyclops" \
+      --replace "/etc/init.d" "$out/etc/init.d"
+  '';
+
+  nativeBuildInputs = [
+    wafHook
+    pkgconfig
+    swig
+  ]
+    # The gaiafusion binary inside $out/bin needs a shebangs patch, and
+    # wrapping with the appropriate $PYTHONPATH
+    ++ lib.optionals (pythonSupport) [
+      pythonPackages.wrapPython
+    ]
+  ;
+
+  buildInputs = [
+    libyaml
+    eigen
+    qt4
+  ];
+
+  propagatedBuildInputs = []
+    ++ lib.optionals (pythonSupport) [
+      # This is not exactly specified in upstream's README but it's needed by the
+      # resulting $out/bin/gaiafusion script
+      pythonPackages.pyyaml
+    ]
+  ;
+
+  wafConfigureFlags = []
+    ++ lib.optionals (pythonSupport) [ "--with-python-bindings" ]
+    ++ lib.optionals (stlfacadeSupport) [ "--with-stlfacade" ]
+    ++ lib.optionals (assertsSupport) [ "--with-asserts" ]
+    ++ lib.optionals (cyclopsSupport) [ "--with-cyclops" ]
+  ;
+
+  postFixup = ''
+  ''
+    + lib.optionalString pythonSupport ''
+      wrapPythonPrograms
+    ''
+  ;
+
+  meta = with lib; {
+    homepage = "https://github.com/MTG/gaia";
+    description = "General library to work with points in a semimetric space";
+    maintainers = with maintainers; [ doronbehar ];
+    platforms = platforms.x86; # upstream assume SSE2 / fails on ARM
+    license = licenses.agpl3;
+  };
+}
diff --git a/pkgs/development/libraries/garmintools/default.nix b/pkgs/development/libraries/garmintools/default.nix
index c1f9c6ad013..a086648c912 100644
--- a/pkgs/development/libraries/garmintools/default.nix
+++ b/pkgs/development/libraries/garmintools/default.nix
@@ -7,7 +7,8 @@ stdenv.mkDerivation {
   };
   buildInputs = [ libusb ];
   meta = {
-    homepage = https://code.google.com/archive/p/garmintools/; # community clone at https://github.com/ianmartin/garmintools
+    description = "Provides the ability to communicate with the Garmin Forerunner 305 via the USB interface";
+    homepage = "https://code.google.com/archive/p/garmintools/"; # community clone at https://github.com/ianmartin/garmintools
     license = stdenv.lib.licenses.gpl2;
     maintainers = [ stdenv.lib.maintainers.ocharles ];
     platforms = stdenv.lib.platforms.unix;
diff --git a/pkgs/development/libraries/gcab/default.nix b/pkgs/development/libraries/gcab/default.nix
index ee5988b30f5..c05bb95913e 100644
--- a/pkgs/development/libraries/gcab/default.nix
+++ b/pkgs/development/libraries/gcab/default.nix
@@ -1,38 +1,83 @@
-{ stdenv, fetchurl, gettext, gobject-introspection, pkgconfig
-, meson, ninja, glibcLocales, git, vala, glib, zlib, gnome3
+{ stdenv
+, fetchurl
+, gettext
+, gobject-introspection
+, gtk-doc
+, docbook_xsl
+, docbook_xml_dtd_43
+, pkgconfig
+, meson
+, ninja
+, git
+, vala
+, glib
+, zlib
+, gnome3
+, nixosTests
 }:
 
 stdenv.mkDerivation rec {
   pname = "gcab";
-  version = "1.2";
+  version = "1.3";
 
-  LC_ALL = "en_US.UTF-8";
+  outputs = [ "bin" "out" "dev" "devdoc" "installedTests" ];
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "038h5kk41si2hc9d9169rrlvp8xgsxq27kri7hv2vr39gvz9cbas";
+    sha256 = "1rv81b37d5ya7xpfdxrfk173jjcwabxyng7vafgwyl5myv44qc0h";
   };
 
-  nativeBuildInputs = [ meson ninja glibcLocales git pkgconfig vala gettext gobject-introspection ];
+  patches = [
+    # allow installing installed tests to a separate output
+    ./installed-tests-path.patch
+  ];
 
-  buildInputs = [ glib zlib ];
+  nativeBuildInputs = [
+    meson
+    ninja
+    git
+    pkgconfig
+    vala
+    gettext
+    gobject-introspection
+    gtk-doc
+    docbook_xsl
+    docbook_xml_dtd_43
+  ];
+
+  buildInputs = [
+    glib
+    zlib
+  ];
+
+  # required by libgcab-1.0.pc
+  propagatedBuildInputs = [
+    glib
+  ];
 
   mesonFlags = [
-    "-Ddocs=false"
-    "-Dtests=false"
+    "-Dinstalled_tests=true"
+    "-Dinstalled_test_prefix=${placeholder ''installedTests''}"
   ];
 
+  doCheck = true;
+
   passthru = {
     updateScript = gnome3.updateScript {
       packageName = pname;
       versionPolicy = "none";
     };
+
+    tests = {
+      installedTests = nixosTests.installed-tests.gcab;
+    };
   };
 
   meta = with stdenv.lib; {
+    description = "GObject library to create cabinet files";
+    homepage = "https://gitlab.gnome.org/GNOME/gcab";
+    license = licenses.lgpl21Plus;
+    maintainers = gnome3.maintainers;
     platforms = platforms.linux;
-    license = licenses.lgpl21;
-    homepage = "https://wiki.gnome.org/msitools";
-    maintainers = [ maintainers.lethalman ];
   };
 }
diff --git a/pkgs/development/libraries/gcab/installed-tests-path.patch b/pkgs/development/libraries/gcab/installed-tests-path.patch
new file mode 100644
index 00000000000..ab3b6b3fae3
--- /dev/null
+++ b/pkgs/development/libraries/gcab/installed-tests-path.patch
@@ -0,0 +1,21 @@
+diff --git a/meson_options.txt b/meson_options.txt
+index c1b1da1..9b76022 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -4,3 +4,4 @@
+ option('vapi', type : 'boolean', value : true, description: 'generate Vala bindings (requires introspection)')
+ option('tests', type : 'boolean', value : true, description : 'enable tests')
+ option('installed_tests', type : 'boolean', value : false, description : 'install tests for "as-installed" testing')
++option('installed_test_prefix', type: 'string', value: '', description: 'Prefix for installed tests')
+diff --git a/tests/meson.build b/tests/meson.build
+index 1e46e2a..aa780d0 100644
+--- a/tests/meson.build
++++ b/tests/meson.build
+@@ -1,5 +1,5 @@
+-installed_tests_metadir = join_paths(get_option('datadir'), 'installed-tests', 'libgcab-1.0')
+-installed_tests_execdir = join_paths(get_option('libexecdir'), 'installed-tests', 'libgcab-1.0')
++installed_tests_metadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', 'libgcab-1.0')
++installed_tests_execdir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', 'libgcab-1.0')
+ installed_tests_enabled = get_option('installed_tests')
+ installed_tests_template_tap = files('template-tap.test.in')
+ abs_installed_tests_execdir = join_paths(get_option('prefix'), installed_tests_execdir)
diff --git a/pkgs/development/libraries/gcr/default.nix b/pkgs/development/libraries/gcr/default.nix
index 1947d40dc85..cf0f22fdd40 100644
--- a/pkgs/development/libraries/gcr/default.nix
+++ b/pkgs/development/libraries/gcr/default.nix
@@ -1,49 +1,84 @@
-{ stdenv, fetchurl, pkgconfig, gettext, gnupg, p11-kit, glib
-, libgcrypt, libtasn1, dbus-glib, gtk3, pango, gdk-pixbuf, atk
-, gobject-introspection, makeWrapper, libxslt, vala, gnome3
-, python3 }:
+{ stdenv
+, fetchurl
+, pkgconfig
+, gettext
+, gnupg
+, p11-kit
+, glib
+, libgcrypt
+, libtasn1
+, gtk3
+, pango
+, gobject-introspection
+, makeWrapper
+, libxslt
+, vala
+, gnome3
+, python3
+}:
 
 stdenv.mkDerivation rec {
   pname = "gcr";
-  version = "3.33.4";
+  version = "3.34.0";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1hf06p4qfyywnb6334ysnr6aqxik3srb37glclvr4yhb3wzrjqnm";
-  };
-
-  passthru = {
-    updateScript = gnome3.updateScript { packageName = pname; };
+    sha256 = "0925snsixzkwh49xiayqmj6fcrmklqk8kyy0jkv7m64h9abm1pr9";
   };
 
   postPatch = ''
-    patchShebangs .
+    patchShebangs build/ gcr/fixtures/
   '';
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig gettext gobject-introspection libxslt makeWrapper vala ];
+  nativeBuildInputs = [
+    pkgconfig
+    gettext
+    gobject-introspection
+    libxslt
+    makeWrapper
+    vala
+  ];
+
+  buildInputs = [
+    gnupg
+    libgcrypt
+    libtasn1
+    pango
+  ];
 
-  buildInputs = [ gnupg libgcrypt libtasn1 dbus-glib pango gdk-pixbuf atk ];
+  propagatedBuildInputs = [
+    glib
+    gtk3
+    p11-kit
+  ];
 
-  propagatedBuildInputs = [ glib gtk3 p11-kit ];
+  checkInputs = [
+    python3
+  ];
 
-  checkInputs = [ python3 ];
   doCheck = false; # fails 21 out of 603 tests, needs dbus daemon
 
-  #enableParallelBuilding = true; issues on hydra
+  enableParallelBuilding = true;
 
   preFixup = ''
     wrapProgram "$out/bin/gcr-viewer" \
       --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
   '';
 
+  passthru = {
+    updateScript = gnome3.updateScript {
+      packageName = pname;
+    };
+  };
+
   meta = with stdenv.lib; {
     platforms = platforms.linux;
     maintainers = gnome3.maintainers;
     description = "GNOME crypto services (daemon and tools)";
-    homepage    = https://gitlab.gnome.org/GNOME/gcr;
-    license     = licenses.gpl2;
+    homepage = "https://gitlab.gnome.org/GNOME/gcr";
+    license = licenses.lgpl2Plus;
 
     longDescription = ''
       GCR is a library for displaying certificates, and crypto UI, accessing
diff --git a/pkgs/development/libraries/gdal/2.4.0.nix b/pkgs/development/libraries/gdal/2.4.0.nix
index d41b4c55f86..f914a112e10 100644
--- a/pkgs/development/libraries/gdal/2.4.0.nix
+++ b/pkgs/development/libraries/gdal/2.4.0.nix
@@ -16,6 +16,15 @@ stdenv.mkDerivation rec {
     sha256 = "09qgy36z0jc9w05373m4n0vm4j54almdzql6z9p9zr9pdp61syf3";
   };
 
+  patches = [
+    (fetchpatch {
+      name = "CVE-2019-17545.patch";
+      url = "https://github.com/OSGeo/gdal/commit/8cd2d2eb6327cf782a74dae263ffa6f89f46c93d.patch";
+      stripLen = 1;
+      sha256 = "06h88a659jcqf6ps1m91qy78s6s9krbkwnz28f5qh7032vlp6qpw";
+    })
+  ];
+
   buildInputs = [ unzip libjpeg libtiff libgeotiff libpng proj openssl sqlite
     libspatialite poppler hdf4 qhull giflib expat libxml2 proj ]
   ++ (with pythonPackages; [ python numpy wrapPython ])
diff --git a/pkgs/development/libraries/gdal/default.nix b/pkgs/development/libraries/gdal/default.nix
index bb53277075f..922877f6f46 100644
--- a/pkgs/development/libraries/gdal/default.nix
+++ b/pkgs/development/libraries/gdal/default.nix
@@ -20,7 +20,15 @@ stdenv.mkDerivation rec {
 
   sourceRoot = "source/gdal";
 
-  patches = [ ./001.3_0_1.darwin.patch ];
+  patches = [
+    ./001.3_0_1.darwin.patch
+    (fetchpatch {
+      name = "CVE-2019-17545.patch";
+      url = "https://github.com/OSGeo/gdal/commit/148115fcc40f1651a5d15fa34c9a8c528e7147bb.patch";
+      stripLen = 1;
+      sha256 = "0hai59hhvrci9xwjw4lp3wc1brn00imngmqrbbs8v9yr3b0fzbgs";
+    })
+  ];
 
   nativeBuildInputs = [ autoreconfHook ];
 
diff --git a/pkgs/development/libraries/gdk-pixbuf/default.nix b/pkgs/development/libraries/gdk-pixbuf/default.nix
index 4cf28b7dbee..9c2da3c5b69 100644
--- a/pkgs/development/libraries/gdk-pixbuf/default.nix
+++ b/pkgs/development/libraries/gdk-pixbuf/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, fixDarwinDylibNames, meson, ninja, pkgconfig, gettext, python3, libxml2, libxslt, docbook_xsl
+{ stdenv, fetchurl, nixosTests, fixDarwinDylibNames, meson, ninja, pkgconfig, gettext, python3, libxml2, libxslt, docbook_xsl
 , docbook_xml_dtd_43, gtk-doc, glib, libtiff, libjpeg, libpng, libX11, gnome3
-, jasper, gobject-introspection, doCheck ? false, makeWrapper }:
+, gobject-introspection, doCheck ? false, makeWrapper }:
 
 let
   pname = "gdk-pixbuf";
@@ -31,11 +31,10 @@ in stdenv.mkDerivation rec {
   ]
     ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
-  propagatedBuildInputs = [ glib libtiff libjpeg libpng jasper ];
+  propagatedBuildInputs = [ glib libtiff libjpeg libpng ];
 
   mesonFlags = [
     "-Ddocs=true"
-    "-Djasper=true"
     "-Dx11=true"
     "-Dgir=${if gobject-introspection != null then "true" else "false"}"
     "-Dgio_sniffing=false"
@@ -85,6 +84,10 @@ in stdenv.mkDerivation rec {
       packageName = pname;
     };
 
+    tests = {
+      installedTests = nixosTests.installed-tests.gdk-pixbuf;
+    };
+
     # gdk_pixbuf_moduledir variable from gdk-pixbuf-2.0.pc
     moduleDir = "lib/gdk-pixbuf-2.0/2.10.0/loaders";
   };
diff --git a/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
index 5a7dcd79299..06958be3213 100644
--- a/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
+++ b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
@@ -2,9 +2,9 @@ findGdkPixbufLoaders() {
 
 	# choose the longest loaders.cache
 	local loadersCache="$1/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
-	if [ -f "$loadersCache" ]; then
-		if [ -f "$GDK_PIXBUF_MODULE_FILE" ]; then
-			if [ $(cat "$loadersCache"|wc -l) -gt $(cat "$GDK_PIXBUF_MODULE_FILE"|wc -l) ]; then
+	if [[ -f "$loadersCache" ]]; then
+		if [[ -f "${GDK_PIXBUF_MODULE_FILE-}" ]]; then
+			if (( "$(cat "$loadersCache" | wc -l)" > "$(cat "$GDK_PIXBUF_MODULE_FILE" | wc -l)" )); then
 				export GDK_PIXBUF_MODULE_FILE="$loadersCache"
 			fi
 		else
diff --git a/pkgs/development/libraries/gegl/4.0.nix b/pkgs/development/libraries/gegl/4.0.nix
index 2edb47cb9bb..ca7163af49b 100644
--- a/pkgs/development/libraries/gegl/4.0.nix
+++ b/pkgs/development/libraries/gegl/4.0.nix
@@ -105,6 +105,9 @@ stdenv.mkDerivation rec {
     "-Dlibv4l=disabled"
     "-Dlibv4l2=disabled"
     "-Dumfpack=disabled"
+    # Disabled due to multiple vulnerabilities, see
+    # https://github.com/NixOS/nixpkgs/pull/73586
+    "-Djasper=disabled"
   ];
 
   # TODO: Fix missing math symbols in gegl seamless clone.
diff --git a/pkgs/development/libraries/geoip/default.nix b/pkgs/development/libraries/geoip/default.nix
index 4525f923286..d55983952b8 100644
--- a/pkgs/development/libraries/geoip/default.nix
+++ b/pkgs/development/libraries/geoip/default.nix
@@ -40,6 +40,6 @@ stdenv.mkDerivation rec {
     maintainers = with maintainers; [ thoughtpolice raskin ];
     license     = licenses.lgpl21;
     platforms   = platforms.unix;
-    homepage    = "http://maxmind.com";
+    homepage    = "https://www.maxmind.com";
   };
 }
diff --git a/pkgs/development/libraries/gettext/CVE-2018-18751-bison.patch b/pkgs/development/libraries/gettext/CVE-2018-18751-bison.patch
deleted file mode 100644
index b734c1c8b02..00000000000
--- a/pkgs/development/libraries/gettext/CVE-2018-18751-bison.patch
+++ /dev/null
@@ -1,323 +0,0 @@
-This patch was generated by re-running Bison 3.0.4 on pro-gram-gen.y after
-applying CVE-2018-18751.patch. This patch removes the need to add bison to
-nativeBuildInputs.
-
---- a/gettext-tools/src/po-gram-gen.c
-+++ b/gettext-tools/src/po-gram-gen.c
-@@ -568,9 +568,9 @@ static const yytype_uint8 yytranslate[] =
- static const yytype_uint16 yyrline[] =
- {
-        0,   169,   169,   171,   172,   173,   174,   179,   187,   195,
--     216,   240,   249,   258,   269,   278,   292,   301,   315,   321,
--     332,   338,   350,   361,   372,   376,   391,   414,   422,   434,
--     442
-+     216,   237,   246,   255,   266,   275,   289,   298,   312,   318,
-+     329,   335,   347,   358,   369,   373,   388,   411,   419,   431,
-+     439
- };
- #endif
-
-@@ -1419,14 +1419,11 @@ yyreduce:
-                   check_obsolete ((yyvsp[-3].message_intro), (yyvsp[-1].string));
-                   check_obsolete ((yyvsp[-3].message_intro), (yyvsp[0].rhs));
-                   if (!(yyvsp[-3].message_intro).obsolete || pass_obsolete_entries)
--                    {
--                      do_callback_message ((yyvsp[-3].message_intro).ctxt, string2, &(yyvsp[-3].message_intro).pos, (yyvsp[-1].string).string,
--                                           (yyvsp[0].rhs).rhs.msgstr, (yyvsp[0].rhs).rhs.msgstr_len, &(yyvsp[0].rhs).pos,
--                                           (yyvsp[-3].message_intro).prev_ctxt,
--                                           (yyvsp[-3].message_intro).prev_id, (yyvsp[-3].message_intro).prev_id_plural,
--                                           (yyvsp[-3].message_intro).obsolete);
--                      free ((yyvsp[-1].string).string);
--                    }
-+                    do_callback_message ((yyvsp[-3].message_intro).ctxt, string2, &(yyvsp[-3].message_intro).pos, (yyvsp[-1].string).string,
-+                                         (yyvsp[0].rhs).rhs.msgstr, (yyvsp[0].rhs).rhs.msgstr_len, &(yyvsp[0].rhs).pos,
-+                                         (yyvsp[-3].message_intro).prev_ctxt,
-+                                         (yyvsp[-3].message_intro).prev_id, (yyvsp[-3].message_intro).prev_id_plural,
-+                                         (yyvsp[-3].message_intro).obsolete);
-                   else
-                     {
-                       free_message_intro ((yyvsp[-3].message_intro));
-@@ -1435,11 +1432,11 @@ yyreduce:
-                       free ((yyvsp[0].rhs).rhs.msgstr);
-                     }
-                 }
--#line 1439 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1436 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 11:
--#line 241 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 238 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   check_obsolete ((yyvsp[-2].message_intro), (yyvsp[-1].stringlist));
-                   check_obsolete ((yyvsp[-2].message_intro), (yyvsp[0].string));
-@@ -1448,11 +1445,11 @@ yyreduce:
-                   string_list_destroy (&(yyvsp[-1].stringlist).stringlist);
-                   free ((yyvsp[0].string).string);
-                 }
--#line 1452 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1449 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 12:
--#line 250 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 247 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   check_obsolete ((yyvsp[-2].message_intro), (yyvsp[-1].stringlist));
-                   check_obsolete ((yyvsp[-2].message_intro), (yyvsp[0].rhs));
-@@ -1461,22 +1458,22 @@ yyreduce:
-                   string_list_destroy (&(yyvsp[-1].stringlist).stringlist);
-                   free ((yyvsp[0].rhs).rhs.msgstr);
-                 }
--#line 1465 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1462 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 13:
--#line 259 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 256 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   check_obsolete ((yyvsp[-1].message_intro), (yyvsp[0].stringlist));
-                   po_gram_error_at_line (&(yyvsp[-1].message_intro).pos, _("missing 'msgstr' section"));
-                   free_message_intro ((yyvsp[-1].message_intro));
-                   string_list_destroy (&(yyvsp[0].stringlist).stringlist);
-                 }
--#line 1476 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1473 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 14:
--#line 270 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 267 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   (yyval.message_intro).prev_ctxt = NULL;
-                   (yyval.message_intro).prev_id = NULL;
-@@ -1485,11 +1482,11 @@ yyreduce:
-                   (yyval.message_intro).pos = (yyvsp[0].string).pos;
-                   (yyval.message_intro).obsolete = (yyvsp[0].string).obsolete;
-                 }
--#line 1489 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1486 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 15:
--#line 279 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 276 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   check_obsolete ((yyvsp[-1].prev), (yyvsp[0].string));
-                   (yyval.message_intro).prev_ctxt = (yyvsp[-1].prev).ctxt;
-@@ -1499,11 +1496,11 @@ yyreduce:
-                   (yyval.message_intro).pos = (yyvsp[0].string).pos;
-                   (yyval.message_intro).obsolete = (yyvsp[0].string).obsolete;
-                 }
--#line 1503 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1500 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 16:
--#line 293 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 290 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   check_obsolete ((yyvsp[-1].string), (yyvsp[0].stringlist));
-                   (yyval.prev).ctxt = (yyvsp[-1].string).string;
-@@ -1512,11 +1509,11 @@ yyreduce:
-                   (yyval.prev).pos = (yyvsp[-1].string).pos;
-                   (yyval.prev).obsolete = (yyvsp[-1].string).obsolete;
-                 }
--#line 1516 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1513 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 17:
--#line 302 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 299 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   check_obsolete ((yyvsp[-2].string), (yyvsp[-1].stringlist));
-                   check_obsolete ((yyvsp[-2].string), (yyvsp[0].string));
-@@ -1526,21 +1523,21 @@ yyreduce:
-                   (yyval.prev).pos = (yyvsp[-2].string).pos;
-                   (yyval.prev).obsolete = (yyvsp[-2].string).obsolete;
-                 }
--#line 1530 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1527 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 18:
--#line 316 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 313 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   (yyval.string).string = NULL;
-                   (yyval.string).pos = (yyvsp[0].pos).pos;
-                   (yyval.string).obsolete = (yyvsp[0].pos).obsolete;
-                 }
--#line 1540 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1537 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 19:
--#line 322 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 319 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   check_obsolete ((yyvsp[-2].pos), (yyvsp[-1].stringlist));
-                   check_obsolete ((yyvsp[-2].pos), (yyvsp[0].pos));
-@@ -1548,21 +1545,21 @@ yyreduce:
-                   (yyval.string).pos = (yyvsp[0].pos).pos;
-                   (yyval.string).obsolete = (yyvsp[0].pos).obsolete;
-                 }
--#line 1552 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1549 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 20:
--#line 333 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 330 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   (yyval.string).string = NULL;
-                   (yyval.string).pos = (yyvsp[0].pos).pos;
-                   (yyval.string).obsolete = (yyvsp[0].pos).obsolete;
-                 }
--#line 1562 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1559 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 21:
--#line 339 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 336 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   check_obsolete ((yyvsp[-2].pos), (yyvsp[-1].stringlist));
-                   check_obsolete ((yyvsp[-2].pos), (yyvsp[0].pos));
-@@ -1570,11 +1567,11 @@ yyreduce:
-                   (yyval.string).pos = (yyvsp[0].pos).pos;
-                   (yyval.string).obsolete = (yyvsp[0].pos).obsolete;
-                 }
--#line 1574 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1571 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 22:
--#line 351 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 348 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   check_obsolete ((yyvsp[-1].pos), (yyvsp[0].stringlist));
-                   plural_counter = 0;
-@@ -1582,30 +1579,30 @@ yyreduce:
-                   (yyval.string).pos = (yyvsp[-1].pos).pos;
-                   (yyval.string).obsolete = (yyvsp[-1].pos).obsolete;
-                 }
--#line 1586 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1583 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 23:
--#line 362 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 359 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   check_obsolete ((yyvsp[-1].pos), (yyvsp[0].stringlist));
-                   (yyval.string).string = string_list_concat_destroy (&(yyvsp[0].stringlist).stringlist);
-                   (yyval.string).pos = (yyvsp[-1].pos).pos;
-                   (yyval.string).obsolete = (yyvsp[-1].pos).obsolete;
-                 }
--#line 1597 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1594 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 24:
--#line 373 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 370 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   (yyval.rhs) = (yyvsp[0].rhs);
-                 }
--#line 1605 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1602 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 25:
--#line 377 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 374 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   check_obsolete ((yyvsp[-1].rhs), (yyvsp[0].rhs));
-                   (yyval.rhs).rhs.msgstr = XNMALLOC ((yyvsp[-1].rhs).rhs.msgstr_len + (yyvsp[0].rhs).rhs.msgstr_len, char);
-@@ -1617,11 +1614,11 @@ yyreduce:
-                   (yyval.rhs).pos = (yyvsp[-1].rhs).pos;
-                   (yyval.rhs).obsolete = (yyvsp[-1].rhs).obsolete;
-                 }
--#line 1621 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1618 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 26:
--#line 392 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 389 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   check_obsolete ((yyvsp[-4].pos), (yyvsp[-3].pos));
-                   check_obsolete ((yyvsp[-4].pos), (yyvsp[-2].number));
-@@ -1640,11 +1637,11 @@ yyreduce:
-                   (yyval.rhs).pos = (yyvsp[-4].pos).pos;
-                   (yyval.rhs).obsolete = (yyvsp[-4].pos).obsolete;
-                 }
--#line 1644 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1641 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 27:
--#line 415 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 412 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   string_list_init (&(yyval.stringlist).stringlist);
-                   string_list_append (&(yyval.stringlist).stringlist, (yyvsp[0].string).string);
-@@ -1652,11 +1649,11 @@ yyreduce:
-                   (yyval.stringlist).pos = (yyvsp[0].string).pos;
-                   (yyval.stringlist).obsolete = (yyvsp[0].string).obsolete;
-                 }
--#line 1656 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1653 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 28:
--#line 423 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 420 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   check_obsolete ((yyvsp[-1].stringlist), (yyvsp[0].string));
-                   (yyval.stringlist).stringlist = (yyvsp[-1].stringlist).stringlist;
-@@ -1665,11 +1662,11 @@ yyreduce:
-                   (yyval.stringlist).pos = (yyvsp[-1].stringlist).pos;
-                   (yyval.stringlist).obsolete = (yyvsp[-1].stringlist).obsolete;
-                 }
--#line 1669 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1666 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 29:
--#line 435 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 432 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   string_list_init (&(yyval.stringlist).stringlist);
-                   string_list_append (&(yyval.stringlist).stringlist, (yyvsp[0].string).string);
-@@ -1677,11 +1674,11 @@ yyreduce:
-                   (yyval.stringlist).pos = (yyvsp[0].string).pos;
-                   (yyval.stringlist).obsolete = (yyvsp[0].string).obsolete;
-                 }
--#line 1681 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1678 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-   case 30:
--#line 443 "po-gram-gen.y" /* yacc.c:1646  */
-+#line 440 "po-gram-gen.y" /* yacc.c:1646  */
-     {
-                   check_obsolete ((yyvsp[-1].stringlist), (yyvsp[0].string));
-                   (yyval.stringlist).stringlist = (yyvsp[-1].stringlist).stringlist;
-@@ -1690,11 +1687,11 @@ yyreduce:
-                   (yyval.stringlist).pos = (yyvsp[-1].stringlist).pos;
-                   (yyval.stringlist).obsolete = (yyvsp[-1].stringlist).obsolete;
-                 }
--#line 1694 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1691 "po-gram-gen.c" /* yacc.c:1646  */
-     break;
-
-
--#line 1698 "po-gram-gen.c" /* yacc.c:1646  */
-+#line 1695 "po-gram-gen.c" /* yacc.c:1646  */
-       default: break;
-     }
-   /* User semantic actions sometimes alter yychar, and that requires
diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix
index 9547c6c31ad..157f801d2f2 100644
--- a/pkgs/development/libraries/gettext/default.nix
+++ b/pkgs/development/libraries/gettext/default.nix
@@ -1,24 +1,16 @@
-{ stdenv, lib, fetchurl, libiconv, xz, bison, automake115x, autoconf }:
+{ stdenv, lib, fetchurl, libiconv, xz }:
 
-let allowBisonDependency = !stdenv.isDarwin; in
 stdenv.mkDerivation rec {
   pname = "gettext";
-  version = "0.19.8.1";
+  version = "0.20.1";
 
   src = fetchurl {
     url = "mirror://gnu/gettext/${pname}-${version}.tar.gz";
-    sha256 = "0hsw28f9q9xaggjlsdp2qmbp2rbd1mp0njzan2ld9kiqwkq2m57z";
+    sha256 = "0p3zwkk27wm2m2ccfqm57nj7vqkmfpn7ja1nf65zmhz8qqs5chb6";
   };
   patches = [
     ./absolute-paths.diff
-    (fetchurl {
-      name = "CVE-2018-18751.patch";
-      url = "https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=patch;h=dce3a16e5e9368245735e29bf498dcd5e3e474a4";
-      sha256 = "1lpjwwcjr1sb879faj0xyzw02kma0ivab6xwn3qciy13qy6fq5xn";
-    })
-  ] ++ lib.optionals (!allowBisonDependency) [
-    # Only necessary for CVE-2018-18751.patch:
-    ./CVE-2018-18751-bison.patch
+    ./gettext.git-2336451ed68d91ff4b5ae1acbc1eca30e47a86a9.patch
   ];
 
   outputs = [ "out" "man" "doc" "info" ];
@@ -29,10 +21,6 @@ stdenv.mkDerivation rec {
 
   configureFlags = [
      "--disable-csharp" "--with-xz"
-     # avoid retaining reference to CF during stdenv bootstrap
-  ] ++ lib.optionals stdenv.isDarwin [
-    "gt_cv_func_CFPreferencesCopyAppValue=no"
-    "gt_cv_func_CFLocaleCopyCurrent=no"
   ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     # On cross building, gettext supposes that the wchar.h from libc
     # does not fulfill gettext needs, so it tries to work with its
@@ -54,14 +42,6 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     xz
     xz.bin
-  ]
-  # Only necessary for CVE-2018-18751.patch (unless CVE-2018-18751-bison.patch
-  # is also applied):
-  ++ lib.optional allowBisonDependency bison
-  ++ [
-    # Only necessary for CVE-2018-18751.patch:
-    automake115x
-    autoconf
   ];
   # HACK, see #10874 (and 14664)
   buildInputs = stdenv.lib.optional (!stdenv.isLinux && !stdenv.hostPlatform.isCygwin) libiconv;
diff --git a/pkgs/development/libraries/gettext/gettext-setup-hook.sh b/pkgs/development/libraries/gettext/gettext-setup-hook.sh
index ad3763c29b6..69020146f84 100644
--- a/pkgs/development/libraries/gettext/gettext-setup-hook.sh
+++ b/pkgs/development/libraries/gettext/gettext-setup-hook.sh
@@ -10,7 +10,7 @@ addEnvHooks "$hostOffset" gettextDataDirsHook
 
 # libintl must be listed in load flags on non-Glibc
 # it doesn't hurt to have it in Glibc either though
-if [ -n "@gettextNeedsLdflags@" -a -z "$dontAddExtraLibs" ]; then
+if [ -n "@gettextNeedsLdflags@" -a -z "${dontAddExtraLibs-}" ]; then
     # See pkgs/build-support/setup-hooks/role.bash
     getHostRole
     export NIX_${role_pre}LDFLAGS+=" -lintl"
diff --git a/pkgs/development/libraries/gettext/gettext.git-2336451ed68d91ff4b5ae1acbc1eca30e47a86a9.patch b/pkgs/development/libraries/gettext/gettext.git-2336451ed68d91ff4b5ae1acbc1eca30e47a86a9.patch
new file mode 100644
index 00000000000..4a19b11507a
--- /dev/null
+++ b/pkgs/development/libraries/gettext/gettext.git-2336451ed68d91ff4b5ae1acbc1eca30e47a86a9.patch
@@ -0,0 +1,82 @@
+From 2336451ed68d91ff4b5ae1acbc1eca30e47a86a9 Mon Sep 17 00:00:00 2001
+From: Bruno Haible <bruno@clisp.org>
+Date: Sun, 19 May 2019 13:10:06 +0200
+Subject: [PATCH] msgmerge: Fix behaviour of --for-msgfmt on PO files with no
+ translations.
+
+Reported by Don Lawrence <dlawrence@iecok.com>
+in <https://lists.freedesktop.org/archives/p11-glue/2019-May/000700.html>
+via Daiki Ueno
+in <https://lists.gnu.org/archive/html/bug-gettext/2019-05/msg00124.html>.
+
+* gettext-tools/src/msgmerge.c (main): Treat force_po like true if for_msgfmt
+is true.
+* gettext-tools/tests/msgmerge-26: Add test of PO file with no translations.
+---
+ gettext-tools/src/msgmerge.c    |  4 ++--
+ gettext-tools/tests/msgmerge-26 | 36 +++++++++++++++++++++++++++++++++---
+ 2 files changed, 35 insertions(+), 5 deletions(-)
+
+diff --git a/gettext-tools/src/msgmerge.c b/gettext-tools/src/msgmerge.c
+index cd762c0..92c9b7a 100644
+--- a/gettext-tools/src/msgmerge.c
++++ b/gettext-tools/src/msgmerge.c
+@@ -520,8 +520,8 @@ There is NO WARRANTY, to the extent permitted by law.\n\
+   else
+     {
+       /* Write the merged message list out.  */
+-      msgdomain_list_print (result, output_file, output_syntax, force_po,
+-                            false);
++      msgdomain_list_print (result, output_file, output_syntax,
++                            for_msgfmt || force_po, false);
+     }
+ 
+   exit (EXIT_SUCCESS);
+diff --git a/gettext-tools/tests/msgmerge-26 b/gettext-tools/tests/msgmerge-26
+index cd3862e..b86f7a0 100755
+--- a/gettext-tools/tests/msgmerge-26
++++ b/gettext-tools/tests/msgmerge-26
+@@ -73,7 +73,37 @@ msgstr "Papaya"
+ EOF
+ 
+ : ${DIFF=diff}
+-${DIFF} mm-test26.ok mm-test26.out
+-result=$?
++${DIFF} mm-test26.ok mm-test26.out || Exit 1
+ 
+-exit $result
++# Test with a PO file that has no translated messages.
++
++cat <<\EOF > mm-test26a.in1
++msgid ""
++msgstr ""
++"Content-Type: text/plain; charset=UTF-8\n"
++
++msgid "Hello world"
++msgstr "Hallo Welt"
++EOF
++
++cat <<\EOF > mm-test26a.in2
++msgid ""
++msgstr ""
++"Content-Type: text/plain; charset=ASCII\n"
++
++msgid "Hello, world!"
++msgstr ""
++EOF
++
++: ${MSGMERGE=msgmerge}
++${MSGMERGE} --for-msgfmt -o mm-test26a.tmp mm-test26a.in1 mm-test26a.in2 \
++    || Exit 1
++LC_ALL=C tr -d '\r' < mm-test26a.tmp > mm-test26a.out || Exit 1
++
++cat <<\EOF > mm-test26a.ok
++msgid ""
++msgstr "Content-Type: text/plain; charset=UTF-8\n"
++EOF
++
++: ${DIFF=diff}
++${DIFF} mm-test26a.ok mm-test26a.out || Exit 1
+-- 
+1.9.1
+
diff --git a/pkgs/development/libraries/giflib/default.nix b/pkgs/development/libraries/giflib/default.nix
index e047bdbb648..5d7b95136dd 100644
--- a/pkgs/development/libraries/giflib/default.nix
+++ b/pkgs/development/libraries/giflib/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     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 ];
+    maintainers = with stdenv.lib.maintainers; [ ];
     branch = "5.2";
   };
 }
diff --git a/pkgs/development/libraries/gjs/default.nix b/pkgs/development/libraries/gjs/default.nix
new file mode 100644
index 00000000000..7facdc1426f
--- /dev/null
+++ b/pkgs/development/libraries/gjs/default.nix
@@ -0,0 +1,86 @@
+{ fetchurl
+, stdenv
+, pkgconfig
+, gnome3
+, gtk3
+, atk
+, gobject-introspection
+, spidermonkey_60
+, pango
+, cairo
+, readline
+, glib
+, libxml2
+, dbus
+, gdk-pixbuf
+, makeWrapper
+, nixosTests
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gjs";
+  version = "1.58.3";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gjs/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1bkksx362007zs8c31ydygb29spwa5g5kch1ad2grc2sp53wv7ya";
+  };
+
+  outputs = [ "out" "dev" "installedTests" ];
+
+  nativeBuildInputs = [
+    pkgconfig
+    makeWrapper
+    libxml2 # for xml-stripblanks
+  ];
+
+  buildInputs = [
+    gobject-introspection
+    cairo
+    readline
+    spidermonkey_60
+    dbus # for dbus-run-session
+  ];
+
+  propagatedBuildInputs = [
+    glib
+  ];
+
+  configureFlags = [
+    "--enable-installed-tests"
+  ];
+
+  postPatch = ''
+    for f in installed-tests/*.test.in; do
+      substituteInPlace "$f" --subst-var-by pkglibexecdir "$installedTests/libexec/gjs"
+    done
+  '';
+
+  postInstall = ''
+    moveToOutput "share/installed-tests" "$installedTests"
+    moveToOutput "libexec/gjs/installed-tests" "$installedTests"
+
+    wrapProgram "$installedTests/libexec/gjs/installed-tests/minijasmine" \
+      --prefix GI_TYPELIB_PATH : "${stdenv.lib.makeSearchPath "lib/girepository-1.0" [ gtk3 atk pango.out gdk-pixbuf ]}:$installedTests/libexec/gjs/installed-tests"
+  '';
+
+  separateDebugInfo = stdenv.isLinux;
+
+  passthru = {
+    tests = {
+      installed-tests = nixosTests.installed-tests.gjs;
+    };
+
+    updateScript = gnome3.updateScript {
+      packageName = "gjs";
+    };
+  };
+
+  meta = with stdenv.lib; {
+    description = "JavaScript bindings for GNOME";
+    homepage = "https://gitlab.gnome.org/GNOME/gjs/blob/master/doc/Home.md";
+    license = licenses.lgpl2Plus;
+    maintainers = gnome3.maintainers;
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/gle/default.nix b/pkgs/development/libraries/gle/default.nix
index dd72637f2eb..d656473ba80 100644
--- a/pkgs/development/libraries/gle/default.nix
+++ b/pkgs/development/libraries/gle/default.nix
@@ -1,7 +1,7 @@
-{stdenv, fetchurl, libGLU_combined, freeglut, libX11, libXt, libXmu, libXi, libXext}:
+{stdenv, fetchurl, freeglut, libX11, libXt, libXmu, libXi, libXext, libGL, libGLU}:
 stdenv.mkDerivation {
   name = "gle-3.1.0";
-  buildInputs = [libGLU_combined freeglut libX11 libXt libXmu libXi libXext];
+  buildInputs = [libGLU libGL freeglut libX11 libXt libXmu libXi libXext];
   src = fetchurl {
     urls = [
       "mirror://sourceforge/project/gle/gle/gle-3.1.0/gle-3.1.0.tar.gz"
diff --git a/pkgs/development/libraries/glfw/3.x.nix b/pkgs/development/libraries/glfw/3.x.nix
index 6532d6f81b5..cf988d32399 100644
--- a/pkgs/development/libraries/glfw/3.x.nix
+++ b/pkgs/development/libraries/glfw/3.x.nix
@@ -1,16 +1,17 @@
-{ stdenv, lib, fetchFromGitHub, cmake, libGL, libXrandr, libXinerama, libXcursor, libX11
+{ stdenv, lib, fetchFromGitHub, cmake
+, libGL, libXrandr, libXinerama, libXcursor, libX11, libXi, libXext
 , Cocoa, Kernel, fixDarwinDylibNames
 }:
 
 stdenv.mkDerivation rec {
-  version = "3.2.1";
+  version = "3.3";
   pname = "glfw";
 
   src = fetchFromGitHub {
     owner = "glfw";
     repo = "GLFW";
     rev = version;
-    sha256 = "0gq6ad38b3azk0w2yy298yz2vmg2jmf9g0ydidqbmiswpk25ills";
+    sha256 = "1f1hqpqffzg46z33ybs2c3akmkly7b3qmgp5byk50nvad6g2pm4p";
   };
 
   enableParallelBuilding = true;
@@ -19,7 +20,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  buildInputs = [ libX11 libXrandr libXinerama libXcursor ]
+  buildInputs = [ libX11 libXrandr libXinerama libXcursor libXi libXext ]
     ++ lib.optionals stdenv.isDarwin [ Cocoa Kernel fixDarwinDylibNames ];
 
   cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
@@ -32,7 +33,7 @@ stdenv.mkDerivation rec {
     description = "Multi-platform library for creating OpenGL contexts and managing input, including keyboard, mouse, joystick and time";
     homepage = https://www.glfw.org/;
     license = licenses.zlib;
-    maintainers = with maintainers; [ marcweber ];
+    maintainers = with maintainers; [ marcweber twey ];
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/glib-networking/default.nix b/pkgs/development/libraries/glib-networking/default.nix
index a571fffebf0..802a18dfda5 100644
--- a/pkgs/development/libraries/glib-networking/default.nix
+++ b/pkgs/development/libraries/glib-networking/default.nix
@@ -79,7 +79,7 @@ stdenv.mkDerivation rec {
     };
 
     tests = {
-      installedTests = nixosTests.glib-networking;
+      installedTests = nixosTests.installed-tests.glib-networking;
     };
   };
 
diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix
index 68bc169bb89..706e99179f5 100644
--- a/pkgs/development/libraries/glib/default.nix
+++ b/pkgs/development/libraries/glib/default.nix
@@ -48,11 +48,11 @@ in
 
 stdenv.mkDerivation rec {
   pname = "glib";
-  version = "2.62.1";
+  version = "2.62.3";
 
   src = fetchurl {
     url = "mirror://gnome/sources/glib/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1pzrw2x9r0kyghrvwdbx3nqn2wcrrxy962f5gbdacwh83m705n9x";
+    sha256 = "1i2mlrd351dnmpfi465qmx9rhgyff01j29a2x3lczzyky34ss024";
   };
 
   patches = optionals stdenv.isDarwin [
diff --git a/pkgs/development/libraries/glib/setup-hook.sh b/pkgs/development/libraries/glib/setup-hook.sh
index a1cb1f40c58..37c750b8db6 100644
--- a/pkgs/development/libraries/glib/setup-hook.sh
+++ b/pkgs/development/libraries/glib/setup-hook.sh
@@ -1,9 +1,11 @@
 
 make_glib_find_gsettings_schemas() {
     # For packages that need gschemas of other packages (e.g. empathy)
-    if [ -d "$1"/share/gsettings-schemas/*/glib-2.0/schemas ]; then
-        addToSearchPath GSETTINGS_SCHEMAS_PATH "$1/share/gsettings-schemas/"*
-    fi
+    for maybe_dir in "$1"/share/gsettings-schemas/*; do
+        if [[ -d "$maybe_dir/glib-2.0/schemas" ]]; then
+            addToSearchPath GSETTINGS_SCHEMAS_PATH "$maybe_dir"
+        fi
+    done
 }
 addEnvHooks "$hostOffset" make_glib_find_gsettings_schemas
 
diff --git a/pkgs/development/libraries/glibc/2.27-CVE-2019-19126.patch b/pkgs/development/libraries/glibc/2.27-CVE-2019-19126.patch
new file mode 100644
index 00000000000..2c558f53b73
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.27-CVE-2019-19126.patch
@@ -0,0 +1,18 @@
+Adapted from https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=patch;h=4d5cfeb510125345cb41431afc9022492994cffa, omitting changes to NEWS
+diff --git a/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h b/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h
+index 1943691..ac694c0 100644
+--- a/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h
++++ b/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h
+@@ -31,7 +31,8 @@
+    environment variable, LD_PREFER_MAP_32BIT_EXEC.  */
+ #define EXTRA_LD_ENVVARS \
+   case 21:								  \
+-    if (memcmp (envline, "PREFER_MAP_32BIT_EXEC", 21) == 0)		  \
++    if (!__libc_enable_secure						  \
++	&& memcmp (envline, "PREFER_MAP_32BIT_EXEC", 21) == 0)		  \
+       GLRO(dl_x86_cpu_features).feature[index_arch_Prefer_MAP_32BIT_EXEC] \
+ 	|= bit_arch_Prefer_MAP_32BIT_EXEC;				  \
+     break;
+-- 
+2.9.3
+
diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix
index edf4d135aba..32be2205bcc 100644
--- a/pkgs/development/libraries/glibc/common.nix
+++ b/pkgs/development/libraries/glibc/common.nix
@@ -98,7 +98,10 @@ stdenv.mkDerivation ({
       # https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f51c8367685dc888a02f7304c729ed5277904aff
       ./CVE-2018-11237.patch
     ]
-    ++ lib.optional stdenv.isx86_64 ./fix-x64-abi.patch
+    ++ lib.optionals stdenv.isx86_64 [
+      ./fix-x64-abi.patch
+      ./2.27-CVE-2019-19126.patch
+    ]
     ++ lib.optional stdenv.hostPlatform.isMusl ./fix-rpc-types-musl-conflicts.patch
     ++ lib.optional stdenv.buildPlatform.isDarwin ./darwin-cross-build.patch
 
diff --git a/pkgs/development/libraries/glm/default.nix b/pkgs/development/libraries/glm/default.nix
index e7d4c934db8..88b33601ee7 100644
--- a/pkgs/development/libraries/glm/default.nix
+++ b/pkgs/development/libraries/glm/default.nix
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
     homepage = http://glm.g-truc.net/;
     license = licenses.mit;
     platforms = platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
+    maintainers = with stdenv.lib.maintainers; [ ];
   };
 }
 
diff --git a/pkgs/development/libraries/glog/default.nix b/pkgs/development/libraries/glog/default.nix
index 6aa300e2b62..792217043da 100644
--- a/pkgs/development/libraries/glog/default.nix
+++ b/pkgs/development/libraries/glog/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, perl }:
+{ stdenv, lib, fetchFromGitHub, fetchpatch, autoreconfHook, perl }:
 
 stdenv.mkDerivation rec {
   pname = "glog";
@@ -11,6 +11,15 @@ stdenv.mkDerivation rec {
     sha256 = "1xd3maiipfbxmhc9rrblc5x52nxvkwxp14npg31y5njqvkvzax9b";
   };
 
+  patches = lib.optionals stdenv.hostPlatform.isMusl [
+    # TODO: Remove at next release that includes this commit.
+    (fetchpatch {
+      name = "glog-Fix-symbolize_unittest-for-musl-builds.patch";
+      url = "https://github.com/google/glog/commit/834dd780bf1fe0704b8ed0350ca355a55f711a9f.patch";
+      sha256 = "0k4lanxg85anyvjsj3mh93bcgds8gizpiamcy2zvs3yyfjl40awn";
+    })
+  ];
+
   nativeBuildInputs = [ autoreconfHook ];
 
   checkInputs = [ perl ];
diff --git a/pkgs/development/libraries/gloox/default.nix b/pkgs/development/libraries/gloox/default.nix
index 51e981a2a33..3343c78bea1 100644
--- a/pkgs/development/libraries/gloox/default.nix
+++ b/pkgs/development/libraries/gloox/default.nix
@@ -11,7 +11,7 @@ assert idnSupport -> libidn != null;
 with stdenv.lib;
 
 let
-  version = "1.0.22";
+  version = "1.0.23";
 in
 stdenv.mkDerivation {
   pname = "gloox";
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "https://camaya.net/download/gloox-${version}.tar.bz2";
-    sha256 = "0r69gq8if9yy1amjzl7qrq9lzhhna7qgz905ln4wvkwchha1ppja";
+    sha256 = "12jz8glg9zmyk0iyv1ywf5i0hq93dfq8lvn6lyjgy8730w66mjwp";
   };
 
   buildInputs = [ ]
@@ -31,7 +31,7 @@ stdenv.mkDerivation {
     description = "A portable high-level Jabber/XMPP library for C++";
     homepage = http://camaya.net/gloox;
     license = licenses.gpl3;
-    maintainers = with maintainers; [ fuuzetsu ];
+    maintainers = with maintainers; [ ];
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/glui/default.nix b/pkgs/development/libraries/glui/default.nix
index 59357bf6fb1..d84a9227c3b 100644
--- a/pkgs/development/libraries/glui/default.nix
+++ b/pkgs/development/libraries/glui/default.nix
@@ -1,8 +1,27 @@
-{stdenv, fetchurl, freeglut, libGLU_combined, libXmu, libXext, libX11, libXi}:
-stdenv.mkDerivation {
-  name = "glui-2.35";
-  buildInputs = [freeglut libGLU_combined libXmu libXext libX11 libXi];
-  preConfigure = ''cd src'';
+{ stdenv
+, fetchFromGitHub
+, freeglut
+, libGL
+, libGLU
+, libX11
+, libXext
+, libXi
+, libXmu
+}:
+
+stdenv.mkDerivation rec {
+  pname = "glui";
+  version = "2.37";
+
+  src = fetchFromGitHub {
+    owner = "libglui";
+    repo = "glui";
+    rev = version;
+    sha256 = "0qg2y8w95s03zay1qsqs8pqxxlg6l9kwm7rrs1qmx0h22sxb360i";
+  };
+
+  buildInputs = [ freeglut libGLU libGL libXmu libXext libX11 libXi ];
+
   installPhase = ''
     mkdir -p "$out"/{bin,lib,share/glui/doc,include}
     cp -rT bin "$out/bin"
@@ -11,14 +30,11 @@ stdenv.mkDerivation {
     cp -rT doc "$out/share/glui/doc"
     cp LICENSE.txt "$out/share/glui/doc"
   '';
-  src = fetchurl {
-    url = "mirror://sourceforge/project/glui/Source/2.36/glui-2.36.tgz";
-    sha256 = "11r7f0k5jlbl825ibhm5c6bck0fn1hbliya9x1f253ikry1mxvy1";
-  };
-  meta = {
+
+  meta = with stdenv.lib; {
     description = ''A user interface library using OpenGL'';
-    license = stdenv.lib.licenses.zlib ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
+    license = licenses.zlib ;
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/gmime/3.nix b/pkgs/development/libraries/gmime/3.nix
index 81546e5c127..754d5aa7411 100644
--- a/pkgs/development/libraries/gmime/3.nix
+++ b/pkgs/development/libraries/gmime/3.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, pkgconfig, glib, zlib, gnupg, gpgme, libidn2, libunistring, gobject-introspection }:
 
 stdenv.mkDerivation rec {
-  version = "3.2.3";
+  version = "3.2.5";
   pname = "gmime";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gmime/3.2/${pname}-${version}.tar.xz";
-    sha256 = "04bk7rqs5slpvlvqf11i6s37s8b2xn6acls8smyl9asjnpp7a23a";
+    sha256 = "0ndsg1z1kq4w4caascydvialpyn4rfbjdn7xclzbzhw53x85cxgv";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/gmp/6.x.nix b/pkgs/development/libraries/gmp/6.x.nix
index d9ea5a71dd3..4b35f7828fe 100644
--- a/pkgs/development/libraries/gmp/6.x.nix
+++ b/pkgs/development/libraries/gmp/6.x.nix
@@ -37,7 +37,9 @@ let self = stdenv.mkDerivation rec {
     "--build=${stdenv.buildPlatform.config}"
   ] ++ optional (cxx && stdenv.isDarwin) "CPPFLAGS=-fexceptions"
     ++ optional (stdenv.isDarwin && stdenv.is64bit) "ABI=64"
-    ++ optional (with stdenv.hostPlatform; (useAndroidPrebuilt || useiOSPrebuilt) && !isx86) "--disable-assembly"
+    # to build a .dll on windows, we need --disable-static + --enable-shared
+    # see https://gmplib.org/manual/Notes-for-Particular-Systems.html
+    ++ optional (!withStatic && stdenv.hostPlatform.isWindows) "--disable-static --enable-shared"
     ;
 
   doCheck = true; # not cross;
diff --git a/pkgs/development/libraries/gnu-efi/default.nix b/pkgs/development/libraries/gnu-efi/default.nix
index 6ae1f47e38c..b5b8add2db5 100644
--- a/pkgs/development/libraries/gnu-efi/default.nix
+++ b/pkgs/development/libraries/gnu-efi/default.nix
@@ -1,16 +1,24 @@
-{ stdenv, buildPackages, fetchurl, pciutils }:
+{ stdenv, buildPackages, fetchurl, fetchpatch, pciutils }:
 
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
   pname = "gnu-efi";
-  version = "3.0.9";
+  version = "3.0.11";
 
   src = fetchurl {
     url = "mirror://sourceforge/gnu-efi/${pname}-${version}.tar.bz2";
-    sha256 = "1w3p4aqlc5j93q44la7dc8cr3hky20zvsd0h0k2lyzhwmrzfl5b7";
+    sha256 = "1ffnc4xbzfggs37ymrgfx76j56kk2644c081ivhr2bjkla9ag3gj";
   };
 
+  patches = [
+    # Fix build on armv6l
+    (fetchpatch {
+      url = "https://sourceforge.net/p/gnu-efi/patches/_discuss/thread/25bb273a18/9c4d/attachment/0001-Fix-ARCH-on-armv6-and-other-32-bit-ARM-platforms.patch";
+      sha256 = "0pj03h20g2bbz6fr753bj1scry6919h57l1h86z3b6q7hqfj0b4r";
+    })
+  ];
+
   buildInputs = [ pciutils ];
 
   hardeningDisable = [ "stackprotector" ];
diff --git a/pkgs/development/libraries/gnutls/default.nix b/pkgs/development/libraries/gnutls/default.nix
index 1b97c369edf..deef141c5df 100644
--- a/pkgs/development/libraries/gnutls/default.nix
+++ b/pkgs/development/libraries/gnutls/default.nix
@@ -8,7 +8,7 @@
 
 assert guileBindings -> guile != null;
 let
-  version = "3.6.10";
+  version = "3.6.11.1";
 
   # XXX: Gnulib's `test-select' fails on FreeBSD:
   # http://hydra.nixos.org/build/2962084/nixlog/1/raw .
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "mirror://gnupg/gnutls/v3.6/gnutls-${version}.tar.xz";
-    sha256 = "14r2h73yfj66cm14k9mnb3kgzq5a7qjg5b31m53bf19vcxkwmwxi";
+    sha256 = "1y1wadpsrj5ai603xv5bgssl9v0pb1si2hg14zqdnmcsvgri5fpv";
   };
 
   outputs = [ "bin" "dev" "out" "man" "devdoc" ];
diff --git a/pkgs/development/libraries/goffice/default.nix b/pkgs/development/libraries/goffice/default.nix
index a18bdb17744..f41fa73a6ef 100644
--- a/pkgs/development/libraries/goffice/default.nix
+++ b/pkgs/development/libraries/goffice/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   pname = "goffice";
-  version = "0.10.45";
+  version = "0.10.46";
 
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "702ba567e9ec0bbdd9b1a8161cd24648b4868d57a6cb89128f13c125f6f31947";
+    sha256 = "058d6d3a40e1f60525682ec6b857c441d5deb50d0d30a76804f9f36f865a13a9";
   };
 
   nativeBuildInputs = [ pkgconfig intltool ];
diff --git a/pkgs/development/libraries/gom/default.nix b/pkgs/development/libraries/gom/default.nix
index 9a947c3ff82..e006f8cd6f8 100644
--- a/pkgs/development/libraries/gom/default.nix
+++ b/pkgs/development/libraries/gom/default.nix
@@ -55,7 +55,8 @@ stdenv.mkDerivation rec {
     "-Dpygobject-override-dir=${placeholder "py"}/${python3.sitePackages}/gi/overrides"
   ];
 
-  doCheck = true;
+  # Success is more likely on x86_64
+  doCheck = stdenv.isx86_64;
 
   passthru = {
     updateScript = gnome3.updateScript {
diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix
index 26d5e9c88c7..63072273c2e 100644
--- a/pkgs/development/libraries/gpgme/default.nix
+++ b/pkgs/development/libraries/gpgme/default.nix
@@ -69,6 +69,6 @@ stdenv.mkDerivation rec {
     '';
     license = with licenses; [ lgpl21Plus gpl3Plus ];
     platforms = platforms.unix;
-    maintainers = with maintainers; [ fuuzetsu primeos ];
+    maintainers = with maintainers; [ primeos ];
   };
 }
diff --git a/pkgs/development/libraries/graphene/default.nix b/pkgs/development/libraries/graphene/default.nix
index f1a9dacd4e2..e540604c9cb 100644
--- a/pkgs/development/libraries/graphene/default.nix
+++ b/pkgs/development/libraries/graphene/default.nix
@@ -60,7 +60,7 @@ stdenv.mkDerivation rec {
 
   passthru = {
     tests = {
-      installedTests = nixosTests.graphene;
+      installedTests = nixosTests.installed-tests.graphene;
     };
   };
 
diff --git a/pkgs/development/libraries/grib-api/default.nix b/pkgs/development/libraries/grib-api/default.nix
index 38243ce5a6d..0c9e4bf3156 100644
--- a/pkgs/development/libraries/grib-api/default.nix
+++ b/pkgs/development/libraries/grib-api/default.nix
@@ -1,5 +1,5 @@
-{ fetchurl, stdenv,
-  cmake, netcdf, gfortran, jasper, libpng,
+{ fetchurl, fetchpatch, stdenv,
+  cmake, netcdf, gfortran, libpng, openjpeg,
   enablePython ? false, pythonPackages }:
 
 stdenv.mkDerivation rec{
@@ -11,6 +11,13 @@ stdenv.mkDerivation rec{
     sha256 = "0qbj12ap7yy2rl1pq629chnss2jl73wxdj1lwzv0xp87r6z5qdfl";
   };
 
+  patches = [
+    (fetchpatch {
+      url = "https://salsa.debian.org/science-team/grib-api/raw/debian/1.28.0-2/debian/patches/openjpeg2.patch";
+      sha256 = "05faxh51vlidiazxq1ssd3k4cjivk1adyn30k94mxqa1xnb2r2pc";
+    })
+  ];
+
   preConfigure = ''
     # Fix "no member named 'inmem_' in 'jas_image_t'"
     substituteInPlace "src/grib_jasper_encoding.c" --replace "image.inmem_    = 1;" ""
@@ -19,8 +26,8 @@ stdenv.mkDerivation rec{
   buildInputs = [ cmake
                   netcdf
                   gfortran
-                  jasper
                   libpng
+                  openjpeg
                 ] ++ stdenv.lib.optionals enablePython [
                   pythonPackages.python
                 ];
@@ -32,6 +39,7 @@ stdenv.mkDerivation rec{
   cmakeFlags = [ "-DENABLE_PYTHON=${if enablePython then "ON" else "OFF"}"
                  "-DENABLE_PNG=ON"
                  "-DENABLE_FORTRAN=ON"
+                 "-DOPENJPEG_INCLUDE_DIR=${openjpeg.dev}/include/${openjpeg.incDir}"
                ];
 
   enableParallelBuilding = true;
@@ -52,13 +60,15 @@ stdenv.mkDerivation rec{
     homepage = https://software.ecmwf.int/wiki/display/GRIB/Home;
     license = licenses.asl20;
     platforms = with platforms; linux ++ darwin;
-    description = "ECMWF Library for the GRIB file format";
+    description = "ECMWF Library for the GRIB file format -- DEPRECATED";
     longDescription = ''
       The ECMWF GRIB API is an application program interface accessible from C,
       FORTRAN and Python programs developed for encoding and decoding WMO FM-92
       GRIB edition 1 and edition 2 messages.
+
+      Please note: GRIB-API support is being discontinued at the end of 2018.
+      After which there will be no further releases. Please upgrade to ecCodes
     '';
     maintainers = with maintainers; [ knedlsepp ];
   };
 }
-
diff --git a/pkgs/development/libraries/grpc/default.nix b/pkgs/development/libraries/grpc/default.nix
index 5d6a10ff113..2fa76b2e085 100644
--- a/pkgs/development/libraries/grpc/default.nix
+++ b/pkgs/development/libraries/grpc/default.nix
@@ -1,15 +1,23 @@
-{ stdenv, fetchFromGitHub, cmake, zlib, c-ares, pkgconfig, openssl, protobuf, gflags }:
+{ stdenv, fetchFromGitHub, fetchpatch, cmake, zlib, c-ares, pkgconfig, openssl, protobuf, gflags }:
 
 stdenv.mkDerivation rec {
-  version = "1.24.3"; # N.B: if you change this, change pythonPackages.grpcio and pythonPackages.grpcio-tools to a matching version too
+  version = "1.25.0"; # N.B: if you change this, change pythonPackages.grpcio and pythonPackages.grpcio-tools to a matching version too
   pname = "grpc";
   src = fetchFromGitHub {
     owner = "grpc";
     repo = "grpc";
     rev = "v${version}";
-    sha256 = "19g3fihds9rih2ciypkwi4jahjaymyqnjhd9id397fgj1qkw4w69";
+    sha256 = "02nbmbk1xpibjzvbhi8xpazmwry46ki24vks1sh2p0aqwy4hv6yb";
     fetchSubmodules = true;
   };
+  patches = [
+    # Fix build on armv6l (https://github.com/grpc/grpc/pull/21341)
+    (fetchpatch {
+      url = "https://github.com/grpc/grpc/commit/ffb8a278389c8e3403b23a9897b65a7390c34645.patch";
+      sha256 = "1lc12a3gccg9wxqhnwgldlj3zmlm6lxg8dssvvj1x7hf655kw3w3";
+    })
+  ];
+
   nativeBuildInputs = [ cmake pkgconfig ];
   buildInputs = [ zlib c-ares c-ares.cmake-config openssl protobuf gflags ];
 
diff --git a/pkgs/development/libraries/gstreamer/bad/default.nix b/pkgs/development/libraries/gstreamer/bad/default.nix
index 735ab4e6e18..9b2d3d0e247 100644
--- a/pkgs/development/libraries/gstreamer/bad/default.nix
+++ b/pkgs/development/libraries/gstreamer/bad/default.nix
@@ -1,16 +1,40 @@
-{ stdenv, fetchurl, fetchpatch, meson, ninja, gettext
+{ stdenv
+, fetchurl
+, meson
+, ninja
+, gettext
 , config
-, pkgconfig, python3, gst-plugins-base, orc
+, pkgconfig
+, python3
+, gst-plugins-base
+, orc
 , gobject-introspection
 , enableZbar ? true
-, faacSupport ? false, faac ? null
-, faad2, libass, libkate, libmms, librdf, ladspaH
-, libnice, webrtc-audio-processing, lilv, lv2, serd, sord, sratom
-, libbs2b, libmodplug, mpeg2dec
-, openjpeg, libopus, librsvg
+, faacSupport ? false
+, faac ? null
+, faad2
+, libass
+, libkate
+, libmms
+, librdf
+, ladspaH
+, libnice
+, webrtc-audio-processing
+, lilv
+, lv2
+, serd
+, sord
+, sratom
+, libbs2b
+, libmodplug
+, mpeg2dec
+, openjpeg
+, libopus
+, librsvg
 , bluez
 , chromaprint
 , curl
+, darwin
 , directfb
 , fdk_aac
 , flite
@@ -27,7 +51,7 @@
 , libusb1
 , neon
 , openal
-, opencv3
+, opencv4
 , openexr
 , openh264
 , pango
@@ -38,10 +62,21 @@
 , srtp
 , zbar
 , wayland-protocols
-, wildmidi, fluidsynth, libvdpau, wayland
-, libwebp, xvidcore, gnutls, mjpegtools
-, libGLU_combined, libintl, libgme
-, openssl, x265, libxml2
+, wildmidi
+, fluidsynth
+, libvdpau
+, wayland
+, libwebp
+, xvidcore
+, gnutls
+, mjpegtools
+, libGLU
+, libGL
+, libintl
+, libgme
+, openssl
+, x265
+, libxml2
 , srt
 }:
 
@@ -49,113 +84,128 @@ assert faacSupport -> faac != null;
 
 let
   inherit (stdenv.lib) optional optionals;
-in
-stdenv.mkDerivation rec {
+in stdenv.mkDerivation rec {
   pname = "gst-plugins-bad";
-  version = "1.16.0";
+  version = "1.16.2";
 
-  meta = with stdenv.lib; {
-    description = "Gstreamer Bad Plugins";
-    homepage    = "https://gstreamer.freedesktop.org";
-    longDescription = ''
-      a set of plug-ins that aren't up to par compared to the
-      rest.  They might be close to being good quality, but they're missing
-      something - be it a good code review, some documentation, a set of tests,
-      a real live maintainer, or some actual wide use.
-    '';
-    license     = licenses.lgpl2Plus;
-    platforms   = platforms.linux ++ platforms.darwin;
-    maintainers = with maintainers; [ matthewbauer ];
-  };
+  outputs = [ "out" "dev" ];
 
-  preConfigure = ''
-    patchShebangs .
-  '';
+  src = fetchurl {
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "0x0y0hm0ga3zqi5q4090hw5sjh59y1ry9ak16qsaascm72i7mjzi";
+  };
 
   patches = [
     ./fix_pkgconfig_includedir.patch
-    # Remove when https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/312 is merged and available to us
-    (fetchpatch {
-      url = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/commit/99790eaad9083cce5ab2b1646489e1a1c0faad1e.patch";
-      sha256 = "11bqy4sl05qq5mj4bx5s09rq106s3j0vnpjl4np058im32j69lr3";
-    })
-    # Remove when https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/312 is merged and available to us
-    (fetchpatch {
-      url = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/commit/1872da81c48d3a719bd39955fd97deac7d037d74.patch";
-      sha256 = "11zwrr5ggflmvr0qfssj7dmhgd3ybiadmy79b4zh24022zgw3xpz";
-    })
   ];
 
-  src = fetchurl {
-    url = "${meta.homepage}/src/gst-plugins-bad/${pname}-${version}.tar.xz";
-    sha256 = "019b0yqjrcg6jmfd4cc336h1bz5p4wxl58yz1c4sdb96avirs4r2";
-  };
-
-  outputs = [ "out" "dev" ];
-
   nativeBuildInputs = [
-    meson ninja pkgconfig python3 gettext gobject-introspection
-  ]
-  ++ optionals stdenv.isLinux [
+    meson
+    ninja
+    pkgconfig
+    python3
+    gettext
+    gobject-introspection
+  ] ++ optionals stdenv.isLinux [
     wayland-protocols
   ];
 
   buildInputs = [
-    gst-plugins-base orc
-    faad2 libass libkate libmms
-    libnice webrtc-audio-processing # webrtc
+    gst-plugins-base
+    orc
+    faad2
+    libass
+    libkate
+    libmms
+    webrtc-audio-processing # webrtc
     libbs2b
-    ladspaH librdf # ladspa plug-in
-    lilv lv2 serd sord sratom # lv2 plug-in
-    libmodplug mpeg2dec
-    openjpeg libopus librsvg
-    bluez
-    chromaprint
+    libmodplug
+    mpeg2dec
+    openjpeg
+    libopus
+    librsvg
     curl.dev
-    directfb
     fdk_aac
-    flite
     gsm
     libaom
     libdc1394
     libde265
-    libdrm
     libdvdnav
     libdvdread
-    libgudev
-    libofa
     libsndfile
     libusb1
+    mjpegtools
     neon
     openal
-    opencv3
+    opencv4
     openexr
     openh264
     rtmpdump
     pango
-    sbc
     soundtouch
-    spandsp
     srtp
-    fluidsynth libvdpau
-    libwebp xvidcore gnutls libGLU_combined
-    libgme openssl x265 libxml2
+    fluidsynth
+    libvdpau
+    libwebp
+    xvidcore
+    gnutls
+    libGL
+    libGLU
+    libgme
+    openssl
+    x265
+    libxml2
     libintl
     srt
-  ]
-    ++ optional enableZbar zbar
-    ++ optional faacSupport faac
-    ++ optional stdenv.isLinux wayland
+  ] ++ optionals enableZbar [
+    zbar
+  ] ++ optionals faacSupport [
+    faac
+  ] ++ optionals stdenv.isLinux [
+    bluez
+    wayland
+  ] ++ optionals (!stdenv.isDarwin) [
     # wildmidi requires apple's OpenAL
     # TODO: package apple's OpenAL, fix wildmidi, include on Darwin
-    ++ optional (!stdenv.isDarwin) wildmidi
+    wildmidi
     # TODO: mjpegtools uint64_t is not compatible with guint64 on Darwin
-    ++ optional (!stdenv.isDarwin) mjpegtools;
+    mjpegtools
 
-  mesonFlags = [
-    # Enables all features, so that we know when new dependencies are necessary.
-    "-Dauto_features=enabled"
+    chromaprint
+    directfb
+    flite
+    libdrm
+    libgudev
+    libnice
+    libofa
+    librdf
+    sbc
+    spandsp
+
+    # ladspa plug-in
+    ladspaH
+    librdf # TODO: make build on Darwin
 
+    # lv2 plug-in
+    lilv
+    lv2
+    serd
+    sord
+    sratom
+  ] ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+    # For unknown reasons the order is important, e.g. if
+    # VideoToolbox is last, we get:
+    #     fatal error: 'VideoToolbox/VideoToolbox.h' file not found
+    VideoToolbox
+    AudioToolbox
+    AVFoundation
+    CoreMedia
+    CoreVideo
+    Foundation
+    MediaToolbox
+  ]);
+
+  mesonFlags = [
     "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
 
     "-Ddts=disabled" # required `libdca` library not packaged in nixpkgs as of writing, and marked as "BIG FAT WARNING: libdca is still in early development"
@@ -191,10 +241,50 @@ stdenv.mkDerivation rec {
     # see https://github.com/NixOS/nixpkgs/issues/54395
     "-Dnvdec=disabled"
     "-Dnvenc=disabled"
+  ]
+  ++ optionals stdenv.isDarwin [
+    "-Dbluez=disabled"
+    "-Dchromaprint=disabled"
+    "-Ddirectfb=disabled"
+    "-Dflite=disabled"
+    "-Dkms=disabled" # renders to libdrm output
+    "-Dofa=disabled"
+    "-Dlv2=disabled"
+    "-Dsbc=disabled"
+    "-Dspandsp=disabled"
+    "-Ddvb=disabled"
+    "-Dfbdev=disabled"
+    "-Duvch264=disabled" # requires gudev
+    "-Dladspa=disabled" # requires lrdf
+    "-Dwebrtc=disabled" # requires libnice, which as of writing doesn't work on Darwin in nixpkgs
+    "-Dwildmidi=disabled" # see dependencies above
+  ] ++ optionals (!gst-plugins-base.glEnabled) [
+    "-Dgl=disabled"]
+  ++ optionals (!gst-plugins-base.waylandEnabled) [
+    "-Dwayland=disabled"
+  ] ++ optionals (!gst-plugins-base.glEnabled) [
+    # `applemedia/videotexturecache.h` requires `gst/gl/gl.h`,
+    # but its meson build system does not declare the dependency.
+    "-Dapplemedia=disabled"
   ];
 
-  enableParallelBuilding = true;
+  # This package has some `_("string literal")` string formats
+  # that trip up clang with format security enabled.
+  hardeningDisable = [ "format" ];
 
   doCheck = false; # fails 20 out of 58 tests, expensive
 
+  meta = with stdenv.lib; {
+    description = "GStreamer Bad Plugins";
+    homepage = "https://gstreamer.freedesktop.org";
+    longDescription = ''
+      a set of plug-ins that aren't up to par compared to the
+      rest.  They might be close to being good quality, but they're missing
+      something - be it a good code review, some documentation, a set of tests,
+      a real live maintainer, or some actual wide use.
+    '';
+    license = licenses.lgpl2Plus;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ matthewbauer ];
+  };
 }
diff --git a/pkgs/development/libraries/gstreamer/base/default.nix b/pkgs/development/libraries/gstreamer/base/default.nix
index 81d91458132..178f6a1fe89 100644
--- a/pkgs/development/libraries/gstreamer/base/default.nix
+++ b/pkgs/development/libraries/gstreamer/base/default.nix
@@ -1,100 +1,158 @@
-{ stdenv, fetchurl, fetchpatch, lib
-, pkgconfig, meson, ninja, gettext, gobject-introspection
-, python3, gstreamer, orc, pango, libtheora
-, libintl, libopus
+{ stdenv
+, fetchurl
+, lib
+, pkgconfig
+, meson
+, ninja
+, gettext
+, gobject-introspection
+, python3
+, gstreamer
+, orc
+, pango
+, libtheora
+, libintl
+, libopus
 , isocodes
 , libjpeg
+, libpng
 , libvisual
 , tremor # provides 'virbisidec'
 , libGL
-, gtk-doc, docbook_xsl, docbook_xml_dtd_412
-, enableX11 ? stdenv.isLinux, libXv
-, enableWayland ? stdenv.isLinux, wayland
-, enableAlsa ? stdenv.isLinux, alsaLib
-, enableCocoa ? false, darwin
-, enableCdparanoia ? (!stdenv.isDarwin), cdparanoia }:
+, gtk-doc
+, docbook_xsl
+, docbook_xml_dtd_43
+, enableX11 ? stdenv.isLinux
+, libXv
+, enableWayland ? stdenv.isLinux
+, wayland
+, wayland-protocols
+, enableAlsa ? stdenv.isLinux
+, alsaLib
+# Enabling Cocoa seems to currently not work, giving compile
+# errors. Suspected is that a newer version than clang
+# is needed than 5.0 but it is not clear.
+, enableCocoa ? false
+, darwin
+, enableGl ? (enableX11 || enableWayland || enableCocoa)
+, enableCdparanoia ? (!stdenv.isDarwin)
+, cdparanoia
+}:
 
 stdenv.mkDerivation rec {
   pname = "gst-plugins-base";
-  version = "1.16.0";
+  version = "1.16.2";
 
-  meta = with lib; {
-    description = "Base plugins and helper libraries";
-    homepage = https://gstreamer.freedesktop.org;
-    license = licenses.lgpl2Plus;
-    platforms = platforms.unix;
-    maintainers = with maintainers; [ matthewbauer ];
-  };
+  outputs = [ "out" "dev" ];
 
   src = fetchurl {
-    url = "${meta.homepage}/src/gst-plugins-base/${pname}-${version}.tar.xz";
-    sha256 = "1bmmdwbyy89ayb85xc48y217f6wdmpz96f30zm6v53z2a5xsm4s0";
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "0sl1hxlyq46r02k7z70v09vx1gi4rcypqmzra9jid93lzvi76gmi";
   };
 
-  outputs = [ "out" "dev" ];
+  patches = [
+    ./fix_pkgconfig_includedir.patch
+  ];
 
   nativeBuildInputs = [
-    pkgconfig python3 gettext gobject-introspection
+    meson
+    ninja
+    pkgconfig
+    python3
+    gettext
+    gobject-introspection
+
+    # docs
     gtk-doc
-    # Without these, enabling the 'gtk_doc' gives us `FAILED: meson-install`
-    docbook_xsl docbook_xml_dtd_412
-  ]
-  # Broken meson with Darwin. Should hopefully be fixed soon. Tracking
-  # in https://bugzilla.gnome.org/show_bug.cgi?id=781148.
-  ++ lib.optionals (!stdenv.isDarwin) [ meson ninja ];
+    docbook_xsl
+    docbook_xml_dtd_43
+  ];
 
-  # On Darwin, we currently use autoconf, on all other systems Meson
-  # TODO Switch to Meson on Darwin as well
+  buildInputs = [
+    orc
+    libtheora
+    libintl
+    libopus
+    isocodes
+    libpng
+    libjpeg
+    tremor
+    libGL
+  ] ++ lib.optional (!stdenv.isDarwin) [
+    libvisual
+  ] ++ lib.optionals stdenv.isDarwin [
+    pango
+    darwin.apple_sdk.frameworks.OpenGL
+  ] ++ lib.optionals enableAlsa [
+    alsaLib
+  ] ++ lib.optionals enableX11 [
+    libXv
+    pango
+  ] ++ lib.optionals enableWayland [
+    wayland
+    wayland-protocols
+  ] ++ lib.optional enableCocoa darwin.apple_sdk.frameworks.Cocoa
+    ++ lib.optional enableCdparanoia cdparanoia;
 
-  # TODO How to pass these to Meson?
-  configureFlags = lib.optionals stdenv.isDarwin [
-    "--enable-x11=${if enableX11 then "yes" else "no"}"
-    "--enable-wayland=${if enableWayland then "yes" else "no"}"
-    "--enable-cocoa=${if enableCocoa then "yes" else "no"}"
-  ]
-  # Introspection fails on my MacBook currently
-  ++ lib.optional stdenv.isDarwin "--disable-introspection";
+  propagatedBuildInputs = [
+    gstreamer
+  ];
 
-  mesonFlags = lib.optionals (!stdenv.isDarwin) [
-    # Enables all features, so that we know when new dependencies are necessary.
-    "-Dauto_features=enabled"
+  mesonFlags = [
     "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
     "-Dgl-graphene=disabled" # not packaged in nixpkgs as of writing
     # See https://github.com/GStreamer/gst-plugins-base/blob/d64a4b7a69c3462851ff4dcfa97cc6f94cd64aef/meson_options.txt#L15 for a list of choices
-    "-Dgl_winsys=[${lib.concatStringsSep "," (lib.optional enableX11 "x11" ++ lib.optional enableWayland "wayland" ++ lib.optional enableCocoa "cocoa")}]"
+    "-Dgl_winsys=${lib.concatStringsSep "," (lib.optional enableX11 "x11" ++ lib.optional enableWayland "wayland" ++ lib.optional enableCocoa "cocoa")}"
     # We must currently disable gtk_doc API docs generation,
     # because it is not compatible with some features being disabled.
     # See for example
-    #     https://gitlab.gnome.org/GNOME/gnome-build-meta/issues/38
+    #     https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/564
     # for it failing because some Wayland symbols are missing.
     # This problem appeared between 1.15.1 and 1.16.0.
+    # In 1.18 they should switch to hotdoc, which should make this issue irrelevant.
     "-Dgtk_doc=disabled"
   ]
   ++ lib.optional (!enableX11) "-Dx11=disabled"
   # TODO How to disable Wayland?
+  ++ lib.optional (!enableGl) "-Dgl=disabled"
   ++ lib.optional (!enableAlsa) "-Dalsa=disabled"
   ++ lib.optional (!enableCdparanoia) "-Dcdparanoia=disabled"
-  ;
-
-  buildInputs = [ orc libtheora libintl libopus isocodes libjpeg tremor libGL ]
-    ++ lib.optional (!stdenv.isDarwin) libvisual
-    ++ lib.optional enableAlsa alsaLib
-    ++ lib.optionals enableX11 [ libXv pango ]
-    ++ lib.optional enableWayland wayland
-    ++ lib.optional enableCocoa darwin.apple_sdk.frameworks.Cocoa
-    ++ lib.optional enableCdparanoia cdparanoia;
-
-  propagatedBuildInputs = [ gstreamer ];
+  ++ lib.optionals stdenv.isDarwin [
+    "-Dlibvisual=disabled"
+  ];
 
   postPatch = ''
-    patchShebangs .
+    patchShebangs common/scangobj-merge.py
   '';
 
-  enableParallelBuilding = true;
+  # This package has some `_("string literal")` string formats
+  # that trip up clang with format security enabled.
+  hardeningDisable = [ "format" ];
 
   doCheck = false; # fails, wants DRI access for OpenGL
 
-  patches = [
-    ./fix_pkgconfig_includedir.patch
-  ];
+  passthru = {
+    # Downstream `gst-*` packages depending on `gst-plugins-base`
+    # have meson build options like 'gl' etc. that depend
+    # on these features being built in `-base`.
+    # If they are not built here, then the downstream builds
+    # will fail, as they, too, use `-Dauto_features=enabled`
+    # which would enable these options unconditionally.
+    # That means we must communicate to these downstream packages
+    # if the `-base` enabled these options or not, so that
+    # the can enable/disable those features accordingly.
+    # The naming `*Enabled` vs `enable*` is intentional to
+    # distinguish inputs from outputs (what is to be built
+    # vs what was built) and to make them easier to search for.
+    glEnabled = enableGl;
+    waylandEnabled = enableWayland;
+  };
+
+  meta = with lib; {
+    description = "Base GStreamer plug-ins and helper libraries";
+    homepage = "https://gstreamer.freedesktop.org";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ matthewbauer ];
+  };
 }
diff --git a/pkgs/development/libraries/gstreamer/core/default.nix b/pkgs/development/libraries/gstreamer/core/default.nix
index f0f01a977fd..3dd7a547de9 100644
--- a/pkgs/development/libraries/gstreamer/core/default.nix
+++ b/pkgs/development/libraries/gstreamer/core/default.nix
@@ -1,10 +1,23 @@
-{ stdenv, fetchurl, fetchpatch, meson, ninja
-, pkgconfig, gettext, gobject-introspection
-, bison, flex, python3, glib, makeWrapper
-, libcap,libunwind, darwin
+{ stdenv
+, fetchurl
+, fetchpatch
+, meson
+, ninja
+, pkgconfig
+, gettext
+, gobject-introspection
+, bison
+, flex
+, python3
+, glib
+, makeWrapper
+, libcap
+, libunwind
+, darwin
 , elfutils # for libdw
 , bash-completion
-, docbook_xsl, docbook_xml_dtd_412
+, docbook_xsl
+, docbook_xml_dtd_43
 , gtk-doc
 , lib
 , CoreServices
@@ -12,50 +25,66 @@
 
 stdenv.mkDerivation rec {
   pname = "gstreamer";
-  version = "1.16.0";
+  version = "1.16.2";
 
-  meta = with lib ;{
-    description = "Open source multimedia framework";
-    homepage = https://gstreamer.freedesktop.org;
-    license = licenses.lgpl2Plus;
-    platforms = platforms.unix;
-    maintainers = with maintainers; [ ttuegel matthewbauer ];
-  };
+  outputs = [ "out" "dev" "devdoc" ];
+  outputBin = "dev";
 
   src = fetchurl {
-    url = "${meta.homepage}/src/gstreamer/${pname}-${version}.tar.xz";
-    sha256 = "003wy1p1in85p9sr5jsyhbnwqaiwz069flwkhyx7qhxy31qjz3hf";
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "0kp93622y29pck8asvil1fmzf55s2gx76wv475a6izc3cwj49w73";
   };
 
   patches = [
     ./fix_pkgconfig_includedir.patch
   ];
 
-  outputs = [ "out" "dev" ];
-  outputBin = "dev";
-
   nativeBuildInputs = [
-    meson ninja pkgconfig gettext bison flex python3 makeWrapper gobject-introspection
+    meson
+    ninja
+    pkgconfig
+    gettext
+    bison
+    flex
+    python3
+    makeWrapper
+    gobject-introspection
     bash-completion
+
+    # documentation
     gtk-doc
-    # Without these, enabling the 'gtk_doc' gives us `FAILED: meson-install`
-    docbook_xsl docbook_xml_dtd_412
+    docbook_xsl
+    docbook_xml_dtd_43
   ];
 
-  buildInputs =
-       lib.optionals stdenv.isLinux [ libcap libunwind elfutils ]
-    ++ lib.optional stdenv.isDarwin CoreServices;
+  buildInputs = lib.optionals stdenv.isLinux [
+    libcap
+    libunwind
+    elfutils
+  ] ++ lib.optionals stdenv.isDarwin [
+    CoreServices
+  ];
 
-  propagatedBuildInputs = [ glib ];
+  propagatedBuildInputs = [
+    glib
+  ];
 
   mesonFlags = [
-    # Enables all features, so that we know when new dependencies are necessary.
-    "-Dauto_features=enabled"
     "-Ddbghelp=disabled" # not needed as we already provide libunwind and libdw, and dbghelp is a fallback to those
     "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
-  ]
+  ] ++ lib.optionals stdenv.isDarwin [
     # darwin.libunwind doesn't have pkgconfig definitions so meson doesn't detect it.
-    ++ stdenv.lib.optionals stdenv.isDarwin [ "-Dlibunwind=disabled" "-Dlibdw=disabled" ];
+    "-Dlibunwind=disabled"
+    "-Dlibdw=disabled"
+  ];
+
+  postPatch = ''
+    patchShebangs \
+      gst/parse/get_flex_version.py \
+      gst/parse/gen_grammar.py.in \
+      gst/parse/gen_lex.py.in \
+      libs/gst/helpers/ptp_helper_post_install.sh
+  '';
 
   postInstall = ''
     for prog in "$dev/bin/"*; do
@@ -64,21 +93,17 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  preConfigure=
-    # These files are not executable upstream, so we need to
-    # make them executable for `patchShebangs` to pick them up.
-    # Can be removed when this is merged and available:
-    #     https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/141
-    ''
-      chmod +x gst/parse/get_flex_version.py
-    '' +
-    ''
-      patchShebangs .
-    '';
-
   preFixup = ''
     moveToOutput "share/bash-completion" "$dev"
   '';
 
   setupHook = ./setup-hook.sh;
+
+  meta = with lib ;{
+    description = "Open source multimedia framework";
+    homepage = "https://gstreamer.freedesktop.org";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ttuegel matthewbauer ];
+  };
 }
diff --git a/pkgs/development/libraries/gstreamer/core/setup-hook.sh b/pkgs/development/libraries/gstreamer/core/setup-hook.sh
index b8c741af578..026a4e5f55a 100644
--- a/pkgs/development/libraries/gstreamer/core/setup-hook.sh
+++ b/pkgs/development/libraries/gstreamer/core/setup-hook.sh
@@ -1,7 +1,7 @@
 addGstreamer1LibPath () {
     if test -d "$1/lib/gstreamer-1.0"
     then
-        export GST_PLUGIN_SYSTEM_PATH_1_0="${GST_PLUGIN_SYSTEM_PATH_1_0}${GST_PLUGIN_SYSTEM_PATH_1_0:+:}$1/lib/gstreamer-1.0"
+        export GST_PLUGIN_SYSTEM_PATH_1_0="${GST_PLUGIN_SYSTEM_PATH_1_0-}${GST_PLUGIN_SYSTEM_PATH_1_0:+:}$1/lib/gstreamer-1.0"
     fi
 }
 
diff --git a/pkgs/development/libraries/gstreamer/ges/default.nix b/pkgs/development/libraries/gstreamer/ges/default.nix
index 810cee650ca..6e9a604f794 100644
--- a/pkgs/development/libraries/gstreamer/ges/default.nix
+++ b/pkgs/development/libraries/gstreamer/ges/default.nix
@@ -1,39 +1,66 @@
-{ stdenv, fetchurl, fetchpatch, meson, ninja
-, pkgconfig, python, gst-plugins-base, libxml2
-, flex, perl, gettext, gobject-introspection
+{ stdenv
+, fetchurl
+, fetchpatch
+, meson
+, ninja
+, pkgconfig
+, python
+, gst-plugins-base
+, libxml2
+, flex
+, perl
+, gettext
+, gobject-introspection
 }:
 
 stdenv.mkDerivation rec {
   pname = "gstreamer-editing-services";
-  version = "1.16.0";
+  version = "1.16.2";
 
-  meta = with stdenv.lib; {
-    description = "Library for creation of audio/video non-linear editors";
-    homepage    = "https://gstreamer.freedesktop.org";
-    license     = licenses.lgpl2Plus;
-    platforms   = platforms.unix;
-  };
+  outputs = [ "out" "dev" ];
 
   src = fetchurl {
-    url = "${meta.homepage}/src/gstreamer-editing-services/${pname}-${version}.tar.xz";
-    sha256 = "1las94jkx83sxmzi5w6b0xm89dqqwzpdsb6h9w9ixndhnbpzm8w2";
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "05hcf3prna8ajjnqd53221gj9syarrrjbgvjcbhicv0c38csc1hf";
   };
 
-  outputs = [ "out" "dev" ];
+  patches = [
+    ./fix_pkgconfig_includedir.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkgconfig
+    gettext
+    gobject-introspection
+    python
+    flex
+    perl
+  ];
 
-  nativeBuildInputs = [ meson ninja pkgconfig gettext gobject-introspection python flex perl ];
+  buildInputs = [
+    libxml2
+  ];
 
-  propagatedBuildInputs = [ gst-plugins-base libxml2 ];
+  propagatedBuildInputs = [
+    gst-plugins-base
+  ];
 
   mesonFlags = [
     "-Dgtk_doc=disabled"
   ];
 
-  patches = [
-    ./fix_pkgconfig_includedir.patch
-  ];
-
   postPatch = ''
+    # for some reason, gst-plugins-bad cannot be found
+    # fortunately, they are only used by tests, which we do not run
     sed -i -r -e 's/p(bad|good) = .*/p\1 = pbase/' tests/check/meson.build
   '';
+
+  meta = with stdenv.lib; {
+    description = "Library for creation of audio/video non-linear editors";
+    homepage = "https://gstreamer.freedesktop.org";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+  };
 }
diff --git a/pkgs/development/libraries/gstreamer/good/default.nix b/pkgs/development/libraries/gstreamer/good/default.nix
index c801684b065..136dd1e1712 100644
--- a/pkgs/development/libraries/gstreamer/good/default.nix
+++ b/pkgs/development/libraries/gstreamer/good/default.nix
@@ -1,14 +1,37 @@
-{ stdenv, fetchurl, meson, ninja, pkgconfig, python
-, gst-plugins-base, orc, bzip2, gettext
-, libv4l, libdv, libavc1394, libiec61883
-, libvpx, speex, flac, taglib, libshout
-, cairo, gdk-pixbuf, aalib, libcaca
-, libsoup, libpulseaudio, libintl
-, darwin, lame, mpg123, twolame
+{ stdenv
+, fetchurl
+, meson
+, ninja
+, pkgconfig
+, python
+, gst-plugins-base
+, orc
+, bzip2
+, gettext
+, libv4l
+, libdv
+, libavc1394
+, libiec61883
+, libvpx
+, speex
+, flac
+, taglib
+, libshout
+, cairo
+, gdk-pixbuf
+, aalib
+, libcaca
+, libsoup
+, libpulseaudio
+, libintl
+, darwin
+, lame
+, mpg123
+, twolame
 , gtkSupport ? false, gtk3 ? null
-# As of writing, jack2 incurs a Qt dependency (big!) via `ffado`.
-# In the fuure we should probably split `ffado`.
-, enableJack ? false
+  # As of writing, jack2 incurs a Qt dependency (big!) via `ffado`.
+  # In the future we should probably split `ffado`.
+, enableJack ? false, jack2
 , libXdamage
 , libXext
 , libXfixes
@@ -16,49 +39,53 @@
 , xorg
 , libgudev
 , wavpack
-, jack2
 }:
 
 assert gtkSupport -> gtk3 != null;
 
 let
-  inherit (stdenv.lib) optional optionals;
+  inherit (stdenv.lib) optionals;
 in
 stdenv.mkDerivation rec {
   pname = "gst-plugins-good";
-  version = "1.16.0";
+  version = "1.16.2";
 
-  meta = with stdenv.lib; {
-    description = "Gstreamer Good Plugins";
-    homepage    = "https://gstreamer.freedesktop.org";
-    longDescription = ''
-      a set of plug-ins that we consider to have good quality code,
-      correct functionality, our preferred license (LGPL for the plug-in
-      code, LGPL or LGPL-compatible for the supporting library).
-    '';
-    license     = licenses.lgpl2Plus;
-    platforms   = platforms.linux ++ platforms.darwin;
-    maintainers = with maintainers; [ matthewbauer ];
-  };
+  outputs = [ "out" "dev" ];
 
   src = fetchurl {
-    url = "${meta.homepage}/src/gst-plugins-good/${pname}-${version}.tar.xz";
-    sha256 = "1zdhif1mhf0ihkjpjyrh65g2iz2cawkjjb3h5w8h9ml06grxwjk5";
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "068k3cbv1yf3gbllfdzqsg263kzwh21y8dpwr0wvgh15vapkpfs0";
   };
 
-  outputs = [ "out" "dev" ];
-
   patches = [ ./fix_pkgconfig_includedir.patch ];
 
-  nativeBuildInputs = [ pkgconfig python meson ninja gettext ];
-
-  NIX_LDFLAGS = "-lncurses";
+  nativeBuildInputs = [
+    pkgconfig
+    python
+    meson
+    ninja
+    gettext
+  ];
 
   buildInputs = [
-    gst-plugins-base orc bzip2
-    libdv libvpx speex flac taglib
-    cairo gdk-pixbuf aalib libcaca
-    libsoup libshout lame mpg123 twolame libintl
+    gst-plugins-base
+    orc
+    bzip2
+    libdv
+    libvpx
+    speex
+    flac
+    taglib
+    cairo
+    gdk-pixbuf
+    aalib
+    libcaca
+    libsoup
+    libshout
+    lame
+    mpg123
+    twolame
+    libintl
     libXdamage
     libXext
     libXfixes
@@ -66,29 +93,59 @@ stdenv.mkDerivation rec {
     xorg.libXfixes
     xorg.libXdamage
     wavpack
-  ]
-  ++ optional gtkSupport gtk3 # for gtksink
-  ++ optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Cocoa ]
-  ++ optionals stdenv.isLinux [ libv4l libpulseaudio libavc1394 libiec61883 libgudev ]
-  ++ optionals (stdenv.isLinux && enableJack) [
+  ] ++ optionals gtkSupport [
+    # for gtksink
+    gtk3
+  ] ++ optionals stdenv.isDarwin [
+    darwin.apple_sdk.frameworks.Cocoa
+  ] ++ optionals stdenv.isLinux [
+    libv4l
+    libpulseaudio
+    libavc1394
+    libiec61883
+    libgudev
+  ] ++ optionals (stdenv.isLinux && enableJack) [
     jack2
   ];
 
   mesonFlags = [
-    # Enables all features, so that we know when new dependencies are necessary.
-    "-Dauto_features=enabled"
     "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
     "-Dqt5=disabled" # not clear as of writing how to correctly pass in the required qt5 deps
-  ]
-  ++ optional (!gtkSupport) "-Dgtk3=disabled"
-  ++ optionals (!stdenv.isLinux || !enableJack) [
+  ] ++ optionals (!gtkSupport) [
+    "-Dgtk3=disabled"
+  ] ++ optionals (!stdenv.isLinux || !enableJack) [
     "-Djack=disabled" # unclear whether Jack works on Darwin
-  ]
-  ++ optionals (!stdenv.isLinux) [
-    "-Dv4l2-gudev=disabled"
+  ] ++ optionals (!stdenv.isLinux) [
+    "-Ddv1394=disabled" # Linux only
+    "-Doss4=disabled" # Linux only
+    "-Doss=disabled" # Linux only
+    "-Dpulse=disabled" # TODO check if we can keep this enabled
+    "-Dv4l2-gudev=disabled" # Linux-only
+    "-Dv4l2=disabled" # Linux-only
+    "-Dximagesrc=disabled" # Linux-only
+    "-Dpulse=disabled" # TODO check if we can keep this enabled
+  ];
+
+
+  NIX_LDFLAGS = [
+    # linking error on Darwin
+    # https://github.com/NixOS/nixpkgs/pull/70690#issuecomment-553694896
+    "-lncurses"
   ];
 
   # fails 1 tests with "Unexpected critical/warning: g_object_set_is_valid_property: object class 'GstRtpStorage' has no property named ''"
   doCheck = false;
 
+  meta = with stdenv.lib; {
+    description = "GStreamer Good Plugins";
+    homepage = "https://gstreamer.freedesktop.org";
+    longDescription = ''
+      a set of plug-ins that we consider to have good quality code,
+      correct functionality, our preferred license (LGPL for the plug-in
+      code, LGPL or LGPL-compatible for the supporting library).
+    '';
+    license = licenses.lgpl2Plus;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ matthewbauer ];
+  };
 }
diff --git a/pkgs/development/libraries/gstreamer/legacy/gst-plugins-base/default.nix b/pkgs/development/libraries/gstreamer/legacy/gst-plugins-base/default.nix
index 5a942b49cc0..eed9d423fdb 100644
--- a/pkgs/development/libraries/gstreamer/legacy/gst-plugins-base/default.nix
+++ b/pkgs/development/libraries/gstreamer/legacy/gst-plugins-base/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, pkgconfig, gstreamer, xorg, alsaLib, cdparanoia
+{ fetchurl, fetchpatch, stdenv, pkgconfig, gstreamer, xorg, alsaLib, cdparanoia
 , libogg, libtheora, libvorbis, freetype, pango, liboil, glib, cairo, orc
 , libintl
 , ApplicationServices
@@ -20,10 +20,10 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./gcc-4.9.patch
-    (fetchurl {
+    (fetchpatch {
       url = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/commit/f672277509705c4034bc92a141eefee4524d15aa.patch";
       name = "CVE-2019-9928.patch";
-      sha256 = "0hz3lsq3ppmaf329sbyi05y1qniqfj9vlp2f3z918383pvrcms4i";
+      sha256 = "1dlamsmyr7chrb6vqqmwikqvvqcx5l7k72p98448qm6k59ndnimc";
     })
   ];
 
diff --git a/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh b/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh
index 65ce2611251..636e20b732b 100644
--- a/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh
+++ b/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh
@@ -1,7 +1,7 @@
 addGstreamerLibPath () {
     if test -d "$1/lib/gstreamer-0.10"
     then
-        export GST_PLUGIN_SYSTEM_PATH="${GST_PLUGIN_SYSTEM_PATH}${GST_PLUGIN_SYSTEM_PATH:+:}$1/lib/gstreamer-0.10"
+        export GST_PLUGIN_SYSTEM_PATH="${GST_PLUGIN_SYSTEM_PATH-}${GST_PLUGIN_SYSTEM_PATH:+:}$1/lib/gstreamer-0.10"
     fi
 }
 
diff --git a/pkgs/development/libraries/gstreamer/libav/default.nix b/pkgs/development/libraries/gstreamer/libav/default.nix
index 1847b8d0c12..e36eba37007 100644
--- a/pkgs/development/libraries/gstreamer/libav/default.nix
+++ b/pkgs/development/libraries/gstreamer/libav/default.nix
@@ -1,43 +1,46 @@
-{ stdenv, fetchurl, meson, ninja, pkgconfig
-, python, yasm, gst-plugins-base, orc, bzip2
-, gettext, withSystemLibav ? true, libav ? null
+{ stdenv
+, lib
+, fetchurl
+, meson
+, ninja
+, pkgconfig
+, python3
+, gst-plugins-base
+, gettext
+, libav
 }:
 
 # Note that since gst-libav-1.6, libav is actually ffmpeg. See
 # https://gstreamer.freedesktop.org/releases/1.6/ for more info.
 
-assert withSystemLibav -> libav != null;
-
 stdenv.mkDerivation rec {
   pname = "gst-libav";
-  version = "1.16.0";
-
-  meta = {
-    homepage = https://gstreamer.freedesktop.org;
-    license = stdenv.lib.licenses.lgpl2Plus;
-    platforms = stdenv.lib.platforms.unix;
-  };
+  version = "1.16.2";
 
   src = fetchurl {
-    url = "${meta.homepage}/src/gst-libav/${pname}-${version}.tar.xz";
-    sha256 = "16ixqpfrr7plaaz14n3vagr2q5xbfkv7gpmcsyndrkx98f813b6z";
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "1wpfilc98bad9nsv3y1qapxp35dvn2mvwvrmqwrsj58cf09gc967";
   };
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = with stdenv.lib;
-    [ meson ninja gettext pkgconfig python ]
-    ++ optional (!withSystemLibav) yasm
-    ;
-
-  buildInputs = with stdenv.lib;
-    [ gst-plugins-base orc bzip2 ]
-    ++ optional withSystemLibav libav
-    ;
+  nativeBuildInputs = [
+    meson
+    ninja
+    gettext
+    pkgconfig
+    python3
+  ];
 
-  mesonFlags = [
-    # Enables all features, so that we know when new dependencies are necessary.
-    "-Dauto_features=enabled"
+  buildInputs = [
+    gst-plugins-base
+    libav
   ];
 
+  meta = with lib; {
+    description = "FFmpeg/libav plugin for GStreamer";
+    homepage = "https://gstreamer.freedesktop.org";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+  };
 }
diff --git a/pkgs/development/libraries/gstreamer/rtsp-server/default.nix b/pkgs/development/libraries/gstreamer/rtsp-server/default.nix
index 5c571fa4a1e..dfb18754c83 100644
--- a/pkgs/development/libraries/gstreamer/rtsp-server/default.nix
+++ b/pkgs/development/libraries/gstreamer/rtsp-server/default.nix
@@ -1,38 +1,50 @@
-{ stdenv, fetchurl, meson, ninja, pkgconfig
-, gettext, gobject-introspection
+{ stdenv
+, fetchurl
+, meson
+, ninja
+, pkgconfig
+, gettext
+, gobject-introspection
 , gst-plugins-base
 , gst-plugins-bad
 }:
 
 stdenv.mkDerivation rec {
   pname = "gst-rtsp-server";
-  version = "1.16.0";
-
-  meta = with stdenv.lib; {
-    description = "Gstreamer RTSP server";
-    homepage    = "https://gstreamer.freedesktop.org";
-    longDescription = ''
-      a library on top of GStreamer for building an RTSP server.
-    '';
-    license     = licenses.lgpl2Plus;
-    platforms   = platforms.linux ++ platforms.darwin;
-    maintainers = with maintainers; [ bkchr ];
-  };
+  version = "1.16.2";
 
   src = fetchurl {
-    url = "${meta.homepage}/src/gst-rtsp-server/${pname}-${version}.tar.xz";
-    sha256 = "069zy159izy50blci9fli1i2r8jh91qkmgrz1n0xqciy3bn9x3hr";
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "0vn23nxwvs96g7gcxw5zbnw23hkhky8a8r42wq68411vgf1s41yy";
   };
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ meson ninja gettext gobject-introspection pkgconfig ];
+  nativeBuildInputs = [
+    meson
+    ninja
+    gettext
+    gobject-introspection
+    pkgconfig
+  ];
 
-  buildInputs = [ gst-plugins-base gst-plugins-bad ];
+  buildInputs = [
+    gst-plugins-base
+    gst-plugins-bad
+  ];
 
   mesonFlags = [
-    # Enables all features, so that we know when new dependencies are necessary.
-    "-Dauto_features=enabled"
     "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
   ];
+
+  meta = with stdenv.lib; {
+    description = "GStreamer RTSP server";
+    homepage = "https://gstreamer.freedesktop.org";
+    longDescription = ''
+      A library on top of GStreamer for building an RTSP server.
+    '';
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ bkchr ];
+  };
 }
diff --git a/pkgs/development/libraries/gstreamer/ugly/default.nix b/pkgs/development/libraries/gstreamer/ugly/default.nix
index 552ab1ec292..870b4468860 100644
--- a/pkgs/development/libraries/gstreamer/ugly/default.nix
+++ b/pkgs/development/libraries/gstreamer/ugly/default.nix
@@ -1,53 +1,76 @@
-{ stdenv, fetchurl, meson, ninja, pkgconfig, python
-, gst-plugins-base, orc, gettext
-, a52dec, libcdio, libdvdread
-, libmad, libmpeg2, x264, libintl, lib
+{ stdenv
+, fetchurl
+, meson
+, ninja
+, pkgconfig
+, python
+, gst-plugins-base
+, orc
+, gettext
+, a52dec
+, libcdio
+, libdvdread
+, libmad
+, libmpeg2
+, x264
+, libintl
+, lib
 , opencore-amr
 , darwin
 }:
 
 stdenv.mkDerivation rec {
   pname = "gst-plugins-ugly";
-  version = "1.16.0";
+  version = "1.16.2";
 
-  meta = with lib; {
-    description = "Gstreamer Ugly Plugins";
-    homepage    = "https://gstreamer.freedesktop.org";
-    longDescription = ''
-      a set of plug-ins that have good quality and correct functionality,
-      but distributing them might pose problems.  The license on either
-      the plug-ins or the supporting libraries might not be how we'd
-      like. The code might be widely known to present patent problems.
-    '';
-    license     = licenses.lgpl2Plus;
-    platforms   = platforms.unix;
-    maintainers = with maintainers; [ matthewbauer ];
-  };
+  outputs = [ "out" "dev" ];
 
   src = fetchurl {
-    url = "${meta.homepage}/src/gst-plugins-ugly/${pname}-${version}.tar.xz";
-    sha256 = "1hm46c1fy9vl1wfwipsj41zp79cm7in1fpmjw24j5hriy32n82g3";
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "1jpvc32x6q01zjkfgh6gmq6aaikiyfwwnhj7bmvn52syhrdl202m";
   };
 
-  outputs = [ "out" "dev" ];
-
-  nativeBuildInputs = [ meson ninja gettext pkgconfig python ];
+  nativeBuildInputs = [
+    meson
+    ninja
+    gettext
+    pkgconfig
+    python
+  ];
 
   buildInputs = [
-    gst-plugins-base orc
-    a52dec libcdio libdvdread
-    libmad libmpeg2 x264
+    gst-plugins-base
+    orc
+    a52dec
+    libcdio
+    libdvdread
+    libmad
+    libmpeg2
+    x264
     libintl
     opencore-amr
-  ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks;
-    [ IOKit CoreFoundation DiskArbitration ]);
+  ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+    IOKit
+    CoreFoundation
+    DiskArbitration
+  ]);
 
   mesonFlags = [
-    # Enables all features, so that we know when new dependencies are necessary.
-    "-Dauto_features=enabled"
     "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
     "-Dsidplay=disabled" # sidplay / sidplay/player.h isn't packaged in nixpkgs as of writing
   ];
 
-  NIX_LDFLAGS = [ "-lm" ];
+  meta = with lib; {
+    description = "Gstreamer Ugly Plugins";
+    homepage = "https://gstreamer.freedesktop.org";
+    longDescription = ''
+      a set of plug-ins that have good quality and correct functionality,
+      but distributing them might pose problems.  The license on either
+      the plug-ins or the supporting libraries might not be how we'd
+      like. The code might be widely known to present patent problems.
+    '';
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ matthewbauer ];
+  };
 }
diff --git a/pkgs/development/libraries/gstreamer/vaapi/default.nix b/pkgs/development/libraries/gstreamer/vaapi/default.nix
index adb495689e3..cac56f64cc9 100644
--- a/pkgs/development/libraries/gstreamer/vaapi/default.nix
+++ b/pkgs/development/libraries/gstreamer/vaapi/default.nix
@@ -1,49 +1,72 @@
-{ stdenv, fetchurl, meson, ninja, pkgconfig, gst-plugins-base, bzip2, libva, wayland
-, libdrm, udev, xorg, libGLU_combined, gstreamer, gst-plugins-bad, nasm
-, libvpx, python, fetchpatch
+{ stdenv
+, fetchurl
+, meson
+, ninja
+, pkgconfig
+, gst-plugins-base
+, bzip2
+, libva
+, wayland
+, libdrm
+, udev
+, xorg
+, libGLU
+, libGL
+, gstreamer
+, gst-plugins-bad
+, nasm
+, libvpx
+, python
 }:
 
 stdenv.mkDerivation rec {
-  pname = "gst-vaapi";
-  version = "1.16.0";
+  pname = "gstreamer-vaapi";
+  version = "1.16.2";
 
   src = fetchurl {
-    url = "${meta.homepage}/src/gstreamer-vaapi/gstreamer-vaapi-${version}.tar.xz";
-    sha256 = "07qpynamiz0lniqajcaijh3n7ixs4lfk9a5mfk50sng0dricwzsf";
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "00f6sx700qm1ximi1ag2c27m35dywwhhg6awhz85va34mfqff78r";
   };
 
-  patches = [
-    # See: https://mail.gnome.org/archives/distributor-list/2019-September/msg00000.html
-    # Note that the patch has now been actually accepted upstream.
-    (fetchpatch {
-      url = "https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/commit/a90daabb84f983d2fa05ff3159f7ad59aa648b55.patch";
-      sha256 = "0p2qygq6b5h6nxjdfnlzbsyih43hjq5c94ag8sbyyb8pmnids9rb";
-    })
-  ];
-
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ meson ninja pkgconfig bzip2 ];
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkgconfig
+    bzip2
+  ];
 
   buildInputs = [
-    gstreamer gst-plugins-base gst-plugins-bad libva wayland libdrm udev
-    xorg.libX11 xorg.libXext xorg.libXv xorg.libXrandr xorg.libSM
-    xorg.libICE libGLU_combined nasm libvpx python
+    gstreamer
+    gst-plugins-base
+    gst-plugins-bad
+    libva
+    wayland
+    libdrm
+    udev
+    xorg.libX11
+    xorg.libXext
+    xorg.libXv
+    xorg.libXrandr
+    xorg.libSM
+    xorg.libICE
+    libGL
+    libGLU
+    nasm
+    libvpx
+    python
   ];
 
-  preConfigure = ''
-    export GST_PLUGIN_PATH_1_0=$out/lib/gstreamer-1.0
-    mkdir -p $GST_PLUGIN_PATH_1_0
-  '';
-
   mesonFlags = [
     "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
   ];
 
-  meta = {
-    homepage = https://gstreamer.freedesktop.org;
-    license = stdenv.lib.licenses.lgpl21Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ tstrobel ];
+  meta = with stdenv.lib; {
+    description = "Set of VAAPI GStreamer Plug-ins";
+    homepage = "https://gstreamer.freedesktop.org";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ tstrobel ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/gstreamer/validate/default.nix b/pkgs/development/libraries/gstreamer/validate/default.nix
index ad013d1570e..9439ddd94e8 100644
--- a/pkgs/development/libraries/gstreamer/validate/default.nix
+++ b/pkgs/development/libraries/gstreamer/validate/default.nix
@@ -1,39 +1,43 @@
-{ stdenv, fetchurl, pkgconfig, gstreamer, gst-plugins-base
-, python, gobject-introspection, json-glib
+{ stdenv
+, fetchurl
+, pkgconfig
+, gstreamer
+, gst-plugins-base
+, python
+, gobject-introspection
+, json-glib
 }:
 
 stdenv.mkDerivation rec {
   pname = "gst-validate";
-  version = "1.16.0";
-
-  meta = {
-    description = "Integration testing infrastructure for the GStreamer framework";
-    homepage = https://gstreamer.freedesktop.org;
-    license = stdenv.lib.licenses.lgpl2Plus;
-    platforms = stdenv.lib.platforms.unix;
-  };
+  version = "1.16.2";
 
   src = fetchurl {
-    url = "${meta.homepage}/src/gst-validate/${pname}-${version}.tar.xz";
-    sha256 = "1jfnd0g9hmdbqfxsx96yc9vpf1w6m33hqwrr6lj4i83kl54awcck";
+    url = "${meta.homepage}/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "1jpfrzg3yc6kp66bgq3jy14xsj3x71mk2zh0k16yf0326awwqqa8";
   };
 
   outputs = [ "out" "dev" ];
 
   nativeBuildInputs = [
-    pkgconfig gobject-introspection
+    pkgconfig
+    gobject-introspection
   ];
 
   buildInputs = [
-    python json-glib
+    python
+    json-glib
   ];
 
-  propagatedBuildInputs = [ gstreamer gst-plugins-base ];
-
-  enableParallelBuilding = true;
-
-  mesonFlags = [
-    # Enables all features, so that we know when new dependencies are necessary.
-    "-Dauto_features=enabled"
+  propagatedBuildInputs = [
+    gstreamer
+    gst-plugins-base
   ];
+
+  meta = with stdenv.lib; {
+    description = "Integration testing infrastructure for the GStreamer framework";
+    homepage = "https://gstreamer.freedesktop.org";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+  };
 }
diff --git a/pkgs/development/libraries/gtest/default.nix b/pkgs/development/libraries/gtest/default.nix
index 5fecd45b7da..4326be59724 100644
--- a/pkgs/development/libraries/gtest/default.nix
+++ b/pkgs/development/libraries/gtest/default.nix
@@ -3,7 +3,7 @@
 
 stdenv.mkDerivation rec {
   pname = "gtest";
-  version = "1.8.1";
+  version = "1.10.0";
 
   outputs = [ "out" "dev" ];
 
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     owner = "google";
     repo = "googletest";
     rev = "release-${version}";
-    sha256 = "0270msj6n7mggh4xqqjp54kswbl7mkcc8px1p5dqdpmw5ngh9fzk";
+    sha256 = "1zbmab9295scgg4z2vclgfgjchfjailjnvzc6f5x9jvlsdi3dpwz";
   };
 
   patches = [
diff --git a/pkgs/development/libraries/gtk-engine-bluecurve/default.nix b/pkgs/development/libraries/gtk-engine-bluecurve/default.nix
new file mode 100644
index 00000000000..99ca221f5ba
--- /dev/null
+++ b/pkgs/development/libraries/gtk-engine-bluecurve/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, pkgconfig, intltool, gtk2 }:
+
+stdenv.mkDerivation {
+  name = "gtk-engine-bluecurve-1.0";
+
+  src = fetchurl {
+    url = "https://ftp.gnome.org/pub/gnome/teams/art.gnome.org/archive/themes/gtk2/GTK2-Wonderland-Engine-1.0.tar.bz2";
+    sha256 = "1nim3lhmbs5mw1hh76d9258c1p923854x2j6i30gmny812c7qjnm";
+  };
+
+  nativeBuildInputs = [ pkgconfig intltool ];
+
+  buildInputs = [ gtk2 ];
+
+  meta = {
+    description = "Original Bluecurve engine from Red Hat's artwork package";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.gnidorah ];
+  };
+}
diff --git a/pkgs/development/libraries/gtk-engine-murrine/default.nix b/pkgs/development/libraries/gtk-engine-murrine/default.nix
new file mode 100644
index 00000000000..9acb7b25a0d
--- /dev/null
+++ b/pkgs/development/libraries/gtk-engine-murrine/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, pkgconfig, intltool, gtk2 }:
+
+stdenv.mkDerivation rec {
+  pname = "gtk-engine-murrine";
+  version = "0.98.2";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "129cs5bqw23i76h3nmc29c9mqkm9460iwc8vkl7hs4xr07h8mip9";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ intltool gtk2 ];
+
+  meta = {
+    description = "A very flexible theme engine";
+    homepage = "https://gitlab.gnome.org/Archive/murrine";
+    license = stdenv.lib.licenses.lgpl3;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/gtk-engines/default.nix b/pkgs/development/libraries/gtk-engines/default.nix
new file mode 100644
index 00000000000..2f56f6eb4c5
--- /dev/null
+++ b/pkgs/development/libraries/gtk-engines/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, pkgconfig, intltool, gtk2 }:
+
+stdenv.mkDerivation {
+  name = "gtk-engines-2.20.2";
+
+  src = fetchurl {
+    url = "ftp://ftp.gnome.org/pub/gnome/sources/gtk-engines/2.20/gtk-engines-2.20.2.tar.bz2";
+    sha256 = "1db65pb0j0mijmswrvpgkdabilqd23x22d95hp5kwxvcramq1dhm";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ intltool gtk2 ];
+
+  meta = {
+    description = "Theme engines for GTK 2";
+    license = stdenv.lib.licenses.lgpl21Plus;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/gtk/hooks/drop-icon-theme-cache.sh b/pkgs/development/libraries/gtk/hooks/drop-icon-theme-cache.sh
index 8f2cb8a334a..f28a856c4f5 100644
--- a/pkgs/development/libraries/gtk/hooks/drop-icon-theme-cache.sh
+++ b/pkgs/development/libraries/gtk/hooks/drop-icon-theme-cache.sh
@@ -16,4 +16,4 @@ dropIconThemeCache() {
     fi
 }
 
-preFixupPhases="$preFixupPhases dropIconThemeCache"
+preFixupPhases="${preFixupPhases-} dropIconThemeCache"
diff --git a/pkgs/development/libraries/gtkspell/3.nix b/pkgs/development/libraries/gtkspell/3.nix
index 54b4b001d81..b68c814ad54 100644
--- a/pkgs/development/libraries/gtkspell/3.nix
+++ b/pkgs/development/libraries/gtkspell/3.nix
@@ -25,6 +25,6 @@ stdenv.mkDerivation rec {
     description = "Word-processor-style highlighting GtkTextView widget";
     license = licenses.gpl2Plus;
     platforms = platforms.unix;
-    maintainers = with maintainers; [ fuuzetsu ];
+    maintainers = with maintainers; [ ];
   };
 }
diff --git a/pkgs/development/libraries/gvfs/default.nix b/pkgs/development/libraries/gvfs/default.nix
index 181d5e4c196..f8db6f573d9 100644
--- a/pkgs/development/libraries/gvfs/default.nix
+++ b/pkgs/development/libraries/gvfs/default.nix
@@ -41,11 +41,11 @@
 
 stdenv.mkDerivation rec {
   pname = "gvfs";
-  version = "1.42.1";
+  version = "1.42.2";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0c3pqc8qc2pn08by43rkkmk725k3cqmw7qyhfqgng0qx98dhf1lx";
+    sha256 = "0jgrbid8a61hgh05wl8c4f4638x7dffd5vip02jmladxfdszjymm";
   };
 
   postPatch = ''
diff --git a/pkgs/development/libraries/harfbuzz/default.nix b/pkgs/development/libraries/harfbuzz/default.nix
index 361ac4f27aa..42f68eea83f 100644
--- a/pkgs/development/libraries/harfbuzz/default.nix
+++ b/pkgs/development/libraries/harfbuzz/default.nix
@@ -8,7 +8,7 @@
 }:
 
 let
-  version = "2.6.2";
+  version = "2.6.4";
   inherit (stdenv.lib) optional optionals optionalString;
 in
 
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-${version}.tar.xz";
-    sha256 = "097ncrkaawdzpgwlrpp4kwciq4z5pqz2n4f3yra5vc7jyxr6lk1v";
+    sha256 = "04iwq13w6zkdhljmsxrzgg4fyh04qnwfn57rgrl9kmijc7cvh4wl";
   };
 
   postPatch = ''
diff --git a/pkgs/development/libraries/hunspell/default.nix b/pkgs/development/libraries/hunspell/default.nix
index a8dcea0059a..f2f8cdcab20 100644
--- a/pkgs/development/libraries/hunspell/default.nix
+++ b/pkgs/development/libraries/hunspell/default.nix
@@ -51,6 +51,6 @@ stdenv.mkDerivation rec {
     '';
     platforms = platforms.all;
     license = with licenses; [ gpl2 lgpl21 mpl11 ];
-    maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
+    maintainers = with stdenv.lib.maintainers; [ ];
   };
 }
diff --git a/pkgs/development/libraries/hyphen/default.nix b/pkgs/development/libraries/hyphen/default.nix
new file mode 100644
index 00000000000..9f30ff54823
--- /dev/null
+++ b/pkgs/development/libraries/hyphen/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, perl, ... }:
+
+let
+  version = "2.8.8";
+  folder = with builtins;
+    let parts = splitVersion version;
+    in concatStringsSep "." [ (elemAt parts 0) (elemAt parts 1) ];
+in stdenv.mkDerivation rec {
+  pname = "hyphen";
+  inherit version;
+
+  nativeBuildInputs = [ perl ];
+
+  src = fetchurl {
+    url =
+      "https://sourceforge.net/projects/hunspell/files/Hyphen/${folder}/${pname}-${version}.tar.gz";
+    sha256 = "01ap9pr6zzzbp4ky0vy7i1983fwyqy27pl0ld55s30fdxka3ciih";
+  };
+
+  meta = with stdenv.lib; {
+    description = "A text hyphenation library";
+    homepage = "https://sourceforge.net/projects/hunspell/files/Hyphen/";
+    platforms = platforms.all;
+    license = with licenses; [ gpl2 lgpl21 mpl11 ];
+    maintainers = with maintainers; [ filalex77 ];
+  };
+}
diff --git a/pkgs/development/libraries/icu/base.nix b/pkgs/development/libraries/icu/base.nix
index 0a8cb7d4684..47ca63fca99 100644
--- a/pkgs/development/libraries/icu/base.nix
+++ b/pkgs/development/libraries/icu/base.nix
@@ -63,10 +63,16 @@ let
     # remove dependency on bootstrap-tools in early stdenv build
     postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
       sed -i 's/INSTALL_CMD=.*install/INSTALL_CMD=install/' $out/lib/icu/${version}/pkgdata.inc
-    '' + ''
+    '' + (let
+      replacements = [
+        { from = "\${prefix}/include"; to = "${placeholder "dev"}/include"; } # --cppflags-searchpath
+        { from = "\${pkglibdir}/Makefile.inc"; to = "${placeholder "dev"}/lib/icu/Makefile.inc"; } # --incfile
+        { from = "\${pkglibdir}/pkgdata.inc"; to = "${placeholder "dev"}/lib/icu/pkgdata.inc"; } # --incpkgdatafile
+      ];
+    in ''
       substituteInPlace "$dev/bin/icu-config" \
-        --replace \''${pkglibdir}/Makefile.inc "$dev/lib/icu/Makefile.inc"
-    '';
+        ${lib.concatMapStringsSep " " (r: "--replace '${r.from}' '${r.to}'") replacements}
+    '');
 
     postFixup = ''moveToOutput lib/icu "$dev" '';
   };
diff --git a/pkgs/development/libraries/ilmbase/default.nix b/pkgs/development/libraries/ilmbase/default.nix
index 5cc0f7c1f46..a25a590b370 100644
--- a/pkgs/development/libraries/ilmbase/default.nix
+++ b/pkgs/development/libraries/ilmbase/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, buildPackages, automake, autoconf, libtool, which }:
+{ stdenv, fetchurl, buildPackages, automake, autoconf, libtool, which,
+  fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "ilmbase";
@@ -21,7 +22,17 @@ stdenv.mkDerivation rec {
 
   NIX_CFLAGS_LINK = [ "-pthread" ];
 
-  patches = [ ./bootstrap.patch ./cross.patch ];
+  patches = [
+    ./bootstrap.patch
+    ./cross.patch
+    (fetchpatch {
+      name = "CVE-2018-18443.patch";
+      url = "https://github.com/kdt3rd/openexr/commit/5fa930b82cff2db386c64ca512af19e60c14d32a.patch";
+      sha256 = "1j6xd0qkx99acc1szycxaj0wwp01yac67jz48hwc4fwwpz8blx4s";
+      stripLen = 1;
+      excludes = [ "CHANGES.md" ];
+    })
+  ];
 
   # fails 1 out of 1 tests with
   # "lt-ImathTest: testBoxAlgo.cpp:892: void {anonymous}::boxMatrixTransform(): Assertion `b21 == b2' failed"
@@ -29,6 +40,7 @@ stdenv.mkDerivation rec {
   doCheck = stdenv.isx86_64;
 
   meta = with stdenv.lib; {
+    description = " A library for 2D/3D vectors and matrices and other mathematical objects, functions and data types for computer graphics";
     homepage = https://www.openexr.com/;
     license = licenses.bsd3;
     platforms = platforms.all;
diff --git a/pkgs/development/libraries/incrtcl/default.nix b/pkgs/development/libraries/incrtcl/default.nix
index f74477eab38..e7f575b04be 100644
--- a/pkgs/development/libraries/incrtcl/default.nix
+++ b/pkgs/development/libraries/incrtcl/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation {
   pname = "incrtcl";
-  version = "4.0.4";
+  version = "4.2.0";
 
   src = fetchurl {
-    url = mirror://sourceforge/incrtcl/%5BIncr%20Tcl_Tk%5D-source/3.4/itcl4.0.4.tar.gz;
-    sha256 = "1ppc9b13cvmc6rp77k7dl2zb26xk0z30vxygmr4h1xr2r8w091k3";
+    url = mirror://sourceforge/incrtcl/%5BIncr%20Tcl_Tk%5D-source/3.4/itcl4.2.0.tar.gz;
+    sha256 = "0w28v0zaraxcq1s9pa6cihqqwqvvwfgz275lks7w4gl7hxjxmasw";
   };
 
   buildInputs = [ tcl ];
diff --git a/pkgs/development/libraries/intel-gmmlib/default.nix b/pkgs/development/libraries/intel-gmmlib/default.nix
index 6657409a708..6c872272e37 100644
--- a/pkgs/development/libraries/intel-gmmlib/default.nix
+++ b/pkgs/development/libraries/intel-gmmlib/default.nix
@@ -4,13 +4,13 @@
 
 stdenv.mkDerivation rec {
   pname = "intel-gmmlib";
-  version = "19.3.2";
+  version = "19.3.4";
 
   src = fetchFromGitHub {
     owner  = "intel";
     repo   = "gmmlib";
     rev    = "${pname}-${version}";
-    sha256 = "04jmzyciswvfb31h9shkja9183bmm1clw0l0sn1flq76888nngma";
+    sha256 = "1vgh14vdmwr34l6rfzmbpsdwp4xi7qp8lg527p16pm7nv0bwx2zk";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/intel-media-sdk/default.nix b/pkgs/development/libraries/intel-media-sdk/default.nix
index 731289d6f9c..49375830ccb 100644
--- a/pkgs/development/libraries/intel-media-sdk/default.nix
+++ b/pkgs/development/libraries/intel-media-sdk/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   pname = "intel-media-sdk";
-  version = "19.3.0";
+  version = "19.3.1";
 
   src = fetchurl {
     url = "https://github.com/Intel-Media-SDK/MediaSDK/archive/intel-mediasdk-${version}.tar.gz";
-    sha256 = "0pgg16a4gsh8yjyz64r28bmkg9xxcy8m0dkvrdz03svkll9v7v3n";
+    sha256 = "12w1f3krcrjyhax4y3hbs7galhf4rabxym2fxjyil8cszx5fh433";
   };
 
   # patchelf is needed for binaries in $out/share/samples
@@ -23,6 +23,6 @@ stdenv.mkDerivation rec {
     description = "Intel Media SDK.";
     license = licenses.mit;
     maintainers = with maintainers; [ midchildan ];
-    platforms = with platforms; linux;
+    platforms = [ "x86_64-linux" ];
   };
 }
diff --git a/pkgs/development/libraries/irrlicht/default.nix b/pkgs/development/libraries/irrlicht/default.nix
index 35ef14cbc13..788772888c6 100644
--- a/pkgs/development/libraries/irrlicht/default.nix
+++ b/pkgs/development/libraries/irrlicht/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, libGLU_combined, unzip, libXrandr, libX11, libXxf86vm }:
+{ stdenv, fetchzip, libGLU, libGL, unzip, libXrandr, libX11, libXxf86vm }:
 
 
 stdenv.mkDerivation rec {
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     mkdir -p $out/lib
   '';
 
-  buildInputs = [ unzip libGLU_combined libXrandr libX11 libXxf86vm ];
+  buildInputs = [ unzip libGLU libGL libXrandr libX11 libXxf86vm ];
 
   meta = {
     homepage = http://irrlicht.sourceforge.net/;
diff --git a/pkgs/development/libraries/jasper/default.nix b/pkgs/development/libraries/jasper/default.nix
index 1bad3394b6a..093fd0c5f28 100644
--- a/pkgs/development/libraries/jasper/default.nix
+++ b/pkgs/development/libraries/jasper/default.nix
@@ -42,5 +42,10 @@ stdenv.mkDerivation rec {
     platforms = platforms.unix;
     license = licenses.jasper;
     maintainers = with maintainers; [ pSub ];
+    knownVulnerabilities = [
+      "Numerous CVE unsolved upstream"
+      "See: https://github.com/NixOS/nixpkgs/pull/57681#issuecomment-475857499"
+      "See: https://github.com/mdadams/jasper/issues/208"
+    ];
   };
 }
diff --git a/pkgs/development/libraries/java/hsqldb/builder.sh b/pkgs/development/libraries/java/hsqldb/builder.sh
deleted file mode 100755
index d7de23ab95e..00000000000
--- a/pkgs/development/libraries/java/hsqldb/builder.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-source $stdenv/setup
-
-unzip $src
-cd hsqldb*
-mkdir -p $out
-cp -R * $out/
diff --git a/pkgs/development/libraries/java/hsqldb/default.nix b/pkgs/development/libraries/java/hsqldb/default.nix
index a478ab0fc50..d9139ec1d82 100644
--- a/pkgs/development/libraries/java/hsqldb/default.nix
+++ b/pkgs/development/libraries/java/hsqldb/default.nix
@@ -1,19 +1,37 @@
-{ stdenv, fetchurl, unzip
-}:
+{ stdenv, fetchurl, unzip, makeWrapper, jre }:
 
-stdenv.mkDerivation {
-  name = "hsqldb-2.4.0";
-  builder = ./builder.sh;
+stdenv.mkDerivation rec {
+  pname = "hsqldb";
+  version = "2.5.0";
+  underscoreMajMin = stdenv.lib.strings.replaceChars ["."] ["_"] (stdenv.lib.versions.majorMinor version);
 
   src = fetchurl {
-    url = mirror://sourceforge/hsqldb/hsqldb_1_8_0_9.zip;
-    sha256 = "1v5dslwsqb7csjmi5g78pghsay2pszidvlzhyi79y18mra5iv3g9";
+    url = "mirror://sourceforge/project/hsqldb/hsqldb/hsqldb_${underscoreMajMin}/hsqldb-${version}.zip";
+    sha256 = "0s64w7qq5vayrzcmdhrdfmd6iqqv6x6fpiq9lpy2gva3dckv3q6j";
   };
 
-  buildInputs = [ unzip
-  ];
+  nativeBuildInputs = [ unzip makeWrapper ];
+  buildInputs = [ jre ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/lib $out/bin
+    cp -R hsqldb/lib/*.jar $out/lib
+
+    makeWrapper ${jre}/bin/java $out/bin/hsqldb --add-flags "-classpath $out/lib/hsqldb.jar org.hsqldb.server.Server"
+    makeWrapper ${jre}/bin/java $out/bin/runServer --add-flags "-classpath $out/lib/hsqldb.jar org.hsqldb.server.Server"
+    makeWrapper ${jre}/bin/java $out/bin/runManagerSwing --add-flags "-classpath $out/lib/hsqldb.jar org.hsqldb.util.DatabaseManagerSwing"
+    makeWrapper ${jre}/bin/java $out/bin/runWebServer --add-flags "-classpath $out/lib/hsqldb.jar org.hsqldb.server.WebServer"
+    makeWrapper ${jre}/bin/java $out/bin/runManager --add-flags "-classpath $out/lib/hsqldb.jar org.hsqldb.util.DatabaseManager"
+    makeWrapper ${jre}/bin/java $out/bin/sqltool --add-flags "-jar $out/lib/sqltool.jar"
+
+   runHook postInstall
+  '';
 
   meta = with stdenv.lib; {
+    homepage = "http://hsqldb.org";
+    description = "A relational, embedable database management system written in Java and a set of related tools";
     platforms = platforms.unix;
     license = licenses.bsd3;
   };
diff --git a/pkgs/development/libraries/java/smack/default.nix b/pkgs/development/libraries/java/smack/default.nix
index e28925c65bb..d5f8ac217f3 100644
--- a/pkgs/development/libraries/java/smack/default.nix
+++ b/pkgs/development/libraries/java/smack/default.nix
@@ -10,6 +10,8 @@ stdenv.mkDerivation {
   };
 
   meta = {
+    description = "A XMPP (Jabber) client library for instant messaging and presence";
+    homepage = "http://www.igniterealtime.org/projects/smack/";
     platforms = stdenv.lib.platforms.unix;
     license = stdenv.lib.licenses.asl20;
   };
diff --git a/pkgs/development/libraries/java/swt/default.nix b/pkgs/development/libraries/java/swt/default.nix
index a93d7774291..6eb5a1f5355 100644
--- a/pkgs/development/libraries/java/swt/default.nix
+++ b/pkgs/development/libraries/java/swt/default.nix
@@ -1,5 +1,5 @@
 { stdenv, lib, fetchurl, unzip, jdk, pkgconfig, gtk2
-, libXt, libXtst, libXi, libGLU_combined, webkitgtk, libsoup, xorg
+, libXt, libXtst, libXi, libGLU, libGL, webkitgtk, libsoup, xorg
 , pango, gdk-pixbuf, glib
 }:
 
@@ -36,7 +36,7 @@ in stdenv.mkDerivation rec {
   sourceRoot = ".";
 
   nativeBuildInputs = [ unzip pkgconfig ];
-  buildInputs = [ jdk gtk2 libXt libXtst libXi libGLU_combined webkitgtk libsoup ];
+  buildInputs = [ jdk gtk2 libXt libXtst libXi libGLU libGL webkitgtk libsoup ];
 
   NIX_LFLAGS = (map (x: "-L${lib.getLib x}/lib") [ xorg.libX11 pango gdk-pixbuf glib ]) ++
     [ "-lX11" "-lpango-1.0" "-lgdk_pixbuf-2.0" "-lglib-2.0" ];
diff --git a/pkgs/development/libraries/jbig2dec/default.nix b/pkgs/development/libraries/jbig2dec/default.nix
index 31c9c89d96f..35fbdfe488a 100644
--- a/pkgs/development/libraries/jbig2dec/default.nix
+++ b/pkgs/development/libraries/jbig2dec/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, python, autoconf }:
 
 stdenv.mkDerivation rec {
-  name = "jbig2dec-0.16";
+  name = "jbig2dec-0.17";
 
   src = fetchurl {
-    url = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs927/${name}.tar.gz";
-    sha256 = "00h61y7bh3z6mqfzxyb318gyh0f8jwarg4hvlrm83rqps8avzxm4";
+    url = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs950/${name}.tar.gz";
+    sha256 = "0wpvslmwazia3z8gyk343kbq6yj47pxr4x5yjvx332v309qssazp";
   };
 
   postPatch = ''
diff --git a/pkgs/development/libraries/jitterentropy/default.nix b/pkgs/development/libraries/jitterentropy/default.nix
index f6a70deb8c2..ddf4ba62169 100644
--- a/pkgs/development/libraries/jitterentropy/default.nix
+++ b/pkgs/development/libraries/jitterentropy/default.nix
@@ -14,6 +14,9 @@ stdenv.mkDerivation rec {
 
   preInstall = ''
     mkdir -p $out/include
+    substituteInPlace Makefile \
+      --replace "install -m 0755 -s" \
+                'install -m 0755 -s --strip-program $(STRIP)'
   '';
 
   installFlags = [
diff --git a/pkgs/development/libraries/jsoncpp/default.nix b/pkgs/development/libraries/jsoncpp/default.nix
index c62f1e2de3f..72158e186ac 100644
--- a/pkgs/development/libraries/jsoncpp/default.nix
+++ b/pkgs/development/libraries/jsoncpp/default.nix
@@ -1,14 +1,14 @@
-{ stdenv , fetchFromGitHub , cmake , python }:
+{ stdenv, fetchFromGitHub, cmake, python, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "jsoncpp";
-  version = "1.9.1";
+  version = "1.9.2";
 
   src = fetchFromGitHub {
     owner = "open-source-parsers";
     repo = "jsoncpp";
     rev = version;
-    sha256 = "00g356iv3kcp0gadj7gbyzf9jn9avvx9vxbxc7c2i5nnry8z72wj";
+    sha256 = "037d1b1qdmn3rksmn1j71j26bv4hkjv7sn7da261k853xb5899sg";
   };
 
   /* During darwin bootstrap, we have a cp that doesn't understand the
@@ -30,6 +30,14 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake python ];
 
+  # fix inverted sense in isAnyCharRequiredQuoting on aarch64. See: https://github.com/open-source-parsers/jsoncpp/pull/1120
+  patches = stdenv.lib.optionals stdenv.isAarch64 [
+    (fetchpatch {
+      url = "https://github.com/open-source-parsers/jsoncpp/commit/9093358efae9e5981aa60013487fc7215f040a59.patch";
+      sha256 = "1wiqp70sck2md14sfc0zdkblqk9750cl55ykf9d6b9vs1ifzzzq5";
+     })
+  ];
+
   cmakeFlags = [
     "-DBUILD_SHARED_LIBS=ON"
     "-DBUILD_STATIC_LIBS=OFF"
diff --git a/pkgs/development/libraries/kde-frameworks/default.nix b/pkgs/development/libraries/kde-frameworks/default.nix
index ef1171b1760..d18dea1c381 100644
--- a/pkgs/development/libraries/kde-frameworks/default.nix
+++ b/pkgs/development/libraries/kde-frameworks/default.nix
@@ -42,13 +42,13 @@ let
       propagate = out:
         let setupHook = { writeScript }:
               writeScript "setup-hook" ''
-                if [ "$hookName" != postHook ]; then
+                if [ "''${hookName:-}" != postHook ]; then
                     postHooks+=("source @dev@/nix-support/setup-hook")
                 else
                     # Propagate $dev so that this setup hook is propagated
                     # But only if there is a separate $dev output
                     if [ "''${outputDev:?}" != out ]; then
-                        propagatedBuildInputs="$propagatedBuildInputs @dev@"
+                        propagatedBuildInputs="''${propagatedBuildInputs-} @dev@"
                     fi
                 fi
               '';
@@ -97,6 +97,7 @@ let
       breeze-icons = callPackage ./breeze-icons.nix {};
       kapidox = callPackage ./kapidox.nix {};
       karchive = callPackage ./karchive.nix {};
+      kcalendarcore = callPackage ./kcalendarcore.nix {};
       kcodecs = callPackage ./kcodecs.nix {};
       kconfig = callPackage ./kconfig.nix {};
       kcoreaddons = callPackage ./kcoreaddons.nix {};
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 35982e86628..4135f6bfd7a 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
@@ -42,12 +42,12 @@ ecmPostHook() {
     cmakeFlags+=" -DKDE_INSTALL_CONFDIR=${!outputBin}/etc/xdg"
     cmakeFlags+=" -DKDE_INSTALL_AUTOSTARTDIR=${!outputBin}/etc/xdg/autostart"
 
-    if [ -n "$qtPluginPrefix" ]; then
+    if [ -n "${qtPluginPrefix-}" ]; then
         cmakeFlags+=" -DKDE_INSTALL_QTPLUGINDIR=${!outputBin}/$qtPluginPrefix"
         cmakeFlags+=" -DKDE_INSTALL_PLUGINDIR=${!outputBin}/$qtPluginPrefix"
     fi
 
-    if [ -n "$qtQmlPrefix" ]; then
+    if [ -n "${qtQmlPrefix-}" ]; then
         cmakeFlags+=" -DKDE_INSTALL_QMLDIR=${!outputBin}/$qtQmlPrefix"
     fi
 }
diff --git a/pkgs/development/libraries/kde-frameworks/fetch.sh b/pkgs/development/libraries/kde-frameworks/fetch.sh
index f06a515a83b..c76ff9fb2c8 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.62/ )
+WGET_ARGS=( https://download.kde.org/stable/frameworks/5.64/ )
diff --git a/pkgs/development/libraries/kde-frameworks/kcalendarcore.nix b/pkgs/development/libraries/kde-frameworks/kcalendarcore.nix
new file mode 100644
index 00000000000..e0b6c5313bb
--- /dev/null
+++ b/pkgs/development/libraries/kde-frameworks/kcalendarcore.nix
@@ -0,0 +1,16 @@
+{
+  mkDerivation,
+  lib,
+  extra-cmake-modules,
+  libical
+}:
+
+mkDerivation {
+  name = "kcalendarcore";
+  meta = {
+    maintainers = [ lib.maintainers.nyanloutre ];
+  };
+  nativeBuildInputs = [ extra-cmake-modules ];
+  propagatedBuildInputs = [ libical ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/pkgs/development/libraries/kde-frameworks/ki18n.nix b/pkgs/development/libraries/kde-frameworks/ki18n.nix
index 3b9ca74bbd0..69ad2fbc737 100644
--- a/pkgs/development/libraries/kde-frameworks/ki18n.nix
+++ b/pkgs/development/libraries/kde-frameworks/ki18n.nix
@@ -1,6 +1,6 @@
 {
   mkDerivation, lib,
-  extra-cmake-modules, gettext, python,
+  extra-cmake-modules, gettext, python3,
   qtbase, qtdeclarative, qtscript,
 }:
 
@@ -11,6 +11,6 @@ mkDerivation {
     broken = builtins.compareVersions qtbase.version "5.7.0" < 0;
   };
   nativeBuildInputs = [ extra-cmake-modules ];
-  propagatedNativeBuildInputs = [ gettext python ];
+  propagatedNativeBuildInputs = [ gettext python3 ];
   buildInputs = [ qtdeclarative qtscript ];
 }
diff --git a/pkgs/development/libraries/kde-frameworks/kio/default.nix b/pkgs/development/libraries/kde-frameworks/kio/default.nix
index 6cf89669df0..fee21a6a923 100644
--- a/pkgs/development/libraries/kde-frameworks/kio/default.nix
+++ b/pkgs/development/libraries/kde-frameworks/kio/default.nix
@@ -20,5 +20,6 @@ mkDerivation {
     kbookmarks kcompletion kconfig kcoreaddons kitemviews kjobwidgets kservice
     kxmlgui qtbase qttools solid
   ];
+  outputs = [ "out" "dev" ];
   patches = (copyPathsToStore (lib.readPathsFromFile ./. ./series));
 }
diff --git a/pkgs/development/libraries/kde-frameworks/kwindowsystem/platform-plugins-path.patch b/pkgs/development/libraries/kde-frameworks/kwindowsystem/platform-plugins-path.patch
index 7c86454c5cf..27501732210 100644
--- a/pkgs/development/libraries/kde-frameworks/kwindowsystem/platform-plugins-path.patch
+++ b/pkgs/development/libraries/kde-frameworks/kwindowsystem/platform-plugins-path.patch
@@ -1,17 +1,19 @@
-diff --git a/src/pluginwrapper.cpp b/src/pluginwrapper.cpp
-index 8e6298a..210989a 100644
---- a/src/pluginwrapper.cpp
-+++ b/src/pluginwrapper.cpp
-@@ -37,14 +37,10 @@ Q_GLOBAL_STATIC(KWindowSystemPluginWrapper, s_pluginWrapper)
+Index: kwindowsystem-5.64.0/src/pluginwrapper.cpp
+===================================================================
+--- kwindowsystem-5.64.0.orig/src/pluginwrapper.cpp
++++ kwindowsystem-5.64.0/src/pluginwrapper.cpp
+@@ -37,16 +37,10 @@ Q_GLOBAL_STATIC(KWindowSystemPluginWrapp
  static QStringList pluginCandidates()
  {
      QStringList ret;
--    foreach (const QString &path, QCoreApplication::libraryPaths()) {
+-    const auto paths = QCoreApplication::libraryPaths();
+-    for (const QString &path : paths) {
 -        QDir pluginDir(path + QLatin1String("/kf5/org.kde.kwindowsystem.platforms"));
 -        if (!pluginDir.exists()) {
 -            continue;
 -        }
--        foreach (const QString &entry, pluginDir.entryList(QDir::Files | QDir::NoDotAndDotDot)) {
+-        const auto entries = pluginDir.entryList(QDir::Files | QDir::NoDotAndDotDot);
+-        for (const QString &entry : entries) {
 -            ret << pluginDir.absoluteFilePath(entry);
 -        }
 +    QDir pluginDir(QLatin1String(NIXPKGS_QT_PLUGIN_PATH) + QLatin1Literal("/kf5/org.kde.kwindowsystem.platforms"));
diff --git a/pkgs/development/libraries/kde-frameworks/srcs.nix b/pkgs/development/libraries/kde-frameworks/srcs.nix
index 6a7c7bc0c9c..32edca38710 100644
--- a/pkgs/development/libraries/kde-frameworks/srcs.nix
+++ b/pkgs/development/libraries/kde-frameworks/srcs.nix
@@ -3,635 +3,651 @@
 
 {
   attica = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/attica-5.62.0.tar.xz";
-      sha256 = "86b5388c93dd3375dbdca23b20d539af5ed9516f6a573e32549baac3200d029f";
-      name = "attica-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/attica-5.64.0.tar.xz";
+      sha256 = "c9b060693656a458f92905091e12d800be020abbf47bb68b9f769a191aa368d9";
+      name = "attica-5.64.0.tar.xz";
     };
   };
   baloo = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/baloo-5.62.0.tar.xz";
-      sha256 = "454e6808a5fe523785e5e67b7c0453fd1b6c42035aaf8084c39ad30bcbbc8d1a";
-      name = "baloo-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/baloo-5.64.0.tar.xz";
+      sha256 = "adaaef1aeec07ccc210210a2e67f4d12c0275226bb05d0220da0281f1a3984c2";
+      name = "baloo-5.64.0.tar.xz";
     };
   };
   bluez-qt = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/bluez-qt-5.62.0.tar.xz";
-      sha256 = "545a6c76042a077f04b0a6c2b8dfbe3b5b1a582edaae4454d7a57c06ab033715";
-      name = "bluez-qt-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/bluez-qt-5.64.0.tar.xz";
+      sha256 = "7d6c7ba913cea6059327726325b8af4cf2baa7594b8be3143e0649eaa36f8384";
+      name = "bluez-qt-5.64.0.tar.xz";
     };
   };
   breeze-icons = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/breeze-icons-5.62.0.tar.xz";
-      sha256 = "5858100f1a87dc865f44cde159aaee025ec46f894f544c75086ea0e8f9555951";
-      name = "breeze-icons-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/breeze-icons-5.64.0.tar.xz";
+      sha256 = "08c2f7efc5f1550668dd2e0cff1641b1b6ec8a91f01614ee14c6abc4d975672f";
+      name = "breeze-icons-5.64.0.tar.xz";
     };
   };
   extra-cmake-modules = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/extra-cmake-modules-5.62.0.tar.xz";
-      sha256 = "e07acfecef1b4c7a481a253b58b75072a4f887376301108ed2c753b5002adcd4";
-      name = "extra-cmake-modules-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/extra-cmake-modules-5.64.0.tar.xz";
+      sha256 = "1865efc6254bed44e0a6918c5af3da62be4008ba7a197a47f35251f298041a69";
+      name = "extra-cmake-modules-5.64.0.tar.xz";
     };
   };
   frameworkintegration = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/frameworkintegration-5.62.0.tar.xz";
-      sha256 = "0d43d6cd008359eac4840c8b6e12d2b17eeb53c95111af1f7e8ca6ae8e6aca2c";
-      name = "frameworkintegration-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/frameworkintegration-5.64.0.tar.xz";
+      sha256 = "6c1880f8300a014bb835ce29fd68651bfd38400de8044fe5914cb4392df48a26";
+      name = "frameworkintegration-5.64.0.tar.xz";
     };
   };
   kactivities = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kactivities-5.62.0.tar.xz";
-      sha256 = "b466b8921adad6d887f93f760634dfa344ae52df83c58dd7ae75174961def85b";
-      name = "kactivities-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kactivities-5.64.0.tar.xz";
+      sha256 = "5afbd0785c04127c91f1ad7402c95ce3f994fb94b216baf56cd802a3a230a3f9";
+      name = "kactivities-5.64.0.tar.xz";
     };
   };
   kactivities-stats = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kactivities-stats-5.62.0.tar.xz";
-      sha256 = "e6850a59d2e3dd566c77aa2b2fdc684737634b59755dcc7de231b8b496acbc1a";
-      name = "kactivities-stats-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kactivities-stats-5.64.0.tar.xz";
+      sha256 = "ca1c07b1250735372a4f6aa6b493536d420a902de0d7a8c9777b437fb6ab0bf9";
+      name = "kactivities-stats-5.64.0.tar.xz";
     };
   };
   kapidox = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kapidox-5.62.0.tar.xz";
-      sha256 = "6aa3928b26acc23f5271ba0591d64a55c342e36ae16094e09be1ef038538952f";
-      name = "kapidox-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kapidox-5.64.0.tar.xz";
+      sha256 = "f75eedfa1af51f5224b14d8bc4c229c2c2d27f607e00172d24bdcede1c899fb4";
+      name = "kapidox-5.64.0.tar.xz";
     };
   };
   karchive = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/karchive-5.62.0.tar.xz";
-      sha256 = "99980ebdc16dd9ac062fcfda0974c0ce894c09a395caf914518646ffdc48e3ca";
-      name = "karchive-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/karchive-5.64.0.tar.xz";
+      sha256 = "135fbfb2dfe107e4487723a5f887d1d074e13258a4583d592639366094aafe1a";
+      name = "karchive-5.64.0.tar.xz";
     };
   };
   kauth = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kauth-5.62.0.tar.xz";
-      sha256 = "31162621200df4b927719e34ce62004c51e79b9d785f9c3056c6902f80eeefe6";
-      name = "kauth-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kauth-5.64.0.tar.xz";
+      sha256 = "ac95525bf1430868c8f54dbdc986478cf7b21192ad3b486381485b429eadddcc";
+      name = "kauth-5.64.0.tar.xz";
     };
   };
   kbookmarks = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kbookmarks-5.62.0.tar.xz";
-      sha256 = "69318784fa5feaee3e60bb159fb6c827475a8ce28a74bedf5939ad592c29ea4f";
-      name = "kbookmarks-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kbookmarks-5.64.0.tar.xz";
+      sha256 = "51343a57b50032d60ffae123f426cdd67cd290ce306ae494c1956d0b899d4ff2";
+      name = "kbookmarks-5.64.0.tar.xz";
+    };
+  };
+  kcalendarcore = {
+    version = "5.64.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.64/kcalendarcore-5.64.0.tar.xz";
+      sha256 = "983f240a7478a780dc403d577827f027856f9f67e8c3bfe8b69d56093e5bb80e";
+      name = "kcalendarcore-5.64.0.tar.xz";
     };
   };
   kcmutils = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kcmutils-5.62.0.tar.xz";
-      sha256 = "93fd9b7b97cb4488f2007a4f518159129f0caafc05a004be56c87dd355870b1b";
-      name = "kcmutils-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kcmutils-5.64.0.tar.xz";
+      sha256 = "f55938c566669e9fcdd786ebfd89edfc11b0c283532aed04cfe4162b58a8b649";
+      name = "kcmutils-5.64.0.tar.xz";
     };
   };
   kcodecs = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kcodecs-5.62.0.tar.xz";
-      sha256 = "1b015be0200444f1ce18ecc5c05dbafde62575a8e094e48698b4b64f43f307b1";
-      name = "kcodecs-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kcodecs-5.64.0.tar.xz";
+      sha256 = "24cbffb123179cf4386500ae7bc7c99f65c4422cd7b91f314152f11cd596402a";
+      name = "kcodecs-5.64.0.tar.xz";
     };
   };
   kcompletion = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kcompletion-5.62.0.tar.xz";
-      sha256 = "af774190ca1a0e4d335485548d6e5c1e02042a5d0e29a3c0db17c24e3656edec";
-      name = "kcompletion-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kcompletion-5.64.0.tar.xz";
+      sha256 = "4fe5b9254e038e654d55167163b2812582f31fe550c977979d692b69424c2508";
+      name = "kcompletion-5.64.0.tar.xz";
     };
   };
   kconfig = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kconfig-5.62.0.tar.xz";
-      sha256 = "fffe16924245e34d6267e67a6d425dc7b4fdab405968bffa4fff7bea5779bb51";
-      name = "kconfig-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kconfig-5.64.0.tar.xz";
+      sha256 = "112c1db9f038dbacf357d08645c83ca103d8c3e7fb0c880ac16f665fdf7d9157";
+      name = "kconfig-5.64.0.tar.xz";
     };
   };
   kconfigwidgets = {
-    version = "5.62.0";
+    version = "5.64.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.64/kconfigwidgets-5.64.0.tar.xz";
+      sha256 = "e84d590c064f2a86d5b9d2fb5d8aa7abc8ac8752125f5d3197cca6dc7e115c56";
+      name = "kconfigwidgets-5.64.0.tar.xz";
+    };
+  };
+  kcontacts = {
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kconfigwidgets-5.62.0.tar.xz";
-      sha256 = "6c10810725e0b109c96ddc2246ca1741bcae012296e31caf7b41167a04ae31d6";
-      name = "kconfigwidgets-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kcontacts-5.64.0.tar.xz";
+      sha256 = "0bf0a1ba6ebedd400bed7a490093962cde6a2b26c49627d6770a71524db63058";
+      name = "kcontacts-5.64.0.tar.xz";
     };
   };
   kcoreaddons = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kcoreaddons-5.62.0.tar.xz";
-      sha256 = "3819e2792a2e61444e337cd1a4cbdc362c18810918376eefc30b203fbd160b41";
-      name = "kcoreaddons-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kcoreaddons-5.64.0.tar.xz";
+      sha256 = "3f0cb3273debf9791dda3f1ad135b6b1a20d88fed1e21890c4b70bac64fdb188";
+      name = "kcoreaddons-5.64.0.tar.xz";
     };
   };
   kcrash = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kcrash-5.62.0.tar.xz";
-      sha256 = "9fac9396212148aade4b59665ec1725fa76e229f24c46b601f066e0026eddd2c";
-      name = "kcrash-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kcrash-5.64.0.tar.xz";
+      sha256 = "9e9ad5e7a6a3e9a128128a7863204f8c4a555bd8659d8ed4ef4cc6bb2fc48290";
+      name = "kcrash-5.64.0.tar.xz";
     };
   };
   kdbusaddons = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kdbusaddons-5.62.0.tar.xz";
-      sha256 = "d32e0b16abcb2b1593a567b0ef12cfb94ec2f08e5b8a3ec56efac19b22ca0152";
-      name = "kdbusaddons-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kdbusaddons-5.64.0.tar.xz";
+      sha256 = "74a6eb443a74eb74a859238b555a3b16be1d6367c4db2a7af5b16da528d57f62";
+      name = "kdbusaddons-5.64.0.tar.xz";
     };
   };
   kdeclarative = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kdeclarative-5.62.0.tar.xz";
-      sha256 = "804bc6dd1848fe38b9160a680f3d9f9b67d47150ee9683b3d2c5a07b96a12e46";
-      name = "kdeclarative-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kdeclarative-5.64.0.tar.xz";
+      sha256 = "1bf199aebabe63880babc364572de44f6b0a94ffbbffd955bc85916c2be7701d";
+      name = "kdeclarative-5.64.0.tar.xz";
     };
   };
   kded = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kded-5.62.0.tar.xz";
-      sha256 = "d2d7a979114ca770442cec0f89fe87730ff0c44b98ee64b39c2cada672fc03b1";
-      name = "kded-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kded-5.64.0.tar.xz";
+      sha256 = "2e8bda93918ac174254c8f70a71c9d6966a4721e14a631760e1b912d108001be";
+      name = "kded-5.64.0.tar.xz";
     };
   };
   kdelibs4support = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/portingAids/kdelibs4support-5.62.0.tar.xz";
-      sha256 = "9cc10b4727b8ee3bae46af796e7da5d6ae620c543278814176a389ea178595ed";
-      name = "kdelibs4support-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/portingAids/kdelibs4support-5.64.0.tar.xz";
+      sha256 = "8c9e23e0e22ccec8b46b4c4b160adb8c8765c1dc308bf297f6f72ccc97c7b682";
+      name = "kdelibs4support-5.64.0.tar.xz";
     };
   };
   kdesignerplugin = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/portingAids/kdesignerplugin-5.62.0.tar.xz";
-      sha256 = "b5c0769d0b1df99f456c3c6f22a48e8bdf9c15f00be2e0795ae5bc5170596e47";
-      name = "kdesignerplugin-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/portingAids/kdesignerplugin-5.64.0.tar.xz";
+      sha256 = "1ca638ec822d9882f4a865d599ce8ad94785fa890ce73bccd5e78210c4a3d95b";
+      name = "kdesignerplugin-5.64.0.tar.xz";
     };
   };
   kdesu = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kdesu-5.62.0.tar.xz";
-      sha256 = "9c22ad0a5c1d948a91846a34066155f64758b69ab005eb423bb02ba06301c80e";
-      name = "kdesu-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kdesu-5.64.0.tar.xz";
+      sha256 = "f4644b0ee91c55473589909c20a7fa1cfbd3d466f1c72b330d53871a2346d4f0";
+      name = "kdesu-5.64.0.tar.xz";
     };
   };
   kdewebkit = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/portingAids/kdewebkit-5.62.0.tar.xz";
-      sha256 = "5e45a7866b28d69e6d28f821011c020e53cc6e5b59bcdb7a5d9cb7bda37175e4";
-      name = "kdewebkit-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/portingAids/kdewebkit-5.64.0.tar.xz";
+      sha256 = "882801a1fd944b08918cb7d9341985e4330e7adac00ae4e6dddcea5343393ac1";
+      name = "kdewebkit-5.64.0.tar.xz";
     };
   };
   kdnssd = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kdnssd-5.62.0.tar.xz";
-      sha256 = "21554c6faf2f7136fb8f7a2908340c120ed0d5dc1475f5aeb8cafed1e4228009";
-      name = "kdnssd-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kdnssd-5.64.0.tar.xz";
+      sha256 = "92d9a4947c45e56ea15e417eaf87121b4b3a4f1f81dfd154d2ee968a9797f46b";
+      name = "kdnssd-5.64.0.tar.xz";
     };
   };
   kdoctools = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kdoctools-5.62.0.tar.xz";
-      sha256 = "471ce5106f80af7272d2ea54265bde5a833c8de7716e8bd82f7a5742939c3f48";
-      name = "kdoctools-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kdoctools-5.64.0.tar.xz";
+      sha256 = "3e669c9bdf8822c262d834a9fbe9250ffdc91ea49c916b2c16ac8483b62f8fce";
+      name = "kdoctools-5.64.0.tar.xz";
     };
   };
   kemoticons = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kemoticons-5.62.0.tar.xz";
-      sha256 = "fab145b2c4106be8a4f0024cb436d02d0fdcbf8666e9a790cc1cd98db1e70313";
-      name = "kemoticons-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kemoticons-5.64.0.tar.xz";
+      sha256 = "0b586957bfe26ce0fe44eca305992f99e3c31fbeb19a9d369c4abfdf9cc0400f";
+      name = "kemoticons-5.64.0.tar.xz";
     };
   };
   kfilemetadata = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kfilemetadata-5.62.0.tar.xz";
-      sha256 = "2d8488500b19a7d8f90712775e0353e16957857a89162d6c7b947dd5536245b0";
-      name = "kfilemetadata-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kfilemetadata-5.64.0.tar.xz";
+      sha256 = "4b581e4d659defe4db595a984ed4c037bc80e0bf7b298ec79e6aa5061fa56e23";
+      name = "kfilemetadata-5.64.0.tar.xz";
     };
   };
   kglobalaccel = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kglobalaccel-5.62.0.tar.xz";
-      sha256 = "b087ec1a23a50787d27e8c5d618d4097375a2f7b6188bc9077a5e60d11e2c04d";
-      name = "kglobalaccel-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kglobalaccel-5.64.0.tar.xz";
+      sha256 = "6863515428988c129acfcceaa3518f90d72c590aff2c295a958a68d0c4cd02ab";
+      name = "kglobalaccel-5.64.0.tar.xz";
     };
   };
   kguiaddons = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kguiaddons-5.62.0.tar.xz";
-      sha256 = "5fc61818ed054901a8b1a6a56a83ccaf5f38d9ea7c5761fa6279cd7316d81e44";
-      name = "kguiaddons-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kguiaddons-5.64.0.tar.xz";
+      sha256 = "4caac79b7341c7796f3ca5e1d88cef57ecab2eefcac9ab654fd977706c89bae4";
+      name = "kguiaddons-5.64.0.tar.xz";
     };
   };
   kholidays = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kholidays-5.62.0.tar.xz";
-      sha256 = "f9f7cc399b35cef9348b8fbaabb87145b689165a66b874e3250456f6bbdcb329";
-      name = "kholidays-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kholidays-5.64.0.tar.xz";
+      sha256 = "65b847ba7a00e1a42c0048fe05a400f584e1d9e746edb5d935331ffcb1f5d4ab";
+      name = "kholidays-5.64.0.tar.xz";
     };
   };
   khtml = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/portingAids/khtml-5.62.0.tar.xz";
-      sha256 = "35e3f7e419041f0892ea42c6506b627661137602c25f0f1d6a81537b583682c1";
-      name = "khtml-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/portingAids/khtml-5.64.0.tar.xz";
+      sha256 = "00d3a3e8c8b8072f4894d74f91d963cfefbd681e47da0b8e80e1297224c5af85";
+      name = "khtml-5.64.0.tar.xz";
     };
   };
   ki18n = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/ki18n-5.62.0.tar.xz";
-      sha256 = "b11a0c94c7149798f3f6592e2c386a682d9c528d1e10a59ed3934a93acbc79cb";
-      name = "ki18n-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/ki18n-5.64.0.tar.xz";
+      sha256 = "ccd2c2f8b14251701f902c9e7d046da1582e544d31edae743911f3554022d024";
+      name = "ki18n-5.64.0.tar.xz";
     };
   };
   kiconthemes = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kiconthemes-5.62.0.tar.xz";
-      sha256 = "33fb5caf28ee763edeb3def66386a27f6a7b2bac6a6a0f0728dd4b222d11ebfe";
-      name = "kiconthemes-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kiconthemes-5.64.0.tar.xz";
+      sha256 = "f89a97e9501d841d4543249776783ebd1fc4d7f69e114f8a56027f59ad32000a";
+      name = "kiconthemes-5.64.0.tar.xz";
     };
   };
   kidletime = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kidletime-5.62.0.tar.xz";
-      sha256 = "dd2b6a9f7815c8e84b635e694cbf9ee207996d2cf3adb5a85eadd4a8de37f276";
-      name = "kidletime-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kidletime-5.64.0.tar.xz";
+      sha256 = "8287e958a8a2a9538bec1038f5e31ebba338ff522de9c51265ca1d63030581d0";
+      name = "kidletime-5.64.0.tar.xz";
     };
   };
   kimageformats = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kimageformats-5.62.0.tar.xz";
-      sha256 = "65c179e15dd9c81a4515eb9189951641cca4aad9e7456067a208658ce205c2c2";
-      name = "kimageformats-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kimageformats-5.64.0.tar.xz";
+      sha256 = "48c6a7026854127fc83698ab11e6639a525d387cf384f2558db6c7478bceae4c";
+      name = "kimageformats-5.64.0.tar.xz";
     };
   };
   kinit = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kinit-5.62.0.tar.xz";
-      sha256 = "5c4b066362ab6528b5c9ac654c20cc4eeed87e5384b26b3aa1df968c98c1e21a";
-      name = "kinit-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kinit-5.64.0.tar.xz";
+      sha256 = "5298b783499cedb681c334b20234a511cb3377e66d140e7df6b7c1899186263d";
+      name = "kinit-5.64.0.tar.xz";
     };
   };
   kio = {
-    version = "5.62.1";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kio-5.62.1.tar.xz";
-      sha256 = "4b149085bcfbcd729d808a34bcbd4b11f5f9526aa919c82eaddabc1e88113df0";
-      name = "kio-5.62.1.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kio-5.64.0.tar.xz";
+      sha256 = "e38c8dcf634989f0f7ec95b68bdd936b9e05f7d242e4050b01f79b7021108f59";
+      name = "kio-5.64.0.tar.xz";
     };
   };
   kirigami2 = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kirigami2-5.62.0.tar.xz";
-      sha256 = "b3cc36bddb5e52617075961b2cbaecbb94492523bcc6801a3ad29a35c43bd912";
-      name = "kirigami2-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kirigami2-5.64.0.tar.xz";
+      sha256 = "c394360e2323c55cf654d09ec762a03c47db0027e6a992646ea32d27ce8b228e";
+      name = "kirigami2-5.64.0.tar.xz";
     };
   };
   kitemmodels = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kitemmodels-5.62.0.tar.xz";
-      sha256 = "4ed6c4081cf6493d6f40ab45deb61325346ab8577eadec7ba8af6a36d7a6485e";
-      name = "kitemmodels-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kitemmodels-5.64.0.tar.xz";
+      sha256 = "1bae70e4c6a033eea649efc17f0a060aba89144f4c469f235fbf5023dba5abc4";
+      name = "kitemmodels-5.64.0.tar.xz";
     };
   };
   kitemviews = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kitemviews-5.62.0.tar.xz";
-      sha256 = "34881a269bdae7e3643ab73290931859437fde72042a066170e7467422408065";
-      name = "kitemviews-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kitemviews-5.64.0.tar.xz";
+      sha256 = "0b3f8a0116c042ae187b67f35ffd40872352b91f5f236d19dd26ffad8db83fee";
+      name = "kitemviews-5.64.0.tar.xz";
     };
   };
   kjobwidgets = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kjobwidgets-5.62.0.tar.xz";
-      sha256 = "e3607167361fdd6874a165881de523505bd00d8fabb755abf62114c017a39c93";
-      name = "kjobwidgets-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kjobwidgets-5.64.0.tar.xz";
+      sha256 = "3b39fc5dfc0f1a9cc9bffed3d05b90ba46c52c63cbbeffa0666f5f09e7093ce0";
+      name = "kjobwidgets-5.64.0.tar.xz";
     };
   };
   kjs = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/portingAids/kjs-5.62.0.tar.xz";
-      sha256 = "aaff97d97e3163f890001b7d2e4c0329fdd9d9c53ce4924233246f3ef6cd5962";
-      name = "kjs-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/portingAids/kjs-5.64.0.tar.xz";
+      sha256 = "93855cde810feb7208443a93f81c952bdb42f9886154959bc7a6509c9863e503";
+      name = "kjs-5.64.0.tar.xz";
     };
   };
   kjsembed = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/portingAids/kjsembed-5.62.0.tar.xz";
-      sha256 = "3763c5f67fa92803b5003a41c5b696524be3d0528018a3d5643abc25b161c23b";
-      name = "kjsembed-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/portingAids/kjsembed-5.64.0.tar.xz";
+      sha256 = "939226116cb47fd66dc45a41baa3c0f45b7ab904ec7674088ced3df5c7bae62e";
+      name = "kjsembed-5.64.0.tar.xz";
     };
   };
   kmediaplayer = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/portingAids/kmediaplayer-5.62.0.tar.xz";
-      sha256 = "2d7fa77c085ab0a48e3ce41ec5d6ffa16fbf7194f2d6ace43e37967c0ffb7880";
-      name = "kmediaplayer-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/portingAids/kmediaplayer-5.64.0.tar.xz";
+      sha256 = "ce4816a14134c4968559ff5030895ab69b63b66e9b541b74595ce05e4fe68d1d";
+      name = "kmediaplayer-5.64.0.tar.xz";
     };
   };
   knewstuff = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/knewstuff-5.62.0.tar.xz";
-      sha256 = "5ec7806bf1c5d24a0f393fc48950afefc4bbd1b04b2ad1db59f5f05ecd8f0195";
-      name = "knewstuff-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/knewstuff-5.64.0.tar.xz";
+      sha256 = "91334c95a1082ae402ee869da399e5bdbac986c8b30a85d0a899b30de1f3be72";
+      name = "knewstuff-5.64.0.tar.xz";
     };
   };
   knotifications = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/knotifications-5.62.0.tar.xz";
-      sha256 = "55ec35bc9ddccd12289d9501b11d453885eabb9caebd4b93199d7c662a147263";
-      name = "knotifications-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/knotifications-5.64.0.tar.xz";
+      sha256 = "5f0c3b158ba253e8df81016c8921d689836ecac063a39766c0290352c9f71bc1";
+      name = "knotifications-5.64.0.tar.xz";
     };
   };
   knotifyconfig = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/knotifyconfig-5.62.0.tar.xz";
-      sha256 = "bb51d1a3f69f9faf274ee381d6d267bf4a69edbbdfcfd9efcab76270db4f8e4d";
-      name = "knotifyconfig-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/knotifyconfig-5.64.0.tar.xz";
+      sha256 = "f496ed0728e688347da360f7aad7f2666cb0310ab669c6006ce9661233218b27";
+      name = "knotifyconfig-5.64.0.tar.xz";
     };
   };
   kpackage = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kpackage-5.62.0.tar.xz";
-      sha256 = "588e6f7b0c066993dbd9b6a0fd2535cd2f1c58ea5bd7ebe1dc381049776bbf62";
-      name = "kpackage-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kpackage-5.64.0.tar.xz";
+      sha256 = "c39c80317c75206ec347edf6d301cb66c2117489f37725374fcfe3b1459aaed6";
+      name = "kpackage-5.64.0.tar.xz";
     };
   };
   kparts = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kparts-5.62.0.tar.xz";
-      sha256 = "2249e70de0b57f13d8ee7a2840106b5a4aed05a6b73da9245101e0cbc9c846ef";
-      name = "kparts-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kparts-5.64.0.tar.xz";
+      sha256 = "61338a37015c2df787b8e0fe49f0ef320474a82831b4f110fb5aefd1635b1d9f";
+      name = "kparts-5.64.0.tar.xz";
     };
   };
   kpeople = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kpeople-5.62.0.tar.xz";
-      sha256 = "e061991f08e6642e61531a630a81927ea0ccd7402f469806a6cfeecf9b5064a2";
-      name = "kpeople-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kpeople-5.64.0.tar.xz";
+      sha256 = "b5bc8d037dab124ea65be1c480b25943e789a403176f8b31599383dcdec20a0e";
+      name = "kpeople-5.64.0.tar.xz";
     };
   };
   kplotting = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kplotting-5.62.0.tar.xz";
-      sha256 = "7472943518a4b0e2fe1877ce47b9f667e178822926985a0efc9c20361097b94e";
-      name = "kplotting-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kplotting-5.64.0.tar.xz";
+      sha256 = "f38f65c97d199077c88213bce84c6162ba254c443f06ccfaf62088ff0e217f7b";
+      name = "kplotting-5.64.0.tar.xz";
     };
   };
   kpty = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kpty-5.62.0.tar.xz";
-      sha256 = "6efd3a3103f15ee825b220ac309bcce3bbce56e9b915e61a4277a2cb096bcb96";
-      name = "kpty-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kpty-5.64.0.tar.xz";
+      sha256 = "c2ece8c6b336ee85973e005969f1228bbfac87cbace6853e9d01a7b5c5fe319e";
+      name = "kpty-5.64.0.tar.xz";
     };
   };
   kross = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/portingAids/kross-5.62.0.tar.xz";
-      sha256 = "38bf9a57f181d823974a00896d89ae7106488c2ccbd7179e295d297edb338563";
-      name = "kross-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/portingAids/kross-5.64.0.tar.xz";
+      sha256 = "d8a7e9fbeba4d16d6288d13d72a5f7581aa8be5894b06f83dbc6068b04551ebd";
+      name = "kross-5.64.0.tar.xz";
     };
   };
   krunner = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/krunner-5.62.0.tar.xz";
-      sha256 = "21b9564d07395f0e1c5c09557ffc64eb1929dd8925914fdb581f5daa537b01fc";
-      name = "krunner-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/krunner-5.64.0.tar.xz";
+      sha256 = "e056635f347eb4d8b2a1545de993b28ead1af4e8e4acc43f1dd1637b528fe0b2";
+      name = "krunner-5.64.0.tar.xz";
     };
   };
   kservice = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kservice-5.62.0.tar.xz";
-      sha256 = "a2e105ae8202fa0d9f443490c56e25083c0b9ee285aa82fa26bb8a14f9999db8";
-      name = "kservice-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kservice-5.64.0.tar.xz";
+      sha256 = "60e0c111485158f89211a62403697714dfe141e3539c1c7e1bf04550db74f02f";
+      name = "kservice-5.64.0.tar.xz";
     };
   };
   ktexteditor = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/ktexteditor-5.62.0.tar.xz";
-      sha256 = "e02d54035367071d44a1499a7f6c482491116c5676fa8ceb57b1e9f564975092";
-      name = "ktexteditor-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/ktexteditor-5.64.0.tar.xz";
+      sha256 = "0fe12c57a7428d78c46d3367bdae47a0b9fbbd762be4f57f0c52dcd76e309ed5";
+      name = "ktexteditor-5.64.0.tar.xz";
     };
   };
   ktextwidgets = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/ktextwidgets-5.62.0.tar.xz";
-      sha256 = "ec34931658cbe3a7ad7419a6e588cd9f9981e9b5ab2400e8b6f2b79b29f83774";
-      name = "ktextwidgets-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/ktextwidgets-5.64.0.tar.xz";
+      sha256 = "0e94c36c7d836450d4c52bd933c492235ea0071b15702c302aed003e8400bbfd";
+      name = "ktextwidgets-5.64.0.tar.xz";
     };
   };
   kunitconversion = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kunitconversion-5.62.0.tar.xz";
-      sha256 = "e96ce3efcb6efe3afc0d5cf093971ea89fe2f20660da16349309cf6748446f41";
-      name = "kunitconversion-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kunitconversion-5.64.0.tar.xz";
+      sha256 = "6783d6180b132a80dce2a4cc6c793dae0f5859b0709207c5fc6f4501ef53a822";
+      name = "kunitconversion-5.64.0.tar.xz";
     };
   };
   kwallet = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kwallet-5.62.0.tar.xz";
-      sha256 = "911d1f3320e7e3d25243e134ba0e42cd5e3ed2ee6c846dbb13777b1a4b338a5b";
-      name = "kwallet-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kwallet-5.64.0.tar.xz";
+      sha256 = "16ff5bb5724105c3d59404f292232c03c6003f6229b483509e395e1171ccabde";
+      name = "kwallet-5.64.0.tar.xz";
     };
   };
   kwayland = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kwayland-5.62.0.tar.xz";
-      sha256 = "c9f513008c91e70b09f5acb76dde332491afde0e94948066c2f1e621bc368eb6";
-      name = "kwayland-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kwayland-5.64.0.tar.xz";
+      sha256 = "1540d4ff62afd0bff234e08618fc77d2c54b5cd69bf9c478c45a08a6e69349d3";
+      name = "kwayland-5.64.0.tar.xz";
     };
   };
   kwidgetsaddons = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kwidgetsaddons-5.62.0.tar.xz";
-      sha256 = "3a8e75d544783a1f567016f2669c3cfdbf2809b0a3d25afd03d38af62a493671";
-      name = "kwidgetsaddons-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kwidgetsaddons-5.64.0.tar.xz";
+      sha256 = "a2d4a47489621d095c4979ea25d5d8304cf4004b10a892a2b314d74cd30cb5da";
+      name = "kwidgetsaddons-5.64.0.tar.xz";
     };
   };
   kwindowsystem = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kwindowsystem-5.62.0.tar.xz";
-      sha256 = "116d75216ea001b2fc8688a72bcc6105b0b0966a2c5a084497f3aef80d158a67";
-      name = "kwindowsystem-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kwindowsystem-5.64.0.tar.xz";
+      sha256 = "77c2e6b0032a79547f80bcd36682aa72c0e901e3b5acc83a58f69d644ce03dab";
+      name = "kwindowsystem-5.64.0.tar.xz";
     };
   };
   kxmlgui = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kxmlgui-5.62.0.tar.xz";
-      sha256 = "bc4321b4d44b0af1c2808814b89231a8c9e86de22ca1c0b080a769819ebc5d50";
-      name = "kxmlgui-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kxmlgui-5.64.0.tar.xz";
+      sha256 = "faa95b92b3b03130022841a6797d5beb3efb6a0d757afaefe038889af76a1dd1";
+      name = "kxmlgui-5.64.0.tar.xz";
     };
   };
   kxmlrpcclient = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/kxmlrpcclient-5.62.0.tar.xz";
-      sha256 = "c284c3e5962d2ed6d0737e5814b85fa4d7926131b7799272cb56c464a12c4530";
-      name = "kxmlrpcclient-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/kxmlrpcclient-5.64.0.tar.xz";
+      sha256 = "8c36472cb69a2d5eeb88c437907f7b0b46703ef34d04df7b45a8c90eb95fd6b0";
+      name = "kxmlrpcclient-5.64.0.tar.xz";
     };
   };
   modemmanager-qt = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/modemmanager-qt-5.62.0.tar.xz";
-      sha256 = "b2a6517377b53aca895efd657d553dc5b057a673c07ccb10786031240b11adf5";
-      name = "modemmanager-qt-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/modemmanager-qt-5.64.0.tar.xz";
+      sha256 = "a9d8554b3720cf46aaaa70da87c79688afc5baa155ffd19ea00e4cae2a1caa21";
+      name = "modemmanager-qt-5.64.0.tar.xz";
     };
   };
   networkmanager-qt = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/networkmanager-qt-5.62.0.tar.xz";
-      sha256 = "08f73ced96866b9dfded574a87c9e887dc907fc510d2764a4aa09315511cedf9";
-      name = "networkmanager-qt-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/networkmanager-qt-5.64.0.tar.xz";
+      sha256 = "369d0391e199d059dd2faa554324cbd45334f7864ccfc462699b06c89af04bbf";
+      name = "networkmanager-qt-5.64.0.tar.xz";
     };
   };
   oxygen-icons5 = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/oxygen-icons5-5.62.0.tar.xz";
-      sha256 = "c066bc96fd45f3553e3c344c7cef34afda3180c95bf67af6cf20e964fd5c1a00";
-      name = "oxygen-icons5-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/oxygen-icons5-5.64.0.tar.xz";
+      sha256 = "41d415b4bd9cca0d9abc43b187059d833ce92b3fff3da66eb8ff4004215e91ef";
+      name = "oxygen-icons5-5.64.0.tar.xz";
     };
   };
   plasma-framework = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/plasma-framework-5.62.0.tar.xz";
-      sha256 = "324bf14078459954c355bb6f146b927f6cbf915109365cdc58c1d81c8495bdb4";
-      name = "plasma-framework-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/plasma-framework-5.64.0.tar.xz";
+      sha256 = "3f1311a48826ab0a76f47d05b02f9a9486f821cc1ad757b895b570e371acfd09";
+      name = "plasma-framework-5.64.0.tar.xz";
     };
   };
   prison = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/prison-5.62.0.tar.xz";
-      sha256 = "d7a024881119e2e91fe2ef98ec982f33e87d3f5584c3e4438638e23cf0106fb0";
-      name = "prison-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/prison-5.64.0.tar.xz";
+      sha256 = "31e136dd33940f32fdb87699b113c57aab566112bb9649f20a057c4eee20db2e";
+      name = "prison-5.64.0.tar.xz";
     };
   };
   purpose = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/purpose-5.62.0.tar.xz";
-      sha256 = "ed0bdc72b1b95fe988fb2ceba5cc1bd36b5bf00d30c098e9de50fdc36d3b3492";
-      name = "purpose-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/purpose-5.64.0.tar.xz";
+      sha256 = "004794dfa2d0bcef316d582f37e5691e3980c99240ef570313a98a8d44235b0d";
+      name = "purpose-5.64.0.tar.xz";
     };
   };
   qqc2-desktop-style = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/qqc2-desktop-style-5.62.0.tar.xz";
-      sha256 = "97234e956a7fc09bef0665e9a759d6f370419bd3cd2bbbd700849e4cbe549bfa";
-      name = "qqc2-desktop-style-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/qqc2-desktop-style-5.64.0.tar.xz";
+      sha256 = "b0e6ad1ccbd01b6974c3222c6098b6c1ae1fe594c26fe0e2817c35dd90b6013a";
+      name = "qqc2-desktop-style-5.64.0.tar.xz";
     };
   };
   solid = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/solid-5.62.0.tar.xz";
-      sha256 = "24a01a7e89b2c1e39cb9ebc477f80f5ab966d35fce00f63682b159a15de64cc3";
-      name = "solid-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/solid-5.64.0.tar.xz";
+      sha256 = "fcbbfd124759854bde2da74e1768da818361f61f2839877b4efbcd38b825da6b";
+      name = "solid-5.64.0.tar.xz";
     };
   };
   sonnet = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/sonnet-5.62.0.tar.xz";
-      sha256 = "a1a2d3500d7fc51d94fd6f9d951c83be86436284aeda8416963fc5213956a69a";
-      name = "sonnet-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/sonnet-5.64.0.tar.xz";
+      sha256 = "3af364858f76c0206136ae8f3c03da5442ea5e42d2560877f5e00f33850c84dc";
+      name = "sonnet-5.64.0.tar.xz";
     };
   };
   syndication = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/syndication-5.62.0.tar.xz";
-      sha256 = "d315a5a5e691925df44ce30abbd5208b764a72eb42d38dc5b5ca134d71c05462";
-      name = "syndication-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/syndication-5.64.0.tar.xz";
+      sha256 = "bffcd673a70646c8cb683ed7b26f6ef251a2ffe439fc78123ccee4332b567b57";
+      name = "syndication-5.64.0.tar.xz";
     };
   };
   syntax-highlighting = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/syntax-highlighting-5.62.0.tar.xz";
-      sha256 = "897fac9ec2e5112d629da464d47223129e547c314369e1518a12c5c94ff2a6fd";
-      name = "syntax-highlighting-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/syntax-highlighting-5.64.0.tar.xz";
+      sha256 = "9655fa79d99fb7d585ae1a11c03d204c83263fe19391e7610575fb0436052b5f";
+      name = "syntax-highlighting-5.64.0.tar.xz";
     };
   };
   threadweaver = {
-    version = "5.62.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.62/threadweaver-5.62.0.tar.xz";
-      sha256 = "aa1704c20c6d38fde4f9988e13cb97356e1c69c7a9d0401870b1515a2814294a";
-      name = "threadweaver-5.62.0.tar.xz";
+      url = "${mirror}/stable/frameworks/5.64/threadweaver-5.64.0.tar.xz";
+      sha256 = "4a3ec0b2b45a5997b24d60059d95006fca5fd86f5d619d8fb1fd30d7510f5a02";
+      name = "threadweaver-5.64.0.tar.xz";
     };
   };
 }
diff --git a/pkgs/development/libraries/khronos-ocl-icd-loader/default.nix b/pkgs/development/libraries/khronos-ocl-icd-loader/default.nix
new file mode 100644
index 00000000000..a57b103b0d9
--- /dev/null
+++ b/pkgs/development/libraries/khronos-ocl-icd-loader/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchFromGitHub, opencl-clhpp, cmake, withTracing ? false }:
+
+stdenv.mkDerivation rec {
+  name = "khronos-ocl-icd-loader-${version}";
+  version = "6c03f8b";
+
+  src = fetchFromGitHub {
+    owner = "KhronosGroup";
+    repo = "OpenCL-ICD-Loader";
+    rev = "6c03f8b58fafd9dd693eaac826749a5cfad515f8";
+    sha256 = "00icrlc00dpc87prbd2j1350igi9pbgkz27hc3rf73s5994yn86a";
+  };
+
+  patches = stdenv.lib.lists.optional withTracing ./tracing.patch;
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ opencl-clhpp ];
+
+  meta = with stdenv.lib; {
+    description = "Offical Khronos OpenCL ICD Loader";
+    homepage = https://github.com/KhronosGroup/OpenCL-ICD-Loader;
+    license = licenses.asl20;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ davidtwco ];
+  };
+}
diff --git a/pkgs/development/libraries/khronos-ocl-icd-loader/tracing.patch b/pkgs/development/libraries/khronos-ocl-icd-loader/tracing.patch
new file mode 100644
index 00000000000..415a1b1dfe4
--- /dev/null
+++ b/pkgs/development/libraries/khronos-ocl-icd-loader/tracing.patch
@@ -0,0 +1,13 @@
+diff --git a/loader/icd.h b/loader/icd.h
+index a1b6969..cf4e272 100644
+--- a/loader/icd.h
++++ b/loader/icd.h
+@@ -122,7 +122,7 @@ void khrIcdContextPropertiesGetPlatform(
+     cl_platform_id *outPlatform);
+
+ // internal tracing macros
+-#if 0
++#if 1
+     #include <stdio.h>
+     #define KHR_ICD_TRACE(...) \
+     do \
diff --git a/pkgs/development/libraries/ldns/default.nix b/pkgs/development/libraries/ldns/default.nix
index 1aa208c2044..74ac59fef28 100644
--- a/pkgs/development/libraries/ldns/default.nix
+++ b/pkgs/development/libraries/ldns/default.nix
@@ -1,29 +1,14 @@
-{ stdenv, fetchurl, fetchpatch, openssl, perl, which, dns-root-data }:
+{ stdenv, fetchurl, openssl, perl, which, dns-root-data }:
 
 stdenv.mkDerivation rec {
   pname = "ldns";
-  version = "1.7.0";
+  version = "1.7.1";
 
   src = fetchurl {
     url = "https://www.nlnetlabs.nl/downloads/ldns/${pname}-${version}.tar.gz";
-    sha256 = "1k56jw4hz8njspfxcfw0czf1smg0n48ylia89ziwyx5k9wdmp7y1";
+    sha256 = "0ac242n7996fswq1a3nlh1bbbhrsdwsq4mx7xq8ffq6aplb4rj4a";
   };
 
-  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
   '';
@@ -38,6 +23,7 @@ stdenv.mkDerivation rec {
     "--with-trust-anchor=${dns-root-data}/root.key"
     "--with-drill"
     "--disable-gost"
+    "--with-examples"
   ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "ac_cv_func_malloc_0_nonnull=yes"
     "ac_cv_func_realloc_0_nonnull=yes"
@@ -47,16 +33,11 @@ stdenv.mkDerivation rec {
   doCheck = false; # fails. missing some files
 
   postInstall = ''
+    # Only 'drill' stays in $out
+    # the rest are examples:
+    moveToOutput "bin/ldns*" "$examples"
+    # with exception of ldns-config, which goes to $dev:
     moveToOutput "bin/ldns-config" "$dev"
-
-    pushd examples
-    configureFlagsArray+=( "--bindir=$examples/bin" )
-    configurePhase
-    make
-    make install
-    popd
-
-    sed -i "$out/lib/libldns.la" -e "s,-L${openssl.dev},-L${openssl.out},g"
   '';
 
   meta = with stdenv.lib; {
@@ -64,6 +45,6 @@ stdenv.mkDerivation rec {
     license = licenses.bsd3;
     homepage = http://www.nlnetlabs.nl/projects/ldns/;
     platforms = platforms.unix;
-    maintainers = with maintainers; [ ];
+    maintainers = with maintainers; [ dtzWill ];
   };
 }
diff --git a/pkgs/development/libraries/leatherman/default.nix b/pkgs/development/libraries/leatherman/default.nix
index 7f7d34199be..44c393baf8e 100644
--- a/pkgs/development/libraries/leatherman/default.nix
+++ b/pkgs/development/libraries/leatherman/default.nix
@@ -2,10 +2,10 @@
 
 stdenv.mkDerivation rec {
   pname = "leatherman";
-  version = "1.9.0";
+  version = "1.9.1";
 
   src = fetchFromGitHub {
-    sha256 = "029n16rsvj2abii6d1d4q01fygkicw8n3ja0iaribk4b4h5mc7vc";
+    sha256 = "1aij0prpf7rvxx25qjf1krf0szb922hq9m6q58p90f5bjgymfzwh";
     rev = version;
     repo = "leatherman";
     owner = "puppetlabs";
diff --git a/pkgs/development/libraries/leptonica/default.nix b/pkgs/development/libraries/leptonica/default.nix
index 62c01e4f356..e26f4f6022a 100644
--- a/pkgs/development/libraries/leptonica/default.nix
+++ b/pkgs/development/libraries/leptonica/default.nix
@@ -16,7 +16,9 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   checkInputs = [ which gnuplot ];
-  doCheck = !stdenv.isDarwin;
+
+  # Fails on pngio_reg for unknown reason
+  doCheck = false; # !stdenv.isDarwin;
 
   meta = {
     description = "Image processing and analysis library";
diff --git a/pkgs/development/libraries/libaal/default.nix b/pkgs/development/libraries/libaal/default.nix
index 11b31d62b5d..87eeac4b4f5 100644
--- a/pkgs/development/libraries/libaal/default.nix
+++ b/pkgs/development/libraries/libaal/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     homepage = http://www.namesys.com/;
     description = "Support library for Reiser4";
     license = stdenv.lib.licenses.gpl2;
-    maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
+    maintainers = with stdenv.lib.maintainers; [ ];
     platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/development/libraries/libagar/default.nix b/pkgs/development/libraries/libagar/default.nix
index 630b1712158..c0a43efc27e 100644
--- a/pkgs/development/libraries/libagar/default.nix
+++ b/pkgs/development/libraries/libagar/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, libtool, perl, bsdbuild, gettext, mandoc
-, libpng, libjpeg, xlibsWrapper, libXinerama, freetype, SDL, libGLU_combined
+, libpng, libjpeg, xlibsWrapper, libXinerama, freetype, SDL, libGLU, libGL
 , libsndfile, portaudio, libmysqlclient, fontconfig
 }:
 
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
     "--enable-nls=yes"
     "--with-gettext=${gettext}"
     "--with-jpeg=${libjpeg.dev}"
-    "--with-gl=${libGLU_combined}"
+    "--with-gl=${libGL}"
     "--with-mysql=${libmysqlclient}"
     "--with-manpages=yes"
   ];
@@ -29,7 +29,7 @@ stdenv.mkDerivation {
   nativeBuildInputs = [ pkgconfig libtool gettext ];
 
   buildInputs = [
-    bsdbuild perl xlibsWrapper libXinerama SDL libGLU_combined libmysqlclient mandoc
+    bsdbuild perl xlibsWrapper libXinerama SDL libGL libmysqlclient mandoc
     freetype.dev libpng libjpeg.dev fontconfig portaudio libsndfile
   ];
 
diff --git a/pkgs/development/libraries/libao/default.nix b/pkgs/development/libraries/libao/default.nix
index f67b3cee607..2d7edee4041 100644
--- a/pkgs/development/libraries/libao/default.nix
+++ b/pkgs/development/libraries/libao/default.nix
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
     '';
     homepage = https://xiph.org/ao/;
     license = licenses.gpl2;
-    maintainers = with maintainers; [ fuuzetsu ];
+    maintainers = with maintainers; [ ];
     platforms = with platforms; unix;
   };
 }
diff --git a/pkgs/development/libraries/libappindicator/default.nix b/pkgs/development/libraries/libappindicator/default.nix
index 46cc30a8944..e9fccaf28ab 100644
--- a/pkgs/development/libraries/libappindicator/default.nix
+++ b/pkgs/development/libraries/libappindicator/default.nix
@@ -1,19 +1,18 @@
 # TODO: Resolve the issues with the Mono bindings.
 
-{ stdenv, fetchurl, lib, file
-, pkgconfig, autoconf
+{ stdenv, fetchurl, fetchpatch, lib
+, pkgconfig, autoreconfHook
 , glib, dbus-glib, gtkVersion ? "3"
 , gtk2 ? null, libindicator-gtk2 ? null, libdbusmenu-gtk2 ? null
 , gtk3 ? null, libindicator-gtk3 ? null, libdbusmenu-gtk3 ? null
-, python2Packages, gobject-introspection, vala
+, vala, gobject-introspection
 , monoSupport ? false, mono ? null, gtk-sharp-2_0 ? null
  }:
 
 with lib;
 
-let
-  inherit (python2Packages) python pygobject2 pygtk;
-in stdenv.mkDerivation rec {
+
+stdenv.mkDerivation rec {
   name = let postfix = if gtkVersion == "2" && monoSupport then "sharp" else "gtk${gtkVersion}";
           in "libappindicator-${postfix}-${version}";
   version = "${versionMajor}.${versionMinor}";
@@ -25,7 +24,7 @@ in stdenv.mkDerivation rec {
     sha256 = "17xlqd60v0zllrxp8bgq3k5a1jkj0svkqn8rzllcyjh8k0gpr46m";
   };
 
-  nativeBuildInputs = [ pkgconfig autoconf ];
+  nativeBuildInputs = [ pkgconfig autoreconfHook vala gobject-introspection ];
 
   propagatedBuildInputs =
     if gtkVersion == "2"
@@ -34,20 +33,18 @@ in stdenv.mkDerivation rec {
 
   buildInputs = [
     glib dbus-glib
-    python pygobject2 pygtk gobject-introspection vala
   ] ++ (if gtkVersion == "2"
     then [ libindicator-gtk2 ] ++ optionals monoSupport [ mono gtk-sharp-2_0 ]
     else [ libindicator-gtk3 ]);
 
-  postPatch = ''
-    substituteInPlace configure.ac \
-      --replace '=codegendir pygtk-2.0' '=codegendir pygobject-2.0'
-    autoconf
-    for f in {configure,ltmain.sh,m4/libtool.m4}; do
-      substituteInPlace $f \
-        --replace /usr/bin/file ${file}/bin/file
-    done
-  '';
+  patches = [
+    # Remove python2 from libappindicator.
+    (fetchpatch {
+      name = "no-python.patch";
+      url = "https://src.fedoraproject.org/rpms/libappindicator/raw/8508f7a52437679fd95a79b4630373f08315f189/f/nopython.patch";
+      sha256 = "18b1xzvwsbhhfpbzf5zragij4g79pa04y1dk6v5ci1wsjvii725s";
+    })
+  ];
 
   configureFlags = [
     "CFLAGS=-Wno-error"
@@ -56,15 +53,10 @@ in stdenv.mkDerivation rec {
     "--with-gtk=${gtkVersion}"
   ];
 
-  postConfigure = ''
-    substituteInPlace configure \
-      --replace /usr/bin/file ${file}/bin/file
-  '';
-
   doCheck = false; # generates shebangs in check phase, too lazy to fix
 
   installFlags = [
-    "sysconfdir=\${out}/etc"
+    "sysconfdir=${placeholder "out"}/etc"
     "localstatedir=\${TMPDIR}"
   ];
 
diff --git a/pkgs/development/libraries/libcdaudio/default.nix b/pkgs/development/libraries/libcdaudio/default.nix
index c48818972b5..df7e93de063 100644
--- a/pkgs/development/libraries/libcdaudio/default.nix
+++ b/pkgs/development/libraries/libcdaudio/default.nix
@@ -8,6 +8,8 @@ stdenv.mkDerivation {
   };
 
   meta = {
+    description = "A portable library for controlling audio CDs";
+    homepage = "http://libcdaudio.sourceforge.net";
     platforms = stdenv.lib.platforms.linux;
     license = stdenv.lib.licenses.lgpl2;
   };
diff --git a/pkgs/development/libraries/libcec/default.nix b/pkgs/development/libraries/libcec/default.nix
index 2688881e66d..070cb58149c 100644
--- a/pkgs/development/libraries/libcec/default.nix
+++ b/pkgs/development/libraries/libcec/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, pkgconfig, udev, libcec_platform }:
+{ stdenv, fetchurl, cmake, pkgconfig, udev, libcec_platform, libraspberrypi ? null }:
 
 let version = "4.0.4"; in
 
@@ -12,7 +12,8 @@ stdenv.mkDerivation {
   };
 
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ cmake udev libcec_platform ];
+  buildInputs = [ cmake udev libcec_platform ] ++
+    stdenv.lib.optional (libraspberrypi != null) libraspberrypi;
 
   cmakeFlags = [ "-DBUILD_SHARED_LIBS=1" ];
 
diff --git a/pkgs/development/libraries/libcerf/default.nix b/pkgs/development/libraries/libcerf/default.nix
index fd5ee8dcaaf..0ffb2085967 100644
--- a/pkgs/development/libraries/libcerf/default.nix
+++ b/pkgs/development/libraries/libcerf/default.nix
@@ -1,16 +1,19 @@
-{ stdenv, lib, fetchurl }:
+{ stdenv, lib, fetchurl, cmake, perl }:
 
-stdenv.mkDerivation {
-  name = "libcerf-1.5";
+stdenv.mkDerivation rec {
+  pname = "libcerf";
+  version = "1.13";
 
   src = fetchurl {
-    url = "http://apps.jcns.fz-juelich.de/src/libcerf/libcerf-1.5.tgz";
-    sha256 = "11jwr8ql4a9kmv04ycgwk4dsqnlv4l65a8aa0x1i3y7zwx3w2vg3";
+    url = "https://jugit.fz-juelich.de/mlz/libcerf/-/archive/v${version}/libcerf-v${version}.tar.gz";
+    sha256 = "01d3fr4qa0080xdgp66mjbsa884qivn9y83p7rdyz2l3my0rysg4";
   };
 
+  nativeBuildInputs = [ cmake perl ];
+
   meta = with lib; {
     description = "Complex error (erf), Dawson, Faddeeva, and Voigt function library";
-    homepage = http://apps.jcns.fz-juelich.de/doku/sc/libcerf;
+    homepage = https://jugit.fz-juelich.de/mlz/libcerf;
     license = licenses.mit;
     maintainers = with maintainers; [ orivej ];
     platforms = platforms.all;
diff --git a/pkgs/development/libraries/libco-canonical/default.nix b/pkgs/development/libraries/libco-canonical/default.nix
index 09c27ae7c9c..56974fcca7b 100644
--- a/pkgs/development/libraries/libco-canonical/default.nix
+++ b/pkgs/development/libraries/libco-canonical/default.nix
@@ -4,13 +4,13 @@ with stdenv.lib;
 
 stdenv.mkDerivation rec {
   pname = "libco-canonical";
-  version = "19.1";
+  version = "20";
 
   src = fetchFromGitHub {
     owner = "canonical";
     repo = "libco";
     rev = "v${version}";
-    sha256 = "03a0fq8f8gc4hjzcf0zsjib4mzag47rxrrg9b5r6bx53vj5rhj78";
+    sha256 = "0r5b1r0sxngx349s5a3zkkvfw5by9y492kr34b25gjspzvjchlxq";
   };
 
   nativeBuildInputs = [ pkgconfig ];
@@ -19,6 +19,17 @@ stdenv.mkDerivation rec {
 
   outputs = [ "dev" "out" ];
 
+  patchPhase = ''
+    # upstream project assumes all build products will go into single directory
+    # `$prefix` but we need `includedir` to point to "dev", not "out"
+    #
+    # pkgs/build-support/setup-hooks/multiple-outputs.sh would normally patch
+    # this automatically, but it fails here due to use of absolute paths
+
+    substituteInPlace Makefile \
+      --replace "@includedir@|\$(PREFIX)" "@includedir@|${placeholder "dev"}"
+  '';
+
   meta = {
     description = "A cooperative multithreading library written in C89";
     homepage = "https://github.com/canonical/libco";
diff --git a/pkgs/development/libraries/libdigidocpp/default.nix b/pkgs/development/libraries/libdigidocpp/default.nix
index fc12096ef5b..c4a351739b6 100644
--- a/pkgs/development/libraries/libdigidocpp/default.nix
+++ b/pkgs/development/libraries/libdigidocpp/default.nix
@@ -2,12 +2,12 @@
 , xercesc, xml-security-c, pkgconfig, xsd, zlib, xalanc, xxd }:
 
 stdenv.mkDerivation rec {
-  version = "3.14.0";
+  version = "3.14.1";
   pname = "libdigidocpp";
 
   src = fetchurl {
      url = "https://github.com/open-eid/libdigidocpp/releases/download/v${version}/libdigidocpp-${version}.tar.gz";
-     sha256 = "0klbr881d56661d1lqlv4ivxhxcv2q16ivlz7r0rb901wilq5jyl";
+     sha256 = "0yrcfw5i1jddz7x3j9zzlcwjlzdbi10wns7kbblbp03nx7vk2vqy";
   };
 
   nativeBuildInputs = [ cmake pkgconfig xxd ];
diff --git a/pkgs/development/libraries/libebml/default.nix b/pkgs/development/libraries/libebml/default.nix
index 2d15e419a76..591ad72e4ec 100644
--- a/pkgs/development/libraries/libebml/default.nix
+++ b/pkgs/development/libraries/libebml/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libebml";
-  version = "1.3.9";
+  version = "1.3.10";
 
   src = fetchFromGitHub {
     owner  = "Matroska-Org";
     repo   = "libebml";
     rev    = "release-${version}";
-    sha256 = "0q2xfabaymrf0xkhwc9akx6m04lgra2b53wcn9mnh5dqiiazizi7";
+    sha256 = "1vn0g4hsygrm29qvnzhrblpwjcy2x6swf799ibxv3bzpi1j0gris";
   };
 
   nativeBuildInputs = [ cmake pkgconfig ];
diff --git a/pkgs/development/libraries/libexif/default.nix b/pkgs/development/libraries/libexif/default.nix
index 5a8f5126680..833ccf5dca5 100644
--- a/pkgs/development/libraries/libexif/default.nix
+++ b/pkgs/development/libraries/libexif/default.nix
@@ -9,21 +9,32 @@ stdenv.mkDerivation rec {
   };
 
   patches = [
-   (fetchpatch {
-     name = "CVE-2017-7544.patch";
-     url = https://sourceforge.net/p/libexif/bugs/_discuss/thread/fc394c4b/489a/attachment/xx.pat;
-     sha256 = "1qgk8hgnxr8d63jsc4vljxz9yg33mbml280dq4a6050rmk9wq4la";
-   })
+    (fetchpatch {
+      name = "CVE-2017-7544.patch";
+      url = "https://github.com/libexif/libexif/commit/c39acd1692023b26290778a02a9232c873f9d71a.patch";
+      sha256 = "0xgx6ly2i4q05shb61mfx6njwf1yp347jkznm0ka4m85i41xm6sd";
+    })
+    (fetchpatch {
+      name = "CVE-2018-20030-1.patch";
+      url = "https://github.com/libexif/libexif/commit/5d28011c40ec86cf52cffad541093d37c263898a.patch";
+      sha256 = "1wv8s962wmbn2m2xypgirf12g6msrbplpsmd5bh86irfwhkcppj3";
+    })
+    (fetchpatch {
+      name = "CVE-2018-20030-2.patch";
+      url = "https://github.com/libexif/libexif/commit/6aa11df549114ebda520dde4cdaea2f9357b2c89.patch";
+      sha256 = "01aqvz63glwq6wg0wr7ykqqghb4abgq77ghvhizbzadg1k4h7drx";
+      excludes = [ "NEWS" ];
+    })
   ];
-  patchFlags = "-p0";
 
   buildInputs = [ gettext ];
 
   meta = {
-    homepage = http://libexif.sourceforge.net/;
+    homepage = https://libexif.github.io/;
     description = "A library to read and manipulate EXIF data in digital photographs";
     license = stdenv.lib.licenses.lgpl21;
     platforms = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.erictapen ];
   };
 
 }
diff --git a/pkgs/development/libraries/libextractor/default.nix b/pkgs/development/libraries/libextractor/default.nix
index 8fd01dbd506..ea155440c8d 100644
--- a/pkgs/development/libraries/libextractor/default.nix
+++ b/pkgs/development/libraries/libextractor/default.nix
@@ -22,6 +22,12 @@ stdenv.mkDerivation rec {
       url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/libextractor-exiv2-0.27.patch?h=packages/libextractor&id=4dc53f7fc69210ae571285dface108ed65d8ee53";
       sha256 = "0w4gc1q1m1yxsd4hv105nblmif465nw3g5nxzldy0x2rl9mdncg6";
     })
+    (fetchpatch {
+      name = "CVE-2019-15531.patch";
+      url = "https://git.gnunet.org/libextractor.git/patch/?id=d2b032452241708bee68d02aa02092cfbfba951a";
+      sha256 = "01xhcjbzv6p53wz7y2ii76kb8m9iwvnm4ip9w4a0bpgaxqz4b9fw";
+      excludes = [ "ChangeLog" ];
+    })
   ];
 
   preConfigure =
diff --git a/pkgs/development/libraries/libffi/3.2.1-cygwin.patch b/pkgs/development/libraries/libffi/3.2.1-cygwin.patch
deleted file mode 100644
index f3b38dbd1c1..00000000000
--- a/pkgs/development/libraries/libffi/3.2.1-cygwin.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- libffi-3.2.1/src/closures.c	2014-11-08 13:47:24.000000000 +0100
-+++ libffi-3.2.1/src/closures.c	2015-05-19 10:15:50.059325900 +0200
-@@ -212,6 +212,7 @@
- #include <sys/mman.h>
- 
- /* Cygwin is Linux-like, but not quite that Linux-like.  */
-+#define is_emutramp_enabled() 0
- #define is_selinux_enabled() 0
- 
- #endif /* !defined(X86_WIN32) && !defined(X86_WIN64) */
diff --git a/pkgs/development/libraries/libffi/default.nix b/pkgs/development/libraries/libffi/default.nix
index 2918276ef21..cc080e7c638 100644
--- a/pkgs/development/libraries/libffi/default.nix
+++ b/pkgs/development/libraries/libffi/default.nix
@@ -7,45 +7,17 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "libffi-3.2.1";
+  name = "libffi-3.3";
 
   src = fetchurl {
     url = "https://sourceware.org/pub/libffi/${name}.tar.gz";
-    sha256 = "0dya49bnhianl0r65m65xndz6ls2jn1xngyn72gd28ls3n7bnvnh";
+    sha256 = "0mi0cpf8aa40ljjmzxb7im6dbj45bb0kllcd09xgmp834y9agyvj";
   };
 
-  patches = stdenv.lib.optional stdenv.isCygwin ./3.2.1-cygwin.patch
-    ++ stdenv.lib.optional stdenv.isAarch64 (fetchpatch {
-      url = https://src.fedoraproject.org/rpms/libffi/raw/ccffc1700abfadb0969495a6e51b964117fc03f6/f/libffi-aarch64-rhbz1174037.patch;
-      sha256 = "1vpirrgny43hp0885rswgv3xski8hg7791vskpbg3wdjdpb20wbc";
-    })
-    ++ stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
-      name = "gnu-linux-define.patch";
-      url = "https://git.alpinelinux.org/cgit/aports/plain/main/libffi/gnu-linux-define.patch?id=bb024fd8ec6f27a76d88396c9f7c5c4b5800d580";
-      sha256 = "11pvy3xkhyvnjfyy293v51f1xjy3x0azrahv1nw9y9mw8bifa2j2";
-    })
-    ++ stdenv.lib.optional stdenv.hostPlatform.isRiscV (fetchpatch {
-      name = "riscv-support.patch";
-      url = https://github.com/sorear/libffi-riscv/commit/e46492e8bb1695a19bc1053ed869e6c2bab02ff2.patch;
-      sha256 = "1vl1vbvdkigs617kckxvj8j4m2cwg62kxm1clav1w5rnw9afxg0y";
-    })
-    ++ stdenv.lib.optionals stdenv.isMips [
-      (fetchpatch {
-        name = "0001-mips-Use-compiler-internal-define-for-linux.patch";
-        url = "http://cgit.openembedded.org/openembedded-core/plain/meta/recipes-support/libffi/libffi/0001-mips-Use-compiler-internal-define-for-linux.patch?id=318e33a708378652edcf61ce7d9d7f3a07743000";
-        sha256 = "1gc53lw90p6hc0cmhj3csrwincfz7va5ss995ksw5gm0yrr9mrvb";
-      })
-      (fetchpatch {
-        name = "0001-mips-fix-MIPS-softfloat-build-issue.patch";
-        url = "http://cgit.openembedded.org/openembedded-core/plain/meta/recipes-support/libffi/libffi/0001-mips-fix-MIPS-softfloat-build-issue.patch?id=318e33a708378652edcf61ce7d9d7f3a07743000";
-        sha256 = "0l8xgdciqalg4z9rcwyk87h8fdxpfv4hfqxwsy2agpnpszl5jjdq";
-      })
-    ];
+  patches = [];
 
   outputs = [ "out" "dev" "man" "info" ];
 
-  nativeBuildInputs = stdenv.lib.optional stdenv.hostPlatform.isRiscV autoreconfHook;
-
   configureFlags = [
     "--with-gcc-arch=generic" # no detection of -march= or -mtune=
     "--enable-pax_emutramp"
@@ -62,15 +34,6 @@ stdenv.mkDerivation rec {
 
   dontStrip = stdenv.hostPlatform != stdenv.buildPlatform; # Don't run the native `strip' when cross-compiling.
 
-  # Install headers and libs in the right places.
-  postFixup = ''
-    mkdir -p "$dev/"
-    mv "$out/lib/${name}/include" "$dev/include"
-    rmdir "$out/lib/${name}"
-    substituteInPlace "$dev/lib/pkgconfig/libffi.pc" \
-      --replace 'includedir=''${libdir}/libffi-3.2.1' "includedir=$dev"
-  '';
-
   meta = with stdenv.lib; {
     description = "A foreign function call interface library";
     longDescription = ''
@@ -88,9 +51,8 @@ stdenv.mkDerivation rec {
       conversions for values passed between the two languages.
     '';
     homepage = http://sourceware.org/libffi/;
-    # See https://github.com/atgreen/libffi/blob/master/LICENSE .
-    license = licenses.free;
-    maintainers = [ ];
+    license = licenses.mit;
+    maintainers = with maintainers; [ matthewbauer ];
     platforms = platforms.all;
   };
 }
diff --git a/pkgs/development/libraries/libfido2/default.nix b/pkgs/development/libraries/libfido2/default.nix
index 5fefdad08e7..a0f44a33220 100644
--- a/pkgs/development/libraries/libfido2/default.nix
+++ b/pkgs/development/libraries/libfido2/default.nix
@@ -2,10 +2,10 @@
 
 stdenv.mkDerivation rec {
   pname = "libfido2";
-  version = "1.2.0";
+  version = "1.3.0";
   src = fetchurl {
-    url = "https://developers.yubico.com/libfido2/Releases/libfido2-${version}.tar.gz";
-    sha256 = "1pbllhzcrzkgxad00bai7lna8dpkwiv8khx8p20miy661abv956v";
+    url = "https://developers.yubico.com/${pname}/Releases/${pname}-${version}.tar.gz";
+    sha256 = "1izyl3as9rn7zcxpsvgngjwr55gli5gy822ac3ajzm65qiqkcbhb";
   };
 
   nativeBuildInputs = [ cmake pkgconfig ];
diff --git a/pkgs/development/libraries/libfilezilla/default.nix b/pkgs/development/libraries/libfilezilla/default.nix
index 95954a120c8..fd17267b615 100644
--- a/pkgs/development/libraries/libfilezilla/default.nix
+++ b/pkgs/development/libraries/libfilezilla/default.nix
@@ -9,11 +9,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libfilezilla";
-  version = "0.18.2";
+  version = "0.19.1";
 
   src = fetchurl {
     url = "https://download.filezilla-project.org/${pname}/${pname}-${version}.tar.bz2";
-    sha256 = "1j9da9xi2k4nw97m14mpp7h39rh03br0gmjj9ff819l6nhlnkn20";
+    sha256 = "0cjscv68nnqivzba94xapx1c970j1jbdbm0h3g2ym9i0hgnyyhha";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/libfprint/default.nix b/pkgs/development/libraries/libfprint/default.nix
index 9a6db72ae05..6819ffba21c 100644
--- a/pkgs/development/libraries/libfprint/default.nix
+++ b/pkgs/development/libraries/libfprint/default.nix
@@ -1,41 +1,27 @@
-{ thinkpad ? false
-, stdenv
-, fetchFromGitHub
+{ stdenv
 , fetchurl
 , pkgconfig
 , meson
 , ninja
-, libusb
+, gusb
 , pixman
 , glib
 , nss
-, gtk3
+, gobject-introspection
 , coreutils
 , gtk-doc
 , docbook_xsl
 , docbook_xml_dtd_43
-, openssl ? null
 }:
 
-assert thinkpad -> openssl != null;
-
 stdenv.mkDerivation rec {
-  pname = "libfprint" + stdenv.lib.optionalString thinkpad "-thinkpad";
-  version = "1.0";
+  pname = "libfprint";
+  version = "1.90";
 
-  src = {
-    libfprint-thinkpad =
-      fetchFromGitHub {
-        owner = "3v1n0";
-        repo = "libfprint";
-        rev = "2e2e3821717e9042e93a995bdbd3d00f2df0be9c";
-        sha256 = "1vps1wrp7hskf13f7jrv0dwry2fcid76x2w463wplngp63cj7b3b";
-      };
-    libfprint = fetchurl {
-      url = "https://gitlab.freedesktop.org/libfprint/libfprint/uploads/aff93e9921d1cff53d7c070944952ff9/libfprint-${version}.tar.xz";
-      sha256 = "0v84pd12v016m8iimhq39fgzamlarqccsr7d98cvrrwrzrgcixrd";
-    };
-  }.${pname};
+  src = fetchurl {
+    url = "https://gitlab.freedesktop.org/libfprint/libfprint/uploads/1bba17b5daa130aa548bc7ea96dc58c4/libfprint-1.90.0.tar.xz";
+    sha256 = "930f530df369ff874d7971f0b7c7bdb7c81597e91af4668694b98fe30b4b3371";
+  };
 
   nativeBuildInputs = [
     pkgconfig
@@ -44,17 +30,15 @@ stdenv.mkDerivation rec {
     gtk-doc
     docbook_xsl
     docbook_xml_dtd_43
+    gobject-introspection
   ];
 
   buildInputs = [
-    libusb
+    gusb
     pixman
     glib
     nss
-    gtk3
-  ]
-  ++ stdenv.lib.optional thinkpad openssl
-  ;
+  ];
 
   mesonFlags = [
     "-Dudev_rules_dir=${placeholder "out"}/lib/udev/rules.d"
diff --git a/pkgs/development/libraries/libftdi/1.x.nix b/pkgs/development/libraries/libftdi/1.x.nix
index 1b00ff4c0fb..26002725d91 100644
--- a/pkgs/development/libraries/libftdi/1.x.nix
+++ b/pkgs/development/libraries/libftdi/1.x.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, cmake, pkgconfig, libusb1, libconfuse
 , cppSupport ? true, boost ? null
-, pythonSupport ? true, python ? null, swig ? null
+, pythonSupport ? true, python3 ? null, swig ? null
 , docSupport ? true, doxygen ? null
 }:
 
 assert cppSupport -> boost != null;
-assert pythonSupport -> python != null && swig != null;
+assert pythonSupport -> python3 != null && swig != null;
 assert docSupport -> doxygen != null;
 
 stdenv.mkDerivation rec {
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake pkgconfig ];
   buildInputs = with stdenv.lib; [ libconfuse ]
     ++ optionals cppSupport [ boost ]
-    ++ optionals pythonSupport [ python swig ]
+    ++ optionals pythonSupport [ python3 swig ]
     ++ optionals docSupport [ doxygen ];
 
   preBuild = stdenv.lib.optionalString docSupport ''
diff --git a/pkgs/development/libraries/libgcrypt/default.nix b/pkgs/development/libraries/libgcrypt/default.nix
index 75d8e6710e0..e7a9ec60a6d 100644
--- a/pkgs/development/libraries/libgcrypt/default.nix
+++ b/pkgs/development/libraries/libgcrypt/default.nix
@@ -27,7 +27,8 @@ stdenv.mkDerivation rec {
     ++ stdenv.lib.optional stdenv.isDarwin gettext
     ++ stdenv.lib.optional enableCapabilities libcap;
 
-  configureFlags = [ "--with-libgpg-error-prefix=${libgpgerror.dev}" ];
+  configureFlags = [ "--with-libgpg-error-prefix=${libgpgerror.dev}" ]
+   ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-asm";
 
   # Make sure libraries are correct for .pc and .la files
   # Also make sure includes are fixed for callers who don't use libgpgcrypt-config
diff --git a/pkgs/development/libraries/libgdata/default.nix b/pkgs/development/libraries/libgdata/default.nix
index c7ff6d10da3..6830d47df74 100644
--- a/pkgs/development/libraries/libgdata/default.nix
+++ b/pkgs/development/libraries/libgdata/default.nix
@@ -74,7 +74,7 @@ stdenv.mkDerivation rec {
     };
 
     tests = {
-      installedTests = nixosTests.libgdata;
+      installedTests = nixosTests.installed-tests.libgdata;
     };
   };
 
diff --git a/pkgs/development/libraries/libglvnd/default.nix b/pkgs/development/libraries/libglvnd/default.nix
index 30b27d9329a..5df1246a0eb 100644
--- a/pkgs/development/libraries/libglvnd/default.nix
+++ b/pkgs/development/libraries/libglvnd/default.nix
@@ -14,6 +14,22 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ autoreconfHook pkgconfig python2 addOpenGLRunpath ];
   buildInputs = [ libX11 libXext xorgproto ];
 
+  # The following 3 patches should be removed once libglvnd >1.2.0 is released
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/NVIDIA/libglvnd/commit/6f52473dac08c44b081b792874b4ce73122096da.patch";
+      sha256 = "0rd9ihl8n33cm0rya5a7ki0hn31fh52r0gaj5d4w80jrsah2ayij";
+    })
+    (fetchpatch {
+      url = "https://github.com/NVIDIA/libglvnd/commit/51233cc52cbcbe25f8461830913c06f5b5bc9508.patch";
+      sha256 = "1qx3nw8vq5xcrixmi7xw1vpy4gbf7kmx38rx8wg8x046g4mv8ijj";
+    })
+    (fetchpatch {
+      url = "https://github.com/NVIDIA/libglvnd/commit/5dfdc5a6dc60a3bdc63cd4510dabacba388da13a.patch";
+      sha256 = "0gmb3619yz3z7n22afjh8p2y13bmsky4r0z0csm14is3wvdi64ya";
+    })
+  ];
+
   postPatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace src/GLX/Makefile.am \
       --replace "-Wl,-Bsymbolic " ""
diff --git a/pkgs/development/libraries/libgnomekbd/default.nix b/pkgs/development/libraries/libgnomekbd/default.nix
index 0951ab1fe0c..21523bf2e1a 100644
--- a/pkgs/development/libraries/libgnomekbd/default.nix
+++ b/pkgs/development/libraries/libgnomekbd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, file, intltool, glib, gtk3, libxklavier, makeWrapper, gnome3 }:
+{ stdenv, fetchurl, pkgconfig, file, intltool, glib, gtk3, libxklavier, wrapGAppsHook, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "libgnomekbd";
@@ -13,13 +13,19 @@ stdenv.mkDerivation rec {
     updateScript = gnome3.updateScript { packageName = pname; };
   };
 
-  nativeBuildInputs = [ pkgconfig file intltool makeWrapper ];
-  buildInputs = [ glib gtk3 libxklavier ];
+  nativeBuildInputs = [
+    file
+    intltool
+    pkgconfig
+    wrapGAppsHook
+  ];
 
-  preFixup = ''
-    wrapProgram $out/bin/gkbd-keyboard-display \
-      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
-  '';
+  # Requires in libgnomekbd.pc
+  propagatedBuildInputs = [
+    gtk3
+    libxklavier
+    glib
+  ];
 
   meta = with stdenv.lib; {
     description = "Keyboard management library";
diff --git a/pkgs/development/libraries/libgnurl/default.nix b/pkgs/development/libraries/libgnurl/default.nix
index 1736e97f466..a1e8ef76394 100644
--- a/pkgs/development/libraries/libgnurl/default.nix
+++ b/pkgs/development/libraries/libgnurl/default.nix
@@ -3,11 +3,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libgnurl";
-  version = "7.66.0";
+  version = "7.67.0";
 
   src = fetchurl {
     url = "mirror://gnu/gnunet/gnurl-${version}.tar.gz";
-    sha256 = "03bkzcld384z7i3zh3k9k3pr0xpyqbcr8cxjqya1zqs5lk7i55x5";
+    sha256 = "0ima9hz5d54iyvvih51s8xn6dsfxd3qyzgnj9l7w9f1smia295rb";
   };
 
   nativeBuildInputs = [ libtool groff perl pkgconfig python2 ];
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "A fork of libcurl used by GNUnet";
-    homepage    = https://gnunet.org/gnurl;
+    homepage    = "https://gnunet.org/en/gnurl.html";
     maintainers = with maintainers; [ falsifian vrthra ];
     platforms = platforms.linux;
     license = licenses.curl;
diff --git a/pkgs/development/libraries/libgpg-error/default.nix b/pkgs/development/libraries/libgpg-error/default.nix
index d7fb35897dc..69c236d7220 100644
--- a/pkgs/development/libraries/libgpg-error/default.nix
+++ b/pkgs/development/libraries/libgpg-error/default.nix
@@ -78,6 +78,6 @@ in stdenv.mkDerivation (rec {
 
     license = licenses.lgpl2Plus;
     platforms = platforms.all;
-    maintainers = [ maintainers.fuuzetsu maintainers.vrthra ];
+    maintainers = [ maintainers.vrthra ];
   };
 } // genPosixLockObjOnlyAttrs)
diff --git a/pkgs/development/libraries/libgpod/default.nix b/pkgs/development/libraries/libgpod/default.nix
index d561ebcd7af..063588e9f1e 100644
--- a/pkgs/development/libraries/libgpod/default.nix
+++ b/pkgs/development/libraries/libgpod/default.nix
@@ -1,18 +1,20 @@
-{stdenv, lib, fetchurl, gettext, perlPackages, intltool, pkgconfig, glib,
+{ stdenv, lib, fetchurl, gettext, perlPackages, intltool, pkgconfig, glib,
   libxml2, sqlite, zlib, sg3_utils, gdk-pixbuf, taglib,
-  libimobiledevice, pythonPackages, mutagen,
+  libimobiledevice, mutagen,
   monoSupport ? false, mono, gtk-sharp-2_0
 }:
 
-let
-  inherit (pythonPackages) python pygobject2;
-in stdenv.mkDerivation rec {
+
+stdenv.mkDerivation rec {
   name = "libgpod-0.8.3";
+
   src = fetchurl {
     url = "mirror://sourceforge/gtkpod/${name}.tar.bz2";
     sha256 = "0pcmgv1ra0ymv73mlj4qxzgyir026z9jpl5s5bkg35afs1cpk2k3";
   };
 
+  outputs = [ "out" "dev" ];
+
   preConfigure = "configureFlagsArray=( --with-udev-dir=$out/lib/udev )";
 
   configureFlags = [
@@ -23,7 +25,7 @@ in stdenv.mkDerivation rec {
   dontStrip = true;
 
   propagatedBuildInputs = [ glib libxml2 sqlite zlib sg3_utils
-    gdk-pixbuf taglib libimobiledevice python pygobject2 mutagen ];
+    gdk-pixbuf taglib libimobiledevice  mutagen ];
 
   nativeBuildInputs = [ gettext intltool pkgconfig ]
     ++ (with perlPackages; [ perl XMLParser ])
diff --git a/pkgs/development/libraries/libgudev/default.nix b/pkgs/development/libraries/libgudev/default.nix
index b52a2b1e0fa..8023acb75d2 100644
--- a/pkgs/development/libraries/libgudev/default.nix
+++ b/pkgs/development/libraries/libgudev/default.nix
@@ -32,6 +32,7 @@ stdenv.mkDerivation rec {
   };
 
   meta = with stdenv.lib; {
+    description = "A library that provides GObject bindings for libudev";
     homepage = https://wiki.gnome.org/Projects/libgudev;
     maintainers = [ maintainers.eelco ] ++ gnome3.maintainers;
     platforms = platforms.linux;
diff --git a/pkgs/development/libraries/libhandy/default.nix b/pkgs/development/libraries/libhandy/default.nix
index c4f353fb6d5..88736113ee5 100644
--- a/pkgs/development/libraries/libhandy/default.nix
+++ b/pkgs/development/libraries/libhandy/default.nix
@@ -7,7 +7,7 @@
 
 stdenv.mkDerivation rec {
   pname = "libhandy";
-  version = "0.0.11";
+  version = "0.0.12";
 
   outputs = [ "out" "dev" "devdoc" "glade" ];
   outputBin = "dev";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     owner = "Librem5";
     repo = pname;
     rev = "v${version}";
-    sha256 = "0622zp5wrvn5bvgardijxd11y76g1i54fs32y03dw9nrar7i6vb0";
+    sha256 = "09wlknarzsbk9hr5ws6s7x5kibkhx9ayrbhshfqib4zkhq2f76hw";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/development/libraries/libheif/default.nix b/pkgs/development/libraries/libheif/default.nix
index f69241ad552..85174e9c3e6 100644
--- a/pkgs/development/libraries/libheif/default.nix
+++ b/pkgs/development/libraries/libheif/default.nix
@@ -2,13 +2,15 @@
 
 stdenv.mkDerivation rec {
   pname = "libheif";
-  version = "1.5.1";
+  version = "1.6.0";
+
+  outputs = [ "bin" "out" "dev" "man" ];
 
   src = fetchFromGitHub {
     owner = "strukturag";
     repo = "libheif";
     rev = "v${version}";
-    sha256 = "0x6207hiy15k2696476qx9jcbzs90fq8cfv4jw6hi14w4wzq89kr";
+    sha256 = "0im9k2pqghlsppj165kh3nc26c4wx1brckmncdmpy0mcj56jjmba";
   };
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
diff --git a/pkgs/development/libraries/libical/default.nix b/pkgs/development/libraries/libical/default.nix
index 050cba5460d..903a1a26eb7 100644
--- a/pkgs/development/libraries/libical/default.nix
+++ b/pkgs/development/libraries/libical/default.nix
@@ -15,7 +15,7 @@
 
 stdenv.mkDerivation rec {
   pname = "libical";
-  version = "3.0.5";
+  version = "3.0.6";
 
   outputs = [ "out" "dev" ]; # "devdoc" ];
 
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     owner = "libical";
     repo = "libical";
     rev = "v${version}";
-    sha256 = "03kjc4s1svmzkmzkr0irgczq37aslhj4bxnvjqav0jwa2zrynhra";
+    sha256 = "181lf07fj36fp0rbcjjmb53yzdvv9i4qxpnbpax8hayjhha8pjh3";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/development/libraries/libicns/default.nix b/pkgs/development/libraries/libicns/default.nix
index 298d6124505..27ec8b17c0d 100644
--- a/pkgs/development/libraries/libicns/default.nix
+++ b/pkgs/development/libraries/libicns/default.nix
@@ -1,14 +1,24 @@
-{ stdenv, fetchurl, libpng, jasper }:
+{ stdenv, fetchurl, fetchpatch, autoreconfHook, libpng, openjpeg }:
 
 stdenv.mkDerivation rec {
-  name = "libicns-0.8.1";
+  pname = "libicns";
+  version = "0.8.1";
 
   src = fetchurl {
-    url = "mirror://sourceforge/icns/${name}.tar.gz";
+    url = "mirror://sourceforge/icns/${pname}-${version}.tar.gz";
     sha256 = "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk";
   };
 
-  buildInputs = [ libpng jasper ];
+  patches = [
+    (fetchpatch {
+      url = "https://sources.debian.org/data/main/libi/libicns/0.8.1-3.1/debian/patches/support-libopenjp2.patch";
+      sha256 = "0ss298lyzvydxvaxsadi6kbbjpwykd86jw3za76brcsg2dpssgas";
+    })
+  ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ libpng openjpeg ];
+  NIX_CFLAGS_COMPILE = [ "-I${openjpeg.dev}/include/${openjpeg.incDir}" ];
 
   meta = with stdenv.lib; {
     description = "Library for manipulation of the Mac OS icns resource format";
diff --git a/pkgs/development/libraries/libiconv/setup-hook.sh b/pkgs/development/libraries/libiconv/setup-hook.sh
index f89361a6299..120cf06c61b 100644
--- a/pkgs/development/libraries/libiconv/setup-hook.sh
+++ b/pkgs/development/libraries/libiconv/setup-hook.sh
@@ -2,7 +2,7 @@
 # it doesn't hurt to have it in Glibc either though
 
 # See pkgs/build-support/setup-hooks/role.bash
-if [ -z "$dontAddExtraLibs" ]; then
+if [ -z "${dontAddExtraLibs-}" ]; then
     getHostRole
     export NIX_${role_pre}LDFLAGS+=" -liconv"
 fi
diff --git a/pkgs/development/libraries/libid3tag/default.nix b/pkgs/development/libraries/libid3tag/default.nix
index 674862d694c..c6d430e10fc 100644
--- a/pkgs/development/libraries/libid3tag/default.nix
+++ b/pkgs/development/libraries/libid3tag/default.nix
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
     description = "ID3 tag manipulation library";
     homepage = http://mad.sourceforge.net/;
     license = licenses.gpl2;
-    maintainers = [ maintainers.fuuzetsu ];
+    maintainers = [ ];
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/libidn2/default.nix b/pkgs/development/libraries/libidn2/default.nix
index 7e7b691e3c1..c1363d7a928 100644
--- a/pkgs/development/libraries/libidn2/default.nix
+++ b/pkgs/development/libraries/libidn2/default.nix
@@ -4,11 +4,11 @@ with stdenv.lib;
 
 stdenv.mkDerivation rec {
   pname = "libidn2";
-  version = "2.2.0";
+  version = "2.3.0";
 
   src = fetchurl {
     url = "mirror://gnu/gnu/libidn/${pname}-${version}.tar.gz";
-    sha256 = "1zl1cc2xgxw31pdhvhr5ij36x4vvpy16jq667rspin06nlr4fwzw";
+    sha256 = "1ddqr80kmz4l8g3r3gf7bmf2v29fgivlc2bgxfiscjg2sarivjz1";
   };
 
   outputs = [ "bin" "dev" "out" "info" "devdoc" ];
diff --git a/pkgs/development/libraries/libindicate/default.nix b/pkgs/development/libraries/libindicate/default.nix
deleted file mode 100644
index f6dc85b629d..00000000000
--- a/pkgs/development/libraries/libindicate/default.nix
+++ /dev/null
@@ -1,66 +0,0 @@
-# TODO: Resolve the issues with the Mono bindings.
-
-{ stdenv, fetchurl, lib, file
-, pkgconfig, autoconf
-, glib, dbus-glib, libdbusmenu
-, gtkVersion ? "3", gtk2 ? null, gtk3 ? null
-, pythonPackages, gobject-introspection, vala, gnome-doc-utils
-, monoSupport ? false, mono ? null, gtk-sharp-2_0 ? null
- }:
-
-with lib;
-
-let
-  inherit (pythonPackages) python pygobject2 pygtk;
-in stdenv.mkDerivation rec {
-  name = let postfix = if gtkVersion == "2" && monoSupport then "sharp" else "gtk${gtkVersion}";
-          in "libindicate-${postfix}-${version}";
-  version = "${versionMajor}.${versionMinor}";
-  versionMajor = "12.10";
-  versionMinor = "1";
-
-  src = fetchurl {
-    url = "${meta.homepage}/${versionMajor}/${version}/+download/libindicate-${version}.tar.gz";
-    sha256 = "10am0ymajx633b33anf6b79j37k61z30v9vaf5f9fwk1x5cw1q21";
-  };
-
-  nativeBuildInputs = [ pkgconfig autoconf gobject-introspection vala gnome-doc-utils ];
-
-  buildInputs = [
-    glib dbus-glib libdbusmenu
-    python pygobject2 pygtk
-  ] ++ (if gtkVersion == "2"
-    then [ gtk2 ] ++ optionals monoSupport [ mono gtk-sharp-2_0 ]
-    else [ gtk3 ]);
-
-  postPatch = ''
-    substituteInPlace configure.ac \
-      --replace '=codegendir pygtk-2.0' '=codegendir pygobject-2.0' \
-      --replace 'pyglib-2.0-python$PYTHON_VERSION' 'pyglib-2.0-python'
-    autoconf
-    for f in {configure,ltmain.sh,m4/libtool.m4}; do
-      substituteInPlace $f \
-        --replace /usr/bin/file ${file}/bin/file
-    done
-  '';
-
-  configureFlags = [
-    "CFLAGS=-Wno-error"
-    "--sysconfdir=/etc"
-    "--localstatedir=/var"
-    "--with-gtk=${gtkVersion}"
-  ];
-
-  installFlags = [
-    "sysconfdir=\${out}/etc"
-    "localstatedir=\${TMPDIR}"
-  ];
-
-  meta = {
-    description = "Library for raising indicators via DBus";
-    homepage = https://launchpad.net/libindicate;
-    license = with licenses; [ lgpl21 lgpl3 ];
-    platforms = platforms.linux;
-    maintainers = [ maintainers.msteen ];
-  };
-}
diff --git a/pkgs/development/libraries/libinput/default.nix b/pkgs/development/libraries/libinput/default.nix
index 044ef2dd6a7..8d48082e1d9 100644
--- a/pkgs/development/libraries/libinput/default.nix
+++ b/pkgs/development/libraries/libinput/default.nix
@@ -27,11 +27,11 @@ in
 with stdenv.lib;
 stdenv.mkDerivation rec {
   pname = "libinput";
-  version = "1.14.1";
+  version = "1.14.3";
 
   src = fetchurl {
     url = "https://www.freedesktop.org/software/libinput/${pname}-${version}.tar.xz";
-    sha256 = "0w7fas37mp2k06f12i3lnj717lw73asziknj6z51kh1m50ja6cz3";
+    sha256 = "1dy58j8dvr7ri34bx0lppmh5638m956azgwk501w373hi42kmsqg";
   };
 
   outputs = [ "bin" "out" "dev" ];
@@ -40,6 +40,7 @@ stdenv.mkDerivation rec {
     (mkFlag documentationSupport "documentation")
     (mkFlag eventGUISupport "debug-gui")
     (mkFlag testsSupport "tests")
+    "--sysconfdir=/etc"
     "--libexecdir=${placeholder "bin"}/libexec"
   ];
 
diff --git a/pkgs/development/libraries/libisds/default.nix b/pkgs/development/libraries/libisds/default.nix
new file mode 100644
index 00000000000..4ed5a830964
--- /dev/null
+++ b/pkgs/development/libraries/libisds/default.nix
@@ -0,0 +1,34 @@
+{ stdenv
+, fetchurl
+, expat
+, gpgme
+, libgcrypt
+, libxml2
+, libxslt
+, curl
+, docbook_xsl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libisds";
+  version = "0.11";
+
+  src = fetchurl {
+    url = "http://xpisar.wz.cz/${pname}/dist/${pname}-${version}.tar.xz";
+    sha256 = "1cy161l7rl25xji2xpb9vjpvg02bc7mwd4fpp2sx9zhpifn5dfbr";
+  };
+
+  configureFlags = [
+    "--with-docbook-xsl-stylesheets=${docbook_xsl}/xml/xsl/docbook"
+  ];
+
+  buildInputs = [ expat gpgme libgcrypt libxml2 libxslt curl docbook_xsl ];
+
+  meta = with stdenv.lib; {
+    description = "Client library for accessing SOAP services of Czech government-provided Databox infomation system";
+    homepage = "http://xpisar.wz.cz/libisds/";
+    license = licenses.lgpl3;
+    maintainers = [ maintainers.mmahut ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/libisoburn/default.nix b/pkgs/development/libraries/libisoburn/default.nix
index cefce19d465..633f19cef79 100644
--- a/pkgs/development/libraries/libisoburn/default.nix
+++ b/pkgs/development/libraries/libisoburn/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libisoburn";
-  version = "1.5.0";
+  version = "1.5.2";
 
   src = fetchurl {
     url = "http://files.libburnia-project.org/releases/${pname}-${version}.tar.gz";
-    sha256 = "1r8xbhw21bmcp3jhfmvadivh0fa7f4k6larv8lvg4ka0kiigbhfs";
+    sha256 = "1v4hanapr02wf2i6rncc62z8cyc18078nb2y6q4hp3hxa74hnwnc";
   };
 
   buildInputs = [ attr zlib libburn libisofs ];
diff --git a/pkgs/development/libraries/liblouis/default.nix b/pkgs/development/libraries/liblouis/default.nix
index 0f73be7ebce..932edd20e9a 100644
--- a/pkgs/development/libraries/liblouis/default.nix
+++ b/pkgs/development/libraries/liblouis/default.nix
@@ -12,13 +12,13 @@
 
 stdenv.mkDerivation rec {
   pname = "liblouis";
-  version = "3.11.0";
+  version = "3.12.0";
 
   src = fetchFromGitHub {
     owner = "liblouis";
     repo = "liblouis";
     rev = "v${version}";
-    sha256 = "1y0pypgxchxczdnjkblibbvvy4gdk2pf8dzpqmbf824c7zpy8z5r";
+    sha256 = "0sw7iwb9158z7jslxj9jwh2vqbg0q8wq6fbmk9iz7sfkjqhi80hv";
   };
 
   outputs = [ "out" "dev" "man" "info" "doc" ];
diff --git a/pkgs/development/libraries/libmad/001-mips_removal_h_constraint.patch b/pkgs/development/libraries/libmad/001-mips_removal_h_constraint.patch
deleted file mode 100644
index 1d8b385e0c5..00000000000
--- a/pkgs/development/libraries/libmad/001-mips_removal_h_constraint.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-Taken from openwrt:
-https://dev.openwrt.org/browser/packages/libs/libmad/patches/001-mips_removal_h_constraint.patch?rev=18548
-
-diff -ur libmad-0.15.1b-orig/fixed.h libmad-0.15.1b/fixed.h
---- libmad-0.15.1b-orig/fixed.h	2004-02-17 12:32:03.000000000 +1030
-+++ libmad-0.15.1b/fixed.h	2009-08-05 10:46:30.000000000 +0930
-@@ -299,6 +299,23 @@
- 
- # elif defined(FPM_MIPS)
- 
-+/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
-+#if defined (__GNUC__) && defined (__GNUC_MINOR__)
-+#define __GNUC_PREREQ(maj, min) \
-+	((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
-+#else
-+#define __GNUC_PREREQ(maj, min)  0
-+#endif
-+
-+#if __GNUC_PREREQ(4,4)
-+  typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
-+# define MAD_F_MLX(hi, lo, x, y) \
-+   do { \
-+      u64_di_t __ll = (u64_di_t) (x) * (y); \
-+      hi = __ll >> 32; \
-+      lo = __ll; \
-+   } while (0) 
-+#else
- /*
-  * This MIPS version is fast and accurate; the disposition of the least
-  * significant bit depends on OPT_ACCURACY via mad_f_scale64().
-@@ -328,6 +345,7 @@
- 	 : "%r" ((x) >> 12), "r" ((y) >> 16))
- #  define MAD_F_MLZ(hi, lo)  ((mad_fixed_t) (lo))
- # endif
-+#endif /* __GNU_PREREQ(4,4) */
- 
- # if defined(OPT_SPEED)
- #  define mad_f_scale64(hi, lo)  \
-diff -ur libmad-0.15.1b-orig/mad.h libmad-0.15.1b/mad.h
---- libmad-0.15.1b-orig/mad.h	2004-02-17 13:25:44.000000000 +1030
-+++ libmad-0.15.1b/mad.h	2009-08-05 10:42:40.000000000 +0930
-@@ -344,6 +344,23 @@
- 
- # elif defined(FPM_MIPS)
- 
-+/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
-+#if defined (__GNUC__) && defined (__GNUC_MINOR__)
-+#define __GNUC_PREREQ(maj, min) \
-+	((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
-+#else
-+#define __GNUC_PREREQ(maj, min)  0
-+#endif
-+
-+#if __GNUC_PREREQ(4,4)
-+  typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
-+# define MAD_F_MLX(hi, lo, x, y) \
-+   do { \
-+      u64_di_t __ll = (u64_di_t) (x) * (y); \
-+      hi = __ll >> 32; \
-+      lo = __ll; \
-+   } while (0) 
-+#else
- /*
-  * This MIPS version is fast and accurate; the disposition of the least
-  * significant bit depends on OPT_ACCURACY via mad_f_scale64().
-@@ -373,6 +390,7 @@
- 	 : "%r" ((x) >> 12), "r" ((y) >> 16))
- #  define MAD_F_MLZ(hi, lo)  ((mad_fixed_t) (lo))
- # endif
-+#endif /* __GNU_PREREQ(4,4) */
- 
- # if defined(OPT_SPEED)
- #  define mad_f_scale64(hi, lo)  \
diff --git a/pkgs/development/libraries/libmad/default.nix b/pkgs/development/libraries/libmad/default.nix
index f6df090e8b5..9d935daddad 100644
--- a/pkgs/development/libraries/libmad/default.nix
+++ b/pkgs/development/libraries/libmad/default.nix
@@ -1,28 +1,58 @@
-{stdenv, fetchurl, autoconf}:
+{ stdenv, fetchurl, fetchpatch, autoconf }:
 
 stdenv.mkDerivation rec {
-  name = "libmad-0.15.1b";
-  
+  pname = "libmad";
+  version = "0.15.1b";
+
   src = fetchurl {
-    url = "mirror://sourceforge/mad/${name}.tar.gz";
-    sha256 = "bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690";
+    url = "mirror://sourceforge/mad/${pname}-${version}.tar.gz";
+    sha256 = "14460zhacxhswnzb36qfpd1f2wbk10qvksvm6wyq5hpvdgnw7ymv";
   };
 
-  patches = [ ./001-mips_removal_h_constraint.patch ./pkgconfig.patch ]
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/openwrt/packages/raw/openwrt-19.07/libs/libmad/patches/001-mips_removal_h_constraint.patch";
+      sha256 = "0layswr6qg6axf4vyz6xrv73jwga34mkma3ifk9w9vrk41454hr5";
+    })
+    (fetchpatch {
+      url = "https://github.com/KaOSx/main/raw/1270b8080f37fb6cca562829a521991800b0a497/libmad/libmad.patch";
+      sha256 = "0rysq0sn3dfdz6pa6bfqkmk4ymc4rzk5ym7p16dyk37sldg1pbzs";
+    })
+    (fetchpatch {
+      url = "https://github.com/KaOSx/main/raw/1270b8080f37fb6cca562829a521991800b0a497/libmad/amd64-64bit.diff";
+      sha256 = "0mx56dmkbvw3zxnqd2hjng48q0d7q7473pns4n0ksdam29b0c5ar";
+    })
+    (fetchpatch {
+      name = "CVE-2017-8372-CVE-2017-8373.patch";
+      url = "https://github.com/openwrt/packages/raw/openwrt-19.07/libs/libmad/patches/102-CVE-2017-8373-CVE-2017-8372-md-size.patch";
+      sha256 = "0p6mkpn66h1ds8jvww28q4vlr58jwm58m9vb7pkvvyvy764agqnk";
+    })
+    (fetchpatch {
+      name = "CVE-2017-8374.patch";
+      url = "https://github.com/openwrt/packages/raw/openwrt-19.07/libs/libmad/patches/101-CVE-2017-8374-length-check.patch";
+      sha256 = "1j1ssxwmx9nfahzl62frbzck93xrjc2v3w30c12vmk29iflf1890";
+    })
+  ]
   # optimize.diff is taken from https://projects.archlinux.org/svntogit/packages.git/tree/trunk/optimize.diff?h=packages/libmad
   # It is included here in order to fix a build failure in Clang
   # But it may be useful to fix other, currently unknown problems as well
-  ++ stdenv.lib.optional stdenv.cc.isClang [ ./optimize.diff ];
-
-  nativeBuildInputs = [ autoconf ];
+  ++ stdenv.lib.optionals stdenv.cc.isClang [
+    (fetchpatch {
+      url = "https://github.com/KaOSx/main/raw/1270b8080f37fb6cca562829a521991800b0a497/libmad/optimize.diff";
+      sha256 = "1wp60ywzk6nmxc3kq3v6i8b7s4cibvf5cjir859zv10y5aa1d0pk";
+    })
+  ];
 
   # The -fforce-mem flag has been removed in GCC 4.3.
-  preConfigure = ''
-    autoconf
-    substituteInPlace configure --replace "-fforce-mem" ""
-    substituteInPlace configure --replace "arch=\"-march=i486\"" ""
+  postPatch = ''
+    substituteInPlace configure.ac --replace "-fforce-mem" ""
+    substituteInPlace configure.ac --replace "arch=\"-march=i486\"" ""
   '';
 
+  nativeBuildInputs = [ autoconf ];
+
+  preConfigure = "autoconf";
+
   meta = with stdenv.lib; {
     homepage    = https://sourceforge.net/projects/mad/;
     description = "A high-quality, fixed-point MPEG audio decoder supporting MPEG-1 and MPEG-2";
diff --git a/pkgs/development/libraries/libmad/optimize.diff b/pkgs/development/libraries/libmad/optimize.diff
deleted file mode 100644
index 1418dc92707..00000000000
--- a/pkgs/development/libraries/libmad/optimize.diff
+++ /dev/null
@@ -1,77 +0,0 @@
-Index: libmad-0.15.1b/configure.ac
-===================================================================
---- libmad-0.15.1b.orig/configure.ac	2008-03-07 20:31:23.000000000 +0000
-+++ libmad-0.15.1b/configure.ac	2008-03-07 20:34:26.000000000 +0000
-@@ -124,71 +124,7 @@
- 
- if test "$GCC" = yes
- then
--    if test -z "$arch"
--    then
--	case "$host" in
--	    i386-*)           ;;
--	    i?86-*)           arch="-march=i486" ;;
--	    arm*-empeg-*)     arch="-march=armv4 -mtune=strongarm1100" ;;
--	    armv4*-*)         arch="-march=armv4 -mtune=strongarm" ;;
--	    powerpc-*)        ;;
--	    mips*-agenda-*)   arch="-mcpu=vr4100" ;;
--	    mips*-luxsonor-*) arch="-mips1 -mcpu=r3000 -Wa,-m4010" ;;
--	esac
--    fi
--
--    case "$optimize" in
--	-O|"-O "*)
--	    optimize="-O"
--	    optimize="$optimize -fforce-mem"
--	    optimize="$optimize -fforce-addr"
--	    : #x optimize="$optimize -finline-functions"
--	    : #- optimize="$optimize -fstrength-reduce"
--	    optimize="$optimize -fthread-jumps"
--	    optimize="$optimize -fcse-follow-jumps"
--	    optimize="$optimize -fcse-skip-blocks"
--	    : #x optimize="$optimize -frerun-cse-after-loop"
--	    : #x optimize="$optimize -frerun-loop-opt"
--	    : #x optimize="$optimize -fgcse"
--	    optimize="$optimize -fexpensive-optimizations"
--	    optimize="$optimize -fregmove"
--	    : #* optimize="$optimize -fdelayed-branch"
--	    : #x optimize="$optimize -fschedule-insns"
--	    optimize="$optimize -fschedule-insns2"
--	    : #? optimize="$optimize -ffunction-sections"
--	    : #? optimize="$optimize -fcaller-saves"
--	    : #> optimize="$optimize -funroll-loops"
--	    : #> optimize="$optimize -funroll-all-loops"
--	    : #x optimize="$optimize -fmove-all-movables"
--	    : #x optimize="$optimize -freduce-all-givs"
--	    : #? optimize="$optimize -fstrict-aliasing"
--	    : #* optimize="$optimize -fstructure-noalias"
--
--	    case "$host" in
--		arm*-*)
--		    optimize="$optimize -fstrength-reduce"
--		    ;;
--		mips*-*)
--		    optimize="$optimize -fstrength-reduce"
--		    optimize="$optimize -finline-functions"
--		    ;;
--		i?86-*)
--		    optimize="$optimize -fstrength-reduce"
--		    ;;
--		powerpc-apple-*)
--		    # this triggers an internal compiler error with gcc2
--		    : #optimize="$optimize -fstrength-reduce"
--
--		    # this is really only beneficial with gcc3
--		    : #optimize="$optimize -finline-functions"
--		    ;;
--		*)
--		    # this sometimes provokes bugs in gcc 2.95.2
--		    : #optimize="$optimize -fstrength-reduce"
--		    ;;
--	    esac
--	    ;;
--    esac
-+    optimize="-O2"
- fi
- 
- case "$host" in
diff --git a/pkgs/development/libraries/libmad/pkgconfig.patch b/pkgs/development/libraries/libmad/pkgconfig.patch
deleted file mode 100644
index 0ac88acb841..00000000000
--- a/pkgs/development/libraries/libmad/pkgconfig.patch
+++ /dev/null
@@ -1,117 +0,0 @@
-diff -ruN libmad-0.15.1b.orig/Makefile.am libmad-0.15.1b/Makefile.am
---- libmad-0.15.1b.orig/Makefile.am	2004-02-17 02:02:03.000000000 +0000
-+++ libmad-0.15.1b/Makefile.am	2005-08-25 12:08:04.000000000 +0000
-@@ -33,9 +33,12 @@
- minimad_INCLUDES =	
- minimad_LDADD =		libmad.la
- 
--EXTRA_DIST =		mad.h.sed  \
-+EXTRA_DIST =		mad.h.sed mad.pc.in \
- 			CHANGES COPYRIGHT CREDITS README TODO VERSION
- 
-+pkgconfigdir = $(libdir)/pkgconfig
-+pkgconfig_DATA= mad.pc
-+
- exported_headers =	version.h fixed.h bit.h timer.h stream.h frame.h  \
- 			synth.h decoder.h
- 
-diff -ruN libmad-0.15.1b.orig/Makefile.in libmad-0.15.1b/Makefile.in
---- libmad-0.15.1b.orig/Makefile.in	2004-02-17 02:33:23.000000000 +0000
-+++ libmad-0.15.1b/Makefile.in	2005-08-25 12:09:34.000000000 +0000
-@@ -14,6 +14,8 @@
- 
- @SET_MAKE@
- 
-+pkgconfigdir = $(libdir)/pkgconfig
-+pkgconfig_DATA = mad.pc
- 
- SOURCES = $(libmad_la_SOURCES) $(EXTRA_libmad_la_SOURCES) $(minimad_SOURCES)
- 
-@@ -43,7 +45,7 @@
- 	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- 	$(srcdir)/config.h.in $(srcdir)/libmad.list.in \
- 	$(top_srcdir)/configure COPYING INSTALL TODO config.guess \
--	config.sub depcomp install-sh ltmain.sh missing mkinstalldirs
-+	config.sub depcomp install-sh ltmain.sh missing mkinstalldirs mad.pc.in
- subdir = .
- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
- am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-@@ -53,7 +55,7 @@
-  configure.lineno configure.status.lineno
- mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
- CONFIG_HEADER = config.h
--CONFIG_CLEAN_FILES = libmad.list
-+CONFIG_CLEAN_FILES = libmad.list mad.pc
- am__installdirs = $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
- libLTLIBRARIES_INSTALL = $(INSTALL)
- LTLIBRARIES = $(lib_LTLIBRARIES)
-@@ -218,7 +220,7 @@
- minimad_SOURCES = minimad.c
- minimad_INCLUDES = 
- minimad_LDADD = libmad.la
--EXTRA_DIST = mad.h.sed  \
-+EXTRA_DIST = mad.h.sed  mad.pc.in \
- 			CHANGES COPYRIGHT CREDITS README TODO VERSION
- 
- exported_headers = version.h fixed.h bit.h timer.h stream.h frame.h  \
-@@ -298,6 +300,28 @@
- 	rm -f stamp-h1
- 	touch $@
- 
-+mad.pc: $(top_builddir)/config.status mad.pc.in
-+	cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
-+
-+install-pkgconfigDATA: $(pkgconfig_DATA)
-+	@$(NORMAL_INSTALL)
-+	$(mkinstalldirs) $(DESTDIR)$(pkgconfigdir)
-+	@list='$(pkgconfig_DATA)'; for p in $$list; do \
-+	  if test -f $(srcdir)/$$p; then \
-+	    echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgconfigdir)/$$p"; \
-+	    $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgconfigdir)/$$p; \
-+	  else if test -f $$p; then \
-+	    echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgconfigdir)/$$p"; \
-+	    $(INSTALL_DATA) $$p $(DESTDIR)$(pkgconfigdir)/$$p; \
-+	  fi; fi; \
-+	done
-+
-+uninstall-pkgconfigDATA:
-+	@$(NORMAL_UNINSTALL)
-+	list='$(pkgconfig_DATA)'; for p in $$list; do \
-+	  rm -f $(DESTDIR)$(pkgconfigdir)/$$p; \
-+	done
-+
- distclean-hdr:
- 	-rm -f config.h stamp-h1
- libmad.list: $(top_builddir)/config.status $(srcdir)/libmad.list.in
-@@ -726,7 +750,7 @@
- 
- info-am:
- 
--install-data-am: install-includeHEADERS
-+install-data-am: install-includeHEADERS install-pkgconfigDATA
- 
- install-exec-am: install-libLTLIBRARIES
- 
-@@ -757,7 +781,7 @@
- ps-am:
- 
- uninstall-am: uninstall-includeHEADERS uninstall-info-am \
--	uninstall-libLTLIBRARIES
-+	uninstall-libLTLIBRARIES install-pkgconfigDATA
- 
- uninstall-info: uninstall-info-recursive
- 
-diff -ruN libmad-0.15.1b.orig/mad.pc.in libmad-0.15.1b/mad.pc.in
---- libmad-0.15.1b.orig/mad.pc.in	1970-01-01 00:00:00.000000000 +0000
-+++ libmad-0.15.1b/mad.pc.in	2005-08-25 12:08:04.000000000 +0000
-@@ -0,0 +1,10 @@
-+prefix=@prefix@
-+exec_prefix=@exec_prefix@
-+libdir=@libdir@
-+includedir=@includedir@
-+
-+Name: MAD
-+Description: libmad - MPEG audio decoder library
-+Version: @VERSION@
-+Libs: -L${libdir} -lmad
-+Cflags:
diff --git a/pkgs/development/libraries/libmaxminddb/default.nix b/pkgs/development/libraries/libmaxminddb/default.nix
index 2fa162b7e8b..5cf12ea46ba 100644
--- a/pkgs/development/libraries/libmaxminddb/default.nix
+++ b/pkgs/development/libraries/libmaxminddb/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libmaxminddb";
-  version = "1.3.2";
+  version = "1.4.2";
 
   src = fetchurl {
     url = meta.homepage + "/releases/download/${version}/${pname}-${version}.tar.gz";
-    sha256 = "1w60yq26x3yr3abxk7fwqqaggw8dc98595jdliaa3kyqdfm83y76";
+    sha256 = "0mnimbaxnnarlw7g1rh8lpxsyf7xnmzwcczcc3lxw8xyf6ljln6x";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/libmbim/default.nix b/pkgs/development/libraries/libmbim/default.nix
index 2d026452e6f..46255e276f5 100644
--- a/pkgs/development/libraries/libmbim/default.nix
+++ b/pkgs/development/libraries/libmbim/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libmbim";
-  version = "1.20.0";
+  version = "1.20.2";
 
   src = fetchurl {
     url = "https://www.freedesktop.org/software/libmbim/${pname}-${version}.tar.xz";
-    sha256 = "0rm8j4zh9gnb3yi324cnxy91gdimc1vg5gv1kxc2m5lymb3wdxrc";
+    sha256 = "16q550sy84izi5ic3sbbhjnnka2fwhj8vvdrirpn9xspbsgbc3sm";
   };
 
   outputs = [ "out" "dev" "man" ];
diff --git a/pkgs/development/libraries/libmicrohttpd/default.nix b/pkgs/development/libraries/libmicrohttpd/default.nix
index 866edcc437c..c8340626935 100644
--- a/pkgs/development/libraries/libmicrohttpd/default.nix
+++ b/pkgs/development/libraries/libmicrohttpd/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libmicrohttpd";
-  version = "0.9.67";
+  version = "0.9.68";
 
   src = fetchurl {
     url = "mirror://gnu/libmicrohttpd/${pname}-${version}.tar.gz";
-    sha256 = "1584lv2miq7sp7yjd58lcbddh3yh5p8f9gbygn1d96fh4ckqa7vy";
+    sha256 = "0q8bc4hrxn6llml7w2vam6n833x8injs39wgdkhwkawr50m6wwf5";
   };
 
   outputs = [ "out" "dev" "devdoc" "info" ];
diff --git a/pkgs/development/libraries/libminc/default.nix b/pkgs/development/libraries/libminc/default.nix
index aea7a5959fa..53b6af40b51 100644
--- a/pkgs/development/libraries/libminc/default.nix
+++ b/pkgs/development/libraries/libminc/default.nix
@@ -1,17 +1,16 @@
 { stdenv, fetchFromGitHub, cmake, zlib, netcdf, nifticlib, hdf5 }:
 
 stdenv.mkDerivation rec {
-  pname = "libminc";
-  name  = "${pname}-2018-01-17";
+  pname   = "libminc";
+  version = "2.4.03";
 
   owner = "BIC-MNI";
 
-  # current master is significantly ahead of most recent release, so use Git version:
   src = fetchFromGitHub {
     inherit owner;
     repo   = pname;
-    rev    = "a9cbe1353eae9791b7d5b03af16e0f86922ce40b";
-    sha256 = "0mn4n3ihzcr1jw2g1vy6c8p4lkc88jwljk04argmj7k4djrgpxpa";
+    rev    = "release-${version}";
+    sha256 = "0kpmqs9df836ywsqj749qbsfavf5bnldblxrmnmxqq9pywc8yfrm";
   };
 
   postPatch = ''
@@ -27,7 +26,7 @@ stdenv.mkDerivation rec {
     "-DLIBMINC_USE_SYSTEM_NIFTI=ON"
   ];
 
-  doCheck = true;
+  doCheck = !stdenv.isDarwin;
   checkPhase = ''
     export LD_LIBRARY_PATH="$(pwd)"  # see #22060
     ctest -E 'ezminc_rw_test|minc_conversion' --output-on-failure
diff --git a/pkgs/development/libraries/libmodule/default.nix b/pkgs/development/libraries/libmodule/default.nix
index bcd20c3b407..26b81d4d412 100644
--- a/pkgs/development/libraries/libmodule/default.nix
+++ b/pkgs/development/libraries/libmodule/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libmodule";
-  version = "4.2.0";
+  version = "5.0.0";
 
   src = fetchFromGitHub {
     owner = "FedeDP";
     repo = "libmodule";
     rev = version;
-    sha256 = "1qn54pysdm0q7v1gnisd43i5i4ylf8s8an77jk6jd8qimysv08mx";
+    sha256 = "1cf81sl33xmfn5g150iqcdrjn0lpjlgp53mganwi6x7jda2qk7r6";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/development/libraries/libmpeg2/default.nix b/pkgs/development/libraries/libmpeg2/default.nix
index 4c886078aa8..321204a0c4f 100644
--- a/pkgs/development/libraries/libmpeg2/default.nix
+++ b/pkgs/development/libraries/libmpeg2/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     homepage = http://libmpeg2.sourceforge.net/;
     description = "A free library for decoding mpeg-2 and mpeg-1 video streams";
     license = stdenv.lib.licenses.gpl2;
-    maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
+    maintainers = with stdenv.lib.maintainers; [ ];
     platforms = with stdenv.lib.platforms; unix;
   };
 }
diff --git a/pkgs/development/libraries/libmypaint/default.nix b/pkgs/development/libraries/libmypaint/default.nix
index 91e0b5ef072..c36633edfff 100644
--- a/pkgs/development/libraries/libmypaint/default.nix
+++ b/pkgs/development/libraries/libmypaint/default.nix
@@ -7,7 +7,7 @@
 , json_c
 , libtool
 , pkgconfig
-, python2
+, python3
 }:
 
 stdenv.mkDerivation rec {
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     intltool
     libtool
     pkgconfig
-    python2
+    python3
   ];
 
   buildInputs = [
@@ -43,6 +43,10 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
+  postPatch = ''
+    sed 's|python2|python|' -i autogen.sh
+  '';
+
   preConfigure = "./autogen.sh";
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/libndctl/default.nix b/pkgs/development/libraries/libndctl/default.nix
index bfff0c84522..613103db69f 100644
--- a/pkgs/development/libraries/libndctl/default.nix
+++ b/pkgs/development/libraries/libndctl/default.nix
@@ -5,13 +5,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libndctl";
-  version = "66";
+  version = "67";
 
   src = fetchFromGitHub {
     owner  = "pmem";
     repo   = "ndctl";
     rev    = "v${version}";
-    sha256 = "1pq1ss6b1lnyfnvdfhpi0x70jjrnm567fcyvkgvhmp2ndzsn393f";
+    sha256 = "076jgw1g2aafqgnq705in0wnabysqk46dq5yxdv1qzgjmyhka39n";
   };
 
   outputs = [ "out" "lib" "man" "dev" ];
diff --git a/pkgs/development/libraries/libnftnl/default.nix b/pkgs/development/libraries/libnftnl/default.nix
index 815ed3a6bd4..a4f98eed417 100644
--- a/pkgs/development/libraries/libnftnl/default.nix
+++ b/pkgs/development/libraries/libnftnl/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, pkgconfig, libmnl }:
 
 stdenv.mkDerivation rec {
-  version = "1.1.4";
+  version = "1.1.5";
   pname = "libnftnl";
 
   src = fetchurl {
     url = "https://netfilter.org/projects/${pname}/files/${pname}-${version}.tar.bz2";
-    sha256 = "087dfc2n4saf2k68hyi4byvgz5grwpw5kfjvmkpn3wmd8y1riiy8";
+    sha256 = "1wqlxf76bkqf3qhka9sw32qhb2ni20q1k6rn3iril2kw482lvpk6";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/libngspice/default.nix b/pkgs/development/libraries/libngspice/default.nix
index d9b2df6148a..ffecfcb61d0 100644
--- a/pkgs/development/libraries/libngspice/default.nix
+++ b/pkgs/development/libraries/libngspice/default.nix
@@ -4,11 +4,11 @@
 # the ngspice derivation.
 stdenv.mkDerivation rec {
   pname = "libngspice";
-  version = "30";
+  version = "31";
 
   src = fetchurl {
     url = "mirror://sourceforge/ngspice/ngspice-${version}.tar.gz";
-    sha256 = "15v0jdfy2a2zxp8dmy04fdp7w7a4vwvffcwa688r81b86wphxzh8";
+    sha256 = "10n2lnfrpsv4vyrirkphr4jwjjhy7i617g6za78dwirfjq63npw4";
   };
 
   nativeBuildInputs = [ flex bison ];
diff --git a/pkgs/development/libraries/libnice/default.nix b/pkgs/development/libraries/libnice/default.nix
index f4ce1f6eea0..90bdb06bb7f 100644
--- a/pkgs/development/libraries/libnice/default.nix
+++ b/pkgs/development/libraries/libnice/default.nix
@@ -1,4 +1,19 @@
-{ stdenv, fetchurl, fetchpatch, meson, ninja, pkgconfig, python3, gobject-introspection, gtk-doc, docbook_xsl, docbook_xml_dtd_412, glib, gupnp-igd, gst_all_1, gnutls }:
+{ stdenv
+, fetchurl
+, fetchpatch
+, meson
+, ninja
+, pkgconfig
+, python3
+, gobject-introspection
+, gtk-doc
+, docbook_xsl
+, docbook_xml_dtd_412
+, glib
+, gupnp-igd
+, gst_all_1
+, gnutls
+}:
 
 stdenv.mkDerivation rec {
   name = "libnice-0.1.16";
@@ -21,27 +36,40 @@ stdenv.mkDerivation rec {
   ];
 
   nativeBuildInputs = [
-    meson ninja pkgconfig python3 gobject-introspection
+    meson
+    ninja
+    pkgconfig
+    python3
+    gobject-introspection
+
+    # documentation
     gtk-doc
-    # Without these, enabling the 'gtk_doc' gives us `FAILED: meson-install`
-    docbook_xsl docbook_xml_dtd_412
+    docbook_xsl
+    docbook_xml_dtd_412
+  ];
+
+  buildInputs = [
+    gst_all_1.gstreamer
+    gst_all_1.gst-plugins-base
+    gnutls
+    gupnp-igd
+  ];
+
+  propagatedBuildInputs = [
+    glib
   ];
-  buildInputs = [ gst_all_1.gstreamer gst_all_1.gst-plugins-base gnutls ];
-  propagatedBuildInputs = [ glib gupnp-igd ];
 
   mesonFlags = [
-    # Enables all features, so that we know when new dependencies are necessary.
-    "-Dauto_features=enabled"
     "-Dgtk_doc=enabled" # Disabled by default as of libnice-0.1.15
     "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
   ];
 
-  # TODO; see #53293 etc.
-  #doCheck = true;
+  # Tests are flaky
+  # see https://github.com/NixOS/nixpkgs/pull/53293#issuecomment-453739295
+  doCheck = false;
 
   meta = with stdenv.lib; {
-    homepage = https://nice.freedesktop.org/wiki/;
-    description = "The GLib ICE implementation";
+    description = "GLib ICE implementation";
     longDescription = ''
       Libnice is an implementation of the IETF's Interactice Connectivity
       Establishment (ICE) standard (RFC 5245) and the Session Traversal
@@ -49,6 +77,7 @@ stdenv.mkDerivation rec {
 
       It provides a GLib-based library, libnice and a Glib-free library,
       libstun as well as GStreamer elements.'';
+    homepage = "https://nice.freedesktop.org/wiki/";
     platforms = platforms.linux;
     license = with licenses; [ lgpl21 mpl11 ];
   };
diff --git a/pkgs/development/libraries/libnotify/default.nix b/pkgs/development/libraries/libnotify/default.nix
index d4ac3ae8dc9..59039aadb89 100644
--- a/pkgs/development/libraries/libnotify/default.nix
+++ b/pkgs/development/libraries/libnotify/default.nix
@@ -1,5 +1,14 @@
-{ stdenv, fetchurl, meson, ninja, pkgconfig, fetchpatch
-, glib, gdk-pixbuf, gobject-introspection, gnome3 }:
+{ stdenv
+, fetchurl
+, meson
+, ninja
+, pkgconfig
+, fetchpatch
+, glib
+, gdk-pixbuf
+, gobject-introspection
+, gnome3
+}:
 
 stdenv.mkDerivation rec {
   pname = "libnotify";
@@ -26,8 +35,17 @@ stdenv.mkDerivation rec {
     "-Dgtk_doc=false"
   ];
 
-  nativeBuildInputs = [ meson ninja pkgconfig gobject-introspection ];
-  buildInputs = [ glib gdk-pixbuf ];
+  nativeBuildInputs = [
+    gobject-introspection
+    meson
+    ninja
+    pkgconfig
+  ];
+
+  propagatedBuildInputs = [
+    gdk-pixbuf
+    glib
+  ];
 
   passthru = {
     updateScript = gnome3.updateScript {
@@ -40,6 +58,7 @@ stdenv.mkDerivation rec {
     homepage = https://developer.gnome.org/notification-spec/;
     description = "A library that sends desktop notifications to a notification daemon";
     platforms = platforms.unix;
+    maintainers = gnome3.maintainers;
     license = licenses.lgpl21;
   };
 }
diff --git a/pkgs/development/libraries/libofx/default.nix b/pkgs/development/libraries/libofx/default.nix
index 6723c08f082..76276f0ce0f 100644
--- a/pkgs/development/libraries/libofx/default.nix
+++ b/pkgs/development/libraries/libofx/default.nix
@@ -1,23 +1,27 @@
-{ stdenv, fetchurl, opensp, pkgconfig, libxml2, curl }:
-        
+{ stdenv, fetchFromGitHub, opensp, pkgconfig, libxml2, curl
+, autoconf, automake, libtool, gengetopt, libiconv }:
+
 stdenv.mkDerivation rec {
-  name = "libofx-0.9.14";
+  pname = "libofx";
+  version = "0.9.15";
 
-  src = fetchurl {
-    url = "mirror://sourceforge/libofx/${name}.tar.gz";
-    sha256 = "02i9zxkp66yxjpjay5dscfh53bz5vxy03zcxncpw09svl6zmf9xq";
+  src = fetchFromGitHub {
+    owner = "LibOFX";
+    repo = pname;
+    rev = version;
+    sha256 = "1jx56ma351p8af8dvavygjwf6ipa7qbgq7bpdsymwj27apdnixfy";
   };
 
+  preConfigure = "./autogen.sh";
   configureFlags = [ "--with-opensp-includes=${opensp}/include/OpenSP" ];
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ opensp libxml2 curl ];
+  nativeBuildInputs = [ pkgconfig libtool autoconf automake gengetopt ];
+  buildInputs = [ opensp libxml2 curl ] ++ stdenv.lib.optional stdenv.isDarwin libiconv;
 
   meta = { 
     description = "Opensource implementation of the Open Financial eXchange specification";
     homepage = http://libofx.sourceforge.net/;
     license = "LGPL";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = stdenv.lib.platforms.unix;
     maintainers = [ ];
   };
 }
-
diff --git a/pkgs/development/libraries/libosmium/default.nix b/pkgs/development/libraries/libosmium/default.nix
index 8005fb9dbbe..e6abe620aaf 100644
--- a/pkgs/development/libraries/libosmium/default.nix
+++ b/pkgs/development/libraries/libosmium/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libosmium";
-  version = "2.15.3";
+  version = "2.15.4";
 
   src = fetchFromGitHub {
     owner = "osmcode";
     repo = "libosmium";
     rev = "v${version}";
-    sha256 = "14xpzac93f8pqjkz1r0ckqv8h691z5p6pd06wn8ib1aryzc7ps97";
+    sha256 = "0mlcvqrhp40bzj5r5j9nfc5vbis8hmzcq9xi8jylkciyydaynhz4";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/libowfat/default.nix b/pkgs/development/libraries/libowfat/default.nix
index 8c0094a3152..4f1a5f8a179 100644
--- a/pkgs/development/libraries/libowfat/default.nix
+++ b/pkgs/development/libraries/libowfat/default.nix
@@ -23,6 +23,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
+    description = "A GPL reimplementation of libdjb";
     homepage = https://www.fefe.de/libowfat/;
     license = licenses.gpl2;
     platforms = platforms.linux;
diff --git a/pkgs/development/libraries/libplacebo/default.nix b/pkgs/development/libraries/libplacebo/default.nix
index eaa11d1a864..cee6d3f1845 100644
--- a/pkgs/development/libraries/libplacebo/default.nix
+++ b/pkgs/development/libraries/libplacebo/default.nix
@@ -12,16 +12,18 @@
 
 stdenv.mkDerivation rec {
   pname = "libplacebo";
-  version = "1.21.0";
+  version = "1.29.1";
 
   src = fetchFromGitLab {
     domain = "code.videolan.org";
     owner = "videolan";
     repo = pname;
     rev = "v${version}";
-    sha256 = "099qwla0yl76qw16lzdx33svyhx84p5gsa50ksy4828b18fy3bgb";
+    sha256 = "1ly5bwy0pwgvqigpaak8hnig5hksjwf0pzvj3mdv3j2f6f7ya2zz";
   };
 
+  postPatch = "substituteInPlace meson.build --replace 1.29.0 1.29.1";
+
   nativeBuildInputs = [
     meson
     ninja
diff --git a/pkgs/development/libraries/libpng/12.nix b/pkgs/development/libraries/libpng/12.nix
index 6f59c94a56b..14ae1156087 100644
--- a/pkgs/development/libraries/libpng/12.nix
+++ b/pkgs/development/libraries/libpng/12.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     description = "The official reference implementation for the PNG file format";
     homepage = http://www.libpng.org/pub/png/libpng.html;
     license = licenses.libpng;
-    maintainers = [ maintainers.fuuzetsu ];
+    maintainers = [ ];
     branch = "1.2";
     platforms = platforms.unix;
   };
diff --git a/pkgs/development/libraries/libpng/default.nix b/pkgs/development/libraries/libpng/default.nix
index 849f7d29ef6..95ef6201346 100644
--- a/pkgs/development/libraries/libpng/default.nix
+++ b/pkgs/development/libraries/libpng/default.nix
@@ -34,6 +34,6 @@ in stdenv.mkDerivation rec {
     homepage = http://www.libpng.org/pub/png/libpng.html;
     license = licenses.libpng2;
     platforms = platforms.all;
-    maintainers = [ maintainers.vcunat maintainers.fuuzetsu ];
+    maintainers = [ maintainers.vcunat ];
   };
 }
diff --git a/pkgs/development/libraries/libpsl/default.nix b/pkgs/development/libraries/libpsl/default.nix
index 15aa7c9e22d..d2012760dcf 100644
--- a/pkgs/development/libraries/libpsl/default.nix
+++ b/pkgs/development/libraries/libpsl/default.nix
@@ -1,5 +1,16 @@
-{ stdenv, fetchurl, autoreconfHook, docbook_xsl, docbook_xml_dtd_43, gtk-doc, lzip
-, libidn2, libunistring, libxslt, pkgconfig, python3, valgrind
+{ stdenv
+, fetchurl
+, autoreconfHook
+, docbook_xsl
+, docbook_xml_dtd_43
+, gtk-doc
+, lzip
+, libidn2
+, libunistring
+, libxslt
+, pkgconfig
+, python3
+, valgrind
 , publicsuffix-list
 }:
 
@@ -12,9 +23,26 @@ stdenv.mkDerivation rec {
     sha256 = "183hadbira0d2zvv8272lspy31dgm9x26z35c61s5axcd5wd9g9i";
   };
 
-  nativeBuildInputs = [ autoreconfHook docbook_xsl docbook_xml_dtd_43 gtk-doc lzip pkgconfig python3 valgrind ];
-  buildInputs = [ libidn2 libunistring libxslt ];
-  propagatedBuildInputs = [ publicsuffix-list ];
+  nativeBuildInputs = [
+    autoreconfHook
+    docbook_xsl
+    docbook_xml_dtd_43
+    gtk-doc
+    lzip
+    pkgconfig
+    python3
+    valgrind
+  ];
+
+  buildInputs = [
+    libidn2
+    libunistring
+    libxslt
+  ];
+
+  propagatedBuildInputs = [
+    publicsuffix-list
+  ];
 
   postPatch = ''
     patchShebangs src/psl-make-dafsa
@@ -25,7 +53,7 @@ stdenv.mkDerivation rec {
   '';
 
   configureFlags = [
-#    "--enable-gtk-doc"
+    # "--enable-gtk-doc"
     "--enable-man"
     "--enable-valgrind-tests"
     "--with-psl-distfile=${publicsuffix-list}/share/publicsuffix/public_suffix_list.dat"
@@ -35,7 +63,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  doCheck = true;
+  doCheck = !stdenv.isDarwin;
 
   meta = with stdenv.lib; {
     description = "C library for the Publix Suffix List";
diff --git a/pkgs/development/libraries/libpwquality/default.nix b/pkgs/development/libraries/libpwquality/default.nix
index df3595adc01..b0d5513ca0f 100644
--- a/pkgs/development/libraries/libpwquality/default.nix
+++ b/pkgs/development/libraries/libpwquality/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libpwquality";
-  version = "1.4.1";
+  version = "1.4.2";
 
   src = fetchFromGitHub {
     owner = "libpwquality";
     repo = "libpwquality";
     rev = "${pname}-${version}";
-    sha256 = "150gk1d0gq9cig3ylyns7fgihgm3qb1basncahgyh1kzxplrdqm7";
+    sha256 = "0n4pjhm7wfivk0wizggaxq4y4mcxic876wcarjabkp5z9k14y36h";
   };
 
   nativeBuildInputs = [ autoreconfHook perl ];
diff --git a/pkgs/development/libraries/libqalculate/default.nix b/pkgs/development/libraries/libqalculate/default.nix
index 4ba976a9fb8..d369eebd88f 100644
--- a/pkgs/development/libraries/libqalculate/default.nix
+++ b/pkgs/development/libraries/libqalculate/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libqalculate";
-  version = "3.5.0";
+  version = "3.6.0";
 
   src = fetchFromGitHub {
     owner = "qalculate";
     repo = "libqalculate";
     rev = "v${version}";
-    sha256 = "0jfi9h8wsj7h5z3dxdijq6ddxiygik9j86pjxl3hza4v2ilsbwy3";
+    sha256 = "0qfdgxb46c18cp43z67n986xhj6x0sa95hryq42spf1p5ymbylqy";
   };
 
   outputs = [ "out" "dev" "doc" ];
diff --git a/pkgs/development/libraries/libraspberrypi/default.nix b/pkgs/development/libraries/libraspberrypi/default.nix
new file mode 100644
index 00000000000..ec31a29d053
--- /dev/null
+++ b/pkgs/development/libraries/libraspberrypi/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, cmake, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  name = "libraspberrypi";
+  version = "2019-10-22";
+  src = fetchFromGitHub {
+    owner = "raspberrypi";
+    repo = "userland";
+    rev = "5070cb7fc150fc98f1ed64a7739c3356970d9f76";
+    sha256 = "08yfzwn9s7lhrblcsxyag9p5lj5vk3n66b1pv3f7r3hah7qcggyq";
+  };
+
+  cmakeFlags = if (stdenv.targetPlatform.system == "aarch64-linux")
+    then "-DARM64=ON"
+    else "-DARM64=OFF";
+  preConfigure = ''cmakeFlags="$cmakeFlags -DVMCS_INSTALL_PREFIX=$out"'';
+  nativeBuildInputs = [ cmake ];
+  meta = with stdenv.lib; {
+    description = "Userland libraries for interfacing with Raspberry Pi hardware";
+    homepage = https://github.com/raspberrypi/userland;
+    license = licenses.bsd3;
+    platforms = [ "armv6l-linux" "armv7l-linux" "aarch64-linux" ];
+    maintainers = with maintainers; [ tkerber ];
+  };
+}
diff --git a/pkgs/development/libraries/libraw/default.nix b/pkgs/development/libraries/libraw/default.nix
index 62fa8c1a675..00288e359df 100644
--- a/pkgs/development/libraries/libraw/default.nix
+++ b/pkgs/development/libraries/libraw/default.nix
@@ -1,4 +1,7 @@
-{ stdenv, fetchurl, lcms2, jasper, pkgconfig }:
+{ stdenv, fetchurl, lcms2, pkgconfig
+, jasper ? null, withJpeg2k ? false
+# disable JPEG2000 support by default as jasper has many CVE
+}:
 
 stdenv.mkDerivation rec {
   pname = "libraw";
@@ -11,7 +14,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "lib" "dev" "doc" ];
 
-  buildInputs = [ jasper ];
+  buildInputs = stdenv.lib.optionals withJpeg2k [ jasper ];
 
   propagatedBuildInputs = [ lcms2 ];
 
diff --git a/pkgs/development/libraries/libre/default.nix b/pkgs/development/libraries/libre/default.nix
index e365ec7a01a..433597cde6f 100644
--- a/pkgs/development/libraries/libre/default.nix
+++ b/pkgs/development/libraries/libre/default.nix
@@ -12,7 +12,8 @@ stdenv.mkDerivation rec {
   ++ stdenv.lib.optional (stdenv.cc.libc != null) "SYSROOT=${stdenv.lib.getDev stdenv.cc.libc}"
   ;
   meta = {
-    homepage = http://www.creytiv.com/re.html;
+    description = "A library for real-time communications with async IO support and a complete SIP stack";
+    homepage = "http://www.creytiv.com/re.html";
     platforms = with stdenv.lib.platforms; linux;
     maintainers = with stdenv.lib.maintainers; [raskin];
     license = stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/librealsense/default.nix b/pkgs/development/libraries/librealsense/default.nix
index 468bcfb0a18..91c093c991a 100644
--- a/pkgs/development/libraries/librealsense/default.nix
+++ b/pkgs/development/libraries/librealsense/default.nix
@@ -1,18 +1,20 @@
-{ stdenv, fetchFromGitHub, cmake, libusb, ninja, pkgconfig}:
+{ stdenv, fetchFromGitHub, cmake, libusb1, ninja, pkgconfig }:
 
 stdenv.mkDerivation rec {
   pname = "librealsense";
-  version = "2.25.0";
+  version = "2.29.0";
+
+  outputs = [ "out" "dev" ];
 
   src = fetchFromGitHub {
     owner = "IntelRealSense";
-    repo = "librealsense";
+    repo = pname;
     rev = "v${version}";
-    sha256 = "029qps0bbck0m2xj0mb5g3pgkk7a1zq8wcilfkvpx72sn7039xvw";
+    sha256 = "0wrg1c4fcd5ky96hmnczg9izfgd0yxls8ghxxzrdvgdlg269f443";
   };
 
   buildInputs = [
-    libusb
+    libusb1
   ];
 
   nativeBuildInputs = [
@@ -25,9 +27,9 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "A cross-platform library for Intel® RealSense™ depth cameras (D400 series and the SR300)";
-    homepage = https://github.com/IntelRealSense/librealsense;
+    homepage = "https://github.com/IntelRealSense/librealsense";
     license = licenses.asl20;
     maintainers = with maintainers; [ brian-dawn ];
-    platforms = ["i686-linux" "x86_64-linux" "x86_64-darwin"];
+    platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
   };
 }
diff --git a/pkgs/development/libraries/librem/default.nix b/pkgs/development/libraries/librem/default.nix
index aeda663342e..012ac2a46a7 100644
--- a/pkgs/development/libraries/librem/default.nix
+++ b/pkgs/development/libraries/librem/default.nix
@@ -16,7 +16,8 @@ stdenv.mkDerivation rec {
   ++ stdenv.lib.optional (stdenv.cc.libc != null) "SYSROOT=${stdenv.lib.getDev stdenv.cc.libc}"
   ;
   meta = {
-    homepage = http://www.creytiv.com/rem.html;
+    description = " A library for real-time audio and video processing";
+    homepage = "http://www.creytiv.com/rem.html";
     platforms = with stdenv.lib.platforms; linux;
     maintainers = with stdenv.lib.maintainers; [raskin];
     license = stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/librsvg/default.nix b/pkgs/development/libraries/librsvg/default.nix
index e54098b4459..11c7f3fed84 100644
--- a/pkgs/development/libraries/librsvg/default.nix
+++ b/pkgs/development/libraries/librsvg/default.nix
@@ -4,14 +4,14 @@
 
 let
   pname = "librsvg";
-  version = "2.46.1";
+  version = "2.46.4";
 in
 stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
-    sha256 = "0hvnqrgfi8c2xh94gxs6xwwg1m2z3l0lblqs2anlx8k3g9ag589d";
+    sha256 = "0afc82nsxc6kw136xid4vcq9kmq4rmgzzk8bh2pvln2cnvirwnxl";
   };
 
   outputs = [ "out" "dev" "installedTests" ];
diff --git a/pkgs/development/libraries/libsearpc/default.nix b/pkgs/development/libraries/libsearpc/default.nix
index b2a79967477..9bf246f556d 100644
--- a/pkgs/development/libraries/libsearpc/default.nix
+++ b/pkgs/development/libraries/libsearpc/default.nix
@@ -1,14 +1,14 @@
 {stdenv, fetchFromGitHub, automake, autoconf, pkgconfig, libtool, python2Packages, glib, jansson}:
 
 stdenv.mkDerivation rec {
-  version = "3.1.0";
+  version = "3.2.0";
   pname = "libsearpc";
 
   src = fetchFromGitHub {
     owner = "haiwen";
     repo = "libsearpc";
     rev = "v${version}";
-    sha256 = "1zf8xxsl95wdx0372kl8s153hd8q3lhwwvwr2k96ia8scbn2ylkp";
+    sha256 = "18i5zvrp6dv6vygxx5nc93mai2p2x786n5lnf5avrin6xiz2j6hd";
   };
 
   patches = [ ./libsearpc.pc.patch ];
diff --git a/pkgs/development/libraries/libseccomp/default.nix b/pkgs/development/libraries/libseccomp/default.nix
index 8c9c6ac107c..08c276c4d55 100644
--- a/pkgs/development/libraries/libseccomp/default.nix
+++ b/pkgs/development/libraries/libseccomp/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libseccomp";
-  version = "2.4.1";
+  version = "2.4.2";
 
   src = fetchurl {
     url = "https://github.com/seccomp/libseccomp/releases/download/v${version}/libseccomp-${version}.tar.gz";
-    sha256 = "1s06h2cgk0xxwmhwj72z33bllafc1xqnxzk2yyra2rmg959778qw";
+    sha256 = "0nsq81acrbkdr8zairxbwa33bj2a6126npp76b4srjl472sjfkxm";
   };
 
   outputs = [ "out" "lib" "dev" "man" ];
diff --git a/pkgs/development/libraries/libsecret/default.nix b/pkgs/development/libraries/libsecret/default.nix
index 0a3c110bbbd..ca2449adefd 100644
--- a/pkgs/development/libraries/libsecret/default.nix
+++ b/pkgs/development/libraries/libsecret/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, glib, pkgconfig, gettext, libxslt, python3, docbook_xsl, docbook_xml_dtd_42
-, libgcrypt, gobject-introspection, vala, gtk-doc, gnome3, libintl, dbus, xvfb_run }:
+, libgcrypt, gobject-introspection, vala, gtk-doc, gnome3, gjs, libintl, dbus, xvfb_run }:
 
 stdenv.mkDerivation rec {
   pname = "libsecret";
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  installCheckInputs = [ python3 python3.pkgs.dbus-python python3.pkgs.pygobject3 xvfb_run dbus gnome3.gjs ];
+  installCheckInputs = [ python3 python3.pkgs.dbus-python python3.pkgs.pygobject3 xvfb_run dbus gjs ];
 
   # needs to run after install because typelibs point to absolute paths
   doInstallCheck = false; # Failed to load shared library '/force/shared/libmock_service.so.0' referenced by the typelib
diff --git a/pkgs/development/libraries/libsexy/default.nix b/pkgs/development/libraries/libsexy/default.nix
deleted file mode 100644
index cb22d9f97bc..00000000000
--- a/pkgs/development/libraries/libsexy/default.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{ stdenv, fetchurl, pkgconfig
-, glib, gtk2, libxml2, pango
-}:
-
-stdenv.mkDerivation {
-  name = "libsexy-0.1.11";
-
-  src = fetchurl {
-    url = http://releases.chipx86.com/libsexy/libsexy/libsexy-0.1.11.tar.gz;
-    sha256 = "8c4101a8cda5fccbba85ba1a15f46f2cf75deaa8b3c525ce5b135b9e1a8fe49e";
-  };
-
-  nativeBuildInputs = [ pkgconfig ];
-
-  buildInputs = [ glib gtk2 libxml2 pango ];
-
-  meta = with stdenv.lib; {
-    description = "A collection of GTK widgets";
-    homepage = https://blog.chipx86.com/tag/libsexy/;
-    license = licenses.lgpl21;
-    maintainers = with maintainers; [ ];
-    platforms = platforms.unix;
-  };
-}
diff --git a/pkgs/development/libraries/libsolv/default.nix b/pkgs/development/libraries/libsolv/default.nix
index 84f6656d0b8..c3fe1ad619a 100644
--- a/pkgs/development/libraries/libsolv/default.nix
+++ b/pkgs/development/libraries/libsolv/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchFromGitHub, cmake, ninja, zlib, expat, rpm, db }:
 
 stdenv.mkDerivation rec {
-  version  = "0.7.7";
+  version  = "0.7.9";
   pname = "libsolv";
 
   src = fetchFromGitHub {
     owner  = "openSUSE";
     repo   = "libsolv";
     rev    = version;
-    sha256 = "0f6r5j5d4fbzx9ihbbwrqylayw90qac8kapkhmfcvsh7f8whr623";
+    sha256 = "1ijb4nywc3hx142194d85x7db0j5g2n0i750665fal30qrw2x43y";
   };
 
   cmakeFlags = [
@@ -24,6 +24,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "A free package dependency solver";
+    homepage    = "https://github.com/openSUSE/libsolv";
     license     = licenses.bsd3;
     platforms   = platforms.linux;
     maintainers = with maintainers; [ copumpkin ];
diff --git a/pkgs/development/libraries/libsoup/default.nix b/pkgs/development/libraries/libsoup/default.nix
index 7c4772c9cf1..2d2f2da6a39 100644
--- a/pkgs/development/libraries/libsoup/default.nix
+++ b/pkgs/development/libraries/libsoup/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libsoup";
-  version = "2.68.2";
+  version = "2.68.3";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0crr9qprmacr626fx83cx81ggk85zsgxr4mn577kpzj6m40k1bai";
+    sha256 = "1yxs0ax4rq3g0lgkbv7mz497rqj16iyyizddyc13gzxh6n7b0jsk";
   };
 
   postPatch = ''
diff --git a/pkgs/development/libraries/libspectrum/default.nix b/pkgs/development/libraries/libspectrum/default.nix
new file mode 100644
index 00000000000..c09a45abf59
--- /dev/null
+++ b/pkgs/development/libraries/libspectrum/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, perl, pkgconfig, audiofile, bzip2, glib, libgcrypt, zlib }:
+
+stdenv.mkDerivation rec {
+  name = "libspectrum-1.4.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/fuse-emulator/${name}.tar.gz";
+    sha256 = "1cc0jx617sym6qj1f9fm115q44cq5azsxplqq2cgrg0pmlmjpyzx";
+  };
+
+  nativeBuildInputs = [ perl pkgconfig ];
+
+  buildInputs = [ audiofile bzip2 glib libgcrypt zlib ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = http://fuse-emulator.sourceforge.net/libspectrum.php;
+    description = "ZX Spectrum input and output support library";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ orivej ];
+  };
+}
diff --git a/pkgs/development/libraries/libtcod/default.nix b/pkgs/development/libraries/libtcod/default.nix
index 6d95d81e5d9..5a7fb3395eb 100644
--- a/pkgs/development/libraries/libtcod/default.nix
+++ b/pkgs/development/libraries/libtcod/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromBitbucket, cmake, SDL, libGLU_combined, upx, zlib }:
+{ stdenv, fetchFromBitbucket, cmake, SDL, libGLU, libGL, upx, zlib }:
 
 stdenv.mkDerivation {
 
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
 
   cmakeFlags="-DLIBTCOD_SAMPLES=OFF";
 
-  buildInputs = [ cmake SDL libGLU_combined upx zlib ];
+  buildInputs = [ cmake SDL libGLU libGL upx zlib ];
 
   meta = {
     description = "API for roguelike games";
diff --git a/pkgs/development/libraries/libtermkey/default.nix b/pkgs/development/libraries/libtermkey/default.nix
index a30d3235411..989d26b64e1 100644
--- a/pkgs/development/libraries/libtermkey/default.nix
+++ b/pkgs/development/libraries/libtermkey/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchzip, libtool, pkgconfig, ncurses }:
+{ stdenv, lib, fetchzip, libtool, pkgconfig, ncurses, unibilium }:
 
 stdenv.mkDerivation rec {
   pname = "libtermkey";
@@ -13,11 +13,12 @@ stdenv.mkDerivation rec {
   makeFlags = [ "PREFIX=$(out)" ]
     ++ stdenv.lib.optional stdenv.isDarwin "LIBTOOL=${libtool}/bin/libtool";
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ libtool ncurses ];
+  nativeBuildInputs = [ libtool pkgconfig ];
+  buildInputs = [ ncurses unibilium ];
 
   meta = with lib; {
     description = "Terminal keypress reading library";
+    homepage = http://www.leonerd.org.uk/code/libtermkey;
     license = licenses.mit;
     platforms = platforms.unix;
   };
diff --git a/pkgs/development/libraries/libtiff/CVE-2019-14973.patch b/pkgs/development/libraries/libtiff/CVE-2019-14973.patch
deleted file mode 100644
index 1dc75246902..00000000000
--- a/pkgs/development/libraries/libtiff/CVE-2019-14973.patch
+++ /dev/null
@@ -1,384 +0,0 @@
-diff -ru tiff-4.0.10-orig/libtiff/tif_aux.c tiff-4.0.10/libtiff/tif_aux.c
---- tiff-4.0.10-orig/libtiff/tif_aux.c	2017-12-02 16:21:47.305709555 +0100
-+++ tiff-4.0.10/libtiff/tif_aux.c	2019-10-02 22:35:17.392184463 +0200
-@@ -57,18 +57,57 @@
- 	return bytes;
- }
- 
-+tmsize_t
-+_TIFFMultiplySSize(TIFF* tif, tmsize_t first, tmsize_t second, const char* where)
-+{
-+    if( first <= 0 || second <= 0 )
-+    {
-+        if( tif != NULL && where != NULL )
-+        {
-+            TIFFErrorExt(tif->tif_clientdata, where,
-+                        "Invalid argument to _TIFFMultiplySSize() in %s", where);
-+        }
-+        return 0;
-+    }
-+
-+    if( first > TIFF_TMSIZE_T_MAX / second )
-+    {
-+        if( tif != NULL && where != NULL )
-+        {
-+            TIFFErrorExt(tif->tif_clientdata, where,
-+                        "Integer overflow in %s", where);
-+        }
-+        return 0;
-+    }
-+    return first * second;
-+}
-+
-+tmsize_t _TIFFCastUInt64ToSSize(TIFF* tif, uint64 val, const char* module)
-+{
-+    if( val > (uint64)TIFF_TMSIZE_T_MAX )
-+    {
-+        if( tif != NULL && module != NULL )
-+        {
-+            TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
-+        }
-+        return 0;
-+    }
-+    return (tmsize_t)val;
-+}
-+
- void*
- _TIFFCheckRealloc(TIFF* tif, void* buffer,
- 		  tmsize_t nmemb, tmsize_t elem_size, const char* what)
- {
- 	void* cp = NULL;
--	tmsize_t bytes = nmemb * elem_size;
--
-+        tmsize_t count = _TIFFMultiplySSize(tif, nmemb, elem_size, NULL);
- 	/*
--	 * XXX: Check for integer overflow.
-+	 * Check for integer overflow.
- 	 */
--	if (nmemb && elem_size && bytes / elem_size == nmemb)
--		cp = _TIFFrealloc(buffer, bytes);
-+	if (count != 0)
-+	{
-+		cp = _TIFFrealloc(buffer, count);
-+	}
- 
- 	if (cp == NULL) {
- 		TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
-diff -ru tiff-4.0.10-orig/libtiff/tiffiop.h tiff-4.0.10/libtiff/tiffiop.h
---- tiff-4.0.10-orig/libtiff/tiffiop.h	2018-11-03 15:28:37.748910968 +0100
-+++ tiff-4.0.10/libtiff/tiffiop.h	2019-10-02 22:35:17.396184535 +0200
-@@ -77,6 +77,9 @@
- #define	FALSE	0
- #endif
- 
-+#define TIFF_SIZE_T_MAX ((size_t) ~ ((size_t)0))
-+#define TIFF_TMSIZE_T_MAX (tmsize_t)(TIFF_SIZE_T_MAX >> 1)
-+
- typedef struct client_info {
-     struct client_info *next;
-     void *data;
-@@ -258,7 +261,7 @@
- #define TIFFhowmany8_64(x) (((x)&0x07)?((uint64)(x)>>3)+1:(uint64)(x)>>3)
- #define TIFFroundup_64(x, y) (TIFFhowmany_64(x,y)*(y))
- 
--/* Safe multiply which returns zero if there is an integer overflow */
-+/* Safe multiply which returns zero if there is an *unsigned* integer overflow. This macro is not safe for *signed* integer types */
- #define TIFFSafeMultiply(t,v,m) ((((t)(m) != (t)0) && (((t)(((v)*(m))/(m))) == (t)(v))) ? (t)((v)*(m)) : (t)0)
- 
- #define TIFFmax(A,B) ((A)>(B)?(A):(B))
-@@ -368,6 +371,8 @@
- 
- extern uint32 _TIFFMultiply32(TIFF*, uint32, uint32, const char*);
- extern uint64 _TIFFMultiply64(TIFF*, uint64, uint64, const char*);
-+extern tmsize_t _TIFFMultiplySSize(TIFF*, tmsize_t, tmsize_t, const char*);
-+extern tmsize_t _TIFFCastUInt64ToSSize(TIFF*, uint64, const char*);
- extern void* _TIFFCheckMalloc(TIFF*, tmsize_t, tmsize_t, const char*);
- extern void* _TIFFCheckRealloc(TIFF*, void*, tmsize_t, tmsize_t, const char*);
- 
-diff -ru tiff-4.0.10-orig/libtiff/tif_getimage.c tiff-4.0.10/libtiff/tif_getimage.c
---- tiff-4.0.10-orig/libtiff/tif_getimage.c	2017-12-02 16:21:47.654716127 +0100
-+++ tiff-4.0.10/libtiff/tif_getimage.c	2019-10-02 22:35:17.393184481 +0200
-@@ -755,9 +755,8 @@
- 	uint32 leftmost_tw;
- 
- 	tilesize = TIFFTileSize(tif);  
--	bufsize = TIFFSafeMultiply(tmsize_t,alpha?4:3,tilesize);
-+	bufsize = _TIFFMultiplySSize(tif, alpha?4:3,tilesize, "gtTileSeparate");
- 	if (bufsize == 0) {
--		TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Integer overflow in %s", "gtTileSeparate");
- 		return (0);
- 	}
- 
-@@ -1019,9 +1018,8 @@
-         uint16 colorchannels;
- 
- 	stripsize = TIFFStripSize(tif);  
--	bufsize = TIFFSafeMultiply(tmsize_t,alpha?4:3,stripsize);
-+	bufsize = _TIFFMultiplySSize(tif,alpha?4:3,stripsize, "gtStripSeparate");
- 	if (bufsize == 0) {
--		TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Integer overflow in %s", "gtStripSeparate");
- 		return (0);
- 	}
- 
-diff -ru tiff-4.0.10-orig/libtiff/tif_luv.c tiff-4.0.10/libtiff/tif_luv.c
---- tiff-4.0.10-orig/libtiff/tif_luv.c	2018-05-05 15:50:35.884596907 +0200
-+++ tiff-4.0.10/libtiff/tif_luv.c	2019-10-02 22:35:17.393184481 +0200
-@@ -1264,16 +1264,10 @@
- 	return (SGILOGDATAFMT_UNKNOWN);
- }
- 
--
--#define TIFF_SIZE_T_MAX ((size_t) ~ ((size_t)0))
--#define TIFF_TMSIZE_T_MAX (tmsize_t)(TIFF_SIZE_T_MAX >> 1)
--
- static tmsize_t
- multiply_ms(tmsize_t m1, tmsize_t m2)
- {
--        if( m1 == 0 || m2 > TIFF_TMSIZE_T_MAX / m1 )
--            return 0;
--        return m1 * m2;
-+        return _TIFFMultiplySSize(NULL, m1, m2, NULL);
- }
- 
- static int
-diff -ru tiff-4.0.10-orig/libtiff/tif_pixarlog.c tiff-4.0.10/libtiff/tif_pixarlog.c
---- tiff-4.0.10-orig/libtiff/tif_pixarlog.c	2017-12-02 16:21:47.841162432 +0100
-+++ tiff-4.0.10/libtiff/tif_pixarlog.c	2019-10-02 22:36:01.223970118 +0200
-@@ -634,15 +634,10 @@
- 	return guess;
- }
- 
--#define TIFF_SIZE_T_MAX ((size_t) ~ ((size_t)0))
--#define TIFF_TMSIZE_T_MAX (tmsize_t)(TIFF_SIZE_T_MAX >> 1)
--
- static tmsize_t
- multiply_ms(tmsize_t m1, tmsize_t m2)
- {
--        if( m1 == 0 || m2 > TIFF_TMSIZE_T_MAX / m1 )
--            return 0;
--        return m1 * m2;
-+        return _TIFFMultiplySSize(NULL, m1, m2, NULL);
- }
- 
- static tmsize_t
-diff -ru tiff-4.0.10-orig/libtiff/tif_read.c tiff-4.0.10/libtiff/tif_read.c
---- tiff-4.0.10-orig/libtiff/tif_read.c	2018-10-14 21:15:27.551093695 +0200
-+++ tiff-4.0.10/libtiff/tif_read.c	2019-10-02 22:41:09.387290927 +0200
-@@ -29,9 +29,6 @@
- #include "tiffiop.h"
- #include <stdio.h>
- 
--#define TIFF_SIZE_T_MAX ((size_t) ~ ((size_t)0))
--#define TIFF_TMSIZE_T_MAX (tmsize_t)(TIFF_SIZE_T_MAX >> 1)
--
- int TIFFFillStrip(TIFF* tif, uint32 strip);
- int TIFFFillTile(TIFF* tif, uint32 tile);
- static int TIFFStartStrip(TIFF* tif, uint32 strip);
-@@ -49,6 +46,8 @@
- #define THRESHOLD_MULTIPLIER 10
- #define MAX_THRESHOLD (THRESHOLD_MULTIPLIER * THRESHOLD_MULTIPLIER * THRESHOLD_MULTIPLIER * INITIAL_THRESHOLD)
- 
-+#define TIFF_INT64_MAX ((((int64)0x7FFFFFFF) << 32) | 0xFFFFFFFF)
-+
- /* Read 'size' bytes in tif_rawdata buffer starting at offset 'rawdata_offset'
-  * Returns 1 in case of success, 0 otherwise. */
- static int TIFFReadAndRealloc( TIFF* tif, tmsize_t size,
-@@ -734,23 +733,8 @@
- 		return ((tmsize_t)(-1));
- 	}
- 	bytecount = td->td_stripbytecount[strip];
--	if ((int64)bytecount <= 0) {
--#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
--		TIFFErrorExt(tif->tif_clientdata, module,
--			     "%I64u: Invalid strip byte count, strip %lu",
--			     (unsigned __int64) bytecount,
--			     (unsigned long) strip);
--#else
--		TIFFErrorExt(tif->tif_clientdata, module,
--			     "%llu: Invalid strip byte count, strip %lu",
--			     (unsigned long long) bytecount,
--			     (unsigned long) strip);
--#endif
--		return ((tmsize_t)(-1));
--	}
--	bytecountm = (tmsize_t)bytecount;
--	if ((uint64)bytecountm!=bytecount) {
--		TIFFErrorExt(tif->tif_clientdata, module, "Integer overflow");
-+	bytecountm =  _TIFFCastUInt64ToSSize(tif, bytecount, module);
-+	if (bytecountm == 0) {
- 		return ((tmsize_t)(-1));
- 	}
- 	if (size != (tmsize_t)(-1) && size < bytecountm)
-@@ -774,7 +758,7 @@
- 	if ((tif->tif_flags&TIFF_NOREADRAW)==0)
- 	{
- 		uint64 bytecount = td->td_stripbytecount[strip];
--		if ((int64)bytecount <= 0) {
-+		if( bytecount == 0 || bytecount > (uint64)TIFF_INT64_MAX ) {
- #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- 			TIFFErrorExt(tif->tif_clientdata, module,
- 				"Invalid strip byte count %I64u, strip %lu",
-@@ -801,7 +785,7 @@
- 			    (bytecount - 4096) / 10 > (uint64)stripsize  )
- 			{
- 				uint64 newbytecount = (uint64)stripsize * 10 + 4096;
--				if( (int64)newbytecount >= 0 )
-+				if( newbytecount == 0 || newbytecount > (uint64)TIFF_INT64_MAX )
- 				{
- #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- 					TIFFWarningExt(tif->tif_clientdata, module,
-@@ -1196,10 +1180,8 @@
- 	bytecount64 = td->td_stripbytecount[tile];
- 	if (size != (tmsize_t)(-1) && (uint64)size < bytecount64)
- 		bytecount64 = (uint64)size;
--	bytecountm = (tmsize_t)bytecount64;
--	if ((uint64)bytecountm!=bytecount64)
--	{
--		TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
-+	bytecountm = _TIFFCastUInt64ToSSize(tif, bytecount64, module);
-+        if( bytecountm == 0 ) {
- 		return ((tmsize_t)(-1));
- 	}
- 	return (TIFFReadRawTile1(tif, tile, buf, bytecountm, module));
-@@ -1221,7 +1203,7 @@
- 	if ((tif->tif_flags&TIFF_NOREADRAW)==0)
- 	{
- 		uint64 bytecount = td->td_stripbytecount[tile];
--		if ((int64)bytecount <= 0) {
-+		if( bytecount == 0 || bytecount > (uint64)TIFF_INT64_MAX ) {
- #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- 			TIFFErrorExt(tif->tif_clientdata, module,
- 				"%I64u: Invalid tile byte count, tile %lu",
-@@ -1248,7 +1230,7 @@
- 			    (bytecount - 4096) / 10 > (uint64)stripsize  )
- 			{
- 				uint64 newbytecount = (uint64)stripsize * 10 + 4096;
--				if( (int64)newbytecount >= 0 )
-+				if( newbytecount == 0 || newbytecount > (uint64)TIFF_INT64_MAX )
- 				{
- #if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- 					TIFFWarningExt(tif->tif_clientdata, module,
-diff -ru tiff-4.0.10-orig/libtiff/tif_strip.c tiff-4.0.10/libtiff/tif_strip.c
---- tiff-4.0.10-orig/libtiff/tif_strip.c	2017-12-02 16:21:47.947867167 +0100
-+++ tiff-4.0.10/libtiff/tif_strip.c	2019-10-02 22:35:17.395184517 +0200
-@@ -129,15 +129,8 @@
- {
- 	static const char module[] = "TIFFVStripSize";
- 	uint64 m;
--	tmsize_t n;
- 	m=TIFFVStripSize64(tif,nrows);
--	n=(tmsize_t)m;
--	if ((uint64)n!=m)
--	{
--		TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
--		n=0;
--	}
--	return(n);
-+        return _TIFFCastUInt64ToSSize(tif, m, module);
- }
- 
- /*
-@@ -211,15 +204,8 @@
- {
- 	static const char module[] = "TIFFStripSize";
- 	uint64 m;
--	tmsize_t n;
- 	m=TIFFStripSize64(tif);
--	n=(tmsize_t)m;
--	if ((uint64)n!=m)
--	{
--		TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
--		n=0;
--	}
--	return(n);
-+	return _TIFFCastUInt64ToSSize(tif, m, module);
- }
- 
- /*
-@@ -330,14 +316,8 @@
- {
- 	static const char module[] = "TIFFScanlineSize";
- 	uint64 m;
--	tmsize_t n;
- 	m=TIFFScanlineSize64(tif);
--	n=(tmsize_t)m;
--	if ((uint64)n!=m) {
--		TIFFErrorExt(tif->tif_clientdata,module,"Integer arithmetic overflow");
--		n=0;
--	}
--	return(n);
-+	return _TIFFCastUInt64ToSSize(tif, m, module);
- }
- 
- /*
-@@ -366,15 +346,8 @@
- {
- 	static const char module[] = "TIFFRasterScanlineSize";
- 	uint64 m;
--	tmsize_t n;
- 	m=TIFFRasterScanlineSize64(tif);
--	n=(tmsize_t)m;
--	if ((uint64)n!=m)
--	{
--		TIFFErrorExt(tif->tif_clientdata,module,"Integer arithmetic overflow");
--		n=0;
--	}
--	return(n);
-+	return _TIFFCastUInt64ToSSize(tif, m, module);
- }
- 
- /* vim: set ts=8 sts=8 sw=8 noet: */
-diff -ru tiff-4.0.10-orig/libtiff/tif_tile.c tiff-4.0.10/libtiff/tif_tile.c
---- tiff-4.0.10-orig/libtiff/tif_tile.c	2017-12-02 16:21:47.993972977 +0100
-+++ tiff-4.0.10/libtiff/tif_tile.c	2019-10-02 22:35:17.395184517 +0200
-@@ -181,15 +181,8 @@
- {
- 	static const char module[] = "TIFFTileRowSize";
- 	uint64 m;
--	tmsize_t n;
- 	m=TIFFTileRowSize64(tif);
--	n=(tmsize_t)m;
--	if ((uint64)n!=m)
--	{
--		TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
--		n=0;
--	}
--	return(n);
-+	return _TIFFCastUInt64ToSSize(tif, m, module);
- }
- 
- /*
-@@ -248,15 +241,8 @@
- {
- 	static const char module[] = "TIFFVTileSize";
- 	uint64 m;
--	tmsize_t n;
- 	m=TIFFVTileSize64(tif,nrows);
--	n=(tmsize_t)m;
--	if ((uint64)n!=m)
--	{
--		TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
--		n=0;
--	}
--	return(n);
-+	return _TIFFCastUInt64ToSSize(tif, m, module);
- }
- 
- /*
-@@ -272,15 +258,8 @@
- {
- 	static const char module[] = "TIFFTileSize";
- 	uint64 m;
--	tmsize_t n;
- 	m=TIFFTileSize64(tif);
--	n=(tmsize_t)m;
--	if ((uint64)n!=m)
--	{
--		TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
--		n=0;
--	}
--	return(n);
-+	return _TIFFCastUInt64ToSSize(tif, m, module);
- }
- 
- /*
diff --git a/pkgs/development/libraries/libtiff/default.nix b/pkgs/development/libraries/libtiff/default.nix
index c35923071b0..795ed439093 100644
--- a/pkgs/development/libraries/libtiff/default.nix
+++ b/pkgs/development/libraries/libtiff/default.nix
@@ -9,24 +9,14 @@
 }:
 
 stdenv.mkDerivation rec {
-  version = "4.0.10";
+  version = "4.1.0";
   pname = "libtiff";
 
   src = fetchurl {
     url = "https://download.osgeo.org/libtiff/tiff-${version}.tar.gz";
-    sha256 = "1r4np635gr6zlc0bic38dzvxia6iqzcrary4n1ylarzpr8fd2lic";
+    sha256 = "0d46bdvxdiv59lxnb0xz9ywm8arsr6xsapi5s6y6vnys2wjz6aax";
   };
 
-  patches = [
-    (fetchurl {
-      url = "https://gitlab.com/libtiff/libtiff/commit/0c74a9f49b8d7a36b17b54a7428b3526d20f88a8.patch";
-      name = "CVE-2019-6128.patch";
-      sha256 = "03yvsfq6dxjd3v8ypfwz6cpz2iymqwcbawqqlmkh40dayi7fgizr";
-    })
-    # Manual backport of https://gitlab.com/libtiff/libtiff/commit/1b5e3b6a23827c33acf19ad50ce5ce78f12b3773.patch
-    ./CVE-2019-14973.patch
-  ];
-
   outputs = [ "bin" "dev" "out" "man" "doc" ];
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/libtommath/default.nix b/pkgs/development/libraries/libtommath/default.nix
index 8ce82bcf07c..0fde422b9aa 100644
--- a/pkgs/development/libraries/libtommath/default.nix
+++ b/pkgs/development/libraries/libtommath/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libtommath";
-  version = "1.1.0";
+  version = "1.2.0";
 
   src = fetchurl {
     url = "https://github.com/libtom/libtommath/releases/download/v${version}/ltm-${version}.tar.xz";
-    sha256 = "1bbyagqzfdbg37k1n08nsqzdf44z8zsnjjinqbsyj7rxg246qilh";
+    sha256 = "1c8q1qy88cjhdjlk3g24mra94h34c1ldvkjz0n2988c0yvn5xixp";
   };
 
   nativeBuildInputs = [ libtool ];
diff --git a/pkgs/development/libraries/libtoxcore/default.nix b/pkgs/development/libraries/libtoxcore/default.nix
index e9267df5047..76362f8f883 100644
--- a/pkgs/development/libraries/libtoxcore/default.nix
+++ b/pkgs/development/libraries/libtoxcore/default.nix
@@ -33,6 +33,12 @@ let
     doCheck = false; # hangs, tries to access the net?
     checkInputs = [ check ];
 
+    postFixup =''
+      sed -i $out/lib/pkgconfig/*.pc \
+        -e "s|^libdir=.*|libdir=$out/lib|" \
+        -e "s|^includedir=.*|includedir=$out/include|"
+    '';
+
     meta = with stdenv.lib; {
       description = "P2P FOSS instant messaging application aimed to replace Skype";
       homepage = https://tox.chat;
diff --git a/pkgs/development/libraries/libtxc_dxtn/default.nix b/pkgs/development/libraries/libtxc_dxtn/default.nix
index 5ac456a60f6..600b1fb510a 100644
--- a/pkgs/development/libraries/libtxc_dxtn/default.nix
+++ b/pkgs/development/libraries/libtxc_dxtn/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook, libGLU_combined }:
+{ stdenv, fetchurl, autoreconfHook, libGL, libGLU }:
 
 let version = "1.0.1"; in
 
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ autoreconfHook ];
-  buildInputs = [ libGLU_combined ];
+  buildInputs = [ libGL libGLU ];
 
   meta = with stdenv.lib; {
     homepage = http://dri.freedesktop.org/wiki/S3TC;
diff --git a/pkgs/development/libraries/libtxc_dxtn_s2tc/default.nix b/pkgs/development/libraries/libtxc_dxtn_s2tc/default.nix
index 4959674f0ad..f9f44f5a653 100644
--- a/pkgs/development/libraries/libtxc_dxtn_s2tc/default.nix
+++ b/pkgs/development/libraries/libtxc_dxtn_s2tc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook, libGLU_combined }:
+{ stdenv, fetchurl, autoreconfHook, libGL, libGLU }:
 
 let version = "1.0"; in
 
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
   };
 
   nativeBuildInputs = [ autoreconfHook ];
-  buildInputs = [ libGLU_combined ];
+  buildInputs = [ libGL libGLU ];
 
   meta = {
     description = "A patent-free S3TC compatible implementation";
diff --git a/pkgs/development/libraries/liburing/default.nix b/pkgs/development/libraries/liburing/default.nix
index ad8c08b3cce..386354b48e4 100644
--- a/pkgs/development/libraries/liburing/default.nix
+++ b/pkgs/development/libraries/liburing/default.nix
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "Userspace library for the Linux io_uring API";
-    homepage    = http://git.kernel.dk/cgit/liburing/;
+    homepage    = https://git.kernel.dk/cgit/liburing/;
     license     = licenses.lgpl21;
     platforms   = platforms.linux;
     maintainers = with maintainers; [ thoughtpolice ];
diff --git a/pkgs/development/libraries/libusb1/default.nix b/pkgs/development/libraries/libusb1/default.nix
index 9a08a7756c8..9d90304042c 100644
--- a/pkgs/development/libraries/libusb1/default.nix
+++ b/pkgs/development/libraries/libusb1/default.nix
@@ -28,13 +28,8 @@ stdenv.mkDerivation (rec {
 
   NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s";
 
-  configureFlags =
-    # We use `isLinux` here only to avoid mass rebuilds for Darwin, where
-    # disabling udev happens automatically. Remove `isLinux` at next big change!
-    stdenv.lib.optional (stdenv.isLinux && !enableSystemd) "--disable-udev";
-
-  preFixup = stdenv.lib.optionalString enableSystemd ''
-    sed 's,-ludev,-L${systemd.lib}/lib -ludev,' -i $out/lib/libusb-1.0.la
+  preFixup = stdenv.lib.optionalString stdenv.isLinux ''
+    sed 's,-ludev,-L${stdenv.lib.getLib systemd}/lib -ludev,' -i $out/lib/libusb-1.0.la
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/libuv/default.nix b/pkgs/development/libraries/libuv/default.nix
index f9b49a46ebf..524896b8bfd 100644
--- a/pkgs/development/libraries/libuv/default.nix
+++ b/pkgs/development/libraries/libuv/default.nix
@@ -1,14 +1,14 @@
 { stdenv, lib, fetchFromGitHub, autoconf, automake, libtool, pkgconfig, ApplicationServices, CoreServices }:
 
 stdenv.mkDerivation rec {
-  version = "1.32.0";
+  version = "1.34.0";
   pname = "libuv";
 
   src = fetchFromGitHub {
     owner = pname;
     repo = pname;
     rev = "v${version}";
-    sha256 = "1ifazxr5ssw2ay6j66acaxgfwq0x8130fvsyjs1wxvf2r9g4ds9w";
+    sha256 = "0vcrrqf0zqgsfmgbyl45qhajyab98kxqq66l0w4lkj5say86aln8";
   };
 
   postPatch = let
diff --git a/pkgs/development/libraries/libvirt-glib/default.nix b/pkgs/development/libraries/libvirt-glib/default.nix
index 1803ce1dc20..7dd874ebc83 100644
--- a/pkgs/development/libraries/libvirt-glib/default.nix
+++ b/pkgs/development/libraries/libvirt-glib/default.nix
@@ -3,13 +3,13 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "libvirt-glib-2.0.0";
+  name = "libvirt-glib-3.0.0";
 
   outputs = [ "out" "dev" ];
 
   src = fetchurl {
     url = "https://libvirt.org/sources/glib/${name}.tar.gz";
-    sha256 = "0six9ckmvlwwyavyjkgc262qkpvfqgi8rjij7cyk00bmqq8c9s4l";
+    sha256 = "1zpbv4ninc57c9rw4zmmkvvqn7154iv1qfr20kyxn8xplalqrzvz";
   };
 
   nativeBuildInputs = [ pkgconfig intltool vala gobject-introspection ];
diff --git a/pkgs/development/libraries/libvncserver/default.nix b/pkgs/development/libraries/libvncserver/default.nix
index 0a7819743e0..c9adad6f645 100644
--- a/pkgs/development/libraries/libvncserver/default.nix
+++ b/pkgs/development/libraries/libvncserver/default.nix
@@ -1,41 +1,43 @@
-{stdenv, fetchurl, fetchpatch,
- libtool, libjpeg, openssl, zlib, libgcrypt, autoreconfHook, pkgconfig, libpng,
- systemd
+{ stdenv, fetchzip, fetchpatch, cmake
+, libjpeg, openssl, zlib, libgcrypt, libpng
+, systemd
 }:
 
 let
   s = # Generated upstream information
   rec {
-    baseName="libvncserver";
-    version="0.9.11";
-    name="${baseName}-${version}";
-    url="https://github.com/LibVNC/libvncserver/archive/LibVNCServer-${version}.tar.gz";
-    sha256="15189n09r1pg2nqrpgxqrcvad89cdcrca9gx6qhm6akjf81n6g8r";
+    pname = "libvncserver";
+    version = "0.9.12";
+    url = "https://github.com/LibVNC/libvncserver/archive/LibVNCServer-${version}.tar.gz";
+    sha256 = "1226hb179l914919f5nm2mlf8rhaarqbf48aa649p4rwmghyx9vm"; # unpacked archive checksum
   };
 in
 stdenv.mkDerivation {
-  inherit (s) name version;
-  src = fetchurl {
+  inherit (s) pname version;
+  src = fetchzip {
     inherit (s) url sha256;
   };
   patches = [
-    # CVE-2018-7225. Remove with the next release
     (fetchpatch {
-      url = https://salsa.debian.org/debian/libvncserver/raw/master/debian/patches/CVE-2018-7225.patch;
-      sha256 = "1hj1lzxsrdmzzl061vg0ncdpvfmvvkrpk8q12mp70qvszcqa7ja3";
+      name = "CVE-2018-20750.patch";
+      url = "https://github.com/LibVNC/libvncserver/commit/09e8fc02f59f16e2583b34fe1a270c238bd9ffec.patch";
+      sha256 = "004h50786nvjl3y3yazpsi2b767vc9gqrwm1ralj3zgy47kwfhqm";
+    })
+    (fetchpatch {
+      name = "CVE-2019-15681.patch";
+      url = "https://github.com/LibVNC/libvncserver/commit/d01e1bb4246323ba6fcee3b82ef1faa9b1dac82a.patch";
+      sha256 = "0hf0ss7all2m50z2kan4mck51ws44yim4ymn8p0d991y465y6l9s";
     })
   ];
-  preConfigure = ''
-    sed -e 's@/usr/include/linux@${stdenv.cc.libc}/include/linux@g' -i configure
-  '';
-  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  nativeBuildInputs = [ cmake ];
   buildInputs = [
-    libtool libjpeg openssl libgcrypt libpng
+    libjpeg openssl libgcrypt libpng
   ] ++ stdenv.lib.optional stdenv.isLinux systemd;
   propagatedBuildInputs = [ zlib ];
   meta = {
     inherit (s) version;
-    description =  "VNC server library";
+    description = "VNC server library";
+    homepage = "https://libvnc.github.io/";
     license = stdenv.lib.licenses.gpl2Plus ;
     maintainers = [stdenv.lib.maintainers.raskin];
     platforms = stdenv.lib.platforms.unix;
diff --git a/pkgs/development/libraries/libvorbis/default.nix b/pkgs/development/libraries/libvorbis/default.nix
index 5457b1075a3..263fa0a5216 100644
--- a/pkgs/development/libraries/libvorbis/default.nix
+++ b/pkgs/development/libraries/libvorbis/default.nix
@@ -29,6 +29,7 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   meta = with stdenv.lib; {
+    description = "Vorbis audio compression reference implementation";
     homepage = https://xiph.org/vorbis/;
     license = licenses.bsd3;
     maintainers = [ maintainers.ehmry ];
diff --git a/pkgs/development/libraries/libvterm-neovim/default.nix b/pkgs/development/libraries/libvterm-neovim/default.nix
index 231b426e6a7..50ee7e4d387 100644
--- a/pkgs/development/libraries/libvterm-neovim/default.nix
+++ b/pkgs/development/libraries/libvterm-neovim/default.nix
@@ -6,13 +6,13 @@
 
 stdenv.mkDerivation {
   pname = "libvterm-neovim";
-  version = "2019-08-28";
+  version = "2019-10-08";
 
   src = fetchFromGitHub {
     owner = "neovim";
     repo = "libvterm";
-    rev = "1aa95e24d8f07a396aa80b7cd52f93e2b5bcca79";
-    sha256 = "0vjd397lqrfv4kc79i5izva4bynbymx3gllkg281fnk0b15vxfif";
+    rev = "7c72294d84ce20da4c27362dbd7fa4b08cfc91da";
+    sha256 = "111qyxq33x74dwdnqcnzlv9j0n8hxyribd6ppwcsxmyrniyw9qrk";
   };
 
   buildInputs = [ perl ];
diff --git a/pkgs/development/libraries/libwebp/default.nix b/pkgs/development/libraries/libwebp/default.nix
index fc9932567cf..56c3f638d52 100644
--- a/pkgs/development/libraries/libwebp/default.nix
+++ b/pkgs/development/libraries/libwebp/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl
 , threadingSupport ? true # multi-threading
-, openglSupport ? false, freeglut ? null, libGLU_combined ? null # OpenGL (required for vwebp)
+, openglSupport ? false, freeglut ? null, libGL ? null, libGLU ? null # OpenGL (required for vwebp)
 , pngSupport ? true, libpng ? null # PNG image format
 , jpegSupport ? true, libjpeg ? null # JPEG image format
 , tiffSupport ? true, libtiff ? null # TIFF image format
@@ -14,7 +14,7 @@
 , libwebpdecoderSupport ? true # Build libwebpdecoder
 }:
 
-assert openglSupport -> ((freeglut != null) && (libGLU_combined != null));
+assert openglSupport -> freeglut != null && libGL != null && libGLU != null;
 assert pngSupport -> (libpng != null);
 assert jpegSupport -> (libjpeg != null);
 assert tiffSupport -> (libtiff != null);
@@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
   ];
 
   buildInputs = [ ]
-    ++ optionals openglSupport [ freeglut libGLU_combined ]
+    ++ optionals openglSupport [ freeglut libGL libGLU ]
     ++ optional pngSupport libpng
     ++ optional jpegSupport libjpeg
     ++ optional tiffSupport libtiff
diff --git a/pkgs/development/libraries/libwmf/default.nix b/pkgs/development/libraries/libwmf/default.nix
index e7aa5f7ecc9..5c684c7fd77 100644
--- a/pkgs/development/libraries/libwmf/default.nix
+++ b/pkgs/development/libraries/libwmf/default.nix
@@ -6,6 +6,8 @@ stdenv.mkDerivation rec {
   pname = "libwmf";
   version = "0.2.12";
 
+  outputs = [ "out" "dev" ];
+
   src = fetchFromGitHub {
     owner = "caolanm";
     repo = pname;
diff --git a/pkgs/development/libraries/libxl/default.nix b/pkgs/development/libraries/libxl/default.nix
index 8153fb883ca..8618fc80a52 100644
--- a/pkgs/development/libraries/libxl/default.nix
+++ b/pkgs/development/libraries/libxl/default.nix
@@ -2,14 +2,15 @@
 
 stdenv.mkDerivation rec {
   pname = "libxl";
-  version = "3.8.5";
+  version = "3.8.7";
 
   src = fetchurl {
     url = "http://www.libxl.com/download/${pname}-lin-${version}.tar.gz";
-    sha256 = "15n8gxyznk1nm2kgp86hd36rnivjsby9ccl12lyabv6q3fab6fsx";
+    sha256 = "0mfi2mlsgqjw9ki3c5bsb6nr2aqym7s1priw70f69r12azzxfqw3";
   };
 
-  phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
+  dontConfigure = true;
+  dontBuild = true;
 
   installPhase = ''
     mkdir $out
@@ -18,7 +19,8 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with stdenv.lib; {
-    description = "A lbrary for parsing excel files";
+    description = "A library for parsing Excel files";
+    homepage    = "http://www.libxl.com/";
     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 04954f3e1f5..f5dcb3357f7 100644
--- a/pkgs/development/libraries/libxml2/default.nix
+++ b/pkgs/development/libraries/libxml2/default.nix
@@ -1,22 +1,33 @@
 { stdenv, lib, fetchurl
-, zlib, xz, python2, ncurses, findXMLCatalogs
+, zlib, xz, python, ncurses, findXMLCatalogs
 , pythonSupport ? stdenv.buildPlatform == stdenv.hostPlatform
 , icuSupport ? false, icu ? null
 , enableShared ? stdenv.hostPlatform.libc != "msvcrt"
 , enableStatic ? !enableShared,
 }:
 
-let
-  python = python2;
-
-in stdenv.mkDerivation rec {
+stdenv.mkDerivation rec {
   pname = "libxml2";
-  version = "2.9.9";
+  version = "2.9.10";
 
   src = fetchurl {
     url = "http://xmlsoft.org/sources/${pname}-${version}.tar.gz";
-    sha256 = "0wd881jzvqayx0ihzba29jl80k06xj9ywp16kxacdqs3064p1ywl";
+    sha256 = "07xynh8hcxb2yb1fs051xrgszjvj37wnxvxgsj10rzmqzy9y3zma";
   };
+  patches = [
+    # Upstream bugs:
+    #   https://bugzilla.gnome.org/show_bug.cgi?id=789714
+    #   https://gitlab.gnome.org/GNOME/libxml2/issues/64
+    # Patch from https://bugzilla.opensuse.org/show_bug.cgi?id=1065270 ,
+    # but only the UTF-8 part.
+    # Can also be mitigated by fixing malformed XML inputs, such as in
+    # https://gitlab.gnome.org/GNOME/gnumeric/merge_requests/3 .
+    # Other discussion:
+    #   https://github.com/itstool/itstool/issues/22
+    #   https://github.com/NixOS/nixpkgs/pull/63174
+    #   https://github.com/NixOS/nixpkgs/pull/72342
+    ./utf8-xmlErrorFuncHandler.patch
+  ];
 
   outputs = [ "bin" "dev" "out" "man" "doc" ]
     ++ lib.optional pythonSupport "py"
@@ -42,6 +53,12 @@ in stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
+  # disable test that's problematic with newer pythons: see
+  # https://mail.gnome.org/archives/xml/2017-August/msg00014.html
+  preCheck = lib.optionalString (pythonSupport && !(python?pythonOlder && python.pythonOlder "3.5")) ''
+    echo "" > python/tests/tstLastError.py
+  '';
+
   doCheck = (stdenv.hostPlatform == stdenv.buildPlatform) && !stdenv.isDarwin &&
     stdenv.hostPlatform.libc != "musl";
 
diff --git a/pkgs/development/libraries/libxml2/utf8-xmlErrorFuncHandler.patch b/pkgs/development/libraries/libxml2/utf8-xmlErrorFuncHandler.patch
new file mode 100644
index 00000000000..9f4c99b0934
--- /dev/null
+++ b/pkgs/development/libraries/libxml2/utf8-xmlErrorFuncHandler.patch
@@ -0,0 +1,30 @@
+Index: libxml2-2.9.5/python/libxml.c
+===================================================================
+--- libxml2-2.9.5.orig/python/libxml.c
++++ libxml2-2.9.5/python/libxml.c
+@@ -1620,6 +1620,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
+     PyObject *message;
+     PyObject *result;
+     char str[1000];
++    unsigned char *ptr = (unsigned char *)str;
+ 
+ #ifdef DEBUG_ERROR
+     printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
+@@ -1636,10 +1637,16 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
+ 	    str[999] = 0;
+         va_end(ap);
+ 
++#if PY_MAJOR_VERSION >= 3
++        /* Ensure the error string doesn't start at UTF8 continuation. */
++        while (*ptr && (*ptr & 0xc0) == 0x80)
++            ptr++;
++#endif
++
+         list = PyTuple_New(2);
+         PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt);
+         Py_XINCREF(libxml_xmlPythonErrorFuncCtxt);
+-        message = libxml_charPtrConstWrap(str);
++        message = libxml_charPtrConstWrap(ptr);
+         PyTuple_SetItem(list, 1, message);
+         result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list);
+         Py_XDECREF(list);
diff --git a/pkgs/development/libraries/libxmlb/default.nix b/pkgs/development/libraries/libxmlb/default.nix
index 0469cf13b0c..75fffa83d24 100644
--- a/pkgs/development/libraries/libxmlb/default.nix
+++ b/pkgs/development/libraries/libxmlb/default.nix
@@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
 
   passthru = {
     tests = {
-      installed-tests = nixosTests.libxmlb;
+      installed-tests = nixosTests.installed-tests.libxmlb;
     };
   };
 
diff --git a/pkgs/development/libraries/libxslt/default.nix b/pkgs/development/libraries/libxslt/default.nix
index 1a3efee176a..6d12329a7f5 100644
--- a/pkgs/development/libraries/libxslt/default.nix
+++ b/pkgs/development/libraries/libxslt/default.nix
@@ -1,44 +1,26 @@
-{ stdenv, fetchurl, fetchpatch, libxml2, findXMLCatalogs, python2, libgcrypt
+{ stdenv, fetchurl, fetchpatch, libxml2, findXMLCatalogs, python, libgcrypt
 , cryptoSupport ? false
 , pythonSupport ? stdenv.buildPlatform == stdenv.hostPlatform
 }:
 
-assert pythonSupport -> python2 != null;
+assert pythonSupport -> python != null;
 assert pythonSupport -> libxml2.pythonSupport;
 
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
   pname = "libxslt";
-  version = "1.1.33";
+  version = "1.1.34";
 
   src = fetchurl {
     url = "http://xmlsoft.org/sources/${pname}-${version}.tar.gz";
-    sha256 = "1j1q1swnsy8jgi9x7mclvkrqhfgn09886gdlr9wzk7a08i8n0dlf";
+    sha256 = "0zrzz6kjdyavspzik6fbkpvfpbd25r2qg6py5nnjaabrsr3bvccq";
   };
 
-  patches = [
-    (fetchpatch {
-      name = "CVE-2019-11068.patch";
-      url = "https://gitlab.gnome.org/GNOME/libxslt/commit/e03553605b45c88f0b4b2980adfbbb8f6fca2fd6.patch";
-      sha256 = "0pkpb4837km15zgg6h57bncp66d5lwrlvkr73h0lanywq7zrwhj8";
-    })
-    (fetchpatch {
-      url = "https://gitlab.gnome.org/GNOME/libxslt/commit/c5eb6cf3aba0af048596106ed839b4ae17ecbcb1.patch";
-      name = "CVE-2019-13117.patch";
-      sha256 = "0ynfq8y5h623cypj1426iiz7796n3mqbjqa24ndvh2am6rl5lw15";
-    })
-    (fetchpatch {
-      url = "https://gitlab.gnome.org/GNOME/libxslt/commit/6ce8de69330783977dd14f6569419489875fb71b.patch";
-      name = "CVE-2019-13118.patch";
-      sha256 = "0bglz9m9sh2vi50qxcm06iqrazw3h45ycgxnp15iankq95z283iq";
-    })
-  ];
-
   outputs = [ "bin" "dev" "out" "man" "doc" ] ++ stdenv.lib.optional pythonSupport "py";
 
   buildInputs = [ libxml2.dev ]
-    ++ stdenv.lib.optionals pythonSupport [ libxml2.py python2 ]
+    ++ stdenv.lib.optionals pythonSupport [ libxml2.py python ]
     ++ stdenv.lib.optionals cryptoSupport [ libgcrypt ];
 
   propagatedBuildInputs = [ findXMLCatalogs ];
@@ -48,7 +30,7 @@ stdenv.mkDerivation rec {
     "--without-debug"
     "--without-mem-debug"
     "--without-debugger"
-  ] ++ optional pythonSupport "--with-python=${python2}"
+  ] ++ optional pythonSupport "--with-python=${python}"
     ++ optional (!cryptoSupport) "--without-crypto";
 
   postFixup = ''
@@ -58,7 +40,7 @@ stdenv.mkDerivation rec {
   '' + optionalString pythonSupport ''
     mkdir -p $py/nix-support
     echo ${libxml2.py} >> $py/nix-support/propagated-build-inputs
-    moveToOutput lib/python2.7 "$py"
+    moveToOutput ${python.libPrefix} "$py"
   '';
 
   passthru = {
diff --git a/pkgs/development/libraries/libzip/default.nix b/pkgs/development/libraries/libzip/default.nix
index 43a5f7dc841..9f9331b90dd 100644
--- a/pkgs/development/libraries/libzip/default.nix
+++ b/pkgs/development/libraries/libzip/default.nix
@@ -1,37 +1,31 @@
-{ stdenv, fetchurl, perl, zlib }:
+{ stdenv, fetchurl, cmake, perl, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "libzip";
-  version = "1.3.0";
+  version = "1.5.2";
 
   src = fetchurl {
     url = "https://www.nih.at/libzip/${pname}-${version}.tar.gz";
-    sha256 = "1633dvjc08zwwhzqhnv62rjf1abx8y5njmm8y16ik9iwd07ka6d9";
+    sha256 = "05ay8cbm882br0ir2cmzrvdq8q5mr1bnf53l4305xzigpd54lsdy";
   };
 
+  # Fix pkgconfig file paths
   postPatch = ''
-    patchShebangs test-driver
-    patchShebangs man/handle_links
+    sed -i CMakeLists.txt \
+      -e 's#\\''${exec_prefix}/''${CMAKE_INSTALL_LIBDIR}#''${CMAKE_INSTALL_FULL_LIBDIR}#' \
+      -e 's#\\''${prefix}/''${CMAKE_INSTALL_INCLUDEDIR}#''${CMAKE_INSTALL_FULL_INCLUDEDIR}#'
   '';
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ perl ];
+  nativeBuildInputs = [ cmake perl ];
   propagatedBuildInputs = [ zlib ];
 
   preCheck = ''
-    # regress/runtests is a generated file
+    # regress/runtest is a generated file
     patchShebangs regress
   '';
 
-  # At least mysqlWorkbench cannot find zipconf.h; I think also openoffice
-  # had this same problem.  This links it somewhere that mysqlworkbench looks.
-  postInstall = ''
-    mkdir -p $dev/lib
-    mv $out/lib/libzip $dev/lib/libzip
-    ( cd $dev/include ; ln -s ../lib/libzip/include/zipconf.h zipconf.h )
-  '';
-
   meta = with stdenv.lib; {
     homepage = https://www.nih.at/libzip;
     description = "A C library for reading, creating and modifying zip archives";
diff --git a/pkgs/development/libraries/lightstep-tracer-cpp/default.nix b/pkgs/development/libraries/lightstep-tracer-cpp/default.nix
index 7f82d49462c..7fba3f3baa6 100644
--- a/pkgs/development/libraries/lightstep-tracer-cpp/default.nix
+++ b/pkgs/development/libraries/lightstep-tracer-cpp/default.nix
@@ -1,44 +1,35 @@
-{ stdenv, lib, fetchFromGitHub, pkgconfig, protobuf, cmake, zlib
-, opentracing-cpp, enableGrpc ? false
+{ stdenv, lib, fetchFromGitHub, pkgconfig, cmake
+, opentracing-cpp, protobuf, zlib
+, enableGrpc ? false, grpc ? null, openssl ? null, c-ares ? null
 }:
 
-let
-  # be sure to use the right revision based on the submodule!
-  common =
-    fetchFromGitHub {
-      owner = "lightstep";
-      repo = "lightstep-tracer-common";
-      rev = "5fe3bf885bcece14c3c65df06c86c826ba45ad69";
-      sha256 = "1q39a0zaqbnqyhl2hza2xzc44235p65bbkfkzs2981niscmggq8w";
-    };
-
-in
+assert enableGrpc -> grpc != null;
+assert enableGrpc -> openssl != null;
+assert enableGrpc -> c-ares != null;
 
 stdenv.mkDerivation rec {
   pname = "lightstep-tracer-cpp";
-  version = "0.8.1";
+  version = "0.11.0";
 
   src = fetchFromGitHub {
     owner = "lightstep";
-    repo = "lightstep-tracer-cpp";
+    repo = pname;
     rev = "v${version}";
-    sha256 = "1m4kl70lhvy1bsmkdh6bf2fddz5v1ikb27vgi99i2akpq40g4fvf";
+    sha256 = "1x7n3b5i9a0481azy3ymfybjfvr5z0i8wm17d964hsv7ryvnapj0";
   };
 
-  postUnpack = ''
-    cp -r ${common}/* $sourceRoot/lightstep-tracer-common
-  '';
-
-  cmakeFlags = ["-DOPENTRACING_INCLUDE_DIR=${opentracing-cpp}/include" "-DOPENTRACING_LIBRARY=${opentracing-cpp}/lib/libopentracing.so"] ++ lib.optional (!enableGrpc) [ "-DWITH_GRPC=OFF" ];
-
   nativeBuildInputs = [
-    pkgconfig cmake
+    cmake pkgconfig
   ];
 
   buildInputs = [
-    protobuf zlib
+    opentracing-cpp protobuf zlib
+  ] ++ lib.optionals enableGrpc [
+    grpc openssl c-ares c-ares.cmake-config
   ];
 
+  cmakeFlags = lib.optionals (!enableGrpc) [ "-DWITH_GRPC=OFF" ];
+
   meta = with lib; {
     description = "Distributed tracing system built on top of the OpenTracing standard";
     homepage = "https://lightstep.com/";
diff --git a/pkgs/development/libraries/linbox/default.nix b/pkgs/development/libraries/linbox/default.nix
index 70320ead5d1..709a237aed9 100644
--- a/pkgs/development/libraries/linbox/default.nix
+++ b/pkgs/development/libraries/linbox/default.nix
@@ -60,6 +60,6 @@ stdenv.mkDerivation rec {
     license = stdenv.lib.licenses.lgpl21Plus;
     maintainers = [stdenv.lib.maintainers.timokau];
     platforms = stdenv.lib.platforms.unix;
-    homepage = http://linalg.org/;
+    homepage = https://linalg.org/;
   };
 }
diff --git a/pkgs/development/libraries/liquidfun/default.nix b/pkgs/development/libraries/liquidfun/default.nix
index 2df7ef94cf3..74952456e64 100644
--- a/pkgs/development/libraries/liquidfun/default.nix
+++ b/pkgs/development/libraries/liquidfun/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, requireFile, cmake, libGLU_combined, libX11, libXi }:
+{ stdenv, requireFile, cmake, libGLU, libGL, libX11, libXi }:
 
 let 
   sourceInfo = rec {
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
   };
 
   inherit (sourceInfo) name version;
-  buildInputs = [ cmake libGLU_combined libX11 libXi ];
+  buildInputs = [ cmake libGLU libGL libX11 libXi ];
 
   sourceRoot = "liquidfun/Box2D/";
 
diff --git a/pkgs/development/libraries/live555/default.nix b/pkgs/development/libraries/live555/default.nix
index dbebe0af80f..84907a42860 100644
--- a/pkgs/development/libraries/live555/default.nix
+++ b/pkgs/development/libraries/live555/default.nix
@@ -3,14 +3,14 @@
 # Based on https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD
 stdenv.mkDerivation rec {
   pname = "live555";
-  version = "2019.10.20";
+  version = "2019.11.22";
 
   src = fetchurl { # the upstream doesn't provide a stable URL
     urls = [
       "mirror://sourceforge/slackbuildsdirectlinks/live.${version}.tar.gz"
       "https://download.videolan.org/contrib/live555/live.${version}.tar.gz"
     ];
-    sha256 = "085csq31s4kak0sym5y170f82wp542bg1ff3kycanvs8w4d4n9j4";
+    sha256 = "144y2wsfpaclkj7srx85f3y3parzn7vbjmzc2afc62wdsb9gn46d";
   };
 
   postPatch = ''
diff --git a/pkgs/development/libraries/mapnik/default.nix b/pkgs/development/libraries/mapnik/default.nix
index 1feea915c02..53c4594f535 100644
--- a/pkgs/development/libraries/mapnik/default.nix
+++ b/pkgs/development/libraries/mapnik/default.nix
@@ -65,7 +65,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "An open source toolkit for developing mapping applications";
-    homepage = http://mapnik.org;
+    homepage = https://mapnik.org;
     maintainers = with maintainers; [ hrdinka ];
     license = licenses.lgpl21;
     platforms = platforms.all;
diff --git a/pkgs/development/libraries/mbedtls/1.3.nix b/pkgs/development/libraries/mbedtls/1.3.nix
deleted file mode 100644
index 8b8d8cd0be8..00000000000
--- a/pkgs/development/libraries/mbedtls/1.3.nix
+++ /dev/null
@@ -1,34 +0,0 @@
-{ stdenv, fetchurl, perl }:
-
-stdenv.mkDerivation rec {
-  name = "mbedtls-1.3.22";
-
-  src = fetchurl {
-    url = "https://tls.mbed.org/download/${name}-gpl.tgz";
-    sha256 = "0ms4s41z88mz7b6gsnp7jslms4v0115k7gw51i6kx6ng9am43l6y";
-  };
-
-  nativeBuildInputs = [ perl ];
-
-  postPatch = ''
-    patchShebangs .
-  '';
-
-  makeFlags = [
-    "SHARED=1"
-  ];
-
-  installFlags = [
-    "DESTDIR=\${out}"
-  ];
-
-  doCheck = true;
-
-  meta = with stdenv.lib; {
-    homepage = https://tls.mbed.org/;
-    description = "Portable cryptographic and SSL/TLS library, aka polarssl";
-    license = licenses.gpl3;
-    platforms = platforms.all;
-    maintainers = with maintainers; [ fpletz ];
-  };
-}
diff --git a/pkgs/development/libraries/mediastreamer/default.nix b/pkgs/development/libraries/mediastreamer/default.nix
index b482176ff29..ca62391e781 100644
--- a/pkgs/development/libraries/mediastreamer/default.nix
+++ b/pkgs/development/libraries/mediastreamer/default.nix
@@ -1,17 +1,16 @@
 { stdenv, pkgconfig, intltool, alsaLib, libpulseaudio, speex, gsm
-, libopus, ffmpeg, libX11, libXv, libGLU_combined, glew, libtheora, libvpx, SDL, libupnp
+, libopus, ffmpeg, libX11, libXv, libGLU, libGL, glew, libtheora, libvpx, SDL, libupnp
 , ortp, libv4l, libpcap, srtp, fetchFromGitHub, cmake, bctoolbox, doxygen
-, python, libXext, libmatroska, openssl, fetchpatch
+, python, libXext, libmatroska, fetchpatch
 }:
 
 stdenv.mkDerivation rec {
-  baseName = "mediastreamer2";
+  pname = "mediastreamer2";
   version = "2.16.1";
-  name = "${baseName}-${version}";
 
   src = fetchFromGitHub {
     owner = "BelledonneCommunications";
-    repo = baseName;
+    repo = pname;
     rev = version;
     sha256 = "02745bzl2r1jqvdqzyv94fjd4w92zr976la4c4nfvsy52waqah7j";
   };
@@ -29,23 +28,22 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [
     alsaLib libpulseaudio speex gsm libopus
-    ffmpeg libX11 libXv libGLU_combined glew libtheora libvpx SDL libupnp
+    ffmpeg libX11 libXv libGLU libGL glew libtheora libvpx SDL libupnp
     ortp libv4l libpcap srtp bctoolbox libXext libmatroska
-    openssl
   ];
 
   NIX_CFLAGS_COMPILE = [
-    "-DGIT_VERSION=\"v2.14.0\""
+    "-DGIT_VERSION=\"v${version}\""
     "-Wno-error=deprecated-declarations"
     "-Wno-error=cast-function-type"
     "-Wno-error=stringop-truncation"
     "-Wno-error=stringop-overflow"
   ];
-  NIX_LDFLAGS = "-lXext -lssl";
+  NIX_LDFLAGS = "-lXext";
 
   meta = with stdenv.lib; {
     description = "A powerful and lightweight streaming engine specialized for voice/video telephony applications";
-    homepage = http://www.linphone.org/technical-corner/mediastreamer2/overview;
+    homepage = http://www.linphone.org/technical-corner/mediastreamer2;
     license = licenses.gpl2;
     platforms = platforms.linux;
   };
diff --git a/pkgs/development/libraries/mediastreamer/msopenh264.nix b/pkgs/development/libraries/mediastreamer/msopenh264.nix
index 38261bd1e53..f1e9fc30151 100644
--- a/pkgs/development/libraries/mediastreamer/msopenh264.nix
+++ b/pkgs/development/libraries/mediastreamer/msopenh264.nix
@@ -1,23 +1,30 @@
 { stdenv, autoreconfHook, pkgconfig, mediastreamer, openh264
-, fetchgit, cmake
+, fetchurl, fetchpatch, cmake
 }:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   pname = "mediastreamer-openh264";
-  version = "0.0pre20160801";
+  version = "1.2.1";
 
-  src = fetchgit {
-    url = "git://git.linphone.org/msopenh264.git";
-    rev = "4cb4b134bf0f1538fd0c2c928eee2d5388115abc";
-    sha256 = "001km4xy1ifwbg1c19ncc75h867fzfcxy9pxvl4pxqb64169xc1k";
+  src = fetchurl {
+    url = "https://www.linphone.org/releases/sources/plugins/msopenh264/msopenh264-${version}.tar.gz";
+    sha256 = "0rdxgazm52560g52pp6mp3mwx6j1z3h2zyizzfycp8y8zi92fqm8";
   };
 
+  patches = [
+    (fetchpatch {
+      name = "msopenh264-build-with-openh264-v2.patch";
+      url = "https://git.pld-linux.org/?p=packages/mediastreamer-plugin-msopenh264.git;a=blob_plain;f=mediastreamer-plugin-msopenh264-openh264.patch;hb=344b8af379701a7e58b4ffb3cbac1517eff079fd";
+      sha256 = "10c24b0afchx78q28176pd8iz7i1nlf57f6v6lyqxpz60fm5nrcc";
+    })
+  ];
+
   nativeBuildInputs = [ autoreconfHook cmake pkgconfig ];
   buildInputs = [ mediastreamer openh264 ];
 
   meta = with stdenv.lib; {
     description = "H.264 encoder/decoder plugin for mediastreamer2";
-    homepage = http://www.linphone.org/technical-corner/mediastreamer2/overview;
+    homepage = "https://www.linphone.org/technical-corner/mediastreamer2";
     license = licenses.gpl2;
     platforms = platforms.linux;
   };
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index caeb8dba8a6..9582e1bf1bf 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -27,7 +27,7 @@
 with stdenv.lib;
 
 let
-  version = "19.2.1";
+  version = "19.2.7";
   branch  = versions.major version;
 in
 
@@ -42,7 +42,7 @@ stdenv.mkDerivation {
       "ftp://ftp.freedesktop.org/pub/mesa/older-versions/${branch}.x/${version}/mesa-${version}.tar.xz"
       "https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz"
     ];
-    sha256 = "4cc53ca1a8d12c6ff0e5ea44a5213c05c88447ab50d7e28bb350cd29199f01e9";
+    sha256 = "17jp8ghipgz62vqqz5llskxypkcmgf8gnlgnj0pyvnbgi6vryyg3";
   };
 
   prePatch = "patchShebangs .";
diff --git a/pkgs/development/libraries/mesa/stubs.nix b/pkgs/development/libraries/mesa/stubs.nix
index 5cb6ac3d4d1..a53f2dc28e7 100644
--- a/pkgs/development/libraries/mesa/stubs.nix
+++ b/pkgs/development/libraries/mesa/stubs.nix
@@ -51,7 +51,7 @@ stdenv.mkDerivation {
     ln -s ${libglvnd.out}/lib $out/lib
 
     mkdir -p $dev/{,lib/pkgconfig,nix-support}
-    echo "$out" > $dev/nix-support/propagated-build-inputs
+    echo "$out ${libglvnd} ${libglvnd.dev}" > $dev/nix-support/propagated-build-inputs
     ln -s ${mesa.dev}/include $dev/include
 
     genPkgConfig() {
@@ -63,7 +63,7 @@ stdenv.mkDerivation {
     Description: $lib library
     Version: ${mesa.version}
     Libs: -L${libglvnd.out}/lib -l$lib
-    Cflags: -I${mesa.dev}/include
+    Cflags: -I${mesa.dev}/include -I${libglvnd.dev}/include
     EOF
     }
 
diff --git a/pkgs/development/libraries/mimalloc/default.nix b/pkgs/development/libraries/mimalloc/default.nix
index 460be100b16..b3f63ec7e9b 100644
--- a/pkgs/development/libraries/mimalloc/default.nix
+++ b/pkgs/development/libraries/mimalloc/default.nix
@@ -1,37 +1,45 @@
-{ stdenv, fetchFromGitHub, cmake
-, secureBuild ? true
+{ stdenv, fetchFromGitHub, cmake, ninja
+, secureBuild ? false
 }:
 
 let
   soext = stdenv.hostPlatform.extensions.sharedLibrary;
 in
 stdenv.mkDerivation rec {
-  name    = "mimalloc-${version}";
+  pname   = "mimalloc";
   version = "1.1.0";
 
   src = fetchFromGitHub {
     owner  = "microsoft";
-    repo   = "mimalloc";
+    repo   = pname;
     rev    = "refs/tags/v${version}";
     sha256 = "1i8pwzpcmbf7dxncb984xrnczn1737xqhf1jaizlyw0k1hpiam4v";
   };
 
-  nativeBuildInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ninja ];
   enableParallelBuilding = true;
-
   cmakeFlags = stdenv.lib.optional secureBuild [ "-DMI_SECURE=ON" ];
 
   postInstall = ''
+    # first, install headers, that's easy
     mkdir -p $dev
     mv $out/lib/*/include $dev/include
 
-    rm -f $out/lib/libmimalloc*${soext} # weird duplicate
-
-    mv $out/lib/*/libmimalloc*${soext} $out/lib/libmimalloc${soext}
-    mv $out/lib/*/libmimalloc*.a       $out/lib/libmimalloc.a
-    mv $out/lib/*/mimalloc*.o          $out/lib/mimalloc.o
-
-    rm -rf $out/lib/mimalloc-*
+    # move .a and .o files into place
+    mv $out/lib/mimalloc-1.0/libmimalloc*.a           $out/lib/libmimalloc.a
+    mv $out/lib/mimalloc-1.0/mimalloc*.o              $out/lib/mimalloc.o
+
+  '' + (if secureBuild then ''
+    mv $out/lib/mimalloc-1.0/libmimalloc-secure${soext}.1.0 $out/lib/libmimalloc-secure${soext}.1.0
+    ln -sfv $out/lib/libmimalloc-secure${soext}.1.0 $out/lib/libmimalloc-secure${soext}
+    ln -sfv $out/lib/libmimalloc-secure${soext}.1.0 $out/lib/libmimalloc${soext}
+  '' else ''
+    mv $out/lib/mimalloc-1.0/libmimalloc${soext}.1.0 $out/lib/libmimalloc${soext}.1.0
+    ln -sfv $out/lib/libmimalloc${soext}.1.0 $out/lib/libmimalloc${soext}
+  '') + ''
+    # remote duplicate dir. FIXME: try to fix the .cmake file distribution
+    # so we can re-use it for dependencies...
+    rm -rf $out/lib/mimalloc-1.0
   '';
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/minizip/default.nix b/pkgs/development/libraries/minizip/default.nix
index c88a978574a..5ee1f38ca8b 100644
--- a/pkgs/development/libraries/minizip/default.nix
+++ b/pkgs/development/libraries/minizip/default.nix
@@ -10,6 +10,7 @@ stdenv.mkDerivation {
   sourceRoot = "zlib-${zlib.version}/contrib/minizip";
 
   meta = {
+    description = "Compression library implementing the deflate compression method found in gzip and PKZIP";
     inherit (zlib.meta) license homepage;
     platforms = stdenv.lib.platforms.unix;
   };
diff --git a/pkgs/development/libraries/mpich/default.nix b/pkgs/development/libraries/mpich/default.nix
index 2232bfb9a38..21803de5e06 100644
--- a/pkgs/development/libraries/mpich/default.nix
+++ b/pkgs/development/libraries/mpich/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation  rec {
   pname = "mpich";
-  version = "3.3.1";
+  version = "3.3.2";
 
   src = fetchurl {
     url = "https://www.mpich.org/static/downloads/${version}/mpich-${version}.tar.gz";
-    sha256 = "1raism1r4jsx4cybc9ddyr1xkccbxm0l8j3ryrw8kslfkkr1wmgy";
+    sha256 = "1farz5zfx4cd0c3a0wb9pgfypzw0xxql1j1294z1sxslga1ziyjb";
   };
 
   configureFlags = [
diff --git a/pkgs/development/libraries/muparser/default.nix b/pkgs/development/libraries/muparser/default.nix
index d058322660c..4d3fe41dff8 100644
--- a/pkgs/development/libraries/muparser/default.nix
+++ b/pkgs/development/libraries/muparser/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, unzip}:
+{stdenv, fetchurl, unzip, setfile}:
 
 stdenv.mkDerivation rec {
   pname = "muparser";
@@ -10,12 +10,14 @@ stdenv.mkDerivation rec {
     sha256 = "00l92k231yb49wijzkspa2l58mapn6vh2dlxnlg0pawjjfv33s6z";
   };
 
-  buildInputs = [ unzip ];
+  buildInputs = [
+    unzip
+  ] ++ stdenv.lib.optionals stdenv.isDarwin [setfile];
 
   meta = {
     homepage = http://muparser.sourceforge.net;
     description = "An extensible high performance math expression parser library written in C++";
     license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.linux;
+    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
   };
 }
diff --git a/pkgs/development/libraries/mygui/default.nix b/pkgs/development/libraries/mygui/default.nix
index 0907f0174c9..c277b7934b9 100644
--- a/pkgs/development/libraries/mygui/default.nix
+++ b/pkgs/development/libraries/mygui/default.nix
@@ -1,5 +1,5 @@
 {  stdenv, fetchFromGitHub, libX11, unzip, cmake, ois, freetype, libuuid,
-   boost, pkgconfig, withOgre ? false, ogre ? null, libGLU_combined ? null } :
+   boost, pkgconfig, withOgre ? false, ogre ? null, libGL, libGLU ? null } :
 
 let
   renderSystem = if withOgre then "3" else "4";
@@ -17,7 +17,8 @@ in stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ libX11 unzip cmake ois freetype libuuid boost (if withOgre then ogre else libGLU_combined) ];
+  buildInputs = [ libX11 unzip cmake ois freetype libuuid boost ]
+    ++ (if withOgre then [ ogre ] else [libGL libGLU]);
 
   # Tools are disabled due to compilation failures.
   cmakeFlags = [ "-DMYGUI_BUILD_TOOLS=OFF" "-DMYGUI_BUILD_DEMOS=OFF" "-DMYGUI_RENDERSYSTEM=${renderSystem}" ];
diff --git a/pkgs/development/libraries/nanoflann/default.nix b/pkgs/development/libraries/nanoflann/default.nix
index 5c0238fe41e..8480cc868c1 100644
--- a/pkgs/development/libraries/nanoflann/default.nix
+++ b/pkgs/development/libraries/nanoflann/default.nix
@@ -1,24 +1,28 @@
 {stdenv, fetchFromGitHub, cmake}:
 
 stdenv.mkDerivation rec {
-  version = "1.3.0";
+  version = "1.3.1";
   pname = "nanoflann";
   
   src = fetchFromGitHub {
     owner = "jlblancoc";
     repo = "nanoflann";
     rev = "v${version}";
-    sha256 = "1bwdmrz1qygp9qy2nzrp1axa1i4nvm0ljkn6mnhlcvbfsyvhzigv";
+    sha256 = "07vi3yn5y9zk9acdbxy954ghdml15wnyqfizzqwsw8zmc9bf30ih";
   };
 
   buildInputs = [ cmake ];
 
+  cmakeFlags = [
+    "-DBUILD_EXAMPLES=OFF"
+  ];
+
   doCheck = true;
   checkTarget = "test";
 
   meta = {
-    homepage = https://github.com/jlblancoc/nanoflann;
-    license = stdenv.lib.licenses.bsd3;
+    homepage = "https://github.com/jlblancoc/nanoflann";
+    license = stdenv.lib.licenses.bsd2;
     description = "Header only C++ library for approximate nearest neighbor search";
     platforms = stdenv.lib.platforms.unix;
   };
diff --git a/pkgs/development/libraries/nco/default.nix b/pkgs/development/libraries/nco/default.nix
index c842eac4311..7b03c32ada5 100644
--- a/pkgs/development/libraries/nco/default.nix
+++ b/pkgs/development/libraries/nco/default.nix
@@ -1,20 +1,21 @@
-{ stdenv, fetchurl, netcdf, netcdfcxx4, gsl, udunits, antlr, which, curl, flex }:
+{ stdenv, fetchzip, netcdf, netcdfcxx4, gsl, udunits, antlr, which, curl, flex }:
 
 stdenv.mkDerivation rec {
-  version = "4.8.1";
+  version = "4.9.1";
   pname = "nco";
 
-  buildInputs = [ netcdf netcdfcxx4 gsl udunits antlr which curl flex ];
+  nativeBuildInputs = [ flex which ];
+  buildInputs = [ netcdf netcdfcxx4 gsl udunits antlr curl ];
 
-  src = fetchurl {
+  src = fetchzip {
     url = "https://github.com/nco/nco/archive/${version}.tar.gz";
-    sha256 = "0s1ww78p4cb2d9qkr4zs439x4xk3ndq6lv8ps677jrn28vnkzbnx";
+    sha256 = "14r44wi9ina8h8gh5cmkcddxl5ziwv42mv60sp4l5wfmjz5xwa4x";
   };
 
   meta = {
     description = "NetCDF Operator toolkit";
     longDescription = "The NCO (netCDF Operator) toolkit manipulates and analyzes data stored in netCDF-accessible formats, including DAP, HDF4, and HDF5";
-    homepage = http://nco.sourceforge.net/;
+    homepage = "http://nco.sourceforge.net/";
     license = stdenv.lib.licenses.gpl3;
     maintainers = [ stdenv.lib.maintainers.bzizou ];
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix
index 708ba46b42e..540ea71abfb 100644
--- a/pkgs/development/libraries/ncurses/default.nix
+++ b/pkgs/development/libraries/ncurses/default.nix
@@ -141,6 +141,7 @@ stdenv.mkDerivation rec {
     moveToOutput "bin/tset" "$out"
     moveToOutput "bin/captoinfo" "$out"
     moveToOutput "bin/infotocap" "$out"
+    moveToOutput "bin/infocmp" "$out"
   '';
 
   preFixup = lib.optionalString (!stdenv.hostPlatform.isCygwin && !enableStatic) ''
diff --git a/pkgs/development/libraries/ndi/default.nix b/pkgs/development/libraries/ndi/default.nix
new file mode 100644
index 00000000000..fcf9457c691
--- /dev/null
+++ b/pkgs/development/libraries/ndi/default.nix
@@ -0,0 +1,60 @@
+{ stdenv, requireFile, avahi }:
+
+stdenv.mkDerivation rec {
+  pname = "ndi";
+  version = "4";
+
+  src = requireFile rec {
+    name    = "InstallNDISDK_v${version}_Linux.tar.gz";
+    sha256  = "1hac5npyg8nifs9ipj34pkn0zjyx8774x3i3h8znhmijx2j2982p";
+    message = ''
+      In order to use the NDI SDK, you need to comply with NewTek's license and
+      download the Linux version ${version} tarball from:
+
+      ${meta.homepage}
+
+      Once you have downloaded the file, please use the following command and
+      re-run the installation:
+
+      nix-prefetch-url file://\$PWD/${name}
+    '';
+  };
+
+  buildInputs = [ avahi ];
+
+  unpackPhase = ''
+    unpackFile ${src}
+    echo y | ./InstallNDISDK_v4_Linux.sh
+    sourceRoot="NDI SDK for Linux";
+  '';
+
+  installPhase = ''
+    mkdir $out
+    mv bin/x86_64-linux-gnu $out/bin
+    for i in $out/bin/*; do
+      patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$i"
+    done
+    patchelf --set-rpath "${avahi}/lib:${stdenv.cc.libc}/lib" $out/bin/ndi-record
+    mv lib/x86_64-linux-gnu $out/lib
+    for i in $out/lib/*; do
+      if [ -L "$i" ]; then continue; fi
+      patchelf --set-rpath "${avahi}/lib:${stdenv.cc.libc}/lib" "$i"
+    done
+    mv include examples $out/
+    mkdir -p $out/share/doc/${pname}-${version}
+    mv licenses $out/share/doc/${pname}-${version}/licenses
+    mv logos $out/share/doc/${pname}-${version}/logos
+    mv documentation/* $out/share/doc/${pname}-${version}/
+  '';
+
+  # Stripping breaks ndi-record.
+  dontStrip = true;
+
+  meta = with stdenv.lib; {
+    homepage = "https://ndi.tv/sdk/";
+    description = "NDI Software Developer Kit";
+    platforms = ["x86_64-linux"];
+    hydraPlatforms = [];
+    license = licenses.unfree;
+  };
+}
diff --git a/pkgs/development/libraries/netcdf/default.nix b/pkgs/development/libraries/netcdf/default.nix
index 0c597fc4b33..1436fb02127 100644
--- a/pkgs/development/libraries/netcdf/default.nix
+++ b/pkgs/development/libraries/netcdf/default.nix
@@ -9,11 +9,12 @@ let
   mpiSupport = hdf5.mpiSupport;
   mpi = hdf5.mpi;
 in stdenv.mkDerivation rec {
-  name = "netcdf-4.6.1";
+  pname = "netcdf";
+  version = "4.7.3";
 
   src = fetchurl {
-    url = "https://www.unidata.ucar.edu/downloads/netcdf/ftp/${name}.tar.gz";
-    sha256 = "0hi61cdihwwvz5jz1l7yq712j7ca1cj4bhr8x0x7c2vlb1s9biw9";
+    url = "https://www.unidata.ucar.edu/downloads/netcdf/ftp/${pname}-c-${version}.tar.gz";
+    sha256 = "12s4w2s96p51hlsa81lw92w56rdx8i3mk21pz2ydwcamw579z34f";
   };
 
   postPatch = ''
@@ -37,10 +38,14 @@ in stdenv.mkDerivation rec {
       "--enable-netcdf-4"
       "--enable-dap"
       "--enable-shared"
+      "--disable-dap-remote-tests"
   ]
   ++ (stdenv.lib.optionals mpiSupport [ "--enable-parallel-tests" "CC=${mpi}/bin/mpicc" ]);
 
+  doCheck = !mpiSupport;
+
   meta = {
+      description = "Libraries for the Unidata network Common Data Format";
       platforms = stdenv.lib.platforms.unix;
       homepage = https://www.unidata.ucar.edu/software/netcdf/;
       license = {
diff --git a/pkgs/development/libraries/nghttp2/default.nix b/pkgs/development/libraries/nghttp2/default.nix
index d02247196b1..57ed5891275 100644
--- a/pkgs/development/libraries/nghttp2/default.nix
+++ b/pkgs/development/libraries/nghttp2/default.nix
@@ -1,7 +1,9 @@
 { stdenv, fetchurl, pkgconfig
 
 # Optional Dependencies
-, openssl ? null, libev ? null, zlib ? null, c-ares ? null
+, openssl ? null, zlib ? null
+, enableLibEv ? !stdenv.hostPlatform.isWindows, libev ? null
+, enableCAres ? !stdenv.hostPlatform.isWindows, c-ares ? null
 , enableHpack ? false, jansson ? null
 , enableAsioLib ? false, boost ? null
 , enableGetAssets ? false, libxml2 ? null
@@ -18,17 +20,20 @@ let inherit (stdenv.lib) optional; in
 
 stdenv.mkDerivation rec {
   pname = "nghttp2";
-  version = "1.39.2";
+  version = "1.40.0";
 
   src = fetchurl {
     url = "https://github.com/${pname}/${pname}/releases/download/v${version}/${pname}-${version}.tar.bz2";
-    sha256 = "1l51q8xqg7d7y9413z8l0scxgbbl1qkwgq4f09jqb31j492kx8lj";
+    sha256 = "0kyrgd4s2pq51ps5z385kw1hn62m8qp7c4h6im0g4ibrf89qwxc2";
   };
 
   outputs = [ "bin" "out" "dev" "lib" ];
 
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ openssl libev zlib c-ares ]
+  buildInputs = [ openssl ]
+    ++ optional enableLibEv libev
+    ++ [ zlib ]
+    ++ optional enableCAres c-ares
     ++ optional enableHpack jansson
     ++ optional enableAsioLib boost
     ++ optional enableGetAssets libxml2
diff --git a/pkgs/development/libraries/nlohmann_json/default.nix b/pkgs/development/libraries/nlohmann_json/default.nix
index 3a51c2ec72b..43a7cf15c15 100644
--- a/pkgs/development/libraries/nlohmann_json/default.nix
+++ b/pkgs/development/libraries/nlohmann_json/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   pname = "nlohmann_json";
-  version = "3.7.0";
+  version = "3.7.3";
 
   src = fetchFromGitHub {
     owner = "nlohmann";
     repo = "json";
     rev = "v${version}";
-    sha256 = "0v7xih4zjixxxfvkfbs7a8j9qcvpwlsv4vrkbyns3hc7b44nb8ap";
+    sha256 = "04rry1xzis71z5gj1ylcj8b4li5q18zxhcwaviwvi3hx0frzxl9w";
   };
 
   nativeBuildInputs = [ cmake ];
@@ -21,7 +21,9 @@ stdenv.mkDerivation rec {
     "-DJSON_MultipleHeaders=ON"
   ];
 
-  doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
+  # A test cause the build to timeout https://github.com/nlohmann/json/issues/1816
+  #doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
+  doCheck = false;
 
   postInstall = "rm -rf $out/lib64";
 
diff --git a/pkgs/development/libraries/nspr/default.nix b/pkgs/development/libraries/nspr/default.nix
index f5e4843a826..44195ce325b 100644
--- a/pkgs/development/libraries/nspr/default.nix
+++ b/pkgs/development/libraries/nspr/default.nix
@@ -2,7 +2,7 @@
 , CoreServices ? null
 , buildPackages }:
 
-let version = "4.22"; in
+let version = "4.24"; in
 
 stdenv.mkDerivation {
   pname = "nspr";
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "mirror://mozilla/nspr/releases/v${version}/src/nspr-${version}.tar.gz";
-    sha256 = "0c6ljv3bdqhc169srbpjy0cs52xk715p04zy08rcjvl54k6bdr69";
+    sha256 = "1l0ksiny032jijgk0g76wf0kiq673i01izj7jrs2h5d1yq6rm9ch";
   };
 
   patches = [
diff --git a/pkgs/development/libraries/nss/default.nix b/pkgs/development/libraries/nss/default.nix
index ff72d87f3c3..7499750c1f0 100644
--- a/pkgs/development/libraries/nss/default.nix
+++ b/pkgs/development/libraries/nss/default.nix
@@ -5,7 +5,7 @@ let
     url = http://dev.gentoo.org/~polynomial-c/mozilla/nss-3.15.4-pem-support-20140109.patch.xz;
     sha256 = "10ibz6y0hknac15zr6dw4gv9nb5r5z9ym6gq18j3xqx7v7n3vpdw";
   };
-  version = "3.46.1";
+  version = "3.47.1";
   underscoreVersion = builtins.replaceStrings ["."] ["_"] version;
 
 in stdenv.mkDerivation rec {
@@ -14,7 +14,7 @@ in stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://mozilla/security/nss/releases/NSS_${underscoreVersion}_RTM/src/${pname}-${version}.tar.gz";
-    sha256 = "0l9ns44rlkp1bpblplspfbqmyhb8rhvc89y56kqh725rgpny1xrv";
+    sha256 = "1yx68a1ks63s8914zmiz9h1nh0261aqzcblgg1cb4ig33p5x3qqs";
   };
 
   depsBuildBuild = [ buildPackages.stdenv.cc ];
@@ -27,7 +27,8 @@ in stdenv.mkDerivation rec {
   propagatedBuildInputs = [ nspr ];
 
   prePatch = ''
-    xz -d < ${nssPEM} | patch -p1
+    # strip the trailing whitespace from the patch line…
+    xz -d < ${nssPEM} | sed -e '/^-DIRS = builtins $/ s/ $//' | patch -p1
   '';
 
   patches =
diff --git a/pkgs/development/libraries/nss_wrapper/default.nix b/pkgs/development/libraries/nss_wrapper/default.nix
index 79eb4d1e10e..40ee4f890d4 100644
--- a/pkgs/development/libraries/nss_wrapper/default.nix
+++ b/pkgs/development/libraries/nss_wrapper/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, cmake, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "nss_wrapper-1.1.6";
+  name = "nss_wrapper-1.1.7";
 
   src = fetchurl {
     url = "mirror://samba/cwrap/${name}.tar.gz";
-    sha256 = "1hijnwabj4nh0m0a913pq07iqq0bw8qb2zxcv73zbnsaay7pa55h";
+    sha256 = "1pa7gakprkxblxdqbcy2242lk924gvzdgfr5648wb7cslksm7hbq";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/ntl/default.nix b/pkgs/development/libraries/ntl/default.nix
index efb307507a3..10e59c5117c 100644
--- a/pkgs/development/libraries/ntl/default.nix
+++ b/pkgs/development/libraries/ntl/default.nix
@@ -14,11 +14,11 @@ assert withGf2x -> gf2x != null;
 
 stdenv.mkDerivation rec {
   pname = "ntl";
-  version = "11.3.4";
+  version = "11.4.1";
 
   src = fetchurl {
     url = "http://www.shoup.net/ntl/ntl-${version}.tar.gz";
-    sha256 = "0fdy63x6iglp20ypqhkpjj6wqjzpxlyl2wfw2dqlgiy6l6ibm4rd";
+    sha256 = "03k2hb6yn49d1f9cdig2ci7h5ga0x3nb3li60hh19wdqzg28f1m3";
   };
 
   buildInputs = [
diff --git a/pkgs/development/libraries/nuspell/default.nix b/pkgs/development/libraries/nuspell/default.nix
index db542ec93a9..c1f354a1ac9 100644
--- a/pkgs/development/libraries/nuspell/default.nix
+++ b/pkgs/development/libraries/nuspell/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "nuspell";
-  version = "2.3.0";
+  version = "3.0.0";
 
   src = fetchFromGitHub {
     owner = "nuspell";
     repo = "nuspell";
     rev = "v${version}";
-    sha256 = "0n5cajrp1fhk8p54ch3akkd9nl8b9c6wwf25980dhagcdys3vab3";
+    sha256 = "1cyvvf5f92a777qgh00ja43z43j5nhc9dw5l3wvw9j6j9bqc4i8p";
   };
 
   nativeBuildInputs = [ cmake pkgconfig ronn ];
diff --git a/pkgs/development/libraries/ogre/1.10.x.nix b/pkgs/development/libraries/ogre/1.10.x.nix
index d847f447048..b66759524fa 100644
--- a/pkgs/development/libraries/ogre/1.10.x.nix
+++ b/pkgs/development/libraries/ogre/1.10.x.nix
@@ -1,5 +1,5 @@
 { fetchurl, stdenv, lib
-, cmake, libGLU_combined
+, cmake, libGLU, libGL
 , freetype, freeimage, zziplib, xorgproto, libXrandr
 , libXaw, freeglut, libXt, libpng, boost, ois
 , libX11, libXmu, libSM, pkgconfig
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
   enableParallelBuilding = true;
 
   buildInputs =
-   [ cmake libGLU_combined
+   [ cmake libGLU libGL
      freetype freeimage zziplib xorgproto libXrandr
      libXaw freeglut libXt libpng boost ois
      libX11 libXmu libSM pkgconfig
diff --git a/pkgs/development/libraries/ogre/1.9.x.nix b/pkgs/development/libraries/ogre/1.9.x.nix
index 2855d1139c3..ced01580185 100644
--- a/pkgs/development/libraries/ogre/1.9.x.nix
+++ b/pkgs/development/libraries/ogre/1.9.x.nix
@@ -1,5 +1,5 @@
 { fetchFromGitHub, stdenv, lib
-, cmake, libGLU_combined
+, cmake, libGLU, libGL
 , freetype, freeimage, zziplib, xorgproto, libXrandr
 , libXaw, freeglut, libXt, libpng, boost, ois
 , libX11, libXmu, libSM, pkgconfig
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   buildInputs =
-   [ cmake libGLU_combined
+   [ cmake libGLU libGL
      freetype freeimage zziplib xorgproto libXrandr
      libXaw freeglut libXt libpng boost ois
      libX11 libXmu libSM pkgconfig
diff --git a/pkgs/development/libraries/ogre/default.nix b/pkgs/development/libraries/ogre/default.nix
index dc3bf8cf009..235da872392 100644
--- a/pkgs/development/libraries/ogre/default.nix
+++ b/pkgs/development/libraries/ogre/default.nix
@@ -1,5 +1,5 @@
 { fetchurl, stdenv, lib
-, cmake, libGLU_combined
+, cmake, libGLU, libGL
 , freetype, freeimage, zziplib, xorgproto, libXrandr
 , libXaw, freeglut, libXt, libpng, boost, ois
 , libX11, libXmu, libSM, pkgconfig
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   buildInputs =
-   [ cmake libGLU_combined
+   [ cmake libGLU libGL
      freetype freeimage zziplib xorgproto libXrandr
      libXaw freeglut libXt libpng boost ois
      libX11 libXmu libSM pkgconfig
diff --git a/pkgs/development/libraries/olm/default.nix b/pkgs/development/libraries/olm/default.nix
index dd3f83a0130..224c01e2c50 100644
--- a/pkgs/development/libraries/olm/default.nix
+++ b/pkgs/development/libraries/olm/default.nix
@@ -2,18 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "olm";
-  version = "3.0.0";
-
-  meta = {
-    description = "Implements double cryptographic ratchet and Megolm ratchet";
-    license = stdenv.lib.licenses.asl20;
-    homepage = https://matrix.org/git/olm/about;
-    platforms = with stdenv.lib.platforms; darwin ++ linux;
-  };
+  version = "3.1.4";
 
   src = fetchurl {
-    url = "https://matrix.org/git/olm/snapshot/${pname}-${version}.tar.gz";
-    sha256 = "1iivxjk458v9lhqgzp0c4k5azligsh9k3rk6irf9ssj29wzgjm2c";
+    url = "https://matrix.org/git/olm/-/archive/${version}/${pname}-${version}.tar.gz";
+    sha256 = "0f7azjxc77n4ib9nj3cwyk3vhk8r2dsyf7id6nvqyxqxwxn95a8w";
   };
 
   doCheck = true;
@@ -25,4 +18,11 @@ stdenv.mkDerivation rec {
   makeFlags = if stdenv.cc.isClang then [ "CC=cc" ] else null;
 
   installFlags = "PREFIX=$(out)";
+
+  meta = {
+    description = "Implements double cryptographic ratchet and Megolm ratchet";
+    license = stdenv.lib.licenses.asl20;
+    homepage = https://matrix.org/git/olm/about;
+    platforms = with stdenv.lib.platforms; darwin ++ linux;
+  };
 }
diff --git a/pkgs/development/libraries/oniguruma/default.nix b/pkgs/development/libraries/oniguruma/default.nix
index 8a1e1d37c1d..e9041993657 100644
--- a/pkgs/development/libraries/oniguruma/default.nix
+++ b/pkgs/development/libraries/oniguruma/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     homepage = https://github.com/kkos/oniguruma;
     description = "Regular expressions library";
     license = licenses.bsd2;
-    maintainers = with maintainers; [ fuuzetsu ];
+    maintainers = with maintainers; [ ];
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/onnxruntime/default.nix b/pkgs/development/libraries/onnxruntime/default.nix
index b5549c6735f..33bc4c6e82c 100644
--- a/pkgs/development/libraries/onnxruntime/default.nix
+++ b/pkgs/development/libraries/onnxruntime/default.nix
@@ -4,13 +4,13 @@
 
 stdenv.mkDerivation rec {
   pname = "onnxruntime";
-  version = "0.5.0";
+  version = "1.0.0";
 
   src = fetchFromGitHub {
     owner = "microsoft";
     repo = "onnxruntime";
     rev = "v${version}";
-    sha256 = "0s8ylc5xr55490hbz7zn3hnp9dnyp92d320ln8xw5hqkw3mgyr3p";
+    sha256 = "1d28lzrjnq69yl8j9ncxlsxl0bniacn3hnsr9van10zgp527436v";
     # TODO: use nix-versions of grpc, onnx, eigen, googletest, etc.
     # submodules increase src size and compile times significantly
     # not currently feasible due to how integrated cmake build is with git
@@ -43,6 +43,8 @@ stdenv.mkDerivation rec {
     rm -r $out/bin   # ctest runner
   '';
 
+  enableParallelBuilding = true;
+
   meta = with stdenv.lib; {
     description = "Cross-platform, high performance scoring engine for ML models";
     longDescription = ''
@@ -55,6 +57,9 @@ stdenv.mkDerivation rec {
       compatibility.
     '';
     homepage = "https://github.com/microsoft/onnxruntime";
+    changelog = "https://github.com/microsoft/onnxruntime/releases";
+    # https://github.com/microsoft/onnxruntime/blob/master/BUILD.md#architectures
+    platforms = platforms.unix;
     license = licenses.mit;
     maintainers = with maintainers; [ jonringer ];
   };
diff --git a/pkgs/development/libraries/openal-soft/default.nix b/pkgs/development/libraries/openal-soft/default.nix
index 89ac85b752b..76f2861428d 100644
--- a/pkgs/development/libraries/openal-soft/default.nix
+++ b/pkgs/development/libraries/openal-soft/default.nix
@@ -20,6 +20,14 @@ stdenv.mkDerivation rec {
     sha256 = "0b0g0q1c36nfb289xcaaj3cmyfpiswvvgky3qyalsf9n4dj7vnzi";
   };
 
+  # this will make it find its own data files (e.g. HRTF profiles)
+  # without any other configuration
+  patches = [ ./search-out.patch ];
+  postPatch = ''
+    substituteInPlace Alc/helpers.c \
+      --replace "@OUT@" $out
+  '';
+
   nativeBuildInputs = [ cmake ];
 
   buildInputs = []
diff --git a/pkgs/development/libraries/openal-soft/search-out.patch b/pkgs/development/libraries/openal-soft/search-out.patch
new file mode 100644
index 00000000000..0f9c2abad3c
--- /dev/null
+++ b/pkgs/development/libraries/openal-soft/search-out.patch
@@ -0,0 +1,12 @@
+diff -Nuar a/Alc/helpers.c b/Alc/helpers.c
+--- a/Alc/helpers.c	1970-01-01 00:00:01.000000000 +0000
++++ b/Alc/helpers.c	1970-01-01 00:00:02.000000000 +0000
+@@ -951,6 +951,8 @@
+             }
+         }
+ 
++        DirectorySearch("@OUT@/share", ext, &results);
++
+         alstr_reset(&path);
+     }
+ 
diff --git a/pkgs/development/libraries/openbabel/default.nix b/pkgs/development/libraries/openbabel/default.nix
index 26bcf3d20ff..3838e1103ba 100644
--- a/pkgs/development/libraries/openbabel/default.nix
+++ b/pkgs/development/libraries/openbabel/default.nix
@@ -25,6 +25,8 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake pkgconfig ];
 
   meta = {
+    description = "A toolbox designed to speak the many languages of chemical data";
+    homepage = "http://openbabel.org";
     platforms = stdenv.lib.platforms.all;
     maintainers = [ ];
     license = stdenv.lib.licenses.gpl2Plus;
diff --git a/pkgs/development/libraries/openbsm/default.nix b/pkgs/development/libraries/openbsm/default.nix
index 25e7267b3c9..269b0138091 100644
--- a/pkgs/development/libraries/openbsm/default.nix
+++ b/pkgs/development/libraries/openbsm/default.nix
@@ -16,7 +16,8 @@ stdenv.mkDerivation rec {
   configureFlags = [ "ac_cv_file__usr_include_mach_audit_triggers_defs=no" ];
 
   meta = {
-    homepage = http://www.openbsm.org/;
+    description = "An implementation of Sun's Basic Security Module (BSM) security audit API and file format";
+    homepage = "http://www.openbsm.org/";
     platforms = lib.platforms.unix;
     maintainers = with lib.maintainers; [ matthewbauer ];
     license = lib.licenses.bsd2;
diff --git a/pkgs/development/libraries/opencolorio/default.nix b/pkgs/development/libraries/opencolorio/default.nix
index cbd05848173..06eff9d17f3 100644
--- a/pkgs/development/libraries/opencolorio/default.nix
+++ b/pkgs/development/libraries/opencolorio/default.nix
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with stdenv.lib; {
-    homepage = http://opencolorio.org;
+    homepage = https://opencolorio.org;
     description = "A color management framework for visual effects and animation";
     license = licenses.bsd3;
     maintainers = [ maintainers.goibhniu ];
diff --git a/pkgs/development/libraries/opencsg/default.nix b/pkgs/development/libraries/opencsg/default.nix
index 724c0d7c764..cf46077a56c 100644
--- a/pkgs/development/libraries/opencsg/default.nix
+++ b/pkgs/development/libraries/opencsg/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, libGLU_combined, freeglut, glew, libXmu, libXext, libX11
+{stdenv, fetchurl, libGLU, libGL, freeglut, glew, libXmu, libXext, libX11
 , qmake, GLUT, fixDarwinDylibNames }:
 
 stdenv.mkDerivation rec {
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
   buildInputs = [ glew ]
-    ++ stdenv.lib.optionals stdenv.isLinux [ libGLU_combined freeglut libXmu libXext libX11 ]
+    ++ stdenv.lib.optionals stdenv.isLinux [ libGLU libGL freeglut libXmu libXext libX11 ]
     ++ stdenv.lib.optional stdenv.isDarwin GLUT;
 
   doCheck = false;
diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix
index d8946dae095..97df84637ef 100644
--- a/pkgs/development/libraries/opencv/3.x.nix
+++ b/pkgs/development/libraries/opencv/3.x.nix
@@ -9,7 +9,7 @@
 , enableTIFF      ? true, libtiff
 , enableWebP      ? true, libwebp
 , enableEXR ?     !stdenv.isDarwin, openexr, ilmbase
-, enableJPEG2K    ? true, jasper
+, enableJPEG2K    ? false, jasper  # disable jasper by default (many CVE)
 , enableEigen     ? true, eigen
 , enableOpenblas  ? true, openblas
 , enableContrib   ? true
@@ -36,20 +36,20 @@
 }:
 
 let
-  version = "3.4.7";
+  version = "3.4.8";
 
   src = fetchFromGitHub {
     owner  = "opencv";
     repo   = "opencv";
     rev    = version;
-    sha256 = "0r5rrcnqx2lsnr1ja5ij2chb7yk9kkamr4p0ik52sqxydwkv3z50";
+    sha256 = "1dnz3gfj70lm1gbrk8pz28apinlqi2x6nvd6xcy5hs08505nqnjp";
   };
 
   contribSrc = fetchFromGitHub {
     owner  = "opencv";
     repo   = "opencv_contrib";
     rev    = version;
-    sha256 = "1ik6acsmgrx66awf19r2y3ijqvv9xg43gaphwszbiyi0jq3r43yw";
+    sha256 = "0psaa1yx36n34l09zd1y8jxgf8q4jzxd3vn06fqmzwzy85hcqn8i";
   };
 
   # Contrib must be built in order to enable Tesseract support:
diff --git a/pkgs/development/libraries/opencv/4.x.nix b/pkgs/development/libraries/opencv/4.x.nix
index a5eb1029ad9..408368b89c4 100644
--- a/pkgs/development/libraries/opencv/4.x.nix
+++ b/pkgs/development/libraries/opencv/4.x.nix
@@ -9,7 +9,7 @@
 , enableTIFF      ? true, libtiff
 , enableWebP      ? true, libwebp
 , enableEXR ?     !stdenv.isDarwin, openexr, ilmbase
-, enableJPEG2K    ? true, jasper
+, enableJPEG2K    ? false, jasper  # disable jasper by default (many CVE)
 , enableEigen     ? true, eigen
 , enableOpenblas  ? true, openblas
 , enableContrib   ? true
diff --git a/pkgs/development/libraries/opencv/default.nix b/pkgs/development/libraries/opencv/default.nix
index b91a1489eb6..db8a5e5a41b 100644
--- a/pkgs/development/libraries/opencv/default.nix
+++ b/pkgs/development/libraries/opencv/default.nix
@@ -6,7 +6,7 @@
 , enablePNG ? true, libpng
 , enableTIFF ? true, libtiff
 , enableEXR ? (!stdenv.isDarwin), openexr, ilmbase
-, enableJPEG2K ? true, jasper
+, enableJPEG2K ? false, jasper  # disable jasper by default (many CVE)
 , enableFfmpeg ? false, ffmpeg
 , enableGStreamer ? false, gst_all_1
 , enableEigen ? true, eigen
diff --git a/pkgs/development/libraries/openexr/default.nix b/pkgs/development/libraries/openexr/default.nix
index 9eef138c532..328bce35357 100644
--- a/pkgs/development/libraries/openexr/default.nix
+++ b/pkgs/development/libraries/openexr/default.nix
@@ -1,4 +1,5 @@
-{ lib, stdenv, buildPackages, fetchurl, autoconf, automake, libtool, pkgconfig, zlib, ilmbase, }:
+{ lib, stdenv, buildPackages, fetchurl, autoconf, automake, libtool, pkgconfig,
+  zlib, ilmbase, fetchpatch }:
 
 let
   # Doesn't really do anything when not crosscompiling
@@ -16,6 +17,12 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./bootstrap.patch
+    (fetchpatch {
+      name = "CVE-2018-18444.patch";
+      url = "https://github.com/openexr/openexr/commit/1b0f1e5d7dcf2e9d6cbb4e005e803808b010b1e0.patch";
+      sha256 = "0f5m4wdwqqg8wfg7azzsz5yfpdrvws314rd4sqfc74j1g6wrcnqj";
+      stripLen = 1;
+    })
   ];
 
   outputs = [ "bin" "dev" "out" "doc" ];
@@ -48,7 +55,8 @@ stdenv.mkDerivation rec {
   doCheck = false; # fails 1 of 1 tests
 
   meta = with stdenv.lib; {
-    homepage = https://www.openexr.com/;
+    description = "A high dynamic-range (HDR) image file format";
+    homepage = "https://www.openexr.com/";
     license = licenses.bsd3;
     platforms = platforms.all;
   };
diff --git a/pkgs/development/libraries/openexrid-unstable/default.nix b/pkgs/development/libraries/openexrid-unstable/default.nix
index b8a3c4a81e0..92cd343cf6a 100644
--- a/pkgs/development/libraries/openexrid-unstable/default.nix
+++ b/pkgs/development/libraries/openexrid-unstable/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, unzip, re2, openfx, zlib, ilmbase, libGLU_combined, openexr }:
+{ stdenv, fetchFromGitHub, unzip, re2, openfx, zlib, ilmbase, libGLU, libGL, openexr }:
 
 stdenv.mkDerivation {
   pname = "openexrid-unstable";
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
                        -I${openfx.dev}/include/OpenFX
                       '';
 
-  buildInputs = [ unzip re2 openfx zlib ilmbase libGLU_combined openexr ];
+  buildInputs = [ unzip re2 openfx zlib ilmbase libGLU libGL openexr ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/openh264/default.nix b/pkgs/development/libraries/openh264/default.nix
index cd91a132597..fe46d25421a 100644
--- a/pkgs/development/libraries/openh264/default.nix
+++ b/pkgs/development/libraries/openh264/default.nix
@@ -2,25 +2,23 @@
 
 stdenv.mkDerivation rec {
   pname = "openh264";
-  version = "1.8.0";
+  version = "2.0.0";
 
   src = fetchFromGitHub {
     owner = "cisco";
-    repo = "openh264";
+    repo = pname;
     rev = "v${version}";
-    sha256 = "1pl7hpk25nh7lcx1lbbv984gvnim0d6hxf4qfmrjjfjf6w37sjw4";
+    sha256 = "0sa4n4xshmiiv6h767jjq9qxapxxjwwwm3bpcignkxv5xn5sls5r";
   };
 
-  buildInputs = [ nasm ];
+  nativeBuildInputs = [ nasm ];
 
-  installPhase = ''
-    make PREFIX=$out install
-  '';
+  makeFlags = [ "PREFIX=${placeholder "out"}" ];
 
   meta = with stdenv.lib; {
     description = "A codec library which supports H.264 encoding and decoding";
-    homepage = http://www.openh264.org;
-    license = stdenv.lib.licenses.bsd2;
+    homepage = "https://www.openh264.org";
+    license = licenses.bsd2;
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/openscenegraph/default.nix b/pkgs/development/libraries/openscenegraph/default.nix
index 1398e829dd5..b12ca67655b 100644
--- a/pkgs/development/libraries/openscenegraph/default.nix
+++ b/pkgs/development/libraries/openscenegraph/default.nix
@@ -1,8 +1,8 @@
 { stdenv, lib, fetchFromGitHub, cmake, pkgconfig, doxygen,
-  libX11, libXinerama, libXrandr, libGLU_combined,
+  libX11, libXinerama, libXrandr, libGLU, libGL,
   glib, ilmbase, libxml2, pcre, zlib,
   jpegSupport ? true, libjpeg,
-  jasperSupport ? true, jasper,
+  jasperSupport ? false, jasper,  # disable jasper by default (many CVE)
   exrSupport ? false, openexr,
   gifSupport ? true, giflib,
   pngSupport ? true, libpng,
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig cmake doxygen ];
 
   buildInputs = [
-    libX11 libXinerama libXrandr libGLU_combined
+    libX11 libXinerama libXrandr libGLU libGL
     glib ilmbase libxml2 pcre zlib
   ] ++ lib.optional jpegSupport libjpeg
     ++ lib.optional jasperSupport jasper
diff --git a/pkgs/development/libraries/ortp/default.nix b/pkgs/development/libraries/ortp/default.nix
index 8510e897332..68e890e3368 100644
--- a/pkgs/development/libraries/ortp/default.nix
+++ b/pkgs/development/libraries/ortp/default.nix
@@ -1,13 +1,12 @@
 { stdenv, cmake, fetchFromGitHub, bctoolbox }:
 
 stdenv.mkDerivation rec {
-  baseName = "ortp";
+  pname = "ortp";
   version = "1.0.2";
-  name = "${baseName}-${version}";
 
   src = fetchFromGitHub {
     owner = "BelledonneCommunications";
-    repo = baseName;
+    repo = pname;
     rev = version;
     sha256 = "12cwv593bsdnxs0zfcp07vwyk7ghlz2wv7vdbs1ksv293w3vj2rv";
   };
@@ -19,8 +18,8 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "A Real-Time Transport Protocol (RFC3550) stack";
-    homepage = http://www.linphone.org/index.php/eng/code_review/ortp;
-    license = licenses.lgpl21;
+    homepage = https://linphone.org/technical-corner/ortp;
+    license = licenses.gpl2Plus;
     platforms = platforms.all;
   };
 }
diff --git a/pkgs/development/libraries/p11-kit/default.nix b/pkgs/development/libraries/p11-kit/default.nix
index 9ca329c6761..f13ae141a81 100644
--- a/pkgs/development/libraries/p11-kit/default.nix
+++ b/pkgs/development/libraries/p11-kit/default.nix
@@ -4,13 +4,13 @@
 
 stdenv.mkDerivation rec {
   pname = "p11-kit";
-  version = "0.23.16.1";
+  version = "0.23.18.1";
 
   src = fetchFromGitHub {
     owner = "p11-glue";
     repo = pname;
     rev = version;
-    sha256 = "0jr62qkbqxp3iawgksk1qc3gp8p6x09sg5v7xac80ghyfxil15wy";
+    sha256 = "0l4ndipcbikblfjz729zkscvni5lzdzvbvsar2538pylw556rx73";
   };
 
   outputs = [ "out" "dev"];
diff --git a/pkgs/development/libraries/pango/default.nix b/pkgs/development/libraries/pango/default.nix
index 9f1e7d5c2fc..ecb0f16c72c 100644
--- a/pkgs/development/libraries/pango/default.nix
+++ b/pkgs/development/libraries/pango/default.nix
@@ -9,13 +9,13 @@ with stdenv.lib;
 
 let
   pname = "pango";
-  version = "1.43.0";
+  version = "1.44.7";
 in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
-    sha256 = "1lnxldmv1a12dq5h0dlq5jyzl4w75k76dp8cn360x2ijlm9w5h6j";
+    sha256 = "07qvxa2sk90chp1l12han6vxvy098mc37sdqcznyywyv2g6bd9b6";
   };
 
   # FIXME: docs fail on darwin
@@ -26,31 +26,18 @@ in stdenv.mkDerivation rec {
     pkgconfig gobject-introspection gtk-doc docbook_xsl docbook_xml_dtd_43
   ];
   buildInputs = [
-    harfbuzz fribidi
+    fribidi
   ] ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
     ApplicationServices
     Carbon
     CoreGraphics
     CoreText
   ]);
-  propagatedBuildInputs = [ cairo glib libintl ] ++
+  propagatedBuildInputs = [ cairo glib libintl harfbuzz ] ++
     optional x11Support libXft;
 
-  patches = [
-    (fetchpatch {
-      # Add gobject-2 to .pc file
-      url = "https://gitlab.gnome.org/GNOME/pango/commit/546f4c242d6f4fe312de3b7c918a848e5172e18d.patch";
-      sha256 = "1cqhy4xbwx3ad7z5d1ks7smf038b9as8c6qy84rml44h0fgiq4m2";
-    })
-    (fetchpatch {
-      # Fixes CVE-2019-1010238
-      url = "https://gitlab.gnome.org/GNOME/pango/commit/490f8979a260c16b1df055eab386345da18a2d54.diff";
-      sha256 = "1s0qclbaknkx3dkc3n6mlmx3fnhlr2pkncqjkywprpvahmmypr7k";
-    })
-  ];
-
   mesonFlags = [
-    "-Denable_docs=${if stdenv.isDarwin then "false" else "true"}"
+    "-Dgtk_doc=${if stdenv.isDarwin then "false" else "true"}"
   ];
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/pangox-compat/default.nix b/pkgs/development/libraries/pangox-compat/default.nix
deleted file mode 100644
index 1ae2f1b8132..00000000000
--- a/pkgs/development/libraries/pangox-compat/default.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, glib, pango, libX11 }:
-
-stdenv.mkDerivation rec {
-  pname = "pangox-compat";
-  version = "0.0.2";
-
-  src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0ip0ziys6mrqqmz4n71ays0kf5cs1xflj1gfpvs4fgy2nsrr482m";
-  };
-
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ glib pango libX11 ];
-
-  meta = {
-    description = "A compatibility library for pango>1.30.*";
-    homepage = "https://gitlab.gnome.org/Archive/pangox-compat";
-    license = stdenv.lib.licenses.lgpl2Plus;
-    platforms = stdenv.lib.platforms.unix;
-  };
-}
diff --git a/pkgs/development/libraries/partio/default.nix b/pkgs/development/libraries/partio/default.nix
index b08936dd34d..ba042562320 100644
--- a/pkgs/development/libraries/partio/default.nix
+++ b/pkgs/development/libraries/partio/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, unzip, cmake, freeglut, libGLU_combined, zlib, swig, python, doxygen, xorg }:
+{ stdenv, fetchFromGitHub, unzip, cmake, freeglut, libGLU, libGL, zlib, swig, python, doxygen, xorg }:
 
 stdenv.mkDerivation {
   pname = "partio";
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
   outputs = [ "dev" "out" "lib" ];
 
   nativeBuildInputs = [ unzip cmake doxygen ];
-  buildInputs = [ freeglut libGLU_combined zlib swig python xorg.libXi xorg.libXmu ];
+  buildInputs = [ freeglut libGLU libGL zlib swig python xorg.libXi xorg.libXmu ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/pcaudiolib/default.nix b/pkgs/development/libraries/pcaudiolib/default.nix
index 5a02229cb0e..1831d969249 100644
--- a/pkgs/development/libraries/pcaudiolib/default.nix
+++ b/pkgs/development/libraries/pcaudiolib/default.nix
@@ -3,15 +3,15 @@
 , portaudio, alsaLib
 , pulseaudioSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio }:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   pname = "pcaudiolib";
-  version = "2016-07-19";
+  version = "1.1";
 
   src = fetchFromGitHub {
     owner = "rhdunn";
     repo = "pcaudiolib";
-    rev = "4f836ea909bdaa8a6e0e89c587efc745b546b459";
-    sha256 = "0z99nh4ibb9md2cd21762n1dmv6jk988785s1cxd8lsy4hp4pwfa";
+    rev = "${version}";
+    sha256 = "0c55hlqqh0m7bcb3nlgv1s4a22s5bgczr1cakjh3767rjb10khi0";
   };
 
   nativeBuildInputs = [ autoconf automake which libtool pkgconfig ];
diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix
index 2e111240758..cf08f989369 100644
--- a/pkgs/development/libraries/pcre/default.nix
+++ b/pkgs/development/libraries/pcre/default.nix
@@ -29,8 +29,6 @@ in stdenv.mkDerivation {
   ]
     ++ optional (variant != null) "--enable-${variant}";
 
-  buildInputs = optional (stdenv.hostPlatform.libc == "msvcrt") windows.mingw_w64_pthreads;
-
   # https://bugs.exim.org/show_bug.cgi?id=2173
   patches = [ ./stacksize-detection.patch ];
 
diff --git a/pkgs/development/libraries/pcre2/default.nix b/pkgs/development/libraries/pcre2/default.nix
index e27c71314d9..b988c4ea02c 100644
--- a/pkgs/development/libraries/pcre2/default.nix
+++ b/pkgs/development/libraries/pcre2/default.nix
@@ -2,10 +2,10 @@
 
 stdenv.mkDerivation rec {
   pname = "pcre2";
-  version = "10.33";
+  version = "10.34";
   src = fetchurl {
     url = "https://ftp.pcre.org/pub/pcre/${pname}-${version}.tar.bz2";
-    sha256 = "1anqi7vpbfzag7imccrc6di1zl5rl63ab7rfpmajpw6d1kzlsl9m";
+    sha256 = "1jlqnzcz2yi70dm40wyfa9w8is9z2kh4dl8zjnv3vqd9mgzp7i3l";
   };
 
   configureFlags = [
diff --git a/pkgs/development/libraries/phonon/backends/gstreamer.nix b/pkgs/development/libraries/phonon/backends/gstreamer.nix
index ef7633dadaf..d9267827e77 100644
--- a/pkgs/development/libraries/phonon/backends/gstreamer.nix
+++ b/pkgs/development/libraries/phonon/backends/gstreamer.nix
@@ -1,21 +1,13 @@
 { stdenv, lib, fetchurl, cmake, gst_all_1, phonon, pkgconfig
-, extra-cmake-modules, qtbase ? null, qtx11extras ? null, qt4 ? null
-, withQt5 ? false
+, extra-cmake-modules, qttools, qtbase, qtx11extras
 , debug ? false
 }:
 
 with lib;
 
-let
-  v = "4.9.0";
+stdenv.mkDerivation rec {
   pname = "phonon-backend-gstreamer";
-in
-
-assert withQt5 -> qtbase != null;
-assert withQt5 -> qtx11extras != null;
-
-stdenv.mkDerivation {
-  name = "${pname}-${if withQt5 then "qt5" else "qt4"}-${v}";
+  version = "4.10.0";
 
   meta = with stdenv.lib; {
     homepage = https://phonon.kde.org/;
@@ -26,8 +18,8 @@ stdenv.mkDerivation {
   };
 
   src = fetchurl {
-    url = "mirror://kde/stable/phonon/${pname}/${v}/${pname}-${v}.tar.xz";
-    sha256 = "1wc5p1rqglf0n1avp55s50k7fjdzdrhg0gind15k8796w7nfbhyf";
+    url = "mirror://kde/stable/phonon/${pname}/${version}/${pname}-${version}.tar.xz";
+    sha256 = "1wk1ip2w7fkh65zk6rilj314dna0hgsv2xhjmpr5w08xa8sii1y5";
   };
 
   # Hardcode paths to useful plugins so the backend doesn't depend
@@ -52,17 +44,26 @@ stdenv.mkDerivation {
       ''-DGST_PLUGIN_PATH_1_0="${gstPluginPaths}"''
     ];
 
-  buildInputs = with gst_all_1;
-    [ gstreamer gst-plugins-base phonon ]
-    ++ (if withQt5 then [ qtbase qtx11extras ] else [ qt4 ]);
+  buildInputs = with gst_all_1; [
+    gstreamer
+    gst-plugins-base
+    phonon
+    qtbase
+    qtx11extras
+  ];
 
   # cleanup: the build system creates (empty) $out/$out/share/icons (double prefix)
   # if DESTDIR is unset
   DESTDIR="/";
 
-  nativeBuildInputs = [ cmake pkgconfig ] ++ optional withQt5 extra-cmake-modules;
+  nativeBuildInputs = [
+    cmake
+    pkgconfig
+    extra-cmake-modules
+    qttools
+  ];
 
-  cmakeFlags =
-    [ "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}" ]
-    ++ optional withQt5 "-DPHONON_BUILD_PHONON4QT5=ON";
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}"
+  ];
 }
diff --git a/pkgs/development/libraries/phonon/backends/vlc.nix b/pkgs/development/libraries/phonon/backends/vlc.nix
index 98c6be85672..9ed137e4f45 100644
--- a/pkgs/development/libraries/phonon/backends/vlc.nix
+++ b/pkgs/development/libraries/phonon/backends/vlc.nix
@@ -1,22 +1,13 @@
 { stdenv, lib, fetchurl, cmake, phonon, pkgconfig, vlc
-, extra-cmake-modules, qtbase ? null, qtx11extras ? null, qt4 ? null
-, withQt4 ? false
+, extra-cmake-modules, qttools, qtbase, qtx11extras
 , debug ? false
 }:
 
 with lib;
 
-let
-  v = "0.10.2";
+stdenv.mkDerivation rec {
   pname = "phonon-backend-vlc";
-in
-
-assert withQt4 -> qt4 != null;
-assert !withQt4 -> qtbase != null;
-assert !withQt4 -> qtx11extras != null;
-
-stdenv.mkDerivation {
-  name = "${pname}-${if withQt4 then "qt4" else "qt5"}-${v}";
+  version = "0.11.1";
 
   meta = with stdenv.lib; {
     homepage = https://phonon.kde.org/;
@@ -26,17 +17,25 @@ stdenv.mkDerivation {
   };
 
   src = fetchurl {
-    url = "mirror://kde/stable/phonon/${pname}/${v}/${pname}-${v}.tar.xz";
-    sha256 = "163jqq5p9n0yfw2fqk0cqn3c6mqycxsvc4956zhkw5345g81a2a9";
+    url = "mirror://kde/stable/phonon/${pname}/${version}/${pname}-${version}.tar.xz";
+    sha256 = "1vp52i5996khpxs233an7mlrzdji50gcs58ig8nrwfwlgyb1xnfc";
   };
 
-  buildInputs =
-    [ phonon vlc ]
-    ++ (if withQt4 then [ qt4 ] else [ qtbase qtx11extras ]);
-
-  nativeBuildInputs = [ cmake pkgconfig ] ++ optional (!withQt4) extra-cmake-modules;
-
-  cmakeFlags =
-    [ "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}" ]
-    ++ optional (!withQt4) "-DPHONON_BUILD_PHONON4QT5=ON";
+  buildInputs = [
+    phonon
+    vlc
+    qtbase
+    qtx11extras
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    pkgconfig
+    qttools
+    extra-cmake-modules
+  ];
+
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}"
+  ];
 }
diff --git a/pkgs/development/libraries/phonon/default.nix b/pkgs/development/libraries/phonon/default.nix
index dc32c4ebfb0..86e3caaa148 100644
--- a/pkgs/development/libraries/phonon/default.nix
+++ b/pkgs/development/libraries/phonon/default.nix
@@ -1,22 +1,27 @@
-{ stdenv, lib, fetchurl, cmake, libGLU_combined, pkgconfig, libpulseaudio
-, qt4 ? null, extra-cmake-modules ? null, qtbase ? null, qttools ? null
-, withQt5 ? false
-, debug ? false }:
+{ stdenv
+, lib
+, fetchurl
+, cmake
+, libGLU
+, libGL
+, pkgconfig
+, libpulseaudio
+, extra-cmake-modules
+, qtbase
+, qttools
+, debug ? false
+}:
 
 with lib;
 
 let
-  v = "4.10.3";
-
-  soname = if withQt5 then "phonon4qt5" else "phonon";
+  soname = "phonon4qt5";
   buildsystemdir = "share/cmake/${soname}";
 in
 
-assert withQt5 -> qtbase != null;
-assert withQt5 -> qttools != null;
-
-stdenv.mkDerivation {
-  name = "phonon-${if withQt5 then "qt5" else "qt4"}-${v}";
+stdenv.mkDerivation rec {
+  pname = "phonon";
+  version = "4.11.1";
 
   meta = {
     homepage = https://phonon.kde.org/;
@@ -27,25 +32,31 @@ stdenv.mkDerivation {
   };
 
   src = fetchurl {
-    url = "mirror://kde/stable/phonon/${v}/phonon-${v}.tar.xz";
-    sha256 = "15f2vndpqfcivifzl1s07r0wkavpfrjln1p46cwfk85gd5b192rf";
+    url = "mirror://kde/stable/phonon/${version}/phonon-${version}.tar.xz";
+    sha256 = "0bfy8iqmjhlg3ma3iqd3kxjc2zkzpjgashbpf5x17y0dc2i1whxl";
   };
 
-  buildInputs =
-    [ libGLU_combined libpulseaudio ]
-    ++ (if withQt5 then [ qtbase qttools ] else [ qt4 ]);
+  buildInputs = [
+    libGLU
+    libGL
+    libpulseaudio
+    qtbase
+    qttools
+  ];
 
-  nativeBuildInputs =
-    [ cmake pkgconfig ]
-    ++ optional withQt5 extra-cmake-modules;
+  nativeBuildInputs = [
+    cmake
+    pkgconfig
+    extra-cmake-modules
+  ];
 
   outputs = [ "out" "dev" ];
 
   NIX_CFLAGS_COMPILE = "-fPIC";
 
-  cmakeFlags =
-    [ "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}" ]
-    ++ optional withQt5 "-DPHONON_BUILD_PHONON4QT5=ON";
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}"
+  ];
 
   preConfigure = ''
     cmakeFlags+=" -DPHONON_QT_MKSPECS_INSTALL_DIR=''${!outputDev}/mkspecs"
@@ -63,10 +74,8 @@ stdenv.mkDerivation {
     sed -i cmake/FindPhononInternal.cmake \
         -e "/set(INCLUDE_INSTALL_DIR/ c set(INCLUDE_INSTALL_DIR \"''${!outputDev}/include\")"
 
-    ${optionalString withQt5 ''
     sed -i cmake/FindPhononInternal.cmake \
         -e "/set(PLUGIN_INSTALL_DIR/ c set(PLUGIN_INSTALL_DIR \"$qtPluginPrefix/..\")"
-    ''}
 
     sed -i CMakeLists.txt \
         -e "/set(BUILDSYSTEM_INSTALL_DIR/ c set(BUILDSYSTEM_INSTALL_DIR \"''${!outputDev}/${buildsystemdir}\")"
diff --git a/pkgs/development/libraries/physics/apfel/default.nix b/pkgs/development/libraries/physics/apfel/default.nix
index 5302ad21258..4ebfd6fbfa3 100644
--- a/pkgs/development/libraries/physics/apfel/default.nix
+++ b/pkgs/development/libraries/physics/apfel/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, gfortran, lhapdf, python2 }:
+{ stdenv, fetchFromGitHub, gfortran, lhapdf, python2, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "apfel";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "13n5ygbqvskg3qq5n4sff1nbii0li0zf1vqissai7x0hynxgy7p6";
   };
 
-  buildInputs = [ gfortran lhapdf python2 ];
+  buildInputs = [ gfortran lhapdf python2 zlib ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/physics/applgrid/default.nix b/pkgs/development/libraries/physics/applgrid/default.nix
index edda5148068..3e2a53d81dd 100644
--- a/pkgs/development/libraries/physics/applgrid/default.nix
+++ b/pkgs/development/libraries/physics/applgrid/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gfortran, hoppet, lhapdf, root5 }:
+{ stdenv, fetchurl, gfortran, hoppet, lhapdf, root5, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "applgrid";
@@ -9,7 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "1yw9wrk3vjv84kd3j4s1scfhinirknwk6xq0hvj7x2srx3h93q9p";
   };
 
-  buildInputs = [ gfortran hoppet lhapdf root5 ];
+  # For some reason zlib was only needed after bump to gfortran8
+  buildInputs = [ gfortran hoppet lhapdf root5 zlib ];
 
   patches = [
     ./bad_code.patch
diff --git a/pkgs/development/libraries/physics/fastjet-contrib/default.nix b/pkgs/development/libraries/physics/fastjet-contrib/default.nix
new file mode 100644
index 00000000000..2bc5b12dfb7
--- /dev/null
+++ b/pkgs/development/libraries/physics/fastjet-contrib/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl, fastjet }:
+
+stdenv.mkDerivation rec {
+  pname = "fastjet-contrib";
+  version = "1.042";
+
+  src = fetchurl {
+    url = "http://fastjet.hepforge.org/contrib/downloads/fjcontrib-${version}.tar.gz";
+    sha256 = "0cc8dn6g7adj2pgs8hvczg68i3xhlk6978m4gxamgibilf9jw1av";
+  };
+
+  buildInputs = [ fastjet ];
+
+  postPatch = ''
+    for f in Makefile.in */Makefile; do
+      substituteInPlace "$f" --replace "CXX=g++" ""
+    done
+    patchShebangs ./configure ./utils/check.sh ./utils/install-sh
+  '';
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  postBuild = ''
+    make fragile-shared
+  '';
+
+  postInstall = ''
+    make fragile-shared-install
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Third party extensions for FastJet";
+    homepage = "http://fastjet.fr/";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ veprbl ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/development/libraries/physics/geant4/default.nix b/pkgs/development/libraries/physics/geant4/default.nix
index 96715882c23..007e4ad0c32 100644
--- a/pkgs/development/libraries/physics/geant4/default.nix
+++ b/pkgs/development/libraries/physics/geant4/default.nix
@@ -30,7 +30,7 @@
 , libXpm
 
 # For enableQT, enableXM, enableOpenGLX11, enableRaytracerX11.
-, libGLU_combined
+, libGLU, libGL
 , xlibsWrapper
 , libXmu
 }:
@@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
   nativeBuildInputs =  [ cmake ];
-  buildInputs = [ clhep expat zlib libGLU_combined xlibsWrapper libXmu ]
+  buildInputs = [ clhep expat zlib libGLU libGL xlibsWrapper libXmu ]
     ++ stdenv.lib.optionals enableGDML [ xercesc ]
     ++ stdenv.lib.optionals enableXM [ motif ]
     ++ stdenv.lib.optionals enableQT [ qtbase ]
diff --git a/pkgs/development/libraries/physics/herwig/default.nix b/pkgs/development/libraries/physics/herwig/default.nix
index d252e62286b..d52f92d9639 100644
--- a/pkgs/development/libraries/physics/herwig/default.nix
+++ b/pkgs/development/libraries/physics/herwig/default.nix
@@ -2,18 +2,18 @@
 
 stdenv.mkDerivation rec {
   pname = "herwig";
-  version = "7.1.5";
+  version = "7.2.0";
 
   src = fetchurl {
     url = "https://www.hepforge.org/archive/herwig/Herwig-${version}.tar.bz2";
-    sha256 = "0jnrv59zfa41gc37pqr3vaiz5jkh7w0k0alcax37b3mlbsnacr9r";
+    sha256 = "0r5iyai2j99pk9p36g4rp98bxm55zd1ik9kgm2zf5zgpvxfm8csr";
   };
 
   nativeBuildInputs = [ autoconf automake libtool ];
 
   buildInputs = [ boost fastjet gfortran gsl thepeg zlib ]
-    # There is a bug that requires for MMHT PDF's to be presend during the build
-    ++ (with lhapdf.pdf_sets; [ MMHT2014lo68cl MMHT2014nlo68cl ]);
+    # There is a bug that requires for default PDF's to be present during the build
+    ++ (with lhapdf.pdf_sets; [ CT14lo CT14nlo ]);
 
   postPatch = ''
     patchShebangs ./
@@ -25,12 +25,12 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "A multi-purpose particle physics event generator";
-    license     = stdenv.lib.licenses.gpl2;
-    homepage    = https://herwig.hepforge.org/;
-    platforms   = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ veprbl ];
-    broken      = stdenv.isAarch64; # doesn't compile: ignoring return value of 'FILE* freopen...
+    homepage = https://herwig.hepforge.org/;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ veprbl ];
+    platforms = platforms.unix;
+    broken = stdenv.isAarch64; # doesn't compile: ignoring return value of 'FILE* freopen...
   };
 }
diff --git a/pkgs/development/libraries/physics/pythia/default.nix b/pkgs/development/libraries/physics/pythia/default.nix
index 0398175a9a2..c37d4b9d2f1 100644
--- a/pkgs/development/libraries/physics/pythia/default.nix
+++ b/pkgs/development/libraries/physics/pythia/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "pythia";
-  version = "8.243";
+  version = "8.244";
 
   src = fetchurl {
     url = "http://home.thep.lu.se/~torbjorn/pythia8/pythia${builtins.replaceStrings ["."] [""] version}.tgz";
-    sha256 = "0y8w5gdaczg8vdw63rkgjr1dcvqs2clqkdia34p30xcwgm1jgv7q";
+    sha256 = "1jlj9hgmk2gcm5p0zqsiz0dpv9vvj8ip261si7frrwfsk7wq0j73";
   };
 
   buildInputs = [ boost fastjet hepmc2 zlib rsync lhapdf ];
diff --git a/pkgs/development/libraries/physics/qcdnum/default.nix b/pkgs/development/libraries/physics/qcdnum/default.nix
index ad5f994620f..8b002ce8195 100644
--- a/pkgs/development/libraries/physics/qcdnum/default.nix
+++ b/pkgs/development/libraries/physics/qcdnum/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gfortran }:
+{ stdenv, fetchurl, gfortran, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "QCDNUM";
@@ -10,6 +10,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ gfortran ];
+  buildInputs = [ zlib ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/physics/rivet/default.nix b/pkgs/development/libraries/physics/rivet/default.nix
index 914eee5c286..95e44f2364c 100644
--- a/pkgs/development/libraries/physics/rivet/default.nix
+++ b/pkgs/development/libraries/physics/rivet/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fastjet, ghostscript, gsl, hepmc2, imagemagick, less, python2, texlive, yoda, which, makeWrapper }:
+{ stdenv, fetchurl, fetchpatch, fastjet, ghostscript, gsl, hepmc2, imagemagick, less, python2, texlive, yoda, which, makeWrapper }:
 
 stdenv.mkDerivation rec {
   pname = "rivet";
@@ -11,6 +11,10 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./darwin.patch # configure relies on impure sw_vers to -Dunix
+    (fetchpatch {
+      url = "https://phab-files.hepforge.org/file/data/j3ja4jirrdyrovrmnbuh/PHID-FILE-6vnor4aoz3s2ejruisrg/file";
+      sha256 = "0flxv08wcd0m5di75s2zvm015k2k70nqgpcgcbq7m604z26pd6ab";
+    })
   ];
 
   latex = texlive.combine { inherit (texlive)
diff --git a/pkgs/development/libraries/physics/thepeg/default.nix b/pkgs/development/libraries/physics/thepeg/default.nix
index fa293eab350..15c94668581 100644
--- a/pkgs/development/libraries/physics/thepeg/default.nix
+++ b/pkgs/development/libraries/physics/thepeg/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "thepeg";
-  version = "2.1.5";
+  version = "2.2.0";
 
   src = fetchurl {
     url = "https://www.hepforge.org/archive/thepeg/ThePEG-${version}.tar.bz2";
-    sha256 = "1rmmwhk9abn9mc9j3127axjwpvymv21ld4wcivwz01pldkxh06n6";
+    sha256 = "1y7vwsc4zk629np4rpjh7a8qzvyqc2fixnwq98dgdndp2544gqfk";
   };
 
   buildInputs = [ boost fastjet gsl hepmc2 lhapdf rivet zlib ];
@@ -19,11 +19,11 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Toolkit for High Energy Physics Event Generation";
-    license     = stdenv.lib.licenses.gpl2;
-    homepage    = https://herwig.hepforge.org/;
-    platforms   = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ veprbl ];
+    homepage = https://herwig.hepforge.org/;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ veprbl ];
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/plib/default.nix b/pkgs/development/libraries/plib/default.nix
index c9e8c632c7f..bbc5eb21c27 100644
--- a/pkgs/development/libraries/plib/default.nix
+++ b/pkgs/development/libraries/plib/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, fetchpatch, stdenv, libGLU_combined, freeglut, SDL
+{ fetchurl, fetchpatch, stdenv, libGLU, libGL, freeglut, SDL
 , libXi, libSM, libXmu, libXext, libX11 }:
 
 stdenv.mkDerivation rec {
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   ];
 
   propagatedBuildInputs = [
-    libGLU_combined freeglut SDL
+    libGLU libGL freeglut SDL
 
     # The following libs ought to be propagated build inputs of Mesa.
     libXi libSM libXmu libXext libX11
diff --git a/pkgs/development/libraries/polkit/default.nix b/pkgs/development/libraries/polkit/default.nix
index 9fdf53a1372..17163c2206c 100644
--- a/pkgs/development/libraries/polkit/default.nix
+++ b/pkgs/development/libraries/polkit/default.nix
@@ -2,7 +2,7 @@
 , intltool, spidermonkey_60 , gobject-introspection, libxslt, docbook_xsl, dbus
 , docbook_xml_dtd_412, gtk-doc, coreutils
 , useSystemd ? (stdenv.isLinux && !stdenv.hostPlatform.isMusl), systemd, elogind
-, withGnome ? true
+, withIntrospection ? true
 # A few tests currently fail on musl (polkitunixusertest, polkitunixgrouptest, polkitidentitytest segfault).
 # Not yet investigated; it may be due to the "Make netgroup support optional"
 # patch not updating the tests correctly yet, or doing something wrong,
@@ -28,8 +28,9 @@ stdenv.mkDerivation rec {
 
   patches = [
     # Don't use etc/dbus-1/system.d
+    # Upstream MR: https://gitlab.freedesktop.org/polkit/polkit/merge_requests/11
     (fetchpatch {
-      url = "https://gitlab.freedesktop.org/polkit/polkit/merge_requests/11.patch";
+      url = "https://gitlab.freedesktop.org/polkit/polkit/commit/5dd4e22efd05d55833c4634b56e473812b5acbf2.patch";
       sha256 = "17lv7xj5ksa27iv4zpm4zwd4iy8zbwjj4ximslfq3sasiz9kxhlp";
     })
   ] ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
@@ -54,8 +55,9 @@ stdenv.mkDerivation rec {
     ++ [ libxslt docbook_xsl docbook_xml_dtd_412 ]; # man pages
   buildInputs =
     [ expat pam spidermonkey_60 ]
-    ++ (if useSystemd then [systemd] else [elogind])
-    ++ stdenv.lib.optional withGnome gobject-introspection;
+    # On Linux, fall back to elogind when systemd support is off.
+    ++ stdenv.lib.optional stdenv.isLinux (if useSystemd then systemd else elogind)
+    ++ stdenv.lib.optional withIntrospection gobject-introspection;
 
   propagatedBuildInputs = [
     glib # in .pc Requires
@@ -84,7 +86,7 @@ stdenv.mkDerivation rec {
     "--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
     "--with-polkitd-user=polkituser" #TODO? <nixos> config.ids.uids.polkituser
     "--with-os-type=NixOS" # not recognized but prevents impurities on non-NixOS
-    (if withGnome then "--enable-introspection" else "--disable-introspection")
+    (if withIntrospection then "--enable-introspection" else "--disable-introspection")
   ] ++ stdenv.lib.optional (!doCheck) "--disable-test";
 
   makeFlags = [
diff --git a/pkgs/development/libraries/poppler/default.nix b/pkgs/development/libraries/poppler/default.nix
index 523e372996b..eb1e9ec732f 100644
--- a/pkgs/development/libraries/poppler/default.nix
+++ b/pkgs/development/libraries/poppler/default.nix
@@ -7,28 +7,20 @@
 , minimal ? false, suffix ? "glib"
 }:
 
-let # beware: updates often break cups-filters build
-  version = "0.74.0";
+let
   mkFlag = optset: flag: "-DENABLE_${flag}=${if optset then "on" else "off"}";
 in
 stdenv.mkDerivation rec {
   name = "poppler-${suffix}-${version}";
+  version = "0.83.0"; # beware: updates often break cups-filters build
 
   src = fetchurl {
     url = "${meta.homepage}/poppler-${version}.tar.xz";
-    sha256 = "0bvb0yq9zsl2b811j4l4x0vf8g5lgmqbndkb2hvgsrr5639rzq4j";
+    sha256 = "16vr1g5qsqwyxfnyikqw37i04x9zpp45far2x90c7qbijw6nap38";
   };
 
   outputs = [ "out" "dev" ];
 
-  patches = [
-    (fetchpatch {
-      name = "CVE-2019-9959.patch";
-      url = "https://gitlab.freedesktop.org/poppler/poppler/commit/68ef84e5968a4249c2162b839ca6d7975048a557.patch";
-      sha256 = "17a3qs74fnnrhjys23f4aw5y7yfsk5d507jcj4hh1bndqv6dpwg1";
-    })
-  ];
-
   buildInputs = [ libiconv libintl ] ++ lib.optional withData poppler_data;
 
   # TODO: reduce propagation to necessary libs
diff --git a/pkgs/development/libraries/precice/default.nix b/pkgs/development/libraries/precice/default.nix
new file mode 100644
index 00000000000..cdce346fe79
--- /dev/null
+++ b/pkgs/development/libraries/precice/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, cmake, gcc, boost, eigen, libxml2, openmpi, python2, python2Packages }:
+
+stdenv.mkDerivation rec {
+  pname = "precice";
+  version = "1.6.1";
+
+  src = fetchFromGitHub {
+    owner = "precice";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "00631zw6cpm67j35cwad04nwgfcvlxa8p660fwz30pgj2hzdx3d2";
+  };
+
+  preConfigure = ''
+    cmakeFlags="-DBUILD_SHARED_LIBS=ON -DPETSC=off"
+  '';
+
+  nativeBuildInputs = [ cmake gcc ];
+  buildInputs = [ boost eigen libxml2 openmpi python2 python2Packages.numpy ];
+  installPhase = ''
+    mkdir -p $out/lib
+    cp libprecice.so libprecice.so.1.6.1 $out/lib/
+  '';
+
+  meta = {
+    description = "preCICE stands for Precise Code Interaction Coupling Environment";
+    license = with lib.licenses; [ gpl3 ];
+    homepage = "https://www.precice.org/";
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ Scriptkiddi ];
+  };
+}
+
diff --git a/pkgs/development/libraries/prometheus-cpp/default.nix b/pkgs/development/libraries/prometheus-cpp/default.nix
index 6f49db4d206..b047322c35e 100644
--- a/pkgs/development/libraries/prometheus-cpp/default.nix
+++ b/pkgs/development/libraries/prometheus-cpp/default.nix
@@ -10,13 +10,13 @@
 
 stdenv.mkDerivation rec {
   pname = "prometheus-cpp";
-  version = "0.7.0";
+  version = "0.8.0";
 
   src = fetchFromGitHub {
     owner = "jupp0r";
     repo = pname;
     rev = "v${version}";
-    sha256 = "15bda1q1jbvixbx1qf41ykcdmsywhhwmi4xgsha12r5m9fh8jzxj";
+    sha256 = "0j12ir8skw3y2q8n743zql4ddp7v1j4h030pjcsqn0xqrqw7m5hg";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/protobuf/3.11.nix b/pkgs/development/libraries/protobuf/3.11.nix
new file mode 100644
index 00000000000..7e89463aad6
--- /dev/null
+++ b/pkgs/development/libraries/protobuf/3.11.nix
@@ -0,0 +1,6 @@
+{ callPackage, ... }:
+
+callPackage ./generic-v3.nix {
+  version = "3.11.1";
+  sha256 = "1mq8dp94mlp72ri27bgvc2i370r8kfig87wfai7vxjdnh3vng0y1";
+}
diff --git a/pkgs/development/libraries/protolock/default.nix b/pkgs/development/libraries/protolock/default.nix
index a36e9e0fd0d..f1eb3ae51f3 100644
--- a/pkgs/development/libraries/protolock/default.nix
+++ b/pkgs/development/libraries/protolock/default.nix
@@ -2,16 +2,16 @@
 
 buildGoModule rec {
   pname = "protolock";
-  version = "0.14.1";
+  version = "0.15.0";
 
   src = fetchFromGitHub {
     owner = "nilslice";
     repo = "protolock";
     rev = "v${version}";
-    sha256 = "0assk7hp9s3m7zm5i1v0pggz00a54yf2w3y0b8mlq5v51y2h8h2z";
+    sha256 = "0qg26vcqdhgy91p6wiv16dq73ay0fymran3d8ylca9264zwi2vxw";
   };
 
-  modSha256 = "079hbv0f8k5lljrb1cr9568wq8sb9yry9smgbrji19yavd9fzcmh";
+  modSha256 = "1q755ipqsfpr41s5fxzmx50lwcdqc5a7akwx6mzn789w2z07x8lg";
 
   postInstall = ''
     rm $out/bin/plugin*
diff --git a/pkgs/development/libraries/pybind11/default.nix b/pkgs/development/libraries/pybind11/default.nix
deleted file mode 100644
index 7dfbdc4d64a..00000000000
--- a/pkgs/development/libraries/pybind11/default.nix
+++ /dev/null
@@ -1,47 +0,0 @@
-{ stdenv, fetchurl, fetchFromGitHub, cmake, catch, python, eigen }:
-
-stdenv.mkDerivation rec {
-  pname = "pybind";
-  version = "2.2.4";
-
-  src = fetchFromGitHub {
-    owner = "pybind";
-    repo = "pybind11";
-    rev = "v${version}";
-    sha256 = "0pa79ymcasv8br5ifbx7878id5py2jpjac3i20cqxr6gs9l6ivlv";
-  };
-
-  nativeBuildInputs = [ cmake ];
-  checkInputs = with python.pkgs; [ catch eigen pytest numpy scipy ];
-
-  # Disable test_cmake_build test, as it fails in sandbox
-  # https://github.com/pybind/pybind11/issues/1355
-  patches = [
-    ./no_test_cmake_build.patch
-    (fetchurl { # Remove on bump to v2.2.5
-      name = "pytest_namespace_to_configure.patch";
-      url = "https://github.com/pybind/pybind11/commit/e7ef34f23f194cfa40bdbf967c6d34712261a4ee.patch";
-      sha256 = "1dhv6p0b5fxzxc8j3sfy8kvfmdshczk22xfxh6bk0cfnfdy9iqrq";
-    })
-  ];
-
-  doCheck = true;
-
-  cmakeFlags = [ 
-    "-DPYTHON_EXECUTABLE=${python.interpreter}" 
-    "-DPYBIND11_TEST=${if doCheck then "ON" else "OFF"}"
-  ];
-
-  meta = {
-    homepage = https://github.com/pybind/pybind11;
-    description = "Seamless operability between C++11 and Python";
-    longDescription = ''
-      Pybind11 is a lightweight header-only library that exposes
-      C++ types in Python and vice versa, mainly to create Python
-      bindings of existing C++ code.
-    '';
-    platforms = with stdenv.lib.platforms; unix;
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = with stdenv.lib.maintainers; [ yuriaisaka ];
-  };
-}
diff --git a/pkgs/development/libraries/pybind11/no_test_cmake_build.patch b/pkgs/development/libraries/pybind11/no_test_cmake_build.patch
deleted file mode 100644
index c5d6ecc4481..00000000000
--- a/pkgs/development/libraries/pybind11/no_test_cmake_build.patch
+++ /dev/null
@@ -1,7 +0,0 @@
---- a/tests/CMakeLists.txt	2019-01-28 14:13:55.822119328 +0100
-+++ b/tests/CMakeLists.txt	2019-01-28 14:14:06.741161928 +0100
-@@ -233,4 +233,3 @@
- add_subdirectory(test_embed)
- 
- # Test CMake build using functions and targets from subdirectory or installed location
--add_subdirectory(test_cmake_build)
diff --git a/pkgs/development/libraries/qgnomeplatform/default.nix b/pkgs/development/libraries/qgnomeplatform/default.nix
index 94c69a4a14b..3626e15cfc7 100644
--- a/pkgs/development/libraries/qgnomeplatform/default.nix
+++ b/pkgs/development/libraries/qgnomeplatform/default.nix
@@ -1,14 +1,14 @@
-{ mkDerivation, lib, fetchFromGitHub, pkgconfig, gtk3, qtbase, qmake }:
+{ mkDerivation, lib, fetchFromGitHub, pkgconfig, gtk3, qtbase, qmake, qtx11extras, pantheon }:
 
 mkDerivation rec {
   pname = "qgnomeplatform";
-  version = "0.5";
+  version = "0.6.0";
 
   src = fetchFromGitHub {
     owner = "FedoraQt";
     repo = "QGnomePlatform";
     rev = version;
-    sha256 = "01ncj21cxd5p7pch6p3zbhv5wp0dgn9vy5hrw54g49fmqnbb1ymz";
+    sha256 = "0fb1mzs6sx76bl7f0z2xhc0jq6y1c55jrw1v3na8577is6g5ji0a";
   };
 
   nativeBuildInputs = [
@@ -19,14 +19,23 @@ mkDerivation rec {
   buildInputs = [
     gtk3
     qtbase
+    qtx11extras
   ];
 
   postPatch = ''
     # Fix plugin dir
-    substituteInPlace qgnomeplatform.pro \
+    substituteInPlace decoration/decoration.pro \
+      --replace "\$\$[QT_INSTALL_PLUGINS]" "$out/$qtPluginPrefix"
+    substituteInPlace theme/theme.pro \
       --replace "\$\$[QT_INSTALL_PLUGINS]" "$out/$qtPluginPrefix"
   '';
 
+  passthru = {
+    updateScript = pantheon.updateScript {
+      attrPath = pname;
+    };
+  };
+
   meta = with lib; {
     description = "QPlatformTheme for a better Qt application inclusion in GNOME";
     homepage = https://github.com/FedoraQt/QGnomePlatform;
diff --git a/pkgs/development/libraries/qpdf/default.nix b/pkgs/development/libraries/qpdf/default.nix
index 5cdde468416..68362be596b 100644
--- a/pkgs/development/libraries/qpdf/default.nix
+++ b/pkgs/development/libraries/qpdf/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, libjpeg, zlib, perl }:
 
-let version = "9.0.2";
+let version = "9.1.0";
 in
 stdenv.mkDerivation rec {
   pname = "qpdf";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://sourceforge/qpdf/qpdf/${version}/${pname}-${version}.tar.gz";
-    sha256 = "0b6jhhsifgiwrznxxi3h7hqm7bi91wph65jjbvs4g2860vcm296h";
+    sha256 = "0ygd80wxcmh613n04x2kmf8wlsl0drxyd5wwdcrm1rzj0xwvpfrs";
   };
 
   nativeBuildInputs = [ perl ];
diff --git a/pkgs/development/libraries/qt-3/default.nix b/pkgs/development/libraries/qt-3/default.nix
index a46dcec0312..98519ae294a 100644
--- a/pkgs/development/libraries/qt-3/default.nix
+++ b/pkgs/development/libraries/qt-3/default.nix
@@ -8,7 +8,7 @@
 , mysqlSupport ? false, libmysqlclient ? null
 , libGLSupported ? stdenv.lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
 , openglSupport ? stdenv.lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
-, libGLU_combined ? null, libXmu ? null
+, libGL ? null, libGLU ? null, libXmu ? null
 , xlibsWrapper, xorgproto, zlib, libjpeg, libpng, which
 }:
 
@@ -17,7 +17,7 @@ assert xrenderSupport -> xftSupport && libXrender != null;
 assert xrandrSupport -> libXrandr != null;
 assert cursorSupport -> libXcursor != null;
 assert mysqlSupport -> libmysqlclient != null;
-assert openglSupport -> libGLU_combined != null && libXmu != null;
+assert openglSupport -> libGL != null && libGLU != null && libXmu != null;
 
 stdenv.mkDerivation {
   name = "qt-3.3.8";
@@ -51,7 +51,7 @@ stdenv.mkDerivation {
     (mk xftSupport "xft")
   ] ++ stdenv.lib.optionals openglSupport [
     "-dlopen-opengl"
-    "-L${libGLU_combined}/lib" "-I${libGLU_combined}/include"
+    "-L${libGL}/lib" "-I${libGLU}/include"
     "-L${libXmu.out}/lib" "-I${libXmu.dev}/include"
   ] ++ stdenv.lib.optionals xrenderSupport [
     "-L${libXrender.out}/lib" "-I${libXrender.dev}/include"
diff --git a/pkgs/development/libraries/qt-5/5.11/fetch.sh b/pkgs/development/libraries/qt-5/5.11/fetch.sh
deleted file mode 100644
index 2ab3dd71c24..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/fetch.sh
+++ /dev/null
@@ -1 +0,0 @@
-WGET_ARGS=( http://download.qt.io/official_releases/qt/5.11/5.11.3/submodules/ )
diff --git a/pkgs/development/libraries/qt-5/5.11/qtbase-fixguicmake.patch b/pkgs/development/libraries/qt-5/5.11/qtbase-fixguicmake.patch
deleted file mode 100644
index 8b46d432812..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtbase-fixguicmake.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
-index 0bbc871..3673634 100644
---- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
-+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
-@@ -286,7 +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})
- 
--        set(imported_location \"$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
-+        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}
-diff --git a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in b/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
-index 5baf0fd..3583745 100644
---- a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
-+++ b/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 \"$${CMAKE_PLUGIN_DIR}$${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 \"$${CMAKE_PLUGIN_DIR}$${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.11/qtbase.patch b/pkgs/development/libraries/qt-5/5.11/qtbase.patch
deleted file mode 100644
index 7d8407f6daf..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtbase.patch
+++ /dev/null
@@ -1,1106 +0,0 @@
-diff -ur qtbase-everywhere-src-5.11.3-orig/mkspecs/common/mac.conf qtbase-everywhere-src-5.11.3/mkspecs/common/mac.conf
---- qtbase-everywhere-src-5.11.3-orig/mkspecs/common/mac.conf	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/mkspecs/common/mac.conf	2019-01-31 00:42:55.843577249 +0100
-@@ -23,7 +23,7 @@
- 
- 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 -ur qtbase-everywhere-src-5.11.3-orig/mkspecs/features/create_cmake.prf qtbase-everywhere-src-5.11.3/mkspecs/features/create_cmake.prf
---- qtbase-everywhere-src-5.11.3-orig/mkspecs/features/create_cmake.prf	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/mkspecs/features/create_cmake.prf	2019-01-31 00:42:55.843577249 +0100
-@@ -21,7 +21,7 @@
- # 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
-@@ -51,45 +51,20 @@
-         $$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
- 
--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_BIN_DIR = $$NIX_OUTPUT_BIN/bin/
-+CMAKE_BIN_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_LIB_DIR = $$NIX_OUTPUT_OUT/lib/
-+CMAKE_LIB_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
--}
--
--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_PLUGIN_DIR = $$NIX_OUTPUT_PLUGIN/
-+CMAKE_PLUGIN_DIR_IS_ABSOLUTE = True
-+ 
-+CMAKE_DLL_DIR = $$NIX_OUTPUT_OUT/lib/
-+CMAKE_DLL_DIR_IS_ABSOLUTE = True
- 
- static|staticlib:CMAKE_STATIC_TYPE = true
- 
-@@ -169,7 +144,7 @@
-       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()
-@@ -316,7 +291,7 @@
-     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 -ur qtbase-everywhere-src-5.11.3-orig/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in qtbase-everywhere-src-5.11.3/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
---- qtbase-everywhere-src-5.11.3-orig/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in	2019-01-31 00:42:55.843577249 +0100
-@@ -3,30 +3,6 @@
-     message(FATAL_ERROR \"Qt 5 $${CMAKE_MODULE_NAME} module requires at least CMake version 3.1.0\")
- 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)")
-@@ -52,11 +28,7 @@
- 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}\"
-@@ -69,11 +41,7 @@
-     )
- 
- !!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
-@@ -89,24 +57,13 @@
- !!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 \"\")
-@@ -122,7 +79,6 @@
-     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
-@@ -269,25 +225,13 @@
- !!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()
-@@ -306,25 +250,13 @@
- !!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()
-@@ -343,11 +275,7 @@
-     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 -ur qtbase-everywhere-src-5.11.3-orig/mkspecs/features/mac/default_post.prf qtbase-everywhere-src-5.11.3/mkspecs/features/mac/default_post.prf
---- qtbase-everywhere-src-5.11.3-orig/mkspecs/features/mac/default_post.prf	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/mkspecs/features/mac/default_post.prf	2019-01-31 00:45:14.585621324 +0100
-@@ -62,199 +62,3 @@
-         }
-     }
- }
--
--# 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 {
--    qmake_pkginfo_typeinfo.name = QMAKE_PKGINFO_TYPEINFO
--    !isEmpty(QMAKE_PKGINFO_TYPEINFO): \
--        qmake_pkginfo_typeinfo.value = $$QMAKE_PKGINFO_TYPEINFO
--    else: \
--        qmake_pkginfo_typeinfo.value = "????"
--    QMAKE_MAC_XCODE_SETTINGS += qmake_pkginfo_typeinfo
--
--    !isEmpty(VERSION) {
--        l = $$split(VERSION, '.') 0 0  # make sure there are at least three
--        VER_MAJ = $$member(l, 0, 0)
--        VER_MIN = $$member(l, 1, 1)
--        VER_PAT = $$member(l, 2, 2)
--        unset(l)
--
--        qmake_full_version.name = QMAKE_FULL_VERSION
--        qmake_full_version.value = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT}
--        QMAKE_MAC_XCODE_SETTINGS += qmake_full_version
--
--        qmake_short_version.name = QMAKE_SHORT_VERSION
--        qmake_short_version.value = $${VER_MAJ}.$${VER_MIN}
--        QMAKE_MAC_XCODE_SETTINGS += qmake_short_version
--    }
--
--    !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()
--
--xcode_product_bundle_identifier_setting.name = PRODUCT_BUNDLE_IDENTIFIER
--xcode_product_bundle_identifier_setting.value = $$QMAKE_TARGET_BUNDLE_PREFIX
--isEmpty(xcode_product_bundle_identifier_setting.value): \
--    xcode_product_bundle_identifier_setting.value = "com.yourcompany"
--xcode_product_bundle_target = $$QMAKE_BUNDLE
--isEmpty(xcode_product_bundle_target): \
--    xcode_product_bundle_target = ${PRODUCT_NAME:rfc1034identifier}
--xcode_product_bundle_identifier_setting.value = "$${xcode_product_bundle_identifier_setting.value}.$${xcode_product_bundle_target}"
--QMAKE_MAC_XCODE_SETTINGS += xcode_product_bundle_identifier_setting
-Only in qtbase-everywhere-src-5.11.3/mkspecs/features/mac: default_post.prf.orig
-diff -ur qtbase-everywhere-src-5.11.3-orig/mkspecs/features/mac/default_pre.prf qtbase-everywhere-src-5.11.3/mkspecs/features/mac/default_pre.prf
---- qtbase-everywhere-src-5.11.3-orig/mkspecs/features/mac/default_pre.prf	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/mkspecs/features/mac/default_pre.prf	2019-01-31 00:42:55.843577249 +0100
-@@ -1,60 +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
--
--xcode_copy_phase_strip_setting.name = COPY_PHASE_STRIP
--xcode_copy_phase_strip_setting.value = NO
--QMAKE_MAC_XCODE_SETTINGS += xcode_copy_phase_strip_setting
-diff -ur qtbase-everywhere-src-5.11.3-orig/mkspecs/features/mac/sdk.prf qtbase-everywhere-src-5.11.3/mkspecs/features/mac/sdk.prf
---- qtbase-everywhere-src-5.11.3-orig/mkspecs/features/mac/sdk.prf	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/mkspecs/features/mac/sdk.prf	2019-01-31 00:42:55.843577249 +0100
-@@ -1,58 +1 @@
- 
--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"): \
--        infoarg = --show-sdk-path
--    equals(info, "PlatformPath"): \
--        infoarg = --show-sdk-platform-path
--    equals(info, "SDKVersion"): \
--        infoarg = --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 $$infoarg 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(infoarg, "--show-sdk-platform-path")): \
--            error("Could not resolve SDK $$info for \'$$sdk\' using $$infoarg")
--        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 QMAKE_LINK_C QMAKE_LINK_C_SHLIB)) {
--    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 -ur qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qml_module.prf qtbase-everywhere-src-5.11.3/mkspecs/features/qml_module.prf
---- qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qml_module.prf	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/mkspecs/features/qml_module.prf	2019-01-31 00:42:55.843577249 +0100
-@@ -23,13 +23,8 @@
- 
- 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 -ur qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qml_plugin.prf qtbase-everywhere-src-5.11.3/mkspecs/features/qml_plugin.prf
---- qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qml_plugin.prf	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/mkspecs/features/qml_plugin.prf	2019-01-31 00:42:55.844577264 +0100
-@@ -48,13 +48,8 @@
- 
- 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 -ur qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qt_app.prf qtbase-everywhere-src-5.11.3/mkspecs/features/qt_app.prf
---- qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qt_app.prf	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/mkspecs/features/qt_app.prf	2019-01-31 00:42:55.844577264 +0100
-@@ -33,7 +33,7 @@
-     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 -ur qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qt_build_paths.prf qtbase-everywhere-src-5.11.3/mkspecs/features/qt_build_paths.prf
---- qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qt_build_paths.prf	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/mkspecs/features/qt_build_paths.prf	2019-01-31 00:42:55.844577264 +0100
-@@ -24,6 +24,6 @@
- !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
- }
-Only in qtbase-everywhere-src-5.11.3/mkspecs/features: qt_build_paths.prf.orig
-diff -ur qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qt_common.prf qtbase-everywhere-src-5.11.3/mkspecs/features/qt_common.prf
---- qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qt_common.prf	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/mkspecs/features/qt_common.prf	2019-01-31 00:42:55.844577264 +0100
-@@ -32,8 +32,8 @@
-         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 -ur qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qt_docs.prf qtbase-everywhere-src-5.11.3/mkspecs/features/qt_docs.prf
---- qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qt_docs.prf	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/mkspecs/features/qt_docs.prf	2019-01-31 00:42:55.844577264 +0100
-@@ -45,7 +45,7 @@
- 
- 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 += -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 @@
-     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 -ur qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qt_example_installs.prf qtbase-everywhere-src-5.11.3/mkspecs/features/qt_example_installs.prf
---- qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qt_example_installs.prf	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/mkspecs/features/qt_example_installs.prf	2019-01-31 00:42:55.844577264 +0100
-@@ -88,7 +88,7 @@
-     $$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 -ur qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qt_functions.prf qtbase-everywhere-src-5.11.3/mkspecs/features/qt_functions.prf
---- qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qt_functions.prf	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/mkspecs/features/qt_functions.prf	2019-01-31 00:42:55.844577264 +0100
-@@ -69,7 +69,7 @@
- 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 -ur qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qt_installs.prf qtbase-everywhere-src-5.11.3/mkspecs/features/qt_installs.prf
---- qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qt_installs.prf	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/mkspecs/features/qt_installs.prf	2019-01-31 00:42:55.844577264 +0100
-@@ -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 {
-     gen_headers.files = $$SYNCQT.GENERATED_HEADER_FILES
--    gen_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME
-+    gen_headers.path = $$NIX_OUTPUT_DEV/include/$$MODULE_INCNAME
-     INSTALLS += gen_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 -ur qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qt_plugin.prf qtbase-everywhere-src-5.11.3/mkspecs/features/qt_plugin.prf
---- qtbase-everywhere-src-5.11.3-orig/mkspecs/features/qt_plugin.prf	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/mkspecs/features/qt_plugin.prf	2019-01-31 00:42:55.844577264 +0100
-@@ -88,7 +88,7 @@
-     }
- }
- 
--target.path = $$[QT_INSTALL_PLUGINS]/$$PLUGIN_TYPE
-+target.path = $$NIX_OUTPUT_PLUGIN/$$PLUGIN_TYPE
- INSTALLS += target
- 
- TARGET = $$qt5LibraryTarget($$TARGET)
-diff -ur qtbase-everywhere-src-5.11.3-orig/src/corelib/kernel/qcoreapplication.cpp qtbase-everywhere-src-5.11.3/src/corelib/kernel/qcoreapplication.cpp
---- qtbase-everywhere-src-5.11.3-orig/src/corelib/kernel/qcoreapplication.cpp	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/src/corelib/kernel/qcoreapplication.cpp	2019-01-31 00:42:55.845577279 +0100
-@@ -2612,6 +2612,15 @@
-         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);
-Only in qtbase-everywhere-src-5.11.3/src/corelib/kernel: qcoreapplication.cpp.orig
-diff -ur qtbase-everywhere-src-5.11.3-orig/src/corelib/Qt5CoreConfigExtras.cmake.in qtbase-everywhere-src-5.11.3/src/corelib/Qt5CoreConfigExtras.cmake.in
---- qtbase-everywhere-src-5.11.3-orig/src/corelib/Qt5CoreConfigExtras.cmake.in	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/src/corelib/Qt5CoreConfigExtras.cmake.in	2019-01-31 00:42:55.844577264 +0100
-@@ -3,7 +3,7 @@
-     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 @@
-     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 @@
-     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
-@@ -116,7 +116,7 @@
- !!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
-@@ -130,7 +130,7 @@
-     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 -ur qtbase-everywhere-src-5.11.3-orig/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in qtbase-everywhere-src-5.11.3/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
---- qtbase-everywhere-src-5.11.3-orig/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in	2019-01-31 00:42:55.844577264 +0100
-@@ -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 -ur qtbase-everywhere-src-5.11.3-orig/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in qtbase-everywhere-src-5.11.3/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
---- qtbase-everywhere-src-5.11.3-orig/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in	2019-01-31 00:42:55.844577264 +0100
-@@ -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 -ur qtbase-everywhere-src-5.11.3-orig/src/corelib/tools/qtimezoneprivate_tz.cpp qtbase-everywhere-src-5.11.3/src/corelib/tools/qtimezoneprivate_tz.cpp
---- qtbase-everywhere-src-5.11.3-orig/src/corelib/tools/qtimezoneprivate_tz.cpp	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/src/corelib/tools/qtimezoneprivate_tz.cpp	2019-01-31 00:42:55.845577279 +0100
-@@ -70,7 +70,11 @@
- // 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 @@
-         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 -ur qtbase-everywhere-src-5.11.3-orig/src/dbus/Qt5DBusConfigExtras.cmake.in qtbase-everywhere-src-5.11.3/src/dbus/Qt5DBusConfigExtras.cmake.in
---- qtbase-everywhere-src-5.11.3-orig/src/dbus/Qt5DBusConfigExtras.cmake.in	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/src/dbus/Qt5DBusConfigExtras.cmake.in	2019-01-31 00:42:55.845577279 +0100
-@@ -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 @@
- 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 -ur qtbase-everywhere-src-5.11.3-orig/src/gui/Qt5GuiConfigExtras.cmake.in qtbase-everywhere-src-5.11.3/src/gui/Qt5GuiConfigExtras.cmake.in
---- qtbase-everywhere-src-5.11.3-orig/src/gui/Qt5GuiConfigExtras.cmake.in	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/src/gui/Qt5GuiConfigExtras.cmake.in	2019-01-31 00:42:55.845577279 +0100
-@@ -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 @@
-     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 -ur qtbase-everywhere-src-5.11.3-orig/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp qtbase-everywhere-src-5.11.3/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
---- qtbase-everywhere-src-5.11.3-orig/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp	2019-01-31 00:42:55.845577279 +0100
-@@ -265,12 +265,9 @@
-     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 -ur qtbase-everywhere-src-5.11.3-orig/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp qtbase-everywhere-src-5.11.3/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
---- qtbase-everywhere-src-5.11.3-orig/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp	2019-01-31 00:42:55.845577279 +0100
-@@ -650,9 +650,14 @@
- #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"));
--                if (!lib.load())
--                    lib.setFileNameAndVersion(QLatin1String("GL"), 1);
-+#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
-             }
-Only in qtbase-everywhere-src-5.11.3/src/plugins/platforms/xcb/gl_integrations/xcb_glx: qglxintegration.cpp.orig
-diff -ur qtbase-everywhere-src-5.11.3-orig/src/plugins/platforms/xcb/qxcbcursor.cpp qtbase-everywhere-src-5.11.3/src/plugins/platforms/xcb/qxcbcursor.cpp
---- qtbase-everywhere-src-5.11.3-orig/src/plugins/platforms/xcb/qxcbcursor.cpp	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/src/plugins/platforms/xcb/qxcbcursor.cpp	2019-01-31 00:42:55.846577295 +0100
-@@ -316,10 +316,10 @@
- #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 -ur qtbase-everywhere-src-5.11.3-orig/src/plugins/platformthemes/gtk3/main.cpp qtbase-everywhere-src-5.11.3/src/plugins/platformthemes/gtk3/main.cpp
---- qtbase-everywhere-src-5.11.3-orig/src/plugins/platformthemes/gtk3/main.cpp	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/src/plugins/platformthemes/gtk3/main.cpp	2019-01-31 00:42:55.846577295 +0100
-@@ -39,6 +39,7 @@
- 
- #include <qpa/qplatformthemeplugin.h>
- #include "qgtk3theme.h"
-+#include <QFile>
- 
- QT_BEGIN_NAMESPACE
- 
-@@ -54,8 +55,22 @@
- 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 -ur qtbase-everywhere-src-5.11.3-orig/src/testlib/qtestassert.h qtbase-everywhere-src-5.11.3/src/testlib/qtestassert.h
---- qtbase-everywhere-src-5.11.3-orig/src/testlib/qtestassert.h	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/src/testlib/qtestassert.h	2019-01-31 00:42:55.846577295 +0100
-@@ -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 -ur qtbase-everywhere-src-5.11.3-orig/src/widgets/Qt5WidgetsConfigExtras.cmake.in qtbase-everywhere-src-5.11.3/src/widgets/Qt5WidgetsConfigExtras.cmake.in
---- qtbase-everywhere-src-5.11.3-orig/src/widgets/Qt5WidgetsConfigExtras.cmake.in	2018-11-25 13:51:11.000000000 +0100
-+++ qtbase-everywhere-src-5.11.3/src/widgets/Qt5WidgetsConfigExtras.cmake.in	2019-01-31 00:42:55.846577295 +0100
-@@ -3,7 +3,7 @@
-     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.11/qtdeclarative.patch b/pkgs/development/libraries/qt-5/5.11/qtdeclarative.patch
deleted file mode 100644
index cfa68eb8102..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtdeclarative.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
-index 005db4248..685c5b1b2 100644
---- a/src/qml/qml/qqmlimport.cpp
-+++ b/src/qml/qml/qqmlimport.cpp
-@@ -1760,6 +1760,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/Qt5QuickCompilerConfig.cmake b/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake
-index 56cb3fb55..74509d601 100644
---- a/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake
-+++ b/tools/qmlcachegen/Qt5QuickCompilerConfig.cmake
-@@ -17,7 +17,7 @@ function(QTQUICK_COMPILER_ADD_RESOURCES outfiles)
- 
-     find_package(Qt5 COMPONENTS Qml Core)
- 
--    set(compiler_path "${_qt5Core_install_prefix}/bin/qmlcachegen")
-+    set(compiler_path "qmlcachegen")
- 
-     get_target_property(rcc_path ${Qt5Core_RCC_EXECUTABLE} IMPORTED_LOCATION)
- 
-diff --git a/tools/qmlcachegen/qmlcache.prf b/tools/qmlcachegen/qmlcache.prf
-index 537eaf62e..e21de58f6 100644
---- a/tools/qmlcachegen/qmlcache.prf
-+++ b/tools/qmlcachegen/qmlcache.prf
-@@ -26,7 +26,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.11/qtscript.patch b/pkgs/development/libraries/qt-5/5.11/qtscript.patch
deleted file mode 100644
index 5508dec1280..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtscript.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-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
-+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
-@@ -81,7 +81,7 @@
- #include <pthread.h>
- #elif PLATFORM(GTK)
- #include <wtf/gtk/GOwnPtr.h>
--typedef struct _GMutex GMutex;
-+typedef union _GMutex GMutex;
- typedef struct _GCond GCond;
- #endif
- 
diff --git a/pkgs/development/libraries/qt-5/5.11/qtserialport.patch b/pkgs/development/libraries/qt-5/5.11/qtserialport.patch
deleted file mode 100644
index f25524e80bc..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtserialport.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-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()) {
-+#ifdef NIXPKGS_LIBUDEV
-+        udevLibrary->setFileNameAndVersion(QLatin1String(NIXPKGS_LIBUDEV), 1);
-+#else
-         udevLibrary->setFileNameAndVersion(QStringLiteral("udev"), 1);
-+#endif
-         if (!udevLibrary->load()) {
-+#ifdef NIXPKGS_LIBUDEV
-+            udevLibrary->setFileNameAndVersion(QLatin1String(NIXPKGS_LIBUDEV), 0);
-+#else
-             udevLibrary->setFileNameAndVersion(QStringLiteral("udev"), 0);
-+#endif
-             if (!udevLibrary->load()) {
-                 qWarning("Failed to load the library: %s, supported version(s): %i and %i", qPrintable(udevLibrary->fileName()), 1, 0);
-                 return false;
diff --git a/pkgs/development/libraries/qt-5/5.11/qttools.patch b/pkgs/development/libraries/qt-5/5.11/qttools.patch
deleted file mode 100644
index 622efc35b6b..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qttools.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-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
---- a/src/macdeployqt/shared/shared.cpp
-+++ b/src/macdeployqt/shared/shared.cpp
-@@ -1241,6 +1241,12 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
-     if (!QFile(qmlImportScannerPath).exists())
-         qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner";
- 
-+#ifdef NIXPKGS_QMLIMPORTSCANNER
-+    // Fallback: Nixpkgs hardcoded path
-+    if (!QFile(qmlImportScannerPath).exists())
-+        qmlImportScannerPath = NIXPKGS_QMLIMPORTSCANNER;
-+#endif
-+
-     // Verify that we found a qmlimportscanner binary
-     if (!QFile(qmlImportScannerPath).exists()) {
-         LogError() << "qmlimportscanner not found at" << qmlImportScannerPath;
diff --git a/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-no-platform-check.patch b/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-no-platform-check.patch
deleted file mode 100644
index 3e1a8762b36..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-no-platform-check.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-diff --git a/mkspecs/features/platform.prf b/mkspecs/features/platform.prf
---- a/mkspecs/features/platform.prf
-+++ b/mkspecs/features/platform.prf
-@@ -38,10 +38,6 @@ defineTest(isPlatformSupported) {
-          return(false)
-     }
-   } else:osx {
--    !isMinXcodeVersion(7, 3) {
--      skipBuild("Using Xcode version $$QMAKE_XCODE_VERSION, but at least version 7.3 is required to build Qt WebEngine.")
--      return(false)
--    }
-     !clang|intel_icc {
-         skipBuild("Qt WebEngine on macOS requires Clang.")
-         return(false)
-@@ -52,10 +48,6 @@ defineTest(isPlatformSupported) {
-       skipBuild("Building Qt WebEngine requires macOS version 10.11 or newer.")
-       return(false)
-     }
--    !isMinOSXSDKVersion(10, 10): {
--      skipBuild("Building Qt WebEngine requires a macOS SDK version of 10.11 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
--      return(false)
--    }
-   } else {
-     skipBuild("Unknown platform. Qt WebEngine only supports Linux, Windows, and macOS.")
-     return(false)
-diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri
---- a/src/core/config/mac_osx.pri
-+++ b/src/core/config/mac_osx.pri
-@@ -5,8 +5,6 @@ load(functions)
- # otherwise query for it.
- QMAKE_MAC_SDK_VERSION = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.SDKVersion)
- isEmpty(QMAKE_MAC_SDK_VERSION) {
--     QMAKE_MAC_SDK_VERSION = $$system("/usr/bin/xcodebuild -sdk $${QMAKE_MAC_SDK} -version SDKVersion 2>/dev/null")
--     isEmpty(QMAKE_MAC_SDK_VERSION): error("Could not resolve SDK version for \'$${QMAKE_MAC_SDK}\'")
- }
- 
- QMAKE_CLANG_DIR = "/usr"
diff --git a/pkgs/development/libraries/qt-5/5.11/qtwebengine-no-build-skip.patch b/pkgs/development/libraries/qt-5/5.11/qtwebengine-no-build-skip.patch
deleted file mode 100644
index f332d5e1bb2..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtwebengine-no-build-skip.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/qtwebengine.pro b/qtwebengine.pro
---- a/qtwebengine.pro
-+++ b/qtwebengine.pro
-@@ -5,7 +5,7 @@ runConfigure()
- 
- !isEmpty(skipBuildReason) {
-     SUBDIRS =
--    log($${skipBuildReason}$${EOL})
-+    error($${skipBuildReason}$${EOL})
-     log(QtWebEngine will not be built.$${EOL})
- }
- 
diff --git a/pkgs/development/libraries/qt-5/5.11/qtwebkit.patch b/pkgs/development/libraries/qt-5/5.11/qtwebkit.patch
deleted file mode 100644
index b94a4b76cba..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/qtwebkit.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/Source/WebKit2/PlatformQt.cmake b/Source/WebKit2/PlatformQt.cmake
---- a/Source/WebKit2/PlatformQt.cmake
-+++ b/Source/WebKit2/PlatformQt.cmake
-@@ -261,6 +261,7 @@
- list(APPEND WebKit2_SYSTEM_INCLUDE_DIRECTORIES
-     ${GLIB_INCLUDE_DIRS}
-     ${GSTREAMER_INCLUDE_DIRS}
-+    ${GSTREAMER_PBUTILS_INCLUDE_DIRS}
-     ${Qt5Quick_INCLUDE_DIRS}
-     ${Qt5Quick_PRIVATE_INCLUDE_DIRS}
-     ${SQLITE_INCLUDE_DIR}
-
diff --git a/pkgs/development/libraries/qt-5/5.11/srcs.nix b/pkgs/development/libraries/qt-5/5.11/srcs.nix
deleted file mode 100644
index cff49b18033..00000000000
--- a/pkgs/development/libraries/qt-5/5.11/srcs.nix
+++ /dev/null
@@ -1,325 +0,0 @@
-# DO NOT EDIT! This file is generated automatically by fetch-kde-qt.sh
-{ fetchurl, mirror }:
-
-{
-  qt3d = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qt3d-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1awyv40jgbb30yp5zxf6j9wq96nmk8zyhbh4fpn9gn35ychmr984";
-      name = "qt3d-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtactiveqt = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtactiveqt-everywhere-src-5.11.3.tar.xz";
-      sha256 = "0g35yhp01c34m91fp5vzzq0d2kzz0yswpjjk5cg36j0ddnfcsh4d";
-      name = "qtactiveqt-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtandroidextras = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtandroidextras-everywhere-src-5.11.3.tar.xz";
-      sha256 = "0clqz10ry70f0v8hbw37fhlwrsr5jddg99yjsk9db250dwbqzq27";
-      name = "qtandroidextras-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtbase = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtbase-everywhere-src-5.11.3.tar.xz";
-      sha256 = "071yc9iz14qs4s8yvrwllyfdzp5yjxsdpvbjxdrf0g5q69vqigy6";
-      name = "qtbase-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtcanvas3d = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtcanvas3d-everywhere-src-5.11.3.tar.xz";
-      sha256 = "0f110z7cmkzns9k00aa5zhzq2fpybfxkd7gdlwzcbhc8hn20986m";
-      name = "qtcanvas3d-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtcharts = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtcharts-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1p4m1nkbbxlkwmbmasx5r83skzssmlcgfzyvj30x2dyrqkmz7627";
-      name = "qtcharts-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtconnectivity = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtconnectivity-everywhere-src-5.11.3.tar.xz";
-      sha256 = "0amks3qad31i7cha85kvcaxvlmmgkc3gm4jdkw2p02ixxfygr30l";
-      name = "qtconnectivity-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtdatavis3d = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtdatavis3d-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1kqwr3avcvcyy4i28vjgxk1bsjj9011zr668hsk1zrjxnnwjwdl3";
-      name = "qtdatavis3d-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtdeclarative = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtdeclarative-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1rhsf9bma2zwwpixk2fsg31x7c1pmsk144npypgc9w86swhkc9lf";
-      name = "qtdeclarative-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtdoc = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtdoc-everywhere-src-5.11.3.tar.xz";
-      sha256 = "06nl8lzrilj8yify5qy4fm9la6dh71aamg19jhvvi657cshiclsq";
-      name = "qtdoc-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtgamepad = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtgamepad-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1k222cx18zq48sfna91hmy427qzk2n2xz3dlyz59iyz72k6915g9";
-      name = "qtgamepad-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtgraphicaleffects = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtgraphicaleffects-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1qjpdzkamf27cg5n1wsf0zk939lcgppgydfjzap9s4fxzj1nkn0l";
-      name = "qtgraphicaleffects-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtimageformats = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtimageformats-everywhere-src-5.11.3.tar.xz";
-      sha256 = "0zq8igsjyyhxsjr43vpaasrqjw3x0g6rwqf8kaz7y9vs7ny63ch4";
-      name = "qtimageformats-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtlocation = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtlocation-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1sq0f41jwmsimv9a1wl2nk5nifjppm5j92rr4n4s7qwnnjjrir2q";
-      name = "qtlocation-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtmacextras = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtmacextras-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1j9sqmcwswr8v9z8mcbm10bj7nz8nv9mir0xsc5123ik1gw2c3lk";
-      name = "qtmacextras-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtmultimedia = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtmultimedia-everywhere-src-5.11.3.tar.xz";
-      sha256 = "0h9wx86zj20n4xc3qnml0i360x2dc1yd2z2af1flj8fwyzppi03j";
-      name = "qtmultimedia-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtnetworkauth = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtnetworkauth-everywhere-src-5.11.3.tar.xz";
-      sha256 = "0dd35698wzg89975vi2ijl2lym495fjizsl03mjixsjnvb1x0q50";
-      name = "qtnetworkauth-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtpurchasing = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtpurchasing-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1fd0gxdj5mrh81iwimq1243i3n47sqv9ik8nslahfh0q3dsx7k8n";
-      name = "qtpurchasing-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtquickcontrols = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtquickcontrols-everywhere-src-5.11.3.tar.xz";
-      sha256 = "0dvmy31qbl76yy0j5y8m7mvnmqyg2c01fmlkn0snvc5h5ah5skjf";
-      name = "qtquickcontrols-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtquickcontrols2 = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtquickcontrols2-everywhere-src-5.11.3.tar.xz";
-      sha256 = "11nhpb0xckv5jjkqj5szr94c2rvyjwr89ch58hh64nsqaav30mpl";
-      name = "qtquickcontrols2-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtremoteobjects = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtremoteobjects-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1d3jzsxfyjhgb6wj9iv1388bv7j6pi08346nmkm1c1a4iykhc0zp";
-      name = "qtremoteobjects-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtscript = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtscript-everywhere-src-5.11.3.tar.xz";
-      sha256 = "027cvggbcvwyz76cn1bl1zvqg0nq7iica1b7yx7xyy0hb36g715v";
-      name = "qtscript-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtscxml = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtscxml-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1mv8mz36v34dckrzy5r41mq3sqznbalrhndk3avz2154xmkjf5qk";
-      name = "qtscxml-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtsensors = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtsensors-everywhere-src-5.11.3.tar.xz";
-      sha256 = "0n88c8xi9pbyh7q1pcqv4yjv6nx62abflj8qgfr4qzb0sp8m6mx7";
-      name = "qtsensors-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtserialbus = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtserialbus-everywhere-src-5.11.3.tar.xz";
-      sha256 = "0vf12jk1ma0v0dlpliw1x9i04iaik1kjkiaby7gaxm2abprxwr2n";
-      name = "qtserialbus-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtserialport = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtserialport-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1nkbfsxzgicwns3k11hhzjxy2hgrigj8xcw2by0jc1j71mnmxi4n";
-      name = "qtserialport-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtspeech = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtspeech-everywhere-src-5.11.3.tar.xz";
-      sha256 = "158p7zqd0vg55gf88jzc3d4f7649ihh80k0m1q46m2yp6fpdjbxr";
-      name = "qtspeech-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtsvg = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtsvg-everywhere-src-5.11.3.tar.xz";
-      sha256 = "14a4rprbj9f9rhixbk7143xdz34d7d39xh9v2sc1w43q9sf2rsi1";
-      name = "qtsvg-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qttools = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qttools-everywhere-src-5.11.3.tar.xz";
-      sha256 = "13lzdxxi02yhvx4mflhisl6aqv2fiss5m804cqccd1wvp8dyh1f2";
-      name = "qttools-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qttranslations = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qttranslations-everywhere-src-5.11.3.tar.xz";
-      sha256 = "0j8i2kabz22vqb0qj41pkjv848zblqxs71sydc3xcd5av22b517s";
-      name = "qttranslations-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtvirtualkeyboard = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtvirtualkeyboard-everywhere-src-5.11.3.tar.xz";
-      sha256 = "17jb7cbfy5c19fr9frql6q22in3ra3a4fbff0kjykllxb8j40p4c";
-      name = "qtvirtualkeyboard-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtwayland = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtwayland-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1chz4wchgkzd45h143i5hkqg0whcgdbj37gkg7j4kj31whllzjb2";
-      name = "qtwayland-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtwebchannel = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtwebchannel-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1wrdawlqvcw84h8q52mvbjhp1vkd6fhz6c8ijlg9rw0s3fj4y99w";
-      name = "qtwebchannel-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtwebengine = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtwebengine-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1zmqsdais85cdfh2jh8h4a5jcamp1mzdk3vgqm6xnldqf6nrxd2v";
-      name = "qtwebengine-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtwebglplugin = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtwebglplugin-everywhere-src-5.11.3.tar.xz";
-      sha256 = "0wqz8lycmi7pffzy0pz5960w109lbk4mkbw0l1lh64avl6clq7b9";
-      name = "qtwebglplugin-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtwebsockets = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtwebsockets-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1ffmapfy68xwwbxbg19ng6b5h8v42cf78s21j7rgq49gm70r0402";
-      name = "qtwebsockets-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtwebview = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtwebview-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1njmn1n03dp4md8cz58cq2z6bsxd8nwlw0238zmavh7px3jzc9kh";
-      name = "qtwebview-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtwinextras = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtwinextras-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1xf9gc0wqk9jz2ayx29vx0vmm72x9h4qxp2fvgpclns621wyhw72";
-      name = "qtwinextras-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtx11extras = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtx11extras-everywhere-src-5.11.3.tar.xz";
-      sha256 = "11fd2mc20qmnyv1vqhaqad2q6m0i4lmkr432rmqvpkgphpkfp7pr";
-      name = "qtx11extras-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-  qtxmlpatterns = {
-    version = "5.11.3";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.11/5.11.3/submodules/qtxmlpatterns-everywhere-src-5.11.3.tar.xz";
-      sha256 = "1vhfvgi39miqsx3iq7c9sii2sykq0yfng69b70i0smr20zihpl4b";
-      name = "qtxmlpatterns-everywhere-src-5.11.3.tar.xz";
-    };
-  };
-}
diff --git a/pkgs/development/libraries/qt-5/5.12/default.nix b/pkgs/development/libraries/qt-5/5.12/default.nix
index 2800f2d7797..8d27f3a0d4b 100644
--- a/pkgs/development/libraries/qt-5/5.12/default.nix
+++ b/pkgs/development/libraries/qt-5/5.12/default.nix
@@ -54,6 +54,7 @@ let
       optionals stdenv.isDarwin [
         ./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
         ./qtbase.patch.d/0002-qtbase-mac.patch
+        ./qtbase.patch.d/0013-define-kiosurfacesuccess.patch
       ]
       ++ [
         ./qtbase.patch.d/0003-qtbase-mkspecs.patch
diff --git a/pkgs/development/libraries/qt-5/5.12/fetch.sh b/pkgs/development/libraries/qt-5/5.12/fetch.sh
index 575115c9bdf..9f99879511e 100644
--- a/pkgs/development/libraries/qt-5/5.12/fetch.sh
+++ b/pkgs/development/libraries/qt-5/5.12/fetch.sh
@@ -1 +1 @@
-WGET_ARGS=( http://download.qt.io/official_releases/qt/5.12/5.12.5/submodules/ )
+WGET_ARGS=( http://download.qt.io/official_releases/qt/5.12/5.12.6/submodules/ )
diff --git a/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0001-qtbase-mkspecs-mac.patch b/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
index ae5d016c99f..bb535b8a0c0 100644
--- a/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
+++ b/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
@@ -5,11 +5,11 @@ Subject: [PATCH 01/12] qtbase-mkspecs-mac
 
 ---
  mkspecs/common/mac.conf               |   2 +-
- mkspecs/features/mac/default_post.prf | 201 --------------------------
- mkspecs/features/mac/default_pre.prf  |  58 --------
- mkspecs/features/mac/sdk.mk           |  25 ----
- mkspecs/features/mac/sdk.prf          |  61 --------
- 5 files changed, 1 insertion(+), 346 deletions(-)
+ mkspecs/features/mac/default_post.prf | 202 ----------------------------------
+ mkspecs/features/mac/default_pre.prf  |  58 ----------
+ mkspecs/features/mac/sdk.mk           |  25 -----
+ mkspecs/features/mac/sdk.prf          |  61 ----------
+ 5 files changed, 1 insertion(+), 347 deletions(-)
 
 diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf
 index b77494ec9b..470c38e772 100644
@@ -25,10 +25,10 @@ index b77494ec9b..470c38e772 100644
  
  QMAKE_LFLAGS_REL_RPATH  =
 diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
-index 26bd3e2e98..b80ec1e801 100644
+index 993f4d56a9..b80ec1e801 100644
 --- a/mkspecs/features/mac/default_post.prf
 +++ b/mkspecs/features/mac/default_post.prf
-@@ -68,207 +68,6 @@ qt {
+@@ -68,208 +68,6 @@ qt {
      }
  }
  
@@ -61,21 +61,22 @@ index 26bd3e2e98..b80ec1e801 100644
 -        qmake_pkginfo_typeinfo.value = "????"
 -    QMAKE_MAC_XCODE_SETTINGS += qmake_pkginfo_typeinfo
 -
--    !isEmpty(VERSION) {
--        l = $$split(VERSION, '.') 0 0  # make sure there are at least three
--        VER_MAJ = $$member(l, 0, 0)
--        VER_MIN = $$member(l, 1, 1)
--        VER_PAT = $$member(l, 2, 2)
--        unset(l)
+-    bundle_version = $$VERSION
+-    isEmpty(bundle_version): bundle_version = 1.0.0
 -
--        qmake_full_version.name = QMAKE_FULL_VERSION
--        qmake_full_version.value = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT}
--        QMAKE_MAC_XCODE_SETTINGS += qmake_full_version
+-    l = $$split(bundle_version, '.') 0 0  # make sure there are at least three
+-    VER_MAJ = $$member(l, 0, 0)
+-    VER_MIN = $$member(l, 1, 1)
+-    VER_PAT = $$member(l, 2, 2)
+-    unset(l)
 -
--        qmake_short_version.name = QMAKE_SHORT_VERSION
--        qmake_short_version.value = $${VER_MAJ}.$${VER_MIN}
--        QMAKE_MAC_XCODE_SETTINGS += qmake_short_version
--    }
+-    qmake_full_version.name = QMAKE_FULL_VERSION
+-    qmake_full_version.value = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT}
+-    QMAKE_MAC_XCODE_SETTINGS += qmake_full_version
+-
+-    qmake_short_version.name = QMAKE_SHORT_VERSION
+-    qmake_short_version.value = $${VER_MAJ}.$${VER_MIN}
+-    QMAKE_MAC_XCODE_SETTINGS += qmake_short_version
 -
 -    !isEmpty(QMAKE_XCODE_DEBUG_INFORMATION_FORMAT) {
 -        debug_information_format.name = DEBUG_INFORMATION_FORMAT
diff --git a/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0013-define-kiosurfacesuccess.patch b/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0013-define-kiosurfacesuccess.patch
new file mode 100644
index 00000000000..a43a46d8a69
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0013-define-kiosurfacesuccess.patch
@@ -0,0 +1,16 @@
+diff --git a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.mm b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.mm
+index a367487e..c3aeca1d 100644
+--- a/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.mm
++++ b/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.mm
+@@ -49,6 +49,11 @@
+ // but was only added in the 10.14 SDK, so declare it just in case.
+ extern "C" CFPropertyListRef CGColorSpaceCopyPropertyList(CGColorSpaceRef space);
+ 
++// Introduced in 10.13: http://codeworkshop.net/objc-diff/sdkdiffs/macos/10.13/IOSurface.html
++#if !defined(kIOSurfaceSuccess)
++#define kIOSurfaceSuccess KERN_SUCCESS
++#endif
++
+ QT_BEGIN_NAMESPACE
+ 
+ Q_LOGGING_CATEGORY(lcQpaIOSurface, "qt.qpa.backingstore.iosurface");
diff --git a/pkgs/development/libraries/qt-5/5.12/srcs.nix b/pkgs/development/libraries/qt-5/5.12/srcs.nix
index 3b4d761c16c..b4494593fd0 100644
--- a/pkgs/development/libraries/qt-5/5.12/srcs.nix
+++ b/pkgs/development/libraries/qt-5/5.12/srcs.nix
@@ -3,323 +3,323 @@
 
 {
   qt3d = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qt3d-everywhere-src-5.12.5.tar.xz";
-      sha256 = "2a35b144768c7ad8a9265d16a04f038d9bc51016bd2c4b2b516e374f81ff29c4";
-      name = "qt3d-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qt3d-everywhere-src-5.12.6.tar.xz";
+      sha256 = "cf34ce99a2592270abbf32a13fa824d99c76412fc493a3f1c37e37892b198baf";
+      name = "qt3d-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtactiveqt = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtactiveqt-everywhere-src-5.12.5.tar.xz";
-      sha256 = "d673a1269dd900c78dbfe88eb16e086e36d236571722712a64401cdec7b73a40";
-      name = "qtactiveqt-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtactiveqt-everywhere-src-5.12.6.tar.xz";
+      sha256 = "c50f082588bf7dad2091a5b67c426791bf36d7d1503c56dc79b9e26444931f09";
+      name = "qtactiveqt-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtandroidextras = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtandroidextras-everywhere-src-5.12.5.tar.xz";
-      sha256 = "f115ccef1e808da7c5d0348f3e245952a2973966f34d18b935f9e3eb16062eab";
-      name = "qtandroidextras-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtandroidextras-everywhere-src-5.12.6.tar.xz";
+      sha256 = "a0f15a4ba29abe90de2b2c221efd22ecfb6793590ff9610f85e6e6b6562784fe";
+      name = "qtandroidextras-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtbase = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtbase-everywhere-src-5.12.5.tar.xz";
-      sha256 = "fc8abffbbda9da3e593d8d62b56bc17dbaab13ff71b72915ddda11dabde4d625";
-      name = "qtbase-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtbase-everywhere-src-5.12.6.tar.xz";
+      sha256 = "6ab52649d74d7c1728cf4a6cf335d1142b3bf617d476e2857eb7961ef43f9f27";
+      name = "qtbase-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtcanvas3d = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtcanvas3d-everywhere-src-5.12.5.tar.xz";
-      sha256 = "1553e06ce3cc5afb36aed3698b85c00e734eac07f7f41895426bebd84216d80c";
-      name = "qtcanvas3d-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtcanvas3d-everywhere-src-5.12.6.tar.xz";
+      sha256 = "2d33e6c944e5a2eed7528fdfe9deadfb1b7a0fcf17bab1f8b83988b1327d9d08";
+      name = "qtcanvas3d-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtcharts = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtcharts-everywhere-src-5.12.5.tar.xz";
-      sha256 = "4c7c30a916ba0100a1635b89f48bc5a8af4cdedac79c3fc18456af54dc0a6608";
-      name = "qtcharts-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtcharts-everywhere-src-5.12.6.tar.xz";
+      sha256 = "14dbdb5bb18d774e3b7ac3042a3f349080ab42c2588527ff04123df1c9ccaa3d";
+      name = "qtcharts-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtconnectivity = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtconnectivity-everywhere-src-5.12.5.tar.xz";
-      sha256 = "bdf62c72d689f47c4d17ecdde934d9f85a1164091e58fce02873de259e8de88b";
-      name = "qtconnectivity-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtconnectivity-everywhere-src-5.12.6.tar.xz";
+      sha256 = "10f1c6727aedc375a1bfab4bb33fd2111bf2c1dfc19049e361c0f58608ea22da";
+      name = "qtconnectivity-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtdatavis3d = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtdatavis3d-everywhere-src-5.12.5.tar.xz";
-      sha256 = "1de165bf5330c7fb18c6fbb8c0e5cda47fa19c2eaba657b3792fd75e653444f3";
-      name = "qtdatavis3d-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtdatavis3d-everywhere-src-5.12.6.tar.xz";
+      sha256 = "414d91aae5e7d3404a0b526f944961871b1abf1fda51f0861d19cb28a2eba4fe";
+      name = "qtdatavis3d-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtdeclarative = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtdeclarative-everywhere-src-5.12.5.tar.xz";
-      sha256 = "22c5323d4b01259e6e352eef1b54129d6dfee00a406f0312905fa7db322b9190";
-      name = "qtdeclarative-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtdeclarative-everywhere-src-5.12.6.tar.xz";
+      sha256 = "34b1d1ae5562f1d433e22c255ac1a37a2fb030ef05bf6123d4b9496644b686d3";
+      name = "qtdeclarative-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtdoc = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtdoc-everywhere-src-5.12.5.tar.xz";
-      sha256 = "f1de30227b8854c284e9c23e9c0c44d9fe768880aef826b0f880a44dd7c7538d";
-      name = "qtdoc-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtdoc-everywhere-src-5.12.6.tar.xz";
+      sha256 = "82549278120236ece0e02f9bab351319e4469c242ce97b05f269964aee924aac";
+      name = "qtdoc-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtgamepad = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtgamepad-everywhere-src-5.12.5.tar.xz";
-      sha256 = "de88f01d47f7cc5d54a1af783c5fae9f2b0101948ff33b8290f71b2657aded33";
-      name = "qtgamepad-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtgamepad-everywhere-src-5.12.6.tar.xz";
+      sha256 = "e1ebc5f3593c5234724663106790fbf1831d4ac8ea50a9d9805d2dd0a1c5b3b3";
+      name = "qtgamepad-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtgraphicaleffects = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtgraphicaleffects-everywhere-src-5.12.5.tar.xz";
-      sha256 = "bdbddba7e0e0d041809a98d97c07da8be8936ec48537335cbaea9b0049c646ad";
-      name = "qtgraphicaleffects-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtgraphicaleffects-everywhere-src-5.12.6.tar.xz";
+      sha256 = "ded0327624a13bf7fab07e5fe762473194ed898b0442ef9325498e41c8c077ef";
+      name = "qtgraphicaleffects-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtimageformats = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtimageformats-everywhere-src-5.12.5.tar.xz";
-      sha256 = "9f19394830542fb9e6bde6806b6216b7207f96bff674b91e8e8a8f89699e1f0a";
-      name = "qtimageformats-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtimageformats-everywhere-src-5.12.6.tar.xz";
+      sha256 = "330d1c29a135c44bb36b5ffc2ba4f8915dbc446d5d75563523ebcfd373617858";
+      name = "qtimageformats-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtlocation = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtlocation-everywhere-src-5.12.5.tar.xz";
-      sha256 = "12c8b59755abc4ca56e135e8ae3db7c6ba1bd95c779060f10a01393ae1040122";
-      name = "qtlocation-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtlocation-everywhere-src-5.12.6.tar.xz";
+      sha256 = "7ae231ca4de3c0915e92bb95440b0ddc7113790b1acb536c9394472e8dde2278";
+      name = "qtlocation-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtmacextras = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtmacextras-everywhere-src-5.12.5.tar.xz";
-      sha256 = "984c3c95834aaa6fd85234ab1987a79662911c510e419611ce88fb4756313194";
-      name = "qtmacextras-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtmacextras-everywhere-src-5.12.6.tar.xz";
+      sha256 = "eae25b8858fef348667b938f5c88a014ee78945c419e4e6d856d4a6adc5e43a3";
+      name = "qtmacextras-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtmultimedia = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtmultimedia-everywhere-src-5.12.5.tar.xz";
-      sha256 = "d5a0a4fddc5ef14d641160a1fc0011b190ff8d9f19009498d586516b8ee3479c";
-      name = "qtmultimedia-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtmultimedia-everywhere-src-5.12.6.tar.xz";
+      sha256 = "9f580e8962ca6a09608570e77b38d7c3f71d344ff6de1c39bc6905226b679570";
+      name = "qtmultimedia-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtnetworkauth = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtnetworkauth-everywhere-src-5.12.5.tar.xz";
-      sha256 = "0933475a2d30550c70ce4026c72678cbfdac73211593c78d442e038ef531a9f1";
-      name = "qtnetworkauth-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtnetworkauth-everywhere-src-5.12.6.tar.xz";
+      sha256 = "ea122d86a960863bbe0e0f4b5a12f0a376455beed3c26f1b61926e065b366abd";
+      name = "qtnetworkauth-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtpurchasing = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtpurchasing-everywhere-src-5.12.5.tar.xz";
-      sha256 = "7bcebc4985d387f3fa4ffcc19eada1f4f0f000ed0fd3e1d1dc37eb1db0be615b";
-      name = "qtpurchasing-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtpurchasing-everywhere-src-5.12.6.tar.xz";
+      sha256 = "1fa0b7e3da4755b64559177f507718320c1aa9e66ec49e17595e04c3f3af70cd";
+      name = "qtpurchasing-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtquickcontrols = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtquickcontrols-everywhere-src-5.12.5.tar.xz";
-      sha256 = "46deaefbdac3daa576c748e807956f5f82b2318923b1a36e434a3ff32d1d2559";
-      name = "qtquickcontrols-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtquickcontrols-everywhere-src-5.12.6.tar.xz";
+      sha256 = "c48d96a187ff924f1ae4b4abe9cc073adeb06a6c2b07c4191aa595ad22df2c99";
+      name = "qtquickcontrols-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtquickcontrols2 = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtquickcontrols2-everywhere-src-5.12.5.tar.xz";
-      sha256 = "d744bdc492486db6cb521b1d4891e2358719399825ca1cf2a50968a80f6acb8f";
-      name = "qtquickcontrols2-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtquickcontrols2-everywhere-src-5.12.6.tar.xz";
+      sha256 = "5cab0712f946405db269851b96cca02ef8ba98f3ee2c4fa9c0877dba3808a970";
+      name = "qtquickcontrols2-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtremoteobjects = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtremoteobjects-everywhere-src-5.12.5.tar.xz";
-      sha256 = "acf131af93dd1fefbf30c7e03e29b8a1da3180e00c49f95c14a1cb6158cfeacd";
-      name = "qtremoteobjects-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtremoteobjects-everywhere-src-5.12.6.tar.xz";
+      sha256 = "49b5353d020fb6ab9bdf90c941a4b3acc6b036266f6c68a42fc44a7ac151d699";
+      name = "qtremoteobjects-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtscript = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtscript-everywhere-src-5.12.5.tar.xz";
-      sha256 = "0083734ae827840334b774decb15de37f1b4ea5c88e442e2f485c530f24f1df4";
-      name = "qtscript-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtscript-everywhere-src-5.12.6.tar.xz";
+      sha256 = "a18082ad338e2378cccab932045804ad3077ec924fed2efc59d4b726d622777c";
+      name = "qtscript-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtscxml = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtscxml-everywhere-src-5.12.5.tar.xz";
-      sha256 = "6f1ec74100cdb2e7dfc3535e09d356fc53ba42e61b32fc3b93d5a7efed49960c";
-      name = "qtscxml-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtscxml-everywhere-src-5.12.6.tar.xz";
+      sha256 = "53d7837c8b5b1f9beb26cb64ea4334211218533e0126167e4e7e75238f7ac68b";
+      name = "qtscxml-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtsensors = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtsensors-everywhere-src-5.12.5.tar.xz";
-      sha256 = "e3a86a706f475bb23fc874de56026482de223ebd24f8cb4e94a28d1985ca0b85";
-      name = "qtsensors-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtsensors-everywhere-src-5.12.6.tar.xz";
+      sha256 = "59dba4c0bc72846d938e0862f14d8064fb664d893f270a41d3abf4e871290ef5";
+      name = "qtsensors-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtserialbus = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtserialbus-everywhere-src-5.12.5.tar.xz";
-      sha256 = "8474ae61a703c56e327ae0755c27643f2eafe0d915e8c6afb21728548dc02c22";
-      name = "qtserialbus-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtserialbus-everywhere-src-5.12.6.tar.xz";
+      sha256 = "071b421282118c507a996e3cee4070f2c545335dfd891a44bf54100935cff5de";
+      name = "qtserialbus-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtserialport = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtserialport-everywhere-src-5.12.5.tar.xz";
-      sha256 = "f8ef0321a59ecfe2c72adc2ee220e0047403439a3c7b9efb719b1476af1fb862";
-      name = "qtserialport-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtserialport-everywhere-src-5.12.6.tar.xz";
+      sha256 = "77d0def93078fb5d9de6faa9ccff05cce5b934899e856b04bcf7f721a4e190be";
+      name = "qtserialport-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtspeech = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtspeech-everywhere-src-5.12.5.tar.xz";
-      sha256 = "f94c0cd7236d1a20d97d314d2c17c45c967cd7f24b869c43f5f46253f436f25b";
-      name = "qtspeech-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtspeech-everywhere-src-5.12.6.tar.xz";
+      sha256 = "27ae7b2c7073377a617f32b0f4adfc1807774f02d13469ed4bcd282799cf878a";
+      name = "qtspeech-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtsvg = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtsvg-everywhere-src-5.12.5.tar.xz";
-      sha256 = "75a791cf749f671d7ea9090b403ca513f745795018db512e7eecbf418b679840";
-      name = "qtsvg-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtsvg-everywhere-src-5.12.6.tar.xz";
+      sha256 = "46243e6c425827ab4e91fbe31567f683ff14cb01d12f9f7543a83a571228ef8f";
+      name = "qtsvg-everywhere-src-5.12.6.tar.xz";
     };
   };
   qttools = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qttools-everywhere-src-5.12.5.tar.xz";
-      sha256 = "28e095047b4985437dd66120cbcb49ac091bf4f12576ecad7ebc781b7dd44025";
-      name = "qttools-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qttools-everywhere-src-5.12.6.tar.xz";
+      sha256 = "e94991c7885c2650cefd71189873e45b1d64d6042e439a0a0d9652c191d3c777";
+      name = "qttools-everywhere-src-5.12.6.tar.xz";
     };
   };
   qttranslations = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qttranslations-everywhere-src-5.12.5.tar.xz";
-      sha256 = "72eb6317190fdcc3f8de37996adc646ab8772988766bacaab60a5bcc7d6a3f2a";
-      name = "qttranslations-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qttranslations-everywhere-src-5.12.6.tar.xz";
+      sha256 = "798ac44414206898d0192653118de3f115c59016e2bf82ad0c659f9f8c864768";
+      name = "qttranslations-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtvirtualkeyboard = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtvirtualkeyboard-everywhere-src-5.12.5.tar.xz";
-      sha256 = "786d745b34b1f145073488d492325e98bcde81b07ab984032ea5eb2fb52e6e5e";
-      name = "qtvirtualkeyboard-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtvirtualkeyboard-everywhere-src-5.12.6.tar.xz";
+      sha256 = "04699888d6e1e8e04db8043a37212fa3b1fcb1b23aef41c2f3ae7a4278e34d2c";
+      name = "qtvirtualkeyboard-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtwayland = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtwayland-everywhere-src-5.12.5.tar.xz";
-      sha256 = "29fd31267149451f93faa15f031e0a14506e704086033f70d51479522c6f3846";
-      name = "qtwayland-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtwayland-everywhere-src-5.12.6.tar.xz";
+      sha256 = "fa9c6aa84ddc0334b44f0f47d69569e496e5d9f3a1ed67aab42214854d2351c4";
+      name = "qtwayland-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtwebchannel = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtwebchannel-everywhere-src-5.12.5.tar.xz";
-      sha256 = "9f1d1ac20722ee053ecf071d4ec0070a45a765cb67b6e31add61004fb4b3c5e8";
-      name = "qtwebchannel-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtwebchannel-everywhere-src-5.12.6.tar.xz";
+      sha256 = "2745d1703de1a749405727a74786184c950ba7465dc5d02e2f39f51635dbc8d7";
+      name = "qtwebchannel-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtwebengine = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtwebengine-everywhere-src-5.12.5.tar.xz";
-      sha256 = "31881130e69eb8336e9480f9f33cd5a93e86de8d7323c0ae1893e1a72ce70743";
-      name = "qtwebengine-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtwebengine-everywhere-src-5.12.6.tar.xz";
+      sha256 = "caa5f257c3bc33c1d2fcb9b7cd414fd5c46e8eee8a103231ab28d592a0058621";
+      name = "qtwebengine-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtwebglplugin = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtwebglplugin-everywhere-src-5.12.5.tar.xz";
-      sha256 = "aac3b2b2e5b6f26dd7abba6eab616777fecbb4d06de05ddab68c1296652bc4f7";
-      name = "qtwebglplugin-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtwebglplugin-everywhere-src-5.12.6.tar.xz";
+      sha256 = "21d88852f69f0f06c5899e61fe76b2cefc2b65be4ed3c334ec01431ba16f50dd";
+      name = "qtwebglplugin-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtwebsockets = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtwebsockets-everywhere-src-5.12.5.tar.xz";
-      sha256 = "5d58e697c49c0ea19a8299deba84b5360dca8c336a1636d38de0351757293262";
-      name = "qtwebsockets-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtwebsockets-everywhere-src-5.12.6.tar.xz";
+      sha256 = "f00bfbaa73e60a4c3371e729167d7acb465cbb2db32535d745982cab21fed61e";
+      name = "qtwebsockets-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtwebview = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtwebview-everywhere-src-5.12.5.tar.xz";
-      sha256 = "a6d4d8c335cd6838f4638874fcd67655e80db569ed567a774a84f6bf7d332f26";
-      name = "qtwebview-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtwebview-everywhere-src-5.12.6.tar.xz";
+      sha256 = "42c0623c1c066620ab1afc3736a4a5f42115f9c190dafdf643e16ccec6e7727a";
+      name = "qtwebview-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtwinextras = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtwinextras-everywhere-src-5.12.5.tar.xz";
-      sha256 = "7ee2fc73bc95c5e36e8ed2d02fc89822d56c406c540fbfa52bb0e3929ff2f93d";
-      name = "qtwinextras-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtwinextras-everywhere-src-5.12.6.tar.xz";
+      sha256 = "02c2b2393073a22498a5645faed34040428ace9cf09f18e2f12e75e31be54bea";
+      name = "qtwinextras-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtx11extras = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtx11extras-everywhere-src-5.12.5.tar.xz";
-      sha256 = "89425af3e48b040878c6a64ace58c17a83b87c9330e6366b09a41d6797062a68";
-      name = "qtx11extras-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtx11extras-everywhere-src-5.12.6.tar.xz";
+      sha256 = "5f3991f557116034731ed059895e73b5d34e1b22e85536a8eb6e92350b3a1d6b";
+      name = "qtx11extras-everywhere-src-5.12.6.tar.xz";
     };
   };
   qtxmlpatterns = {
-    version = "5.12.5";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.5/submodules/qtxmlpatterns-everywhere-src-5.12.5.tar.xz";
-      sha256 = "b905d9107f87798ef0f142942fc45c0f63fc113522ab041e791d3cb744a8babd";
-      name = "qtxmlpatterns-everywhere-src-5.12.5.tar.xz";
+      url = "${mirror}/official_releases/qt/5.12/5.12.6/submodules/qtxmlpatterns-everywhere-src-5.12.6.tar.xz";
+      sha256 = "76977bc834e6c6118ae2bab31e68ae54843358936b03e432d919ad15cd2184d0";
+      name = "qtxmlpatterns-everywhere-src-5.12.6.tar.xz";
     };
   };
 }
diff --git a/pkgs/development/libraries/qt-5/5.9/default.nix b/pkgs/development/libraries/qt-5/5.9/default.nix
deleted file mode 100644
index 8854ed54700..00000000000
--- a/pkgs/development/libraries/qt-5/5.9/default.nix
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
-
-# 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. Check that the new packages build correctly.
-4. Commit the changes and open a pull request.
-
-*/
-
-{
-  newScope,
-  stdenv, fetchurl, fetchpatch, makeSetupHook, makeWrapper,
-  bison, cups ? null, harfbuzz, libGL, perl,
-  gstreamer, gst-plugins-base, gtk3, dconf,
-
-  # options
-  developerBuild ? false,
-  decryptSslTraffic ? false,
-  debug ? false,
-}:
-
-with stdenv.lib;
-
-let
-
-  qtCompatVersion = srcs.qtbase.version;
-
-  mirror = "http://download.qt.io";
-  srcs = import ./srcs.nix { inherit fetchurl; inherit mirror; };
-
-  patches = {
-    qtbase = [
-      ./qtbase.patch
-      ./qtbase-fixguicmake.patch
-      ./qtbase-openssl_1_1.patch
-    ];
-    qtdeclarative = [ ./qtdeclarative.patch ];
-    qtscript = [
-      ./qtscript.patch
-      # needed due to changes in gcc 8.3, see https://bugreports.qt.io/browse/QTBUG-74196
-      # fixed in qtscript 5.12.2
-      (fetchpatch {
-        url = "https://github.com/qt/qtscript/commit/97ec1d1882a83c23c91f0f7daea48e05858d8c32.diff";
-        sha256 = "0khrapq13xzvxckzc9l7gqyjwibyd98vyqy6gmyhvsbm2kq8n6wi";
-      })
-    ];
-    qtserialport = [ ./qtserialport.patch ];
-    qttools = [ ./qttools.patch ];
-    qtwebengine = [
-      ./qtwebengine-no-build-skip.patch
-      # https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/707
-      # https://bugreports.qt.io/browse/QTBUG-77037
-      (fetchpatch {
-        name = "fix-build-with-pulseaudio-13.0.patch";
-        url = "https://git.archlinux.org/svntogit/packages.git/plain/trunk/qtbug-77037-workaround.patch?h=packages/qt5-webengine&id=fc77d6b3d5ec74e421b58f199efceb2593cbf951";
-        sha256 = "1gv733qfdn9746nbqqxzyjx4ijjqkkb7zb71nxax49nna5bri3am";
-      })
-    ] ++ optional stdenv.cc.isClang ./qtwebengine-clang-fix.patch
-      ++ optional stdenv.isDarwin ./qtwebengine-darwin-no-platform-check.patch;
-  
-    qtwebkit = [ ./qtwebkit.patch ];
-    qtvirtualkeyboard = [
-      (fetchpatch {
-        name = "CVE-2018-19865-A.patch";
-        url = "https://codereview.qt-project.org/gitweb?p=qt/qtvirtualkeyboard.git;a=patch;h=61780a113f02b3c62fb14516fe8ea47d91f9ed9a";
-        sha256 = "0jd4nzaz9ndm9ryvrkav7kjs437l661288diklhbmgh249f8gki0";
-      })
-      (fetchpatch {
-        name = "CVE-2018-19865-B.patch";
-        url = "https://codereview.qt-project.org/gitweb?p=qt/qtvirtualkeyboard.git;a=patch;h=c0ac7a4c684e2fed60a72ceee53da89eea3f95a7";
-        sha256 = "0yvxrx5vx6845vgnq8ml3q93y61py5j0bvhqj7nqvpbmyj1wy1p3";
-
-      })
-      (fetchpatch {
-        name = "CVE-2018-19865-C.patch";
-        url = "https://codereview.qt-project.org/gitweb?p=qt/qtvirtualkeyboard.git;a=patch;h=a2e7b8412f56841e12ed20a39f4a38e32d3c1e30";
-        sha256 = "1yijysa9gy5xbxndx5ri0dkfrjqja0d1bsx52qz4mhzi4pkbib02";
-      })
-    ];
-
-  };
-
-  qtModule =
-    import ../qtModule.nix
-    {
-      inherit perl;
-      inherit (stdenv) lib;
-      # Use a variant of mkDerivation that does not include wrapQtApplications
-      # to avoid cyclic dependencies between Qt modules.
-      mkDerivation =
-        import ../mkDerivation.nix
-        { inherit (stdenv) lib; inherit debug; wrapQtAppsHook = null; }
-        stdenv.mkDerivation;
-    }
-    { inherit self srcs patches; };
-
-  addPackages = self: with self;
-    let
-      callPackage = self.newScope { inherit qtCompatVersion qtModule srcs; };
-    in {
-
-      mkDerivationWith =
-        import ../mkDerivation.nix
-        { inherit (stdenv) lib; inherit debug; inherit (self) wrapQtAppsHook; };
-
-      mkDerivation = mkDerivationWith stdenv.mkDerivation;
-
-      qtbase = callPackage ../modules/qtbase.nix {
-        inherit (srcs.qtbase) src version;
-        patches = patches.qtbase;
-        inherit bison cups harfbuzz libGL;
-        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;
-      };
-      qtnetworkauth = callPackage ../modules/qtnetworkauth.nix {};
-      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-full-${qtbase.version}" ([
-        qtcharts qtconnectivity qtdeclarative qtdoc qtgraphicaleffects
-        qtimageformats qtlocation qtmultimedia qtquickcontrols qtquickcontrols2
-        qtscript qtsensors qtserialport qtsvg qttools qttranslations
-        qtvirtualkeyboard qtwebchannel qtwebengine qtwebkit qtwebsockets
-        qtx11extras qtxmlpatterns
-      ] ++ optional (!stdenv.isDarwin) qtwayland
-        ++ optional (stdenv.isDarwin) qtmacextras);
-
-      qmake = makeSetupHook {
-        deps = [ self.qtbase.dev ];
-        substitutions = {
-          fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
-        };
-      } ../hooks/qmake-hook.sh;
-
-      wrapQtAppsHook = makeSetupHook {
-        deps =
-          [ self.qtbase.dev makeWrapper ]
-          ++ optional stdenv.isLinux self.qtwayland.dev;
-      } ../hooks/wrap-qt-apps-hook.sh;
-    };
-
-   self = makeScope newScope addPackages;
-
-in self
diff --git a/pkgs/development/libraries/qt-5/5.9/fetch.sh b/pkgs/development/libraries/qt-5/5.9/fetch.sh
deleted file mode 100644
index 17ebe1e532d..00000000000
--- a/pkgs/development/libraries/qt-5/5.9/fetch.sh
+++ /dev/null
@@ -1 +0,0 @@
-WGET_ARGS=( http://download.qt.io/official_releases/qt/5.9/5.9.7/submodules/ )
diff --git a/pkgs/development/libraries/qt-5/5.9/qtbase-fixguicmake.patch b/pkgs/development/libraries/qt-5/5.9/qtbase-fixguicmake.patch
deleted file mode 100644
index 8b46d432812..00000000000
--- a/pkgs/development/libraries/qt-5/5.9/qtbase-fixguicmake.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
-index 0bbc871..3673634 100644
---- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
-+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
-@@ -286,7 +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})
- 
--        set(imported_location \"$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
-+        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}
-diff --git a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in b/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
-index 5baf0fd..3583745 100644
---- a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
-+++ b/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 \"$${CMAKE_PLUGIN_DIR}$${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 \"$${CMAKE_PLUGIN_DIR}$${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.9/qtbase-openssl_1_1.patch b/pkgs/development/libraries/qt-5/5.9/qtbase-openssl_1_1.patch
deleted file mode 100644
index d5f4d7527cb..00000000000
--- a/pkgs/development/libraries/qt-5/5.9/qtbase-openssl_1_1.patch
+++ /dev/null
@@ -1,3985 +0,0 @@
-commit 2d88fc0ce4ac76924a65ffd797183de9422ba672
-Author: Andreas Rammhold <andreas@rammhold.de>
-Date:   Wed Mar 6 00:18:51 2019 +0100
-
-    openssl1.1 compat
-
-diff --git a/config.tests/openssl/openssl.cpp b/config.tests/openssl/openssl.cpp
-index 6c8a9e8f19..d33b62389c 100644
---- a/config.tests/openssl/openssl.cpp
-+++ b/config.tests/openssl/openssl.cpp
-@@ -39,8 +39,8 @@
- 
- #include <openssl/opensslv.h>
- 
--#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x0090700fL || OPENSSL_VERSION_NUMBER-0 >= 0x10100000L
--#  error "OpenSSL >= 0.9.7, and < 1.1.0 is required"
-+#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x0090700fL
-+#  error "OpenSSL >= 0.9.7 is required"
- #endif
- 
- #include <openssl/ssl.h>
-diff --git a/config.tests/openssl11/openssl.cpp b/config.tests/openssl11/openssl.cpp
-new file mode 100644
-index 0000000000..c20cc59deb
---- /dev/null
-+++ b/config.tests/openssl11/openssl.cpp
-@@ -0,0 +1,48 @@
-+/****************************************************************************
-+**
-+** Copyright (C) 2017 The Qt Company Ltd.
-+** Contact: https://www.qt.io/licensing/
-+**
-+** This file is part of the config.tests of the Qt Toolkit.
-+**
-+** $QT_BEGIN_LICENSE:LGPL$
-+** Commercial License Usage
-+** Licensees holding valid commercial Qt licenses may use this file in
-+** accordance with the commercial license agreement provided with the
-+** Software or, alternatively, in accordance with the terms contained in
-+** a written agreement between you and The Qt Company. For licensing terms
-+** and conditions see https://www.qt.io/terms-conditions. For further
-+** information use the contact form at https://www.qt.io/contact-us.
-+**
-+** GNU Lesser General Public License Usage
-+** Alternatively, this file may be used under the terms of the GNU Lesser
-+** General Public License version 3 as published by the Free Software
-+** Foundation and appearing in the file LICENSE.LGPL3 included in the
-+** packaging of this file. Please review the following information to
-+** ensure the GNU Lesser General Public License version 3 requirements
-+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-+**
-+** GNU General Public License Usage
-+** Alternatively, this file may be used under the terms of the GNU
-+** General Public License version 2.0 or (at your option) the GNU General
-+** Public license version 3 or any later version approved by the KDE Free
-+** Qt Foundation. The licenses are as published by the Free Software
-+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-+** included in the packaging of this file. Please review the following
-+** information to ensure the GNU General Public License requirements will
-+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-+** https://www.gnu.org/licenses/gpl-3.0.html.
-+**
-+** $QT_END_LICENSE$
-+**
-+****************************************************************************/
-+
-+#include <openssl/opensslv.h>
-+
-+#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x10100000L
-+#  error "OpenSSL >= 1.1 is required"
-+#endif
-+
-+int main()
-+{
-+}
-diff --git a/config.tests/openssl11/openssl11.pro b/config.tests/openssl11/openssl11.pro
-new file mode 100644
-index 0000000000..a023aee4aa
---- /dev/null
-+++ b/config.tests/openssl11/openssl11.pro
-@@ -0,0 +1,2 @@
-+SOURCES = openssl.cpp
-+CONFIG -= x11 qt
-diff --git a/src/network/configure.json b/src/network/configure.json
-index 2cf90ed94b..a021c0734b 100644
---- a/src/network/configure.json
-+++ b/src/network/configure.json
-@@ -77,6 +77,17 @@
-                 },
-                 { "libs": "-lssl -lcrypto", "condition": "!config.win32" }
-             ]
-+        },
-+        "openssl11": {
-+            "label": "OpenSSL v. 1.1 support",
-+            "type": "compile",
-+            "test": "openssl11",
-+	    "sources": [
-+		{
-+                    "comment": "placeholder for OPENSSL_PATH",
-+                    "libs": ""
-+                }
-+	    ]
-         }
-     },
- 
-@@ -182,7 +193,7 @@
-             "enable": "input.openssl == 'yes' || input.openssl == 'linked' || input.openssl == 'runtime'",
-             "disable": "input.openssl == 'no' || input.ssl == 'no'",
-             "autoDetect": "!config.winrt",
--            "condition": "!features.securetransport && (features.openssl-linked || libs.openssl_headers)",
-+            "condition": "!features.securetransport && (features.openssl-linked || libs.openssl_headers || feature.opensslv11)",
-             "output": [
-                 "privateFeature",
-                 { "type": "publicQtConfig", "condition": "!features.openssl-linked" },
-@@ -193,7 +204,7 @@
-             "label": "  Qt directly linked to OpenSSL",
-             "enable": "input.openssl == 'linked'",
-             "disable": "input.openssl != 'linked'",
--            "condition": "!features.securetransport && libs.openssl",
-+            "condition": "!features.securetransport && (libs.openssl || feature.opensslv11)",
-             "output": [
-                 "privateFeature",
-                 { "type": "define", "name": "QT_LINKED_OPENSSL" }
-@@ -213,6 +224,11 @@
-             "condition": "config.winrt || features.securetransport || features.openssl",
-             "output": [ "publicFeature", "feature" ]
-         },
-+        "opensslv11": {
-+            "label": "OpenSSL v. 1.1",
-+            "condition": "libs.openssl11",
-+            "output": ["publicFeature", "feature"]
-+        },
-         "sctp": {
-             "label": "SCTP",
-             "autoDetect": false,
-diff --git a/src/network/ssl/qsslcertificate_openssl.cpp b/src/network/ssl/qsslcertificate_openssl.cpp
-index 28b7eda54a..71e514a025 100644
---- a/src/network/ssl/qsslcertificate_openssl.cpp
-+++ b/src/network/ssl/qsslcertificate_openssl.cpp
-@@ -1,6 +1,7 @@
- /****************************************************************************
- **
--** Copyright (C) 2016 The Qt Company Ltd.
-+** Copyright (C) 2017 The Qt Company Ltd.
-+** Copyright (C) 2016 Richard J. Moore <rich@kde.org>
- ** Contact: https://www.qt.io/licensing/
- **
- ** This file is part of the QtNetwork module of the Qt Toolkit.
-@@ -64,12 +65,14 @@ bool QSslCertificate::operator==(const QSslCertificate &other) const
- uint qHash(const QSslCertificate &key, uint seed) Q_DECL_NOTHROW
- {
-     if (X509 * const x509 = key.d->x509) {
--        (void)q_X509_cmp(x509, x509); // populate x509->sha1_hash
--                                      // (if someone knows a better way...)
--        return qHashBits(x509->sha1_hash, SHA_DIGEST_LENGTH, seed);
--    } else {
--        return seed;
-+        const EVP_MD *sha1 = q_EVP_sha1();
-+        unsigned int len = 0;
-+        unsigned char md[EVP_MAX_MD_SIZE];
-+        q_X509_digest(x509, sha1, md, &len);
-+        return qHashBits(md, len, seed);
-     }
-+
-+    return seed;
- }
- 
- bool QSslCertificate::isNull() const
-@@ -89,8 +92,7 @@ QByteArray QSslCertificate::version() const
- {
-     QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));
-     if (d->versionString.isEmpty() && d->x509)
--        d->versionString =
--            QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->version)) + 1);
-+        d->versionString = QByteArray::number(qlonglong(q_X509_get_version(d->x509)) + 1);
- 
-     return d->versionString;
- }
-@@ -99,7 +101,7 @@ QByteArray QSslCertificate::serialNumber() const
- {
-     QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));
-     if (d->serialNumberString.isEmpty() && d->x509) {
--        ASN1_INTEGER *serialNumber = d->x509->cert_info->serialNumber;
-+        ASN1_INTEGER *serialNumber = q_X509_get_serialNumber(d->x509);
-         QByteArray hexString;
-         hexString.reserve(serialNumber->length * 3);
-         for (int a = 0; a < serialNumber->length; ++a) {
-@@ -199,14 +201,15 @@ QMultiMap<QSsl::AlternativeNameEntryType, QString> QSslCertificate::subjectAlter
-                 continue;
-             }
- 
--            const char *altNameStr = reinterpret_cast<const char *>(q_ASN1_STRING_data(genName->d.ia5));
-+            const char *altNameStr = reinterpret_cast<const char *>(q_ASN1_STRING_get0_data(genName->d.ia5));
-             const QString altName = QString::fromLatin1(altNameStr, len);
-             if (genName->type == GEN_DNS)
-                 result.insert(QSsl::DnsEntry, altName);
-             else if (genName->type == GEN_EMAIL)
-                 result.insert(QSsl::EmailEntry, altName);
-         }
--        q_sk_pop_free((STACK*)altNames, reinterpret_cast<void(*)(void*)>(q_sk_free));
-+
-+        q_OPENSSL_sk_pop_free((OPENSSL_STACK*)altNames, reinterpret_cast<void(*)(void*)>(q_OPENSSL_sk_free));
-     }
- 
-     return result;
-@@ -235,25 +238,26 @@ QSslKey QSslCertificate::publicKey() const
-     QSslKey key;
- 
-     key.d->type = QSsl::PublicKey;
--    X509_PUBKEY *xkey = d->x509->cert_info->key;
--    EVP_PKEY *pkey = q_X509_PUBKEY_get(xkey);
-+
-+    EVP_PKEY *pkey = q_X509_get_pubkey(d->x509);
-     Q_ASSERT(pkey);
-+    const int keyType = q_EVP_PKEY_type(q_EVP_PKEY_base_id(pkey));
- 
--    if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_RSA) {
-+    if (keyType == EVP_PKEY_RSA) {
-         key.d->rsa = q_EVP_PKEY_get1_RSA(pkey);
-         key.d->algorithm = QSsl::Rsa;
-         key.d->isNull = false;
--    } else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_DSA) {
-+    } else if (keyType == EVP_PKEY_DSA) {
-         key.d->dsa = q_EVP_PKEY_get1_DSA(pkey);
-         key.d->algorithm = QSsl::Dsa;
-         key.d->isNull = false;
- #ifndef OPENSSL_NO_EC
--    } else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_EC) {
-+    } else if (keyType == EVP_PKEY_EC) {
-         key.d->ec = q_EVP_PKEY_get1_EC_KEY(pkey);
-         key.d->algorithm = QSsl::Ec;
-         key.d->isNull = false;
- #endif
--    } else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_DH) {
-+    } else if (keyType == EVP_PKEY_DH) {
-         // DH unsupported
-     } else {
-         // error?
-@@ -275,7 +279,7 @@ static QVariant x509UnknownExtensionToValue(X509_EXTENSION *ext)
-     X509V3_EXT_METHOD *meth = const_cast<X509V3_EXT_METHOD *>(q_X509V3_EXT_get(ext));
-     if (!meth) {
-         ASN1_OCTET_STRING *value = q_X509_EXTENSION_get_data(ext);
--        QByteArray result( reinterpret_cast<const char *>(q_ASN1_STRING_data(value)),
-+        QByteArray result( reinterpret_cast<const char *>(q_ASN1_STRING_get0_data(value)),
-                            q_ASN1_STRING_length(value));
-         return result;
-     }
-@@ -371,7 +375,7 @@ static QVariant x509ExtensionToValue(X509_EXTENSION *ext)
-                         continue;
-                     }
- 
--                    const char *uriStr = reinterpret_cast<const char *>(q_ASN1_STRING_data(name->d.uniformResourceIdentifier));
-+                    const char *uriStr = reinterpret_cast<const char *>(q_ASN1_STRING_get0_data(name->d.uniformResourceIdentifier));
-                     const QString uri = QString::fromUtf8(uriStr, len);
- 
-                     result[QString::fromUtf8(QSslCertificatePrivate::asn1ObjectName(ad->method))] = uri;
-@@ -380,11 +384,7 @@ static QVariant x509ExtensionToValue(X509_EXTENSION *ext)
-                 }
-             }
- 
--#if OPENSSL_VERSION_NUMBER >= 0x10000000L
--            q_sk_pop_free((_STACK*)info, reinterpret_cast<void(*)(void*)>(q_sk_free));
--#else
--            q_sk_pop_free((STACK*)info, reinterpret_cast<void(*)(void*)>(q_sk_free));
--#endif
-+            q_OPENSSL_sk_pop_free((OPENSSL_STACK*)info, reinterpret_cast<void(*)(void *)>(q_OPENSSL_sk_free));
-             return result;
-         }
-         break;
-@@ -607,7 +607,11 @@ static QMap<QByteArray, QString> _q_mapFromX509Name(X509_NAME *name)
-         unsigned char *data = 0;
-         int size = q_ASN1_STRING_to_UTF8(&data, q_X509_NAME_ENTRY_get_data(e));
-         info.insertMulti(name, QString::fromUtf8((char*)data, size));
-+#if QT_CONFIG(opensslv11)
-+        q_CRYPTO_free(data, 0, 0);
-+#else
-         q_CRYPTO_free(data);
-+#endif
-     }
- 
-     return info;
-@@ -619,8 +623,9 @@ QSslCertificate QSslCertificatePrivate::QSslCertificate_from_X509(X509 *x509)
-     if (!x509 || !QSslSocket::supportsSsl())
-         return certificate;
- 
--    ASN1_TIME *nbef = q_X509_get_notBefore(x509);
--    ASN1_TIME *naft = q_X509_get_notAfter(x509);
-+    ASN1_TIME *nbef = q_X509_getm_notBefore(x509);
-+    ASN1_TIME *naft = q_X509_getm_notAfter(x509);
-+
-     certificate.d->notValidBefore = q_getTimeFromASN1(nbef);
-     certificate.d->notValidAfter = q_getTimeFromASN1(naft);
-     certificate.d->null = false;
-diff --git a/src/network/ssl/qsslcontext_openssl.cpp b/src/network/ssl/qsslcontext_openssl.cpp
-index c92d8fc3f8..cef503710c 100644
---- a/src/network/ssl/qsslcontext_openssl.cpp
-+++ b/src/network/ssl/qsslcontext_openssl.cpp
-@@ -1,6 +1,6 @@
- /****************************************************************************
- **
--** Copyright (C) 2016 The Qt Company Ltd.
-+** Copyright (C) 2017 The Qt Company Ltd.
- ** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
- ** Copyright (C) 2014 Governikus GmbH & Co. KG.
- ** Contact: https://www.qt.io/licensing/
-@@ -41,22 +41,14 @@
- 
- 
- #include <QtNetwork/qsslsocket.h>
--#include <QtNetwork/qssldiffiehellmanparameters.h>
--#include <QtCore/qmutex.h>
- 
- #include "private/qssl_p.h"
- #include "private/qsslcontext_openssl_p.h"
--#include "private/qsslsocket_p.h"
- #include "private/qsslsocket_openssl_p.h"
- #include "private/qsslsocket_openssl_symbols_p.h"
--#include "private/qssldiffiehellmanparameters_p.h"
- 
- QT_BEGIN_NAMESPACE
- 
--// defined in qsslsocket_openssl.cpp:
--extern int q_X509Callback(int ok, X509_STORE_CTX *ctx);
--extern QString getErrorsFromOpenSsl();
--
- QSslContext::QSslContext()
-     : ctx(0),
-     pkey(0),
-@@ -78,301 +70,6 @@ QSslContext::~QSslContext()
-         q_SSL_SESSION_free(session);
- }
- 
--static inline QString msgErrorSettingEllipticCurves(const QString &why)
--{
--    return QSslSocket::tr("Error when setting the elliptic curves (%1)").arg(why);
--}
--
--// static
--void QSslContext::initSslContext(QSslContext *sslContext, QSslSocket::SslMode mode, const QSslConfiguration &configuration, bool allowRootCertOnDemandLoading)
--{
--    sslContext->sslConfiguration = configuration;
--    sslContext->errorCode = QSslError::NoError;
--
--    bool client = (mode == QSslSocket::SslClientMode);
--
--    bool reinitialized = false;
--    bool unsupportedProtocol = false;
--init_context:
--    switch (sslContext->sslConfiguration.protocol()) {
--    case QSsl::SslV2:
--#ifndef OPENSSL_NO_SSL2
--        sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv2_client_method() : q_SSLv2_server_method());
--#else
--        // SSL 2 not supported by the system, but chosen deliberately -> error
--        sslContext->ctx = 0;
--        unsupportedProtocol = true;
--#endif
--        break;
--    case QSsl::SslV3:
--#ifndef OPENSSL_NO_SSL3_METHOD
--        sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv3_client_method() : q_SSLv3_server_method());
--#else
--        // SSL 3 not supported by the system, but chosen deliberately -> error
--        sslContext->ctx = 0;
--        unsupportedProtocol = true;
--#endif
--        break;
--    case QSsl::SecureProtocols:
--        // SSLv2 and SSLv3 will be disabled by SSL options
--        // But we need q_SSLv23_server_method() otherwise AnyProtocol will be unable to connect on Win32.
--    case QSsl::TlsV1SslV3:
--        // SSLv2 will will be disabled by SSL options
--    case QSsl::AnyProtocol:
--    default:
--        sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv23_client_method() : q_SSLv23_server_method());
--        break;
--    case QSsl::TlsV1_0:
--        sslContext->ctx = q_SSL_CTX_new(client ? q_TLSv1_client_method() : q_TLSv1_server_method());
--        break;
--    case QSsl::TlsV1_1:
--#if OPENSSL_VERSION_NUMBER >= 0x10001000L
--        sslContext->ctx = q_SSL_CTX_new(client ? q_TLSv1_1_client_method() : q_TLSv1_1_server_method());
--#else
--        // TLS 1.1 not supported by the system, but chosen deliberately -> error
--        sslContext->ctx = 0;
--        unsupportedProtocol = true;
--#endif
--        break;
--    case QSsl::TlsV1_2:
--#if OPENSSL_VERSION_NUMBER >= 0x10001000L
--        sslContext->ctx = q_SSL_CTX_new(client ? q_TLSv1_2_client_method() : q_TLSv1_2_server_method());
--#else
--        // TLS 1.2 not supported by the system, but chosen deliberately -> error
--        sslContext->ctx = 0;
--        unsupportedProtocol = true;
--#endif
--        break;
--    case QSsl::TlsV1_0OrLater:
--        // Specific protocols will be specified via SSL options.
--        sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv23_client_method() : q_SSLv23_server_method());
--        break;
--    case QSsl::TlsV1_1OrLater:
--    case QSsl::TlsV1_2OrLater:
--#if OPENSSL_VERSION_NUMBER >= 0x10001000L
--        // Specific protocols will be specified via SSL options.
--        sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv23_client_method() : q_SSLv23_server_method());
--#else
--        // TLS 1.1/1.2 not supported by the system, but chosen deliberately -> error
--        sslContext->ctx = 0;
--        unsupportedProtocol = true;
--#endif
--        break;
--    }
--
--    if (!sslContext->ctx) {
--        // After stopping Flash 10 the SSL library looses its ciphers. Try re-adding them
--        // by re-initializing the library.
--        if (!reinitialized) {
--            reinitialized = true;
--            if (q_SSL_library_init() == 1)
--                goto init_context;
--        }
--
--        sslContext->errorStr = QSslSocket::tr("Error creating SSL context (%1)").arg(
--            unsupportedProtocol ? QSslSocket::tr("unsupported protocol") : QSslSocketBackendPrivate::getErrorsFromOpenSsl()
--        );
--        sslContext->errorCode = QSslError::UnspecifiedError;
--        return;
--    }
--
--    // Enable bug workarounds.
--    long options = QSslSocketBackendPrivate::setupOpenSslOptions(configuration.protocol(), configuration.d->sslOptions);
--    q_SSL_CTX_set_options(sslContext->ctx, options);
--
--#if OPENSSL_VERSION_NUMBER >= 0x10000000L
--    // Tell OpenSSL to release memory early
--    // http://www.openssl.org/docs/ssl/SSL_CTX_set_mode.html
--    if (q_SSLeay() >= 0x10000000L)
--        q_SSL_CTX_set_mode(sslContext->ctx, SSL_MODE_RELEASE_BUFFERS);
--#endif
--
--    // Initialize ciphers
--    QByteArray cipherString;
--    bool first = true;
--    QList<QSslCipher> ciphers = sslContext->sslConfiguration.ciphers();
--    if (ciphers.isEmpty())
--        ciphers = QSslSocketPrivate::defaultCiphers();
--    for (const QSslCipher &cipher : qAsConst(ciphers)) {
--        if (first)
--            first = false;
--        else
--            cipherString.append(':');
--        cipherString.append(cipher.name().toLatin1());
--    }
--
--    if (!q_SSL_CTX_set_cipher_list(sslContext->ctx, cipherString.data())) {
--        sslContext->errorStr = QSslSocket::tr("Invalid or empty cipher list (%1)").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
--        sslContext->errorCode = QSslError::UnspecifiedError;
--        return;
--    }
--
--    const QDateTime now = QDateTime::currentDateTimeUtc();
--
--    // Add all our CAs to this store.
--    const auto caCertificates = sslContext->sslConfiguration.caCertificates();
--    for (const QSslCertificate &caCertificate : caCertificates) {
--        // From https://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html:
--        //
--        // If several CA certificates matching the name, key identifier, and
--        // serial number condition are available, only the first one will be
--        // examined. This may lead to unexpected results if the same CA
--        // certificate is available with different expiration dates. If a
--        // ``certificate expired'' verification error occurs, no other
--        // certificate will be searched. Make sure to not have expired
--        // certificates mixed with valid ones.
--        //
--        // See also: QSslSocketBackendPrivate::verify()
--        if (caCertificate.expiryDate() >= now) {
--            q_X509_STORE_add_cert(q_SSL_CTX_get_cert_store(sslContext->ctx), (X509 *)caCertificate.handle());
--        }
--    }
--
--    if (QSslSocketPrivate::s_loadRootCertsOnDemand && allowRootCertOnDemandLoading) {
--        // tell OpenSSL the directories where to look up the root certs on demand
--        const QList<QByteArray> unixDirs = QSslSocketPrivate::unixRootCertDirectories();
--        for (const QByteArray &unixDir : unixDirs)
--            q_SSL_CTX_load_verify_locations(sslContext->ctx, 0, unixDir.constData());
--    }
--
--    if (!sslContext->sslConfiguration.localCertificate().isNull()) {
--        // Require a private key as well.
--        if (sslContext->sslConfiguration.privateKey().isNull()) {
--            sslContext->errorStr = QSslSocket::tr("Cannot provide a certificate with no key, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
--            sslContext->errorCode = QSslError::UnspecifiedError;
--            return;
--        }
--
--        // Load certificate
--        if (!q_SSL_CTX_use_certificate(sslContext->ctx, (X509 *)sslContext->sslConfiguration.localCertificate().handle())) {
--            sslContext->errorStr = QSslSocket::tr("Error loading local certificate, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
--            sslContext->errorCode = QSslError::UnspecifiedError;
--            return;
--        }
--
--        if (configuration.d->privateKey.algorithm() == QSsl::Opaque) {
--            sslContext->pkey = reinterpret_cast<EVP_PKEY *>(configuration.d->privateKey.handle());
--        } else {
--            // Load private key
--            sslContext->pkey = q_EVP_PKEY_new();
--            // before we were using EVP_PKEY_assign_R* functions and did not use EVP_PKEY_free.
--            // this lead to a memory leak. Now we use the *_set1_* functions which do not
--            // take ownership of the RSA/DSA key instance because the QSslKey already has ownership.
--            if (configuration.d->privateKey.algorithm() == QSsl::Rsa)
--                q_EVP_PKEY_set1_RSA(sslContext->pkey, reinterpret_cast<RSA *>(configuration.d->privateKey.handle()));
--            else if (configuration.d->privateKey.algorithm() == QSsl::Dsa)
--                q_EVP_PKEY_set1_DSA(sslContext->pkey, reinterpret_cast<DSA *>(configuration.d->privateKey.handle()));
--#ifndef OPENSSL_NO_EC
--            else if (configuration.d->privateKey.algorithm() == QSsl::Ec)
--                q_EVP_PKEY_set1_EC_KEY(sslContext->pkey, reinterpret_cast<EC_KEY *>(configuration.d->privateKey.handle()));
--#endif
--        }
--
--        if (!q_SSL_CTX_use_PrivateKey(sslContext->ctx, sslContext->pkey)) {
--            sslContext->errorStr = QSslSocket::tr("Error loading private key, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
--            sslContext->errorCode = QSslError::UnspecifiedError;
--            return;
--        }
--        if (configuration.d->privateKey.algorithm() == QSsl::Opaque)
--            sslContext->pkey = 0; // Don't free the private key, it belongs to QSslKey
--
--        // Check if the certificate matches the private key.
--        if (!q_SSL_CTX_check_private_key(sslContext->ctx)) {
--            sslContext->errorStr = QSslSocket::tr("Private key does not certify public key, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
--            sslContext->errorCode = QSslError::UnspecifiedError;
--            return;
--        }
--
--        // If we have any intermediate certificates then we need to add them to our chain
--        bool first = true;
--        for (const QSslCertificate &cert : qAsConst(configuration.d->localCertificateChain)) {
--            if (first) {
--                first = false;
--                continue;
--            }
--            q_SSL_CTX_ctrl(sslContext->ctx, SSL_CTRL_EXTRA_CHAIN_CERT, 0,
--                           q_X509_dup(reinterpret_cast<X509 *>(cert.handle())));
--        }
--    }
--
--    // Initialize peer verification.
--    if (sslContext->sslConfiguration.peerVerifyMode() == QSslSocket::VerifyNone) {
--        q_SSL_CTX_set_verify(sslContext->ctx, SSL_VERIFY_NONE, 0);
--    } else {
--        q_SSL_CTX_set_verify(sslContext->ctx, SSL_VERIFY_PEER, q_X509Callback);
--    }
--
--    // Set verification depth.
--    if (sslContext->sslConfiguration.peerVerifyDepth() != 0)
--        q_SSL_CTX_set_verify_depth(sslContext->ctx, sslContext->sslConfiguration.peerVerifyDepth());
--
--    // set persisted session if the user set it
--    if (!configuration.sessionTicket().isEmpty())
--        sslContext->setSessionASN1(configuration.sessionTicket());
--
--    // Set temp DH params
--    QSslDiffieHellmanParameters dhparams = configuration.diffieHellmanParameters();
--
--    if (!dhparams.isValid()) {
--        sslContext->errorStr = QSslSocket::tr("Diffie-Hellman parameters are not valid");
--        sslContext->errorCode = QSslError::UnspecifiedError;
--        return;
--    }
--
--    if (!dhparams.isEmpty()) {
--        const QByteArray &params = dhparams.d->derData;
--        const char *ptr = params.constData();
--        DH *dh = q_d2i_DHparams(NULL, reinterpret_cast<const unsigned char **>(&ptr), params.length());
--        if (dh == NULL)
--            qFatal("q_d2i_DHparams failed to convert QSslDiffieHellmanParameters to DER form");
--        q_SSL_CTX_set_tmp_dh(sslContext->ctx, dh);
--        q_DH_free(dh);
--    }
--
--#ifndef OPENSSL_NO_EC
--#if OPENSSL_VERSION_NUMBER >= 0x10002000L
--    if (q_SSLeay() >= 0x10002000L) {
--        q_SSL_CTX_ctrl(sslContext->ctx, SSL_CTRL_SET_ECDH_AUTO, 1, NULL);
--    } else
--#endif
--    {
--        // Set temp ECDH params
--        EC_KEY *ecdh = 0;
--        ecdh = q_EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
--        q_SSL_CTX_set_tmp_ecdh(sslContext->ctx, ecdh);
--        q_EC_KEY_free(ecdh);
--    }
--#endif // OPENSSL_NO_EC
--
--#if OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK)
--    if (!client)
--        q_SSL_CTX_use_psk_identity_hint(sslContext->ctx, sslContext->sslConfiguration.preSharedKeyIdentityHint().constData());
--#endif // OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK)
--
--    const QVector<QSslEllipticCurve> qcurves = sslContext->sslConfiguration.ellipticCurves();
--    if (!qcurves.isEmpty()) {
--#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !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,
--            // but let's avoid a copy into a temporary array
--            if (!q_SSL_CTX_ctrl(sslContext->ctx,
--                                SSL_CTRL_SET_CURVES,
--                                qcurves.size(),
--                                const_cast<int *>(reinterpret_cast<const int *>(qcurves.data())))) {
--                sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
--                sslContext->errorCode = QSslError::UnspecifiedError;
--            }
--        } else
--#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L && !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"));
--            sslContext->errorCode = QSslError::UnspecifiedError;
--        }
--    }
--}
--
- QSslContext* QSslContext::fromConfiguration(QSslSocket::SslMode mode, const QSslConfiguration &configuration, bool allowRootCertOnDemandLoading)
- {
-     QSslContext *sslContext = new QSslContext();
-@@ -463,7 +160,7 @@ SSL* QSslContext::createSsl()
-         m_npnContext.len = m_supportedNPNVersions.count();
-         m_npnContext.status = QSslConfiguration::NextProtocolNegotiationNone;
- #if OPENSSL_VERSION_NUMBER >= 0x10002000L
--        if (q_SSLeay() >= 0x10002000L) {
-+        if (QSslSocket::sslLibraryVersionNumber() >= 0x10002000L) {
-             // Callback's type has a parameter 'const unsigned char ** out'
-             // since it was introduced in 1.0.2. Internally, OpenSSL's own code
-             // (tests/examples) cast it to unsigned char * (since it's 'out').
-@@ -508,7 +205,7 @@ bool QSslContext::cacheSession(SSL* ssl)
-             unsigned char *data = reinterpret_cast<unsigned char *>(m_sessionASN1.data());
-             if (!q_i2d_SSL_SESSION(session, &data))
-                 qCWarning(lcSsl, "could not store persistent version of SSL session");
--            m_sessionTicketLifeTimeHint = session->tlsext_tick_lifetime_hint;
-+            m_sessionTicketLifeTimeHint = q_SSL_SESSION_get_ticket_lifetime_hint(session);
-         }
-     }
- 
-diff --git a/src/network/ssl/qsslcontext_openssl11.cpp b/src/network/ssl/qsslcontext_openssl11.cpp
-new file mode 100644
-index 0000000000..787b6ae3f5
---- /dev/null
-+++ b/src/network/ssl/qsslcontext_openssl11.cpp
-@@ -0,0 +1,277 @@
-+/****************************************************************************
-+**
-+** Copyright (C) 2017 The Qt Company Ltd.
-+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
-+** Copyright (C) 2014 Governikus GmbH & Co. KG.
-+** Copyright (C) 2016 Richard J. Moore <rich@kde.org>
-+** Contact: https://www.qt.io/licensing/
-+**
-+** This file is part of the QtNetwork module of the Qt Toolkit.
-+**
-+** $QT_BEGIN_LICENSE:LGPL$
-+** Commercial License Usage
-+** Licensees holding valid commercial Qt licenses may use this file in
-+** accordance with the commercial license agreement provided with the
-+** Software or, alternatively, in accordance with the terms contained in
-+** a written agreement between you and The Qt Company. For licensing terms
-+** and conditions see https://www.qt.io/terms-conditions. For further
-+** information use the contact form at https://www.qt.io/contact-us.
-+**
-+** GNU Lesser General Public License Usage
-+** Alternatively, this file may be used under the terms of the GNU Lesser
-+** General Public License version 3 as published by the Free Software
-+** Foundation and appearing in the file LICENSE.LGPL3 included in the
-+** packaging of this file. Please review the following information to
-+** ensure the GNU Lesser General Public License version 3 requirements
-+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-+**
-+** GNU General Public License Usage
-+** Alternatively, this file may be used under the terms of the GNU
-+** General Public License version 2.0 or (at your option) the GNU General
-+** Public license version 3 or any later version approved by the KDE Free
-+** Qt Foundation. The licenses are as published by the Free Software
-+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-+** included in the packaging of this file. Please review the following
-+** information to ensure the GNU General Public License requirements will
-+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-+** https://www.gnu.org/licenses/gpl-3.0.html.
-+**
-+** $QT_END_LICENSE$
-+**
-+****************************************************************************/
-+
-+
-+#include <QtNetwork/qsslsocket.h>
-+#include <QtNetwork/qssldiffiehellmanparameters.h>
-+
-+#include "private/qssl_p.h"
-+#include "private/qsslcontext_openssl_p.h"
-+#include "private/qsslsocket_p.h"
-+#include "private/qsslsocket_openssl_p.h"
-+#include "private/qsslsocket_openssl_symbols_p.h"
-+#include "private/qssldiffiehellmanparameters_p.h"
-+
-+#include <vector>
-+
-+QT_BEGIN_NAMESPACE
-+
-+// defined in qsslsocket_openssl.cpp:
-+extern int q_X509Callback(int ok, X509_STORE_CTX *ctx);
-+extern QString getErrorsFromOpenSsl();
-+
-+static inline QString msgErrorSettingEllipticCurves(const QString &why)
-+{
-+    return QSslSocket::tr("Error when setting the elliptic curves (%1)").arg(why);
-+}
-+
-+// static
-+void QSslContext::initSslContext(QSslContext *sslContext, QSslSocket::SslMode mode, const QSslConfiguration &configuration, bool allowRootCertOnDemandLoading)
-+{
-+    sslContext->sslConfiguration = configuration;
-+    sslContext->errorCode = QSslError::NoError;
-+
-+    bool client = (mode == QSslSocket::SslClientMode);
-+
-+    bool reinitialized = false;
-+    bool unsupportedProtocol = false;
-+init_context:
-+    if (sslContext->sslConfiguration.protocol() == QSsl::SslV2) {
-+        // SSL 2 is no longer supported, but chosen deliberately -> error
-+        sslContext->ctx = nullptr;
-+        unsupportedProtocol = true;
-+    } else {
-+        // The ssl options will actually control the supported methods
-+        sslContext->ctx = q_SSL_CTX_new(client ? q_TLS_client_method() : q_TLS_server_method());
-+    }
-+
-+    if (!sslContext->ctx) {
-+        // After stopping Flash 10 the SSL library loses its ciphers. Try re-adding them
-+        // by re-initializing the library.
-+        if (!reinitialized) {
-+            reinitialized = true;
-+            if (q_OPENSSL_init_ssl(0, nullptr) == 1)
-+                goto init_context;
-+        }
-+
-+        sslContext->errorStr = QSslSocket::tr("Error creating SSL context (%1)").arg(
-+            unsupportedProtocol ? QSslSocket::tr("unsupported protocol") : QSslSocketBackendPrivate::getErrorsFromOpenSsl()
-+        );
-+        sslContext->errorCode = QSslError::UnspecifiedError;
-+        return;
-+    }
-+
-+    // Enable bug workarounds.
-+    long options = QSslSocketBackendPrivate::setupOpenSslOptions(configuration.protocol(), configuration.d->sslOptions);
-+    q_SSL_CTX_set_options(sslContext->ctx, options);
-+
-+    // Tell OpenSSL to release memory early
-+    // http://www.openssl.org/docs/ssl/SSL_CTX_set_mode.html
-+    q_SSL_CTX_set_mode(sslContext->ctx, SSL_MODE_RELEASE_BUFFERS);
-+
-+    // Initialize ciphers
-+    QByteArray cipherString;
-+    bool first = true;
-+    QList<QSslCipher> ciphers = sslContext->sslConfiguration.ciphers();
-+    if (ciphers.isEmpty())
-+        ciphers = QSslSocketPrivate::defaultCiphers();
-+    for (const QSslCipher &cipher : qAsConst(ciphers)) {
-+        if (first)
-+            first = false;
-+        else
-+            cipherString.append(':');
-+        cipherString.append(cipher.name().toLatin1());
-+    }
-+
-+    if (!q_SSL_CTX_set_cipher_list(sslContext->ctx, cipherString.data())) {
-+        sslContext->errorStr = QSslSocket::tr("Invalid or empty cipher list (%1)").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
-+        sslContext->errorCode = QSslError::UnspecifiedError;
-+        return;
-+    }
-+
-+    const QDateTime now = QDateTime::currentDateTimeUtc();
-+
-+    // Add all our CAs to this store.
-+    const auto caCertificates = sslContext->sslConfiguration.caCertificates();
-+    for (const QSslCertificate &caCertificate : caCertificates) {
-+        // From https://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html:
-+        //
-+        // If several CA certificates matching the name, key identifier, and
-+        // serial number condition are available, only the first one will be
-+        // examined. This may lead to unexpected results if the same CA
-+        // certificate is available with different expiration dates. If a
-+        // ``certificate expired'' verification error occurs, no other
-+        // certificate will be searched. Make sure to not have expired
-+        // certificates mixed with valid ones.
-+        //
-+        // See also: QSslSocketBackendPrivate::verify()
-+        if (caCertificate.expiryDate() >= now) {
-+            q_X509_STORE_add_cert(q_SSL_CTX_get_cert_store(sslContext->ctx), (X509 *)caCertificate.handle());
-+        }
-+    }
-+
-+    if (QSslSocketPrivate::s_loadRootCertsOnDemand && allowRootCertOnDemandLoading) {
-+        // tell OpenSSL the directories where to look up the root certs on demand
-+        const QList<QByteArray> unixDirs = QSslSocketPrivate::unixRootCertDirectories();
-+        for (const QByteArray &unixDir : unixDirs)
-+            q_SSL_CTX_load_verify_locations(sslContext->ctx, nullptr, unixDir.constData());
-+    }
-+
-+    if (!sslContext->sslConfiguration.localCertificate().isNull()) {
-+        // Require a private key as well.
-+        if (sslContext->sslConfiguration.privateKey().isNull()) {
-+            sslContext->errorStr = QSslSocket::tr("Cannot provide a certificate with no key, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
-+            sslContext->errorCode = QSslError::UnspecifiedError;
-+            return;
-+        }
-+
-+        // Load certificate
-+        if (!q_SSL_CTX_use_certificate(sslContext->ctx, (X509 *)sslContext->sslConfiguration.localCertificate().handle())) {
-+            sslContext->errorStr = QSslSocket::tr("Error loading local certificate, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
-+            sslContext->errorCode = QSslError::UnspecifiedError;
-+            return;
-+        }
-+
-+        if (configuration.d->privateKey.algorithm() == QSsl::Opaque) {
-+            sslContext->pkey = reinterpret_cast<EVP_PKEY *>(configuration.d->privateKey.handle());
-+        } else {
-+            // Load private key
-+            sslContext->pkey = q_EVP_PKEY_new();
-+            // before we were using EVP_PKEY_assign_R* functions and did not use EVP_PKEY_free.
-+            // this lead to a memory leak. Now we use the *_set1_* functions which do not
-+            // take ownership of the RSA/DSA key instance because the QSslKey already has ownership.
-+            if (configuration.d->privateKey.algorithm() == QSsl::Rsa)
-+                q_EVP_PKEY_set1_RSA(sslContext->pkey, reinterpret_cast<RSA *>(configuration.d->privateKey.handle()));
-+            else if (configuration.d->privateKey.algorithm() == QSsl::Dsa)
-+                q_EVP_PKEY_set1_DSA(sslContext->pkey, reinterpret_cast<DSA *>(configuration.d->privateKey.handle()));
-+#ifndef OPENSSL_NO_EC
-+            else if (configuration.d->privateKey.algorithm() == QSsl::Ec)
-+                q_EVP_PKEY_set1_EC_KEY(sslContext->pkey, reinterpret_cast<EC_KEY *>(configuration.d->privateKey.handle()));
-+#endif
-+        }
-+
-+        if (!q_SSL_CTX_use_PrivateKey(sslContext->ctx, sslContext->pkey)) {
-+            sslContext->errorStr = QSslSocket::tr("Error loading private key, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
-+            sslContext->errorCode = QSslError::UnspecifiedError;
-+            return;
-+        }
-+        if (configuration.d->privateKey.algorithm() == QSsl::Opaque)
-+            sslContext->pkey = nullptr; // Don't free the private key, it belongs to QSslKey
-+
-+        // Check if the certificate matches the private key.
-+        if (!q_SSL_CTX_check_private_key(sslContext->ctx)) {
-+            sslContext->errorStr = QSslSocket::tr("Private key does not certify public key, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
-+            sslContext->errorCode = QSslError::UnspecifiedError;
-+            return;
-+        }
-+
-+        // If we have any intermediate certificates then we need to add them to our chain
-+        bool first = true;
-+        for (const QSslCertificate &cert : qAsConst(configuration.d->localCertificateChain)) {
-+            if (first) {
-+                first = false;
-+                continue;
-+            }
-+            q_SSL_CTX_ctrl(sslContext->ctx, SSL_CTRL_EXTRA_CHAIN_CERT, 0,
-+                           q_X509_dup(reinterpret_cast<X509 *>(cert.handle())));
-+        }
-+    }
-+
-+    // Initialize peer verification.
-+    if (sslContext->sslConfiguration.peerVerifyMode() == QSslSocket::VerifyNone) {
-+        q_SSL_CTX_set_verify(sslContext->ctx, SSL_VERIFY_NONE, nullptr);
-+    } else {
-+        q_SSL_CTX_set_verify(sslContext->ctx, SSL_VERIFY_PEER, q_X509Callback);
-+    }
-+
-+    // Set verification depth.
-+    if (sslContext->sslConfiguration.peerVerifyDepth() != 0)
-+        q_SSL_CTX_set_verify_depth(sslContext->ctx, sslContext->sslConfiguration.peerVerifyDepth());
-+
-+    // set persisted session if the user set it
-+    if (!configuration.sessionTicket().isEmpty())
-+        sslContext->setSessionASN1(configuration.sessionTicket());
-+
-+    // Set temp DH params
-+    QSslDiffieHellmanParameters dhparams = configuration.diffieHellmanParameters();
-+
-+    if (!dhparams.isValid()) {
-+        sslContext->errorStr = QSslSocket::tr("Diffie-Hellman parameters are not valid");
-+        sslContext->errorCode = QSslError::UnspecifiedError;
-+        return;
-+    }
-+
-+    if (!dhparams.isEmpty()) {
-+        const QByteArray &params = dhparams.d->derData;
-+        const char *ptr = params.constData();
-+        DH *dh = q_d2i_DHparams(NULL, reinterpret_cast<const unsigned char **>(&ptr), params.length());
-+        if (dh == NULL)
-+            qFatal("q_d2i_DHparams failed to convert QSslDiffieHellmanParameters to DER form");
-+        q_SSL_CTX_set_tmp_dh(sslContext->ctx, dh);
-+        q_DH_free(dh);
-+    }
-+
-+#ifndef OPENSSL_NO_PSK
-+    if (!client)
-+        q_SSL_CTX_use_psk_identity_hint(sslContext->ctx, sslContext->sslConfiguration.preSharedKeyIdentityHint().constData());
-+#endif // !OPENSSL_NO_PSK
-+
-+    const QVector<QSslEllipticCurve> qcurves = sslContext->sslConfiguration.ellipticCurves();
-+    if (!qcurves.isEmpty()) {
-+#ifdef OPENSSL_NO_EC
-+        sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocket::tr("OpenSSL version with disabled elliptic curves"));
-+        sslContext->errorCode = QSslError::UnspecifiedError;
-+#else
-+        // Set the curves to be used.
-+        std::vector<int> curves;
-+        curves.reserve(qcurves.size());
-+        for (const auto &sslCurve : qcurves)
-+            curves.push_back(sslCurve.id);
-+        if (!q_SSL_CTX_ctrl(sslContext->ctx, SSL_CTRL_SET_CURVES, long(curves.size()), &curves[0])) {
-+            sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
-+            sslContext->errorCode = QSslError::UnspecifiedError;
-+        }
-+#endif
-+    }
-+}
-+
-+QT_END_NAMESPACE
-diff --git a/src/network/ssl/qsslcontext_opensslpre11.cpp b/src/network/ssl/qsslcontext_opensslpre11.cpp
-new file mode 100644
-index 0000000000..9c01c2f2dc
---- /dev/null
-+++ b/src/network/ssl/qsslcontext_opensslpre11.cpp
-@@ -0,0 +1,354 @@
-+/****************************************************************************
-+**
-+** Copyright (C) 2017 The Qt Company Ltd.
-+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
-+** Copyright (C) 2014 Governikus GmbH & Co. KG.
-+** Contact: https://www.qt.io/licensing/
-+**
-+** This file is part of the QtNetwork module of the Qt Toolkit.
-+**
-+** $QT_BEGIN_LICENSE:LGPL$
-+** Commercial License Usage
-+** Licensees holding valid commercial Qt licenses may use this file in
-+** accordance with the commercial license agreement provided with the
-+** Software or, alternatively, in accordance with the terms contained in
-+** a written agreement between you and The Qt Company. For licensing terms
-+** and conditions see https://www.qt.io/terms-conditions. For further
-+** information use the contact form at https://www.qt.io/contact-us.
-+**
-+** GNU Lesser General Public License Usage
-+** Alternatively, this file may be used under the terms of the GNU Lesser
-+** General Public License version 3 as published by the Free Software
-+** Foundation and appearing in the file LICENSE.LGPL3 included in the
-+** packaging of this file. Please review the following information to
-+** ensure the GNU Lesser General Public License version 3 requirements
-+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-+**
-+** GNU General Public License Usage
-+** Alternatively, this file may be used under the terms of the GNU
-+** General Public License version 2.0 or (at your option) the GNU General
-+** Public license version 3 or any later version approved by the KDE Free
-+** Qt Foundation. The licenses are as published by the Free Software
-+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-+** included in the packaging of this file. Please review the following
-+** information to ensure the GNU General Public License requirements will
-+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-+** https://www.gnu.org/licenses/gpl-3.0.html.
-+**
-+** $QT_END_LICENSE$
-+**
-+****************************************************************************/
-+
-+
-+#include <QtNetwork/qsslsocket.h>
-+#include <QtNetwork/qssldiffiehellmanparameters.h>
-+
-+#include "private/qssl_p.h"
-+#include "private/qsslcontext_openssl_p.h"
-+#include "private/qsslsocket_p.h"
-+#include "private/qsslsocket_openssl_p.h"
-+#include "private/qsslsocket_openssl_symbols_p.h"
-+#include "private/qssldiffiehellmanparameters_p.h"
-+
-+QT_BEGIN_NAMESPACE
-+
-+// defined in qsslsocket_openssl.cpp:
-+extern int q_X509Callback(int ok, X509_STORE_CTX *ctx);
-+extern QString getErrorsFromOpenSsl();
-+
-+static inline QString msgErrorSettingEllipticCurves(const QString &why)
-+{
-+    return QSslSocket::tr("Error when setting the elliptic curves (%1)").arg(why);
-+}
-+
-+// static
-+void QSslContext::initSslContext(QSslContext *sslContext, QSslSocket::SslMode mode, const QSslConfiguration &configuration, bool allowRootCertOnDemandLoading)
-+{
-+    sslContext->sslConfiguration = configuration;
-+    sslContext->errorCode = QSslError::NoError;
-+
-+    bool client = (mode == QSslSocket::SslClientMode);
-+
-+    bool reinitialized = false;
-+    bool unsupportedProtocol = false;
-+init_context:
-+    switch (sslContext->sslConfiguration.protocol()) {
-+    case QSsl::SslV2:
-+#ifndef OPENSSL_NO_SSL2
-+        sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv2_client_method() : q_SSLv2_server_method());
-+#else
-+        // SSL 2 not supported by the system, but chosen deliberately -> error
-+        sslContext->ctx = 0;
-+        unsupportedProtocol = true;
-+#endif
-+        break;
-+    case QSsl::SslV3:
-+#ifndef OPENSSL_NO_SSL3_METHOD
-+        sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv3_client_method() : q_SSLv3_server_method());
-+#else
-+        // SSL 3 not supported by the system, but chosen deliberately -> error
-+        sslContext->ctx = 0;
-+        unsupportedProtocol = true;
-+#endif
-+        break;
-+    case QSsl::SecureProtocols:
-+        // SSLv2 and SSLv3 will be disabled by SSL options
-+        // But we need q_SSLv23_server_method() otherwise AnyProtocol will be unable to connect on Win32.
-+    case QSsl::TlsV1SslV3:
-+        // SSLv2 will will be disabled by SSL options
-+    case QSsl::AnyProtocol:
-+    default:
-+        sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv23_client_method() : q_SSLv23_server_method());
-+        break;
-+    case QSsl::TlsV1_0:
-+        sslContext->ctx = q_SSL_CTX_new(client ? q_TLSv1_client_method() : q_TLSv1_server_method());
-+        break;
-+    case QSsl::TlsV1_1:
-+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
-+        sslContext->ctx = q_SSL_CTX_new(client ? q_TLSv1_1_client_method() : q_TLSv1_1_server_method());
-+#else
-+        // TLS 1.1 not supported by the system, but chosen deliberately -> error
-+        sslContext->ctx = 0;
-+        unsupportedProtocol = true;
-+#endif
-+        break;
-+    case QSsl::TlsV1_2:
-+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
-+        sslContext->ctx = q_SSL_CTX_new(client ? q_TLSv1_2_client_method() : q_TLSv1_2_server_method());
-+#else
-+        // TLS 1.2 not supported by the system, but chosen deliberately -> error
-+        sslContext->ctx = 0;
-+        unsupportedProtocol = true;
-+#endif
-+        break;
-+    case QSsl::TlsV1_0OrLater:
-+        // Specific protocols will be specified via SSL options.
-+        sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv23_client_method() : q_SSLv23_server_method());
-+        break;
-+    case QSsl::TlsV1_1OrLater:
-+    case QSsl::TlsV1_2OrLater:
-+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
-+        // Specific protocols will be specified via SSL options.
-+        sslContext->ctx = q_SSL_CTX_new(client ? q_SSLv23_client_method() : q_SSLv23_server_method());
-+#else
-+        // TLS 1.1/1.2 not supported by the system, but chosen deliberately -> error
-+        sslContext->ctx = 0;
-+        unsupportedProtocol = true;
-+#endif
-+        break;
-+    }
-+
-+    if (!sslContext->ctx) {
-+        // After stopping Flash 10 the SSL library loses its ciphers. Try re-adding them
-+        // by re-initializing the library.
-+        if (!reinitialized) {
-+            reinitialized = true;
-+            if (q_SSL_library_init() == 1)
-+                goto init_context;
-+        }
-+
-+        sslContext->errorStr = QSslSocket::tr("Error creating SSL context (%1)").arg(
-+            unsupportedProtocol ? QSslSocket::tr("unsupported protocol") : QSslSocketBackendPrivate::getErrorsFromOpenSsl()
-+        );
-+        sslContext->errorCode = QSslError::UnspecifiedError;
-+        return;
-+    }
-+
-+    // Enable bug workarounds.
-+    long options = QSslSocketBackendPrivate::setupOpenSslOptions(configuration.protocol(), configuration.d->sslOptions);
-+    q_SSL_CTX_set_options(sslContext->ctx, options);
-+
-+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-+    // Tell OpenSSL to release memory early
-+    // http://www.openssl.org/docs/ssl/SSL_CTX_set_mode.html
-+    if (q_SSLeay() >= 0x10000000L)
-+        q_SSL_CTX_set_mode(sslContext->ctx, SSL_MODE_RELEASE_BUFFERS);
-+#endif
-+
-+    // Initialize ciphers
-+    QByteArray cipherString;
-+    bool first = true;
-+    QList<QSslCipher> ciphers = sslContext->sslConfiguration.ciphers();
-+    if (ciphers.isEmpty())
-+        ciphers = QSslSocketPrivate::defaultCiphers();
-+    for (const QSslCipher &cipher : qAsConst(ciphers)) {
-+        if (first)
-+            first = false;
-+        else
-+            cipherString.append(':');
-+        cipherString.append(cipher.name().toLatin1());
-+    }
-+
-+    if (!q_SSL_CTX_set_cipher_list(sslContext->ctx, cipherString.data())) {
-+        sslContext->errorStr = QSslSocket::tr("Invalid or empty cipher list (%1)").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
-+        sslContext->errorCode = QSslError::UnspecifiedError;
-+        return;
-+    }
-+
-+    const QDateTime now = QDateTime::currentDateTimeUtc();
-+
-+    // Add all our CAs to this store.
-+    const auto caCertificates = sslContext->sslConfiguration.caCertificates();
-+    for (const QSslCertificate &caCertificate : caCertificates) {
-+        // From https://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html:
-+        //
-+        // If several CA certificates matching the name, key identifier, and
-+        // serial number condition are available, only the first one will be
-+        // examined. This may lead to unexpected results if the same CA
-+        // certificate is available with different expiration dates. If a
-+        // ``certificate expired'' verification error occurs, no other
-+        // certificate will be searched. Make sure to not have expired
-+        // certificates mixed with valid ones.
-+        //
-+        // See also: QSslSocketBackendPrivate::verify()
-+        if (caCertificate.expiryDate() >= now) {
-+            q_X509_STORE_add_cert(q_SSL_CTX_get_cert_store(sslContext->ctx), (X509 *)caCertificate.handle());
-+        }
-+    }
-+
-+    if (QSslSocketPrivate::s_loadRootCertsOnDemand && allowRootCertOnDemandLoading) {
-+        // tell OpenSSL the directories where to look up the root certs on demand
-+        const QList<QByteArray> unixDirs = QSslSocketPrivate::unixRootCertDirectories();
-+        for (const QByteArray &unixDir : unixDirs)
-+            q_SSL_CTX_load_verify_locations(sslContext->ctx, 0, unixDir.constData());
-+    }
-+
-+    if (!sslContext->sslConfiguration.localCertificate().isNull()) {
-+        // Require a private key as well.
-+        if (sslContext->sslConfiguration.privateKey().isNull()) {
-+            sslContext->errorStr = QSslSocket::tr("Cannot provide a certificate with no key, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
-+            sslContext->errorCode = QSslError::UnspecifiedError;
-+            return;
-+        }
-+
-+        // Load certificate
-+        if (!q_SSL_CTX_use_certificate(sslContext->ctx, (X509 *)sslContext->sslConfiguration.localCertificate().handle())) {
-+            sslContext->errorStr = QSslSocket::tr("Error loading local certificate, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
-+            sslContext->errorCode = QSslError::UnspecifiedError;
-+            return;
-+        }
-+
-+        if (configuration.d->privateKey.algorithm() == QSsl::Opaque) {
-+            sslContext->pkey = reinterpret_cast<EVP_PKEY *>(configuration.d->privateKey.handle());
-+        } else {
-+            // Load private key
-+            sslContext->pkey = q_EVP_PKEY_new();
-+            // before we were using EVP_PKEY_assign_R* functions and did not use EVP_PKEY_free.
-+            // this lead to a memory leak. Now we use the *_set1_* functions which do not
-+            // take ownership of the RSA/DSA key instance because the QSslKey already has ownership.
-+            if (configuration.d->privateKey.algorithm() == QSsl::Rsa)
-+                q_EVP_PKEY_set1_RSA(sslContext->pkey, reinterpret_cast<RSA *>(configuration.d->privateKey.handle()));
-+            else if (configuration.d->privateKey.algorithm() == QSsl::Dsa)
-+                q_EVP_PKEY_set1_DSA(sslContext->pkey, reinterpret_cast<DSA *>(configuration.d->privateKey.handle()));
-+#ifndef OPENSSL_NO_EC
-+            else if (configuration.d->privateKey.algorithm() == QSsl::Ec)
-+                q_EVP_PKEY_set1_EC_KEY(sslContext->pkey, reinterpret_cast<EC_KEY *>(configuration.d->privateKey.handle()));
-+#endif
-+        }
-+
-+        if (!q_SSL_CTX_use_PrivateKey(sslContext->ctx, sslContext->pkey)) {
-+            sslContext->errorStr = QSslSocket::tr("Error loading private key, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
-+            sslContext->errorCode = QSslError::UnspecifiedError;
-+            return;
-+        }
-+        if (configuration.d->privateKey.algorithm() == QSsl::Opaque)
-+            sslContext->pkey = 0; // Don't free the private key, it belongs to QSslKey
-+
-+        // Check if the certificate matches the private key.
-+        if (!q_SSL_CTX_check_private_key(sslContext->ctx)) {
-+            sslContext->errorStr = QSslSocket::tr("Private key does not certify public key, %1").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
-+            sslContext->errorCode = QSslError::UnspecifiedError;
-+            return;
-+        }
-+
-+        // If we have any intermediate certificates then we need to add them to our chain
-+        bool first = true;
-+        for (const QSslCertificate &cert : qAsConst(configuration.d->localCertificateChain)) {
-+            if (first) {
-+                first = false;
-+                continue;
-+            }
-+            q_SSL_CTX_ctrl(sslContext->ctx, SSL_CTRL_EXTRA_CHAIN_CERT, 0,
-+                           q_X509_dup(reinterpret_cast<X509 *>(cert.handle())));
-+        }
-+    }
-+
-+    // Initialize peer verification.
-+    if (sslContext->sslConfiguration.peerVerifyMode() == QSslSocket::VerifyNone) {
-+        q_SSL_CTX_set_verify(sslContext->ctx, SSL_VERIFY_NONE, 0);
-+    } else {
-+        q_SSL_CTX_set_verify(sslContext->ctx, SSL_VERIFY_PEER, q_X509Callback);
-+    }
-+
-+    // Set verification depth.
-+    if (sslContext->sslConfiguration.peerVerifyDepth() != 0)
-+        q_SSL_CTX_set_verify_depth(sslContext->ctx, sslContext->sslConfiguration.peerVerifyDepth());
-+
-+    // set persisted session if the user set it
-+    if (!configuration.sessionTicket().isEmpty())
-+        sslContext->setSessionASN1(configuration.sessionTicket());
-+
-+    // Set temp DH params
-+    QSslDiffieHellmanParameters dhparams = configuration.diffieHellmanParameters();
-+
-+    if (!dhparams.isValid()) {
-+        sslContext->errorStr = QSslSocket::tr("Diffie-Hellman parameters are not valid");
-+        sslContext->errorCode = QSslError::UnspecifiedError;
-+        return;
-+    }
-+
-+    if (!dhparams.isEmpty()) {
-+        const QByteArray &params = dhparams.d->derData;
-+        const char *ptr = params.constData();
-+        DH *dh = q_d2i_DHparams(NULL, reinterpret_cast<const unsigned char **>(&ptr), params.length());
-+        if (dh == NULL)
-+            qFatal("q_d2i_DHparams failed to convert QSslDiffieHellmanParameters to DER form");
-+        q_SSL_CTX_set_tmp_dh(sslContext->ctx, dh);
-+        q_DH_free(dh);
-+    }
-+
-+#ifndef OPENSSL_NO_EC
-+#if OPENSSL_VERSION_NUMBER >= 0x10002000L
-+    if (q_SSLeay() >= 0x10002000L) {
-+        q_SSL_CTX_ctrl(sslContext->ctx, SSL_CTRL_SET_ECDH_AUTO, 1, NULL);
-+    } else
-+#endif
-+    {
-+        // Set temp ECDH params
-+        EC_KEY *ecdh = 0;
-+        ecdh = q_EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
-+        q_SSL_CTX_set_tmp_ecdh(sslContext->ctx, ecdh);
-+        q_EC_KEY_free(ecdh);
-+    }
-+#endif // OPENSSL_NO_EC
-+
-+#if OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK)
-+    if (!client)
-+        q_SSL_CTX_use_psk_identity_hint(sslContext->ctx, sslContext->sslConfiguration.preSharedKeyIdentityHint().constData());
-+#endif // OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK)
-+
-+    const QVector<QSslEllipticCurve> qcurves = sslContext->sslConfiguration.ellipticCurves();
-+    if (!qcurves.isEmpty()) {
-+#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !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,
-+            // but let's avoid a copy into a temporary array
-+            if (!q_SSL_CTX_ctrl(sslContext->ctx,
-+                                SSL_CTRL_SET_CURVES,
-+                                qcurves.size(),
-+                                const_cast<int *>(reinterpret_cast<const int *>(qcurves.data())))) {
-+                sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
-+                sslContext->errorCode = QSslError::UnspecifiedError;
-+            }
-+        } else
-+#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L && !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"));
-+            sslContext->errorCode = QSslError::UnspecifiedError;
-+        }
-+    }
-+}
-+
-+QT_END_NAMESPACE
-diff --git a/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp b/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp
-index 90687b05c5..5ebad822f1 100644
---- a/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp
-+++ b/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp
-@@ -1,6 +1,7 @@
- /****************************************************************************
- **
- ** Copyright (C) 2015 Mikkel Krautz <mikkel@krautz.dk>
-+** Copyright (C) 2016 Richard J. Moore <rich@kde.org>
- ** Contact: https://www.qt.io/licensing/
- **
- ** This file is part of the QtNetwork module of the Qt Toolkit.
-@@ -50,8 +51,8 @@
- #include <QtCore/qdebug.h>
- #endif
- 
--// For q_BN_is_word.
- #include <openssl/bn.h>
-+#include <openssl/dh.h>
- 
- QT_BEGIN_NAMESPACE
- 
-@@ -62,13 +63,6 @@ static bool isSafeDH(DH *dh)
- 
-     QSslSocketPrivate::ensureInitialized();
- 
--    // Mark p < 1024 bits as unsafe.
--    if (q_BN_num_bits(dh->p) < 1024) {
--        return false;
--    }
--
--    if (q_DH_check(dh, &status) != 1)
--        return false;
- 
-     // From https://wiki.openssl.org/index.php/Diffie-Hellman_parameters:
-     //
-@@ -81,11 +75,39 @@ static bool isSafeDH(DH *dh)
-     //     Without the test, the IETF parameters would
-     //     fail validation. For details, see Diffie-Hellman
-     //     Parameter Check (when g = 2, must p mod 24 == 11?).
-+#if QT_CONFIG(opensslv11)
-+    // Mark p < 1024 bits as unsafe.
-+    if (q_DH_bits(dh) < 1024)
-+        return false;
-+
-+    if (q_DH_check(dh, &status) != 1)
-+        return false;
-+
-+    const BIGNUM *p = nullptr;
-+    const BIGNUM *q = nullptr;
-+    const BIGNUM *g = nullptr;
-+    q_DH_get0_pqg(dh, &p, &q, &g);
-+
-+    if (q_BN_is_word(const_cast<BIGNUM *>(g), DH_GENERATOR_2)) {
-+        long residue = q_BN_mod_word(p, 24);
-+        if (residue == 11 || residue == 23)
-+            status &= ~DH_NOT_SUITABLE_GENERATOR;
-+    }
-+
-+#else
-+    // Mark p < 1024 bits as unsafe.
-+    if (q_BN_num_bits(dh->p) < 1024)
-+        return false;
-+
-+    if (q_DH_check(dh, &status) != 1)
-+        return false;
-+
-     if (q_BN_is_word(dh->g, DH_GENERATOR_2)) {
-         long residue = q_BN_mod_word(dh->p, 24);
-         if (residue == 11 || residue == 23)
-             status &= ~DH_NOT_SUITABLE_GENERATOR;
-     }
-+#endif
- 
-     bad |= DH_CHECK_P_NOT_PRIME;
-     bad |= DH_CHECK_P_NOT_SAFE_PRIME;
-diff --git a/src/network/ssl/qsslellipticcurve.h b/src/network/ssl/qsslellipticcurve.h
-index 231566063e..57dda19bad 100644
---- a/src/network/ssl/qsslellipticcurve.h
-+++ b/src/network/ssl/qsslellipticcurve.h
-@@ -80,6 +80,7 @@ private:
-     friend Q_DECL_CONSTEXPR bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs) Q_DECL_NOTHROW;
-     friend Q_DECL_CONSTEXPR uint qHash(QSslEllipticCurve curve, uint seed) Q_DECL_NOTHROW;
- 
-+    friend class QSslContext;
-     friend class QSslSocketPrivate;
-     friend class QSslSocketBackendPrivate;
- };
-diff --git a/src/network/ssl/qsslellipticcurve_openssl.cpp b/src/network/ssl/qsslellipticcurve_openssl.cpp
-index e18197b703..8cd14837f0 100644
---- a/src/network/ssl/qsslellipticcurve_openssl.cpp
-+++ b/src/network/ssl/qsslellipticcurve_openssl.cpp
-@@ -1,6 +1,7 @@
- /****************************************************************************
- **
- ** Copyright (C) 2014 Governikus GmbH & Co. KG.
-+** Copyright (C) 2016 Richard J. Moore <rich@kde.org>
- ** Contact: https://www.qt.io/licensing/
- **
- ** This file is part of the QtNetwork module of the Qt Toolkit.
-@@ -78,17 +79,18 @@ QSslEllipticCurve QSslEllipticCurve::fromShortName(const QString &name)
-     QSslEllipticCurve result;
- 
- #ifndef OPENSSL_NO_EC
--    const QByteArray curveNameLatin1 = name.toLatin1();
- 
-+    const QByteArray curveNameLatin1 = name.toLatin1();
-     int nid = q_OBJ_sn2nid(curveNameLatin1.data());
- 
- #if OPENSSL_VERSION_NUMBER >= 0x10002000L
--    if (nid == 0 && q_SSLeay() >= 0x10002000L)
-+    if (nid == 0 && QSslSocket::sslLibraryVersionNumber() >= 0x10002000L)
-         nid = q_EC_curve_nist2nid(curveNameLatin1.data());
- #endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
- 
-     result.id = nid;
--#endif
-+
-+#endif // !OPENSSL_NO_EC
- 
-     return result;
- }
-diff --git a/src/network/ssl/qsslkey_openssl.cpp b/src/network/ssl/qsslkey_openssl.cpp
-index 26119023d1..2b03af9441 100644
---- a/src/network/ssl/qsslkey_openssl.cpp
-+++ b/src/network/ssl/qsslkey_openssl.cpp
-@@ -1,6 +1,7 @@
- /****************************************************************************
- **
--** Copyright (C) 2016 The Qt Company Ltd.
-+** Copyright (C) 2017 The Qt Company Ltd.
-+** Copyright (C) 2016 Richard J. Moore <rich@kde.org>
- ** Contact: https://www.qt.io/licensing/
- **
- ** This file is part of the QtNetwork module of the Qt Toolkit.
-@@ -87,33 +88,32 @@ bool QSslKeyPrivate::fromEVP_PKEY(EVP_PKEY *pkey)
-     if (pkey == nullptr)
-         return false;
- 
--    if (pkey->type == EVP_PKEY_RSA) {
-+#if QT_CONFIG(opensslv11)
-+    const int keyType = q_EVP_PKEY_type(q_EVP_PKEY_base_id(pkey));
-+#else
-+    const int keyType = pkey->type;
-+#endif
-+    if (keyType == EVP_PKEY_RSA) {
-         isNull = false;
-         algorithm = QSsl::Rsa;
-         type = QSsl::PrivateKey;
- 
--        rsa = q_RSA_new();
--        memcpy(rsa, q_EVP_PKEY_get1_RSA(pkey), sizeof(RSA));
--
-+        rsa = q_EVP_PKEY_get1_RSA(pkey);
-         return true;
--    }
--    else if (pkey->type == EVP_PKEY_DSA) {
-+    } else if (keyType == EVP_PKEY_DSA) {
-         isNull = false;
-         algorithm = QSsl::Dsa;
-         type = QSsl::PrivateKey;
- 
--        dsa = q_DSA_new();
--        memcpy(dsa, q_EVP_PKEY_get1_DSA(pkey), sizeof(DSA));
--
-+        dsa = q_EVP_PKEY_get1_DSA(pkey);
-         return true;
-     }
- #ifndef OPENSSL_NO_EC
--    else if (pkey->type == EVP_PKEY_EC) {
-+    else if (keyType == EVP_PKEY_EC) {
-         isNull = false;
-         algorithm = QSsl::Ec;
-         type = QSsl::PrivateKey;
--        ec = q_EC_KEY_dup(q_EVP_PKEY_get1_EC_KEY(pkey));
--
-+        ec = q_EVP_PKEY_get1_EC_KEY(pkey);
-         return true;
-     }
- #endif
-@@ -181,8 +181,8 @@ int QSslKeyPrivate::length() const
-         return -1;
- 
-     switch (algorithm) {
--        case QSsl::Rsa: return q_BN_num_bits(rsa->n);
--        case QSsl::Dsa: return q_BN_num_bits(dsa->p);
-+        case QSsl::Rsa: return q_RSA_bits(rsa);
-+        case QSsl::Dsa: return q_DSA_bits(dsa);
- #ifndef OPENSSL_NO_EC
-         case QSsl::Ec: return q_EC_GROUP_get_degree(q_EC_KEY_get0_group(ec));
- #endif
-@@ -276,7 +276,13 @@ Qt::HANDLE QSslKeyPrivate::handle() const
- 
- static QByteArray doCrypt(QSslKeyPrivate::Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv, int enc)
- {
--    EVP_CIPHER_CTX ctx;
-+#if QT_CONFIG(opensslv11)
-+    EVP_CIPHER_CTX *ctx = q_EVP_CIPHER_CTX_new();
-+#else
-+    EVP_CIPHER_CTX evpCipherContext;
-+    EVP_CIPHER_CTX *ctx = &evpCipherContext;
-+#endif
-+
-     const EVP_CIPHER* type = 0;
-     int i = 0, len = 0;
- 
-@@ -294,21 +300,44 @@ static QByteArray doCrypt(QSslKeyPrivate::Cipher cipher, const QByteArray &data,
- 
-     QByteArray output;
-     output.resize(data.size() + EVP_MAX_BLOCK_LENGTH);
--    q_EVP_CIPHER_CTX_init(&ctx);
--    q_EVP_CipherInit(&ctx, type, NULL, NULL, enc);
--    q_EVP_CIPHER_CTX_set_key_length(&ctx, key.size());
-+
-+#if QT_CONFIG(opensslv11)
-+    q_EVP_CIPHER_CTX_reset(ctx);
-+#else
-+    q_EVP_CIPHER_CTX_init(ctx);
-+#endif
-+
-+    q_EVP_CipherInit(ctx, type, NULL, NULL, enc);
-+    q_EVP_CIPHER_CTX_set_key_length(ctx, key.size());
-     if (cipher == QSslKeyPrivate::Rc2Cbc)
--        q_EVP_CIPHER_CTX_ctrl(&ctx, EVP_CTRL_SET_RC2_KEY_BITS, 8 * key.size(), NULL);
--    q_EVP_CipherInit(&ctx, NULL,
-+        q_EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC2_KEY_BITS, 8 * key.size(), NULL);
-+
-+#if QT_CONFIG(opensslv11)
-+    // EVP_CipherInit in 1.1 resets the context thus making the calls above useless.
-+    // We call EVP_CipherInit_ex instead.
-+    q_EVP_CipherInit_ex(ctx, nullptr, nullptr,
-+                        reinterpret_cast<const unsigned char *>(key.constData()),
-+                        reinterpret_cast<const unsigned char *>(iv.constData()),
-+                        enc);
-+#else
-+    q_EVP_CipherInit(ctx, NULL,
-         reinterpret_cast<const unsigned char *>(key.constData()),
-         reinterpret_cast<const unsigned char *>(iv.constData()), enc);
--    q_EVP_CipherUpdate(&ctx,
-+#endif // opensslv11
-+
-+    q_EVP_CipherUpdate(ctx,
-         reinterpret_cast<unsigned char *>(output.data()), &len,
-         reinterpret_cast<const unsigned char *>(data.constData()), data.size());
--    q_EVP_CipherFinal(&ctx,
-+    q_EVP_CipherFinal(ctx,
-         reinterpret_cast<unsigned char *>(output.data()) + len, &i);
-     len += i;
--    q_EVP_CIPHER_CTX_cleanup(&ctx);
-+
-+#if QT_CONFIG(opensslv11)
-+    q_EVP_CIPHER_CTX_reset(ctx);
-+    q_EVP_CIPHER_CTX_free(ctx);
-+#else
-+    q_EVP_CIPHER_CTX_cleanup(ctx);
-+#endif
- 
-     return output.left(len);
- }
-diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
-index f5b493897e..45cea490fc 100644
---- a/src/network/ssl/qsslsocket_openssl.cpp
-+++ b/src/network/ssl/qsslsocket_openssl.cpp
-@@ -1,6 +1,6 @@
- /****************************************************************************
- **
--** Copyright (C) 2016 The Qt Company Ltd.
-+** Copyright (C) 2017 The Qt Company Ltd.
- ** Copyright (C) 2014 Governikus GmbH & Co. KG
- ** Contact: https://www.qt.io/licensing/
- **
-@@ -97,70 +97,6 @@ bool QSslSocketPrivate::s_loadRootCertsOnDemand = false;
- int QSslSocketBackendPrivate::s_indexForSSLExtraData = -1;
- #endif
- 
--/* \internal
--
--    From OpenSSL's thread(3) manual page:
--
--    OpenSSL can safely be used in multi-threaded applications provided that at
--    least two callback functions are set.
--
--    locking_function(int mode, int n, const char *file, int line) is needed to
--    perform locking on shared data structures.  (Note that OpenSSL uses a
--    number of global data structures that will be implicitly shared
--    whenever multiple threads use OpenSSL.)  Multi-threaded
--    applications will crash at random if it is not set.  ...
--    ...
--    id_function(void) is a function that returns a thread ID. It is not
--    needed on Windows nor on platforms where getpid() returns a different
--    ID for each thread (most notably Linux)
--*/
--class QOpenSslLocks
--{
--public:
--    inline QOpenSslLocks()
--        : initLocker(QMutex::Recursive),
--          locksLocker(QMutex::Recursive)
--    {
--        QMutexLocker locker(&locksLocker);
--        int numLocks = q_CRYPTO_num_locks();
--        locks = new QMutex *[numLocks];
--        memset(locks, 0, numLocks * sizeof(QMutex *));
--    }
--    inline ~QOpenSslLocks()
--    {
--        QMutexLocker locker(&locksLocker);
--        for (int i = 0; i < q_CRYPTO_num_locks(); ++i)
--            delete locks[i];
--        delete [] locks;
--
--        QSslSocketPrivate::deinitialize();
--    }
--    inline QMutex *lock(int num)
--    {
--        QMutexLocker locker(&locksLocker);
--        QMutex *tmp = locks[num];
--        if (!tmp)
--            tmp = locks[num] = new QMutex(QMutex::Recursive);
--        return tmp;
--    }
--
--    QMutex *globalLock()
--    {
--        return &locksLocker;
--    }
--
--    QMutex *initLock()
--    {
--        return &initLocker;
--    }
--
--private:
--    QMutex initLocker;
--    QMutex locksLocker;
--    QMutex **locks;
--};
--Q_GLOBAL_STATIC(QOpenSslLocks, openssl_locks)
--
- QString QSslSocketBackendPrivate::getErrorsFromOpenSsl()
- {
-     QString errorString;
-@@ -175,20 +111,6 @@ QString QSslSocketBackendPrivate::getErrorsFromOpenSsl()
- }
- 
- extern "C" {
--static void locking_function(int mode, int lockNumber, const char *, int)
--{
--    QMutex *mutex = openssl_locks()->lock(lockNumber);
--
--    // Lock or unlock it
--    if (mode & CRYPTO_LOCK)
--        mutex->lock();
--    else
--        mutex->unlock();
--}
--static unsigned long id_function()
--{
--    return (quintptr)QThread::currentThreadId();
--}
- 
- #if OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK)
- static unsigned int q_ssl_psk_client_callback(SSL *ssl,
-@@ -227,7 +149,7 @@ QSslSocketBackendPrivate::~QSslSocketBackendPrivate()
-     destroySslContext();
- }
- 
--QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(SSL_CIPHER *cipher)
-+QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(const SSL_CIPHER *cipher)
- {
-     QSslCipher ciph;
- 
-@@ -283,6 +205,7 @@ struct QSslErrorList
-     QMutex mutex;
-     QVector<QSslErrorEntry> errors;
- };
-+
- Q_GLOBAL_STATIC(QSslErrorList, _q_sslErrorList)
- 
- int q_X509Callback(int ok, X509_STORE_CTX *ctx)
-@@ -312,7 +235,7 @@ int q_X509Callback(int ok, X509_STORE_CTX *ctx)
-         }
- #endif
-     }
--    // Always return OK to allow verification to continue. We're handle the
-+    // Always return OK to allow verification to continue. We handle the
-     // errors gracefully after collecting all errors, after verification has
-     // completed.
-     return 1;
-@@ -397,7 +320,7 @@ bool QSslSocketBackendPrivate::initSslContext()
-     if (configuration.protocol != QSsl::SslV2 &&
-         configuration.protocol != QSsl::SslV3 &&
-         configuration.protocol != QSsl::UnknownProtocol &&
--        mode == QSslSocket::SslClientMode && q_SSLeay() >= 0x00090806fL) {
-+        mode == QSslSocket::SslClientMode && QSslSocket::sslLibraryVersionNumber() >= 0x00090806fL) {
-         // Set server hostname on TLS extension. RFC4366 section 3.1 requires it in ACE format.
-         QString tlsHostName = verificationPeerName.isEmpty() ? q->peerName() : verificationPeerName;
-         if (tlsHostName.isEmpty())
-@@ -438,13 +361,13 @@ bool QSslSocketBackendPrivate::initSslContext()
- 
- #if OPENSSL_VERSION_NUMBER >= 0x10001000L
-     // Save a pointer to this object into the SSL structure.
--    if (q_SSLeay() >= 0x10001000L)
-+    if (QSslSocket::sslLibraryVersionNumber() >= 0x10001000L)
-         q_SSL_set_ex_data(ssl, s_indexForSSLExtraData, this);
- #endif
- 
- #if OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK)
-     // Set the client callback for PSK
--    if (q_SSLeay() >= 0x10001000L) {
-+    if (QSslSocket::sslLibraryVersionNumber() >= 0x10001000L) {
-         if (mode == QSslSocket::SslClientMode)
-             q_SSL_set_psk_client_callback(ssl, &q_ssl_psk_client_callback);
-         else if (mode == QSslSocket::SslServerMode)
-@@ -464,16 +387,6 @@ void QSslSocketBackendPrivate::destroySslContext()
-     sslContextPointer.clear();
- }
- 
--/*!
--    \internal
--*/
--void QSslSocketPrivate::deinitialize()
--{
--    q_CRYPTO_set_id_callback(0);
--    q_CRYPTO_set_locking_callback(0);
--    q_ERR_free_strings();
--}
--
- /*!
-     \internal
- 
-@@ -486,91 +399,6 @@ bool QSslSocketPrivate::supportsSsl()
-     return ensureLibraryLoaded();
- }
- 
--bool QSslSocketPrivate::ensureLibraryLoaded()
--{
--    if (!q_resolveOpenSslSymbols())
--        return false;
--
--    // Check if the library itself needs to be initialized.
--    QMutexLocker locker(openssl_locks()->initLock());
--
--    if (!s_libraryLoaded) {
--        s_libraryLoaded = true;
--
--        // Initialize OpenSSL.
--        q_CRYPTO_set_id_callback(id_function);
--        q_CRYPTO_set_locking_callback(locking_function);
--        if (q_SSL_library_init() != 1)
--            return false;
--        q_SSL_load_error_strings();
--        q_OpenSSL_add_all_algorithms();
--
--#if OPENSSL_VERSION_NUMBER >= 0x10001000L
--        if (q_SSLeay() >= 0x10001000L)
--            QSslSocketBackendPrivate::s_indexForSSLExtraData = q_SSL_get_ex_new_index(0L, NULL, NULL, NULL, NULL);
--#endif
--
--        // Initialize OpenSSL's random seed.
--        if (!q_RAND_status()) {
--            qWarning("Random number generator not seeded, disabling SSL support");
--            return false;
--        }
--    }
--    return true;
--}
--
--void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
--{
--    QMutexLocker locker(openssl_locks()->initLock());
--    if (s_loadedCiphersAndCerts)
--        return;
--    s_loadedCiphersAndCerts = true;
--
--    resetDefaultCiphers();
--    resetDefaultEllipticCurves();
--
--#if QT_CONFIG(library)
--    //load symbols needed to receive certificates from system store
--#if defined(Q_OS_WIN)
--    HINSTANCE hLib = LoadLibraryW(L"Crypt32");
--    if (hLib) {
--        ptrCertOpenSystemStoreW = (PtrCertOpenSystemStoreW)GetProcAddress(hLib, "CertOpenSystemStoreW");
--        ptrCertFindCertificateInStore = (PtrCertFindCertificateInStore)GetProcAddress(hLib, "CertFindCertificateInStore");
--        ptrCertCloseStore = (PtrCertCloseStore)GetProcAddress(hLib, "CertCloseStore");
--        if (!ptrCertOpenSystemStoreW || !ptrCertFindCertificateInStore || !ptrCertCloseStore)
--            qCWarning(lcSsl, "could not resolve symbols in crypt32 library"); // should never happen
--    } else {
--        qCWarning(lcSsl, "could not load crypt32 library"); // should never happen
--    }
--#elif defined(Q_OS_QNX)
--    s_loadRootCertsOnDemand = true;
--#elif defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
--    // check whether we can enable on-demand root-cert loading (i.e. check whether the sym links are there)
--    QList<QByteArray> dirs = unixRootCertDirectories();
--    QStringList symLinkFilter;
--    symLinkFilter << QLatin1String("[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].[0-9]");
--    for (int a = 0; a < dirs.count(); ++a) {
--        QDirIterator iterator(QLatin1String(dirs.at(a)), symLinkFilter, QDir::Files);
--        if (iterator.hasNext()) {
--            s_loadRootCertsOnDemand = true;
--            break;
--        }
--    }
--#endif
--#endif // QT_CONFIG(library)
--    // if on-demand loading was not enabled, load the certs now
--    if (!s_loadRootCertsOnDemand)
--        setDefaultCaCertificates(systemCaCertificates());
--#ifdef Q_OS_WIN
--    //Enabled for fetching additional root certs from windows update on windows 6+
--    //This flag is set false by setDefaultCaCertificates() indicating the app uses
--    //its own cert bundle rather than the system one.
--    //Same logic that disables the unix on demand cert loading.
--    //Unlike unix, we do preload the certificates from the cert store.
--    if ((QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) >= QSysInfo::WV_6_0)
--        s_loadRootCertsOnDemand = true;
--#endif
--}
- 
- /*!
-     \internal
-@@ -587,26 +415,6 @@ void QSslSocketPrivate::ensureInitialized()
-     ensureCiphersAndCertsLoaded();
- }
- 
--long QSslSocketPrivate::sslLibraryVersionNumber()
--{
--    if (!supportsSsl())
--        return 0;
--
--    return q_SSLeay();
--}
--
--QString QSslSocketPrivate::sslLibraryVersionString()
--{
--    if (!supportsSsl())
--        return QString();
--
--    const char *versionString = q_SSLeay_version(SSLEAY_VERSION);
--    if (!versionString)
--        return QString();
--
--    return QString::fromLatin1(versionString);
--}
--
- long QSslSocketPrivate::sslLibraryBuildVersionNumber()
- {
-     return OPENSSL_VERSION_NUMBER;
-@@ -628,7 +436,11 @@ QString QSslSocketPrivate::sslLibraryBuildVersionString()
- */
- void QSslSocketPrivate::resetDefaultCiphers()
- {
-+#if QT_CONFIG(opensslv11)
-+    SSL_CTX *myCtx = q_SSL_CTX_new(q_TLS_client_method());
-+#else
-     SSL_CTX *myCtx = q_SSL_CTX_new(q_SSLv23_client_method());
-+#endif
-     SSL *mySsl = q_SSL_new(myCtx);
- 
-     QList<QSslCipher> ciphers;
-@@ -664,7 +476,7 @@ void QSslSocketPrivate::resetDefaultEllipticCurves()
-     QVector<QSslEllipticCurve> curves;
- 
- #ifndef OPENSSL_NO_EC
--    const size_t curveCount = q_EC_get_builtin_curves(NULL, 0);
-+    const size_t curveCount = q_EC_get_builtin_curves(nullptr, 0);
- 
-     QVarLengthArray<EC_builtin_curve> builtinCurves(static_cast<int>(curveCount));
- 
-@@ -698,13 +510,14 @@ QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
-     if (ptrCertOpenSystemStoreW && ptrCertFindCertificateInStore && ptrCertCloseStore) {
-         HCERTSTORE hSystemStore;
-         hSystemStore = ptrCertOpenSystemStoreW(0, L"ROOT");
--        if(hSystemStore) {
--            PCCERT_CONTEXT pc = NULL;
--            while(1) {
--                pc = ptrCertFindCertificateInStore( hSystemStore, X509_ASN_ENCODING, 0, CERT_FIND_ANY, NULL, pc);
--                if(!pc)
-+        if (hSystemStore) {
-+            PCCERT_CONTEXT pc = nullptr;
-+            while (1) {
-+                pc = ptrCertFindCertificateInStore(hSystemStore, X509_ASN_ENCODING, 0, CERT_FIND_ANY, nullptr, pc);
-+                if (!pc)
-                     break;
--                QByteArray der((const char *)(pc->pbCertEncoded), static_cast<int>(pc->cbCertEncoded));
-+                QByteArray der(reinterpret_cast<const char *>(pc->pbCertEncoded),
-+                               static_cast<int>(pc->cbCertEncoded));
-                 QSslCertificate cert(der, QSsl::Der);
-                 systemCerts.append(cert);
-             }
-@@ -1504,14 +1317,8 @@ QSslCipher QSslSocketBackendPrivate::sessionCipher() const
- {
-     if (!ssl)
-         return QSslCipher();
--#if OPENSSL_VERSION_NUMBER >= 0x10000000L
--    // FIXME This is fairly evil, but needed to keep source level compatibility
--    // with the OpenSSL 0.9.x implementation at maximum -- some other functions
--    // don't take a const SSL_CIPHER* when they should
--    SSL_CIPHER *sessionCipher = const_cast<SSL_CIPHER *>(q_SSL_get_current_cipher(ssl));
--#else
--    SSL_CIPHER *sessionCipher = q_SSL_get_current_cipher(ssl);
--#endif
-+
-+    const SSL_CIPHER *sessionCipher = q_SSL_get_current_cipher(ssl);
-     return sessionCipher ? QSslCipher_from_SSL_CIPHER(sessionCipher) : QSslCipher();
- }
- 
-@@ -1537,112 +1344,6 @@ QSsl::SslProtocol QSslSocketBackendPrivate::sessionProtocol() const
-     return QSsl::UnknownProtocol;
- }
- 
--void QSslSocketBackendPrivate::continueHandshake()
--{
--    Q_Q(QSslSocket);
--    // if we have a max read buffer size, reset the plain socket's to match
--    if (readBufferMaxSize)
--        plainSocket->setReadBufferSize(readBufferMaxSize);
--
--    if (q_SSL_ctrl((ssl), SSL_CTRL_GET_SESSION_REUSED, 0, NULL))
--        configuration.peerSessionShared = true;
--
--#ifdef QT_DECRYPT_SSL_TRAFFIC
--    if (ssl->session && ssl->s3) {
--        const char *mk = reinterpret_cast<const char *>(ssl->session->master_key);
--        QByteArray masterKey(mk, ssl->session->master_key_length);
--        const char *random = reinterpret_cast<const char *>(ssl->s3->client_random);
--        QByteArray clientRandom(random, SSL3_RANDOM_SIZE);
--
--        // different format, needed for e.g. older Wireshark versions:
--//        const char *sid = reinterpret_cast<const char *>(ssl->session->session_id);
--//        QByteArray sessionID(sid, ssl->session->session_id_length);
--//        QByteArray debugLineRSA("RSA Session-ID:");
--//        debugLineRSA.append(sessionID.toHex().toUpper());
--//        debugLineRSA.append(" Master-Key:");
--//        debugLineRSA.append(masterKey.toHex().toUpper());
--//        debugLineRSA.append("\n");
--
--        QByteArray debugLineClientRandom("CLIENT_RANDOM ");
--        debugLineClientRandom.append(clientRandom.toHex().toUpper());
--        debugLineClientRandom.append(" ");
--        debugLineClientRandom.append(masterKey.toHex().toUpper());
--        debugLineClientRandom.append("\n");
--
--        QString sslKeyFile = QDir::tempPath() + QLatin1String("/qt-ssl-keys");
--        QFile file(sslKeyFile);
--        if (!file.open(QIODevice::Append))
--            qCWarning(lcSsl) << "could not open file" << sslKeyFile << "for appending";
--        if (!file.write(debugLineClientRandom))
--            qCWarning(lcSsl) << "could not write to file" << sslKeyFile;
--        file.close();
--    } else {
--        qCWarning(lcSsl, "could not decrypt SSL traffic");
--    }
--#endif
--
--    // Cache this SSL session inside the QSslContext
--    if (!(configuration.sslOptions & QSsl::SslOptionDisableSessionSharing)) {
--        if (!sslContextPointer->cacheSession(ssl)) {
--            sslContextPointer.clear(); // we could not cache the session
--        } else {
--            // Cache the session for permanent usage as well
--            if (!(configuration.sslOptions & QSsl::SslOptionDisableSessionPersistence)) {
--                if (!sslContextPointer->sessionASN1().isEmpty())
--                    configuration.sslSession = sslContextPointer->sessionASN1();
--                configuration.sslSessionTicketLifeTimeHint = sslContextPointer->sessionTicketLifeTimeHint();
--            }
--        }
--    }
--
--#if OPENSSL_VERSION_NUMBER >= 0x1000100fL && !defined(OPENSSL_NO_NEXTPROTONEG)
--
--    configuration.nextProtocolNegotiationStatus = sslContextPointer->npnContext().status;
--    if (sslContextPointer->npnContext().status == QSslConfiguration::NextProtocolNegotiationUnsupported) {
--        // we could not agree -> be conservative and use HTTP/1.1
--        configuration.nextNegotiatedProtocol = QByteArrayLiteral("http/1.1");
--    } else {
--        const unsigned char *proto = 0;
--        unsigned int proto_len = 0;
--#if OPENSSL_VERSION_NUMBER >= 0x10002000L
--        if (q_SSLeay() >= 0x10002000L) {
--            q_SSL_get0_alpn_selected(ssl, &proto, &proto_len);
--            if (proto_len && mode == QSslSocket::SslClientMode) {
--                // Client does not have a callback that sets it ...
--                configuration.nextProtocolNegotiationStatus = QSslConfiguration::NextProtocolNegotiationNegotiated;
--            }
--        }
--
--        if (!proto_len) { // Test if NPN was more lucky ...
--#else
--        {
--#endif
--            q_SSL_get0_next_proto_negotiated(ssl, &proto, &proto_len);
--        }
--
--        if (proto_len)
--            configuration.nextNegotiatedProtocol = QByteArray(reinterpret_cast<const char *>(proto), proto_len);
--        else
--            configuration.nextNegotiatedProtocol.clear();
--    }
--#endif // OPENSSL_VERSION_NUMBER >= 0x1000100fL ...
--
--#if OPENSSL_VERSION_NUMBER >= 0x10002000L
--    if (q_SSLeay() >= 0x10002000L && mode == QSslSocket::SslClientMode) {
--        EVP_PKEY *key;
--        if (q_SSL_get_server_tmp_key(ssl, &key))
--            configuration.ephemeralServerKey = QSslKey(key, QSsl::PublicKey);
--    }
--#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L ...
--
--    connectionEncrypted = true;
--    emit q->encrypted();
--    if (autoStartHandshake && pendingClose) {
--        pendingClose = false;
--        q->disconnectFromHost();
--    }
--}
--
- QList<QSslCertificate> QSslSocketBackendPrivate::STACKOFX509_to_QSslCertificates(STACK_OF(X509) *x509)
- {
-     ensureInitialized();
-@@ -1696,12 +1397,12 @@ QList<QSslError> QSslSocketBackendPrivate::verify(const QList<QSslCertificate> &
-     QMutexLocker sslErrorListMutexLocker(&_q_sslErrorList()->mutex);
- 
-     // Register a custom callback to get all verification errors.
--    X509_STORE_set_verify_cb_func(certStore, q_X509Callback);
-+    q_X509_STORE_set_verify_cb(certStore, q_X509Callback);
- 
-     // Build the chain of intermediate certificates
-     STACK_OF(X509) *intermediates = 0;
-     if (certificateChain.length() > 1) {
--        intermediates = (STACK_OF(X509) *) q_sk_new_null();
-+        intermediates = (STACK_OF(X509) *) q_OPENSSL_sk_new_null();
- 
-         if (!intermediates) {
-             q_X509_STORE_free(certStore);
-@@ -1715,11 +1416,8 @@ QList<QSslError> QSslSocketBackendPrivate::verify(const QList<QSslCertificate> &
-                 first = false;
-                 continue;
-             }
--#if OPENSSL_VERSION_NUMBER >= 0x10000000L
--            q_sk_push( (_STACK *)intermediates, reinterpret_cast<X509 *>(cert.handle()));
--#else
--            q_sk_push( (STACK *)intermediates, reinterpret_cast<char *>(cert.handle()));
--#endif
-+
-+            q_OPENSSL_sk_push((OPENSSL_STACK *)intermediates, reinterpret_cast<X509 *>(cert.handle()));
-         }
-     }
- 
-@@ -1743,11 +1441,7 @@ QList<QSslError> QSslSocketBackendPrivate::verify(const QList<QSslCertificate> &
-     (void) q_X509_verify_cert(storeContext);
- 
-     q_X509_STORE_CTX_free(storeContext);
--#if OPENSSL_VERSION_NUMBER >= 0x10000000L
--    q_sk_free( (_STACK *) intermediates);
--#else
--    q_sk_free( (STACK *) intermediates);
--#endif
-+    q_OPENSSL_sk_free((OPENSSL_STACK *)intermediates);
- 
-     // Now process the errors
-     const auto errorList = std::move(_q_sslErrorList()->errors);
-@@ -1821,7 +1515,8 @@ bool QSslSocketBackendPrivate::importPkcs12(QIODevice *device,
-     // Convert to Qt types
-     if (!key->d->fromEVP_PKEY(pkey)) {
-         qCWarning(lcSsl, "Unable to convert private key");
--        q_sk_pop_free(reinterpret_cast<STACK *>(ca), reinterpret_cast<void(*)(void*)>(q_sk_free));
-+        q_OPENSSL_sk_pop_free(reinterpret_cast<OPENSSL_STACK *>(ca),
-+                              reinterpret_cast<void (*)(void *)>(q_OPENSSL_sk_free));
-         q_X509_free(x509);
-         q_EVP_PKEY_free(pkey);
-         q_PKCS12_free(p12);
-@@ -1836,7 +1531,11 @@ bool QSslSocketBackendPrivate::importPkcs12(QIODevice *device,
-         *caCertificates = QSslSocketBackendPrivate::STACKOFX509_to_QSslCertificates(ca);
- 
-     // Clean up
--    q_sk_pop_free(reinterpret_cast<STACK *>(ca), reinterpret_cast<void(*)(void*)>(q_sk_free));
-+    // TODO: verify ASAP, in the past we had sk_pop_free with q_OPENSSL_sk_free
-+    // which seems to be blatantly wrong and even crashes with 1.1.
-+    q_OPENSSL_sk_pop_free(reinterpret_cast<OPENSSL_STACK *>(ca),
-+                          reinterpret_cast<void (*)(void *)>(q_X509_free));
-+
-     q_X509_free(x509);
-     q_EVP_PKEY_free(pkey);
-     q_PKCS12_free(p12);
-diff --git a/src/network/ssl/qsslsocket_openssl11.cpp b/src/network/ssl/qsslsocket_openssl11.cpp
-new file mode 100644
-index 0000000000..b6d18943a5
---- /dev/null
-+++ b/src/network/ssl/qsslsocket_openssl11.cpp
-@@ -0,0 +1,285 @@
-+/****************************************************************************
-+**
-+** Copyright (C) 2017 The Qt Company Ltd.
-+** Copyright (C) 2014 Governikus GmbH & Co. KG
-+** Copyright (C) 2016 Richard J. Moore <rich@kde.org>
-+** Contact: https://www.qt.io/licensing/
-+**
-+** This file is part of the QtNetwork module of the Qt Toolkit.
-+**
-+** $QT_BEGIN_LICENSE:LGPL$
-+** Commercial License Usage
-+** Licensees holding valid commercial Qt licenses may use this file in
-+** accordance with the commercial license agreement provided with the
-+** Software or, alternatively, in accordance with the terms contained in
-+** a written agreement between you and The Qt Company. For licensing terms
-+** and conditions see https://www.qt.io/terms-conditions. For further
-+** information use the contact form at https://www.qt.io/contact-us.
-+**
-+** GNU Lesser General Public License Usage
-+** Alternatively, this file may be used under the terms of the GNU Lesser
-+** General Public License version 3 as published by the Free Software
-+** Foundation and appearing in the file LICENSE.LGPL3 included in the
-+** packaging of this file. Please review the following information to
-+** ensure the GNU Lesser General Public License version 3 requirements
-+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-+**
-+** GNU General Public License Usage
-+** Alternatively, this file may be used under the terms of the GNU
-+** General Public License version 2.0 or (at your option) the GNU General
-+** Public license version 3 or any later version approved by the KDE Free
-+** Qt Foundation. The licenses are as published by the Free Software
-+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-+** included in the packaging of this file. Please review the following
-+** information to ensure the GNU General Public License requirements will
-+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-+** https://www.gnu.org/licenses/gpl-3.0.html.
-+**
-+** $QT_END_LICENSE$
-+**
-+****************************************************************************/
-+
-+/****************************************************************************
-+**
-+** In addition, as a special exception, the copyright holders listed above give
-+** permission to link the code of its release of Qt with the OpenSSL project's
-+** "OpenSSL" library (or modified versions of the "OpenSSL" library that use the
-+** same license as the original version), and distribute the linked executables.
-+**
-+** You must comply with the GNU General Public License version 2 in all
-+** respects for all of the code used other than the "OpenSSL" code.  If you
-+** modify this file, you may extend this exception to your version of the file,
-+** but you are not obligated to do so.  If you do not wish to do so, delete
-+** this exception statement from your version of this file.
-+**
-+****************************************************************************/
-+
-+//#define QT_DECRYPT_SSL_TRAFFIC
-+
-+#include "qssl_p.h"
-+#include "qsslsocket_openssl_p.h"
-+#include "qsslsocket_openssl_symbols_p.h"
-+#include "qsslsocket.h"
-+#include "qsslkey.h"
-+
-+#include <QtCore/qdebug.h>
-+#include <QtCore/qdir.h>
-+#include <QtCore/qdiriterator.h>
-+#include <QtCore/qfile.h>
-+#include <QtCore/qmutex.h>
-+#include <QtCore/qlibrary.h>
-+
-+QT_BEGIN_NAMESPACE
-+
-+Q_GLOBAL_STATIC_WITH_ARGS(QMutex, qt_opensslInitMutex, (QMutex::Recursive))
-+
-+/*!
-+    \internal
-+*/
-+void QSslSocketPrivate::deinitialize()
-+{
-+    // This function exists only for compatibility with the pre-11 code,
-+    // where deinitialize() actually does some cleanup. To be discarded
-+    // once we retire < 1.1.
-+}
-+
-+bool QSslSocketPrivate::ensureLibraryLoaded()
-+{
-+    if (!q_resolveOpenSslSymbols())
-+        return false;
-+
-+    const QMutexLocker locker(qt_opensslInitMutex);
-+
-+    if (!s_libraryLoaded) {
-+        s_libraryLoaded = true;
-+
-+        // Initialize OpenSSL.
-+        if (q_OPENSSL_init_ssl(0, nullptr) != 1)
-+            return false;
-+        q_SSL_load_error_strings();
-+        q_OpenSSL_add_all_algorithms();
-+
-+        QSslSocketBackendPrivate::s_indexForSSLExtraData
-+            = q_CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_SSL, 0L, nullptr, nullptr,
-+                                        nullptr, nullptr);
-+
-+        // Initialize OpenSSL's random seed.
-+        if (!q_RAND_status()) {
-+            qWarning("Random number generator not seeded, disabling SSL support");
-+            return false;
-+        }
-+    }
-+    return true;
-+}
-+
-+void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
-+{
-+    const QMutexLocker locker(qt_opensslInitMutex);
-+
-+    if (s_loadedCiphersAndCerts)
-+        return;
-+    s_loadedCiphersAndCerts = true;
-+
-+    resetDefaultCiphers();
-+    resetDefaultEllipticCurves();
-+
-+#if QT_CONFIG(library)
-+    //load symbols needed to receive certificates from system store
-+#if defined(Q_OS_WIN)
-+    HINSTANCE hLib = LoadLibraryW(L"Crypt32");
-+    if (hLib) {
-+        ptrCertOpenSystemStoreW = (PtrCertOpenSystemStoreW)GetProcAddress(hLib, "CertOpenSystemStoreW");
-+        ptrCertFindCertificateInStore = (PtrCertFindCertificateInStore)GetProcAddress(hLib, "CertFindCertificateInStore");
-+        ptrCertCloseStore = (PtrCertCloseStore)GetProcAddress(hLib, "CertCloseStore");
-+        if (!ptrCertOpenSystemStoreW || !ptrCertFindCertificateInStore || !ptrCertCloseStore)
-+            qCWarning(lcSsl, "could not resolve symbols in crypt32 library"); // should never happen
-+    } else {
-+        qCWarning(lcSsl, "could not load crypt32 library"); // should never happen
-+    }
-+#elif defined(Q_OS_QNX)
-+    s_loadRootCertsOnDemand = true;
-+#elif defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
-+    // check whether we can enable on-demand root-cert loading (i.e. check whether the sym links are there)
-+    QList<QByteArray> dirs = unixRootCertDirectories();
-+    QStringList symLinkFilter;
-+    symLinkFilter << QLatin1String("[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].[0-9]");
-+    for (int a = 0; a < dirs.count(); ++a) {
-+        QDirIterator iterator(QLatin1String(dirs.at(a)), symLinkFilter, QDir::Files);
-+        if (iterator.hasNext()) {
-+            s_loadRootCertsOnDemand = true;
-+            break;
-+        }
-+    }
-+#endif
-+#endif // QT_CONFIG(library)
-+    // if on-demand loading was not enabled, load the certs now
-+    if (!s_loadRootCertsOnDemand)
-+        setDefaultCaCertificates(systemCaCertificates());
-+#ifdef Q_OS_WIN
-+    //Enabled for fetching additional root certs from windows update on windows 6+
-+    //This flag is set false by setDefaultCaCertificates() indicating the app uses
-+    //its own cert bundle rather than the system one.
-+    //Same logic that disables the unix on demand cert loading.
-+    //Unlike unix, we do preload the certificates from the cert store.
-+    if ((QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) >= QSysInfo::WV_6_0)
-+        s_loadRootCertsOnDemand = true;
-+#endif
-+}
-+
-+long QSslSocketPrivate::sslLibraryVersionNumber()
-+{
-+    if (!supportsSsl())
-+        return 0;
-+
-+    return q_OpenSSL_version_num();
-+}
-+
-+QString QSslSocketPrivate::sslLibraryVersionString()
-+{
-+    if (!supportsSsl())
-+        return QString();
-+
-+    const char *versionString = q_OpenSSL_version(OPENSSL_VERSION);
-+    if (!versionString)
-+        return QString();
-+
-+    return QString::fromLatin1(versionString);
-+}
-+
-+void QSslSocketBackendPrivate::continueHandshake()
-+{
-+    Q_Q(QSslSocket);
-+    // if we have a max read buffer size, reset the plain socket's to match
-+    if (readBufferMaxSize)
-+        plainSocket->setReadBufferSize(readBufferMaxSize);
-+
-+    if (q_SSL_session_reused(ssl))
-+        configuration.peerSessionShared = true;
-+
-+#ifdef QT_DECRYPT_SSL_TRAFFIC
-+    if (q_SSL_get_session(ssl)) {
-+        size_t master_key_len = q_SSL_SESSION_get_master_key(q_SSL_get_session(ssl), 0, 0);
-+        size_t client_random_len = q_SSL_get_client_random(ssl, 0, 0);
-+        QByteArray masterKey(int(master_key_len), 0); // Will not overflow
-+        QByteArray clientRandom(int(client_random_len), 0); // Will not overflow
-+
-+        q_SSL_SESSION_get_master_key(q_SSL_get_session(ssl),
-+                                     reinterpret_cast<unsigned char*>(masterKey.data()),
-+                                     masterKey.size());
-+        q_SSL_get_client_random(ssl, reinterpret_cast<unsigned char *>(clientRandom.data()),
-+                                clientRandom.size());
-+
-+        QByteArray debugLineClientRandom("CLIENT_RANDOM ");
-+        debugLineClientRandom.append(clientRandom.toHex().toUpper());
-+        debugLineClientRandom.append(" ");
-+        debugLineClientRandom.append(masterKey.toHex().toUpper());
-+        debugLineClientRandom.append("\n");
-+
-+        QString sslKeyFile = QDir::tempPath() + QLatin1String("/qt-ssl-keys");
-+        QFile file(sslKeyFile);
-+        if (!file.open(QIODevice::Append))
-+            qCWarning(lcSsl) << "could not open file" << sslKeyFile << "for appending";
-+        if (!file.write(debugLineClientRandom))
-+            qCWarning(lcSsl) << "could not write to file" << sslKeyFile;
-+        file.close();
-+    } else {
-+        qCWarning(lcSsl, "could not decrypt SSL traffic");
-+    }
-+#endif
-+
-+    // Cache this SSL session inside the QSslContext
-+    if (!(configuration.sslOptions & QSsl::SslOptionDisableSessionSharing)) {
-+        if (!sslContextPointer->cacheSession(ssl)) {
-+            sslContextPointer.clear(); // we could not cache the session
-+        } else {
-+            // Cache the session for permanent usage as well
-+            if (!(configuration.sslOptions & QSsl::SslOptionDisableSessionPersistence)) {
-+                if (!sslContextPointer->sessionASN1().isEmpty())
-+                    configuration.sslSession = sslContextPointer->sessionASN1();
-+                configuration.sslSessionTicketLifeTimeHint = sslContextPointer->sessionTicketLifeTimeHint();
-+            }
-+        }
-+    }
-+
-+#if !defined(OPENSSL_NO_NEXTPROTONEG)
-+
-+    configuration.nextProtocolNegotiationStatus = sslContextPointer->npnContext().status;
-+    if (sslContextPointer->npnContext().status == QSslConfiguration::NextProtocolNegotiationUnsupported) {
-+        // we could not agree -> be conservative and use HTTP/1.1
-+        configuration.nextNegotiatedProtocol = QByteArrayLiteral("http/1.1");
-+    } else {
-+        const unsigned char *proto = 0;
-+        unsigned int proto_len = 0;
-+
-+        q_SSL_get0_alpn_selected(ssl, &proto, &proto_len);
-+        if (proto_len && mode == QSslSocket::SslClientMode) {
-+            // Client does not have a callback that sets it ...
-+            configuration.nextProtocolNegotiationStatus = QSslConfiguration::NextProtocolNegotiationNegotiated;
-+        }
-+
-+        if (!proto_len) { // Test if NPN was more lucky ...
-+            q_SSL_get0_next_proto_negotiated(ssl, &proto, &proto_len);
-+        }
-+
-+        if (proto_len)
-+            configuration.nextNegotiatedProtocol = QByteArray(reinterpret_cast<const char *>(proto), proto_len);
-+        else
-+            configuration.nextNegotiatedProtocol.clear();
-+    }
-+#endif // !defined(OPENSSL_NO_NEXTPROTONEG)
-+
-+    if (mode == QSslSocket::SslClientMode) {
-+        EVP_PKEY *key;
-+        if (q_SSL_get_server_tmp_key(ssl, &key))
-+            configuration.ephemeralServerKey = QSslKey(key, QSsl::PublicKey);
-+    }
-+
-+    connectionEncrypted = true;
-+    emit q->encrypted();
-+    if (autoStartHandshake && pendingClose) {
-+        pendingClose = false;
-+        q->disconnectFromHost();
-+    }
-+}
-+
-+QT_END_NAMESPACE
-diff --git a/src/network/ssl/qsslsocket_openssl11_symbols_p.h b/src/network/ssl/qsslsocket_openssl11_symbols_p.h
-new file mode 100644
-index 0000000000..2980b3d23e
---- /dev/null
-+++ b/src/network/ssl/qsslsocket_openssl11_symbols_p.h
-@@ -0,0 +1,132 @@
-+/****************************************************************************
-+**
-+** Copyright (C) 2017 The Qt Company Ltd.
-+** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
-+** Copyright (C) 2016 Richard J. Moore <rich@kde.org>
-+** Contact: https://www.qt.io/licensing/
-+**
-+** This file is part of the QtNetwork module of the Qt Toolkit.
-+**
-+** $QT_BEGIN_LICENSE:LGPL$
-+** Commercial License Usage
-+** Licensees holding valid commercial Qt licenses may use this file in
-+** accordance with the commercial license agreement provided with the
-+** Software or, alternatively, in accordance with the terms contained in
-+** a written agreement between you and The Qt Company. For licensing terms
-+** and conditions see https://www.qt.io/terms-conditions. For further
-+** information use the contact form at https://www.qt.io/contact-us.
-+**
-+** GNU Lesser General Public License Usage
-+** Alternatively, this file may be used under the terms of the GNU Lesser
-+** General Public License version 3 as published by the Free Software
-+** Foundation and appearing in the file LICENSE.LGPL3 included in the
-+** packaging of this file. Please review the following information to
-+** ensure the GNU Lesser General Public License version 3 requirements
-+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-+**
-+** GNU General Public License Usage
-+** Alternatively, this file may be used under the terms of the GNU
-+** General Public License version 2.0 or (at your option) the GNU General
-+** Public license version 3 or any later version approved by the KDE Free
-+** Qt Foundation. The licenses are as published by the Free Software
-+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-+** included in the packaging of this file. Please review the following
-+** information to ensure the GNU General Public License requirements will
-+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-+** https://www.gnu.org/licenses/gpl-3.0.html.
-+**
-+** $QT_END_LICENSE$
-+**
-+****************************************************************************/
-+
-+/****************************************************************************
-+**
-+** In addition, as a special exception, the copyright holders listed above give
-+** permission to link the code of its release of Qt with the OpenSSL project's
-+** "OpenSSL" library (or modified versions of the "OpenSSL" library that use the
-+** same license as the original version), and distribute the linked executables.
-+**
-+** You must comply with the GNU General Public License version 2 in all
-+** respects for all of the code used other than the "OpenSSL" code.  If you
-+** modify this file, you may extend this exception to your version of the file,
-+** but you are not obligated to do so.  If you do not wish to do so, delete
-+** this exception statement from your version of this file.
-+**
-+****************************************************************************/
-+
-+#ifndef QSSLSOCKET_OPENSSL11_SYMBOLS_P_H
-+#define QSSLSOCKET_OPENSSL11_SYMBOLS_P_H
-+
-+//
-+//  W A R N I N G
-+//  -------------
-+//
-+// This file is not part of the Qt API. It exists purely as an
-+// implementation detail. This header file may change from version to
-+// version without notice, or even be removed.
-+//
-+// We mean it.
-+//
-+
-+// Note: this file does not have QT_BEGIN_NAMESPACE/QT_END_NAMESPACE, it's done
-+// in qsslsocket_openssl_symbols_p.h.
-+
-+#ifndef QSSLSOCKET_OPENSSL_SYMBOLS_P_H
-+#error "You are not supposed to use this header file, include qsslsocket_openssl_symbols_p.h instead"
-+#endif
-+
-+const unsigned char * q_ASN1_STRING_get0_data(const ASN1_STRING *x);
-+
-+Q_AUTOTEST_EXPORT BIO *q_BIO_new(const BIO_METHOD *a);
-+Q_AUTOTEST_EXPORT const BIO_METHOD *q_BIO_s_mem();
-+
-+int q_DSA_bits(DSA *a);
-+int q_EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *c);
-+int q_EVP_PKEY_base_id(EVP_PKEY *a);
-+int q_RSA_bits(RSA *a);
-+int q_OPENSSL_sk_num(OPENSSL_STACK *a);
-+void q_OPENSSL_sk_pop_free(OPENSSL_STACK *a, void (*b)(void *));
-+OPENSSL_STACK *q_OPENSSL_sk_new_null();
-+void q_OPENSSL_sk_push(OPENSSL_STACK *st, void *data);
-+void q_OPENSSL_sk_free(OPENSSL_STACK *a);
-+void * q_OPENSSL_sk_value(OPENSSL_STACK *a, int b);
-+int q_SSL_session_reused(SSL *a);
-+unsigned long q_SSL_CTX_set_options(SSL_CTX *ctx, unsigned long op);
-+int q_OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
-+size_t q_SSL_get_client_random(SSL *a, unsigned char *out, size_t outlen);
-+size_t q_SSL_SESSION_get_master_key(const SSL_SESSION *session, unsigned char *out, size_t outlen);
-+int q_CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
-+const SSL_METHOD *q_TLS_method();
-+const SSL_METHOD *q_TLS_client_method();
-+const SSL_METHOD *q_TLS_server_method();
-+ASN1_TIME *q_X509_getm_notBefore(X509 *a);
-+ASN1_TIME *q_X509_getm_notAfter(X509 *a);
-+
-+long q_X509_get_version(X509 *a);
-+EVP_PKEY *q_X509_get_pubkey(X509 *a);
-+void q_X509_STORE_set_verify_cb(X509_STORE *ctx, X509_STORE_CTX_verify_cb verify_cb);
-+STACK_OF(X509) *q_X509_STORE_CTX_get0_chain(X509_STORE_CTX *ctx);
-+void q_DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g);
-+int q_DH_bits(DH *dh);
-+
-+# define q_SSL_load_error_strings() q_OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS \
-+                                                       | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL)
-+
-+#define q_SKM_sk_num(type, st) ((int (*)(const STACK_OF(type) *))q_OPENSSL_sk_num)(st)
-+#define q_SKM_sk_value(type, st,i) ((type * (*)(const STACK_OF(type) *, int))q_OPENSSL_sk_value)(st, i)
-+
-+#define q_OPENSSL_add_all_algorithms_conf()  q_OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \
-+                                                                   | OPENSSL_INIT_ADD_ALL_DIGESTS \
-+                                                                   | OPENSSL_INIT_LOAD_CONFIG, NULL)
-+#define  q_OPENSSL_add_all_algorithms_noconf() q_OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \
-+                                                                    | OPENSSL_INIT_ADD_ALL_DIGESTS, NULL)
-+
-+int q_OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
-+void q_CRYPTO_free(void *str, const char *file, int line);
-+
-+long q_OpenSSL_version_num();
-+const char *q_OpenSSL_version(int type);
-+
-+unsigned long q_SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *session);
-+
-+#endif
-diff --git a/src/network/ssl/qsslsocket_openssl_p.h b/src/network/ssl/qsslsocket_openssl_p.h
-index b2adb3e547..7f9e884045 100644
---- a/src/network/ssl/qsslsocket_openssl_p.h
-+++ b/src/network/ssl/qsslsocket_openssl_p.h
-@@ -1,6 +1,6 @@
- /****************************************************************************
- **
--** Copyright (C) 2016 The Qt Company Ltd.
-+** Copyright (C) 2017 The Qt Company Ltd.
- ** Contact: https://www.qt.io/licensing/
- **
- ** This file is part of the QtNetwork module of the Qt Toolkit.
-@@ -98,8 +98,8 @@
- #include <openssl/crypto.h>
- #include <openssl/tls1.h>
- 
--#if OPENSSL_VERSION_NUMBER >= 0x10000000L
--typedef _STACK STACK;
-+#if QT_CONFIG(opensslv11)
-+#include <openssl/dh.h>
- #endif
- 
- QT_BEGIN_NAMESPACE
-@@ -151,7 +151,7 @@ public:
- #endif
- 
-     Q_AUTOTEST_EXPORT static long setupOpenSslOptions(QSsl::SslProtocol protocol, QSsl::SslOptions sslOptions);
--    static QSslCipher QSslCipher_from_SSL_CIPHER(SSL_CIPHER *cipher);
-+    static QSslCipher QSslCipher_from_SSL_CIPHER(const SSL_CIPHER *cipher);
-     static QList<QSslCertificate> STACKOFX509_to_QSslCertificates(STACK_OF(X509) *x509);
-     static QList<QSslError> verify(const QList<QSslCertificate> &certificateChain, const QString &hostName);
-     static QString getErrorsFromOpenSsl();
-diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
-index c344a94427..0ef8bf6b5e 100644
---- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
-+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
-@@ -1,7 +1,8 @@
- /****************************************************************************
- **
--** Copyright (C) 2016 The Qt Company Ltd.
-+** Copyright (C) 2017 The Qt Company Ltd.
- ** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
-+** Copyright (C) 2016 Richard J. Moore <rich@kde.org>
- ** Contact: https://www.qt.io/licensing/
- **
- ** This file is part of the QtNetwork module of the Qt Toolkit.
-@@ -136,49 +137,195 @@ void qsslSocketCannotResolveSymbolWarning(const char *functionName)
- 
- #endif // QT_LINKED_OPENSSL
- 
-+#if QT_CONFIG(opensslv11)
-+
-+// Below are the functions first introduced in version 1.1:
-+
-+DEFINEFUNC(const unsigned char *, ASN1_STRING_get0_data, const ASN1_STRING *a, a, return 0, return)
-+DEFINEFUNC2(int, OPENSSL_init_ssl, uint64_t opts, opts, const OPENSSL_INIT_SETTINGS *settings, settings, return 0, return)
-+DEFINEFUNC2(int, OPENSSL_init_crypto, uint64_t opts, opts, const OPENSSL_INIT_SETTINGS *settings, settings, return 0, return)
-+DEFINEFUNC(BIO *, BIO_new, const BIO_METHOD *a, a, return 0, return)
-+DEFINEFUNC(const BIO_METHOD *, BIO_s_mem, void, DUMMYARG, return 0, return)
-+DEFINEFUNC2(int, BN_is_word, BIGNUM *a, a, BN_ULONG w, w, return 0, return)
-+DEFINEFUNC(int, EVP_CIPHER_CTX_reset, EVP_CIPHER_CTX *c, c, return 0, return)
-+DEFINEFUNC(int, EVP_PKEY_base_id, EVP_PKEY *a, a, return NID_undef, return)
-+DEFINEFUNC(int, RSA_bits, RSA *a, a, return 0, return)
-+DEFINEFUNC(int, DSA_bits, DSA *a, a, return 0, return)
-+DEFINEFUNC(int, OPENSSL_sk_num, OPENSSL_STACK *a, a, return -1, return)
-+DEFINEFUNC2(void, OPENSSL_sk_pop_free, OPENSSL_STACK *a, a, void (*b)(void*), b, return, DUMMYARG)
-+DEFINEFUNC(OPENSSL_STACK *, OPENSSL_sk_new_null, DUMMYARG, DUMMYARG, return 0, return)
-+DEFINEFUNC2(void, OPENSSL_sk_push, OPENSSL_STACK *a, a, void *b, b, return, DUMMYARG)
-+DEFINEFUNC(void, OPENSSL_sk_free, OPENSSL_STACK *a, a, return, DUMMYARG)
-+DEFINEFUNC2(void *, OPENSSL_sk_value, OPENSSL_STACK *a, a, int b, b, return 0, return)
-+DEFINEFUNC(int, SSL_session_reused, SSL *a, a, return 0, return)
-+DEFINEFUNC2(unsigned long, SSL_CTX_set_options, SSL_CTX *ctx, ctx, unsigned long op, op, return 0, return)
-+DEFINEFUNC3(size_t, SSL_get_client_random, SSL *a, a, unsigned char *out, out, size_t outlen, outlen, return 0, return)
-+DEFINEFUNC3(size_t, SSL_SESSION_get_master_key, const SSL_SESSION *ses, ses, unsigned char *out, out, size_t outlen, outlen, return 0, return)
-+DEFINEFUNC6(int, CRYPTO_get_ex_new_index, int class_index, class_index, long argl, argl, void *argp, argp, CRYPTO_EX_new *new_func, new_func, CRYPTO_EX_dup *dup_func, dup_func, CRYPTO_EX_free *free_func, free_func, return -1, return)
-+
-+DEFINEFUNC(const SSL_METHOD *, TLS_method, DUMMYARG, DUMMYARG, return 0, return)
-+DEFINEFUNC(const SSL_METHOD *, TLS_client_method, DUMMYARG, DUMMYARG, return 0, return)
-+DEFINEFUNC(const SSL_METHOD *, TLS_server_method, DUMMYARG, DUMMYARG, return 0, return)
-+DEFINEFUNC(ASN1_TIME *, X509_getm_notBefore, X509 *a, a, return 0, return)
-+DEFINEFUNC(ASN1_TIME *, X509_getm_notAfter, X509 *a, a, return 0, return)
-+DEFINEFUNC(long, X509_get_version, X509 *a, a, return -1, return)
-+DEFINEFUNC(EVP_PKEY *, X509_get_pubkey, X509 *a, a, return 0, return)
-+DEFINEFUNC2(void, X509_STORE_set_verify_cb, X509_STORE *a, a, X509_STORE_CTX_verify_cb verify_cb, verify_cb, return, DUMMYARG)
-+DEFINEFUNC(STACK_OF(X509) *, X509_STORE_CTX_get0_chain, X509_STORE_CTX *a, a, return 0, return)
-+DEFINEFUNC3(void, CRYPTO_free, void *str, str, const char *file, file, int line, line, return, DUMMYARG)
-+DEFINEFUNC(long, OpenSSL_version_num, void, DUMMYARG, return 0, return)
-+DEFINEFUNC(const char *, OpenSSL_version, int a, a, return 0, return)
-+DEFINEFUNC(unsigned long, SSL_SESSION_get_ticket_lifetime_hint, const SSL_SESSION *session, session, return 0, return)
-+DEFINEFUNC4(void, DH_get0_pqg, const DH *dh, dh, const BIGNUM **p, p, const BIGNUM **q, q, const BIGNUM **g, g, return, DUMMYARG)
-+DEFINEFUNC(int, DH_bits, DH *dh, dh, return 0, return)
-+
-+#else // QT_CONFIG(opensslv11)
-+
-+// Functions below are either deprecated or removed in OpenSSL >= 1.1:
-+
-+DEFINEFUNC(unsigned char *, ASN1_STRING_data, ASN1_STRING *a, a, return 0, return)
-+
- #ifdef SSLEAY_MACROS
- DEFINEFUNC3(void *, ASN1_dup, i2d_of_void *a, a, d2i_of_void *b, b, char *c, c, return 0, return)
- #endif
-+DEFINEFUNC2(BIO *, BIO_new_file, const char *filename, filename, const char *mode, mode, return 0, return)
-+DEFINEFUNC(void, ERR_clear_error, DUMMYARG, DUMMYARG, return, DUMMYARG)
-+DEFINEFUNC(BIO *, BIO_new, BIO_METHOD *a, a, return 0, return)
-+DEFINEFUNC(BIO_METHOD *, BIO_s_mem, void, DUMMYARG, return 0, return)
-+DEFINEFUNC(int, CRYPTO_num_locks, DUMMYARG, DUMMYARG, return 0, return)
-+DEFINEFUNC(void, CRYPTO_set_locking_callback, void (*a)(int, int, const char *, int), a, return, DUMMYARG)
-+DEFINEFUNC(void, CRYPTO_set_id_callback, unsigned long (*a)(), a, return, DUMMYARG)
-+DEFINEFUNC(void, CRYPTO_free, void *a, a, return, DUMMYARG)
-+DEFINEFUNC(unsigned long, ERR_peek_last_error, DUMMYARG, DUMMYARG, return 0, return)
-+DEFINEFUNC(void, ERR_free_strings, void, DUMMYARG, return, DUMMYARG)
-+DEFINEFUNC(void, EVP_CIPHER_CTX_cleanup, EVP_CIPHER_CTX *a, a, return, DUMMYARG)
-+DEFINEFUNC(void, EVP_CIPHER_CTX_init, EVP_CIPHER_CTX *a, a, return, DUMMYARG)
-+
-+#ifdef SSLEAY_MACROS
-+DEFINEFUNC6(void *, PEM_ASN1_read_bio, d2i_of_void *a, a, const char *b, b, BIO *c, c, void **d, d, pem_password_cb *e, e, void *f, f, return 0, return)
-+DEFINEFUNC6(void *, PEM_ASN1_write_bio, d2i_of_void *a, a, const char *b, b, BIO *c, c, void **d, d, pem_password_cb *e, e, void *f, f, return 0, return)
-+#endif // SSLEAY_MACROS
-+
-+DEFINEFUNC(int, sk_num, STACK *a, a, return -1, return)
-+DEFINEFUNC2(void, sk_pop_free, STACK *a, a, void (*b)(void*), b, return, DUMMYARG)
-+
-+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-+DEFINEFUNC(_STACK *, sk_new_null, DUMMYARG, DUMMYARG, return 0, return)
-+DEFINEFUNC2(void, sk_push, _STACK *a, a, void *b, b, return, DUMMYARG)
-+DEFINEFUNC(void, sk_free, _STACK *a, a, return, DUMMYARG)
-+DEFINEFUNC2(void *, sk_value, STACK *a, a, int b, b, return 0, return)
-+#else
-+DEFINEFUNC(STACK *, sk_new_null, DUMMYARG, DUMMYARG, return 0, return)
-+DEFINEFUNC2(void, sk_push, STACK *a, a, char *b, b, return, DUMMYARG)
-+DEFINEFUNC(void, sk_free, STACK *a, a, return, DUMMYARG)
-+DEFINEFUNC2(char *, sk_value, STACK *a, a, int b, b, return 0, return)
-+#endif // OPENSSL_VERSION_NUMBER >= 0x10000000L
-+
-+DEFINEFUNC(int, SSL_library_init, void, DUMMYARG, return -1, return)
-+DEFINEFUNC(void, SSL_load_error_strings, void, DUMMYARG, return, DUMMYARG)
-+
-+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
-+DEFINEFUNC5(int, SSL_get_ex_new_index, long argl, argl, void *argp, argp, CRYPTO_EX_new *new_func, new_func, CRYPTO_EX_dup *dup_func, dup_func, CRYPTO_EX_free *free_func, free_func, return -1, return)
-+#endif // OPENSSL_VERSION_NUMBER >= 0x10001000L
-+
-+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-+#ifndef OPENSSL_NO_SSL2
-+DEFINEFUNC(const SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return)
-+#endif
-+#ifndef OPENSSL_NO_SSL3_METHOD
-+DEFINEFUNC(const SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return)
-+#endif
-+DEFINEFUNC(const SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, return 0, return)
-+DEFINEFUNC(const SSL_METHOD *, TLSv1_client_method, DUMMYARG, DUMMYARG, return 0, return)
-+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
-+DEFINEFUNC(const SSL_METHOD *, TLSv1_1_client_method, DUMMYARG, DUMMYARG, return 0, return)
-+DEFINEFUNC(const SSL_METHOD *, TLSv1_2_client_method, DUMMYARG, DUMMYARG, return 0, return)
-+#endif
-+#ifndef OPENSSL_NO_SSL2
-+DEFINEFUNC(const SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return)
-+#endif
-+#ifndef OPENSSL_NO_SSL3_METHOD
-+DEFINEFUNC(const SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, return 0, return)
-+#endif
-+DEFINEFUNC(const SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, return 0, return)
-+DEFINEFUNC(const SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, return 0, return)
-+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
-+DEFINEFUNC(const SSL_METHOD *, TLSv1_1_server_method, DUMMYARG, DUMMYARG, return 0, return)
-+DEFINEFUNC(const SSL_METHOD *, TLSv1_2_server_method, DUMMYARG, DUMMYARG, return 0, return)
-+#endif
-+#else
-+#ifndef OPENSSL_NO_SSL2
-+DEFINEFUNC(SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return)
-+#endif
-+#ifndef OPENSSL_NO_SSL3_METHOD
-+DEFINEFUNC(SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return)
-+#endif
-+DEFINEFUNC(SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, return 0, return)
-+DEFINEFUNC(SSL_METHOD *, TLSv1_client_method, DUMMYARG, DUMMYARG, return 0, return)
-+#ifndef OPENSSL_NO_SSL2
-+DEFINEFUNC(SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return)
-+#endif
-+#ifndef OPENSSL_NO_SSL3_METHOD
-+DEFINEFUNC(SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, return 0, return)
-+#endif
-+DEFINEFUNC(SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, return 0, return)
-+DEFINEFUNC(SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, return 0, return)
-+#endif
-+
-+DEFINEFUNC(STACK_OF(X509) *, X509_STORE_CTX_get_chain, X509_STORE_CTX *a, a, return 0, return)
-+
-+#ifdef SSLEAY_MACROS
-+DEFINEFUNC2(int, i2d_DSAPrivateKey, const DSA *a, a, unsigned char **b, b, return -1, return)
-+DEFINEFUNC2(int, i2d_RSAPrivateKey, const RSA *a, a, unsigned char **b, b, return -1, return)
-+#ifndef OPENSSL_NO_EC
-+DEFINEFUNC2(int, i2d_ECPrivateKey, const EC_KEY *a, a, unsigned char **b, b, return -1, return)
-+#endif
-+DEFINEFUNC3(RSA *, d2i_RSAPrivateKey, RSA **a, a, unsigned char **b, b, long c, c, return 0, return)
-+DEFINEFUNC3(DSA *, d2i_DSAPrivateKey, DSA **a, a, unsigned char **b, b, long c, c, return 0, return)
-+#ifndef OPENSSL_NO_EC
-+DEFINEFUNC3(EC_KEY *, d2i_ECPrivateKey, EC_KEY **a, a, unsigned char **b, b, long c, c, return 0, return)
-+#endif
-+#endif
-+DEFINEFUNC(char *, CONF_get1_default_config_file, DUMMYARG, DUMMYARG, return 0, return)
-+DEFINEFUNC(void, OPENSSL_add_all_algorithms_noconf, void, DUMMYARG, return, DUMMYARG)
-+DEFINEFUNC(void, OPENSSL_add_all_algorithms_conf, void, DUMMYARG, return, DUMMYARG)
-+DEFINEFUNC(long, SSLeay, void, DUMMYARG, return 0, return)
-+DEFINEFUNC(const char *, SSLeay_version, int a, a, return 0, return)
-+
-+#endif // QT_CONFIG(opensslv11)
-+
- DEFINEFUNC(long, ASN1_INTEGER_get, ASN1_INTEGER *a, a, return 0, return)
--DEFINEFUNC(unsigned char *, ASN1_STRING_data, ASN1_STRING *a, a, return 0, return)
- DEFINEFUNC(int, ASN1_STRING_length, ASN1_STRING *a, a, return 0, return)
--DEFINEFUNC2(int, ASN1_STRING_to_UTF8, unsigned char **a, a, ASN1_STRING *b, b, return 0, return);
-+DEFINEFUNC2(int, ASN1_STRING_to_UTF8, unsigned char **a, a, ASN1_STRING *b, b, return 0, return)
- DEFINEFUNC4(long, BIO_ctrl, BIO *a, a, int b, b, long c, c, void *d, d, return -1, return)
- DEFINEFUNC(int, BIO_free, BIO *a, a, return 0, return)
--DEFINEFUNC(BIO *, BIO_new, BIO_METHOD *a, a, return 0, return)
- DEFINEFUNC2(BIO *, BIO_new_mem_buf, void *a, a, int b, b, return 0, return)
- DEFINEFUNC3(int, BIO_read, BIO *a, a, void *b, b, int c, c, return -1, return)
--DEFINEFUNC(BIO_METHOD *, BIO_s_mem, void, DUMMYARG, return 0, return)
-+
- DEFINEFUNC3(int, BIO_write, BIO *a, a, const void *b, b, int c, c, return -1, return)
- DEFINEFUNC(int, BN_num_bits, const BIGNUM *a, a, return 0, return)
--#if OPENSSL_VERSION_NUMBER >= 0x10100000L
--DEFINEFUNC2(int, BN_is_word, BIGNUM *a, a, BN_ULONG w, w, return 0, return)
--#endif
- DEFINEFUNC2(BN_ULONG, BN_mod_word, const BIGNUM *a, a, BN_ULONG w, w, return static_cast<BN_ULONG>(-1), return)
- #ifndef OPENSSL_NO_EC
- DEFINEFUNC(const EC_GROUP*, EC_KEY_get0_group, const EC_KEY* k, k, return 0, return)
- DEFINEFUNC(int, EC_GROUP_get_degree, const EC_GROUP* g, g, return 0, return)
- #endif
--DEFINEFUNC(int, CRYPTO_num_locks, DUMMYARG, DUMMYARG, return 0, return)
--DEFINEFUNC(void, CRYPTO_set_locking_callback, void (*a)(int, int, const char *, int), a, return, DUMMYARG)
--DEFINEFUNC(void, CRYPTO_set_id_callback, unsigned long (*a)(), a, return, DUMMYARG)
--DEFINEFUNC(void, CRYPTO_free, void *a, a, return, DUMMYARG)
- DEFINEFUNC(DSA *, DSA_new, DUMMYARG, DUMMYARG, return 0, return)
- DEFINEFUNC(void, DSA_free, DSA *a, a, return, DUMMYARG)
- DEFINEFUNC3(X509 *, d2i_X509, X509 **a, a, const unsigned char **b, b, long c, c, return 0, return)
- DEFINEFUNC2(char *, ERR_error_string, unsigned long a, a, char *b, b, return 0, return)
- DEFINEFUNC(unsigned long, ERR_get_error, DUMMYARG, DUMMYARG, return 0, return)
--DEFINEFUNC(void, ERR_free_strings, void, DUMMYARG, return, DUMMYARG)
--DEFINEFUNC(void, EVP_CIPHER_CTX_cleanup, EVP_CIPHER_CTX *a, a, return, DUMMYARG)
--DEFINEFUNC(void, EVP_CIPHER_CTX_init, EVP_CIPHER_CTX *a, a, return, DUMMYARG)
--DEFINEFUNC4(int, EVP_CIPHER_CTX_ctrl, EVP_CIPHER_CTX *ctx, ctx, int type, type, int arg, arg, void *ptr, ptr, return 0, return);
-+DEFINEFUNC(EVP_CIPHER_CTX *, EVP_CIPHER_CTX_new, void, DUMMYARG, return 0, return)
-+DEFINEFUNC(void, EVP_CIPHER_CTX_free, EVP_CIPHER_CTX *a, a, return, DUMMYARG)
-+DEFINEFUNC4(int, EVP_CIPHER_CTX_ctrl, EVP_CIPHER_CTX *ctx, ctx, int type, type, int arg, arg, void *ptr, ptr, return 0, return)
- DEFINEFUNC2(int, EVP_CIPHER_CTX_set_key_length, EVP_CIPHER_CTX *ctx, ctx, int keylen, keylen, return 0, return)
--DEFINEFUNC5(int, EVP_CipherInit, EVP_CIPHER_CTX *ctx, ctx, const EVP_CIPHER *type, type, const unsigned char *key, key, const unsigned char *iv, iv, int enc, enc, return 0, return);
--DEFINEFUNC5(int, EVP_CipherUpdate, EVP_CIPHER_CTX *ctx, ctx, unsigned char *out, out, int *outl, outl, const unsigned char *in, in, int inl, inl, return 0, return);
--DEFINEFUNC3(int, EVP_CipherFinal, EVP_CIPHER_CTX *ctx, ctx, unsigned char *out, out, int *outl, outl, return 0, return);
-+DEFINEFUNC5(int, EVP_CipherInit, EVP_CIPHER_CTX *ctx, ctx, const EVP_CIPHER *type, type, const unsigned char *key, key, const unsigned char *iv, iv, int enc, enc, return 0, return)
-+DEFINEFUNC6(int, EVP_CipherInit_ex, EVP_CIPHER_CTX *ctx, ctx, const EVP_CIPHER *cipher, cipher, ENGINE *impl, impl, const unsigned char *key, key, const unsigned char *iv, iv, int enc, enc, return 0, return)
-+DEFINEFUNC5(int, EVP_CipherUpdate, EVP_CIPHER_CTX *ctx, ctx, unsigned char *out, out, int *outl, outl, const unsigned char *in, in, int inl, inl, return 0, return)
-+DEFINEFUNC3(int, EVP_CipherFinal, EVP_CIPHER_CTX *ctx, ctx, unsigned char *out, out, int *outl, outl, return 0, return)
- DEFINEFUNC(const EVP_CIPHER *, EVP_des_cbc, DUMMYARG, DUMMYARG, return 0, return)
- DEFINEFUNC(const EVP_CIPHER *, EVP_des_ede3_cbc, DUMMYARG, DUMMYARG, return 0, return)
- DEFINEFUNC(const EVP_CIPHER *, EVP_rc2_cbc, DUMMYARG, DUMMYARG, return 0, return)
-+DEFINEFUNC(const EVP_MD *, EVP_sha1, DUMMYARG, DUMMYARG, return 0, return)
- DEFINEFUNC3(int, EVP_PKEY_assign, EVP_PKEY *a, a, int b, b, char *c, c, return -1, return)
- DEFINEFUNC2(int, EVP_PKEY_set1_RSA, EVP_PKEY *a, a, RSA *b, b, return -1, return)
- DEFINEFUNC2(int, EVP_PKEY_set1_DSA, EVP_PKEY *a, a, DSA *b, b, return -1, return)
-@@ -202,10 +349,8 @@ DEFINEFUNC3(int, i2t_ASN1_OBJECT, char *a, a, int b, b, ASN1_OBJECT *c, c, retur
- DEFINEFUNC4(int, OBJ_obj2txt, char *a, a, int b, b, ASN1_OBJECT *c, c, int d, d, return -1, return)
- 
- DEFINEFUNC(int, OBJ_obj2nid, const ASN1_OBJECT *a, a, return NID_undef, return)
--#ifdef SSLEAY_MACROS
--DEFINEFUNC6(void *, PEM_ASN1_read_bio, d2i_of_void *a, a, const char *b, b, BIO *c, c, void **d, d, pem_password_cb *e, e, void *f, f, return 0, return)
--DEFINEFUNC6(void *, PEM_ASN1_write_bio, d2i_of_void *a, a, const char *b, b, BIO *c, c, void **d, d, pem_password_cb *e, e, void *f, f, return 0, return)
--#else
-+
-+#ifndef SSLEAY_MACROS
- DEFINEFUNC4(EVP_PKEY *, PEM_read_bio_PrivateKey, BIO *a, a, EVP_PKEY **b, b, pem_password_cb *c, c, void *d, d, return 0, return)
- DEFINEFUNC4(DSA *, PEM_read_bio_DSAPrivateKey, BIO *a, a, DSA **b, b, pem_password_cb *c, c, void *d, d, return 0, return)
- DEFINEFUNC4(RSA *, PEM_read_bio_RSAPrivateKey, BIO *a, a, RSA **b, b, pem_password_cb *c, c, void *d, d, return 0, return)
-@@ -218,7 +363,7 @@ DEFINEFUNC7(int, PEM_write_bio_RSAPrivateKey, BIO *a, a, RSA *b, b, const EVP_CI
- #ifndef OPENSSL_NO_EC
- DEFINEFUNC7(int, PEM_write_bio_ECPrivateKey, BIO *a, a, EC_KEY *b, b, const EVP_CIPHER *c, c, unsigned char *d, d, int e, e, pem_password_cb *f, f, void *g, g, return 0, return)
- #endif
--#endif
-+#endif // !SSLEAY_MACROS
- DEFINEFUNC4(EVP_PKEY *, PEM_read_bio_PUBKEY, BIO *a, a, EVP_PKEY **b, b, pem_password_cb *c, c, void *d, d, return 0, return)
- DEFINEFUNC4(DSA *, PEM_read_bio_DSA_PUBKEY, BIO *a, a, DSA **b, b, pem_password_cb *c, c, void *d, d, return 0, return)
- DEFINEFUNC4(RSA *, PEM_read_bio_RSA_PUBKEY, BIO *a, a, RSA **b, b, pem_password_cb *c, c, void *d, d, return 0, return)
-@@ -234,23 +379,10 @@ DEFINEFUNC2(void, RAND_seed, const void *a, a, int b, b, return, DUMMYARG)
- DEFINEFUNC(int, RAND_status, void, DUMMYARG, return -1, return)
- DEFINEFUNC(RSA *, RSA_new, DUMMYARG, DUMMYARG, return 0, return)
- DEFINEFUNC(void, RSA_free, RSA *a, a, return, DUMMYARG)
--DEFINEFUNC(int, sk_num, STACK *a, a, return -1, return)
--DEFINEFUNC2(void, sk_pop_free, STACK *a, a, void (*b)(void*), b, return, DUMMYARG)
--#if OPENSSL_VERSION_NUMBER >= 0x10000000L
--DEFINEFUNC(_STACK *, sk_new_null, DUMMYARG, DUMMYARG, return 0, return)
--DEFINEFUNC2(void, sk_push, _STACK *a, a, void *b, b, return, DUMMYARG)
--DEFINEFUNC(void, sk_free, _STACK *a, a, return, DUMMYARG)
--DEFINEFUNC2(void *, sk_value, STACK *a, a, int b, b, return 0, return)
--#else
--DEFINEFUNC(STACK *, sk_new_null, DUMMYARG, DUMMYARG, return 0, return)
--DEFINEFUNC2(void, sk_push, STACK *a, a, char *b, b, return, DUMMYARG)
--DEFINEFUNC(void, sk_free, STACK *a, a, return, DUMMYARG)
--DEFINEFUNC2(char *, sk_value, STACK *a, a, int b, b, return 0, return)
--#endif
- DEFINEFUNC(int, SSL_accept, SSL *a, a, return -1, return)
- DEFINEFUNC(int, SSL_clear, SSL *a, a, return -1, return)
--DEFINEFUNC3(char *, SSL_CIPHER_description, SSL_CIPHER *a, a, char *b, b, int c, c, return 0, return)
--DEFINEFUNC2(int, SSL_CIPHER_get_bits, SSL_CIPHER *a, a, int *b, b, return 0, return)
-+DEFINEFUNC3(char *, SSL_CIPHER_description, const SSL_CIPHER *a, a, char *b, b, int c, c, return 0, return)
-+DEFINEFUNC2(int, SSL_CIPHER_get_bits, const SSL_CIPHER *a, a, int *b, b, return 0, return)
- DEFINEFUNC(int, SSL_connect, SSL *a, a, return -1, return)
- DEFINEFUNC(int, SSL_CTX_check_private_key, const SSL_CTX *a, a, return -1, return)
- DEFINEFUNC4(long, SSL_CTX_ctrl, SSL_CTX *a, a, int b, b, long c, c, void *d, d, return -1, return)
-@@ -287,8 +419,6 @@ DEFINEFUNC(long, SSL_get_verify_result, const SSL *a, a, return -1, return)
- #else
- DEFINEFUNC(long, SSL_get_verify_result, SSL *a, a, return -1, return)
- #endif
--DEFINEFUNC(int, SSL_library_init, void, DUMMYARG, return -1, return)
--DEFINEFUNC(void, SSL_load_error_strings, void, DUMMYARG, return, DUMMYARG)
- DEFINEFUNC(SSL *, SSL_new, SSL_CTX *a, a, return 0, return)
- DEFINEFUNC4(long, SSL_ctrl, SSL *a, a, int cmd, cmd, long larg, larg, void *parg, parg, return -1, return)
- DEFINEFUNC3(int, SSL_read, SSL *a, a, void *b, b, int c, c, return -1, return)
-@@ -301,7 +431,6 @@ DEFINEFUNC(void, SSL_SESSION_free, SSL_SESSION *ses, ses, return, DUMMYARG)
- DEFINEFUNC(SSL_SESSION*, SSL_get1_session, SSL *ssl, ssl, return 0, return)
- DEFINEFUNC(SSL_SESSION*, SSL_get_session, const SSL *ssl, ssl, return 0, return)
- #if OPENSSL_VERSION_NUMBER >= 0x10001000L
--DEFINEFUNC5(int, SSL_get_ex_new_index, long argl, argl, void *argp, argp, CRYPTO_EX_new *new_func, new_func, CRYPTO_EX_dup *dup_func, dup_func, CRYPTO_EX_free *free_func, free_func, return -1, return)
- DEFINEFUNC3(int, SSL_set_ex_data, SSL *ssl, ssl, int idx, idx, void *arg, arg, return 0, return)
- DEFINEFUNC2(void *, SSL_get_ex_data, const SSL *ssl, ssl, int idx, idx, return NULL, return)
- #endif
-@@ -310,51 +439,9 @@ DEFINEFUNC2(void, SSL_set_psk_client_callback, SSL* ssl, ssl, q_psk_client_callb
- DEFINEFUNC2(void, SSL_set_psk_server_callback, SSL* ssl, ssl, q_psk_server_callback_t callback, callback, return, DUMMYARG)
- DEFINEFUNC2(int, SSL_CTX_use_psk_identity_hint, SSL_CTX* ctx, ctx, const char *hint, hint, return 0, return)
- #endif
--#if OPENSSL_VERSION_NUMBER >= 0x10000000L
--#ifndef OPENSSL_NO_SSL2
--DEFINEFUNC(const SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return)
--#endif
--#ifndef OPENSSL_NO_SSL3_METHOD
--DEFINEFUNC(const SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return)
--#endif
--DEFINEFUNC(const SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, return 0, return)
--DEFINEFUNC(const SSL_METHOD *, TLSv1_client_method, DUMMYARG, DUMMYARG, return 0, return)
--#if OPENSSL_VERSION_NUMBER >= 0x10001000L
--DEFINEFUNC(const SSL_METHOD *, TLSv1_1_client_method, DUMMYARG, DUMMYARG, return 0, return)
--DEFINEFUNC(const SSL_METHOD *, TLSv1_2_client_method, DUMMYARG, DUMMYARG, return 0, return)
--#endif
--#ifndef OPENSSL_NO_SSL2
--DEFINEFUNC(const SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return)
--#endif
--#ifndef OPENSSL_NO_SSL3_METHOD
--DEFINEFUNC(const SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, return 0, return)
--#endif
--DEFINEFUNC(const SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, return 0, return)
--DEFINEFUNC(const SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, return 0, return)
--#if OPENSSL_VERSION_NUMBER >= 0x10001000L
--DEFINEFUNC(const SSL_METHOD *, TLSv1_1_server_method, DUMMYARG, DUMMYARG, return 0, return)
--DEFINEFUNC(const SSL_METHOD *, TLSv1_2_server_method, DUMMYARG, DUMMYARG, return 0, return)
--#endif
--#else
--#ifndef OPENSSL_NO_SSL2
--DEFINEFUNC(SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return)
--#endif
--#ifndef OPENSSL_NO_SSL3_METHOD
--DEFINEFUNC(SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return)
--#endif
--DEFINEFUNC(SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, return 0, return)
--DEFINEFUNC(SSL_METHOD *, TLSv1_client_method, DUMMYARG, DUMMYARG, return 0, return)
--#ifndef OPENSSL_NO_SSL2
--DEFINEFUNC(SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return)
--#endif
--#ifndef OPENSSL_NO_SSL3_METHOD
--DEFINEFUNC(SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, return 0, return)
--#endif
--DEFINEFUNC(SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, return 0, return)
--DEFINEFUNC(SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, return 0, return)
--#endif
- DEFINEFUNC3(int, SSL_write, SSL *a, a, const void *b, b, int c, c, return -1, return)
- DEFINEFUNC2(int, X509_cmp, X509 *a, a, X509 *b, b, return -1, return)
-+DEFINEFUNC4(int, X509_digest, const X509 *x509, x509, const EVP_MD *type, type, unsigned char *md, md, unsigned int *len, len, return -1, return)
- #ifndef SSLEAY_MACROS
- DEFINEFUNC(X509 *, X509_dup, X509 *a, a, return 0, return)
- #endif
-@@ -378,6 +465,7 @@ DEFINEFUNC2(int, ASN1_STRING_print, BIO *a, a, ASN1_STRING *b, b, return 0, retu
- DEFINEFUNC2(int, X509_check_issued, X509 *a, a, X509 *b, b, return -1, return)
- DEFINEFUNC(X509_NAME *, X509_get_issuer_name, X509 *a, a, return 0, return)
- DEFINEFUNC(X509_NAME *, X509_get_subject_name, X509 *a, a, return 0, return)
-+DEFINEFUNC(ASN1_INTEGER *, X509_get_serialNumber, X509 *a, a, return 0, return)
- DEFINEFUNC(int, X509_verify_cert, X509_STORE_CTX *a, a, return -1, return)
- DEFINEFUNC(int, X509_NAME_entry_count, X509_NAME *a, a, return 0, return)
- DEFINEFUNC2(X509_NAME_ENTRY *, X509_NAME_get_entry, X509_NAME *a, a, int b, b, return 0, return)
-@@ -393,25 +481,8 @@ DEFINEFUNC2(int, X509_STORE_CTX_set_purpose, X509_STORE_CTX *a, a, int b, b, ret
- DEFINEFUNC(int, X509_STORE_CTX_get_error, X509_STORE_CTX *a, a, return -1, return)
- DEFINEFUNC(int, X509_STORE_CTX_get_error_depth, X509_STORE_CTX *a, a, return -1, return)
- DEFINEFUNC(X509 *, X509_STORE_CTX_get_current_cert, X509_STORE_CTX *a, a, return 0, return)
--DEFINEFUNC(STACK_OF(X509) *, X509_STORE_CTX_get_chain, X509_STORE_CTX *a, a, return 0, return)
- DEFINEFUNC(X509_STORE_CTX *, X509_STORE_CTX_new, DUMMYARG, DUMMYARG, return 0, return)
--#ifdef SSLEAY_MACROS
--DEFINEFUNC2(int, i2d_DSAPrivateKey, const DSA *a, a, unsigned char **b, b, return -1, return)
--DEFINEFUNC2(int, i2d_RSAPrivateKey, const RSA *a, a, unsigned char **b, b, return -1, return)
--#ifndef OPENSSL_NO_EC
--DEFINEFUNC2(int, i2d_ECPrivateKey, const EC_KEY *a, a, unsigned char **b, b, return -1, return)
--#endif
--DEFINEFUNC3(RSA *, d2i_RSAPrivateKey, RSA **a, a, unsigned char **b, b, long c, c, return 0, return)
--DEFINEFUNC3(DSA *, d2i_DSAPrivateKey, DSA **a, a, unsigned char **b, b, long c, c, return 0, return)
--#ifndef OPENSSL_NO_EC
--DEFINEFUNC3(EC_KEY *, d2i_ECPrivateKey, EC_KEY **a, a, unsigned char **b, b, long c, c, return 0, return)
--#endif
--#endif
--DEFINEFUNC(void, OPENSSL_add_all_algorithms_noconf, void, DUMMYARG, return, DUMMYARG)
--DEFINEFUNC(void, OPENSSL_add_all_algorithms_conf, void, DUMMYARG, return, DUMMYARG)
- DEFINEFUNC3(int, SSL_CTX_load_verify_locations, SSL_CTX *ctx, ctx, const char *CAfile, CAfile, const char *CApath, CApath, return 0, return)
--DEFINEFUNC(long, SSLeay, void, DUMMYARG, return 0, return)
--DEFINEFUNC(const char *, SSLeay_version, int a, a, return 0, return)
- DEFINEFUNC2(int, i2d_SSL_SESSION, SSL_SESSION *in, in, unsigned char **pp, pp, return 0, return)
- DEFINEFUNC3(SSL_SESSION *, d2i_SSL_SESSION, SSL_SESSION **a, a, const unsigned char **pp, pp, long length, length, return 0, return)
- #if OPENSSL_VERSION_NUMBER >= 0x1000100fL && !defined(OPENSSL_NO_NEXTPROTONEG)
-@@ -694,8 +765,8 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
- #ifndef Q_OS_DARWIN
-     // second attempt: find the development files libssl.so and libcrypto.so
-     //
--    // disabled on OS X/iOS:
--    //  OS X's /usr/lib/libssl.dylib, /usr/lib/libcrypto.dylib will be picked up in the third
-+    // disabled on macOS/iOS:
-+    //  macOS'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);
-@@ -754,7 +825,11 @@ bool q_resolveOpenSslSymbols()
-     static bool symbolsResolved = false;
-     static bool triedToResolveSymbols = false;
- #ifndef QT_NO_THREAD
-+#if QT_CONFIG(opensslv11)
-+    QMutexLocker locker(QMutexPool::globalInstanceGet((void *)&q_OPENSSL_init_ssl));
-+#else
-     QMutexLocker locker(QMutexPool::globalInstanceGet((void *)&q_SSL_library_init));
-+#endif
- #endif
-     if (symbolsResolved)
-         return true;
-@@ -771,11 +846,145 @@ bool q_resolveOpenSslSymbols()
-         // failed to load them
-         return false;
- 
-+#if QT_CONFIG(opensslv11)
-+
-+    RESOLVEFUNC(OPENSSL_init_ssl)
-+    RESOLVEFUNC(OPENSSL_init_crypto)
-+    RESOLVEFUNC(ASN1_STRING_get0_data)
-+    RESOLVEFUNC(EVP_CIPHER_CTX_reset)
-+    RESOLVEFUNC(EVP_PKEY_base_id)
-+    RESOLVEFUNC(RSA_bits)
-+    RESOLVEFUNC(OPENSSL_sk_new_null)
-+    RESOLVEFUNC(OPENSSL_sk_push)
-+    RESOLVEFUNC(OPENSSL_sk_free)
-+    RESOLVEFUNC(OPENSSL_sk_num)
-+    RESOLVEFUNC(OPENSSL_sk_pop_free)
-+    RESOLVEFUNC(OPENSSL_sk_value)
-+    RESOLVEFUNC(DH_get0_pqg)
-+    RESOLVEFUNC(SSL_CTX_set_options)
-+    RESOLVEFUNC(SSL_get_client_random)
-+    RESOLVEFUNC(SSL_SESSION_get_master_key)
-+    RESOLVEFUNC(SSL_session_reused)
-+    RESOLVEFUNC(SSL_get_session)
-+    RESOLVEFUNC(CRYPTO_get_ex_new_index)
-+    RESOLVEFUNC(TLS_method)
-+    RESOLVEFUNC(TLS_client_method)
-+    RESOLVEFUNC(TLS_server_method)
-+    RESOLVEFUNC(X509_STORE_CTX_get0_chain)
-+    RESOLVEFUNC(X509_getm_notBefore)
-+    RESOLVEFUNC(X509_getm_notAfter)
-+    RESOLVEFUNC(X509_get_version)
-+    RESOLVEFUNC(X509_get_pubkey)
-+    RESOLVEFUNC(X509_STORE_set_verify_cb)
-+    RESOLVEFUNC(CRYPTO_free)
-+    RESOLVEFUNC(OpenSSL_version_num)
-+    RESOLVEFUNC(OpenSSL_version)
-+    if (!_q_OpenSSL_version) {
-+        // Apparently, we were built with OpenSSL 1.1 enabled but are now using
-+        // a wrong library.
-+        delete libs.first;
-+        delete libs.second;
-+        qCWarning(lcSsl, "Incompatible version of OpenSSL");
-+        return false;
-+    }
-+
-+    RESOLVEFUNC(SSL_SESSION_get_ticket_lifetime_hint)
-+    RESOLVEFUNC(DH_bits)
-+    RESOLVEFUNC(DSA_bits)
-+
-+#else // !opensslv11
-+
-+    RESOLVEFUNC(ASN1_STRING_data)
-+
- #ifdef SSLEAY_MACROS
-     RESOLVEFUNC(ASN1_dup)
-+#endif // SSLEAY_MACROS
-+    RESOLVEFUNC(BIO_new_file)
-+    RESOLVEFUNC(ERR_clear_error)
-+    RESOLVEFUNC(CRYPTO_free)
-+    RESOLVEFUNC(CRYPTO_num_locks)
-+    RESOLVEFUNC(CRYPTO_set_id_callback)
-+    RESOLVEFUNC(CRYPTO_set_locking_callback)
-+    RESOLVEFUNC(ERR_peek_last_error)
-+    RESOLVEFUNC(ERR_free_strings)
-+    RESOLVEFUNC(EVP_CIPHER_CTX_cleanup)
-+    RESOLVEFUNC(EVP_CIPHER_CTX_init)
-+
-+#ifdef SSLEAY_MACROS // ### verify
-+    RESOLVEFUNC(PEM_ASN1_read_bio)
-+#endif // SSLEAY_MACROS
-+
-+    RESOLVEFUNC(sk_new_null)
-+    RESOLVEFUNC(sk_push)
-+    RESOLVEFUNC(sk_free)
-+    RESOLVEFUNC(sk_num)
-+    RESOLVEFUNC(sk_pop_free)
-+    RESOLVEFUNC(sk_value)
-+    RESOLVEFUNC(SSL_library_init)
-+    RESOLVEFUNC(SSL_load_error_strings)
-+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
-+    RESOLVEFUNC(SSL_get_ex_new_index)
-+#endif
-+#ifndef OPENSSL_NO_SSL2
-+    RESOLVEFUNC(SSLv2_client_method)
- #endif
-+#ifndef OPENSSL_NO_SSL3_METHOD
-+    RESOLVEFUNC(SSLv3_client_method)
-+#endif
-+    RESOLVEFUNC(SSLv23_client_method)
-+    RESOLVEFUNC(TLSv1_client_method)
-+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
-+    RESOLVEFUNC(TLSv1_1_client_method)
-+    RESOLVEFUNC(TLSv1_2_client_method)
-+#endif
-+#ifndef OPENSSL_NO_SSL2
-+    RESOLVEFUNC(SSLv2_server_method)
-+#endif
-+#ifndef OPENSSL_NO_SSL3_METHOD
-+    RESOLVEFUNC(SSLv3_server_method)
-+#endif
-+    RESOLVEFUNC(SSLv23_server_method)
-+    RESOLVEFUNC(TLSv1_server_method)
-+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
-+    RESOLVEFUNC(TLSv1_1_server_method)
-+    RESOLVEFUNC(TLSv1_2_server_method)
-+#endif
-+    RESOLVEFUNC(X509_STORE_CTX_get_chain)
-+#ifdef SSLEAY_MACROS
-+    RESOLVEFUNC(i2d_DSAPrivateKey)
-+    RESOLVEFUNC(i2d_RSAPrivateKey)
-+    RESOLVEFUNC(d2i_DSAPrivateKey)
-+    RESOLVEFUNC(d2i_RSAPrivateKey)
-+#endif
-+    RESOLVEFUNC(CONF_get1_default_config_file)
-+    RESOLVEFUNC(OPENSSL_add_all_algorithms_noconf)
-+    RESOLVEFUNC(OPENSSL_add_all_algorithms_conf)
-+    RESOLVEFUNC(SSLeay)
-+
-+    if (!_q_SSLeay || q_SSLeay() >= 0x10100000L) {
-+        // OpenSSL 1.1 has deprecated and removed SSLeay. We consider a failure to
-+        // resolve this symbol as a failure to resolve symbols.
-+        // The right operand of '||' above is ... a bit of paranoia.
-+        delete libs.first;
-+        delete libs.second;
-+        qCWarning(lcSsl, "Incompatible version of OpenSSL");
-+        return false;
-+    }
-+
-+
-+    RESOLVEFUNC(SSLeay_version)
-+
-+#ifndef OPENSSL_NO_EC
-+#if OPENSSL_VERSION_NUMBER >= 0x10002000L
-+    if (q_SSLeay() >= 0x10002000L)
-+        RESOLVEFUNC(EC_curve_nist2nid)
-+#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
-+#endif // OPENSSL_NO_EC
-+
-+
-+#endif // !opensslv11
-+
-     RESOLVEFUNC(ASN1_INTEGER_get)
--    RESOLVEFUNC(ASN1_STRING_data)
-     RESOLVEFUNC(ASN1_STRING_length)
-     RESOLVEFUNC(ASN1_STRING_to_UTF8)
-     RESOLVEFUNC(BIO_ctrl)
-@@ -794,25 +1003,22 @@ bool q_resolveOpenSslSymbols()
-     RESOLVEFUNC(BN_is_word)
- #endif
-     RESOLVEFUNC(BN_mod_word)
--    RESOLVEFUNC(CRYPTO_free)
--    RESOLVEFUNC(CRYPTO_num_locks)
--    RESOLVEFUNC(CRYPTO_set_id_callback)
--    RESOLVEFUNC(CRYPTO_set_locking_callback)
-     RESOLVEFUNC(DSA_new)
-     RESOLVEFUNC(DSA_free)
-     RESOLVEFUNC(ERR_error_string)
-     RESOLVEFUNC(ERR_get_error)
--    RESOLVEFUNC(ERR_free_strings)
--    RESOLVEFUNC(EVP_CIPHER_CTX_cleanup)
--    RESOLVEFUNC(EVP_CIPHER_CTX_init)
-+    RESOLVEFUNC(EVP_CIPHER_CTX_new)
-+    RESOLVEFUNC(EVP_CIPHER_CTX_free)
-     RESOLVEFUNC(EVP_CIPHER_CTX_ctrl)
-     RESOLVEFUNC(EVP_CIPHER_CTX_set_key_length)
-     RESOLVEFUNC(EVP_CipherInit)
-+    RESOLVEFUNC(EVP_CipherInit_ex)
-     RESOLVEFUNC(EVP_CipherUpdate)
-     RESOLVEFUNC(EVP_CipherFinal)
-     RESOLVEFUNC(EVP_des_cbc)
-     RESOLVEFUNC(EVP_des_ede3_cbc)
-     RESOLVEFUNC(EVP_rc2_cbc)
-+    RESOLVEFUNC(EVP_sha1)
-     RESOLVEFUNC(EVP_PKEY_assign)
-     RESOLVEFUNC(EVP_PKEY_set1_RSA)
-     RESOLVEFUNC(EVP_PKEY_set1_DSA)
-@@ -834,9 +1040,8 @@ bool q_resolveOpenSslSymbols()
-     RESOLVEFUNC(i2t_ASN1_OBJECT)
-     RESOLVEFUNC(OBJ_obj2txt)
-     RESOLVEFUNC(OBJ_obj2nid)
--#ifdef SSLEAY_MACROS // ### verify
--    RESOLVEFUNC(PEM_ASN1_read_bio)
--#else
-+
-+#ifndef SSLEAY_MACROS
-     RESOLVEFUNC(PEM_read_bio_PrivateKey)
-     RESOLVEFUNC(PEM_read_bio_DSAPrivateKey)
-     RESOLVEFUNC(PEM_read_bio_RSAPrivateKey)
-@@ -849,7 +1054,8 @@ bool q_resolveOpenSslSymbols()
- #ifndef OPENSSL_NO_EC
-     RESOLVEFUNC(PEM_write_bio_ECPrivateKey)
- #endif
--#endif
-+#endif // !SSLEAY_MACROS
-+
-     RESOLVEFUNC(PEM_read_bio_PUBKEY)
-     RESOLVEFUNC(PEM_read_bio_DSA_PUBKEY)
-     RESOLVEFUNC(PEM_read_bio_RSA_PUBKEY)
-@@ -865,12 +1071,6 @@ bool q_resolveOpenSslSymbols()
-     RESOLVEFUNC(RAND_status)
-     RESOLVEFUNC(RSA_new)
-     RESOLVEFUNC(RSA_free)
--    RESOLVEFUNC(sk_new_null)
--    RESOLVEFUNC(sk_push)
--    RESOLVEFUNC(sk_free)
--    RESOLVEFUNC(sk_num)
--    RESOLVEFUNC(sk_pop_free)
--    RESOLVEFUNC(sk_value)
-     RESOLVEFUNC(SSL_CIPHER_description)
-     RESOLVEFUNC(SSL_CIPHER_get_bits)
-     RESOLVEFUNC(SSL_CTX_check_private_key)
-@@ -898,8 +1098,6 @@ bool q_resolveOpenSslSymbols()
-     RESOLVEFUNC(SSL_get_peer_cert_chain)
-     RESOLVEFUNC(SSL_get_peer_certificate)
-     RESOLVEFUNC(SSL_get_verify_result)
--    RESOLVEFUNC(SSL_library_init)
--    RESOLVEFUNC(SSL_load_error_strings)
-     RESOLVEFUNC(SSL_new)
-     RESOLVEFUNC(SSL_ctrl)
-     RESOLVEFUNC(SSL_read)
-@@ -912,7 +1110,6 @@ bool q_resolveOpenSslSymbols()
-     RESOLVEFUNC(SSL_get1_session)
-     RESOLVEFUNC(SSL_get_session)
- #if OPENSSL_VERSION_NUMBER >= 0x10001000L
--    RESOLVEFUNC(SSL_get_ex_new_index)
-     RESOLVEFUNC(SSL_set_ex_data)
-     RESOLVEFUNC(SSL_get_ex_data)
- #endif
-@@ -922,30 +1119,6 @@ bool q_resolveOpenSslSymbols()
-     RESOLVEFUNC(SSL_CTX_use_psk_identity_hint)
- #endif
-     RESOLVEFUNC(SSL_write)
--#ifndef OPENSSL_NO_SSL2
--    RESOLVEFUNC(SSLv2_client_method)
--#endif
--#ifndef OPENSSL_NO_SSL3_METHOD
--    RESOLVEFUNC(SSLv3_client_method)
--#endif
--    RESOLVEFUNC(SSLv23_client_method)
--    RESOLVEFUNC(TLSv1_client_method)
--#if OPENSSL_VERSION_NUMBER >= 0x10001000L
--    RESOLVEFUNC(TLSv1_1_client_method)
--    RESOLVEFUNC(TLSv1_2_client_method)
--#endif
--#ifndef OPENSSL_NO_SSL2
--    RESOLVEFUNC(SSLv2_server_method)
--#endif
--#ifndef OPENSSL_NO_SSL3_METHOD
--    RESOLVEFUNC(SSLv3_server_method)
--#endif
--    RESOLVEFUNC(SSLv23_server_method)
--    RESOLVEFUNC(TLSv1_server_method)
--#if OPENSSL_VERSION_NUMBER >= 0x10001000L
--    RESOLVEFUNC(TLSv1_1_server_method)
--    RESOLVEFUNC(TLSv1_2_server_method)
--#endif
-     RESOLVEFUNC(X509_NAME_entry_count)
-     RESOLVEFUNC(X509_NAME_get_entry)
-     RESOLVEFUNC(X509_NAME_ENTRY_get_data)
-@@ -961,12 +1134,12 @@ bool q_resolveOpenSslSymbols()
-     RESOLVEFUNC(X509_STORE_CTX_get_error)
-     RESOLVEFUNC(X509_STORE_CTX_get_error_depth)
-     RESOLVEFUNC(X509_STORE_CTX_get_current_cert)
--    RESOLVEFUNC(X509_STORE_CTX_get_chain)
-     RESOLVEFUNC(X509_cmp)
- #ifndef SSLEAY_MACROS
-     RESOLVEFUNC(X509_dup)
- #endif
-     RESOLVEFUNC(X509_print)
-+    RESOLVEFUNC(X509_digest)
-     RESOLVEFUNC(X509_EXTENSION_get_object)
-     RESOLVEFUNC(X509_free)
-     RESOLVEFUNC(X509_get_ext)
-@@ -982,20 +1155,11 @@ bool q_resolveOpenSslSymbols()
-     RESOLVEFUNC(X509_check_issued)
-     RESOLVEFUNC(X509_get_issuer_name)
-     RESOLVEFUNC(X509_get_subject_name)
-+    RESOLVEFUNC(X509_get_serialNumber)
-     RESOLVEFUNC(X509_verify_cert)
-     RESOLVEFUNC(d2i_X509)
-     RESOLVEFUNC(i2d_X509)
--#ifdef SSLEAY_MACROS
--    RESOLVEFUNC(i2d_DSAPrivateKey)
--    RESOLVEFUNC(i2d_RSAPrivateKey)
--    RESOLVEFUNC(d2i_DSAPrivateKey)
--    RESOLVEFUNC(d2i_RSAPrivateKey)
--#endif
--    RESOLVEFUNC(OPENSSL_add_all_algorithms_noconf)
--    RESOLVEFUNC(OPENSSL_add_all_algorithms_conf)
-     RESOLVEFUNC(SSL_CTX_load_verify_locations)
--    RESOLVEFUNC(SSLeay)
--    RESOLVEFUNC(SSLeay_version)
-     RESOLVEFUNC(i2d_SSL_SESSION)
-     RESOLVEFUNC(d2i_SSL_SESSION)
- #if OPENSSL_VERSION_NUMBER >= 0x1000100fL && !defined(OPENSSL_NO_NEXTPROTONEG)
-@@ -1019,27 +1183,14 @@ bool q_resolveOpenSslSymbols()
-     RESOLVEFUNC(EC_KEY_new_by_curve_name)
-     RESOLVEFUNC(EC_KEY_free)
-     RESOLVEFUNC(EC_get_builtin_curves)
--#if OPENSSL_VERSION_NUMBER >= 0x10002000L
--    if (q_SSLeay() >= 0x10002000L)
--        RESOLVEFUNC(EC_curve_nist2nid)
--#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
- #endif // OPENSSL_NO_EC
-     RESOLVEFUNC(PKCS12_parse)
-     RESOLVEFUNC(d2i_PKCS12_bio)
-     RESOLVEFUNC(PKCS12_free)
- 
-+    symbolsResolved = true;
-     delete libs.first;
-     delete libs.second;
--    if (!_q_SSLeay || q_SSLeay() >= 0x10100000L) {
--        // OpenSSL 1.1 deprecated and removed SSLeay. We consider a failure to
--        // resolve this symbol as a failure to resolve symbols.
--        // The right operand of '||' above ... a bit of paranoia.
--        qCWarning(lcSsl, "Incompatible version of OpenSSL");
--        return false;
--    }
--
--    symbolsResolved = true;
--
-     return true;
- }
- #endif // QT_CONFIG(library)
-diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h
-index b35a895d38..796bf2d4f5 100644
---- a/src/network/ssl/qsslsocket_openssl_symbols_p.h
-+++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h
-@@ -1,6 +1,6 @@
- /****************************************************************************
- **
--** Copyright (C) 2016 The Qt Company Ltd.
-+** Copyright (C) 2017 The Qt Company Ltd.
- ** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
- ** Contact: https://www.qt.io/licensing/
- **
-@@ -56,6 +56,7 @@
- #ifndef QSSLSOCKET_OPENSSL_SYMBOLS_P_H
- #define QSSLSOCKET_OPENSSL_SYMBOLS_P_H
- 
-+
- //
- //  W A R N I N G
- //  -------------
-@@ -215,17 +216,20 @@ QT_BEGIN_NAMESPACE
- 
- #endif // !defined QT_LINKED_OPENSSL
- 
-+#if QT_CONFIG(opensslv11)
-+#include "qsslsocket_openssl11_symbols_p.h"
-+#else
-+#include "qsslsocket_opensslpre11_symbols_p.h"
-+#endif // QT_CONFIG
-+
- bool q_resolveOpenSslSymbols();
- long q_ASN1_INTEGER_get(ASN1_INTEGER *a);
--unsigned char * q_ASN1_STRING_data(ASN1_STRING *a);
- int q_ASN1_STRING_length(ASN1_STRING *a);
- int q_ASN1_STRING_to_UTF8(unsigned char **a, ASN1_STRING *b);
- long q_BIO_ctrl(BIO *a, int b, long c, void *d);
- Q_AUTOTEST_EXPORT int q_BIO_free(BIO *a);
--Q_AUTOTEST_EXPORT BIO *q_BIO_new(BIO_METHOD *a);
- BIO *q_BIO_new_mem_buf(void *a, int b);
- int q_BIO_read(BIO *a, void *b, int c);
--Q_AUTOTEST_EXPORT BIO_METHOD *q_BIO_s_mem();
- Q_AUTOTEST_EXPORT int q_BIO_write(BIO *a, const void *b, int c);
- int q_BN_num_bits(const BIGNUM *a);
- #if OPENSSL_VERSION_NUMBER >= 0x10100000L
-@@ -247,26 +251,23 @@ BN_ULONG q_BN_mod_word(const BIGNUM *a, BN_ULONG w);
- const EC_GROUP* q_EC_KEY_get0_group(const EC_KEY* k);
- int q_EC_GROUP_get_degree(const EC_GROUP* g);
- #endif
--int q_CRYPTO_num_locks();
--void q_CRYPTO_set_locking_callback(void (*a)(int, int, const char *, int));
--void q_CRYPTO_set_id_callback(unsigned long (*a)());
--void q_CRYPTO_free(void *a);
- DSA *q_DSA_new();
- void q_DSA_free(DSA *a);
- X509 *q_d2i_X509(X509 **a, const unsigned char **b, long c);
- char *q_ERR_error_string(unsigned long a, char *b);
- unsigned long q_ERR_get_error();
--void q_ERR_free_strings();
--void q_EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a);
--void q_EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a);
-+EVP_CIPHER_CTX *q_EVP_CIPHER_CTX_new();
-+void q_EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *a);
- int q_EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr);
- int q_EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen);
- int q_EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, const unsigned char *key, const unsigned char *iv, int enc);
-+int q_EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl, const unsigned char *key, const unsigned char *iv, int enc);
- int q_EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, const unsigned char *in, int inl);
- int q_EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
- const EVP_CIPHER *q_EVP_des_cbc();
- const EVP_CIPHER *q_EVP_des_ede3_cbc();
- const EVP_CIPHER *q_EVP_rc2_cbc();
-+const EVP_MD *q_EVP_sha1();
- int q_EVP_PKEY_assign(EVP_PKEY *a, int b, char *c);
- Q_AUTOTEST_EXPORT int q_EVP_PKEY_set1_RSA(EVP_PKEY *a, RSA *b);
- int q_EVP_PKEY_set1_DSA(EVP_PKEY *a, DSA *b);
-@@ -310,7 +311,7 @@ int q_PEM_write_bio_RSAPrivateKey(BIO *a, RSA *b, const EVP_CIPHER *c, unsigned
- int q_PEM_write_bio_ECPrivateKey(BIO *a, EC_KEY *b, const EVP_CIPHER *c, unsigned char *d,
-                                   int e, pem_password_cb *f, void *g);
- #endif
--#endif
-+#endif // SSLEAY_MACROS
- Q_AUTOTEST_EXPORT EVP_PKEY *q_PEM_read_bio_PUBKEY(BIO *a, EVP_PKEY **b, pem_password_cb *c, void *d);
- DSA *q_PEM_read_bio_DSA_PUBKEY(BIO *a, DSA **b, pem_password_cb *c, void *d);
- RSA *q_PEM_read_bio_RSA_PUBKEY(BIO *a, RSA **b, pem_password_cb *c, void *d);
-@@ -326,23 +327,10 @@ void q_RAND_seed(const void *a, int b);
- int q_RAND_status();
- RSA *q_RSA_new();
- void q_RSA_free(RSA *a);
--int q_sk_num(STACK *a);
--void q_sk_pop_free(STACK *a, void (*b)(void *));
--#if OPENSSL_VERSION_NUMBER >= 0x10000000L
--_STACK *q_sk_new_null();
--void q_sk_push(_STACK *st, void *data);
--void q_sk_free(_STACK *a);
--void * q_sk_value(STACK *a, int b);
--#else
--STACK *q_sk_new_null();
--void q_sk_push(STACK *st, char *data);
--void q_sk_free(STACK *a);
--char * q_sk_value(STACK *a, int b);
--#endif
- int q_SSL_accept(SSL *a);
- int q_SSL_clear(SSL *a);
--char *q_SSL_CIPHER_description(SSL_CIPHER *a, char *b, int c);
--int q_SSL_CIPHER_get_bits(SSL_CIPHER *a, int *b);
-+char *q_SSL_CIPHER_description(const SSL_CIPHER *a, char *b, int c);
-+int q_SSL_CIPHER_get_bits(const SSL_CIPHER *a, int *b);
- int q_SSL_connect(SSL *a);
- int q_SSL_CTX_check_private_key(const SSL_CTX *a);
- long q_SSL_CTX_ctrl(SSL_CTX *a, int b, long c, void *d);
-@@ -374,8 +362,6 @@ int q_SSL_get_error(SSL *a, int b);
- STACK_OF(X509) *q_SSL_get_peer_cert_chain(SSL *a);
- X509 *q_SSL_get_peer_certificate(SSL *a);
- long q_SSL_get_verify_result(const SSL *a);
--int q_SSL_library_init();
--void q_SSL_load_error_strings();
- SSL *q_SSL_new(SSL_CTX *a);
- long q_SSL_ctrl(SSL *ssl,int cmd, long larg, void *parg);
- int q_SSL_read(SSL *a, void *b, int c);
-@@ -388,7 +374,6 @@ void q_SSL_SESSION_free(SSL_SESSION *ses);
- SSL_SESSION *q_SSL_get1_session(SSL *ssl);
- SSL_SESSION *q_SSL_get_session(const SSL *ssl);
- #if OPENSSL_VERSION_NUMBER >= 0x10001000L
--int q_SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
- int q_SSL_set_ex_data(SSL *ssl, int idx, void *arg);
- void *q_SSL_get_ex_data(const SSL *ssl, int idx);
- #endif
-@@ -399,49 +384,6 @@ typedef unsigned int (*q_psk_server_callback_t)(SSL *ssl, const char *identity,
- void q_SSL_set_psk_server_callback(SSL *ssl, q_psk_server_callback_t callback);
- int q_SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *hint);
- #endif // OPENSSL_VERSION_NUMBER >= 0x10001000L && !defined(OPENSSL_NO_PSK)
--#if OPENSSL_VERSION_NUMBER >= 0x10000000L
--#ifndef OPENSSL_NO_SSL2
--const SSL_METHOD *q_SSLv2_client_method();
--#endif
--#ifndef OPENSSL_NO_SSL3_METHOD
--const SSL_METHOD *q_SSLv3_client_method();
--#endif
--const SSL_METHOD *q_SSLv23_client_method();
--const SSL_METHOD *q_TLSv1_client_method();
--const SSL_METHOD *q_TLSv1_1_client_method();
--const SSL_METHOD *q_TLSv1_2_client_method();
--#ifndef OPENSSL_NO_SSL2
--const SSL_METHOD *q_SSLv2_server_method();
--#endif
--#ifndef OPENSSL_NO_SSL3_METHOD
--const SSL_METHOD *q_SSLv3_server_method();
--#endif
--const SSL_METHOD *q_SSLv23_server_method();
--const SSL_METHOD *q_TLSv1_server_method();
--const SSL_METHOD *q_TLSv1_1_server_method();
--const SSL_METHOD *q_TLSv1_2_server_method();
--#else
--#ifndef OPENSSL_NO_SSL2
--SSL_METHOD *q_SSLv2_client_method();
--#endif
--#ifndef OPENSSL_NO_SSL3_METHOD
--SSL_METHOD *q_SSLv3_client_method();
--#endif
--SSL_METHOD *q_SSLv23_client_method();
--SSL_METHOD *q_TLSv1_client_method();
--SSL_METHOD *q_TLSv1_1_client_method();
--SSL_METHOD *q_TLSv1_2_client_method();
--#ifndef OPENSSL_NO_SSL2
--SSL_METHOD *q_SSLv2_server_method();
--#endif
--#ifndef OPENSSL_NO_SSL3_METHOD
--SSL_METHOD *q_SSLv3_server_method();
--#endif
--SSL_METHOD *q_SSLv23_server_method();
--SSL_METHOD *q_TLSv1_server_method();
--SSL_METHOD *q_TLSv1_1_server_method();
--SSL_METHOD *q_TLSv1_2_server_method();
--#endif
- int q_SSL_write(SSL *a, const void *b, int c);
- int q_X509_cmp(X509 *a, X509 *b);
- #ifdef SSLEAY_MACROS
-@@ -452,6 +394,7 @@ void *q_ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, char *x);
- X509 *q_X509_dup(X509 *a);
- #endif
- void q_X509_print(BIO *a, X509*b);
-+int q_X509_digest(const X509 *x509, const EVP_MD *type, unsigned char *md, unsigned int *len);
- ASN1_OBJECT *q_X509_EXTENSION_get_object(X509_EXTENSION *a);
- void q_X509_free(X509 *a);
- X509_EXTENSION *q_X509_get_ext(X509 *a, int b);
-@@ -471,6 +414,7 @@ int q_ASN1_STRING_print(BIO *a, ASN1_STRING *b);
- int q_X509_check_issued(X509 *a, X509 *b);
- X509_NAME *q_X509_get_issuer_name(X509 *a);
- X509_NAME *q_X509_get_subject_name(X509 *a);
-+ASN1_INTEGER *q_X509_get_serialNumber(X509 *a);
- int q_X509_verify_cert(X509_STORE_CTX *ctx);
- int q_X509_NAME_entry_count(X509_NAME *a);
- X509_NAME_ENTRY *q_X509_NAME_get_entry(X509_NAME *a,int b);
-@@ -488,7 +432,6 @@ int q_X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose);
- int q_X509_STORE_CTX_get_error(X509_STORE_CTX *ctx);
- int q_X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx);
- X509 *q_X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx);
--STACK_OF(X509) *q_X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx);
- 
- // Diffie-Hellman support
- DH *q_DH_new();
-@@ -522,34 +465,9 @@ int q_PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
- PKCS12 *q_d2i_PKCS12_bio(BIO *bio, PKCS12 **pkcs12);
- void q_PKCS12_free(PKCS12 *pkcs12);
- 
--
- #define q_BIO_get_mem_data(b, pp) (int)q_BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp)
- #define q_BIO_pending(b) (int)q_BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)
--#ifdef SSLEAY_MACROS
--int     q_i2d_DSAPrivateKey(const DSA *a, unsigned char **pp);
--int     q_i2d_RSAPrivateKey(const RSA *a, unsigned char **pp);
--RSA *q_d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length);
--DSA *q_d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length);
--#define q_PEM_read_bio_RSAPrivateKey(bp, x, cb, u) \
--        (RSA *)q_PEM_ASN1_read_bio( \
--        (void *(*)(void**, const unsigned char**, long int))q_d2i_RSAPrivateKey, PEM_STRING_RSA, bp, (void **)x, cb, u)
--#define q_PEM_read_bio_DSAPrivateKey(bp, x, cb, u) \
--        (DSA *)q_PEM_ASN1_read_bio( \
--        (void *(*)(void**, const unsigned char**, long int))q_d2i_DSAPrivateKey, PEM_STRING_DSA, bp, (void **)x, cb, u)
--#define q_PEM_write_bio_RSAPrivateKey(bp,x,enc,kstr,klen,cb,u) \
--        PEM_ASN1_write_bio((int (*)(void*, unsigned char**))q_i2d_RSAPrivateKey,PEM_STRING_RSA,\
--                           bp,(char *)x,enc,kstr,klen,cb,u)
--#define q_PEM_write_bio_DSAPrivateKey(bp,x,enc,kstr,klen,cb,u) \
--        PEM_ASN1_write_bio((int (*)(void*, unsigned char**))q_i2d_DSAPrivateKey,PEM_STRING_DSA,\
--                           bp,(char *)x,enc,kstr,klen,cb,u)
--#define q_PEM_read_bio_DHparams(bp, dh, cb, u) \
--        (DH *)q_PEM_ASN1_read_bio( \
--        (void *(*)(void**, const unsigned char**, long int))q_d2i_DHparams, PEM_STRING_DHPARAMS, bp, (void **)x, cb, u)
--#endif
--#define q_SSL_CTX_set_options(ctx,op) q_SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL)
- #define q_SSL_CTX_set_mode(ctx,op) q_SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL)
--#define q_SKM_sk_num(type, st) ((int (*)(const STACK_OF(type) *))q_sk_num)(st)
--#define q_SKM_sk_value(type, st,i) ((type * (*)(const STACK_OF(type) *, int))q_sk_value)(st, i)
- #define q_sk_GENERAL_NAME_num(st) q_SKM_sk_num(GENERAL_NAME, (st))
- #define q_sk_GENERAL_NAME_value(st, i) q_SKM_sk_value(GENERAL_NAME, (st), (i))
- #define q_sk_X509_num(st) q_SKM_sk_num(X509, (st))
-@@ -558,18 +476,12 @@ DSA *q_d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length);
- #define q_sk_SSL_CIPHER_value(st, i) q_SKM_sk_value(SSL_CIPHER, (st), (i))
- #define q_SSL_CTX_add_extra_chain_cert(ctx,x509) \
-         q_SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509)
--#define q_X509_get_notAfter(x) X509_get_notAfter(x)
--#define q_X509_get_notBefore(x) X509_get_notBefore(x)
- #define q_EVP_PKEY_assign_RSA(pkey,rsa) q_EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\
-                                         (char *)(rsa))
- #define q_EVP_PKEY_assign_DSA(pkey,dsa) q_EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\
-                                         (char *)(dsa))
- #define q_OpenSSL_add_all_algorithms() q_OPENSSL_add_all_algorithms_conf()
--void q_OPENSSL_add_all_algorithms_noconf();
--void q_OPENSSL_add_all_algorithms_conf();
- int q_SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, const char *CApath);
--long q_SSLeay();
--const char *q_SSLeay_version(int type);
- int q_i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp);
- SSL_SESSION *q_d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, long length);
- 
-diff --git a/src/network/ssl/qsslsocket_opensslpre11.cpp b/src/network/ssl/qsslsocket_opensslpre11.cpp
-new file mode 100644
-index 0000000000..e51888c5f2
---- /dev/null
-+++ b/src/network/ssl/qsslsocket_opensslpre11.cpp
-@@ -0,0 +1,424 @@
-+/****************************************************************************
-+**
-+** Copyright (C) 2017 The Qt Company Ltd.
-+** Copyright (C) 2014 Governikus GmbH & Co. KG
-+** Contact: https://www.qt.io/licensing/
-+**
-+** This file is part of the QtNetwork module of the Qt Toolkit.
-+**
-+** $QT_BEGIN_LICENSE:LGPL$
-+** Commercial License Usage
-+** Licensees holding valid commercial Qt licenses may use this file in
-+** accordance with the commercial license agreement provided with the
-+** Software or, alternatively, in accordance with the terms contained in
-+** a written agreement between you and The Qt Company. For licensing terms
-+** and conditions see https://www.qt.io/terms-conditions. For further
-+** information use the contact form at https://www.qt.io/contact-us.
-+**
-+** GNU Lesser General Public License Usage
-+** Alternatively, this file may be used under the terms of the GNU Lesser
-+** General Public License version 3 as published by the Free Software
-+** Foundation and appearing in the file LICENSE.LGPL3 included in the
-+** packaging of this file. Please review the following information to
-+** ensure the GNU Lesser General Public License version 3 requirements
-+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-+**
-+** GNU General Public License Usage
-+** Alternatively, this file may be used under the terms of the GNU
-+** General Public License version 2.0 or (at your option) the GNU General
-+** Public license version 3 or any later version approved by the KDE Free
-+** Qt Foundation. The licenses are as published by the Free Software
-+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-+** included in the packaging of this file. Please review the following
-+** information to ensure the GNU General Public License requirements will
-+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-+** https://www.gnu.org/licenses/gpl-3.0.html.
-+**
-+** $QT_END_LICENSE$
-+**
-+****************************************************************************/
-+
-+/****************************************************************************
-+**
-+** In addition, as a special exception, the copyright holders listed above give
-+** permission to link the code of its release of Qt with the OpenSSL project's
-+** "OpenSSL" library (or modified versions of the "OpenSSL" library that use the
-+** same license as the original version), and distribute the linked executables.
-+**
-+** You must comply with the GNU General Public License version 2 in all
-+** respects for all of the code used other than the "OpenSSL" code.  If you
-+** modify this file, you may extend this exception to your version of the file,
-+** but you are not obligated to do so.  If you do not wish to do so, delete
-+** this exception statement from your version of this file.
-+**
-+****************************************************************************/
-+
-+//#define QT_DECRYPT_SSL_TRAFFIC
-+
-+#include "qssl_p.h"
-+#include "qsslsocket_openssl_p.h"
-+#include "qsslsocket_openssl_symbols_p.h"
-+#include "qsslsocket.h"
-+#include "qsslkey.h"
-+
-+#include <QtCore/qdebug.h>
-+#include <QtCore/qdir.h>
-+#include <QtCore/qdiriterator.h>
-+#include <QtCore/qthread.h>
-+#include <QtCore/qfile.h>
-+#include <QtCore/qmutex.h>
-+#include <QtCore/qlibrary.h>
-+
-+QT_BEGIN_NAMESPACE
-+
-+/* \internal
-+
-+    From OpenSSL's thread(3) manual page:
-+
-+    OpenSSL can safely be used in multi-threaded applications provided that at
-+    least two callback functions are set.
-+
-+    locking_function(int mode, int n, const char *file, int line) is needed to
-+    perform locking on shared data structures.  (Note that OpenSSL uses a
-+    number of global data structures that will be implicitly shared
-+    whenever multiple threads use OpenSSL.)  Multi-threaded
-+    applications will crash at random if it is not set.  ...
-+    ...
-+    id_function(void) is a function that returns a thread ID. It is not
-+    needed on Windows nor on platforms where getpid() returns a different
-+    ID for each thread (most notably Linux)
-+*/
-+
-+class QOpenSslLocks
-+{
-+public:
-+    QOpenSslLocks()
-+        : initLocker(QMutex::Recursive),
-+          locksLocker(QMutex::Recursive)
-+    {
-+        QMutexLocker locker(&locksLocker);
-+        int numLocks = q_CRYPTO_num_locks();
-+        locks = new QMutex *[numLocks];
-+        memset(locks, 0, numLocks * sizeof(QMutex *));
-+    }
-+    ~QOpenSslLocks()
-+    {
-+        QMutexLocker locker(&locksLocker);
-+        for (int i = 0; i < q_CRYPTO_num_locks(); ++i)
-+            delete locks[i];
-+        delete [] locks;
-+
-+        QSslSocketPrivate::deinitialize();
-+    }
-+    QMutex *lock(int num)
-+    {
-+        QMutexLocker locker(&locksLocker);
-+        QMutex *tmp = locks[num];
-+        if (!tmp)
-+            tmp = locks[num] = new QMutex(QMutex::Recursive);
-+        return tmp;
-+    }
-+
-+    QMutex *globalLock()
-+    {
-+        return &locksLocker;
-+    }
-+
-+    QMutex *initLock()
-+    {
-+        return &initLocker;
-+    }
-+
-+private:
-+    QMutex initLocker;
-+    QMutex locksLocker;
-+    QMutex **locks;
-+};
-+
-+Q_GLOBAL_STATIC(QOpenSslLocks, openssl_locks)
-+
-+extern "C" {
-+static void locking_function(int mode, int lockNumber, const char *, int)
-+{
-+    QMutex *mutex = openssl_locks()->lock(lockNumber);
-+
-+    // Lock or unlock it
-+    if (mode & CRYPTO_LOCK)
-+        mutex->lock();
-+    else
-+        mutex->unlock();
-+}
-+static unsigned long id_function()
-+{
-+    return (quintptr)QThread::currentThreadId();
-+}
-+
-+} // extern "C"
-+
-+static void q_OpenSSL_add_all_algorithms_safe()
-+{
-+#ifdef Q_OS_WIN
-+    // Prior to version 1.0.1m an attempt to call OpenSSL_add_all_algorithms on
-+    // Windows could result in 'exit' call from OPENSSL_config (QTBUG-43843).
-+    // We can predict this and avoid OPENSSL_add_all_algorithms call.
-+    // From OpenSSL docs:
-+    // "An application does not need to add algorithms to use them explicitly,
-+    // for example by EVP_sha1(). It just needs to add them if it (or any of
-+    // the functions it calls) needs to lookup algorithms.
-+    // The cipher and digest lookup functions are used in many parts of the
-+    // library. If the table is not initialized several functions will
-+    // misbehave and complain they cannot find algorithms. This includes the
-+    // PEM, PKCS#12, SSL and S/MIME libraries. This is a common query in
-+    // the OpenSSL mailing lists."
-+    //
-+    // Anyway, as a result, we chose not to call this function if it would exit.
-+
-+    if (q_SSLeay() < 0x100010DFL)
-+    {
-+        // Now, before we try to call it, check if an attempt to open config file
-+        // will result in exit:
-+        if (char *confFileName = q_CONF_get1_default_config_file()) {
-+            BIO *confFile = q_BIO_new_file(confFileName, "r");
-+            const auto lastError = q_ERR_peek_last_error();
-+            q_CRYPTO_free(confFileName);
-+            if (confFile) {
-+                q_BIO_free(confFile);
-+            } else {
-+                q_ERR_clear_error();
-+                if (ERR_GET_REASON(lastError) == ERR_R_SYS_LIB) {
-+                    qCWarning(lcSsl, "failed to open openssl.conf file");
-+                    return;
-+                }
-+            }
-+        }
-+    }
-+#endif // Q_OS_WIN
-+
-+    q_OpenSSL_add_all_algorithms();
-+}
-+
-+
-+/*!
-+    \internal
-+*/
-+void QSslSocketPrivate::deinitialize()
-+{
-+    q_CRYPTO_set_id_callback(0);
-+    q_CRYPTO_set_locking_callback(0);
-+    q_ERR_free_strings();
-+}
-+
-+
-+bool QSslSocketPrivate::ensureLibraryLoaded()
-+{
-+    if (!q_resolveOpenSslSymbols())
-+        return false;
-+
-+    // Check if the library itself needs to be initialized.
-+    QMutexLocker locker(openssl_locks()->initLock());
-+
-+    if (!s_libraryLoaded) {
-+        s_libraryLoaded = true;
-+
-+        // Initialize OpenSSL.
-+        q_CRYPTO_set_id_callback(id_function);
-+        q_CRYPTO_set_locking_callback(locking_function);
-+        if (q_SSL_library_init() != 1)
-+            return false;
-+        q_SSL_load_error_strings();
-+        q_OpenSSL_add_all_algorithms_safe();
-+
-+#if OPENSSL_VERSION_NUMBER >= 0x10001000L
-+        if (q_SSLeay() >= 0x10001000L)
-+            QSslSocketBackendPrivate::s_indexForSSLExtraData = q_SSL_get_ex_new_index(0L, NULL, NULL, NULL, NULL);
-+#endif
-+
-+        // Initialize OpenSSL's random seed.
-+        if (!q_RAND_status()) {
-+            qWarning("Random number generator not seeded, disabling SSL support");
-+            return false;
-+        }
-+    }
-+    return true;
-+}
-+
-+void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
-+{
-+    QMutexLocker locker(openssl_locks()->initLock());
-+    if (s_loadedCiphersAndCerts)
-+        return;
-+    s_loadedCiphersAndCerts = true;
-+
-+    resetDefaultCiphers();
-+    resetDefaultEllipticCurves();
-+
-+#if QT_CONFIG(library)
-+    //load symbols needed to receive certificates from system store
-+#if defined(Q_OS_WIN)
-+    HINSTANCE hLib = LoadLibraryW(L"Crypt32");
-+    if (hLib) {
-+        ptrCertOpenSystemStoreW = (PtrCertOpenSystemStoreW)GetProcAddress(hLib, "CertOpenSystemStoreW");
-+        ptrCertFindCertificateInStore = (PtrCertFindCertificateInStore)GetProcAddress(hLib, "CertFindCertificateInStore");
-+        ptrCertCloseStore = (PtrCertCloseStore)GetProcAddress(hLib, "CertCloseStore");
-+        if (!ptrCertOpenSystemStoreW || !ptrCertFindCertificateInStore || !ptrCertCloseStore)
-+            qCWarning(lcSsl, "could not resolve symbols in crypt32 library"); // should never happen
-+    } else {
-+        qCWarning(lcSsl, "could not load crypt32 library"); // should never happen
-+    }
-+#elif defined(Q_OS_QNX)
-+    s_loadRootCertsOnDemand = true;
-+#elif defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
-+    // check whether we can enable on-demand root-cert loading (i.e. check whether the sym links are there)
-+    QList<QByteArray> dirs = unixRootCertDirectories();
-+    QStringList symLinkFilter;
-+    symLinkFilter << QLatin1String("[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].[0-9]");
-+    for (int a = 0; a < dirs.count(); ++a) {
-+        QDirIterator iterator(QLatin1String(dirs.at(a)), symLinkFilter, QDir::Files);
-+        if (iterator.hasNext()) {
-+            s_loadRootCertsOnDemand = true;
-+            break;
-+        }
-+    }
-+#endif
-+#endif // QT_CONFIG(library)
-+    // if on-demand loading was not enabled, load the certs now
-+    if (!s_loadRootCertsOnDemand)
-+        setDefaultCaCertificates(systemCaCertificates());
-+#ifdef Q_OS_WIN
-+    //Enabled for fetching additional root certs from windows update on windows 6+
-+    //This flag is set false by setDefaultCaCertificates() indicating the app uses
-+    //its own cert bundle rather than the system one.
-+    //Same logic that disables the unix on demand cert loading.
-+    //Unlike unix, we do preload the certificates from the cert store.
-+    if ((QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) >= QSysInfo::WV_6_0)
-+        s_loadRootCertsOnDemand = true;
-+#endif
-+}
-+
-+long QSslSocketPrivate::sslLibraryVersionNumber()
-+{
-+    if (!supportsSsl())
-+        return 0;
-+
-+    return q_SSLeay();
-+}
-+
-+QString QSslSocketPrivate::sslLibraryVersionString()
-+{
-+    if (!supportsSsl())
-+        return QString();
-+
-+    const char *versionString = q_SSLeay_version(SSLEAY_VERSION);
-+    if (!versionString)
-+        return QString();
-+
-+    return QString::fromLatin1(versionString);
-+}
-+
-+void QSslSocketBackendPrivate::continueHandshake()
-+{
-+    Q_Q(QSslSocket);
-+    // if we have a max read buffer size, reset the plain socket's to match
-+    if (readBufferMaxSize)
-+        plainSocket->setReadBufferSize(readBufferMaxSize);
-+
-+    if (q_SSL_ctrl((ssl), SSL_CTRL_GET_SESSION_REUSED, 0, NULL))
-+        configuration.peerSessionShared = true;
-+
-+#ifdef QT_DECRYPT_SSL_TRAFFIC
-+    if (ssl->session && ssl->s3) {
-+        const char *mk = reinterpret_cast<const char *>(ssl->session->master_key);
-+        QByteArray masterKey(mk, ssl->session->master_key_length);
-+        const char *random = reinterpret_cast<const char *>(ssl->s3->client_random);
-+        QByteArray clientRandom(random, SSL3_RANDOM_SIZE);
-+
-+        // different format, needed for e.g. older Wireshark versions:
-+//        const char *sid = reinterpret_cast<const char *>(ssl->session->session_id);
-+//        QByteArray sessionID(sid, ssl->session->session_id_length);
-+//        QByteArray debugLineRSA("RSA Session-ID:");
-+//        debugLineRSA.append(sessionID.toHex().toUpper());
-+//        debugLineRSA.append(" Master-Key:");
-+//        debugLineRSA.append(masterKey.toHex().toUpper());
-+//        debugLineRSA.append("\n");
-+
-+        QByteArray debugLineClientRandom("CLIENT_RANDOM ");
-+        debugLineClientRandom.append(clientRandom.toHex().toUpper());
-+        debugLineClientRandom.append(" ");
-+        debugLineClientRandom.append(masterKey.toHex().toUpper());
-+        debugLineClientRandom.append("\n");
-+
-+        QString sslKeyFile = QDir::tempPath() + QLatin1String("/qt-ssl-keys");
-+        QFile file(sslKeyFile);
-+        if (!file.open(QIODevice::Append))
-+            qCWarning(lcSsl) << "could not open file" << sslKeyFile << "for appending";
-+        if (!file.write(debugLineClientRandom))
-+            qCWarning(lcSsl) << "could not write to file" << sslKeyFile;
-+        file.close();
-+    } else {
-+        qCWarning(lcSsl, "could not decrypt SSL traffic");
-+    }
-+#endif
-+
-+    // Cache this SSL session inside the QSslContext
-+    if (!(configuration.sslOptions & QSsl::SslOptionDisableSessionSharing)) {
-+        if (!sslContextPointer->cacheSession(ssl)) {
-+            sslContextPointer.clear(); // we could not cache the session
-+        } else {
-+            // Cache the session for permanent usage as well
-+            if (!(configuration.sslOptions & QSsl::SslOptionDisableSessionPersistence)) {
-+                if (!sslContextPointer->sessionASN1().isEmpty())
-+                    configuration.sslSession = sslContextPointer->sessionASN1();
-+                configuration.sslSessionTicketLifeTimeHint = sslContextPointer->sessionTicketLifeTimeHint();
-+            }
-+        }
-+    }
-+
-+#if OPENSSL_VERSION_NUMBER >= 0x1000100fL && !defined(OPENSSL_NO_NEXTPROTONEG)
-+
-+    configuration.nextProtocolNegotiationStatus = sslContextPointer->npnContext().status;
-+    if (sslContextPointer->npnContext().status == QSslConfiguration::NextProtocolNegotiationUnsupported) {
-+        // we could not agree -> be conservative and use HTTP/1.1
-+        configuration.nextNegotiatedProtocol = QByteArrayLiteral("http/1.1");
-+    } else {
-+        const unsigned char *proto = 0;
-+        unsigned int proto_len = 0;
-+#if OPENSSL_VERSION_NUMBER >= 0x10002000L
-+        if (q_SSLeay() >= 0x10002000L) {
-+            q_SSL_get0_alpn_selected(ssl, &proto, &proto_len);
-+            if (proto_len && mode == QSslSocket::SslClientMode) {
-+                // Client does not have a callback that sets it ...
-+                configuration.nextProtocolNegotiationStatus = QSslConfiguration::NextProtocolNegotiationNegotiated;
-+            }
-+        }
-+
-+        if (!proto_len) { // Test if NPN was more lucky ...
-+#else
-+        {
-+#endif
-+            q_SSL_get0_next_proto_negotiated(ssl, &proto, &proto_len);
-+        }
-+
-+        if (proto_len)
-+            configuration.nextNegotiatedProtocol = QByteArray(reinterpret_cast<const char *>(proto), proto_len);
-+        else
-+            configuration.nextNegotiatedProtocol.clear();
-+    }
-+#endif // OPENSSL_VERSION_NUMBER >= 0x1000100fL ...
-+
-+#if OPENSSL_VERSION_NUMBER >= 0x10002000L
-+    if (q_SSLeay() >= 0x10002000L && mode == QSslSocket::SslClientMode) {
-+        EVP_PKEY *key;
-+        if (q_SSL_get_server_tmp_key(ssl, &key))
-+            configuration.ephemeralServerKey = QSslKey(key, QSsl::PublicKey);
-+    }
-+#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L ...
-+
-+    connectionEncrypted = true;
-+    emit q->encrypted();
-+    if (autoStartHandshake && pendingClose) {
-+        pendingClose = false;
-+        q->disconnectFromHost();
-+    }
-+}
-+
-+QT_END_NAMESPACE
-diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri
-index d2b0c2d60d..2783effaf1 100644
---- a/src/network/ssl/ssl.pri
-+++ b/src/network/ssl/ssl.pri
-@@ -60,13 +60,25 @@ qtConfig(ssl) {
-         HEADERS += ssl/qsslcontext_openssl_p.h \
-                    ssl/qsslsocket_openssl_p.h \
-                    ssl/qsslsocket_openssl_symbols_p.h
--        SOURCES += ssl/qsslcertificate_openssl.cpp \
--                   ssl/qsslcontext_openssl.cpp \
-+        SOURCES += ssl/qsslsocket_openssl_symbols.cpp \
-                    ssl/qssldiffiehellmanparameters_openssl.cpp \
-+                   ssl/qsslcertificate_openssl.cpp \
-                    ssl/qsslellipticcurve_openssl.cpp \
-                    ssl/qsslkey_openssl.cpp \
-                    ssl/qsslsocket_openssl.cpp \
--                   ssl/qsslsocket_openssl_symbols.cpp
-+                   ssl/qsslcontext_openssl.cpp
-+
-+        qtConfig(opensslv11) {
-+            HEADERS += ssl/qsslsocket_openssl11_symbols_p.h
-+            SOURCES += ssl/qsslsocket_openssl11.cpp \
-+                       ssl/qsslcontext_openssl11.cpp
-+
-+            QMAKE_CXXFLAGS += -DOPENSSL_API_COMPAT=0x10100000L
-+        } else {
-+            HEADERS += ssl/qsslsocket_opensslpre11_symbols_p.h
-+            SOURCES += ssl/qsslsocket_opensslpre11.cpp \
-+                       ssl/qsslcontext_opensslpre11.cpp
-+        }
- 
-         darwin:SOURCES += ssl/qsslsocket_mac_shared.cpp
- 
diff --git a/pkgs/development/libraries/qt-5/5.9/qtbase.patch b/pkgs/development/libraries/qt-5/5.9/qtbase.patch
deleted file mode 100644
index f87c508a380..00000000000
--- a/pkgs/development/libraries/qt-5/5.9/qtbase.patch
+++ /dev/null
@@ -1,1119 +0,0 @@
-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 fb96d1b6a0..508ed17d30 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 0d3dfb6b93..5f935b4424 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
--    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 cba279c184..5ae3fd62e5 100644
---- a/src/corelib/kernel/qcoreapplication.cpp
-+++ b/src/corelib/kernel/qcoreapplication.cpp
-@@ -2533,6 +2533,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 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;
- // 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");
- 
-@@ -645,12 +649,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 9a24938284..74962b4ae2 100644
---- a/src/network/kernel/qhostinfo_unix.cpp
-+++ b/src/network/kernel/qhostinfo_unix.cpp
-@@ -102,7 +102,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 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)
- #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 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 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.9/qtdeclarative.patch b/pkgs/development/libraries/qt-5/5.9/qtdeclarative.patch
deleted file mode 100644
index bb1bbbeb05e..00000000000
--- a/pkgs/development/libraries/qt-5/5.9/qtdeclarative.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
-index ee5b38717..bbccef8c4 100644
---- a/src/qml/qml/qqmlimport.cpp
-+++ b/src/qml/qml/qqmlimport.cpp
-@@ -1678,6 +1678,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 QByteArray envImportPath = qgetenv("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.9/qtscript.patch b/pkgs/development/libraries/qt-5/5.9/qtscript.patch
deleted file mode 100644
index 5508dec1280..00000000000
--- a/pkgs/development/libraries/qt-5/5.9/qtscript.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-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
-+++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
-@@ -81,7 +81,7 @@
- #include <pthread.h>
- #elif PLATFORM(GTK)
- #include <wtf/gtk/GOwnPtr.h>
--typedef struct _GMutex GMutex;
-+typedef union _GMutex GMutex;
- typedef struct _GCond GCond;
- #endif
- 
diff --git a/pkgs/development/libraries/qt-5/5.9/qtserialport.patch b/pkgs/development/libraries/qt-5/5.9/qtserialport.patch
deleted file mode 100644
index f25524e80bc..00000000000
--- a/pkgs/development/libraries/qt-5/5.9/qtserialport.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-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()) {
-+#ifdef NIXPKGS_LIBUDEV
-+        udevLibrary->setFileNameAndVersion(QLatin1String(NIXPKGS_LIBUDEV), 1);
-+#else
-         udevLibrary->setFileNameAndVersion(QStringLiteral("udev"), 1);
-+#endif
-         if (!udevLibrary->load()) {
-+#ifdef NIXPKGS_LIBUDEV
-+            udevLibrary->setFileNameAndVersion(QLatin1String(NIXPKGS_LIBUDEV), 0);
-+#else
-             udevLibrary->setFileNameAndVersion(QStringLiteral("udev"), 0);
-+#endif
-             if (!udevLibrary->load()) {
-                 qWarning("Failed to load the library: %s, supported version(s): %i and %i", qPrintable(udevLibrary->fileName()), 1, 0);
-                 return false;
diff --git a/pkgs/development/libraries/qt-5/5.9/qttools.patch b/pkgs/development/libraries/qt-5/5.9/qttools.patch
deleted file mode 100644
index fbba439ef7a..00000000000
--- a/pkgs/development/libraries/qt-5/5.9/qttools.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-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.9/qtwebengine-clang-fix.patch b/pkgs/development/libraries/qt-5/5.9/qtwebengine-clang-fix.patch
deleted file mode 100644
index cf082cddd11..00000000000
--- a/pkgs/development/libraries/qt-5/5.9/qtwebengine-clang-fix.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-Fix a following build error:
-
-In file included from ../../3rdparty/chromium/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm:7:
-In file included from ../../3rdparty/chromium/base/bind.h:8:
-../../3rdparty/chromium/base/bind_internal.h:214:31: error: cannot initialize a parameter of type 'NSError *' with an lvalue of type 'const long'
-    return (receiver.*method)(std::forward<RunArgs>(args)...);
-                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
-../../3rdparty/chromium/base/bind_internal.h:285:20: note: in instantiation of function template specialization 'base::internal::FunctorTraits<void (device::BluetoothRemoteGat
-tCharacteristicMac::*)(NSError *), void>::Invoke<device::BluetoothRemoteGattCharacteristicMac *, const long &>' requested here
-    return Traits::Invoke(std::forward<Functor>(functor),
-                   ^
-../../3rdparty/chromium/base/bind_internal.h:361:43: note: in instantiation of function template specialization 'base::internal::InvokeHelper<false, void>::MakeItSo<void (devi
-ce::BluetoothRemoteGattCharacteristicMac::*const &)(NSError *), device::BluetoothRemoteGattCharacteristicMac *, const long &>' requested here
-    return InvokeHelper<is_weak_call, R>::MakeItSo(
-                                          ^
-../../3rdparty/chromium/base/bind_internal.h:339:12: note: in instantiation of function template specialization 'base::internal::Invoker<base::internal::BindState<void (device::BluetoothRemoteGattCharacteristicMac::*)(NSError *), base::internal::UnretainedWrapper<device::BluetoothRemoteGattCharacteristicMac>, long>, void ()>::RunImpl<void (device::BluetoothRemoteGattCharacteristicMac::*const &)(NSError *), const std::__1::tuple<base::internal::UnretainedWrapper<device::BluetoothRemoteGattCharacteristicMac>, long> &, 0, 1>' requested here
-    return RunImpl(storage->functor_,
-           ^
-../../3rdparty/chromium/base/bind.h:62:45: note: in instantiation of member function 'base::internal::Invoker<base::internal::BindState<void (device::BluetoothRemoteGattCharacteristicMac::*)(NSError *), base::internal::UnretainedWrapper<device::BluetoothRemoteGattCharacteristicMac>, long>, void ()>::Run' requested here
-  PolymorphicInvoke invoke_func = &Invoker::Run;
-                                            ^
-../../3rdparty/chromium/base/bind.h:77:10: note: in instantiation of function template specialization 'base::BindRepeating<void (device::BluetoothRemoteGattCharacteristicMac::*)(NSError *), base::internal::UnretainedWrapper<device::BluetoothRemoteGattCharacteristicMac>, long>' requested here
-  return BindRepeating(std::forward<Functor>(functor),
-         ^
-../../3rdparty/chromium/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm:241:15: note: in instantiation of function template specialization 'base::Bind<void (device::BluetoothRemoteGattCharacteristicMac::*)(NSError *), base::internal::UnretainedWrapper<device::BluetoothRemoteGattCharacteristicMac>, long>' requested here
-        base::Bind(&BluetoothRemoteGattCharacteristicMac::DidWriteValue,
-
---- a/src/3rdparty/chromium/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm
-+++ b/src/3rdparty/chromium/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm
-@@ -239,7 +239,7 @@ void BluetoothRemoteGattCharacteristicMac::WriteRemoteCharacteristic(
-     base::ThreadTaskRunnerHandle::Get()->PostTask(
-         FROM_HERE,
-         base::Bind(&BluetoothRemoteGattCharacteristicMac::DidWriteValue,
--                   base::Unretained(this), nil));
-+                   base::Unretained(this), nullptr));
-   }
- }
- 
diff --git a/pkgs/development/libraries/qt-5/5.9/qtwebengine-darwin-no-platform-check.patch b/pkgs/development/libraries/qt-5/5.9/qtwebengine-darwin-no-platform-check.patch
deleted file mode 100644
index 7156c41c5ec..00000000000
--- a/pkgs/development/libraries/qt-5/5.9/qtwebengine-darwin-no-platform-check.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
---- a/mkspecs/features/configure.prf
-+++ b/mkspecs/features/configure.prf
-@@ -194,9 +194,6 @@ defineTest(runConfigure) {
-         } else {
-             log("Native Spellchecker .............. Not enabled         (Default, enable with WEBENGINE_CONFIG+=use_native_spellchecker)$${EOL}")
-         }
--        !isMinOSXSDKVersion(10, 10, 3) {
--            log("  Force Touch API usage .............. Not enabled         (Because the OS X SDK version to be used \"$${WEBENGINE_OSX_SDK_PRODUCT_VERSION}\" is lower than the required \"10.10.3\")$${EOL}")
--        }
-     }
- }
- 
-diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf
---- a/mkspecs/features/functions.prf
-+++ b/mkspecs/features/functions.prf
-@@ -38,10 +38,6 @@ defineTest(isPlatformSupported) {
-       return(false)
-     }
-   } else:osx {
--    !isMinXcodeVersion(5, 1) {
--      skipBuild("Using XCode version $$QMAKE_XCODE_VERSION, but at least version 5.1 is required to build Qt WebEngine.")
--      return(false)
--    }
-     !clang|intel_icc {
-         skipBuild("Qt WebEngine on macOS requires Clang.")
-         return(false)
-@@ -52,10 +48,6 @@ defineTest(isPlatformSupported) {
-       skipBuild("Qt WebEngine requires OS X version 10.10 or newer.")
-       return(false)
-     }
--    !isMinOSXSDKVersion(10, 10): {
--      skipBuild("Qt WebEngine requires an OS X SDK version of 10.10 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
--      return(false)
--    }
-   } else {
-     skipBuild("Unknown platform. Qt WebEngine only supports Linux, Windows, and OS X.")
-     return(false)
-diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri
---- a/src/core/config/mac_osx.pri
-+++ b/src/core/config/mac_osx.pri
-@@ -5,8 +5,6 @@ load(functions)
- # otherwise query for it.
- QMAKE_MAC_SDK_VERSION = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.SDKVersion)
- isEmpty(QMAKE_MAC_SDK_VERSION) {
--     QMAKE_MAC_SDK_VERSION = $$system("/usr/bin/xcodebuild -sdk $${QMAKE_MAC_SDK} -version SDKVersion 2>/dev/null")
--     isEmpty(QMAKE_MAC_SDK_VERSION): error("Could not resolve SDK version for \'$${QMAKE_MAC_SDK}\'")
- }
- 
- QMAKE_CLANG_DIR = "/usr"
diff --git a/pkgs/development/libraries/qt-5/5.9/qtwebengine-no-build-skip.patch b/pkgs/development/libraries/qt-5/5.9/qtwebengine-no-build-skip.patch
deleted file mode 100644
index f332d5e1bb2..00000000000
--- a/pkgs/development/libraries/qt-5/5.9/qtwebengine-no-build-skip.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/qtwebengine.pro b/qtwebengine.pro
---- a/qtwebengine.pro
-+++ b/qtwebengine.pro
-@@ -5,7 +5,7 @@ runConfigure()
- 
- !isEmpty(skipBuildReason) {
-     SUBDIRS =
--    log($${skipBuildReason}$${EOL})
-+    error($${skipBuildReason}$${EOL})
-     log(QtWebEngine will not be built.$${EOL})
- }
- 
diff --git a/pkgs/development/libraries/qt-5/5.9/qtwebkit.patch b/pkgs/development/libraries/qt-5/5.9/qtwebkit.patch
deleted file mode 100644
index 718bda36194..00000000000
--- a/pkgs/development/libraries/qt-5/5.9/qtwebkit.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-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.9/srcs.nix b/pkgs/development/libraries/qt-5/5.9/srcs.nix
deleted file mode 100644
index 09b6293daeb..00000000000
--- a/pkgs/development/libraries/qt-5/5.9/srcs.nix
+++ /dev/null
@@ -1,333 +0,0 @@
-# DO NOT EDIT! This file is generated automatically by fetch-kde-qt.sh
-{ fetchurl, mirror }:
-
-{
-  qt3d = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qt3d-opensource-src-5.9.7.tar.xz";
-      sha256 = "0skdp72jlfy97cw9lpa3l2ivs6f5x9w53978sf2xbkl9k1ai268l";
-      name = "qt3d-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtactiveqt = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtactiveqt-opensource-src-5.9.7.tar.xz";
-      sha256 = "01yp0railyc80ldvpiy36lpsdk26rs8vfp78xca9jy1glm4cmaik";
-      name = "qtactiveqt-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtandroidextras = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtandroidextras-opensource-src-5.9.7.tar.xz";
-      sha256 = "1bl05hr0zm23z7qig3kxhzyvm440wfrjfgsxvpmlvk9pbb8h2q63";
-      name = "qtandroidextras-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtbase = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtbase-opensource-src-5.9.7.tar.xz";
-      sha256 = "004gs95ig51jv2wz64kwzl4rvqqzs4rln3kqmzjs3sh6y1s9bp9n";
-      name = "qtbase-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtcanvas3d = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtcanvas3d-opensource-src-5.9.7.tar.xz";
-      sha256 = "131zwqddjns7cpkdbr33jahqgvnw6f8gdcr1b2hmadi0p2shrcwq";
-      name = "qtcanvas3d-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtcharts = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtcharts-opensource-src-5.9.7.tar.xz";
-      sha256 = "1rkj4lkpgdqk4ygxivkj7gc8mlccb5sgi9mfr0xwvq5j85r3dk8n";
-      name = "qtcharts-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtconnectivity = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtconnectivity-opensource-src-5.9.7.tar.xz";
-      sha256 = "0f7g2lfnfgsjka7y5hdf0lbzpfxlxh8bfhdxix44cwlmwzjizy3l";
-      name = "qtconnectivity-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtdatavis3d = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtdatavis3d-opensource-src-5.9.7.tar.xz";
-      sha256 = "08anm8byxcym7h1n49j3cbxkh3kh3xjlxd3b8vi8fxyqqhvll4lv";
-      name = "qtdatavis3d-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtdeclarative = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtdeclarative-opensource-src-5.9.7.tar.xz";
-      sha256 = "0p26c96fb33khbf7ws91ha73n72lwmn714v8spg0bla9m1jkfhk8";
-      name = "qtdeclarative-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtdoc = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtdoc-opensource-src-5.9.7.tar.xz";
-      sha256 = "1vs6dy0mdcn65fhpl8nib0pjw9bliqkjnaahqm833ayvxr15vzyj";
-      name = "qtdoc-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtgamepad = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtgamepad-opensource-src-5.9.7.tar.xz";
-      sha256 = "0242683h9jz6b0n11s4m4ii2691dbws0gkj45n6sx6z513blfx9f";
-      name = "qtgamepad-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtgraphicaleffects = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtgraphicaleffects-opensource-src-5.9.7.tar.xz";
-      sha256 = "1yhxa3i3jvfnc9l6a3q3pyk7y702a3pp87ypshb63607xvrxrv2d";
-      name = "qtgraphicaleffects-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtimageformats = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtimageformats-opensource-src-5.9.7.tar.xz";
-      sha256 = "1an0k3rzxjc4x4rscnibdk36zff6g1n41lh5dasys4jc05k3w1b2";
-      name = "qtimageformats-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtlocation = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtlocation-opensource-src-5.9.7.tar.xz";
-      sha256 = "0lp6zn630px1lj7623shq47dlv02nr0aj7iqscrk0yzhygbv7dc2";
-      name = "qtlocation-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtmacextras = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtmacextras-opensource-src-5.9.7.tar.xz";
-      sha256 = "0b0znccbach41la226cmps9aaigpz8mj940xj890arjf8hn4jd97";
-      name = "qtmacextras-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtmultimedia = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtmultimedia-opensource-src-5.9.7.tar.xz";
-      sha256 = "060gic3gl27r7k4vw4n550384b4wadqfn3biajbq6lbyj3zhgxxx";
-      name = "qtmultimedia-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtnetworkauth = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtnetworkauth-opensource-src-5.9.7.tar.xz";
-      sha256 = "14n8wzsyq7bw67r1k442widfvszawgi5sh0b10h2jcrp5aikqr0p";
-      name = "qtnetworkauth-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtpurchasing = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtpurchasing-opensource-src-5.9.7.tar.xz";
-      sha256 = "1qvxsi0ar04qy0zajbhvwj5blldhfq2mn3laq15g0xxy1xh4m46i";
-      name = "qtpurchasing-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtquickcontrols = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtquickcontrols-opensource-src-5.9.7.tar.xz";
-      sha256 = "1jkz2b2wzxzmskvwwb4afqxz0yp0siaf3yhj2i01y865sp6q1wz0";
-      name = "qtquickcontrols-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtquickcontrols2 = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtquickcontrols2-opensource-src-5.9.7.tar.xz";
-      sha256 = "0w9rq77a8vc9avhbwbx7swg7zw7jn21wd7si59822rw9ln1p6zb0";
-      name = "qtquickcontrols2-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtremoteobjects = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtremoteobjects-opensource-src-5.9.7.tar.xz";
-      sha256 = "1ninscf4jkframv585zzi76fml1lyz0mhb091r2r54lrf66wl3lw";
-      name = "qtremoteobjects-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtscript = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtscript-opensource-src-5.9.7.tar.xz";
-      sha256 = "0mv33a1mjaahq7ixfasvjasc881bprfbkjhx8pn3z5f0l8213m67";
-      name = "qtscript-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtscxml = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtscxml-opensource-src-5.9.7.tar.xz";
-      sha256 = "0xz2q2bl1n43gxx00nrzyc0bsnq4wch0k2rkj3prc9gsgmpq0bih";
-      name = "qtscxml-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtsensors = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtsensors-opensource-src-5.9.7.tar.xz";
-      sha256 = "0pfh4lr9zxsh9winzx1lmcgl2hgp9lr45smcvslr4an93z6mbf8r";
-      name = "qtsensors-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtserialbus = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtserialbus-opensource-src-5.9.7.tar.xz";
-      sha256 = "0n6z56axm0gbrxmnwbz8fv40ar9mw1rlfvmpqvpg5xb9031qil1b";
-      name = "qtserialbus-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtserialport = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtserialport-opensource-src-5.9.7.tar.xz";
-      sha256 = "05qy4m1p5j5bh6af7d97iblsmgy9kppm5wif3bl63p6yghn319sh";
-      name = "qtserialport-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtspeech = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtspeech-opensource-src-5.9.7.tar.xz";
-      sha256 = "0nnbqnh18vw26vphancs38vjr816xha8m6wl389kjqi01kjrcz70";
-      name = "qtspeech-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtsvg = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtsvg-opensource-src-5.9.7.tar.xz";
-      sha256 = "0r2mqy6lb2ypmilf83zyp73v5d9ars314jfm6f0fv5if8yw253v2";
-      name = "qtsvg-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qttools = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qttools-opensource-src-5.9.7.tar.xz";
-      sha256 = "18b7jg25434p80yr929nfihk0i124bxpd2dv9mqdcicnv5q0ybnn";
-      name = "qttools-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qttranslations = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qttranslations-opensource-src-5.9.7.tar.xz";
-      sha256 = "051a3igp1qnd7d7bg2dvjaqwh6f67fvkn19jdfjzrdis7kcsfvdk";
-      name = "qttranslations-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtvirtualkeyboard = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtvirtualkeyboard-opensource-src-5.9.7.tar.xz";
-      sha256 = "1qcj6ncg53rv4pg4ijdq7vbkzgzfr9bn40aif7g4dndykj0zwla7";
-      name = "qtvirtualkeyboard-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtwayland = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtwayland-opensource-src-5.9.7.tar.xz";
-      sha256 = "0y6ky1ipg42gq390ibgr4nns9i4j648yb7bkmx6b7lhsi7mvnp2n";
-      name = "qtwayland-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtwebchannel = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtwebchannel-opensource-src-5.9.7.tar.xz";
-      sha256 = "189qkfxixddfblwkaf46yrqjp91vhmw90gpafjryqfmd2141r8qj";
-      name = "qtwebchannel-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtwebengine = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtwebengine-opensource-src-5.9.7.tar.xz";
-      sha256 = "0kzpgks5h19rm7gbhr688lr5f5d9ykf062kj91q7wf6fk7qd72v2";
-      name = "qtwebengine-opensource-src-5.9.7.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";
-    };
-  };
-  qtwebsockets = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtwebsockets-opensource-src-5.9.7.tar.xz";
-      sha256 = "1qqvd6qf7m2xq71mdaidwabj5c03cbbi1hwc7p95fvbnz9crz79x";
-      name = "qtwebsockets-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtwebview = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtwebview-opensource-src-5.9.7.tar.xz";
-      sha256 = "1zwqkmzik4f83hdffmw0hz90mzga34hkyz7d0skfbdp25y278r12";
-      name = "qtwebview-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtwinextras = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtwinextras-opensource-src-5.9.7.tar.xz";
-      sha256 = "1a57v7krglfdi4gizm402jn9pg7fqpcma7xk6sm68zg1siv11a6x";
-      name = "qtwinextras-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtx11extras = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtx11extras-opensource-src-5.9.7.tar.xz";
-      sha256 = "02jdiw94dasnkszi5w1pysfgz8xrr71pzah37nbnqg0knn4dzich";
-      name = "qtx11extras-opensource-src-5.9.7.tar.xz";
-    };
-  };
-  qtxmlpatterns = {
-    version = "5.9.7";
-    src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.9/5.9.7/submodules/qtxmlpatterns-opensource-src-5.9.7.tar.xz";
-      sha256 = "0j0rxkpyww5cgcjhy0332jsyka1d811wf6zmr16d5fdkbryp7d65";
-      name = "qtxmlpatterns-opensource-src-5.9.7.tar.xz";
-    };
-  };
-}
diff --git a/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh b/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
index c3373983e32..7f6ddb76ad5 100644
--- a/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
+++ b/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
@@ -1,6 +1,6 @@
 . @fix_qmake_libtool@
 
-qmakeFlags=( $qmakeFlags )
+qmakeFlags=( ${qmakeFlags-} )
 
 qmakePrePhase() {
     qmakeFlags=( \
@@ -31,6 +31,6 @@ qmakeConfigurePhase() {
     runHook postConfigure
 }
 
-if [ -z "$dontUseQmakeConfigure" -a -z "$configurePhase" ]; then
+if [ -z "${dontUseQmakeConfigure-}" -a -z "${configurePhase-}" ]; then
     configurePhase=qmakeConfigurePhase
 fi
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 436c2e1d032..9f2a9f06f1a 100644
--- a/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
+++ b/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
@@ -61,6 +61,6 @@ postPatchMkspecs() {
         fixQtBuiltinPaths "$dev/mkspecs" '*.pr?'
     fi
 }
-if [ -z "$dontPatchMkspecs" ]; then
-    postPhases="${postPhases}${postPhases:+ }postPatchMkspecs"
+if [ -z "${dontPatchMkspecs-}" ]; then
+    postPhases="${postPhases-}${postPhases:+ }postPatchMkspecs"
 fi
diff --git a/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh b/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh
index d2aadbd956a..7356c8ee356 100644
--- a/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh
+++ b/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh
@@ -1,5 +1,5 @@
 # Inherit arguments given in mkDerivation
-qtWrapperArgs=( $qtWrapperArgs )
+qtWrapperArgs=( ${qtWrapperArgs-} )
 
 qtHostPathSeen=()
 
@@ -64,16 +64,16 @@ qtOwnPathsHook() {
 
 preFixupPhases+=" qtOwnPathsHook"
 
-# Note: $qtWrapperArgs still gets defined even if $dontWrapQtApps is set.
+# Note: $qtWrapperArgs still gets defined even if ${dontWrapQtApps-} is set.
 wrapQtAppsHook() {
     # skip this hook when requested
-    [ -z "$dontWrapQtApps" ] || return 0
+    [ -z "${dontWrapQtApps-}" ] || return 0
 
     # guard against running multiple times (e.g. due to propagation)
     [ -z "$wrapQtAppsHookHasRun" ] || return 0
     wrapQtAppsHookHasRun=1
 
-    local targetDirs=( "$prefix/bin" "$prefix/libexec"  )
+    local targetDirs=( "$prefix/bin" "$prefix/sbin" "$prefix/libexec"  )
     echo "wrapping Qt applications in ${targetDirs[@]}"
 
     for targetDir in "${targetDirs[@]}"
diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix
index d1ec209c95d..3dbdb2a9770 100644
--- a/pkgs/development/libraries/qt-5/modules/qtbase.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix
@@ -58,7 +58,7 @@ stdenv.mkDerivation {
           # TODO: move to buildInputs, this should not be propagated.
           AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth
           CoreLocation CoreServices DiskArbitration Foundation OpenGL
-          darwin.libobjc libiconv MetalKit
+          darwin.libobjc libiconv MetalKit IOKit
         ]
       else
         [
diff --git a/pkgs/development/libraries/qtkeychain/0002-Fix-install-name-Darwin.patch b/pkgs/development/libraries/qtkeychain/0002-Fix-install-name-Darwin.patch
new file mode 100644
index 00000000000..30d93cd7bf8
--- /dev/null
+++ b/pkgs/development/libraries/qtkeychain/0002-Fix-install-name-Darwin.patch
@@ -0,0 +1,10 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -215,7 +215,6 @@
+     VERSION ${QTKEYCHAIN_VERSION}
+     SOVERSION ${QTKEYCHAIN_SOVERSION}
+     MACOSX_RPATH 1
+-    INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}"
+     INSTALL_RPATH_USE_LINK_PATH TRUE
+ )
+ 
diff --git a/pkgs/development/libraries/qtkeychain/default.nix b/pkgs/development/libraries/qtkeychain/default.nix
index 3de84d85911..4951670f896 100644
--- a/pkgs/development/libraries/qtkeychain/default.nix
+++ b/pkgs/development/libraries/qtkeychain/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     sha256 = "0h4wgngn2yl35hapbjs24amkjfbzsvnna4ixfhn87snjnq5lmjbc"; # v0.9.1
   };
 
-  patches = if withQt5 then null else [ ./0001-Fixes-build-with-Qt4.patch ];
+  patches = (if withQt5 then [] else [ ./0001-Fixes-build-with-Qt4.patch ]) ++ (if stdenv.isDarwin then [ ./0002-Fix-install-name-Darwin.patch ] else []);
 
   cmakeFlags = [ "-DQT_TRANSLATIONS_DIR=share/qt/translations" ];
 
diff --git a/pkgs/development/libraries/qtpbfimageplugin/default.nix b/pkgs/development/libraries/qtpbfimageplugin/default.nix
index 8ad908013bd..5f3f8c4a66a 100644
--- a/pkgs/development/libraries/qtpbfimageplugin/default.nix
+++ b/pkgs/development/libraries/qtpbfimageplugin/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "qtpbfimageplugin";
-  version = "1.4";
+  version = "2.0";
 
   src = fetchFromGitHub {
     owner = "tumic0";
     repo = "QtPBFImagePlugin";
     rev = version;
-    sha256 = "0d39i7rmhrmm2df49gd47zm37gnz3fmyr6hfc6hhzvk08jb6956r";
+    sha256 = "16qsax1p09gldbg83df77ixaz7bkxl8wm806lc55y19pwnid9m7p";
   };
 
   nativeBuildInputs = [ qmake ];
@@ -31,9 +31,9 @@ stdenv.mkDerivation rec {
       displaying raster MBTiles maps or raster XYZ online maps to also display PBF
       vector tiles without (almost) any application modifications.
     '';
-    homepage = https://github.com/tumic0/QtPBFImagePlugin;
+    homepage = "https://github.com/tumic0/QtPBFImagePlugin";
     license = licenses.lgpl3;
-    maintainers = [ maintainers.sikmir ];
+    maintainers = with maintainers; [ sikmir ];
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/quesoglc/default.nix b/pkgs/development/libraries/quesoglc/default.nix
index 2e47a213565..fe24d0fcddf 100644
--- a/pkgs/development/libraries/quesoglc/default.nix
+++ b/pkgs/development/libraries/quesoglc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libGLU_combined, glew, freetype, fontconfig, fribidi, libX11 }:
+{ stdenv, fetchurl, libGLU, libGL, glew, freetype, fontconfig, fribidi, libX11 }:
 stdenv.mkDerivation rec {
   pname = "quesoglc";
   version = "0.7.2";
@@ -6,7 +6,7 @@ stdenv.mkDerivation rec {
     url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.bz2";
     sha256 = "0cf9ljdzii5d4i2m23gdmf3kn521ljcldzq69lsdywjid3pg5zjl";
   };
-  buildInputs = [ libGLU_combined glew freetype fontconfig fribidi libX11 ];
+  buildInputs = [ libGLU libGL glew freetype fontconfig fribidi libX11 ];
   # FIXME: Configure fails to use system glew.
   meta = with stdenv.lib; {
     description = "A free implementation of the OpenGL Character Renderer";
diff --git a/pkgs/development/libraries/rabbitmq-c/default.nix b/pkgs/development/libraries/rabbitmq-c/default.nix
index fe48d99b383..487de0976bd 100644
--- a/pkgs/development/libraries/rabbitmq-c/default.nix
+++ b/pkgs/development/libraries/rabbitmq-c/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "rabbitmq-c";
-  version = "0.9.0";
+  version = "0.10.0";
 
   src = fetchFromGitHub {
     owner = "alanxz";
     repo = "rabbitmq-c";
     rev = "v${version}";
-    sha256 = "1mhzxyh9pmpxjjbyy8hd34gm39sxf73r1ldk8zjfsfbs26ggrppz";
+    sha256 = "1iv7aww4pam8497s524xjxbbxypyqd01qgrb0b429y3q9x06m4sw";
   };
 
   buildInputs = [ cmake openssl popt xmlto ];
diff --git a/pkgs/development/libraries/randomx/default.nix b/pkgs/development/libraries/randomx/default.nix
new file mode 100644
index 00000000000..9e6cdfecb95
--- /dev/null
+++ b/pkgs/development/libraries/randomx/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "randomX";
+  version = "1.1.7";
+
+  nativeBuildInputs = [ cmake ];
+
+  src = fetchFromGitHub {
+    owner = "tevador";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1d42dw4zrd7mzfqs6gwk27jj6lsh6pwv85p1ckx9dxy8mw3m52ah";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Proof of work algorithm based on random code execution";
+    homepage = https://github.com/tevador/RandomX;
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ rnhmjoj ];
+    platforms = platforms.unix;
+  };
+
+}
diff --git a/pkgs/development/libraries/range-v3/default.nix b/pkgs/development/libraries/range-v3/default.nix
index f02093001e4..56c5754831e 100644
--- a/pkgs/development/libraries/range-v3/default.nix
+++ b/pkgs/development/libraries/range-v3/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "range-v3";
-  version = "0.9.1";
+  version = "0.10.0";
 
   src = fetchFromGitHub {
     owner = "ericniebler";
     repo = "range-v3";
     rev = version;
-    sha256 = "0qga2fnfrlrzrvnnk1z1plpmvcr8b4c75g5xz0jv0sav0kmq5zwn";
+    sha256 = "1h9h5j7pdi0afpip9ncq76h1xjhvb8bnm585q17afz2l4fydy8qj";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/rdkafka/default.nix b/pkgs/development/libraries/rdkafka/default.nix
index 670d2a832ee..cb1b176ce35 100644
--- a/pkgs/development/libraries/rdkafka/default.nix
+++ b/pkgs/development/libraries/rdkafka/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "rdkafka";
-  version = "1.2.0";
+  version = "1.3.0";
 
   src = fetchFromGitHub {
     owner = "edenhill";
     repo = "librdkafka";
     rev = "v${version}";
-    sha256 = "03h4yxnbnig17zapnnyvvnh1bsp0qalvlpb4fc3bpvs7yj4d8v25";
+    sha256 = "1arwpvva2b1m3yd618s59v38gwsi0nnm07g6yc9dapcgxrkg5n0h";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/rnnoise/default.nix b/pkgs/development/libraries/rnnoise/default.nix
new file mode 100644
index 00000000000..fe6b75446b2
--- /dev/null
+++ b/pkgs/development/libraries/rnnoise/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, lib, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation (rec {
+  name = "rnnoise-${version}";
+  version = "0.0.1";
+
+  src = fetchFromGitHub {
+    owner = "xiph";
+    repo = "rnnoise";
+    rev = "91ef401f4c3536c6de999ac609262691ec888c4c";
+    sha256 = "1h2ibg67gfcwnpvkq1rx0sngf9lk9j8pqsmsmmk5hclvrr2lp3yb";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = with lib; {
+    homepage = https://people.xiph.org/~jm/demo/rnnoise/;
+    description = "Recurrent neural network for audio noise reduction.";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.nh2 ];
+    platforms = platforms.all;
+  };
+})
diff --git a/pkgs/development/libraries/rocksdb/default.nix b/pkgs/development/libraries/rocksdb/default.nix
index 60b02a13cb7..3f3b50ea8fe 100644
--- a/pkgs/development/libraries/rocksdb/default.nix
+++ b/pkgs/development/libraries/rocksdb/default.nix
@@ -1,19 +1,31 @@
-{ stdenv, fetchFromGitHub, lib, bzip2, cmake, lz4, snappy, zlib, zstd, enableLite ? false }:
+{ stdenv, fetchFromGitHub, fetchpatch
+, cmake, ninja
+, bzip2, lz4, snappy, zlib, zstd
+, enableLite ? false
+}:
 
 stdenv.mkDerivation rec {
   pname = "rocksdb";
-  version = "6.3.6";
+  version = "6.4.6";
 
   src = fetchFromGitHub {
     owner = "facebook";
     repo = pname;
     rev = "v${version}";
-    sha256 = "0i993z7xxsbs595y7wxfhgm69mg5893lfkpidcbaqnzj8j0kn0ab";
+    sha256 = "0s0n4p1b4jzmslz9d2xd4ajra0m6l9x26mjwlbgw0klxjggmy8qn";
   };
 
-  nativeBuildInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ninja ];
   buildInputs = [ bzip2 lz4 snappy zlib zstd ];
 
+  patches = [
+    # https://github.com/facebook/rocksdb/pull/6076
+    (fetchpatch {
+      url = "https://github.com/facebook/rocksdb/commit/c0be4b2ff1a5393419673fab961cb9b09ba38752.diff";
+      sha256 = "1f2wg9kqlmf2hiiihmbp8m5fr2wnn7896g6i9yg9hdgi40pw30w6";
+    })
+  ];
+
   postPatch = ''
     substituteInPlace CMakeLists.txt --replace "find_package(zlib " "find_package(ZLIB "
   '';
@@ -32,13 +44,18 @@ stdenv.mkDerivation rec {
     "-DWITH_ZLIB=1"
     "-DWITH_ZSTD=1"
     "-DWITH_GFLAGS=0"
-    (lib.optional
-        (stdenv.hostPlatform.system == "i686-linux"
-         || stdenv.hostPlatform.system == "x86_64-linux")
+    "-DUSE_RTTI=1"
+    "-DROCKSDB_INSTALL_ON_WINDOWS=YES" # harmless elsewhere
+    (stdenv.lib.optional
+        (stdenv.hostPlatform.isx86 && stdenv.hostPlatform.isLinux)
         "-DFORCE_SSE42=1")
-    (lib.optional enableLite "-DROCKSDB_LITE=1")
+    (stdenv.lib.optional enableLite "-DROCKSDB_LITE=1")
+    "-DFAIL_ON_WARNINGS=${if stdenv.hostPlatform.isMinGW then "NO" else "YES"}"
   ];
 
+  # otherwise "cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]"
+  hardeningDisable = stdenv.lib.optional stdenv.hostPlatform.isWindows "format";
+
   meta = with stdenv.lib; {
     homepage = https://rocksdb.org;
     description = "A library that provides an embeddable, persistent key-value store for fast storage";
diff --git a/pkgs/development/libraries/schroedinger/default.nix b/pkgs/development/libraries/schroedinger/default.nix
index 25126edbc0f..f78ed0f7925 100644
--- a/pkgs/development/libraries/schroedinger/default.nix
+++ b/pkgs/development/libraries/schroedinger/default.nix
@@ -4,10 +4,7 @@ stdenv.mkDerivation {
   name = "schroedinger-1.0.11";
 
   src = fetchurl {
-    urls = [
-      http://diracvideo.org/download/schroedinger/schroedinger-1.0.11.tar.gz
-      https://download.videolan.org/contrib/schroedinger-1.0.11.tar.gz
-    ];
+    url = https://download.videolan.org/contrib/schroedinger-1.0.11.tar.gz;
     sha256 = "04prr667l4sn4zx256v1z36a0nnkxfdqyln48rbwlamr6l3jlmqy";
   };
 
@@ -27,7 +24,8 @@ stdenv.mkDerivation {
   ];
 
   meta = with stdenv.lib; {
-    homepage = http://diracvideo.org/;
+    description = "An implementation of the Dirac video codec in ANSI C";
+    homepage = "https://sourceforge.net/projects/schrodinger/";
     maintainers = [ maintainers.spwhitt ];
     license = [ licenses.mpl11 licenses.lgpl2 licenses.mit ];
     platforms = platforms.unix;
diff --git a/pkgs/development/libraries/science/biology/elastix/default.nix b/pkgs/development/libraries/science/biology/elastix/default.nix
index 9105b1c52ac..4cfc07c1cba 100644
--- a/pkgs/development/libraries/science/biology/elastix/default.nix
+++ b/pkgs/development/libraries/science/biology/elastix/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl, cmake, itk, python }:
+{ stdenv, fetchFromGitHub, cmake, itk, python }:
 
 stdenv.mkDerivation rec {
   pname    = "elastix";
-  pversion = "4.9.0";
-  name  = "${pname}-${pversion}";
+  version = "5.0.0";
 
-  src = fetchurl {
-    url    = "https://github.com/SuperElastix/${pname}/archive/${pversion}.tar.gz";
-    sha256 = "02pbln36nq98xxfyqwlxg7b6gmigdq4fgfqr9mym1qn58aj04shg";
+  src = fetchFromGitHub {
+    owner  = "SuperElastix";
+    repo   = pname;
+    rev    = version;
+    sha256 = "1zrl7rz4lwsx88b2shnl985f3a97lmp4ksbd437h9y0hfjq8l0lj";
   };
-
   nativeBuildInputs = [ cmake python ];
   buildInputs = [ itk ];
 
@@ -19,6 +19,5 @@ stdenv.mkDerivation rec {
     maintainers = with maintainers; [ bcdarwin ];
     platforms = platforms.linux;
     license = licenses.asl20;
-    broken = true;
   };
 }
diff --git a/pkgs/development/libraries/science/biology/nifticlib/default.nix b/pkgs/development/libraries/science/biology/nifticlib/default.nix
index 51eed36312d..8c7da7968f5 100644
--- a/pkgs/development/libraries/science/biology/nifticlib/default.nix
+++ b/pkgs/development/libraries/science/biology/nifticlib/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     homepage = https://sourceforge.net/projects/niftilib;
     description = "Medical imaging format C API";
     maintainers = with maintainers; [ bcdarwin ];
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     license = licenses.publicDomain;
   };
 }
diff --git a/pkgs/development/libraries/science/math/QuadProgpp/default.nix b/pkgs/development/libraries/science/math/QuadProgpp/default.nix
index d4333146406..69ccbfc26b4 100644
--- a/pkgs/development/libraries/science/math/QuadProgpp/default.nix
+++ b/pkgs/development/libraries/science/math/QuadProgpp/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
       A C++ library for Quadratic Programming which implements the
       Goldfarb-Idnani active-set dual method.
     '';
-    maintainers = with maintainers; [ fuuzetsu ];
+    maintainers = with maintainers; [ ];
     platforms = with platforms; linux;
   };
 }
diff --git a/pkgs/development/libraries/science/math/brial/default.nix b/pkgs/development/libraries/science/math/brial/default.nix
index f08f6425655..56a78b00cd6 100644
--- a/pkgs/development/libraries/science/math/brial/default.nix
+++ b/pkgs/development/libraries/science/math/brial/default.nix
@@ -8,14 +8,14 @@
 }:
 
 stdenv.mkDerivation rec {
-  version = "1.2.5";
+  version = "1.2.6";
   pname = "brial";
 
   src = fetchFromGitHub {
     owner = "BRiAl";
     repo = "BRiAl";
     rev = version;
-    sha256 = "1nv56fp3brpzanxj7vwvxqdafqfsfhdgq5imr3m94psw5gdfqwja";
+    sha256 = "1mc1zjr3mxcx6bg0js5k9jx65japg7644b0aj1al75m4nwh2ygab";
   };
 
   # FIXME package boost-test and enable checks
diff --git a/pkgs/development/libraries/science/math/caffe2/default.nix b/pkgs/development/libraries/science/math/caffe2/default.nix
index 26ec1237601..a5c373ecde9 100644
--- a/pkgs/development/libraries/science/math/caffe2/default.nix
+++ b/pkgs/development/libraries/science/math/caffe2/default.nix
@@ -57,7 +57,7 @@ let
     dst = "pybind11";
   };
 
-  ccVersion = (builtins.parseDrvName stdenv.cc.name).version;
+  ccVersion = lib.getVersion stdenv.cc;
 in
 
 stdenv.mkDerivation rec {
diff --git a/pkgs/development/libraries/science/math/cudnn/default.nix b/pkgs/development/libraries/science/math/cudnn/default.nix
index a33e3ec2009..8cd74939959 100644
--- a/pkgs/development/libraries/science/math/cudnn/default.nix
+++ b/pkgs/development/libraries/science/math/cudnn/default.nix
@@ -1,4 +1,4 @@
-{ callPackage, cudatoolkit_7, cudatoolkit_7_5, cudatoolkit_8, cudatoolkit_9_0, cudatoolkit_9_1, cudatoolkit_9_2, cudatoolkit_10_0 }:
+{ callPackage, cudatoolkit_7, cudatoolkit_7_5, cudatoolkit_8, cudatoolkit_9_0, cudatoolkit_9_1, cudatoolkit_9_2, cudatoolkit_10_0, cudatoolkit_10_1 }:
 
 let
   generic = args: callPackage (import ./generic.nix (removeAttrs args ["cudatoolkit"])) {
@@ -65,5 +65,12 @@ in rec {
     sha256 = "18ys0apiz9afid2s6lvy9qbyi8g66aimb2a7ikl1f3dm09mciprf";
   };
 
-  cudnn_cudatoolkit_10 = cudnn_cudatoolkit_10_0;
+  cudnn_cudatoolkit_10_1 = generic rec {
+    version = "7.6.3";
+    cudatoolkit = cudatoolkit_10_1;
+    srcName = "cudnn-${cudatoolkit.majorVersion}-linux-x64-v7.6.3.30.tgz";
+    sha256 = "0qc9f1xpyfibwqrpqxxq2v9h6w90j0dbx564akwy44c1dls5f99m";
+  };
+
+  cudnn_cudatoolkit_10 = cudnn_cudatoolkit_10_1;
 }
diff --git a/pkgs/development/libraries/science/math/liblapack/default.nix b/pkgs/development/libraries/science/math/liblapack/default.nix
index 076376dc3c1..a7d01e22d96 100644
--- a/pkgs/development/libraries/science/math/liblapack/default.nix
+++ b/pkgs/development/libraries/science/math/liblapack/default.nix
@@ -1,6 +1,6 @@
 {
   stdenv,
-  fetchurl,
+  fetchFromGitHub,
   gfortran,
   cmake,
   python2,
@@ -8,19 +8,22 @@
 }:
 let
   inherit (stdenv.lib) optional;
-  version = "3.8.0";
+  version = "3.9.0";
 in
 
 stdenv.mkDerivation {
   pname = "liblapack";
   inherit version;
-  src = fetchurl {
-    url = "http://www.netlib.org/lapack/lapack-${version}.tar.gz";
-    sha256 = "1xmwi2mqmipvg950gb0rhgprcps8gy8sjm8ic9rgy2qjlv22rcny";
+
+  src = fetchFromGitHub {
+    owner = "Reference-LAPACK";
+    repo = "lapack";
+    rev = "v${version}";
+    sha256 = "0sxnc97z67i7phdmcnq8f8lmxgw10wdwvr8ami0w3pb179cgrbpb";
   };
 
-  buildInputs = [ gfortran cmake ];
-  nativeBuildInputs = [ python2 ];
+  buildInputs = [ gfortran ];
+  nativeBuildInputs = [ python2 cmake ];
 
   cmakeFlags = [
     "-DCMAKE_Fortran_FLAGS=-fPIC"
diff --git a/pkgs/development/libraries/science/math/mkl/default.nix b/pkgs/development/libraries/science/math/mkl/default.nix
index c1a5ea2969e..382d2c303e3 100644
--- a/pkgs/development/libraries/science/math/mkl/default.nix
+++ b/pkgs/development/libraries/science/math/mkl/default.nix
@@ -46,6 +46,7 @@ in stdenvNoCC.mkDerivation {
       tar xzvf $f
     done
   '' else ''
+    rpmextract rpm/intel-mkl-cluster-rt-${rpm-ver}.x86_64.rpm
     rpmextract rpm/intel-mkl-common-c-${rpm-ver}.noarch.rpm
     rpmextract rpm/intel-mkl-core-${rpm-ver}.x86_64.rpm
     rpmextract rpm/intel-mkl-core-rt-${rpm-ver}.x86_64.rpm
diff --git a/pkgs/development/libraries/science/math/or-tools/default.nix b/pkgs/development/libraries/science/math/or-tools/default.nix
index 224f4239a22..15aea5803bf 100644
--- a/pkgs/development/libraries/science/math/or-tools/default.nix
+++ b/pkgs/development/libraries/science/math/or-tools/default.nix
@@ -69,7 +69,7 @@ stdenv.mkDerivation rec {
     description = ''
       Google's software suite for combinatorial optimization.
     '';
-    maintainers = with maintainers; [ fuuzetsu ];
+    maintainers = with maintainers; [ ];
     platforms = with platforms; linux;
   };
 }
diff --git a/pkgs/development/libraries/science/math/scalapack/default.nix b/pkgs/development/libraries/science/math/scalapack/default.nix
index 14277c8c631..bff0d9a85fa 100644
--- a/pkgs/development/libraries/science/math/scalapack/default.nix
+++ b/pkgs/development/libraries/science/math/scalapack/default.nix
@@ -1,20 +1,19 @@
-{ stdenv, fetchurl, cmake, openssh
+{ stdenv, fetchFromGitHub, cmake, openssh
 , gfortran, mpi, openblasCompat
 } :
 
 
 stdenv.mkDerivation rec {
   pname = "scalapack";
-  version = "2.0.2";
+  version = "2.1";
 
-  src = fetchurl {
-    url = "http://www.netlib.org/scalapack/scalapack-${version}.tgz";
-    sha256 = "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c";
+  src = fetchFromGitHub {
+    owner = "Reference-ScaLAPACK";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "042q9kc383h7y0had9a37702z4s0szavss063ljvfdsbjy07gzb1";
   };
 
-  # patch to rename outdated MPI functions
-  patches = [ ./openmpi4.patch ];
-
   nativeBuildInputs = [ cmake openssh ];
   buildInputs = [ mpi gfortran openblasCompat ];
 
diff --git a/pkgs/development/libraries/science/math/scalapack/openmpi4.patch b/pkgs/development/libraries/science/math/scalapack/openmpi4.patch
deleted file mode 100644
index 5d0afb58c02..00000000000
--- a/pkgs/development/libraries/science/math/scalapack/openmpi4.patch
+++ /dev/null
@@ -1,143 +0,0 @@
-diff --git a/BLACS/SRC/blacs_get_.c b/BLACS/SRC/blacs_get_.c
-index e979767..d4b04cf 100644
---- a/BLACS/SRC/blacs_get_.c
-+++ b/BLACS/SRC/blacs_get_.c
-@@ -23,7 +23,7 @@ F_VOID_FUNC blacs_get_(int *ConTxt, int *what, int *val)
-    case SGET_MSGIDS:
-       if (BI_COMM_WORLD == NULL) Cblacs_pinfo(val, &val[1]);
-       iptr = &val[1];
--      ierr=MPI_Attr_get(MPI_COMM_WORLD, MPI_TAG_UB, (BVOID **) &iptr,val);
-+      ierr=MPI_Comm_get_attr(MPI_COMM_WORLD, MPI_TAG_UB, (BVOID **) &iptr,val);
-       val[0] = 0;
-       val[1] = *iptr;
-       break;
-diff --git a/BLACS/SRC/cgamn2d_.c b/BLACS/SRC/cgamn2d_.c
-index 2db6ccb..6958f32 100644
---- a/BLACS/SRC/cgamn2d_.c
-+++ b/BLACS/SRC/cgamn2d_.c
-@@ -221,7 +221,7 @@ F_VOID_FUNC cgamn2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
-diff --git a/BLACS/SRC/cgamx2d_.c b/BLACS/SRC/cgamx2d_.c
-index 707c0b6..f802d01 100644
---- a/BLACS/SRC/cgamx2d_.c
-+++ b/BLACS/SRC/cgamx2d_.c
-@@ -221,7 +221,7 @@ F_VOID_FUNC cgamx2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
-diff --git a/BLACS/SRC/dgamn2d_.c b/BLACS/SRC/dgamn2d_.c
-index dff23b4..a2627ac 100644
---- a/BLACS/SRC/dgamn2d_.c
-+++ b/BLACS/SRC/dgamn2d_.c
-@@ -221,7 +221,7 @@ F_VOID_FUNC dgamn2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
-diff --git a/BLACS/SRC/dgamx2d_.c b/BLACS/SRC/dgamx2d_.c
-index a51f731..2a644d0 100644
---- a/BLACS/SRC/dgamx2d_.c
-+++ b/BLACS/SRC/dgamx2d_.c
-@@ -221,7 +221,7 @@ F_VOID_FUNC dgamx2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
-diff --git a/BLACS/SRC/igamn2d_.c b/BLACS/SRC/igamn2d_.c
-index 16bc003..f6a7859 100644
---- a/BLACS/SRC/igamn2d_.c
-+++ b/BLACS/SRC/igamn2d_.c
-@@ -218,7 +218,7 @@ F_VOID_FUNC igamn2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
-diff --git a/BLACS/SRC/igamx2d_.c b/BLACS/SRC/igamx2d_.c
-index 8165cbe..a7cfcc6 100644
---- a/BLACS/SRC/igamx2d_.c
-+++ b/BLACS/SRC/igamx2d_.c
-@@ -218,7 +218,7 @@ F_VOID_FUNC igamx2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
-diff --git a/BLACS/SRC/sgamn2d_.c b/BLACS/SRC/sgamn2d_.c
-index d6c95e5..569c797 100644
---- a/BLACS/SRC/sgamn2d_.c
-+++ b/BLACS/SRC/sgamn2d_.c
-@@ -221,7 +221,7 @@ F_VOID_FUNC sgamn2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
-diff --git a/BLACS/SRC/sgamx2d_.c b/BLACS/SRC/sgamx2d_.c
-index 4b0af6f..8897ece 100644
---- a/BLACS/SRC/sgamx2d_.c
-+++ b/BLACS/SRC/sgamx2d_.c
-@@ -221,7 +221,7 @@ F_VOID_FUNC sgamx2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
-diff --git a/BLACS/SRC/zgamn2d_.c b/BLACS/SRC/zgamn2d_.c
-index 9de2b23..37897df 100644
---- a/BLACS/SRC/zgamn2d_.c
-+++ b/BLACS/SRC/zgamn2d_.c
-@@ -221,7 +221,7 @@ F_VOID_FUNC zgamn2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
-diff --git a/BLACS/SRC/zgamx2d_.c b/BLACS/SRC/zgamx2d_.c
-index 414c381..0e9d474 100644
---- a/BLACS/SRC/zgamx2d_.c
-+++ b/BLACS/SRC/zgamx2d_.c
-@@ -221,7 +221,7 @@ F_VOID_FUNC zgamx2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
-       {
- #endif
-       i = 2;
--      ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
-+      ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
-       ierr=MPI_Type_commit(&MyType);
-       bp->N = bp2->N = 1;
-       bp->dtype = bp2->dtype = MyType;
diff --git a/pkgs/development/libraries/sentencepiece/default.nix b/pkgs/development/libraries/sentencepiece/default.nix
new file mode 100644
index 00000000000..556f77ef8b5
--- /dev/null
+++ b/pkgs/development/libraries/sentencepiece/default.nix
@@ -0,0 +1,31 @@
+{ config
+, fetchFromGitHub
+, stdenv
+, lib
+, cmake
+, gperftools
+}:
+
+stdenv.mkDerivation rec {
+  pname = "sentencepiece";
+  version = "0.1.84";
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "144y25nj4rwxmgvzqbr7al9fjwh3539ssjswvzrx4gsgfk62lsm0";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ cmake gperftools ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/google/sentencepiece;
+    description = "Unsupervised text tokenizer for Neural Network-based text generation";
+    license = licenses.asl20;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ pashashocky ];
+  };
+}
diff --git a/pkgs/development/libraries/silgraphite/graphite2.nix b/pkgs/development/libraries/silgraphite/graphite2.nix
index 14af55c2afc..6b1c4ca97ba 100644
--- a/pkgs/development/libraries/silgraphite/graphite2.nix
+++ b/pkgs/development/libraries/silgraphite/graphite2.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, pkgconfig, freetype, cmake, python }:
 
 stdenv.mkDerivation rec {
-  version = "1.3.6";
+  version = "1.3.13";
   pname = "graphite2";
 
   src = fetchurl {
     url = "https://github.com/silnrsi/graphite/releases/download/"
-      + "${version}/graphite-${version}.tgz";
-    sha256 = "0xdg6bc02bl8yz39l5i2skczfg17q4lif0qqan0dhvk0mibpcpj7";
+      + "${version}/graphite2-${version}.tgz";
+    sha256 = "01jzhwnj1c3d68dmw15jdxly0hwkmd8ja4kw755rbkykn1ly2qyx";
   };
 
   nativeBuildInputs = [ pkgconfig cmake ];
diff --git a/pkgs/development/libraries/simgear/default.nix b/pkgs/development/libraries/simgear/default.nix
index 471bcb22234..bdd8dd9d999 100644
--- a/pkgs/development/libraries/simgear/default.nix
+++ b/pkgs/development/libraries/simgear/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, plib, freeglut, xorgproto, libX11, libXext, libXi
-, libICE, libSM, libXt, libXmu, libGLU_combined, boost, zlib, libjpeg, freealut
+, libICE, libSM, libXt, libXmu, libGLU, libGL, boost, zlib, libjpeg, freealut
 , openscenegraph, openal, expat, cmake, apr
 , curl
 }:
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ plib freeglut xorgproto libX11 libXext libXi
-                  libICE libSM libXt libXmu libGLU_combined boost zlib libjpeg freealut
+                  libICE libSM libXt libXmu libGLU libGL boost zlib libjpeg freealut
                   openscenegraph openal expat apr curl ];
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/simpleitk/default.nix b/pkgs/development/libraries/simpleitk/default.nix
index 2afd7650618..cbb6a4b64f1 100644
--- a/pkgs/development/libraries/simpleitk/default.nix
+++ b/pkgs/development/libraries/simpleitk/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "simpleitk";
-  version = "1.2.3";
+  version = "1.2.4";
 
   src = fetchFromGitHub {
     owner = "SimpleITK";
     repo = "SimpleITK";
     rev = "v${version}";
-    sha256 = "0nmsq0qx4jmrrhrc6bfm11wwvyszvfgl45xizw69yra3cv9pgmm6";
+    sha256 = "0dvf2407z9n6lczm0l5vzcvpw6r6z1wzrs2gk3dqjrgynq6952qr";
   };
 
   nativeBuildInputs = [ cmake git swig ];
diff --git a/pkgs/development/libraries/slang/default.nix b/pkgs/development/libraries/slang/default.nix
index f868f6bd494..d1cafbce117 100644
--- a/pkgs/development/libraries/slang/default.nix
+++ b/pkgs/development/libraries/slang/default.nix
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
     description = "A multi-platform programmer's library designed to allow a developer to create robust software";
     homepage = http://www.jedsoft.org/slang/;
     license = licenses.gpl2Plus;
-    maintainers = with maintainers; [ fuuzetsu ];
+    maintainers = with maintainers; [ ];
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/smarty3/default.nix b/pkgs/development/libraries/smarty3/default.nix
index 4876c39ce83..b3214cc01df 100644
--- a/pkgs/development/libraries/smarty3/default.nix
+++ b/pkgs/development/libraries/smarty3/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchFromGitHub, ... }: stdenv.mkDerivation rec {
   pname = "smarty3";
-  version = "3.1.33";
+  version = "3.1.34";
 
   src = fetchFromGitHub {
     owner = "smarty-php";
     repo = "smarty";
     rev = "v${version}";
-    sha256 = "12kll8nv4b90nlx3y0213lsncqw2ydshjx4g6dv7jah6j1pv29ix";
+    sha256 = "0a44p71aqyifm7qkp892aczb0bn6a9fv4657dsscxszvdm25a92x";
   };
 
   installPhase = ''
diff --git a/pkgs/development/libraries/smpeg/default.nix b/pkgs/development/libraries/smpeg/default.nix
index e2866788302..a7ffc146f41 100644
--- a/pkgs/development/libraries/smpeg/default.nix
+++ b/pkgs/development/libraries/smpeg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchsvn, SDL, autoconf, automake, libtool, gtk2, m4, pkgconfig, libGLU_combined, makeWrapper }:
+{ stdenv, fetchsvn, SDL, autoconf, automake, libtool, gtk2, m4, pkgconfig, libGLU, libGL, makeWrapper }:
 
 stdenv.mkDerivation rec {
   name = "smpeg-svn${version}";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  buildInputs = [ SDL gtk2 libGLU_combined ];
+  buildInputs = [ SDL gtk2 libGLU libGL ];
 
   nativeBuildInputs = [ autoconf automake libtool m4 pkgconfig makeWrapper ];
 
diff --git a/pkgs/development/libraries/snappy/default.nix b/pkgs/development/libraries/snappy/default.nix
index 80c3630af29..f35f5bfc55a 100644
--- a/pkgs/development/libraries/snappy/default.nix
+++ b/pkgs/development/libraries/snappy/default.nix
@@ -32,6 +32,6 @@ stdenv.mkDerivation rec {
     homepage = https://google.github.io/snappy/;
     license = licenses.bsd3;
     description = "Compression/decompression library for very high speeds";
-    platforms = platforms.unix;
+    platforms = platforms.all;
   };
 }
diff --git a/pkgs/development/libraries/sonic/default.nix b/pkgs/development/libraries/sonic/default.nix
index 4a744c08ae3..3e93302f3d7 100644
--- a/pkgs/development/libraries/sonic/default.nix
+++ b/pkgs/development/libraries/sonic/default.nix
@@ -1,20 +1,22 @@
-{ stdenv, fetchFromGitHub }:
+{ stdenv, fetchFromGitHub, fftw }:
 
 stdenv.mkDerivation {
   pname = "sonic";
-  version = "2016-03-01";
+  version = "2018-07-06";
 
   src = fetchFromGitHub {
     owner = "waywardgeek";
     repo = "sonic";
-    rev = "71bdf26c55716a45af50c667c0335a9519e952dd";
-    sha256 = "1kcl8fdf92kafmfhvyjal5gvkn99brkjyzbi9gw3rd5b30m3xz2b";
+    rev = "71c51195de71627d7443d05378c680ba756545e8";
+    sha256 = "1z9qdk3pk507hdg39v2z1hanlw2wv7mhn8br4cb8qry9z9qwi87i";
   };
 
   postPatch = ''
     sed -i "s,^PREFIX=.*,PREFIX=$out," Makefile
   '';
 
+  buildInputs = [ fftw ];
+
   meta = with stdenv.lib; {
     description = "Simple library to speed up or slow down speech";
     homepage = https://github.com/waywardgeek/sonic;
diff --git a/pkgs/development/libraries/soxt/default.nix b/pkgs/development/libraries/soxt/default.nix
index 11ba48c5971..4afb310d49a 100644
--- a/pkgs/development/libraries/soxt/default.nix
+++ b/pkgs/development/libraries/soxt/default.nix
@@ -1,4 +1,4 @@
-{ fetchhg, stdenv, cmake, coin3d, motif, xlibsWrapper, libXmu, libGLU_combined }:
+{ fetchhg, stdenv, cmake, coin3d, motif, xlibsWrapper, libXmu, libGLU, libGL }:
 
 stdenv.mkDerivation {
   pname = "soxt";
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
   };
 
   nativeBuildInputs = [ cmake ];
-  buildInputs = [ coin3d motif xlibsWrapper libGLU_combined libXmu ];
+  buildInputs = [ coin3d motif xlibsWrapper libGLU libGL libXmu ];
 
   meta = with stdenv.lib; {
     homepage = https://bitbucket.org/Coin3D/coin/wiki/Home;
diff --git a/pkgs/development/libraries/spandsp/default.nix b/pkgs/development/libraries/spandsp/default.nix
index ba1d3e992d6..95827ba364a 100644
--- a/pkgs/development/libraries/spandsp/default.nix
+++ b/pkgs/development/libraries/spandsp/default.nix
@@ -11,6 +11,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [audiofile libtiff];
   meta = {
+    description = "A portable and modular SIP User-Agent with audio and video support";
     homepage = http://www.creytiv.com/baresip.html;
     platforms = with stdenv.lib.platforms; linux;
     maintainers = with stdenv.lib.maintainers; [raskin];
diff --git a/pkgs/development/libraries/sphinxbase/default.nix b/pkgs/development/libraries/sphinxbase/default.nix
index 57c3ae40fd9..3e4d64c47ad 100644
--- a/pkgs/development/libraries/sphinxbase/default.nix
+++ b/pkgs/development/libraries/sphinxbase/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation (rec {
     homepage = http://cmusphinx.sourceforge.net;
     license = stdenv.lib.licenses.bsd2;
     platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
+    maintainers = with stdenv.lib.maintainers; [ ];
   };
 
 } // (stdenv.lib.optionalAttrs multipleOutputs {
diff --git a/pkgs/development/libraries/sundials/default.nix b/pkgs/development/libraries/sundials/default.nix
index 4bc066df32e..d19ecf34ab9 100644
--- a/pkgs/development/libraries/sundials/default.nix
+++ b/pkgs/development/libraries/sundials/default.nix
@@ -2,24 +2,22 @@
 , cmake
 , fetchurl
 , python
-, liblapack
+, openblas
 , gfortran
 , lapackSupport ? true }:
 
-let liblapackShared = liblapack.override {
-  shared = true;
-};
+let openblas32 = openblas.override { blas64 = false; };
 
 in stdenv.mkDerivation rec {
   pname = "sundials";
-  version = "4.1.0";
+  version = "5.0.0";
 
-  buildInputs = [ python ] ++ stdenv.lib.optionals (lapackSupport) [ gfortran ];
+  buildInputs = [ python ] ++ stdenv.lib.optionals (lapackSupport) [ gfortran openblas32 ];
   nativeBuildInputs = [ cmake ];
 
   src = fetchurl {
     url = "https://computation.llnl.gov/projects/${pname}/download/${pname}-${version}.tar.gz";
-    sha256 = "19ca4nmlf6i9ijqcibyvpprxzsdfnackgjs6dw51fq13gg1f2398";
+    sha256 = "1lvx5pddjxgyr8kqlira36kxckz7nxwc8xilzfyx0hf607n42l9l";
   };
 
   patches = [
@@ -33,8 +31,6 @@ in stdenv.mkDerivation rec {
       url = "https://github.com/LLNL/sundials/pull/20/commits/2d951bbe1ff7842fcd0dafa28c61b0aa94015f66.patch";
       sha256 = "0lcr6m4lk14yqrxah4rdscpczny5l7m1zpfsjh8bgspadfsgk512";
     })
-    # https://github.com/LLNL/sundials/pull/21
-    ./tests-parallel.patch
   ];
 
   cmakeFlags = [
@@ -42,7 +38,7 @@ in stdenv.mkDerivation rec {
   ] ++ stdenv.lib.optionals (lapackSupport) [
     "-DSUNDIALS_INDEX_TYPE=int32_t"
     "-DLAPACK_ENABLE=ON"
-    "-DLAPACK_LIBRARIES=${liblapackShared}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary};${liblapackShared}/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}"
+    "-DLAPACK_LIBRARIES=${openblas32}/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary}"
   ];
 
   doCheck = true;
diff --git a/pkgs/development/libraries/sundials/tests-parallel.patch b/pkgs/development/libraries/sundials/tests-parallel.patch
deleted file mode 100644
index a785a1dade9..00000000000
--- a/pkgs/development/libraries/sundials/tests-parallel.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-diff --git a/config/SundialsAddTest.cmake b/config/SundialsAddTest.cmake
-index e965fed..a7fb1d2 100644
---- a/config/SundialsAddTest.cmake
-+++ b/config/SundialsAddTest.cmake
-@@ -70,7 +70,7 @@ MACRO(SUNDIALS_ADD_TEST NAME EXECUTABLE)
-         "--verbose"
-         "--testname=${NAME}"
-         "--executablename=$<TARGET_FILE:${EXECUTABLE}>"
--        "--outputdir=${CMAKE_BINARY_DIR}/Testing/output"
-+        "--outputdir=${TEST_OUTPUT_DIR}"
-         )
- 
-       # do not diff the output and answer files
-diff --git a/config/SundialsTesting.cmake b/config/SundialsTesting.cmake
-index 815576a..d91801a 100644
---- a/config/SundialsTesting.cmake
-+++ b/config/SundialsTesting.cmake
-@@ -29,6 +29,13 @@ IF(SUNDIALS_DEVTESTS)
-     ENDIF()
-   ENDIF()
- 
-+  # Directory for test output
-+  SET(TEST_OUTPUT_DIR ${PROJECT_BINARY_DIR}/Testing/output)
-+
-+  IF(NOT EXISTS ${TEST_OUTPUT_DIR})
-+    FILE(MAKE_DIRECTORY ${TEST_OUTPUT_DIR})
-+  ENDIF()
-+
-   # look for the testRunner script in the test directory
-   FIND_PROGRAM(TESTRUNNER testRunner PATHS test)
-   HIDE_VARIABLE(TESTRUNNER)
-diff --git a/test/testRunner b/test/testRunner
-index f450ec2..f1c8deb 100755
---- a/test/testRunner
-+++ b/test/testRunner
-@@ -106,7 +106,8 @@ def main():
- 
-     # create output directory if necessary
-     if not os.path.exists(outDir):
--        os.makedirs(outDir)
-+        error("Output directory does not exist, it must be created.", outDir)
-+        sys.exit(1)
-     elif not os.path.isdir(outDir):
-         error("Output directory exists but is not a directory, it must be deleted.", outDir)
-         sys.exit(1)
diff --git a/pkgs/development/libraries/tcllib/default.nix b/pkgs/development/libraries/tcllib/default.nix
index 40e137204e2..b1add708902 100644
--- a/pkgs/development/libraries/tcllib/default.nix
+++ b/pkgs/development/libraries/tcllib/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "tcllib";
-  version = "1.19";
+  version = "1.20";
 
   src = fetchurl {
     url = "mirror://sourceforge/tcllib/tcllib-${version}.tar.gz";
-    sha256 = "173abxaazdmf210v651708ab6h7xhskvd52krxk6ifam337qgzh1";
+    sha256 = "0wax281h6ksz974a5qpfgf9y34lmlpd8i87lkm1w94ybbd3rgc73";
   };
 
   passthru = {
diff --git a/pkgs/development/libraries/tdb/default.nix b/pkgs/development/libraries/tdb/default.nix
index 4df80140aa5..9e90e3d3be4 100644
--- a/pkgs/development/libraries/tdb/default.nix
+++ b/pkgs/development/libraries/tdb/default.nix
@@ -3,11 +3,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "tdb-1.3.16";
+  name = "tdb-1.3.18";
 
   src = fetchurl {
     url = "mirror://samba/tdb/${name}.tar.gz";
-    sha256 = "1ibcz466xwk1x6xvzlgzd5va4lyrjzm3rnjak29kkwk7cmhw4gva";
+    sha256 = "1drnsdh1w0px35r0y7l7g59yvyr67mvcsdrli4wab0mwi07b8mn1";
   };
 
   nativeBuildInputs = [ pkgconfig wafHook ];
diff --git a/pkgs/development/libraries/tepl/default.nix b/pkgs/development/libraries/tepl/default.nix
index 0ca382baeca..997b874ac5b 100644
--- a/pkgs/development/libraries/tepl/default.nix
+++ b/pkgs/development/libraries/tepl/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl
 , amtk, gnome3, gtk3, gtksourceview4, libuchardet, libxml2, pkgconfig }:
 let
-  version = "4.2.0";
+  version = "4.3.1";
   pname = "tepl";
 in stdenv.mkDerivation {
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1kcwcr72dv3xwi2ni579c9raa0cnbazfnmy6mgapzn6dir1d8fc8";
+    sha256 = "08y6vss29b65pqzv708cyqmbszgxsqqgw7g0vh6f1389ayi2lvs0";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/development/libraries/tiledb/default.nix b/pkgs/development/libraries/tiledb/default.nix
new file mode 100644
index 00000000000..605307e080e
--- /dev/null
+++ b/pkgs/development/libraries/tiledb/default.nix
@@ -0,0 +1,76 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, zlib
+, lz4
+, bzip2
+, zstd
+, spdlog_0
+, tbb
+, openssl
+, boost
+, libpqxx
+, clang-tools
+, catch2
+, python
+, gtest
+, doxygen
+}:
+
+stdenv.mkDerivation rec {
+  pname = "tiledb";
+  version = "1.7.0";
+
+  src = fetchFromGitHub {
+    owner = "TileDB-Inc";
+    repo = "TileDB";
+    rev = version;
+    sha256 = "07wh9q72vsaf5j2m2c6cfmllwhr3m9f8xzg8h0i6mhd7d0wr4lna";
+  };
+
+  nativeBuildInputs = [
+    clang-tools
+    cmake
+    python
+    doxygen
+  ];
+
+  checkInputs = [
+    gtest
+  ];
+
+  enableParallelBuilding = true;
+
+  buildInputs = [
+    catch2
+    zlib
+    lz4
+    bzip2
+    zstd
+    spdlog_0
+    tbb
+    openssl
+    boost
+    libpqxx
+  ];
+
+  # emulate the process of pulling catch down
+  postPatch = ''
+    mkdir -p build/externals/src/ep_catch
+    ln -sf ${catch2}/include/catch2 build/externals/src/ep_catch/single_include
+  '';
+
+  doCheck = false; # 9 failing tests due to what seems an overflow
+
+  installTargets = [ "install-tiledb" "doc" ];
+
+  meta = with lib; {
+    description = "TileDB allows you to manage the massive dense and sparse multi-dimensional array data";
+    homepage = https://github.com/TileDB-Inc/TileDB;
+    license = licenses.mit;
+    platforms = [ "x86_64-linux"];
+    maintainers = with maintainers; [ rakesh4g ];
+  };
+
+}
diff --git a/pkgs/development/libraries/tpm2-tss/default.nix b/pkgs/development/libraries/tpm2-tss/default.nix
index 0bff95f02a7..3ad33615b3e 100644
--- a/pkgs/development/libraries/tpm2-tss/default.nix
+++ b/pkgs/development/libraries/tpm2-tss/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   pname = "tpm2-tss";
-  version = "2.3.1";
+  version = "2.3.2";
 
   src = fetchurl {
     url = "https://github.com/tpm2-software/${pname}/releases/download/${version}/${pname}-${version}.tar.gz";
-    sha256 = "1ryy6da3s91ks3m66y3xp6yh3v096kny0f9br74mxf2635n5g5kh";
+    sha256 = "19jg09sxy3aj4dc1yv32jjv0m62cnmhjlw02jbh4d4pk2439m4l2";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/development/libraries/tre/default.nix b/pkgs/development/libraries/tre/default.nix
index 901b6aa097f..d5ed35694c5 100644
--- a/pkgs/development/libraries/tre/default.nix
+++ b/pkgs/development/libraries/tre/default.nix
@@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
   ];
 
   meta = {
+    description = "Lightweight and robust POSIX compliant regexp matching library";
+    homepage = "https://laurikari.net/tre/";
     platforms = stdenv.lib.platforms.unix;
     license = stdenv.lib.licenses.bsd2;
   };
diff --git a/pkgs/development/libraries/unixODBCDrivers/default.nix b/pkgs/development/libraries/unixODBCDrivers/default.nix
index c1810443bdb..78f85afca91 100644
--- a/pkgs/development/libraries/unixODBCDrivers/default.nix
+++ b/pkgs/development/libraries/unixODBCDrivers/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, unixODBC, cmake, postgresql, mysql, libmysqlclient, sqlite, zlib, libxml2, dpkg, lib, openssl, kerberos, libuuid, patchelf }:
+{ fetchurl, stdenv, unixODBC, cmake, postgresql, mysql, sqlite, zlib, libxml2, dpkg, lib, openssl, kerberos, libuuid, patchelf, libiconv, fetchFromGitHub }:
 
 # I haven't done any parameter tweaking.. So the defaults provided here might be bad
 
@@ -29,35 +29,42 @@
 
   mariadb = stdenv.mkDerivation rec {
     pname = "mariadb-connector-odbc";
-    version = "3.1.2";
-
-    src = fetchurl {
-      url = "https://downloads.mariadb.org/interstitial/connector-odbc-${version}/${pname}-${version}-ga-src.tar.gz";
-      sha256 = "0iibly2mbqijqyq4pzpb6dh40clqhvqrhgnj8knm4bw3nlksd0d5";
+    version = "3.1.4";
+
+    src = fetchFromGitHub {
+      owner = "MariaDB";
+      repo = "mariadb-connector-odbc";
+      rev = version;
+      sha256 = "1kbz5mng9vx89cw2sx7gsvhbv4h86zwp31fr0hxqing3cwxhkfgw";
+      # this driver only seems to build correctly when built against the mariadb-connect-c subrepo
+      # (see https://github.com/NixOS/nixpkgs/issues/73258)
+      fetchSubmodules = true;
     };
 
     nativeBuildInputs = [ cmake ];
-    buildInputs = [ unixODBC libmysqlclient openssl ];
+    buildInputs = [ unixODBC openssl libiconv ];
+
+    preConfigure = ''
+      # we don't want to build a .pkg
+      sed -i 's/ADD_SUBDIRECTORY(osxinstall)//g' CMakeLists.txt
+    '';
 
     cmakeFlags = [
       "-DWITH_OPENSSL=ON"
-    ];
-
-   NIX_CFLAGS_COMPILE = [
-     "-I${libmysqlclient}/include/mysql"
-     "-L${libmysqlclient}/lib/mysql"
+      # on darwin this defaults to ON but we want to build against unixODBC
+      "-DWITH_IODBC=OFF"
     ];
 
     passthru = {
       fancyName = "MariaDB";
-      driver = "lib/libmaodbc.so";
+      driver = if stdenv.isDarwin then "lib/libmaodbc.dylib" else "lib/libmaodbc.so";
     };
 
     meta = with stdenv.lib; {
       description = "MariaDB ODBC database driver";
       homepage =  https://downloads.mariadb.org/connector-odbc/;
       license = licenses.gpl2;
-      platforms = platforms.linux;
+      platforms = platforms.linux ++ platforms.darwin;
     };
   };
 
diff --git a/pkgs/development/libraries/vaapi-intel/default.nix b/pkgs/development/libraries/vaapi-intel/default.nix
index 722079ff347..1775d5fffc5 100644
--- a/pkgs/development/libraries/vaapi-intel/default.nix
+++ b/pkgs/development/libraries/vaapi-intel/default.nix
@@ -5,16 +5,13 @@
 
 stdenv.mkDerivation rec {
   pname = "intel-vaapi-driver";
-  # TODO: go back to stable releases with the next stable release after 2.3.0.
-  #       see: https://github.com/NixOS/nixpkgs/issues/55975 (and the libva comment v)
-  rev = "329975c63123610fc750241654a3bd18add75beb"; # generally try to match libva version, but not required
-  version = "git-20190211";
+  version = "2.4.0";
 
   src = fetchFromGitHub {
     owner  = "intel";
     repo   = "intel-vaapi-driver";
-    rev    = rev;
-    sha256 = "10333wh2d0hvz5lxl3gjvqs71s7v9ajb0269b3bj5kbflj03v3n5";
+    rev    = version;
+    sha256 = "019w0hvjc9l85yqhy01z2bvvljq208nkb43ai2v377l02krgcrbl";
   };
 
   patchPhase = ''
diff --git a/pkgs/development/libraries/vaapi-vdpau/default.nix b/pkgs/development/libraries/vaapi-vdpau/default.nix
index e3fd7ad57e0..94f96b867d5 100644
--- a/pkgs/development/libraries/vaapi-vdpau/default.nix
+++ b/pkgs/development/libraries/vaapi-vdpau/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, libvdpau, libGLU_combined, libva, pkgconfig }:
+{ stdenv, fetchurl, fetchpatch, libvdpau, libGLU, libGL, libva, pkgconfig }:
 
 stdenv.mkDerivation rec {
   pname = "libva-vdpau-driver";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   ];
 
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ libvdpau libGLU_combined libva ];
+  buildInputs = [ libvdpau libGLU libGL libva ];
 
   postPatch = ''
     sed -i -e "s,LIBVA_DRIVERS_PATH=.*,LIBVA_DRIVERS_PATH=$out/lib/dri," configure
diff --git a/pkgs/development/libraries/vrpn/default.nix b/pkgs/development/libraries/vrpn/default.nix
index 0ae5ba147cb..688dc8d451e 100644
--- a/pkgs/development/libraries/vrpn/default.nix
+++ b/pkgs/development/libraries/vrpn/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, unzip, cmake, libGLU_combined }:
+{ stdenv, fetchFromGitHub, unzip, cmake, libGLU, libGL }:
 
 stdenv.mkDerivation rec {
   name    = "${pname}-${date}";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "032q295d68w34rk5q8nfqdd29s55n00bfik84y7xzkjrpspaprlh";
   };
 
-  buildInputs = [ unzip cmake libGLU_combined ];
+  buildInputs = [ unzip cmake libGLU libGL ];
 
   doCheck = false; # FIXME: test failure
   checkTarget = "test";
diff --git a/pkgs/development/libraries/vtk/default.nix b/pkgs/development/libraries/vtk/default.nix
index 3cb8998485a..482d691fc7c 100644
--- a/pkgs/development/libraries/vtk/default.nix
+++ b/pkgs/development/libraries/vtk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, libGLU_combined, libX11, xorgproto, libXt, libtiff
+{ stdenv, fetchurl, cmake, libGLU, libGL, libX11, xorgproto, libXt, libtiff
 , qtLib ? null
 # Darwin support
 , Cocoa, CoreServices, DiskArbitration, IOKit, CFNetwork, Security, GLUT, OpenGL
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libtiff ]
     ++ optional (qtLib != null) qtLib
-    ++ optionals stdenv.isLinux [ libGLU_combined libX11 xorgproto libXt ]
+    ++ optionals stdenv.isLinux [ libGLU libGL libX11 xorgproto libXt ]
     ++ optionals stdenv.isDarwin [ xpc Cocoa CoreServices DiskArbitration IOKit
                                    CFNetwork Security ApplicationServices CoreText
                                    IOSurface ImageIO OpenGL GLUT ];
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
   # built and requiring one of the shared objects.
   # At least, we use -fPIC for other packages to be able to use this in shared
   # objects.
-  cmakeFlags = [ "-DCMAKE_C_FLAGS=-fPIC" "-DCMAKE_CXX_FLAGS=-fPIC" "-DVTK_USE_SYSTEM_TIFF=1" ]
+  cmakeFlags = [ "-DCMAKE_C_FLAGS=-fPIC" "-DCMAKE_CXX_FLAGS=-fPIC" "-DVTK_USE_SYSTEM_TIFF=1" "-DOPENGL_INCLUDE_DIR=${libGL}/include" ]
     ++ optional (qtLib != null) [ "-DVTK_USE_QT:BOOL=ON" ]
     ++ optional stdenv.isDarwin "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks";
 
diff --git a/pkgs/development/libraries/webkitgtk/2.4.nix b/pkgs/development/libraries/webkitgtk/2.4.nix
deleted file mode 100644
index 060109072b4..00000000000
--- a/pkgs/development/libraries/webkitgtk/2.4.nix
+++ /dev/null
@@ -1,111 +0,0 @@
-{ stdenv, fetchurl, fetchpatch, perl, python, ruby, bison, gperf, flex
-, pkgconfig, which, gettext, gobject-introspection
-, gtk2, gtk3, wayland, libwebp, enchant, sqlite
-, libxml2, libsoup, libsecret, libxslt, harfbuzz, xorg
-, gst-plugins-base, libobjc
-, withGtk2 ? false
-, enableIntrospection ? !stdenv.isDarwin
-, enableCredentialStorage ? !stdenv.isDarwin
-, readline, libedit
-}:
-
-assert stdenv.isDarwin -> !enableIntrospection;
-assert stdenv.isDarwin -> !enableCredentialStorage;
-
-with stdenv.lib;
-stdenv.mkDerivation rec {
-  pname = "webkitgtk";
-  version = "2.4.11";
-
-  meta = with stdenv.lib; {
-    description = "Web content rendering engine, GTK port";
-    homepage = http://webkitgtk.org/;
-    license = licenses.bsd2;
-    platforms = with platforms; linux ++ darwin;
-    maintainers = [];
-    knownVulnerabilities = [
-      "WSA-2016-0004"
-      "WSA-2016-0005"
-      "WSA-2016-0006"
-      "WSA-2017-0001"
-      "WSA-2017-0002"
-    ];
-  };
-
-  src = fetchurl {
-    url = "https://webkitgtk.org/releases/${pname}-${version}.tar.xz";
-    sha256 = "1xsvnvyvlywwyf6m9ainpsg87jkxjmd37q6zgz9cxb7v3c2ym2jq";
-  };
-
-  CC = "cc";
-
-  prePatch = ''
-    patchShebangs Tools/gtk
-  '';
-  patches = [
-    ./webcore-svg-libxml-cflags.patch
-    (fetchpatch {
-      url = https://raw.githubusercontent.com/gentoo/gentoo/7c5457e265bd40c156a8fe6b2ff94a4e34bcea8e/net-libs/webkit-gtk/files/webkit-gtk-2.4.9-gcc-6.patch;
-      sha256 = "0ll93dr5vxd40wvly1jaw41lvw86krac0jc6k6cacrps4i5ql5j0";
-    })
-  ] ++ optionals stdenv.isDarwin [
-    ./configure.patch
-    ./quartz-webcore.patch
-    ./libc++.patch
-    ./plugin-none.patch
-  ] ++ optionals stdenv.hostPlatform.isMusl [
-    ./fix-execinfo.patch
-  ];
-
-  configureFlags = with stdenv.lib; [
-    "--disable-geolocation"
-    "--disable-jit"
-    # needed for parallel building
-    "--enable-dependency-tracking"
-    (optionalString enableIntrospection "--enable-introspection")
-  ] ++ optional withGtk2 [
-    "--with-gtk=2.0"
-  ] ++ optionals (withGtk2 || stdenv.isDarwin) [
-    "--disable-webkit2"
-  ] ++ optionals stdenv.isDarwin [
-    "--disable-x11-target"
-    "--enable-quartz-target"
-    "--disable-web-audio"
-    "CFLAGS=-DJSC_OBJC_API_ENABLED=0"
-    "CXXFLAGS=-DJSC_OBJC_API_ENABLED=0"
-  ] ++ optionals (!enableCredentialStorage) [
-    "--disable-credential-storage"
-  ];
-
-  NIX_CFLAGS_COMPILE = [
-    "-DU_NOEXCEPT="
-    "-Wno-expansion-to-defined"
-  ];
-
-  dontAddDisableDepTrack = true;
-
-  nativeBuildInputs = [
-    perl python ruby bison gperf flex
-    pkgconfig which gettext gobject-introspection
-  ];
-
-  buildInputs = [
-    gtk2 libwebp enchant
-    libxml2 libxslt
-    gst-plugins-base sqlite xorg.libXt xorg.libXdamage
-  ] ++ optionals enableCredentialStorage [
-    libsecret
-  ] ++ (if stdenv.isDarwin then [
-    readline libedit libobjc
-  ] else [
-    wayland
-  ]);
-
-  propagatedBuildInputs = [
-    libsoup harfbuzz/*icu in *.la*/
-    (if withGtk2 then gtk2 else gtk3)
-  ];
-
-  enableParallelBuilding = true;
-
-}
diff --git a/pkgs/development/libraries/webkitgtk/configure.patch b/pkgs/development/libraries/webkitgtk/configure.patch
deleted file mode 100644
index 2f4c1e7ad31..00000000000
--- a/pkgs/development/libraries/webkitgtk/configure.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- webkitgtk-2.4.11-orig/configure	2016-04-10 17:00:06.000000000 +0800
-+++ webkitgtk-2.4.11/configure	2016-07-21 23:04:10.000000000 +0800
-@@ -17738,7 +17738,7 @@
-   cat >>confdefs.h <<_ACEOF
- #define HAVE_WEBP_DECODE_H 1
- _ACEOF
-- WEBP_LIBS='-lwebp'
-+ WEBP_LIBS=`$PKG_CONFIG --libs libwebp`
- else
-   as_fn_error $? "WebP library (libwebp) not found" "$LINENO" 5
- fi
-@@ -18388,7 +18388,7 @@
- case "$host" in
-     *-*-darwin*)
-         UNICODE_CFLAGS="-I$srcdir/Source/JavaScriptCore/icu -I$srcdir/Source/WebCore/icu"
--        UNICODE_LIBS="-licucore"
-+        UNICODE_LIBS="/usr/lib/libicucore.dylib"
-         ;;
-     *-*-mingw*)
- 
diff --git a/pkgs/development/libraries/webkitgtk/default.nix b/pkgs/development/libraries/webkitgtk/default.nix
index 7d48b68d14c..d1e171566ee 100644
--- a/pkgs/development/libraries/webkitgtk/default.nix
+++ b/pkgs/development/libraries/webkitgtk/default.nix
@@ -1,12 +1,56 @@
-{ stdenv, fetchurl, perl, python2, ruby, bison, gperf, cmake, ninja
-, pkgconfig, gettext, gobject-introspection, libnotify, gnutls, libgcrypt
-, gtk3, wayland, libwebp, enchant2, xorg, libxkbcommon, epoxy, at-spi2-core
-, libxml2, libsoup, libsecret, libxslt, harfbuzz, libpthreadstubs, pcre, nettle, libtasn1, p11-kit
-, libidn, libedit, readline, libGLU_combined, libintl, openjpeg
-, enableGeoLocation ? true, geoclue2, sqlite
-, enableGtk2Plugins ? false, gtk2 ? null
-, gst-plugins-base, gst-plugins-bad, woff2
-, bubblewrap, libseccomp, xdg-dbus-proxy, substituteAll
+{ stdenv
+, fetchurl
+, perl
+, python3
+, ruby
+, bison
+, gperf
+, cmake
+, ninja
+, pkgconfig
+, gettext
+, gobject-introspection
+, libnotify
+, gnutls
+, libgcrypt
+, gtk3
+, wayland
+, libwebp
+, enchant2
+, xorg
+, libxkbcommon
+, epoxy
+, at-spi2-core
+, libxml2
+, libsoup
+, libsecret
+, libxslt
+, harfbuzz
+, libpthreadstubs
+, pcre
+, nettle
+, libtasn1
+, p11-kit
+, libidn
+, libedit
+, readline
+, libGL
+, libGLU
+, libintl
+, openjpeg
+, enableGeoLocation ? true
+, geoclue2
+, sqlite
+, enableGtk2Plugins ? false
+, gtk2 ? null
+, gst-plugins-base
+, gst-plugins-bad
+, woff2
+, bubblewrap
+, libseccomp
+, xdg-dbus-proxy
+, substituteAll
+, gnome3
 }:
 
 assert enableGeoLocation -> geoclue2 != null;
@@ -14,22 +58,16 @@ assert enableGtk2Plugins -> gtk2 != null;
 assert stdenv.isDarwin -> !enableGtk2Plugins;
 
 with stdenv.lib;
+
 stdenv.mkDerivation rec {
   pname = "webkitgtk";
-  version = "2.26.1";
+  version = "2.26.2";
 
-  meta = {
-    description = "Web content rendering engine, GTK port";
-    homepage = https://webkitgtk.org/;
-    license = licenses.bsd2;
-    platforms = platforms.linux;
-    hydraPlatforms = [];
-    maintainers = with maintainers; [ ];
-  };
+  outputs = [ "out" "dev" ];
 
   src = fetchurl {
     url = "https://webkitgtk.org/releases/${pname}-${version}.tar.xz";
-    sha256 = "0mfikjfjhwcnrxbzdyh3fl9bbs2azgbdnx8h5910h41b3n022jvb";
+    sha256 = "04k5h0sid9azsqz9pyq436v1rx4lnfrhvmcgmicqb0c0g9iz103b";
   };
 
   patches = optionals stdenv.isLinux [
@@ -37,55 +75,100 @@ stdenv.mkDerivation rec {
       src = ./fix-bubblewrap-paths.patch;
       inherit (builtins) storeDir;
     })
-  ];
-
-  postPatch = ''
-    patchShebangs .
-  '';
-
-  cmakeFlags = [
-  "-DPORT=GTK"
-  "-DUSE_LIBHYPHEN=OFF"
-  "-DENABLE_INTROSPECTION=ON"
-  "-DUSE_WPE_RENDERER=OFF"
-  ]
-  ++ optional (!enableGtk2Plugins) "-DENABLE_PLUGIN_PROCESS_GTK2=OFF"
-  ++ optional stdenv.isLinux "-DENABLE_GLES2=ON"
-  ++ optionals stdenv.isDarwin [
-  "-DUSE_SYSTEM_MALLOC=ON"
-  "-DUSE_ACCELERATE=0"
-  "-DENABLE_MINIBROWSER=OFF"
-  "-DENABLE_VIDEO=ON"
-  "-DENABLE_QUARTZ_TARGET=ON"
-  "-DENABLE_X11_TARGET=OFF"
-  "-DENABLE_OPENGL=OFF"
-  "-DENABLE_WEB_AUDIO=OFF"
-  "-DENABLE_WEBGL=OFF"
-  "-DENABLE_GRAPHICS_CONTEXT_3D=OFF"
-  "-DENABLE_GTKDOC=OFF"
+    ./libglvnd-headers.patch
   ];
 
   nativeBuildInputs = [
-    cmake ninja perl python2 ruby bison gperf
-    pkgconfig gettext gobject-introspection
+    bison
+    cmake
+    gettext
+    gobject-introspection
+    gperf
+    ninja
+    perl
+    pkgconfig
+    python3
+    ruby
   ];
 
   buildInputs = [
-    libintl libwebp enchant2 libnotify gnutls pcre nettle libidn libgcrypt woff2
-    libxml2 libsecret libxslt harfbuzz libpthreadstubs libtasn1 p11-kit openjpeg
-    sqlite gst-plugins-base gst-plugins-bad libxkbcommon epoxy at-spi2-core
+    at-spi2-core
+    enchant2
+    epoxy
+    gnutls
+    gst-plugins-bad
+    gst-plugins-base
+    harfbuzz
+    libGL
+    libGLU
+    libgcrypt
+    libidn
+    libintl
+    libnotify
+    libpthreadstubs
+    libsecret
+    libtasn1
+    libwebp
+    libxkbcommon
+    libxml2
+    libxslt
+    nettle
+    openjpeg
+    p11-kit
+    pcre
+    sqlite
+    woff2
+  ] ++ (with xorg; [
+    libXdamage
+    libXdmcp
+    libXt
+    libXtst
+  ]) ++ optionals stdenv.isDarwin [
+    libedit
+    readline
+  ] ++ optionals stdenv.isLinux [
+    bubblewrap
+    libseccomp
+    wayland
+    xdg-dbus-proxy
   ] ++ optional enableGeoLocation geoclue2
-    ++ optional enableGtk2Plugins gtk2
-    ++ (with xorg; [ libXdmcp libXt libXtst libXdamage ])
-    ++ optionals stdenv.isDarwin [ libedit readline libGLU_combined ]
-    ++ optionals stdenv.isLinux [
-      wayland bubblewrap libseccomp xdg-dbus-proxy
-  ];
+    ++ optional enableGtk2Plugins gtk2;
 
   propagatedBuildInputs = [
-    libsoup gtk3
+    gtk3
+    libsoup
   ];
 
-  outputs = [ "out" "dev" ];
+  cmakeFlags = [
+    "-DENABLE_INTROSPECTION=ON"
+    "-DPORT=GTK"
+    "-DUSE_LIBHYPHEN=OFF"
+    "-DUSE_WPE_RENDERER=OFF"
+  ] ++ optionals stdenv.isDarwin [
+    "-DENABLE_GRAPHICS_CONTEXT_3D=OFF"
+    "-DENABLE_GTKDOC=OFF"
+    "-DENABLE_MINIBROWSER=OFF"
+    "-DENABLE_OPENGL=OFF"
+    "-DENABLE_QUARTZ_TARGET=ON"
+    "-DENABLE_VIDEO=ON"
+    "-DENABLE_WEBGL=OFF"
+    "-DENABLE_WEB_AUDIO=OFF"
+    "-DENABLE_X11_TARGET=OFF"
+    "-DUSE_ACCELERATE=0"
+    "-DUSE_SYSTEM_MALLOC=ON"
+  ] ++ optional (!enableGtk2Plugins) "-DENABLE_PLUGIN_PROCESS_GTK2=OFF"
+    ++ optional stdenv.isLinux "-DENABLE_GLES2=ON";
+
+  postPatch = ''
+    patchShebangs .
+  '';
 
+  meta = {
+    description = "Web content rendering engine, GTK port";
+    homepage = https://webkitgtk.org/;
+    license = licenses.bsd2;
+    platforms = platforms.linux;
+    hydraPlatforms = [];
+    maintainers = gnome3.maintainers;
+  };
 }
diff --git a/pkgs/development/libraries/webkitgtk/fix-execinfo.patch b/pkgs/development/libraries/webkitgtk/fix-execinfo.patch
deleted file mode 100644
index eb825312f3b..00000000000
--- a/pkgs/development/libraries/webkitgtk/fix-execinfo.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- webkitgtk-2.2.0.orig/Source/WTF/wtf/Assertions.cpp
-+++ webkitgtk-2.2.0/Source/WTF/wtf/Assertions.cpp
-@@ -64,7 +64,7 @@
- #include <windows.h>
- #endif
- 
--#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
-+#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__))
- #include <cxxabi.h>
- #include <dlfcn.h>
- #include <execinfo.h>
-@@ -242,7 +242,7 @@
- 
- void WTFGetBacktrace(void** stack, int* size)
- {
--#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
-+#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__))
-     *size = backtrace(stack, *size);
- #elif OS(WINDOWS) && !OS(WINCE)
-     // The CaptureStackBackTrace function is available in XP, but it is not defined
diff --git a/pkgs/development/libraries/webkitgtk/libc++.patch b/pkgs/development/libraries/webkitgtk/libc++.patch
deleted file mode 100644
index 5a9df0ddae9..00000000000
--- a/pkgs/development/libraries/webkitgtk/libc++.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- webkitgtk-2.4.9-orig/GNUmakefile.in	2016-02-02 13:23:23.000000000 -0500
-+++ webkitgtk-2.4.9/GNUmakefile.in	2016-02-02 22:10:23.000000000 -0500
-@@ -23321,7 +23321,7 @@
- 	$(WINMM_LIBS) \
- 	-lm \
- 	-lpthread \
--	-lstdc++
-+	-lc++
- 
- Programs_minidom_LDFLAGS = \
- 	-no-install
-@@ -23344,7 +23344,7 @@
- 	$(WINMM_LIBS) \
- 	-lm \
- 	-lpthread \
--	-lstdc++
-+	-lc++
- 
- Programs_LLIntOffsetsExtractor_LDFLAGS = \
- 	-no-install
diff --git a/pkgs/development/libraries/webkitgtk/libglvnd-headers.patch b/pkgs/development/libraries/webkitgtk/libglvnd-headers.patch
new file mode 100644
index 00000000000..17264f3b588
--- /dev/null
+++ b/pkgs/development/libraries/webkitgtk/libglvnd-headers.patch
@@ -0,0 +1,586 @@
+diff --git a/Source/ThirdParty/ANGLE/scripts/generate_loader.py b/Source/ThirdParty/ANGLE/scripts/generate_loader.py
+index a408dac4..92ddca90 100644
+--- a/Source/ThirdParty/ANGLE/scripts/generate_loader.py
++++ b/Source/ThirdParty/ANGLE/scripts/generate_loader.py
+@@ -201,6 +201,8 @@ def main():
+ 
+ libegl_preamble = """#include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
++#include <EGL/eglmesaext.h>
+ """
+ 
+ util_gles_preamble = """#if defined(GL_GLES_PROTOTYPES) && GL_GLES_PROTOTYPES
+@@ -215,6 +217,8 @@ util_egl_preamble = """#include "util/util_export.h"
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
++#include <EGL/eglmesaext.h>
+ """
+ 
+ util_wgl_preamble = """
+diff --git a/Source/ThirdParty/ANGLE/src/common/PackedEGLEnums_autogen.h b/Source/ThirdParty/ANGLE/src/common/PackedEGLEnums_autogen.h
+index 68c65d8b..0dc9c8e3 100644
+--- a/Source/ThirdParty/ANGLE/src/common/PackedEGLEnums_autogen.h
++++ b/Source/ThirdParty/ANGLE/src/common/PackedEGLEnums_autogen.h
+@@ -14,6 +14,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <angle_gl.h>
+ 
+ #include <cstdint>
+diff --git a/Source/ThirdParty/ANGLE/src/common/PackedGLEnums_autogen.h b/Source/ThirdParty/ANGLE/src/common/PackedGLEnums_autogen.h
+index cd651150..17719bc2 100644
+--- a/Source/ThirdParty/ANGLE/src/common/PackedGLEnums_autogen.h
++++ b/Source/ThirdParty/ANGLE/src/common/PackedGLEnums_autogen.h
+@@ -14,6 +14,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <angle_gl.h>
+ 
+ #include <cstdint>
+diff --git a/Source/ThirdParty/ANGLE/src/common/gen_packed_gl_enums.py b/Source/ThirdParty/ANGLE/src/common/gen_packed_gl_enums.py
+index 2f77e725..5ea54f1f 100644
+--- a/Source/ThirdParty/ANGLE/src/common/gen_packed_gl_enums.py
++++ b/Source/ThirdParty/ANGLE/src/common/gen_packed_gl_enums.py
+@@ -71,6 +71,7 @@ header_template = """// GENERATED FILE - DO NOT EDIT.
+ #include <angle_gl.h>
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ #include <cstdint>
+ 
+diff --git a/Source/ThirdParty/ANGLE/src/common/utilities.h b/Source/ThirdParty/ANGLE/src/common/utilities.h
+index 7a1429a4..dd20bcca 100644
+--- a/Source/ThirdParty/ANGLE/src/common/utilities.h
++++ b/Source/ThirdParty/ANGLE/src/common/utilities.h
+@@ -11,6 +11,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ #include <math.h>
+ #include <string>
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/Config.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/Config.cpp
+index 4134226d..5dd1065f 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/Config.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/Config.cpp
+@@ -15,6 +15,7 @@
+ #include <vector>
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include "angle_gl.h"
+ 
+ #include "common/debug.h"
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/Device.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/Device.cpp
+index 13ae4e61..b964b755 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/Device.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/Device.cpp
+@@ -12,6 +12,7 @@
+ #include <iterator>
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <platform/Platform.h>
+ 
+ #include "common/debug.h"
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/Display.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/Display.cpp
+index 21064073..a46628bd 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/Display.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/Display.cpp
+@@ -17,6 +17,7 @@
+ #include <vector>
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <platform/Platform.h>
+ 
+ #include "common/debug.h"
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/Error.h b/Source/ThirdParty/ANGLE/src/libANGLE/Error.h
+index 37df5b0c..b2e3885b 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/Error.h
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/Error.h
+@@ -11,6 +11,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include "angle_gl.h"
+ #include "common/angleutils.h"
+ #include "common/debug.h"
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/Stream.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/Stream.cpp
+index b7bc84c8..538cb3e0 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/Stream.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/Stream.cpp
+@@ -10,6 +10,7 @@
+ #include "libANGLE/Stream.h"
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <platform/Platform.h>
+ 
+ #include "common/debug.h"
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/Stream.h b/Source/ThirdParty/ANGLE/src/libANGLE/Stream.h
+index 9157aa51..d8e58f2d 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/Stream.h
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/Stream.h
+@@ -14,6 +14,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ #include "common/angleutils.h"
+ #include "libANGLE/AttributeMap.h"
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/Surface.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/Surface.cpp
+index 6daec4f6..941f34ca 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/Surface.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/Surface.cpp
+@@ -11,6 +11,7 @@
+ #include "libANGLE/Surface.h"
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ #include "libANGLE/Config.h"
+ #include "libANGLE/Context.h"
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/SurfaceImpl.h b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/SurfaceImpl.h
+index ea1a0510..db7cf0c8 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/SurfaceImpl.h
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/SurfaceImpl.h
+@@ -11,6 +11,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ #include "common/angleutils.h"
+ #include "libANGLE/Error.h"
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/DeviceD3D.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/DeviceD3D.cpp
+index ba5cf532..43304da5 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/DeviceD3D.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/DeviceD3D.cpp
+@@ -13,6 +13,7 @@
+ #include "libANGLE/Display.h"
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ namespace rx
+ {
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/DisplayD3D.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/DisplayD3D.cpp
+index de60dfff..93b5bdf8 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/DisplayD3D.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/DisplayD3D.cpp
+@@ -9,6 +9,7 @@
+ #include "libANGLE/renderer/d3d/DisplayD3D.h"
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ #include "libANGLE/Config.h"
+ #include "libANGLE/Context.h"
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/EGLImageD3D.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/EGLImageD3D.cpp
+index a7255d0d..a7e37777 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/EGLImageD3D.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/EGLImageD3D.cpp
+@@ -20,6 +20,7 @@
+ #include "libANGLE/renderer/d3d/TextureStorage.h"
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ namespace rx
+ {
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/SurfaceD3D.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
+index 61dc8ffa..87276514 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
+@@ -19,6 +19,7 @@
+ #include "libANGLE/renderer/d3d/d3d11/formatutils11.h"
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <tchar.h>
+ #include <algorithm>
+ 
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/SwapChainD3D.h b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/SwapChainD3D.h
+index 443cadd6..e64bdfc4 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/SwapChainD3D.h
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/SwapChainD3D.h
+@@ -12,6 +12,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <GLES2/gl2.h>
+ 
+ #include "common/angleutils.h"
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
+index 33dfa6b0..eb3393d2 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
+@@ -9,6 +9,7 @@
+ #include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <versionhelpers.h>
+ #include <sstream>
+ 
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
+index fe4def6e..2550b52c 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
+@@ -9,6 +9,7 @@
+ #include "libANGLE/renderer/d3d/d3d11/SwapChain11.h"
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ #include "libANGLE/features.h"
+ #include "libANGLE/renderer/d3d/DisplayD3D.h"
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
+index f4a4ce43..0cad5540 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
+@@ -9,6 +9,7 @@
+ #include "libANGLE/renderer/d3d/d3d9/Renderer9.h"
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <sstream>
+ 
+ #include "common/utilities.h"
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/DisplayGL.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/DisplayGL.cpp
+index a89e1365..0fe4fa98 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/DisplayGL.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/DisplayGL.cpp
+@@ -18,6 +18,7 @@
+ #include "libANGLE/renderer/gl/SurfaceGL.h"
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ namespace rx
+ {
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/RendererGL.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/RendererGL.cpp
+index 10b15594..7ae1ac6b 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/RendererGL.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/RendererGL.cpp
+@@ -9,6 +9,7 @@
+ #include "libANGLE/renderer/gl/RendererGL.h"
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ #include "common/debug.h"
+ #include "libANGLE/AttributeMap.h"
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/egl/FunctionsEGL.h b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/egl/FunctionsEGL.h
+index 115a7afb..abb200e6 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/egl/FunctionsEGL.h
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/egl/FunctionsEGL.h
+@@ -11,6 +11,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ #include <string>
+ #include <vector>
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/egl/ozone/DisplayOzone.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/egl/ozone/DisplayOzone.cpp
+index 47ed6ce0..9d11560c 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/egl/ozone/DisplayOzone.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/egl/ozone/DisplayOzone.cpp
+@@ -14,6 +14,7 @@
+ #include <unistd.h>
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ #include <drm_fourcc.h>
+ #include <gbm.h>
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/glx/DisplayGLX.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/glx/DisplayGLX.cpp
+index 23b4a5c5..daeb5789 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/glx/DisplayGLX.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/glx/DisplayGLX.cpp
+@@ -9,6 +9,7 @@
+ #include "libANGLE/renderer/gl/glx/DisplayGLX.h"
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <algorithm>
+ #include <cstring>
+ #include <fstream>
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/renderergl_utils.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/renderergl_utils.cpp
+index 698b51e2..32e6126f 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/renderergl_utils.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/renderergl_utils.cpp
+@@ -27,6 +27,7 @@
+ #include "libANGLE/renderer/gl/formatutilsgl.h"
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <algorithm>
+ #include <sstream>
+ 
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp
+index 5b686321..16ae890f 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp
+@@ -18,6 +18,7 @@
+ #include "libANGLE/renderer/gl/wgl/FunctionsWGL.h"
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ namespace rx
+ {
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp
+index 12679ba7..93503812 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp
+@@ -28,6 +28,7 @@
+ #include "platform/Platform.h"
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <sstream>
+ #include <string>
+ 
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/vulkan/RendererVk.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/vulkan/RendererVk.cpp
+index df900f4d..4385be88 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/renderer/vulkan/RendererVk.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/renderer/vulkan/RendererVk.cpp
+@@ -13,6 +13,7 @@
+ #include "libANGLE/renderer/vulkan/vk_utils.h"
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ #include "common/debug.h"
+ #include "common/platform.h"
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/validationEGL.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/validationEGL.cpp
+index 1c0b25f4..64e96f73 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/validationEGL.cpp
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/validationEGL.cpp
+@@ -22,6 +22,7 @@
+ #include "libANGLE/formatutils.h"
+ 
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ namespace egl
+ {
+diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/validationEGL.h b/Source/ThirdParty/ANGLE/src/libANGLE/validationEGL.h
+index a671bb0d..248f0ae8 100644
+--- a/Source/ThirdParty/ANGLE/src/libANGLE/validationEGL.h
++++ b/Source/ThirdParty/ANGLE/src/libANGLE/validationEGL.h
+@@ -15,6 +15,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ namespace gl
+ {
+diff --git a/Source/ThirdParty/ANGLE/src/libEGL/egl_loader_autogen.h b/Source/ThirdParty/ANGLE/src/libEGL/egl_loader_autogen.h
+index ae4a427c..a802b65d 100644
+--- a/Source/ThirdParty/ANGLE/src/libEGL/egl_loader_autogen.h
++++ b/Source/ThirdParty/ANGLE/src/libEGL/egl_loader_autogen.h
+@@ -13,6 +13,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ extern PFNEGLCHOOSECONFIGPROC EGL_ChooseConfig;
+ extern PFNEGLCOPYBUFFERSPROC EGL_CopyBuffers;
+diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/entry_points_egl_ext.h b/Source/ThirdParty/ANGLE/src/libGLESv2/entry_points_egl_ext.h
+index 3c64b290..96201b31 100644
+--- a/Source/ThirdParty/ANGLE/src/libGLESv2/entry_points_egl_ext.h
++++ b/Source/ThirdParty/ANGLE/src/libGLESv2/entry_points_egl_ext.h
+@@ -11,6 +11,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <export.h>
+ 
+ extern "C" {
+diff --git a/Source/ThirdParty/ANGLE/src/tests/deqp_support/tcuANGLENativeDisplayFactory.cpp b/Source/ThirdParty/ANGLE/src/tests/deqp_support/tcuANGLENativeDisplayFactory.cpp
+index 777b09e1..dbb0bd2f 100644
+--- a/Source/ThirdParty/ANGLE/src/tests/deqp_support/tcuANGLENativeDisplayFactory.cpp
++++ b/Source/ThirdParty/ANGLE/src/tests/deqp_support/tcuANGLENativeDisplayFactory.cpp
+@@ -24,6 +24,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ #include "deClock.h"
+ #include "deMemory.h"
+diff --git a/Source/ThirdParty/ANGLE/src/tests/deqp_support/tcuANGLEPlatform.cpp b/Source/ThirdParty/ANGLE/src/tests/deqp_support/tcuANGLEPlatform.cpp
+index 6b4a25bf..1c4ac864 100644
+--- a/Source/ThirdParty/ANGLE/src/tests/deqp_support/tcuANGLEPlatform.cpp
++++ b/Source/ThirdParty/ANGLE/src/tests/deqp_support/tcuANGLEPlatform.cpp
+@@ -22,6 +22,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ #include "egluGLContextFactory.hpp"
+ #include "tcuANGLENativeDisplayFactory.h"
+diff --git a/Source/ThirdParty/ANGLE/src/tests/egl_tests/EGLX11VisualTest.cpp b/Source/ThirdParty/ANGLE/src/tests/egl_tests/EGLX11VisualTest.cpp
+index 90abb931..aea4e153 100644
+--- a/Source/ThirdParty/ANGLE/src/tests/egl_tests/EGLX11VisualTest.cpp
++++ b/Source/ThirdParty/ANGLE/src/tests/egl_tests/EGLX11VisualTest.cpp
+@@ -10,6 +10,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <X11/Xlib.h>
+ 
+ #include "test_utils/ANGLETest.h"
+diff --git a/Source/ThirdParty/ANGLE/src/tests/gles_conformance_tests/gles_conformance_tests.h b/Source/ThirdParty/ANGLE/src/tests/gles_conformance_tests/gles_conformance_tests.h
+index e888a239..71606b8c 100644
+--- a/Source/ThirdParty/ANGLE/src/tests/gles_conformance_tests/gles_conformance_tests.h
++++ b/Source/ThirdParty/ANGLE/src/tests/gles_conformance_tests/gles_conformance_tests.h
+@@ -11,6 +11,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ #include <string>
+ 
+diff --git a/Source/ThirdParty/ANGLE/src/tests/gles_conformance_tests/gles_conformance_tests_main.cpp b/Source/ThirdParty/ANGLE/src/tests/gles_conformance_tests/gles_conformance_tests_main.cpp
+index 7fdddcc6..e40b8905 100644
+--- a/Source/ThirdParty/ANGLE/src/tests/gles_conformance_tests/gles_conformance_tests_main.cpp
++++ b/Source/ThirdParty/ANGLE/src/tests/gles_conformance_tests/gles_conformance_tests_main.cpp
+@@ -10,6 +10,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ #include <map>
+ #include <string>
+diff --git a/Source/ThirdParty/ANGLE/src/tests/test_utils/angle_test_configs.h b/Source/ThirdParty/ANGLE/src/tests/test_utils/angle_test_configs.h
+index 7bc7a027..ebb2827b 100644
+--- a/Source/ThirdParty/ANGLE/src/tests/test_utils/angle_test_configs.h
++++ b/Source/ThirdParty/ANGLE/src/tests/test_utils/angle_test_configs.h
+@@ -16,6 +16,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ #include "GLSLANG/ShaderLang.h"
+ #include "angle_test_instantiate.h"
+diff --git a/Source/ThirdParty/ANGLE/util/OSPixmap.h b/Source/ThirdParty/ANGLE/util/OSPixmap.h
+index ba6ccf4a..563d2578 100644
+--- a/Source/ThirdParty/ANGLE/util/OSPixmap.h
++++ b/Source/ThirdParty/ANGLE/util/OSPixmap.h
+@@ -13,6 +13,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ #include "util/Event.h"
+ #include "util/util_export.h"
+diff --git a/Source/ThirdParty/ANGLE/util/OSWindow.h b/Source/ThirdParty/ANGLE/util/OSWindow.h
+index 3cdb458c..3178fa44 100644
+--- a/Source/ThirdParty/ANGLE/util/OSWindow.h
++++ b/Source/ThirdParty/ANGLE/util/OSWindow.h
+@@ -15,6 +15,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ #include "util/Event.h"
+ #include "util/util_export.h"
+diff --git a/Source/ThirdParty/ANGLE/util/egl_loader_autogen.h b/Source/ThirdParty/ANGLE/util/egl_loader_autogen.h
+index 5fbec82f..77a30330 100644
+--- a/Source/ThirdParty/ANGLE/util/egl_loader_autogen.h
++++ b/Source/ThirdParty/ANGLE/util/egl_loader_autogen.h
+@@ -15,6 +15,7 @@
+ 
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ 
+ ANGLE_UTIL_EXPORT extern PFNEGLCHOOSECONFIGPROC eglChooseConfig;
+ ANGLE_UTIL_EXPORT extern PFNEGLCOPYBUFFERSPROC eglCopyBuffers;
+diff --git a/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp b/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp
+index a8a82d70..050893a9 100644
+--- a/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp
++++ b/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp
+@@ -29,6 +29,7 @@
+ #else
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #endif
+ 
+ #if USE(CAIRO)
+diff --git a/Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp b/Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp
+index 05f92c22..636df34a 100644
+--- a/Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp
++++ b/Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp
+@@ -35,6 +35,7 @@
+ #include <wayland-egl.h>
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <wtf/Assertions.h>
+ 
+ namespace WebCore {
+diff --git a/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp b/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp
+index 8c81119b..bf9ed4bd 100644
+--- a/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp
++++ b/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp
+@@ -38,6 +38,7 @@
+ #if USE(EGL)
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #endif
+ 
+ namespace WebCore {
+diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp
+index 973b3168..5586236a 100644
+--- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp
++++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp
+@@ -35,6 +35,7 @@
+ #include <gdk/gdkwayland.h>
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <WebCore/CairoUtilities.h>
+ #include <WebCore/GLContext.h>
+ 
+diff --git a/Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp b/Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp
+index 8d848ce4..46d42c11 100644
+--- a/Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp
++++ b/Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp
+@@ -31,6 +31,7 @@
+ #include "WebKitWaylandServerProtocol.h"
+ #include <EGL/egl.h>
+ #include <EGL/eglext.h>
++#include <EGL/eglmesaext.h>
+ #include <WebCore/GLContext.h>
+ #include <WebCore/PlatformDisplayWayland.h>
+ #include <WebCore/Region.h>
diff --git a/pkgs/development/libraries/webkitgtk/plugin-none.patch b/pkgs/development/libraries/webkitgtk/plugin-none.patch
deleted file mode 100644
index 5e2b36bf62d..00000000000
--- a/pkgs/development/libraries/webkitgtk/plugin-none.patch
+++ /dev/null
@@ -1,38 +0,0 @@
---- webkitgtk-2.4.9-orig/GNUmakefile.in	2016-02-02 13:23:23.000000000 -0500
-+++ webkitgtk-2.4.9/GNUmakefile.in	2016-02-08 00:27:10.000000000 -0500
-@@ -4799,6 +4799,8 @@
- 	Source/WebCore/plugins/PluginViewBase.h \
- 	Source/WebCore/plugins/PluginView.cpp \
- 	Source/WebCore/plugins/PluginView.h \
-+	Source/WebCore/plugins/PluginViewNone.cpp \
-+	Source/WebCore/plugins/PluginPackageNone.cpp \
- 	Source/WebCore/plugins/npapi.h \
- 	Source/WebCore/plugins/npfunctions.h \
- 	Source/WebCore/plugins/npruntime.h \
-@@ -6375,6 +6377,8 @@
- 	Source/WebCore/plugins/libWebCore_la-PluginPackage.lo \
- 	Source/WebCore/plugins/libWebCore_la-PluginStream.lo \
- 	Source/WebCore/plugins/libWebCore_la-PluginView.lo \
-+	Source/WebCore/plugins/libWebCore_la-PluginViewNone.lo \
-+	Source/WebCore/plugins/libWebCore_la-PluginPackageNone.lo \
- 	Source/WebCore/rendering/libWebCore_la-AutoTableLayout.lo \
- 	Source/WebCore/rendering/libWebCore_la-BidiRun.lo \
- 	Source/WebCore/rendering/libWebCore_la-break_lines.lo \
-@@ -10796,6 +10800,8 @@
- 	Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginProcessConnectionManager.lo \
- 	Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginProxy.lo \
- 	Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginView.lo \
-+	Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginViewNone.lo \
-+	Source/WebKit2/WebProcess/Plugins/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-PluginPackageNone.lo \
- 	Source/WebKit2/WebProcess/ResourceCache/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-WebResourceCacheManager.lo \
- 	Source/WebKit2/WebProcess/Storage/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-StorageAreaImpl.lo \
- 	Source/WebKit2/WebProcess/Storage/libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la-StorageAreaMap.lo \
-@@ -19503,6 +19509,8 @@
- 	Source/WebCore/plugins/PluginViewBase.h \
- 	Source/WebCore/plugins/PluginView.cpp \
- 	Source/WebCore/plugins/PluginView.h \
-+	Source/WebCore/plugins/PluginViewNone.cpp \
-+	Source/WebCore/plugins/PluginPackageNone.cpp \
- 	Source/WebCore/plugins/npapi.h \
- 	Source/WebCore/plugins/npfunctions.h \
- 	Source/WebCore/plugins/npruntime.h \
diff --git a/pkgs/development/libraries/webkitgtk/quartz-webcore.patch b/pkgs/development/libraries/webkitgtk/quartz-webcore.patch
deleted file mode 100644
index a7bf859d6c6..00000000000
--- a/pkgs/development/libraries/webkitgtk/quartz-webcore.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- webkitgtk-2.4.9-orig/Source/WebCore/plugins/PluginView.cpp	2016-02-02 13:23:23.000000000 -0500
-+++ webkitgtk-2.4.9/Source/WebCore/plugins/PluginView.cpp	2016-02-02 18:28:07.000000000 -0500
-@@ -839,7 +839,7 @@
- #if defined(XP_MACOSX)
-     , m_contextRef(0)
- #endif
--#if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
-+#if defined(X11) && ENABLE(NETSCAPE_PLUGIN_API)
-     , m_hasPendingGeometryChange(true)
-     , m_drawable(0)
-     , m_visual(0)
---- webkitgtk-2.4.9-orig/Source/WebCore/plugins/PluginView.h	2016-02-02 13:23:23.000000000 -0500
-+++ webkitgtk-2.4.9/Source/WebCore/plugins/PluginView.h	2016-02-02 18:26:37.000000000 -0500
-@@ -378,7 +378,7 @@
-         void setNPWindowIfNeeded();
- #endif
- 
--#if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
-+#if PLATFORM(X11) && ENABLE(NETSCAPE_PLUGIN_API)
-         bool m_hasPendingGeometryChange;
-         Pixmap m_drawable;
-         Visual* m_visual;
diff --git a/pkgs/development/libraries/webkitgtk/webcore-svg-libxml-cflags.patch b/pkgs/development/libraries/webkitgtk/webcore-svg-libxml-cflags.patch
deleted file mode 100644
index 03fc3f3f97d..00000000000
--- a/pkgs/development/libraries/webkitgtk/webcore-svg-libxml-cflags.patch
+++ /dev/null
@@ -1,8 +0,0 @@
---- webkitgtk-2.2.3-orig/GNUmakefile.in	2013-12-04 17:56:28.000000000 +0800
-+++ webkitgtk-2.2.3/GNUmakefile.in	2013-12-05 17:32:37.976689248 +0800
-@@ -21911,6 +21911,7 @@
- @ENABLE_SVG_TRUE@	$(CAIRO_CFLAGS) \
- @ENABLE_SVG_TRUE@	$(FREETYPE_CFLAGS) \
- @ENABLE_SVG_TRUE@	$(LIBSOUP_CFLAGS) \
-+@ENABLE_SVG_TRUE@	$(LIBXML_CFLAGS) \
- @ENABLE_SVG_TRUE@	$(UNICODE_CFLAGS)
diff --git a/pkgs/development/libraries/wlroots/default.nix b/pkgs/development/libraries/wlroots/default.nix
index 54464ffd4b6..a567e66285c 100644
--- a/pkgs/development/libraries/wlroots/default.nix
+++ b/pkgs/development/libraries/wlroots/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig
+{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig, fetchpatch
 , wayland, libGL, wayland-protocols, libinput, libxkbcommon, pixman
 , xcbutilwm, libX11, libcap, xcbutilimage, xcbutilerrors, mesa
 , libpng, ffmpeg_4, freerdp
@@ -15,6 +15,15 @@ stdenv.mkDerivation rec {
     sha256 = "1ak86kx617c81dy85wg9rldy1z3n8ch93cjc05a4j6sifv0nkyfm";
   };
 
+  patches = [
+    # add missing header that changed in mesa-19.2.2
+    # https://github.com/swaywm/wlroots/issues/1862
+    (fetchpatch {
+      url = "https://github.com/swaywm/wlroots/commit/d113e48a2a32542fe6e12f1759f07888364609bf.diff";
+      sha256 = "1h09j1gmnzlz4py92a92chgy8xzsd8h8xn5irq9s2hq4cla66h87";
+    })
+  ];
+
   # $out for the library and $examples for the example programs (in examples):
   outputs = [ "out" "examples" ];
 
diff --git a/pkgs/development/libraries/wt/default.nix b/pkgs/development/libraries/wt/default.nix
index 74792f8f34c..7c819487a33 100644
--- a/pkgs/development/libraries/wt/default.nix
+++ b/pkgs/development/libraries/wt/default.nix
@@ -49,12 +49,12 @@ let
     };
 in {
   wt3 = generic {
-    version = "3.4.2";
-    sha256 = "03mwr4yv3705y74pdh19lmh8szad6gk2x2m23f4pr0wrmqg73307";
+    version = "3.5.0";
+    sha256 = "1xcwzldbval5zrf7f3n2gkpscagg51cw2jp6p3q1yh6bi59haida";
   };
 
   wt4 = generic {
-    version = "4.1.2";
-    sha256 = "06bnadpgflg8inikzynnz4l4r6w1bphjwlva4pzf51w648vpkknl";
+    version = "4.2.0";
+    sha256 = "0zrrdjz0sa8hrmybjp4aap1lcqcqvsicd7dj49zj1m5k8gnfpm4v";
   };
 }
diff --git a/pkgs/development/libraries/wxwidgets/3.0/default.nix b/pkgs/development/libraries/wxwidgets/3.0/default.nix
index a12447562b8..3bbfb139279 100644
--- a/pkgs/development/libraries/wxwidgets/3.0/default.nix
+++ b/pkgs/development/libraries/wxwidgets/3.0/default.nix
@@ -6,15 +6,16 @@
 , libGLU ? null, libGL ? null
 , compat24 ? false, compat26 ? true, unicode ? true
 , withGtk2 ? true
-, withWebKit ? false, webkitgtk24x-gtk2 ? null, webkitgtk ? null
+, withWebKit ? false, webkitgtk ? null
 , AGL ? null, Carbon ? null, Cocoa ? null, Kernel ? null, QTKit ? null
 }:
 
+with stdenv.lib;
 
 assert withMesa -> libGLU != null && libGL != null;
-assert withWebKit -> (if withGtk2 then webkitgtk24x-gtk2 else webkitgtk) != null;
+assert withWebKit -> webkitgtk != null;
 
-with stdenv.lib;
+assert assertMsg (withGtk2 -> withWebKit == false) "wxGTK30: You cannot enable withWebKit when using withGtk2.";
 
 stdenv.mkDerivation rec {
   version = "3.0.4";
@@ -31,7 +32,7 @@ stdenv.mkDerivation rec {
     [ (if withGtk2 then gtk2 else gtk3) libXinerama libSM libXxf86vm xorgproto gstreamer
       gst-plugins-base GConf ]
     ++ optional withMesa libGLU
-    ++ optional withWebKit (if withGtk2 then webkitgtk24x-gtk2 else webkitgtk)
+    ++ optional withWebKit webkitgtk
     ++ optionals stdenv.isDarwin [ setfile Carbon Cocoa Kernel QTKit ];
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/wxwidgets/3.1/default.nix b/pkgs/development/libraries/wxwidgets/3.1/default.nix
index 8fe75153de6..0984472e860 100644
--- a/pkgs/development/libraries/wxwidgets/3.1/default.nix
+++ b/pkgs/development/libraries/wxwidgets/3.1/default.nix
@@ -5,15 +5,16 @@
 , withMesa ? libGLSupported, libGLU ? null, libGL ? null
 , compat28 ? false, compat30 ? true, unicode ? true
 , withGtk2 ? true
-, withWebKit ? false, webkitgtk24x-gtk2 ? null, webkitgtk ? null
+, withWebKit ? false, webkitgtk ? null
 , AGL ? null, Carbon ? null, Cocoa ? null, Kernel ? null, QTKit ? null
 }:
 
+with stdenv.lib;
 
 assert withMesa -> libGLU != null && libGL != null;
-assert withWebKit -> (if withGtk2 then webkitgtk24x-gtk2 else webkitgtk) != null;
+assert withWebKit -> webkitgtk != null;
 
-with stdenv.lib;
+assert assertMsg (withGtk2 -> withWebKit == false) "wxGTK31: You cannot enable withWebKit when using withGtk2.";
 
 stdenv.mkDerivation rec {
   version = "3.1.2";
@@ -30,7 +31,7 @@ stdenv.mkDerivation rec {
     [ (if withGtk2 then gtk2 else gtk3) libXinerama libSM libXxf86vm xorgproto gstreamer
       gst-plugins-base GConf ]
     ++ optional withMesa libGLU
-    ++ optional withWebKit (if withGtk2 then webkitgtk24x-gtk2 else webkitgtk)
+    ++ optional withWebKit webkitgtk
     ++ optionals stdenv.isDarwin [ setfile Carbon Cocoa Kernel QTKit ];
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/xapian/default.nix b/pkgs/development/libraries/xapian/default.nix
index dfec2197385..971ab485221 100644
--- a/pkgs/development/libraries/xapian/default.nix
+++ b/pkgs/development/libraries/xapian/default.nix
@@ -37,5 +37,5 @@ let
     };
   };
 in {
-  xapian_1_4 = generic "1.4.13" "0z0k8902bz2ckdggikj5yz11ik2n8krmdwzvpqv60phcm3zzzy4k";
+  xapian_1_4 = generic "1.4.14" "0ja95vn0lkf6qkjhg2blkx306i10hg4fr8wlrhalmly93307lnlp";
 }
diff --git a/pkgs/development/libraries/xdg-desktop-portal/default.nix b/pkgs/development/libraries/xdg-desktop-portal/default.nix
index 4be7bd1474c..d16c5d670e5 100644
--- a/pkgs/development/libraries/xdg-desktop-portal/default.nix
+++ b/pkgs/development/libraries/xdg-desktop-portal/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, substituteAll, autoreconfHook, pkgconfig, libxml2, glib, pipewire, fontconfig, flatpak, gsettings-desktop-schemas, acl, dbus, fuse, geoclue2, json-glib, wrapGAppsHook }:
+{ stdenv, fetchFromGitHub, nixosTests, substituteAll, autoreconfHook, pkgconfig, libxml2, glib, pipewire, fontconfig, flatpak, gsettings-desktop-schemas, acl, dbus, fuse, geoclue2, json-glib, wrapGAppsHook }:
 
 stdenv.mkDerivation rec {
   pname = "xdg-desktop-portal";
@@ -35,6 +35,12 @@ stdenv.mkDerivation rec {
     "installed_test_metadir=$(installedTests)/share/installed-tests/xdg-desktop-portal"
   ];
 
+  passthru = {
+    tests = {
+      installedTests = nixosTests.installed-tests.xdg-desktop-portal;
+    };
+  };
+
   meta = with stdenv.lib; {
     description = "Desktop integration portals for sandboxed apps";
     license = licenses.lgpl21;
diff --git a/pkgs/development/libraries/xine-lib/default.nix b/pkgs/development/libraries/xine-lib/default.nix
index fd772a1ff9d..adcb2e74b0b 100644
--- a/pkgs/development/libraries/xine-lib/default.nix
+++ b/pkgs/development/libraries/xine-lib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, pkgconfig, xorg, alsaLib, libGLU_combined, aalib
+{ stdenv, fetchurl, fetchpatch, pkgconfig, xorg, alsaLib, libGLU, libGL, aalib
 , libvorbis, libtheora, speex, zlib, perl, ffmpeg
 , flac, libcaca, libpulseaudio, libmng, libcdio, libv4l, vcdimager
 , libmpcdec
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     xorg.libX11 xorg.libXv xorg.libXinerama xorg.libxcb xorg.libXext
-    alsaLib libGLU_combined aalib libvorbis libtheora speex perl ffmpeg flac
+    alsaLib libGLU libGL aalib libvorbis libtheora speex perl ffmpeg flac
     libcaca libpulseaudio libmng libcdio libv4l vcdimager libmpcdec
   ];
 
diff --git a/pkgs/development/libraries/yajl/default.nix b/pkgs/development/libraries/yajl/default.nix
index f9ce555cf27..947b08e7bc5 100644
--- a/pkgs/development/libraries/yajl/default.nix
+++ b/pkgs/development/libraries/yajl/default.nix
@@ -20,6 +20,6 @@ stdenv.mkDerivation rec {
     homepage = http://lloyd.github.com/yajl/;
     license = stdenv.lib.licenses.isc;
     platforms = with stdenv.lib.platforms; linux ++ darwin;
-    maintainers = with stdenv.lib.maintainers; [ z77z ];
+    maintainers = with stdenv.lib.maintainers; [ maggesi ];
   };
 }
diff --git a/pkgs/development/libraries/zeitgeist/default.nix b/pkgs/development/libraries/zeitgeist/default.nix
index 9e3b06453bf..98c94cfecca 100644
--- a/pkgs/development/libraries/zeitgeist/default.nix
+++ b/pkgs/development/libraries/zeitgeist/default.nix
@@ -1,7 +1,23 @@
-{ stdenv, fetchFromGitLab, pkgconfig, glib, sqlite, gobject-introspection, vala
-, autoconf, automake, libtool, gettext, dbus, telepathy-glib
-, gtk3, json-glib, librdf_raptor2, dbus-glib
-, pythonSupport ? true, python2Packages
+{ stdenv
+, fetchFromGitLab
+, fetchpatch
+, pkgconfig
+, glib
+, sqlite
+, gobject-introspection
+, vala
+, autoconf
+, automake
+, libtool
+, gettext
+, dbus
+, telepathy-glib
+, gtk3
+, json-glib
+, librdf_raptor2
+, dbus-glib
+, pythonSupport ? true
+, python2Packages
 }:
 
 stdenv.mkDerivation rec {
@@ -18,31 +34,58 @@ stdenv.mkDerivation rec {
     sha256 = "0ig3d3j1n0ghaxsgfww6g2hhcdwx8cljwwfmp9jk1nrvkxd6rnmv";
   };
 
-  preConfigure = "NOCONFIGURE=1 ./autogen.sh";
-
-  configureFlags = [ "--with-session-bus-services-dir=${placeholder "out"}/share/dbus-1/services" ];
+  patches = [
+    # Fix build with gettext 0.20
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/zeitgeist/zeitgeist/commit/b5c00e80189fd59a059a95c4e276728a2492cb89.patch";
+      sha256 = "1r7f7j3l2p6xlzxajihgx8bzbc2sxcb9spc9pi26rz9bwmngdyq7";
+    })
+  ];
 
   nativeBuildInputs = [
-    autoconf automake libtool pkgconfig gettext gobject-introspection vala python2Packages.python
+    autoconf
+    automake
+    libtool
+    pkgconfig
+    gettext
+    gobject-introspection
+    vala
+    python2Packages.python
   ];
+
   buildInputs = [
-    glib sqlite dbus telepathy-glib dbus-glib
-    gtk3 json-glib librdf_raptor2 python2Packages.rdflib
+    glib
+    sqlite
+    dbus
+    telepathy-glib
+    dbus-glib
+    gtk3
+    json-glib
+    librdf_raptor2
+    python2Packages.rdflib
+  ];
+
+  configureFlags = [
+    "--with-session-bus-services-dir=${placeholder "out"}/share/dbus-1/services"
   ];
 
+  enableParallelBuilding = true;
+
   postPatch = ''
     patchShebangs data/ontology2code
   '';
 
-  enableParallelBuilding = true;
+  preConfigure = ''
+    NOCONFIGURE=1 ./autogen.sh
+  '';
 
   postFixup = stdenv.lib.optionalString pythonSupport ''
     moveToOutput lib/${python2Packages.python.libPrefix} "$py"
   '';
 
   meta = with stdenv.lib; {
-    description = "A service which logs the users's activities and events";
-    homepage = https://zeitgeist.freedesktop.org/;
+    description = "A service which logs the users’s activities and events";
+    homepage = "https://zeitgeist.freedesktop.org/";
     maintainers = with maintainers; [ lethalman worldofpeace ];
     license = licenses.gpl2;
     platforms = platforms.linux;
diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix
index b0f8ae503ea..71da686ce48 100644
--- a/pkgs/development/libraries/zlib/default.nix
+++ b/pkgs/development/libraries/zlib/default.nix
@@ -5,7 +5,7 @@
 , shared ? true
 , static ? true
 # If true, a separate .static ouput is created and the .a is moved there.
-# In this case `pkg-config` will auto detection will currently not work if the
+# In this case `pkg-config` auto detection does not currently work if the
 # .static output is given as `buildInputs` to another package (#66461), because
 # the `.pc` file lists only the main output's lib dir.
 # If false, and if `{ static = true; }`, the .a stays in the main output.