about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-01-11 23:37:02 +0000
committerAlyssa Ross <hi@alyssa.is>2020-01-11 23:41:30 +0000
commit6c557e3f1c28cf87e9fba232811d6875dd1399c1 (patch)
tree035a071d5d8980df6de0fa42e2ef8fc0cce7055e /nixpkgs/pkgs/development/libraries
parentda7500bc026e937ac7fce7b50f67a0e1765737a7 (diff)
parente4134747f5666bcab8680aff67fa3b63384f9a0f (diff)
downloadnixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.gz
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.bz2
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.lz
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.xz
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.zst
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.zip
Merge commit 'e4134747f5666bcab8680aff67fa3b63384f9a0f'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries')
-rw-r--r--nixpkgs/pkgs/development/libraries/AntTweakBar/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/CGAL/4.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/CGAL/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL/find-headers.patch20
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL/setup-hook.sh5
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2/setup-hook.sh2
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2_mixer/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_Pango/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_Pango/fixes.patch148
-rw-r--r--nixpkgs/pkgs/development/libraries/accounts-qt/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/accountsservice/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/accountsservice/drop-prefix-check-extensions.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/ace/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/Agda-Sheaves/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/TotalParserCombinators/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/agda-base/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/agda-iowa-stdlib/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/agda-prelude/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/agda-stdlib/default.nix3
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/bitvector/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/categories/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/pretty/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/alembic/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/alkimia/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/allegro/5.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/allegro/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/amtk/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/apr/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/aqbanking/libchipcard.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/aravis/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/arb/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/argp-standalone/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/armadillo/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/arrayfire/default.nix70
-rw-r--r--nixpkgs/pkgs/development/libraries/arrayfire/no-download.patch28
-rw-r--r--nixpkgs/pkgs/development/libraries/arrow-cpp/default.nix93
-rw-r--r--nixpkgs/pkgs/development/libraries/arrow-cpp/jemalloc-disable-shared.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/aspell/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/aspell/dictionaries.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/assimp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/at-spi2-atk/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/at-spi2-core/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/atk/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/atk/fix_pc.patch9
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/libmysofa/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/lilv/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/lv2/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/sratom/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/audiofile/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/avahi/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/avro-c/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/aws-c-common/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/aws-sdk-cpp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/bamf/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/bamf/gtester2xunit-python3.patch53
-rw-r--r--nixpkgs/pkgs/development/libraries/bcg729/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/bctoolbox/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/belle-sip/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/blitz/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/boehm-gc/7.6.6.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/boehm-gc/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/boehm-gc/mcfgthread.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/1.71.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/generic.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/box2d/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/boxfort/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/buddy/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/bullet/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/bullet/roboschool-fork.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/c-blosc/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/caf/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/cairo/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/catch2/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/ccrtp/1.8.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/ccrtp/gcc-4.6-fix.patch20
-rw-r--r--nixpkgs/pkgs/development/libraries/cereal/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/cfitsio/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/check/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/chipmunk/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/chromaprint/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/cimg/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/cl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/clfft/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/clipper/default.nix3
-rw-r--r--nixpkgs/pkgs/development/libraries/cln/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/clutter/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/codec2/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/cogl/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/coin3d/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/commoncpp2/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/coprthr/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/coredumper/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/cpp-hocon/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/cpp-utilities/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/cppdb/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/cppzmq/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/crc32c/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/criterion/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/crypto++/GNUmakefile-darwin.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/crypto++/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/crypto++/dll.patch28
-rw-r--r--nixpkgs/pkgs/development/libraries/csfml/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/cutee/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/cutelyst/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/cwiid/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/cyrus-sasl/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/czmq/3.x.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/czmq/czmq3-gcc7.patch26
-rw-r--r--nixpkgs/pkgs/development/libraries/czmq/default.nix (renamed from nixpkgs/pkgs/development/libraries/czmq/4.x.nix)0
-rw-r--r--nixpkgs/pkgs/development/libraries/czmqpp/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/czmqpp/socket.patch17
-rw-r--r--nixpkgs/pkgs/development/libraries/dav1d/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/dconf/default.nix55
-rw-r--r--nixpkgs/pkgs/development/libraries/dee/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/dirac/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/dirac/dirac-1.0.2.patch362
-rw-r--r--nixpkgs/pkgs/development/libraries/dleyna-core/setup-hook.sh2
-rw-r--r--nixpkgs/pkgs/development/libraries/dlib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/double-conversion/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/dqlite/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/drumstick/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/eclib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/egl-wayland/default.nix79
-rw-r--r--nixpkgs/pkgs/development/libraries/egl-wayland/eglmesaext.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/enet/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/epoxy/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/exempi/default.nix3
-rw-r--r--nixpkgs/pkgs/development/libraries/expat/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/farbfeld/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/farstream/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/faudio/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/fdk-aac/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/fflas-ffpack/1.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/fflas-ffpack/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/ffmpeg-full/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/ffmpeg/2.8.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/ffmpeg/3.4.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/ffmpeg/4.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/ffmpeg/generic.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/ffmpegthumbnailer/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ffms/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/filter-audio/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/flatbuffers/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/flatcc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/flatpak/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/flint/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/fltk/1.4.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/fltk/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/folks/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/folly/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/fontconfig-ultimate/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/fontconfig/2.10.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/fontconfig/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/fontconfig/make-fonts-cache.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/forge/default.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/fox/fox-1.6.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/fplll/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/freeglut/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/freenect/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/freetds/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/fribidi/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/fstrm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ftgl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gaia/default.nix87
-rw-r--r--nixpkgs/pkgs/development/libraries/gamin/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/garmintools/default.nix3
-rw-r--r--nixpkgs/pkgs/development/libraries/gcab/default.nix69
-rw-r--r--nixpkgs/pkgs/development/libraries/gcab/installed-tests-path.patch21
-rw-r--r--nixpkgs/pkgs/development/libraries/gcr/default.nix73
-rw-r--r--nixpkgs/pkgs/development/libraries/gdal/2.4.0.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/gdal/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/gdal/gdal-1_11.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gdata-sharp/default.nix1
-rw-r--r--nixpkgs/pkgs/development/libraries/gdbm/default.nix3
-rw-r--r--nixpkgs/pkgs/development/libraries/gdcm/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/gdk-pixbuf/default.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh6
-rw-r--r--nixpkgs/pkgs/development/libraries/gdl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gegl/4.0.nix128
-rw-r--r--nixpkgs/pkgs/development/libraries/gegl/patches/no-simple-backend-file-test.patch10
-rw-r--r--nixpkgs/pkgs/development/libraries/geis/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/geoclue/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/geoip/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/geos/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gettext/CVE-2018-18751-bison.patch323
-rw-r--r--nixpkgs/pkgs/development/libraries/gettext/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/gettext/gettext-setup-hook.sh2
-rw-r--r--nixpkgs/pkgs/development/libraries/gettext/gettext.git-2336451ed68d91ff4b5ae1acbc1eca30e47a86a9.patch82
-rw-r--r--nixpkgs/pkgs/development/libraries/gf2x/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/gflags/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/giflib/5.1.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/giflib/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/git2/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gjs/default.nix86
-rw-r--r--nixpkgs/pkgs/development/libraries/gle/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/glfw/3.x.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/glib-networking/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/glib/default.nix88
-rw-r--r--nixpkgs/pkgs/development/libraries/glib/setup-hook.sh8
-rw-r--r--nixpkgs/pkgs/development/libraries/glib/split-dev-programs.patch154
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/2.27-CVE-2019-19126.patch18
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/CVE-2018-11236.patch146
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/CVE-2018-11237.patch55
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/common.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/glibmm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/glm/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/glog/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/gloox/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/glui/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/gmime/3.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gmp/6.x.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gnome-online-accounts/default.nix104
-rw-r--r--nixpkgs/pkgs/development/libraries/gnu-efi/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/gnutls-kdh/generic.nix1
-rw-r--r--nixpkgs/pkgs/development/libraries/gnutls/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gobject-introspection/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/goffice/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gom/default.nix3
-rw-r--r--nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix73
-rw-r--r--nixpkgs/pkgs/development/libraries/gperftools/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/gpgme/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/graphene-hardened-malloc/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/graphene/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/grib-api/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/grilo-plugins/chromaprint-gst-plugins.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/grilo-plugins/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/grilo/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/grpc/default.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/gsettings-desktop-schemas/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gsl/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/gsl/gsl-1_16.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/gsmlib/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/gsound/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gspell/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/bad/default.nix252
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix176
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix107
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/core/setup-hook.sh2
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/ges/default.nix65
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/good/default.nix155
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/legacy/gst-plugins-base/default.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh2
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/libav/default.nix55
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/default.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/ugly/default.nix85
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/vaapi/default.nix83
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/validate/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/gtest/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-engine-bluecurve/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-engine-murrine/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-engines/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-layer-shell/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/2.x.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/3.x.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/hooks/drop-icon-theme-cache.sh19
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/hooks/gtk2-clean-immodules-cache.sh (renamed from nixpkgs/pkgs/development/libraries/gtk/setup-hook.sh)4
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/hooks/gtk3-clean-immodules-cache.sh (renamed from nixpkgs/pkgs/development/libraries/gtk/gtk3-setup-hook.sh)5
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/patches/01-build-Fix-path-handling-in-pkgconfig.patch (renamed from nixpkgs/pkgs/development/libraries/gtk/01-build-Fix-path-handling-in-pkgconfig.patch)0
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/patches/2.0-darwin-x11.patch (renamed from nixpkgs/pkgs/development/libraries/gtk/2.0-darwin-x11.patch)0
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/patches/2.0-immodules.cache.patch (renamed from nixpkgs/pkgs/development/libraries/gtk/2.0-immodules.cache.patch)0
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/patches/3.0-darwin-x11.patch (renamed from nixpkgs/pkgs/development/libraries/gtk/3.0-darwin-x11.patch)0
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/patches/3.0-immodules.cache.patch (renamed from nixpkgs/pkgs/development/libraries/gtk/3.0-immodules.cache.patch)0
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/patches/gtk2-theme-paths.patch (renamed from nixpkgs/pkgs/development/libraries/gtk/gtk2-theme-paths.patch)0
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkd/default.nix126
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkd/paths.d8
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkmm/3.x.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gtksourceview/4.x.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkspell/3.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/gts/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/gvfs/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/harfbuzz/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/hspell/dicts.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/http-parser/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/hunspell/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/hunspell/dictionaries.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/hwloc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/hyperscan/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/hyphen/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/icu/58.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/icu/base.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/ilmbase/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/incrtcl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/intel-gmmlib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/intel-media-driver/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/intel-media-sdk/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/irrlicht/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/iso-codes/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/itk/4.x.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/jasper/default.nix5
-rwxr-xr-xnixpkgs/pkgs/development/libraries/java/hsqldb/builder.sh6
-rw-r--r--nixpkgs/pkgs/development/libraries/java/hsqldb/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/java/lombok/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/java/smack/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/java/swt/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/jbig2dec/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/jitterentropy/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/jitterentropy/reproducible-manpages.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/jsoncpp/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/jsonrpc-glib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/kdb/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/breeze-icons.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/nix-lib-path.patch5
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh16
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/fetch.sh2
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kcalendarcore.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kconfigwidgets/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/ki18n.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kiconthemes/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kio/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/knewstuff.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kplotting.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/ktextwidgets.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kwindowsystem/platform-plugins-path.patch19
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kxmlgui.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/srcs.nix648
-rw-r--r--nixpkgs/pkgs/development/libraries/kf5gpgmepp/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/khronos-ocl-icd-loader/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/khronos-ocl-icd-loader/tracing.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/kmsxx/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/ldns/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/leatherman/default.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/leptonica/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libaal/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libabigail/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/libabw/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libagar/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libao/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libappindicator/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/libav/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libbfd/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libbladeRF/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libblockdev/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libbluray/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libbsd/darwin.patch283
-rw-r--r--nixpkgs/pkgs/development/libraries/libbsd/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libbsd/musl.patch14
-rw-r--r--nixpkgs/pkgs/development/libraries/libburn/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libcaca/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libcbor/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libcdaudio/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libcec/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/libcef/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/libcerf/default.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/libchamplain/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libck/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libclc/default.nix1
-rw-r--r--nixpkgs/pkgs/development/libraries/libco-canonical/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/libcouchbase/0001-Fix-timeouts-in-libcouchbase-testsuite.patch36
-rw-r--r--nixpkgs/pkgs/development/libraries/libcouchbase/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libctb/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libctb/include-kbhit.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/libcutl/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libdazzle/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/libdbi-drivers/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libdbusmenu-qt/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libdbusmenu/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/libde265/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libdigidocpp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libdrm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libdvbpsi/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libdynd/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/libebml/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libechonest/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libedit/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libev/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libevdev/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/libevdevplus/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libexecinfo/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libexif/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libextractor/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libf2c/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libfakekey/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libfaketime/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libffi/3.2.1-cygwin.patch10
-rw-r--r--nixpkgs/pkgs/development/libraries/libffi/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/libfido2/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libfilezilla/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libfprint/default.nix71
-rw-r--r--nixpkgs/pkgs/development/libraries/libfpx/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libfsm/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/libftdi/1.x.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libftdi/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libgcrypt/default.nix3
-rw-r--r--nixpkgs/pkgs/development/libraries/libgda/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libgdata/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libgdiplus/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libglvnd/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/libgnomekbd/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/libgnurl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libgpg-error/default.nix3
-rw-r--r--nixpkgs/pkgs/development/libraries/libgpod/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/libgroove/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libgsf/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libgudev/default.nix1
-rw-r--r--nixpkgs/pkgs/development/libraries/libguestfs/appliance.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libguestfs/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libgweather/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libhandy/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libheif/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libical/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libicns/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/libiconv/setup-hook.sh2
-rw-r--r--nixpkgs/pkgs/development/libraries/libid3tag/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libidn2/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libimagequant/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libindicate/default.nix66
-rw-r--r--nixpkgs/pkgs/development/libraries/libinjection/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/libinput/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/libisds/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libisoburn/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libisofs/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libite/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libivykis/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libjpeg-drop/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libjpeg-turbo/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libksi/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/liblockfile/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/liblouis/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmad/001-mips_removal_h_constraint.patch73
-rw-r--r--nixpkgs/pkgs/development/libraries/libmad/default.nix56
-rw-r--r--nixpkgs/pkgs/development/libraries/libmad/optimize.diff77
-rw-r--r--nixpkgs/pkgs/development/libraries/libmad/pkgconfig.patch117
-rw-r--r--nixpkgs/pkgs/development/libraries/libmanette/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/libmatchbox/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmaxminddb/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libmbim/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmediaart/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libmemcached/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libmesode/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmicrohttpd/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libminc/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/libmodule/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmpeg2/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmypaint/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libnabo/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libnats-c/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libndctl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libnftnl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libngspice/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libnice/default.nix53
-rw-r--r--nixpkgs/pkgs/development/libraries/libnotify/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libofx/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libogg/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/liboping/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libosmium/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libosmpbf/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libowfat/default.nix3
-rw-r--r--nixpkgs/pkgs/development/libraries/libpcap/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/libpeas/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/libpeas/fix-libpeas-gtk-pc.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/libpfm/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libphonenumber/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/libplacebo/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libpng/12.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libpng/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libpointmatcher/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libproxy/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libpsl/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/libpwquality/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libqalculate/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libqmi/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libqtav/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libraspberrypi/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libraw/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/librdf/redland.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libre/default.nix3
-rw-r--r--nixpkgs/pkgs/development/libraries/librealsense/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/librem/default.nix3
-rw-r--r--nixpkgs/pkgs/development/libraries/libressl/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/librseq/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/librsvg/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/librsync/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libscrypt/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libsearpc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libseccomp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libsecret/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libsexy/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libsodium/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libsolv/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/libsoup/default.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/libspectrum/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libspotify/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libstrophe/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/libsvm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libtcod/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libtermkey/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/libtiff/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libtommath/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libtoxcore/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libtxc_dxtn/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libtxc_dxtn_s2tc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libui/default.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/libuinputplus/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libunique/default.nix3
-rw-r--r--nixpkgs/pkgs/development/libraries/libunity/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/libunity/fix-vala.patch36
-rw-r--r--nixpkgs/pkgs/development/libraries/liburing/default.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/libusb1/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/libuv/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libvdpau/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libvirt-glib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libvmaf/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/libvncserver/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/libvorbis/default.nix1
-rw-r--r--nixpkgs/pkgs/development/libraries/libvterm-neovim/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libwacom/default.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/libwebp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libwhereami/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/libwmf/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libwps/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libx86emu/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libxklavier/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libxklavier/honor-XKB_CONFIG_ROOT.patch89
-rw-r--r--nixpkgs/pkgs/development/libraries/libxl/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libxls/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libxml2/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/libxml2/utf8-xmlErrorFuncHandler.patch30
-rw-r--r--nixpkgs/pkgs/development/libraries/libxmlb/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/libxslt/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libyaml-cpp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libzip/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/lightning/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/lightstep-tracer-cpp/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/linbox/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/liquidfun/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/live555/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/lmdb/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/log4cplus/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/mapnik/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/mbedtls/1.3.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/mbedtls/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/mediastreamer/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/mediastreamer/msopenh264.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/mesa/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/mesa/disk_cache-include-dri-driver-path-in-cache-key.patch23
-rw-r--r--nixpkgs/pkgs/development/libraries/mesa/stubs.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/mimalloc/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/minixml/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/minizip/default.nix1
-rw-r--r--nixpkgs/pkgs/development/libraries/mlt/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/mlt/qt-5.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/mm-common/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/mpich/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/mps/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/muparser/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/mygui/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/nanoflann/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/nco/default.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/ncurses/default.nix1
-rw-r--r--nixpkgs/pkgs/development/libraries/ndi/default.nix60
-rw-r--r--nixpkgs/pkgs/development/libraries/netcdf/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/nettle/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/nghttp2/default.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/nspr/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/nss/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/nss_wrapper/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/nsss/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ntl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/ntrack/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/nuspell/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/nvidia-texture-tools/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/ogre/1.10.x.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ogre/1.9.x.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ogre/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ois/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/olm/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/oniguruma/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/onnxruntime/default.nix67
-rw-r--r--nixpkgs/pkgs/development/libraries/opae/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/opal/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/opal/disable-samples-ftbfs.diff14
-rw-r--r--nixpkgs/pkgs/development/libraries/opal/libav10.patch208
-rw-r--r--nixpkgs/pkgs/development/libraries/opal/libav9.patch543
-rw-r--r--nixpkgs/pkgs/development/libraries/openal-soft/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/openal-soft/search-out.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/openbabel/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/openbsm/default.nix3
-rw-r--r--nixpkgs/pkgs/development/libraries/opencl-clang/default.nix97
-rw-r--r--nixpkgs/pkgs/development/libraries/opencl-clang/opencl-headers-dir.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/opencolorio/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/opencsg/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/opencv/3.x.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/opencv/4.x.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/opencv/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/opendbx/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/openexr/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/openexrid-unstable/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/openfst/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/openh264/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/openmpi/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/openscenegraph/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/openssl/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/openvdb/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/openxr-loader/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/openzwave/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/oracle-instantclient/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/orcania/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ortp/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/p11-kit/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/packr/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/pango/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/pangox-compat/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/partio/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/pcaudiolib/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/pcre/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/pcre2/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/phonon/backends/vlc.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/phonon/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/apfel/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/applgrid/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/fastjet-contrib/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/fastjet/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/geant4/datasets-hook.sh2
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/geant4/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/geant4/g4py/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/hepmc3/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/herwig/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/pythia/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/rivet/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/thepeg/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/pipewire/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/plib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/plplot/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/pmdk/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/poco/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/polkit/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/poly2tri-c/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/poppler/0.61-CVE-2019-9959.patch20
-rw-r--r--nixpkgs/pkgs/development/libraries/poppler/0.61.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/poppler/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/portaudio/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/precice/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/prometheus-cpp/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/protobuf/3.10.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/protobuf/3.11.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/protobuf/3.9.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/protolock/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/pstreams/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/ptlib/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/ptlib/ptlib-2.10.11-glibc-2.26.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/pybind11/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/pybind11/no_test_cmake_build.patch7
-rw-r--r--nixpkgs/pkgs/development/libraries/qca2/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/qgnomeplatform/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/qoauth/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qpdf/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qrupdate/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qscintilla/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/qscintilla/fix-qt4-build.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-3/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt4-gcc6.patch4
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.11/default.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.11/fetch.sh1
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.11/qtbase-fixguicmake.patch30
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.11/qtbase.patch1106
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.11/qtdeclarative.patch46
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.11/qtscript.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.11/qtserialport.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.11/qttools.patch86
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-no-platform-check.patch37
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.11/qtwebengine-no-build-skip.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.11/qtwebkit.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.11/srcs.nix325
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/fetch.sh2
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase-fixguicmake.patch30
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch1146
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0001-qtbase-mkspecs-mac.patch403
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0002-qtbase-mac.patch116
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0003-qtbase-mkspecs.patch465
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0004-qtbase-replace-libdir.patch68
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0005-qtbase-cmake.patch194
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0006-qtbase-gtk3.patch48
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0007-qtbase-xcursor.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0008-qtbase-xcompose.patch30
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0009-qtbase-tzdir.patch51
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0010-qtbase-qtpluginpath.patch32
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0011-qtbase-assert.patch32
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0012-fix-header_module.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0013-define-kiosurfacesuccess.patch16
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/srcs.nix320
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.9/default.nix172
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.9/fetch.sh1
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.9/qtbase-fixguicmake.patch30
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.9/qtbase-openssl_1_1.patch3985
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.9/qtbase.patch1119
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.9/qtdeclarative.patch33
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.9/qtscript.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.9/qtserialport.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.9/qttools.patch71
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.9/qtwebengine-clang-fix.patch38
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.9/qtwebengine-darwin-no-platform-check.patch50
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.9/qtwebengine-no-build-skip.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.9/qtwebkit.patch64
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.9/srcs.nix333
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qmake-libtool.sh14
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh31
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh4
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/hooks/qttools-setup-hook.sh2
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh8
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/mkDerivation.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix88
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebengine.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebkit.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/qtkeychain/0002-Fix-install-name-Darwin.patch10
-rw-r--r--nixpkgs/pkgs/development/libraries/qtkeychain/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/qtpbfimageplugin/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/qtutilities/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/quesoglc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/quickder/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/rabbitmq-c/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/raft-canonical/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/randomx/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/range-v3/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/rdkafka/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/6.2.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/6.3.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/7.0.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/8.0.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/rnnoise/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/robin-map/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/rocksdb/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/safefile/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/schroedinger/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/science/benchmark/papi/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/elastix/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/mirtk/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/nifticlib/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/QuadProgpp/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/brial/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/caffe2/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/clmagma/default.nix75
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/cudnn/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/lcalc/makefile.patch4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/magma/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/mkl/default.nix118
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/or-tools/build.patch5
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/or-tools/default.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/or-tools/protobuf.patch10
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/osi/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/scalapack/openmpi4.patch143
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/tensorflow/bin.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/sentencepiece/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/serd/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/serialdv/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/shhmsg/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/shhopt/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/silgraphite/graphite2.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/simgear/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/simpleitk/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/skalibs/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/slang/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/smarty3/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/smpeg/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/snappy/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/sonic/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/sord/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/soxt/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/spandsp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/spatialite-tools/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/spdk/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/spdk/spdk-dpdk-meson.patch17
-rw-r--r--nixpkgs/pkgs/development/libraries/spdlog/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/sphinxbase/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/spirv-headers/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/sqlcipher/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/sqlite/analyzer.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/sqlite/archive-version.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/sqlite/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/srt/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/srtp/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/sundials/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/sundials/tests-parallel.patch45
-rw-r--r--nixpkgs/pkgs/development/libraries/symengine/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/t1lib/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/tachyon/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/taglib/1.9.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/taglib/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/tbb/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/tcllib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/tdb/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/tdlib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/template-glib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/tepl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/thrift/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/tiledb/default.nix76
-rw-r--r--nixpkgs/pkgs/development/libraries/tinyxml/2.6.2.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/tntdb/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/torch/default.nix1
-rw-r--r--nixpkgs/pkgs/development/libraries/tpm2-tss/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/tracker-miners/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/tracker-miners/fix-paths.patch9
-rw-r--r--nixpkgs/pkgs/development/libraries/tracker/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/tre/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/tremor/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/trompeloeil/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/umockdev/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/unibilium/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/unicorn-emu/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/unixODBCDrivers/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/uri/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/usbredir/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/utmps/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/v8/3.14.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/v8/3.16.14.nix81
-rw-r--r--nixpkgs/pkgs/development/libraries/v8/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/vaapi-intel/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/vaapi-vdpau/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/vapoursynth/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/vapoursynth/editor.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/vrpn/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/vte/default.nix75
-rw-r--r--nixpkgs/pkgs/development/libraries/vte/ng.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/vtk/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/vxl/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/wayland/1.9.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/webkitgtk/2.4.nix111
-rw-r--r--nixpkgs/pkgs/development/libraries/webkitgtk/configure.patch20
-rw-r--r--nixpkgs/pkgs/development/libraries/webkitgtk/default.nix203
-rw-r--r--nixpkgs/pkgs/development/libraries/webkitgtk/fix-bubblewrap-paths.patch23
-rw-r--r--nixpkgs/pkgs/development/libraries/webkitgtk/fix-execinfo.patch20
-rw-r--r--nixpkgs/pkgs/development/libraries/webkitgtk/libc++.patch20
-rw-r--r--nixpkgs/pkgs/development/libraries/webkitgtk/libglvnd-headers.patch586
-rw-r--r--nixpkgs/pkgs/development/libraries/webkitgtk/plugin-none.patch38
-rw-r--r--nixpkgs/pkgs/development/libraries/webkitgtk/quartz-webcore.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/webkitgtk/webcore-svg-libxml-cflags.patch8
-rw-r--r--nixpkgs/pkgs/development/libraries/wiredtiger/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/wlroots/default.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/wolfssl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/wt/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/wxSVG/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/wxwidgets/2.8/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/wxwidgets/3.0/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/wxwidgets/3.1/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/x265/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/xapian/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/xapian/skip-flaky-darwin-test.patch6
-rw-r--r--nixpkgs/pkgs/development/libraries/xdg-dbus-proxy/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/xine-lib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/xmlsec/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/xxHash/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/yajl/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/yder/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/zeitgeist/default.nix69
-rw-r--r--nixpkgs/pkgs/development/libraries/zeroc-ice/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/zeromq/4.x.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/zlib/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/zookeeper_mt/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/zziplib/default.nix16
871 files changed, 11144 insertions, 15703 deletions
diff --git a/nixpkgs/pkgs/development/libraries/AntTweakBar/default.nix b/nixpkgs/pkgs/development/libraries/AntTweakBar/default.nix
index 94b36b855f25..1ae6346cbe58 100644
--- a/nixpkgs/pkgs/development/libraries/AntTweakBar/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/CGAL/4.nix b/nixpkgs/pkgs/development/libraries/CGAL/4.nix
new file mode 100644
index 000000000000..60c244009ceb
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/CGAL/default.nix b/nixpkgs/pkgs/development/libraries/CGAL/default.nix
index 95984c970018..d2d74769a1fc 100644
--- a/nixpkgs/pkgs/development/libraries/CGAL/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/SDL/default.nix b/nixpkgs/pkgs/development/libraries/SDL/default.nix
index 610f1b768f24..61609a90dd02 100644
--- a/nixpkgs/pkgs/development/libraries/SDL/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL/default.nix
@@ -13,6 +13,16 @@
 
 with stdenv.lib;
 
+let
+  extraPropagatedBuildInputs = [ ]
+    ++ optionals x11Support [ libXext libICE libXrandr ]
+    ++ optionals openglSupport [ libGL libGLU ]
+    ++ optional alsaSupport alsaLib
+    ++ optional pulseaudioSupport libpulseaudio
+    ++ optional stdenv.isDarwin Cocoa;
+  rpath = makeLibraryPath extraPropagatedBuildInputs;
+in
+
 stdenv.mkDerivation rec {
   pname = "SDL";
   version = "1.2.15";
@@ -31,12 +41,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ]
     ++ optional stdenv.isLinux libcap;
 
-  propagatedBuildInputs = [ libiconv ]
-    ++ optionals x11Support [ libXext libICE libXrandr ]
-    ++ optionals openglSupport [ libGL libGLU ]
-    ++ optional alsaSupport alsaLib
-    ++ optional pulseaudioSupport libpulseaudio
-    ++ optional stdenv.isDarwin Cocoa;
+  propagatedBuildInputs = [ libiconv ] ++ extraPropagatedBuildInputs;
 
   buildInputs = [ ]
     ++ optional (!stdenv.hostPlatform.isMinGW && alsaSupport) audiofile
@@ -108,7 +113,7 @@ stdenv.mkDerivation rec {
   postFixup = ''
     for lib in $out/lib/*.so* ; do
       if [[ -L "$lib" ]]; then
-        patchelf --set-rpath "$(patchelf --print-rpath $lib):${makeLibraryPath propagatedBuildInputs}" "$lib"
+        patchelf --set-rpath "$(patchelf --print-rpath $lib):${rpath}" "$lib"
       fi
     done
   '';
diff --git a/nixpkgs/pkgs/development/libraries/SDL/find-headers.patch b/nixpkgs/pkgs/development/libraries/SDL/find-headers.patch
index 5f75ae9e8301..fd498117fd64 100644
--- a/nixpkgs/pkgs/development/libraries/SDL/find-headers.patch
+++ b/nixpkgs/pkgs/development/libraries/SDL/find-headers.patch
@@ -1,7 +1,8 @@
-diff -ru3 SDL-1.2.15/sdl-config.in SDL-1.2.15-new/sdl-config.in
---- SDL-1.2.15/sdl-config.in	2012-01-19 10:30:06.000000000 +0400
-+++ SDL-1.2.15-new/sdl-config.in	2016-08-22 05:32:52.716397920 +0300
-@@ -42,7 +42,11 @@
+diff --git a/sdl-config.in b/sdl-config.in
+index e0fcc0c..bf7928a 100644
+--- a/sdl-config.in
++++ b/sdl-config.in
+@@ -42,14 +42,18 @@ while test $# -gt 0; do
        echo @SDL_VERSION@
        ;;
      --cflags)
@@ -13,4 +14,13 @@ diff -ru3 SDL-1.2.15/sdl-config.in SDL-1.2.15-new/sdl-config.in
 +      echo $SDL_CFLAGS @SDL_CFLAGS@
        ;;
  @ENABLE_SHARED_TRUE@    --libs)
- @ENABLE_SHARED_TRUE@      echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@
+-@ENABLE_SHARED_TRUE@      echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@
++@ENABLE_SHARED_TRUE@      echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@ $SDL_LIB_PATH
+ @ENABLE_SHARED_TRUE@      ;;
+ @ENABLE_STATIC_TRUE@@ENABLE_SHARED_TRUE@    --static-libs)
+ @ENABLE_STATIC_TRUE@@ENABLE_SHARED_FALSE@    --libs|--static-libs)
+-@ENABLE_STATIC_TRUE@      echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_STATIC_LIBS@
++@ENABLE_STATIC_TRUE@      echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_STATIC_LIBS@ $SDL_LIB_PATH
+ @ENABLE_STATIC_TRUE@      ;;
+     *)
+       echo "${usage}" 1>&2
diff --git a/nixpkgs/pkgs/development/libraries/SDL/setup-hook.sh b/nixpkgs/pkgs/development/libraries/SDL/setup-hook.sh
index 20382f18f529..553e8553a77f 100644
--- a/nixpkgs/pkgs/development/libraries/SDL/setup-hook.sh
+++ b/nixpkgs/pkgs/development/libraries/SDL/setup-hook.sh
@@ -1,6 +1,9 @@
 addSDLPath () {
   if [ -e "$1/include/SDL" ]; then
-    export SDL_PATH="$SDL_PATH $1/include/SDL"
+    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/nixpkgs/pkgs/development/libraries/SDL2/default.nix b/nixpkgs/pkgs/development/libraries/SDL2/default.nix
index 37e38e03b8cf..e02ea05a7262 100644
--- a/nixpkgs/pkgs/development/libraries/SDL2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL2/default.nix
@@ -36,6 +36,13 @@ stdenv.mkDerivation rec {
 
   patches = [ ./find-headers.patch ];
 
+  # Fix with mesa 19.2: https://bugzilla.libsdl.org/show_bug.cgi?id=4797
+  postPatch = ''
+    substituteInPlace include/SDL_opengl_glext.h \
+      --replace "typedef ptrdiff_t GLsizeiptr;" "typedef signed long int khronos_ssize_t; typedef khronos_ssize_t GLsizeiptr;" \
+      --replace "typedef ptrdiff_t GLintptr;" "typedef signed long int khronos_intptr_t; typedef khronos_intptr_t GLintptr;"
+  '';
+
   nativeBuildInputs = [ pkgconfig ];
 
   propagatedBuildInputs = dlopenPropagatedBuildInputs;
@@ -68,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/nixpkgs/pkgs/development/libraries/SDL2/setup-hook.sh b/nixpkgs/pkgs/development/libraries/SDL2/setup-hook.sh
index 3acce9d473c5..0119926491af 100644
--- a/nixpkgs/pkgs/development/libraries/SDL2/setup-hook.sh
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/SDL2_mixer/default.nix b/nixpkgs/pkgs/development/libraries/SDL2_mixer/default.nix
index 826cf793cd2e..58c76e3a3f53 100644
--- a/nixpkgs/pkgs/development/libraries/SDL2_mixer/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL2_mixer/default.nix
@@ -1,5 +1,5 @@
 { stdenv, lib, fetchurl, autoreconfHook, pkgconfig, which
-, SDL2, libogg, libvorbis, smpeg2, flac, libmodplug
+, SDL2, libogg, libvorbis, smpeg2, flac, libmodplug, opusfile
 , CoreServices, AudioUnit, AudioToolbox
 , enableNativeMidi ? false, fluidsynth ? null }:
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = stdenv.lib.optionals stdenv.isDarwin [ CoreServices AudioUnit AudioToolbox ];
 
-  propagatedBuildInputs = [ SDL2 libogg libvorbis fluidsynth smpeg2 flac libmodplug ];
+  propagatedBuildInputs = [ SDL2 libogg libvorbis fluidsynth smpeg2 flac libmodplug opusfile ];
 
   configureFlags = [ "--disable-music-ogg-shared" ]
     ++ lib.optional enableNativeMidi "--enable-music-native-midi-gpl"
diff --git a/nixpkgs/pkgs/development/libraries/SDL_Pango/default.nix b/nixpkgs/pkgs/development/libraries/SDL_Pango/default.nix
new file mode 100644
index 000000000000..e330ccef6116
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL_Pango/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchpatch, fetchurl, SDL, autoreconfHook, pango, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  pname = "SDL_Pango";
+  version = "0.1.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/sdlpango/${pname}-${version}.tar.gz";
+    sha256 = "197baw1dsg0p4pljs5k0fshbyki00r4l49m1drlpqw6ggawx6xbz";
+  };
+
+  patches = [ 
+    (fetchpatch {
+      url = https://sources.debian.org/data/main/s/sdlpango/0.1.2-6/debian/patches/api_additions.patch;
+      sha256 = "00p5ry5gd3ixm257p9i2c4jg0qj8ipk8nf56l7c9fma8id3zxyld";
+    })
+    ./fixes.patch
+  ];
+
+  preConfigure = "autoreconf -i -f";
+
+  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  buildInputs = [ SDL pango ];
+
+  meta = with stdenv.lib; {
+    description = "Connects the Pango rendering engine to SDL";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.all;
+    homepage = http://sdlpango.sourceforge.net/;
+    maintainers = with maintainers; [ puckipedia ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/SDL_Pango/fixes.patch b/nixpkgs/pkgs/development/libraries/SDL_Pango/fixes.patch
new file mode 100644
index 000000000000..9703c0d4918f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL_Pango/fixes.patch
@@ -0,0 +1,148 @@
+diff --git a/SDL_Pango.pc.in b/SDL_Pango.pc.in
+index 750d091..3af38ff 100644
+--- a/SDL_Pango.pc.in
++++ b/SDL_Pango.pc.in
+@@ -6,6 +6,6 @@ includedir=@includedir@
+ Name: SDL_Pango

+ Description: SDL library for internationalized text rendering

+ Version: @VERSION@

+-Requires: pango

++Requires: pango pangoft2
+ Libs: -L${libdir} -lSDL_Pango

+ Cflags: -I${includedir}
+\ No newline at end of file
+diff --git a/src/SDL_Pango.c b/src/SDL_Pango.c
+index b969bc1..cc2c3f5 100644
+--- a/src/SDL_Pango.c
++++ b/src/SDL_Pango.c
+@@ -231,6 +231,41 @@
+ 

+ #include "SDL_Pango.h"

+ 

++const SDLPango_Matrix _MATRIX_WHITE_BACK
++    = {255, 0, 0, 0,
++       255, 0, 0, 0,
++       255, 0, 0, 0,
++       255, 255, 0, 0,};
++const SDLPango_Matrix *MATRIX_WHITE_BACK = &_MATRIX_WHITE_BACK;
++
++const SDLPango_Matrix _MATRIX_BLACK_BACK
++    = {0, 255, 0, 0,
++       0, 255, 0, 0,
++       0, 255, 0, 0,
++       255, 255, 0, 0,};
++const SDLPango_Matrix *MATRIX_BLACK_BACK = &_MATRIX_BLACK_BACK;
++
++const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_BLACK_LETTER
++    = {0, 0, 0, 0,
++       0, 0, 0, 0,
++       0, 0, 0, 0,
++       0, 255, 0, 0,};
++const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_BLACK_LETTER = &_MATRIX_TRANSPARENT_BACK_BLACK_LETTER;
++
++const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_WHITE_LETTER
++    = {255, 255, 0, 0,
++       255, 255, 0, 0,
++       255, 255, 0, 0,
++       0, 255, 0, 0,};
++const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_WHITE_LETTER = &_MATRIX_TRANSPARENT_BACK_WHITE_LETTER;
++
++const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER
++    = {255, 255, 0, 0,
++       255, 255, 0, 0,
++       255, 255, 0, 0,
++       0, 0, 0, 0,};
++const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER = &_MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER;
++
+ //! non-zero if initialized

+ static int IS_INITIALIZED = 0;

+ 

+diff --git a/src/SDL_Pango.h b/src/SDL_Pango.h
+index 6ebdf78..b7e5e58 100644
+--- a/src/SDL_Pango.h
++++ b/src/SDL_Pango.h
+@@ -47,57 +47,32 @@ typedef struct _SDLPango_Matrix {
+     Uint8 m[4][4];  /*! Matrix variables */

+ } SDLPango_Matrix;

+ 

+-const SDLPango_Matrix _MATRIX_WHITE_BACK

+-    = {255, 0, 0, 0,

+-       255, 0, 0, 0,

+-       255, 0, 0, 0,

+-       255, 255, 0, 0,};

+ 

+ /*!

+     Specifies white back and black letter.

+ */

+-const SDLPango_Matrix *MATRIX_WHITE_BACK = &_MATRIX_WHITE_BACK;

++extern const SDLPango_Matrix *MATRIX_WHITE_BACK;
+ 

+-const SDLPango_Matrix _MATRIX_BLACK_BACK

+-    = {0, 255, 0, 0,

+-       0, 255, 0, 0,

+-       0, 255, 0, 0,

+-       255, 255, 0, 0,};

+ /*!

+     Specifies black back and white letter.

+ */

+-const SDLPango_Matrix *MATRIX_BLACK_BACK = &_MATRIX_BLACK_BACK;

++extern const SDLPango_Matrix *MATRIX_BLACK_BACK;
+ 

+-const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_BLACK_LETTER

+-    = {0, 0, 0, 0,

+-       0, 0, 0, 0,

+-       0, 0, 0, 0,

+-       0, 255, 0, 0,};

+ /*!

+     Specifies transparent back and black letter.

+ */

+-const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_BLACK_LETTER = &_MATRIX_TRANSPARENT_BACK_BLACK_LETTER;

++extern const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_BLACK_LETTER;
+ 

+-const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_WHITE_LETTER

+-    = {255, 255, 0, 0,

+-       255, 255, 0, 0,

+-       255, 255, 0, 0,

+-       0, 255, 0, 0,};

+ /*!

+     Specifies transparent back and white letter.

+ */

+-const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_WHITE_LETTER = &_MATRIX_TRANSPARENT_BACK_WHITE_LETTER;

++extern const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_WHITE_LETTER;
+ 

+-const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER

+-    = {255, 255, 0, 0,

+-       255, 255, 0, 0,

+-       255, 255, 0, 0,

+-       0, 0, 0, 0,};

+ /*!

+     Specifies transparent back and transparent letter.

+     This is useful for KARAOKE like rendering.

+ */

+-const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER = &_MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER;

++extern const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER;
+ 

+ /*!

+     Specifies direction of text. See Pango reference for detail

+@@ -186,7 +161,8 @@ extern DECLSPEC void SDLCALL SDLPango_SetBaseDirection(
+     SDLPango_Direction direction);

+ 

+ 

+-#ifdef __FT2_BUILD_UNIX_H__

++

++#ifdef __PANGO_H__

+ 

+ extern DECLSPEC void SDLCALL SDLPango_CopyFTBitmapToSurface(

+     const FT_Bitmap *bitmap,

+@@ -194,11 +170,8 @@ extern DECLSPEC void SDLCALL SDLPango_CopyFTBitmapToSurface(
+     const SDLPango_Matrix *matrix,

+     SDL_Rect *rect);

+ 

+-#endif	/* __FT2_BUILD_UNIX_H__ */

+ 

+ 

+-#ifdef __PANGO_H__

+-

+ extern DECLSPEC PangoFontMap* SDLCALL SDLPango_GetPangoFontMap(

+     SDLPango_Context *context);

+ 

diff --git a/nixpkgs/pkgs/development/libraries/accounts-qt/default.nix b/nixpkgs/pkgs/development/libraries/accounts-qt/default.nix
index 0aace12569a5..bae7b56cb8ee 100644
--- a/nixpkgs/pkgs/development/libraries/accounts-qt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/accounts-qt/default.nix
@@ -2,10 +2,10 @@
 
 stdenv.mkDerivation rec {
   pname = "accounts-qt";
-  version = "1.15";
+  version = "1.16";
 
   src = fetchFromGitLab {
-    sha256 = "0cnra7g2mcgzh8ykrj1dpb4khkx676pzdr4ia1bvsp0cli48691w";
+    sha256 = "1vmpjvysm0ld8dqnx8msa15hlhrkny02cqycsh4k2azrnijg0xjz";
     rev = "VERSION_${version}";
     repo = "libaccounts-qt";
     owner = "accounts-sso";
diff --git a/nixpkgs/pkgs/development/libraries/accountsservice/default.nix b/nixpkgs/pkgs/development/libraries/accountsservice/default.nix
index 860ac3fde41f..eb48aca80ee6 100644
--- a/nixpkgs/pkgs/development/libraries/accountsservice/default.nix
+++ b/nixpkgs/pkgs/development/libraries/accountsservice/default.nix
@@ -60,6 +60,8 @@ stdenv.mkDerivation rec {
     })
     ./no-create-dirs.patch
     ./Disable-methods-that-change-files-in-etc.patch
+    # Fixes https://github.com/NixOS/nixpkgs/issues/72396
+    ./drop-prefix-check-extensions.patch
     # Systemd unit improvements. Notably using StateDirectory eliminating the
     # need of an ad-hoc script.
     (fetchpatch {
@@ -70,6 +72,11 @@ stdenv.mkDerivation rec {
       url = "https://gitlab.freedesktop.org/accountsservice/accountsservice/commit/0e712e935abd26499ff5995ab363e5bfd9ee7c4c.patch";
       sha256 = "1y60a5fmgfqjzprwpizilrazqn3mggdlgc5sgcpsprsp62fv78rl";
     })
+    # Don't use etc/dbus-1/system.d
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/accountsservice/accountsservice/commit/ced73d0fcbd2a54085a660d260482fc70d79bd5c.patch";
+      sha256 = "0s7fknfgxl8hnf6givmhfg4586fjb2n64i9arh1w7xnq7x9x8d4c";
+    })
   ];
 
   meta = with stdenv.lib; {
diff --git a/nixpkgs/pkgs/development/libraries/accountsservice/drop-prefix-check-extensions.patch b/nixpkgs/pkgs/development/libraries/accountsservice/drop-prefix-check-extensions.patch
new file mode 100644
index 000000000000..4b5222c9552d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/accountsservice/drop-prefix-check-extensions.patch
@@ -0,0 +1,22 @@
+diff --git a/src/extensions.c b/src/extensions.c
+index 038dcb2..830465d 100644
+--- a/src/extensions.c
++++ b/src/extensions.c
+@@ -121,16 +121,7 @@ daemon_read_extension_directory (GHashTable  *ifaces,
+                         continue;
+                 }
+ 
+-                /* Ensure it looks like "../../dbus-1/interfaces/${name}" */
+-                const gchar * const prefix = "../../dbus-1/interfaces/";
+-                if (g_str_has_prefix (symlink, prefix) && g_str_equal (symlink + strlen (prefix), name)) {
+-                        daemon_read_extension_file (ifaces, filename);
+-                }
+-                else {
+-                        g_warning ("Found accounts service vendor extension symlink %s, but it must be exactly "
+-                                   "equal to '../../dbus-1/interfaces/%s' for forwards-compatibility reasons.",
+-                                   filename, name);
+-                }
++                daemon_read_extension_file (ifaces, filename);
+         }
+ 
+         g_dir_close (dir);
diff --git a/nixpkgs/pkgs/development/libraries/ace/default.nix b/nixpkgs/pkgs/development/libraries/ace/default.nix
index 04ab13314755..ea352772b33a 100644
--- a/nixpkgs/pkgs/development/libraries/ace/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/agda/Agda-Sheaves/default.nix b/nixpkgs/pkgs/development/libraries/agda/Agda-Sheaves/default.nix
index 6ab7455915cc..62856157b4b6 100644
--- a/nixpkgs/pkgs/development/libraries/agda/Agda-Sheaves/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/agda/TotalParserCombinators/default.nix b/nixpkgs/pkgs/development/libraries/agda/TotalParserCombinators/default.nix
index ac9ce9dd84f4..344da00d04f2 100644
--- a/nixpkgs/pkgs/development/libraries/agda/TotalParserCombinators/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/agda/agda-base/default.nix b/nixpkgs/pkgs/development/libraries/agda/agda-base/default.nix
index 146e44182ed2..1bc9d0cb882e 100644
--- a/nixpkgs/pkgs/development/libraries/agda/agda-base/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/agda/agda-iowa-stdlib/default.nix b/nixpkgs/pkgs/development/libraries/agda/agda-iowa-stdlib/default.nix
index e2d64841985c..30a03980e44d 100644
--- a/nixpkgs/pkgs/development/libraries/agda/agda-iowa-stdlib/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/agda/agda-prelude/default.nix b/nixpkgs/pkgs/development/libraries/agda/agda-prelude/default.nix
index a57ee6e08bae..bcdad18bedec 100644
--- a/nixpkgs/pkgs/development/libraries/agda/agda-prelude/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/agda/agda-stdlib/default.nix b/nixpkgs/pkgs/development/libraries/agda/agda-stdlib/default.nix
index 4d071251ee8e..033ba67f661b 100644
--- a/nixpkgs/pkgs/development/libraries/agda/agda-stdlib/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/agda/bitvector/default.nix b/nixpkgs/pkgs/development/libraries/agda/bitvector/default.nix
index 6306bb89b5c7..c09702c48d78 100644
--- a/nixpkgs/pkgs/development/libraries/agda/bitvector/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/agda/categories/default.nix b/nixpkgs/pkgs/development/libraries/agda/categories/default.nix
index ea232f2853d6..a58afd7e8667 100644
--- a/nixpkgs/pkgs/development/libraries/agda/categories/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/agda/pretty/default.nix b/nixpkgs/pkgs/development/libraries/agda/pretty/default.nix
index 0e4f1da6e140..ffae1f6f900c 100644
--- a/nixpkgs/pkgs/development/libraries/agda/pretty/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/alembic/default.nix b/nixpkgs/pkgs/development/libraries/alembic/default.nix
index 263acfed63a0..0c3ba0abaa9a 100644
--- a/nixpkgs/pkgs/development/libraries/alembic/default.nix
+++ b/nixpkgs/pkgs/development/libraries/alembic/default.nix
@@ -3,13 +3,13 @@
 stdenv.mkDerivation rec
 {
   pname = "alembic";
-  version = "1.7.11";
+  version = "1.7.12";
 
   src = fetchFromGitHub {
     owner = "alembic";
     repo = "alembic";
     rev = version;
-    sha256 = "1lalbqn4cwf0vp4hiq72gwpd7kq501j21rnjb380mv26pk7r2ivz";
+    sha256 = "0a9icrv6pwh2b73lywq1aj7i19pmzpg59iy3ngal8vq4zdciylqc";
   };
 
   outputs = [ "bin" "dev" "out" "lib" ];
diff --git a/nixpkgs/pkgs/development/libraries/alkimia/default.nix b/nixpkgs/pkgs/development/libraries/alkimia/default.nix
index 407aa557ea2e..d7d8c268928f 100644
--- a/nixpkgs/pkgs/development/libraries/alkimia/default.nix
+++ b/nixpkgs/pkgs/development/libraries/alkimia/default.nix
@@ -5,11 +5,11 @@
 
 mkDerivation rec {
   pname = "alkimia";
-  version = "8.0.1";
+  version = "8.0.2";
 
   src = fetchurl {
     url = "mirror://kde/stable/alkimia/${version}/${pname}-${version}.tar.xz";
-    sha256 = "059i6vn36sdq5zn2vqzh4asvvgdgs7n478nk9phvb5gdys01fq7m";
+    sha256 = "0al5k9irmg9gsjc234qxjsqfzgzsavl18pspqk78mkp8zlv7fvv1";
   };
 
   nativeBuildInputs = [ extra-cmake-modules doxygen graphviz ];
diff --git a/nixpkgs/pkgs/development/libraries/allegro/5.nix b/nixpkgs/pkgs/development/libraries/allegro/5.nix
index b267c62d6c70..5f5368f2866d 100644
--- a/nixpkgs/pkgs/development/libraries/allegro/5.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/allegro/default.nix b/nixpkgs/pkgs/development/libraries/allegro/default.nix
index 6b44ec1b598a..64488b25b094 100644
--- a/nixpkgs/pkgs/development/libraries/allegro/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/amtk/default.nix b/nixpkgs/pkgs/development/libraries/amtk/default.nix
index e8ecd0c0f1ef..177bf324b7af 100644
--- a/nixpkgs/pkgs/development/libraries/amtk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/amtk/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, gtk3
 , pkgconfig, gnome3, dbus, xvfb_run }:
 let
-  version = "5.0.0";
+  version = "5.0.1";
   pname = "amtk";
 in stdenv.mkDerivation {
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1zriix7bdwcg0868mfc7jy6zbwjwdmjwbh0ah6dbddrhiabrda8j";
+    sha256 = "09yy95w1s83c43mh9vha1jbb780yighf5pd2j0ygjmc68sjg871d";
   };
 
   nativeBuildInputs = [
diff --git a/nixpkgs/pkgs/development/libraries/apr/default.nix b/nixpkgs/pkgs/development/libraries/apr/default.nix
index ea84609868cf..2ce4b77927f1 100644
--- a/nixpkgs/pkgs/development/libraries/apr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/apr/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "apr-1.6.5";
+  name = "apr-1.7.0";
 
   src = fetchurl {
     url = "mirror://apache/apr/${name}.tar.bz2";
-    sha256 = "01d1n1ql66bxsjx0wyzazmkqdqdmr0is6a7lwyy5kzy4z7yajz56";
+    sha256 = "1spp6r2a3xcl5yajm9safhzyilsdzgagc2dadif8x6z9nbq4iqg2";
   };
 
   patches = stdenv.lib.optionals stdenv.isDarwin [ ./is-this-a-compiler-bug.patch ];
@@ -23,10 +23,18 @@ stdenv.mkDerivation rec {
       configureFlagsArray+=("--with-installbuilddir=$dev/share/build")
     '';
 
-  configureFlags =
+  configureFlags = stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "ac_cv_file__dev_zero=yes"
+    "ac_cv_func_setpgrp_void=0"
+    "apr_cv_process_shared_works=1"
+    "apr_cv_tcp_nodelay_with_cork=1"
+  ] ++ stdenv.lib.optionals (stdenv.hostPlatform.system == "i686-cygwin") [
     # Including the Windows headers breaks unistd.h.
     # Based on ftp://sourceware.org/pub/cygwin/release/libapr1/libapr1-1.3.8-2-src.tar.bz2
-    stdenv.lib.optional (stdenv.hostPlatform.system == "i686-cygwin") "ac_cv_header_windows_h=no";
+    "ac_cv_header_windows_h=no"
+  ];
+
+  CPPFLAGS=stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-DAPR_IOVEC_DEFINED";
 
   enableParallelBuilding = true;
 
diff --git a/nixpkgs/pkgs/development/libraries/aqbanking/libchipcard.nix b/nixpkgs/pkgs/development/libraries/aqbanking/libchipcard.nix
index 23c300ab48a3..32ec4dd06fd6 100644
--- a/nixpkgs/pkgs/development/libraries/aqbanking/libchipcard.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/aravis/default.nix b/nixpkgs/pkgs/development/libraries/aravis/default.nix
index 9d506b10e353..eaeddbcad368 100644
--- a/nixpkgs/pkgs/development/libraries/aravis/default.nix
+++ b/nixpkgs/pkgs/development/libraries/aravis/default.nix
@@ -33,13 +33,13 @@ in
   stdenv.mkDerivation rec {
 
     pname = "aravis";
-    version = "0.6.3";
+    version = "0.6.4";
 
     src = fetchFromGitHub {
       owner = "AravisProject";
       repo = pname;
       rev= "ARAVIS_${builtins.replaceStrings ["."] ["_"] version}";
-      sha256 = "0lmgx854z522dwcxsg37bxdyiai9fnycpx1nvgayksj38h39kfn2";
+      sha256 = "18fnliks661kzc3g8v08hcaj18hjid8b180d6s9gwn0zgv4g374w";
     };
 
     outputs = [ "bin" "dev" "out" "lib" ];
diff --git a/nixpkgs/pkgs/development/libraries/arb/default.nix b/nixpkgs/pkgs/development/libraries/arb/default.nix
index 0e24d556b1a5..6393e25f561d 100644
--- a/nixpkgs/pkgs/development/libraries/arb/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/argp-standalone/default.nix b/nixpkgs/pkgs/development/libraries/argp-standalone/default.nix
index 17093deae00f..6544c4811875 100644
--- a/nixpkgs/pkgs/development/libraries/argp-standalone/default.nix
+++ b/nixpkgs/pkgs/development/libraries/argp-standalone/default.nix
@@ -31,7 +31,7 @@ stdenv.mkDerivation {
        stdenv.lib.optionals stdenv.hostPlatform.isDarwin [ patch-argp-fmtstream ]
     ++ stdenv.lib.optionals stdenv.hostPlatform.isLinux [ patch-throw-in-funcdef patch-shared ];
 
-  patchFlags = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin "-p0";
+  patchFlags = stdenv.lib.optional stdenv.hostPlatform.isDarwin "-p0";
 
   preConfigure = stdenv.lib.optionalString stdenv.hostPlatform.isLinux "export CFLAGS='-fgnu89-inline'";
 
@@ -43,6 +43,8 @@ stdenv.mkDerivation {
 
   doCheck = true;
 
+  makeFlags = [ "AR:=$(AR)" ];
+
   enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
diff --git a/nixpkgs/pkgs/development/libraries/armadillo/default.nix b/nixpkgs/pkgs/development/libraries/armadillo/default.nix
index 127c2f3ae311..8dec98271413 100644
--- a/nixpkgs/pkgs/development/libraries/armadillo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/armadillo/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "armadillo";
-  version = "9.600.6";
+  version = "9.800.3";
 
   src = fetchurl {
     url = "mirror://sourceforge/arma/armadillo-${version}.tar.xz";
-    sha256 = "0wlk1yv9531vpvgja4cpy0sxykrn0p5w376kx86vl45b50yamx7g";
+    sha256 = "16bm1pa5a8wsk497y9s18dyi3hax03z6g2x2z19b6z0bi3ff30d4";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/development/libraries/arrayfire/default.nix b/nixpkgs/pkgs/development/libraries/arrayfire/default.nix
new file mode 100644
index 000000000000..21e93a8cd492
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/arrayfire/default.nix
@@ -0,0 +1,70 @@
+{ stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig
+, cudatoolkit, opencl-clhpp, ocl-icd, fftw, fftwFloat, mkl
+, blas, openblas, boost, mesa, libGLU, libGL
+, freeimage, python, clfft, clblas
+, doxygen, buildDocs ? false
+}:
+
+let
+  strOnLinux = stdenv.lib.optionalString stdenv.isLinux;
+
+in stdenv.mkDerivation rec {
+  pname = "arrayfire";
+  version = "3.6.4";
+
+  src = fetchurl {
+    url = "http://arrayfire.com/arrayfire_source/arrayfire-full-${version}.tar.bz2";
+    sha256 = "1fin7a9rliyqic3z83agkpb8zlq663q6gdxsnm156cs8s7f7rc9h";
+  };
+
+  cmakeFlags = [
+    "-DAF_BUILD_OPENCL=OFF"
+    "-DAF_BUILD_EXAMPLES=OFF"
+    "-DBUILD_TESTING=OFF"
+    (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 ${clfft.src}/ ./build/third_party/clFFT/src/clFFT-ext/
+    mkdir -p ./build/third_party/clBLAS/src
+    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 ${opencl-clhpp}/include/CL/cl2.hpp ./build/include/CL/cl2.hpp
+  '';
+
+  preBuild = strOnLinux ''
+    export CUDA_PATH="${cudatoolkit}"
+  '';
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [
+    cmake
+    pkgconfig
+    python
+  ];
+
+  buildInputs = [
+    opencl-clhpp fftw fftwFloat
+    mkl
+    openblas
+    libGLU libGL
+    mesa freeimage
+    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 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/";
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ chessai ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/arrayfire/no-download.patch b/nixpkgs/pkgs/development/libraries/arrayfire/no-download.patch
new file mode 100644
index 000000000000..2b3ac492a54d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/arrayfire/no-download.patch
@@ -0,0 +1,28 @@
+diff --git a/CMakeModules/build_clBLAS.cmake b/CMakeModules/build_clBLAS.cmake
+index 8de529e8..6361b613 100644
+--- a/CMakeModules/build_clBLAS.cmake
++++ b/CMakeModules/build_clBLAS.cmake
+@@ -14,8 +14,7 @@ find_package(OpenCL)
+ 
+ ExternalProject_Add(
+     clBLAS-ext
+-    GIT_REPOSITORY https://github.com/arrayfire/clBLAS.git
+-    GIT_TAG arrayfire-release
++    DOWNLOAD_COMMAND true
+     BUILD_BYPRODUCTS ${clBLAS_location}
+     PREFIX "${prefix}"
+     INSTALL_DIR "${prefix}"
+diff --git a/CMakeModules/build_clFFT.cmake b/CMakeModules/build_clFFT.cmake
+index 28be38a3..85e3915e 100644
+--- a/CMakeModules/build_clFFT.cmake
++++ b/CMakeModules/build_clFFT.cmake
+@@ -20,8 +20,7 @@ ENDIF()
+ 
+ ExternalProject_Add(
+     clFFT-ext
+-    GIT_REPOSITORY https://github.com/arrayfire/clFFT.git
+-    GIT_TAG arrayfire-release
++    DOWNLOAD_COMMAND true
+     PREFIX "${prefix}"
+     INSTALL_DIR "${prefix}"
+     UPDATE_COMMAND ""
diff --git a/nixpkgs/pkgs/development/libraries/arrow-cpp/default.nix b/nixpkgs/pkgs/development/libraries/arrow-cpp/default.nix
index f763f98799d0..87684a4bbe4a 100644
--- a/nixpkgs/pkgs/development/libraries/arrow-cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/arrow-cpp/default.nix
@@ -1,4 +1,7 @@
-{ stdenv, fetchurl, fetchFromGitHub, fixDarwinDylibNames, autoconf, boost, brotli, cmake, double-conversion, flatbuffers, gflags, glog, gtest, lz4, perl, python, rapidjson, snappy, thrift, uriparser, which, zlib, zstd }:
+{ stdenv, lib, fetchurl, fetchFromGitHub, fixDarwinDylibNames, autoconf, boost
+, brotli, cmake, double-conversion, flatbuffers, gflags, glog, gtest, lz4, perl
+, python, rapidjson, snappy, thrift, uriparser, which, zlib, zstd
+, enableShared ? true }:
 
 let
   parquet-testing = fetchFromGitHub {
@@ -7,15 +10,15 @@ let
     rev = "a277dc4e55ded3e3ea27dab1e4faf98c112442df";
     sha256 = "1yh5a8l4ship36hwmgmp2kl72s5ac9r8ly1qcs650xv2g9q7yhnq";
   };
-in
 
-stdenv.mkDerivation rec {
+in stdenv.mkDerivation rec {
   pname = "arrow-cpp";
-  version = "0.14.1";
+  version = "0.15.1";
 
   src = fetchurl {
-    url = "mirror://apache/arrow/arrow-${version}/apache-arrow-${version}.tar.gz";
-    sha256 = "0a0xrsbr7dd1yp34yw82jw7psfkfvm935jhd5mam32vrsjvdsj4r";
+    url =
+      "mirror://apache/arrow/arrow-${version}/apache-arrow-${version}.tar.gz";
+    sha256 = "1jbghpppabsix2rkxbnh41inj9lcxfz4q94p96xzxshh4g3mhb4s";
   };
 
   sourceRoot = "apache-arrow-${version}/cpp";
@@ -24,57 +27,89 @@ stdenv.mkDerivation rec {
     # From
     # ./cpp/cmake_modules/ThirdpartyToolchain.cmake
     # ./cpp/thirdparty/versions.txt
-    url = "https://github.com/jemalloc/jemalloc/releases/download/5.2.0/jemalloc-5.2.0.tar.bz2";
+    url =
+      "https://github.com/jemalloc/jemalloc/releases/download/5.2.0/jemalloc-5.2.0.tar.bz2";
     sha256 = "1d73a5c5qdrwck0fa5pxz0myizaf3s9alsvhiqwrjahdlr29zgkl";
   };
 
   patches = [
     # patch to fix python-test
     ./darwin.patch
-    ];
+  ] ++ lib.optionals (!enableShared) [
+    # The shared jemalloc lib is unused and breaks in static mode due to missing -fpic.
+    ./jemalloc-disable-shared.patch
+  ];
 
-  nativeBuildInputs = [ cmake autoconf /* for vendored jemalloc */ ]
-    ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
+  nativeBuildInputs = [
+    cmake
+    autoconf # for vendored jemalloc
+    flatbuffers
+  ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
   buildInputs = [
-    boost brotli double-conversion flatbuffers gflags glog gtest lz4 rapidjson
-    snappy thrift uriparser zlib zstd python.pkgs.python python.pkgs.numpy
+    boost
+    brotli
+    double-conversion
+    flatbuffers
+    gflags
+    glog
+    gtest
+    lz4
+    rapidjson
+    snappy
+    thrift
+    uriparser
+    zlib
+    zstd
+    python.pkgs.python
+    python.pkgs.numpy
   ];
 
   preConfigure = ''
     substituteInPlace cmake_modules/FindLz4.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
 
     patchShebangs build-support/
-
-    # Fix build for ARROW_USE_SIMD=OFF
-    # https://jira.apache.org/jira/browse/ARROW-5007
-    sed -i src/arrow/util/sse-util.h -e '1i#include "arrow/util/logging.h"'
-    sed -i src/arrow/util/neon-util.h -e '1i#include "arrow/util/logging.h"'
   '';
 
   cmakeFlags = [
     "-DARROW_BUILD_TESTS=ON"
     "-DARROW_DEPENDENCY_SOURCE=SYSTEM"
     "-DARROW_PARQUET=ON"
-    "-DARROW_PYTHON=ON"
+    "-DARROW_PLASMA=ON"
+    # Disable Python for static mode because openblas is currently broken there.
+    "-DARROW_PYTHON=${if enableShared then "ON" else "OFF"}"
     "-Duriparser_SOURCE=SYSTEM"
-  ] ++ stdenv.lib.optional (!stdenv.isx86_64) "-DARROW_USE_SIMD=OFF";
+  ] ++ lib.optionals (!enableShared) [
+    "-DARROW_BUILD_SHARED=OFF"
+    "-DARROW_TEST_LINKAGE=static"
+    "-DOPENSSL_USE_STATIC_LIBS=ON"
+  ] ++ lib.optional (!stdenv.isx86_64) "-DARROW_USE_SIMD=OFF";
 
   doInstallCheck = true;
-  PARQUET_TEST_DATA = if doInstallCheck then "${parquet-testing}/data" else null;
+  PARQUET_TEST_DATA =
+    if doInstallCheck then "${parquet-testing}/data" else null;
   installCheckInputs = [ perl which ];
-  installCheckPhase = (stdenv.lib.optionalString stdenv.isDarwin ''
-    for f in release/*test; do
+  installCheckPhase = (lib.optionalString stdenv.isDarwin ''
+    for f in release/*test{,s}; do
       install_name_tool -add_rpath "$out"/lib  "$f"
     done
-  '') + ''
-    ctest -L unittest -V
-  '';
+  '')
+  + (let
+    excludedTests = lib.optionals stdenv.isDarwin [
+      # Some plasma tests need to be patched to use a shorter AF_UNIX socket
+      # path on Darwin. See https://github.com/NixOS/nix/pull/1085
+      "plasma-external-store-tests"
+      "plasma-client-tests"
+    ];
+  in ''
+    ctest -L unittest -V \
+      --exclude-regex '^(${builtins.concatStringsSep "|" excludedTests})$'
+  '');
 
   meta = {
     description = "A  cross-language development platform for in-memory data";
-    homepage = https://arrow.apache.org/;
-    license = stdenv.lib.licenses.asl20;
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ veprbl ];
+    homepage = "https://arrow.apache.org/";
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ tobim veprbl ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/arrow-cpp/jemalloc-disable-shared.patch b/nixpkgs/pkgs/development/libraries/arrow-cpp/jemalloc-disable-shared.patch
new file mode 100644
index 000000000000..0f7955724e16
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/arrow-cpp/jemalloc-disable-shared.patch
@@ -0,0 +1,11 @@
+diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake
+--- a/cmake_modules/ThirdpartyToolchain.cmake
++++ b/cmake_modules/ThirdpartyToolchain.cmake
+@@ -1428,6 +1428,7 @@ if(ARROW_JEMALLOC)
+                       "--with-jemalloc-prefix=je_arrow_"
+                       "--with-private-namespace=je_arrow_private_"
+                       "--without-export"
++                      "--disable-shared"
+                       # Don't override operator new()
+                       "--disable-cxx" "--disable-libdl"
+                       # See https://github.com/jemalloc/jemalloc/issues/1237
diff --git a/nixpkgs/pkgs/development/libraries/aspell/default.nix b/nixpkgs/pkgs/development/libraries/aspell/default.nix
index 5c3c6272f83d..ad0f910dcbf6 100644
--- a/nixpkgs/pkgs/development/libraries/aspell/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/aspell/dictionaries.nix b/nixpkgs/pkgs/development/libraries/aspell/dictionaries.nix
index fa9a45f1ed3c..05a1c95c81f0 100644
--- a/nixpkgs/pkgs/development/libraries/aspell/dictionaries.nix
+++ b/nixpkgs/pkgs/development/libraries/aspell/dictionaries.nix
@@ -298,10 +298,10 @@ in rec {
 
   en = buildOfficialDict {
     language = "en";
-    version = "2018.04.16-0";
+    version = "2019.10.06-0";
     fullName = "English";
     filename = "aspell6";
-    sha256 = "0bxxdzkk9g27plg22y9qzsx9cfjw3aa29w5bmzs561qc9gkp247i";
+    sha256 = "1zai9wrqwgb9z9vfgb22qhrvxvg73jg0ix44j1khm2f6m96lncr4";
   };
 
   eo = buildOfficialDict {
@@ -919,12 +919,12 @@ in rec {
 
     src1 = fetchurl {
       url = http://jpetrie.net/wp-content/uploads/custom_scientific_US.txt;
-      sha256 = "1psqm094zl4prk2f8h18jv0d471hxykzd1zdnrlx7gzrzy6pz5r3";
+      sha256 = "1nf4py2mg0mlv9s5a7had2wn29z2v6bcca0fs6rbpdn4nqc4s7dm";
     };
 
     src2 = fetchurl {
       url = http://jpetrie.net/wp-content/uploads/custom_scientific_UK.txt;
-      sha256 = "17ss1sdr3k70zbyx2z9xf74345slrp41gbkpih8axrmg4x92fgm1";
+      sha256 = "0f88il1ds6qazy1ghxviqcwsywrbf6pzl2lmzf4f3qvhdfb6f1y0";
     };
 
     langInputs = [ en ];
diff --git a/nixpkgs/pkgs/development/libraries/assimp/default.nix b/nixpkgs/pkgs/development/libraries/assimp/default.nix
index d5a98b0ce92e..b9207e517069 100644
--- a/nixpkgs/pkgs/development/libraries/assimp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/assimp/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "assimp";
-  version = "4.1.0";
+  version = "5.0.0";
 
   src = fetchFromGitHub{
     owner = "assimp";
     repo = "assimp";
     rev = "v${version}";
-    sha256 = "00g61g3ixmfszzjncpvm8x7gp2livaj4lmhbycjmrw4x3gfqlc4r";
+    sha256 = "17y5q5hbygmb0cgf96gd3v8sal5g69cp8hmh1cs3yz7v00kjysmz";
   };
 
   buildInputs = [ cmake boost zlib ];
diff --git a/nixpkgs/pkgs/development/libraries/at-spi2-atk/default.nix b/nixpkgs/pkgs/development/libraries/at-spi2-atk/default.nix
index a805949bf119..f63a341e26ea 100644
--- a/nixpkgs/pkgs/development/libraries/at-spi2-atk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/at-spi2-atk/default.nix
@@ -10,23 +10,20 @@
 , dbus
 , glib
 , libxml2
-, fixDarwinDylibNames
 
 , gnome3 # To pass updateScript
 }:
 
 stdenv.mkDerivation rec {
   pname = "at-spi2-atk";
-  version = "2.32.0";
+  version = "2.34.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0p54wx6f6q7s8w0b1j0sgw87pikllp79q5g3lfiwqazs779ycl8b";
+    sha256 = "05ncp7s5nddjinffs26mcvpbd63vk1m3cv5y530p3plgfhqgjvbp";
   };
 
-  nativeBuildInputs = [ meson ninja pkgconfig ]
-    # Fixup rpaths because of meson, remove with meson-0.47
-    ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
+  nativeBuildInputs = [ meson ninja pkgconfig ];
   buildInputs = [ at-spi2-core atk dbus glib libxml2 ];
 
   doCheck = false; # fails with "No test data file provided"
@@ -40,7 +37,7 @@ stdenv.mkDerivation rec {
   meta = with stdenv.lib; {
     description = "D-Bus bridge for Assistive Technology Service Provider Interface (AT-SPI) and Accessibility Toolkit (ATK)";
     homepage = https://gitlab.gnome.org/GNOME/at-spi2-atk;
-    license = licenses.lgpl2Plus; # NOTE: 2018-06-06: Please check the license when upstream sorts-out licensing: https://gitlab.gnome.org/GNOME/at-spi2-atk/issues/2
+    license = licenses.lgpl21Plus;
     maintainers = gnome3.maintainers;
     platforms = platforms.unix;
   };
diff --git a/nixpkgs/pkgs/development/libraries/at-spi2-core/default.nix b/nixpkgs/pkgs/development/libraries/at-spi2-core/default.nix
index e7cea235ceb4..84a8a6b90265 100644
--- a/nixpkgs/pkgs/development/libraries/at-spi2-core/default.nix
+++ b/nixpkgs/pkgs/development/libraries/at-spi2-core/default.nix
@@ -10,28 +10,26 @@
 
 , 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
-, fixDarwinDylibNames
 
 , gnome3 # To pass updateScript
 }:
 
 stdenv.mkDerivation rec {
   pname = "at-spi2-core";
-  version = "2.32.1";
+  version = "2.34.0";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0lqd7gsl471v6538iighkvb21gjglcb9pklvas32rjpsxcvsjaiw";
+    sha256 = "1ihixwhh3c16q6253qj9gf69741rb2pi51822a4rylsfcyywsafn";
   };
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ meson ninja pkgconfig gobject-introspection makeWrapper ]
-    # Fixup rpaths because of meson, remove with meson-0.47
-    ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
+  nativeBuildInputs = [ meson ninja pkgconfig gobject-introspection makeWrapper ];
   buildInputs = [ dbus glib libX11 libXtst libXi ];
 
   doCheck = false; # fails with "AT-SPI: Couldn't connect to accessibility bus. Is at-spi-bus-launcher running?"
@@ -51,14 +49,14 @@ 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}
   '';
 
   meta = with stdenv.lib; {
     description = "Assistive Technology Service Provider Interface protocol definitions and daemon for D-Bus";
     homepage = https://gitlab.gnome.org/GNOME/at-spi2-core;
-    license = licenses.lgpl2Plus; # NOTE: 2018-06-06: Please check the license when upstream sorts-out licensing: https://gitlab.gnome.org/GNOME/at-spi2-core/issues/2
+    license = licenses.lgpl21Plus;
     maintainers = gnome3.maintainers;
     platforms = platforms.unix;
   };
diff --git a/nixpkgs/pkgs/development/libraries/atk/default.nix b/nixpkgs/pkgs/development/libraries/atk/default.nix
index 0a076442b42c..9e80d4fc6ca6 100644
--- a/nixpkgs/pkgs/development/libraries/atk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/atk/default.nix
@@ -4,7 +4,7 @@
 
 let
   pname = "atk";
-  version = "2.32.0";
+  version = "2.34.1";
 in
 
 stdenv.mkDerivation rec {
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
-    sha256 = "1k4i817bd2w5b9z394f2yyx95591l2746wa40am0vvz4gzdgwhfb";
+    sha256 = "1jwp16r6p5z66k4b2v8zlzhyshhwlmyi27ippkrgqr8jsary7w6l";
   };
 
   outputs = [ "out" "dev" ];
@@ -26,6 +26,12 @@ stdenv.mkDerivation rec {
     glib
   ];
 
+  patches = [
+    # meson builds an incorrect .pc file
+    # glib should be Requires not Requires.private
+    ./fix_pc.patch
+  ];
+
   doCheck = true;
 
   passthru = {
diff --git a/nixpkgs/pkgs/development/libraries/atk/fix_pc.patch b/nixpkgs/pkgs/development/libraries/atk/fix_pc.patch
new file mode 100644
index 000000000000..3d19d9862cbd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/atk/fix_pc.patch
@@ -0,0 +1,9 @@
+--- a/atk/meson.build
++++ b/atk/meson.build
+@@ -162,5 +162,6 @@ pkgconfig.generate(libatk,
+   name: 'Atk',
+   description: 'Accessibility Toolkit',
+   subdirs: atk_api_name,
++  requires: glib_dep,
+   filebase: 'atk',
+ )
diff --git a/nixpkgs/pkgs/development/libraries/audio/libmysofa/default.nix b/nixpkgs/pkgs/development/libraries/audio/libmysofa/default.nix
index 0e0f0c5d425d..c541159a96eb 100644
--- a/nixpkgs/pkgs/development/libraries/audio/libmysofa/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/libmysofa/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libmysofa";
-  version = "0.7";
+  version = "0.9";
 
   src = fetchFromGitHub {
     owner = "hoene";
     repo = "libmysofa";
     rev = "v${version}";
-    sha256 = "0si0z7cfw6xcs3dkrb4zini55xpxwfp27yl8lbx39gx2pf8v2jls";
+    sha256 = "14k8c31xh0v4r34h89ld440j9zri4plblmlhj5ddhdmzqmh4lr9f";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/development/libraries/audio/lilv/default.nix b/nixpkgs/pkgs/development/libraries/audio/lilv/default.nix
index 04752fd29519..8d429987ad8d 100644
--- a/nixpkgs/pkgs/development/libraries/audio/lilv/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/lilv/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, lv2, pkgconfig, python, serd, sord, sratom, wafHook }:
+{ stdenv, fetchurl, lv2, pkgconfig, python3, serd, sord, sratom, wafHook }:
 
 stdenv.mkDerivation rec {
   pname = "lilv";
@@ -9,8 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "0f24cd7wkk5l969857g2ydz2kjjrkvvddg1g87xzzs78lsvq8fy3";
   };
 
-  nativeBuildInputs = [ pkgconfig wafHook ];
-  buildInputs = [ lv2 python serd sord sratom ];
+  nativeBuildInputs = [ pkgconfig python3 wafHook ];
+  buildInputs = [ lv2 serd sord sratom ];
 
   meta = with stdenv.lib; {
     homepage = http://drobilla.net/software/lilv;
diff --git a/nixpkgs/pkgs/development/libraries/audio/lv2/default.nix b/nixpkgs/pkgs/development/libraries/audio/lv2/default.nix
index 50593cab6476..ad450b53d12f 100644
--- a/nixpkgs/pkgs/development/libraries/audio/lv2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/lv2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gtk2, libsndfile, pkgconfig, python, wafHook }:
+{ stdenv, fetchurl, gtk2, libsndfile, pkgconfig, python3, wafHook }:
 
 stdenv.mkDerivation rec {
   pname = "lv2";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ pkgconfig wafHook ];
-  buildInputs = [ gtk2 libsndfile python ];
+  buildInputs = [ gtk2 libsndfile python3 ];
 
   meta = with stdenv.lib; {
     homepage = http://lv2plug.in;
diff --git a/nixpkgs/pkgs/development/libraries/audio/sratom/default.nix b/nixpkgs/pkgs/development/libraries/audio/sratom/default.nix
index 21d6cdfb5d4d..d7353af0d3d3 100644
--- a/nixpkgs/pkgs/development/libraries/audio/sratom/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/sratom/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, lv2, pkgconfig, python, serd, sord, wafHook }:
+{ stdenv, fetchurl, lv2, pkgconfig, python3, serd, sord, wafHook }:
 
 stdenv.mkDerivation rec {
   pname = "sratom";
@@ -9,8 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "0lz883ravxjf7r9wwbx2gx9m8vhyiavxrl9jdxfppjxnsralll8a";
   };
 
-  nativeBuildInputs = [ pkgconfig wafHook ];
-  buildInputs = [ lv2 python serd sord ];
+  nativeBuildInputs = [ pkgconfig wafHook python3 ];
+  buildInputs = [ lv2 serd sord ];
 
   meta = with stdenv.lib; {
     homepage = http://drobilla.net/software/sratom;
diff --git a/nixpkgs/pkgs/development/libraries/audiofile/default.nix b/nixpkgs/pkgs/development/libraries/audiofile/default.nix
index 1ed457aa5fe1..680b585643b7 100644
--- a/nixpkgs/pkgs/development/libraries/audiofile/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audiofile/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, alsaLib, AudioUnit, CoreServices }:
+{ stdenv, lib, fetchurl, fetchpatch, alsaLib, AudioUnit, CoreServices }:
 
 let
 
@@ -25,6 +25,9 @@ stdenv.mkDerivation rec {
     sha256 = "0rb927zknk9kmhprd8rdr4azql4gn2dp75a36iazx2xhkbqhvind";
   };
 
+  # fix build with gcc9
+  NIX_CFLAGS_LINK = lib.optional (stdenv.system == "i686-linux") "-lgcc";
+
   patches = [
     ./gcc-6.patch
     ./CVE-2015-7747.patch
diff --git a/nixpkgs/pkgs/development/libraries/avahi/default.nix b/nixpkgs/pkgs/development/libraries/avahi/default.nix
index ee451818831c..babfd6849a84 100644
--- a/nixpkgs/pkgs/development/libraries/avahi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/avahi/default.nix
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
 
   configureFlags =
     [ "--disable-qt3" "--disable-gdbm" "--disable-mono"
-      "--disable-gtk"
+      "--disable-gtk" "--with-dbus-sys=${placeholder "out"}/share/dbus-1/system.d"
       (stdenv.lib.enableFeature gtk3Support "gtk3")
       "--${if qt4Support then "enable" else "disable"}-qt4"
       (stdenv.lib.enableFeature withPython "python")
diff --git a/nixpkgs/pkgs/development/libraries/avro-c/default.nix b/nixpkgs/pkgs/development/libraries/avro-c/default.nix
index f66d9369c20a..5d7dedd0e071 100644
--- a/nixpkgs/pkgs/development/libraries/avro-c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/avro-c/default.nix
@@ -1,14 +1,14 @@
 { stdenv, cmake, fetchurl, pkgconfig, jansson, zlib }:
 
 let
-  version = "1.9.0";
+  version = "1.9.1";
 in stdenv.mkDerivation {
   pname = "avro-c";
   inherit version;
 
   src = fetchurl {
     url = "mirror://apache/avro/avro-${version}/c/avro-c-${version}.tar.gz";
-    sha256 = "1ch8z9jpkjxjx2zh28z0946gz3vwj1jnkrzg4vwvfa287128cml0";
+    sha256 = "0hj6w1w5mqkhnhkvjc0zz5njnnrbcjv5ml4f8gq80wff2cgbrxvx";
   };
 
   postPatch = ''
diff --git a/nixpkgs/pkgs/development/libraries/aws-c-common/default.nix b/nixpkgs/pkgs/development/libraries/aws-c-common/default.nix
index 4286eedc87b2..b10797d3d56f 100644
--- a/nixpkgs/pkgs/development/libraries/aws-c-common/default.nix
+++ b/nixpkgs/pkgs/development/libraries/aws-c-common/default.nix
@@ -13,10 +13,8 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [
-    "-Wno-nullability-extension"
-    "-Wno-typedef-redefinition"
-  ];
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin
+    "-Wno-nullability-extension -Wno-typedef-redefinition";
 
   meta = with lib; {
     description = "AWS SDK for C common core";
diff --git a/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/default.nix b/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/default.nix
index 6bfb80d3a174..8024f3109513 100644
--- a/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/default.nix
@@ -21,7 +21,6 @@ stdenv.mkDerivation rec {
   # FIXME: might be nice to put different APIs in different outputs
   # (e.g. libaws-cpp-sdk-s3.so in output "s3").
   outputs = [ "out" "dev" ];
-  separateDebugInfo = stdenv.isLinux;
 
   nativeBuildInputs = [ cmake curl ];
 
@@ -43,6 +42,9 @@ stdenv.mkDerivation rec {
   ] ++ lib.optional (apis != ["*"])
     "-DBUILD_ONLY=${lib.concatStringsSep ";" apis}";
 
+  # fix build with gcc9, can be removed after bumping to current version
+  NIX_CFLAGS_COMPILE = [ "-Wno-error" ];
+
   preConfigure =
     ''
       rm aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp
diff --git a/nixpkgs/pkgs/development/libraries/bamf/default.nix b/nixpkgs/pkgs/development/libraries/bamf/default.nix
index b1fb17b08fa9..60322f530166 100644
--- a/nixpkgs/pkgs/development/libraries/bamf/default.nix
+++ b/nixpkgs/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
@@ -66,8 +87,8 @@ stdenv.mkDerivation rec {
   # TODO: Requires /etc/machine-id
   doCheck = false;
 
-  # ignore deprecation errors
-  NIX_CFLAGS_COMPILE = "-Wno-deprecated-declarations";
+  # glib-2.62 deprecations
+  NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS";
 
   meta = with stdenv.lib; {
     description = "Application matching framework";
@@ -78,6 +99,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/nixpkgs/pkgs/development/libraries/bamf/gtester2xunit-python3.patch b/nixpkgs/pkgs/development/libraries/bamf/gtester2xunit-python3.patch
new file mode 100644
index 000000000000..8dc478541943
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/bcg729/default.nix b/nixpkgs/pkgs/development/libraries/bcg729/default.nix
new file mode 100644
index 000000000000..4363948e830d
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/bctoolbox/default.nix b/nixpkgs/pkgs/development/libraries/bctoolbox/default.nix
index 2730696344e0..1c81dd608cbf 100644
--- a/nixpkgs/pkgs/development/libraries/bctoolbox/default.nix
+++ b/nixpkgs/pkgs/development/libraries/bctoolbox/default.nix
@@ -1,19 +1,25 @@
-{stdenv, fetchFromGitHub, cmake, mbedtls, bcunit, srtp}:
+{ stdenv, fetchFromGitHub, cmake, bcunit, mbedtls }:
+
 stdenv.mkDerivation rec {
-  name = "${baseName}-${version}";
-  baseName = "bctoolbox";
+  pname = "bctoolbox";
   version = "0.6.0";
-  buildInputs = [cmake mbedtls bcunit srtp];
+
+  nativeBuildInputs = [ cmake bcunit ];
+  buildInputs = [ mbedtls ];
+
   src = fetchFromGitHub {
     owner = "BelledonneCommunications";
-    repo = baseName;
+    repo = pname;
     rev = version;
     sha256 = "1cxx243wyzkd4xnvpyqf97n0rjhfckpvw1vhwnbwshq3q6fra909";
   };
 
+  NIX_CFLAGS_COMPILE = [ "-Wno-error=stringop-truncation" ];
+
   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/nixpkgs/pkgs/development/libraries/belle-sip/default.nix b/nixpkgs/pkgs/development/libraries/belle-sip/default.nix
index d4420e40ab69..0d3df37d8e09 100644
--- a/nixpkgs/pkgs/development/libraries/belle-sip/default.nix
+++ b/nixpkgs/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";
   };
@@ -18,24 +17,20 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ zlib ];
 
-  NIX_CFLAGS_COMPILE = [
+  NIX_CFLAGS_COMPILE = toString [
     "-Wno-error=deprecated-declarations"
     "-Wno-error=format-truncation"
     "-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/nixpkgs/pkgs/development/libraries/blitz/default.nix b/nixpkgs/pkgs/development/libraries/blitz/default.nix
index fd0da496fa40..f370e45b5fdd 100644
--- a/nixpkgs/pkgs/development/libraries/blitz/default.nix
+++ b/nixpkgs/pkgs/development/libraries/blitz/default.nix
@@ -55,7 +55,7 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  buildFlags = "lib info pdf html";
+  buildFlags = [ "lib" "info" "pdf" "html" ];
   installTargets = [ "install" "install-info" "install-pdf" "install-html" ];
 
   inherit doCheck;
diff --git a/nixpkgs/pkgs/development/libraries/boehm-gc/7.6.6.nix b/nixpkgs/pkgs/development/libraries/boehm-gc/7.6.6.nix
index 0e828a6f6dad..9fb9e4f4df17 100644
--- a/nixpkgs/pkgs/development/libraries/boehm-gc/7.6.6.nix
+++ b/nixpkgs/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";
@@ -60,10 +60,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/nixpkgs/pkgs/development/libraries/boehm-gc/default.nix b/nixpkgs/pkgs/development/libraries/boehm-gc/default.nix
index cf76d9e7d24c..f061626a897d 100644
--- a/nixpkgs/pkgs/development/libraries/boehm-gc/default.nix
+++ b/nixpkgs/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,26 +10,29 @@ 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";
   };
 
   outputs = [ "out" "dev" "doc" ];
-  separateDebugInfo = stdenv.isLinux;
+  separateDebugInfo = stdenv.isLinux && stdenv.hostPlatform.libc != "musl";
 
   preConfigure = stdenv.lib.optionalString (stdenv.hostPlatform.libc == "musl") ''
     export NIX_CFLAGS_COMPILE+=" -D_GNU_SOURCE -DUSE_MMAP -DHAVE_DL_ITERATE_PHDR"
   '';
 
-  patches =
-    # https://github.com/ivmai/bdwgc/pull/208
-    lib.optional stdenv.hostPlatform.isRiscV ./riscv.patch;
+  patches = # https://github.com/ivmai/bdwgc/pull/208
+    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"
-    ++ lib.optional (stdenv.hostPlatform.libc == "musl") "--disable-static";
+    ++ lib.optional enableLargeConfig "--enable-large-config";
+
+  nativeBuildInputs =
+    lib.optional stdenv.hostPlatform.isMinGW autoreconfHook;
 
   doCheck = true; # not cross;
 
@@ -54,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/nixpkgs/pkgs/development/libraries/boehm-gc/mcfgthread.patch b/nixpkgs/pkgs/development/libraries/boehm-gc/mcfgthread.patch
new file mode 100644
index 000000000000..c4aa996aebd7
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/boost/1.71.nix b/nixpkgs/pkgs/development/libraries/boost/1.71.nix
new file mode 100644
index 000000000000..f66bd4cd6fb1
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/boost/generic.nix b/nixpkgs/pkgs/development/libraries/boost/generic.nix
index f7bd189022f8..82bcd49592d4 100644
--- a/nixpkgs/pkgs/development/libraries/boost/generic.nix
+++ b/nixpkgs/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
 
@@ -101,7 +103,7 @@ stdenv.mkDerivation {
 
   inherit src version;
 
-  patchFlags = "";
+  patchFlags = [];
 
   patches = patches
   ++ optional stdenv.isDarwin (
diff --git a/nixpkgs/pkgs/development/libraries/box2d/default.nix b/nixpkgs/pkgs/development/libraries/box2d/default.nix
index 328ac434d85a..d4b4c33f35b5 100644
--- a/nixpkgs/pkgs/development/libraries/box2d/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/boxfort/default.nix b/nixpkgs/pkgs/development/libraries/boxfort/default.nix
new file mode 100644
index 000000000000..95c1afd090f4
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/buddy/default.nix b/nixpkgs/pkgs/development/libraries/buddy/default.nix
index fb25b0a58108..9b722602a65c 100644
--- a/nixpkgs/pkgs/development/libraries/buddy/default.nix
+++ b/nixpkgs/pkgs/development/libraries/buddy/default.nix
@@ -11,9 +11,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ bison ];
   patches = [ ./gcc-4.3.3-fixes.patch ];
   configureFlags = [ "CFLAGS=-O3" "CXXFLAGS=-O3" ];
-  NIX_LDFLAGS = [
-    "-lm"
-  ];
+  NIX_LDFLAGS = "-lm";
   doCheck = true;
 
   meta = {
diff --git a/nixpkgs/pkgs/development/libraries/bullet/default.nix b/nixpkgs/pkgs/development/libraries/bullet/default.nix
index f6041802a9c5..5b4e37eff9f6 100644
--- a/nixpkgs/pkgs/development/libraries/bullet/default.nix
+++ b/nixpkgs/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 ];
@@ -40,7 +40,8 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=argument-outside-range";
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang
+    "-Wno-error=argument-outside-range -Wno-error=c++11-narrowing";
 
   meta = with stdenv.lib; {
     description = "A professional free 3D Game Multiphysics Library";
diff --git a/nixpkgs/pkgs/development/libraries/bullet/roboschool-fork.nix b/nixpkgs/pkgs/development/libraries/bullet/roboschool-fork.nix
index 8b0901832d11..34a9ee3b6ee8 100644
--- a/nixpkgs/pkgs/development/libraries/bullet/roboschool-fork.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/c-blosc/default.nix b/nixpkgs/pkgs/development/libraries/c-blosc/default.nix
index 396e419406ae..4a9e627e5442 100644
--- a/nixpkgs/pkgs/development/libraries/c-blosc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/c-blosc/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "c-blosc";
-  version = "1.16.3";
+  version = "1.17.0";
 
   src = fetchFromGitHub {
     owner = "Blosc";
     repo = "c-blosc";
     rev = "v${version}";
-    sha256 = "1c58wkf34rp5wh9qp09zdk7zcfn037sk56p4xq1g0vapbnglv603";
+    sha256 = "0c4vh7kyxm57jclk8jlcnc11w7nd2m81qk454gav58aji85w16hg";
   };
 
   buildInputs = [ cmake ];
@@ -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/nixpkgs/pkgs/development/libraries/caf/default.nix b/nixpkgs/pkgs/development/libraries/caf/default.nix
index 3ebc0b36679c..ecf991cb59ce 100644
--- a/nixpkgs/pkgs/development/libraries/caf/default.nix
+++ b/nixpkgs/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.0";
+  version = "0.17.3";
 
   src = fetchFromGitHub {
     owner = "actor-framework";
     repo = "actor-framework";
     rev = version;
-    sha256 = "10dcpmdsfq6r7hpvg413pqi1q3rjvgn7f87c17ghyz30x6rjhaic";
+    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/nixpkgs/pkgs/development/libraries/cairo/default.nix b/nixpkgs/pkgs/development/libraries/cairo/default.nix
index e5152b8a6461..0d7a3465214d 100644
--- a/nixpkgs/pkgs/development/libraries/cairo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cairo/default.nix
@@ -9,8 +9,8 @@
 , x11XrenderSupport ? x11Support, libXrender
 , xcbSupport ? !stdenv.isDarwin, libxcb # 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
 , darwin
 }:
 
diff --git a/nixpkgs/pkgs/development/libraries/catch2/default.nix b/nixpkgs/pkgs/development/libraries/catch2/default.nix
index d7876affe2f9..cc338e35d832 100644
--- a/nixpkgs/pkgs/development/libraries/catch2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/catch2/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "catch2";
-  version = "2.8.0";
+  version = "2.11.1";
 
   src = fetchFromGitHub {
     owner = "catchorg";
     repo = "Catch2";
     rev = "v${version}";
-    sha256="1i7nz29gcsy9cnljb0sb1fw8fg9p1gdh2pdhrgj3kcrsnxgbyhrq";
+    sha256="1jijj72cas6k5hckkxqppbv1inlwbca37p0ixzs3vzm2jhnd7z31";
   };
 
   nativeBuildInputs = [ cmake ];
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "A multi-paradigm automated test framework for C++ and Objective-C (and, maybe, C)";
-    homepage = http://catch-lib.net;
+    homepage = "http://catch-lib.net";
     license = licenses.boost;
     maintainers = with maintainers; [ edwtjo knedlsepp ];
     platforms = with platforms; unix;
diff --git a/nixpkgs/pkgs/development/libraries/ccrtp/1.8.nix b/nixpkgs/pkgs/development/libraries/ccrtp/1.8.nix
deleted file mode 100644
index db2d177b710c..000000000000
--- a/nixpkgs/pkgs/development/libraries/ccrtp/1.8.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{ stdenv, fetchurl, openssl, pkgconfig, libgcrypt, commoncpp2 }:
-
-stdenv.mkDerivation {
-  name = "ccrtp-1.8.0";
-
-  src = fetchurl {
-    url = mirror://gnu/ccrtp/ccrtp-1.8.0.tar.gz;
-    sha256 = "0wr4dandlfajhmg90nqyvwv61ikn9vdycji001310y3c4zfysprn";
-  };
-
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ openssl libgcrypt commoncpp2 ];
-
-  patches = [ ./gcc-4.6-fix.patch ];
-
-  meta = {
-    description = "GNU ccRTP is an implementation of RTP, the real-time transport protocol from the IETF";
-    homepage = https://www.gnu.org/software/ccrtp/;
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = [ stdenv.lib.maintainers.marcweber ];
-    platforms = stdenv.lib.platforms.linux;
-    broken = true; # fails to compile with libgcrypt >= 1.6
-  };
-}
diff --git a/nixpkgs/pkgs/development/libraries/ccrtp/gcc-4.6-fix.patch b/nixpkgs/pkgs/development/libraries/ccrtp/gcc-4.6-fix.patch
deleted file mode 100644
index 49d07a89e52a..000000000000
--- a/nixpkgs/pkgs/development/libraries/ccrtp/gcc-4.6-fix.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -ubr ccrtp-1.8.0-orig/src/ccrtp/sources.h ccrtp-1.8.0/src/ccrtp/sources.h
---- ccrtp-1.8.0-orig/src/ccrtp/sources.h	2010-04-18 20:51:49.000000000 +0200
-+++ ccrtp-1.8.0/src/ccrtp/sources.h	2012-07-07 11:42:50.961179016 +0200
-@@ -45,6 +45,7 @@
- #define CCXX_RTP_SOURCES_H_
- 
- #include <string>
-+#include <cstddef>
- #include <ccrtp/rtcppkt.h>
- 
- #ifdef	CCXX_NAMESPACES
-@@ -406,7 +407,7 @@
- 	public:
- 		typedef std::forward_iterator_tag iterator_category;
- 		typedef Participant value_type;
--		typedef ptrdiff_t difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 		typedef const Participant* pointer;
- 		typedef const Participant& reference;
- 
diff --git a/nixpkgs/pkgs/development/libraries/cereal/default.nix b/nixpkgs/pkgs/development/libraries/cereal/default.nix
new file mode 100644
index 000000000000..03a1f9b31799
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cereal/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchFromGitHub, cmake }:
+stdenv.mkDerivation rec {
+  pname = "cereal";
+  version = "1.3.0";
+
+  nativeBuildInputs = [ cmake ];
+
+  src = fetchFromGitHub {
+    owner = "USCiLab";
+    repo = "cereal";
+    rev = "v${version}";
+    sha256 = "0hc8wh9dwpc1w1zf5lfss4vg5hmgpblqxbrpp1rggicpx9ar831p";
+  };
+
+  cmakeFlagsArray = [ "-DJUST_INSTALL_CEREAL=yes" ];
+
+  meta = with stdenv.lib; {
+    description = "A header-only C++11 serialization library";
+    homepage    = https://uscilab.github.io/cereal/;
+    platforms   = platforms.all;
+    license     = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cfitsio/default.nix b/nixpkgs/pkgs/development/libraries/cfitsio/default.nix
index 7576c24024a4..4b84f73a2585 100644
--- a/nixpkgs/pkgs/development/libraries/cfitsio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cfitsio/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   hardeningDisable = [ "format" ];
 
   # Shared-only build
-  buildFlags = "shared";
+  buildFlags = [ "shared" ];
   postPatch = '' sed -e '/^install:/s/libcfitsio.a //' -e 's@/bin/@@g' -i Makefile.in
    '';
 
diff --git a/nixpkgs/pkgs/development/libraries/check/default.nix b/nixpkgs/pkgs/development/libraries/check/default.nix
index 08610d1e9aff..6a94d9a71ce3 100644
--- a/nixpkgs/pkgs/development/libraries/check/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/chipmunk/default.nix b/nixpkgs/pkgs/development/libraries/chipmunk/default.nix
index 76f722f31aa7..5dd9917bc52b 100644
--- a/nixpkgs/pkgs/development/libraries/chipmunk/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/chromaprint/default.nix b/nixpkgs/pkgs/development/libraries/chromaprint/default.nix
index fd868884f986..6ad6a09ec14b 100644
--- a/nixpkgs/pkgs/development/libraries/chromaprint/default.nix
+++ b/nixpkgs/pkgs/development/libraries/chromaprint/default.nix
@@ -2,18 +2,18 @@
 
 stdenv.mkDerivation rec {
   pname = "chromaprint";
-  version = "1.3.2";
+  version = "1.4.3";
 
   src = fetchurl {
-    url = "https://bitbucket.org/acoustid/chromaprint/downloads/${pname}-${version}.tar.gz";
-    sha256 = "0lln8dh33gslb9cbmd1hcv33pr6jxdwipd8m8gbsyhksiq6r1by3";
+    url = "https://github.com/acoustid/chromaprint/releases/download/v${version}/${pname}-${version}.tar.gz";
+    sha256 = "10kz8lncal4s2rp2rqpgc6xyjp0jzcrihgkx7chf127vfs5n067a";
   };
 
   nativeBuildInputs = [ cmake ];
 
   buildInputs = [ boost ffmpeg ];
 
-  cmakeFlags = [ "-DBUILD_EXAMPLES=ON" ];
+  cmakeFlags = [ "-DBUILD_EXAMPLES=ON" "-DBUILD_TOOLS=ON" ];
 
   meta = with stdenv.lib; {
     homepage = https://acoustid.org/chromaprint;
diff --git a/nixpkgs/pkgs/development/libraries/cimg/default.nix b/nixpkgs/pkgs/development/libraries/cimg/default.nix
index 6181122aa7f1..22ad25a8bbe2 100644
--- a/nixpkgs/pkgs/development/libraries/cimg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cimg/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "cimg";
-  version = "2.7.1";
+  version = "2.8.0";
 
   src = fetchurl {
     url = "http://cimg.eu/files/CImg_${version}.zip";
-    sha256 = "1lw1hjk65zyd5x9w113yrqyy8db45jdzzkqslkipaiskl9f81y9z";
+    sha256 = "1nm9zpx9k3pb1p726ihw13y0d3y3xqafml7mhnx6wrkg9sfgs17n";
   };
 
   nativeBuildInputs = [ unzip ];
diff --git a/nixpkgs/pkgs/development/libraries/cl/default.nix b/nixpkgs/pkgs/development/libraries/cl/default.nix
index a7d7a0ea982b..2c8ac5113b12 100644
--- a/nixpkgs/pkgs/development/libraries/cl/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/clfft/default.nix b/nixpkgs/pkgs/development/libraries/clfft/default.nix
new file mode 100644
index 000000000000..5eb5b842ecfa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/clfft/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchFromGitHub, cmake, fftw, fftwFloat, boost166, opencl-clhpp, ocl-icd }:
+
+let
+  version = "2.12.2";
+in stdenv.mkDerivation {
+  pname = "clfft";
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "clMathLibraries";
+    repo = "clFFT";
+    rev = "refs/tags/v${version}";
+    sha256 = "134vb6214hn00qy84m4djg4hqs6hw19gkp8d0wlq8gb9m3mfx7na";
+  };
+
+  sourceRoot = "source/src";
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ fftw fftwFloat boost166 opencl-clhpp ocl-icd ];
+
+  meta = with stdenv.lib; {
+    description = "Library containing FFT functions written in OpenCL";
+    longDescription = ''
+      clFFT is a software library containing FFT functions written in OpenCL.
+      In addition to GPU devices, the library also supports running on CPU devices to facilitate debugging and heterogeneous programming.
+    '';
+    license = licenses.asl20;
+    homepage = "http://clmathlibraries.github.io/clFFT/";
+    platforms = [ "i686-linux" "x86_64-linux" ];
+    maintainers = with maintainers; [ chessai ];
+    inherit version;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/clipper/default.nix b/nixpkgs/pkgs/development/libraries/clipper/default.nix
index 117524239061..ebb41fde4238 100644
--- a/nixpkgs/pkgs/development/libraries/clipper/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/cln/default.nix b/nixpkgs/pkgs/development/libraries/cln/default.nix
index 7adc2a365c5b..dc36414fc28d 100644
--- a/nixpkgs/pkgs/development/libraries/cln/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/clutter/default.nix b/nixpkgs/pkgs/development/libraries/clutter/default.nix
index 7095a808540f..32e723671e8c 100644
--- a/nixpkgs/pkgs/development/libraries/clutter/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/codec2/default.nix b/nixpkgs/pkgs/development/libraries/codec2/default.nix
index 7c42a7479b1a..9c31b50c0285 100644
--- a/nixpkgs/pkgs/development/libraries/codec2/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/cogl/default.nix b/nixpkgs/pkgs/development/libraries/cogl/default.nix
index 4700d9e2418e..e122c1e7b120 100644
--- a/nixpkgs/pkgs/development/libraries/cogl/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/coin3d/default.nix b/nixpkgs/pkgs/development/libraries/coin3d/default.nix
index 74fd12ffea26..634ac27058bb 100644
--- a/nixpkgs/pkgs/development/libraries/coin3d/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/commoncpp2/default.nix b/nixpkgs/pkgs/development/libraries/commoncpp2/default.nix
deleted file mode 100644
index 0c5ab7585833..000000000000
--- a/nixpkgs/pkgs/development/libraries/commoncpp2/default.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{ fetchurl, stdenv }:
-
-stdenv.mkDerivation rec {
-  name = "commoncpp2-1.8.1";
-
-  src = fetchurl {
-    url = "mirror://gnu/commoncpp/${name}.tar.gz";
-    sha256 = "0kmgr5w3b1qwzxnsnw94q6rqs0hr8nbv9clf07ca2a2fyypx9kjk";
-  };
-
-  doCheck = true;
-
-  preBuild = ''
-    echo '#include <sys/stat.h>' >> inc/cc++/config.h
-  '';
-
-  meta = {
-    description = "GNU Common C++, a portable, highly optimized C++ class framework";
-
-    longDescription =
-      '' GNU Common C++ and GNU uCommon are very portable and highly
-         optimized class framework for writing C++ applications that need to
-         use threads and support concurrent sychronization, and that use
-         sockets, XML parsing, object serialization, thread-optimized String
-         and data structure classes, etc.  This framework offers a class
-         foundation that hides platform differences from your C++ application
-         so that you need not write platform specific code.  GNU Common C++
-         has been ported to compile nativily on most platforms which support
-         either posix threads, or on maybe be used with Debian hosted mingw32
-         to build native threading applications for Microsoft Windows.
-      '';
-
-    homepage = https://www.gnu.org/software/commoncpp/;
-    license = stdenv.lib.licenses.gpl2Plus;
-    maintainers = [ stdenv.lib.maintainers.marcweber ];
-    platforms = with stdenv.lib.platforms; linux;
-  };
-}
diff --git a/nixpkgs/pkgs/development/libraries/coprthr/default.nix b/nixpkgs/pkgs/development/libraries/coprthr/default.nix
deleted file mode 100644
index 86f4485a900d..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/coredumper/default.nix b/nixpkgs/pkgs/development/libraries/coredumper/default.nix
deleted file mode 100644
index ddd0d87a5511..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/cpp-hocon/default.nix b/nixpkgs/pkgs/development/libraries/cpp-hocon/default.nix
index d172ab55fa3c..dc742a5c051a 100644
--- a/nixpkgs/pkgs/development/libraries/cpp-hocon/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cpp-hocon/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     owner = "puppetlabs";
   };
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=catch-value" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error=catch-value";
 
   nativeBuildInputs = [ cmake ];
 
diff --git a/nixpkgs/pkgs/development/libraries/cpp-utilities/default.nix b/nixpkgs/pkgs/development/libraries/cpp-utilities/default.nix
index c7f949455700..82e09c33a55f 100644
--- a/nixpkgs/pkgs/development/libraries/cpp-utilities/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cpp-utilities/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "cpp-utilities";
-  version = "5.0.0";
+  version = "5.0.1";
 
   src = fetchFromGitHub {
     owner = "Martchus";
     repo = pname;
     rev = "v${version}";
-    sha256 = "031kiawmrp40sqgd9g5qd82ljglcm9xvynicsn4n8n4ngfgbnc0m";
+    sha256 = "11wm7z4ldsja2x2m2dkj3xhiammkwfqgbgkwq9gssnv14803fhnv";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/development/libraries/cppdb/default.nix b/nixpkgs/pkgs/development/libraries/cppdb/default.nix
index 737122c57bfe..bb521ba3ec0c 100644
--- a/nixpkgs/pkgs/development/libraries/cppdb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cppdb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, sqlite, mysql, postgresql, unixODBC }:
+{ stdenv, fetchurl, cmake, sqlite, libmysqlclient, postgresql, unixODBC }:
 
 stdenv.mkDerivation rec {
   pname = "cppdb";
@@ -11,10 +11,10 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  buildInputs = [ cmake sqlite mysql.connector-c postgresql unixODBC ];
+  buildInputs = [ cmake sqlite libmysqlclient postgresql unixODBC ];
 
   cmakeFlags = [ "--no-warn-unused-cli" ];
-  NIX_CFLAGS_COMPILE = [ "-I${mysql.connector-c}/include/mysql" "-L${mysql.connector-c}/lib/mysql" ];
+  NIX_CFLAGS_COMPILE = "-I${libmysqlclient}/include/mysql -L${libmysqlclient}/lib/mysql";
 
   meta = with stdenv.lib; {
     homepage = http://cppcms.com/sql/cppdb/;
diff --git a/nixpkgs/pkgs/development/libraries/cppzmq/default.nix b/nixpkgs/pkgs/development/libraries/cppzmq/default.nix
index 2328bd533629..ccf38fa09fbb 100644
--- a/nixpkgs/pkgs/development/libraries/cppzmq/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/crc32c/default.nix b/nixpkgs/pkgs/development/libraries/crc32c/default.nix
index 916ec5b703bb..a7313c205536 100644
--- a/nixpkgs/pkgs/development/libraries/crc32c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/crc32c/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ gflags ];
-  NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.isAarch64 "-march=armv8-a+crc";
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isAarch64 "-march=armv8-a+crc";
 
   meta = with stdenv.lib; {
     homepage = https://github.com/google/crc32c;
diff --git a/nixpkgs/pkgs/development/libraries/criterion/default.nix b/nixpkgs/pkgs/development/libraries/criterion/default.nix
new file mode 100644
index 000000000000..c2721d3839a1
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/crypto++/GNUmakefile-darwin.patch b/nixpkgs/pkgs/development/libraries/crypto++/GNUmakefile-darwin.patch
deleted file mode 100644
index 5a6cb3bcafb4..000000000000
--- a/nixpkgs/pkgs/development/libraries/crypto++/GNUmakefile-darwin.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/GNUmakefile b/GNUmakefile
-index 4de9d10..ff4789a 100755
---- a/GNUmakefile
-+++ b/GNUmakefile
-@@ -271,8 +271,8 @@ endif # OpenMP
- endif # IS_LINUX
- 
- ifneq ($(IS_DARWIN),0)
--AR = libtool
--ARFLAGS = -static -o
-+AR = ar
-+ARFLAGS = cru
- CXX ?= c++
- ifeq ($(IS_GCC_29),1)
- CXXFLAGS += -fno-coalesce-templates -fno-coalesce-static-vtables
diff --git a/nixpkgs/pkgs/development/libraries/crypto++/default.nix b/nixpkgs/pkgs/development/libraries/crypto++/default.nix
index cb481fc7084e..3fe277481553 100644
--- a/nixpkgs/pkgs/development/libraries/crypto++/default.nix
+++ b/nixpkgs/pkgs/development/libraries/crypto++/default.nix
@@ -1,49 +1,47 @@
-{ fetchFromGitHub, stdenv }:
+{ stdenv, fetchFromGitHub, nasm, which }:
 
+with stdenv.lib;
 stdenv.mkDerivation rec {
   pname = "crypto++";
-  majorVersion = "5.6";
-  version = "${majorVersion}.5";
+  version = "8.2.0";
+  underscoredVersion = strings.replaceStrings ["."] ["_"] version;
 
   src = fetchFromGitHub {
     owner = "weidai11";
     repo = "cryptopp";
-    rev = "CRYPTOPP_5_6_5";
-    sha256 = "1yk7jyf4va9425cg05llskpls2jm7n3jwy2hj5jm74zkr4mwpvl7";
+    rev = "CRYPTOPP_${underscoredVersion}";
+    sha256 = "01zrrzjn14yhkb9fzzl57vmh7ig9a6n6fka45f8za0gf7jpcq3mj";
   };
 
-  patches = stdenv.lib.concatLists [
-    (stdenv.lib.optional (stdenv.hostPlatform.system != "i686-cygwin") ./dll.patch)
-    (stdenv.lib.optional stdenv.hostPlatform.isDarwin ./GNUmakefile-darwin.patch)
-  ];
-
-
-  configurePhase = ''
-      sed -i GNUmakefile \
-        -e 's|-march=native|-fPIC|g' \
-        -e '/^CXXFLAGS =/s|-g ||'
+  postPatch = ''
+    substituteInPlace GNUmakefile \
+        --replace "AR = libtool" "AR = ar" \
+        --replace "ARFLAGS = -static -o" "ARFLAGS = -cru"
   '';
 
-  enableParallelBuilding = true;
+  nativeBuildInputs = optionals stdenv.hostPlatform.isx86 [ nasm which ];
 
-  makeFlags = [ "PREFIX=$(out)" ];
-  buildFlags = [ "libcryptopp.so" ];
-  installFlags = [ "LDCONF=true" ];
+  preBuild = optionalString stdenv.hostPlatform.isx86 "${stdenv.shell} rdrand-nasm.sh";
+  makeFlags = [ "PREFIX=${placeholder "out"}" ];
+  buildFlags = [ "shared" "libcryptopp.pc" ];
+  enableParallelBuilding = true;
 
   doCheck = true;
-  checkPhase = "LD_LIBRARY_PATH=`pwd` make test";
 
-  # prefer -fPIC and .so to .a; cryptotest.exe seems superfluous
-  postInstall = ''
-    rm "$out"/lib/*.a -r "$out/bin"
-    ln -sf "$out"/lib/libcryptopp.so.${version} "$out"/lib/libcryptopp.so.${majorVersion}
+  preInstall = "rm libcryptopp.a"; # built for checks but we don't install static lib into the nix store
+  installTargets = [ "install-lib" ];
+  installFlags = [ "LDCONF=true" ];
+  postInstall = optionalString (!stdenv.hostPlatform.isDarwin) ''
+    ln -sr $out/lib/libcryptopp.so.${version} $out/lib/libcryptopp.so.${versions.majorMinor version}
+    ln -sr $out/lib/libcryptopp.so.${version} $out/lib/libcryptopp.so.${versions.major version}
   '';
 
-  meta = with stdenv.lib; {
+  meta = {
     description = "Crypto++, a free C++ class library of cryptographic schemes";
-    homepage = http://cryptopp.com/;
-    license = licenses.boost;
+    homepage = "https://cryptopp.com/";
+    changelog = "https://raw.githubusercontent.com/weidai11/cryptopp/CRYPTOPP_${underscoredVersion}/History.txt";
+    license = with licenses; [ boost publicDomain ];
     platforms = platforms.all;
-    maintainers = [ ];
+    maintainers = with maintainers; [ c0bw3b ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/crypto++/dll.patch b/nixpkgs/pkgs/development/libraries/crypto++/dll.patch
deleted file mode 100644
index 12df1fb9e9e9..000000000000
--- a/nixpkgs/pkgs/development/libraries/crypto++/dll.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-Get rid of Windows-specific stuff.
-
-diff --git a/GNUmakefile b/GNUmakefile
-index 4de9d10..ff4789a 100755
---- a/GNUmakefile
-+++ b/GNUmakefile
-@@ -656,7 +656,7 @@ nolib: $(OBJS)
- dll: cryptest.import.exe dlltest.exe
- 
- cryptopp.dll: $(DLLOBJS)
--	$(CXX) -shared -o $@ $(CXXFLAGS) $(DLLOBJS) $(LDFLAGS) $(LDLIBS) -Wl,--out-implib=libcryptopp.dll.a
-+	$(CXX) -shared -o $@ $(CXXFLAGS) $(DLLOBJS) $(LDFLAGS) $(LDLIBS)
- 
- libcryptopp.import.a: $(LIBIMPORTOBJS)
- 	$(AR) $(ARFLAGS) $@ $(LIBIMPORTOBJS)
-diff --git a/dll.cpp b/dll.cpp
-index 72dade9..b5097ab 100644
---- a/dll.cpp
-+++ b/dll.cpp
-@@ -48,7 +48,7 @@ NAMESPACE_END
- 

- #endif

- 

--#ifdef CRYPTOPP_EXPORTS

-+#if defined CRYPTOPP_EXPORTS && defined _MSC_VER

- 

- USING_NAMESPACE(CryptoPP)

- 

diff --git a/nixpkgs/pkgs/development/libraries/csfml/default.nix b/nixpkgs/pkgs/development/libraries/csfml/default.nix
index 506aa5f475d6..9bfff5c4aa81 100644
--- a/nixpkgs/pkgs/development/libraries/csfml/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/cutee/default.nix b/nixpkgs/pkgs/development/libraries/cutee/default.nix
index 1658f8a6fa7a..1c14454af5c4 100644
--- a/nixpkgs/pkgs/development/libraries/cutee/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cutee/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "18bzvhzx8k24mpcim5669n3wg9hd0sfsxj8zjpbr24hywrlppgc2";
   };
 
-  buildFlags = "cutee";
+  buildFlags = [ "cutee" ];
 
   installPhase = ''
     mkdir -p $out/bin
diff --git a/nixpkgs/pkgs/development/libraries/cutelyst/default.nix b/nixpkgs/pkgs/development/libraries/cutelyst/default.nix
index e84fbe89aa95..6cd464e55390 100644
--- a/nixpkgs/pkgs/development/libraries/cutelyst/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cutelyst/default.nix
@@ -4,13 +4,13 @@
 
 stdenv.mkDerivation rec {
   pname = "cutelyst";
-  version = "2.8.0";
+  version = "2.9.0";
 
   src = fetchFromGitHub {
     owner = "cutelyst";
     repo = "cutelyst";
     rev = "v${version}";
-    sha256 = "02jys32qkyksa2dmanyg4x0y5lh4ra0xbn2mfr2k84slrxbgjs1g";
+    sha256 = "13h2sj131s31qdzdwa3hx7ildmvlk8mv9s0j99kvx1ijaq49z79f";
   };
 
   nativeBuildInputs = [ cmake pkgconfig wrapQtAppsHook ];
diff --git a/nixpkgs/pkgs/development/libraries/cwiid/default.nix b/nixpkgs/pkgs/development/libraries/cwiid/default.nix
index 246dd009820c..d9a17aff9418 100644
--- a/nixpkgs/pkgs/development/libraries/cwiid/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cwiid/default.nix
@@ -23,9 +23,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
 
-  NIX_LDFLAGS = [
-    "-lbluetooth"
-  ];
+  NIX_LDFLAGS = "-lbluetooth";
 
   postInstall = ''
     # Some programs (for example, cabal-install) have problems with the double 0
diff --git a/nixpkgs/pkgs/development/libraries/cyrus-sasl/default.nix b/nixpkgs/pkgs/development/libraries/cyrus-sasl/default.nix
index a050dd8d9cac..68f6a7c5d8b8 100644
--- a/nixpkgs/pkgs/development/libraries/cyrus-sasl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cyrus-sasl/default.nix
@@ -1,6 +1,6 @@
 { lib, stdenv, fetchurl, openssl, openldap, kerberos, db, gettext
 , pam, fixDarwinDylibNames, autoreconfHook, enableLdap ? false
-, buildPackages, pruneLibtoolFiles }:
+, buildPackages, pruneLibtoolFiles, fetchpatch }:
 
 with stdenv.lib;
 stdenv.mkDerivation rec {
@@ -27,6 +27,11 @@ stdenv.mkDerivation rec {
   patches = [
     ./missing-size_t.patch # https://bugzilla.redhat.com/show_bug.cgi?id=906519
     ./cyrus-sasl-ac-try-run-fix.patch
+    (fetchpatch {
+      name = "CVE-2019-19906.patch";
+      url = "https://sources.debian.org/data/main/c/cyrus-sasl2/2.1.27+dfsg-1+deb10u1/debian/patches/0021-CVE-2019-19906.patch";
+      sha256 = "1n4c5wg7l9j8rlbvx8i605j5d39xmj5wm618k8acxl4fmglcmfls";
+    })
   ];
 
   configureFlags = [
diff --git a/nixpkgs/pkgs/development/libraries/czmq/3.x.nix b/nixpkgs/pkgs/development/libraries/czmq/3.x.nix
deleted file mode 100644
index 73a51cd27310..000000000000
--- a/nixpkgs/pkgs/development/libraries/czmq/3.x.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ stdenv, fetchurl, zeromq }:
-
-stdenv.mkDerivation rec {
-  version = "3.0.2";
-  pname = "czmq";
-
-  src = fetchurl {
-    url = "http://download.zeromq.org/${pname}-${version}.tar.gz";
-    sha256 = "16k9awrhdsymx7dnmvqcnkaq8lz8x8zppy6sh7ls8prpd6mkkjlb";
-  };
-
-  patches = [ ./czmq3-gcc7.patch ];
-
-  # Fix build on Glibc 2.24.
-  NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
-
-  # Needs to be propagated for the .pc file to work
-  propagatedBuildInputs = [ zeromq ];
-
-  meta = with stdenv.lib; {
-    homepage = http://czmq.zeromq.org/;
-    description = "High-level C Binding for ZeroMQ";
-    license = licenses.mpl20;
-    platforms = platforms.all;
-  };
-}
diff --git a/nixpkgs/pkgs/development/libraries/czmq/czmq3-gcc7.patch b/nixpkgs/pkgs/development/libraries/czmq/czmq3-gcc7.patch
deleted file mode 100644
index 4ab14685a6c1..000000000000
--- a/nixpkgs/pkgs/development/libraries/czmq/czmq3-gcc7.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/src/zgossip_engine.inc b/src/zgossip_engine.inc
-index 37dbb4eb..727aaa9b 100644
---- a/src/zgossip_engine.inc
-+++ b/src/zgossip_engine.inc
-@@ -258,7 +258,7 @@ engine_set_log_prefix (client_t *client, const char *string)
- {
-     if (client) {
-         s_client_t *self = (s_client_t *) client;
--        snprintf (self->log_prefix, sizeof (self->log_prefix) - 1,
-+        snprintf (self->log_prefix, sizeof (self->log_prefix),
-             "%6d:%-33s", self->unique_id, string);
-     }
- }
-diff --git a/src/zsys.c b/src/zsys.c
-index 4d0bb8a1..f07db9c8 100644
---- a/src/zsys.c
-+++ b/src/zsys.c
-@@ -1071,7 +1071,7 @@ zsys_run_as (const char *lockfile, const char *group, const char *user)
-             }
-         }
-         //   We record the current process id in the lock file
--        char pid_buffer [10];
-+        char pid_buffer [32];
-         snprintf (pid_buffer, sizeof (pid_buffer), "%6d\n", getpid ());
-         if (write (handle, pid_buffer, strlen (pid_buffer)) != strlen (pid_buffer)) {
-             zsys_error ("cannot write to lockfile: %s", strerror (errno));
diff --git a/nixpkgs/pkgs/development/libraries/czmq/4.x.nix b/nixpkgs/pkgs/development/libraries/czmq/default.nix
index 05e499c73d0c..05e499c73d0c 100644
--- a/nixpkgs/pkgs/development/libraries/czmq/4.x.nix
+++ b/nixpkgs/pkgs/development/libraries/czmq/default.nix
diff --git a/nixpkgs/pkgs/development/libraries/czmqpp/default.nix b/nixpkgs/pkgs/development/libraries/czmqpp/default.nix
deleted file mode 100644
index 079eb0806d2c..000000000000
--- a/nixpkgs/pkgs/development/libraries/czmqpp/default.nix
+++ /dev/null
@@ -1,28 +0,0 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, czmq }:
-
-stdenv.mkDerivation rec {
-  pname = "czmqpp";
-  version = "1.2.0";
-
-  src = fetchFromGitHub {
-    owner = "zeromq";
-    repo = "czmqpp";
-    rev = "v${version}";
-    sha256 = "0z8lwq53yk4h7pgibicx3q9idz15qb95r0pjpz0j5vql6qh46rja";
-  };
-
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
-
-  propagatedBuildInputs = [ czmq ];
-
-  # https://github.com/zeromq/czmqpp/issues/42
-  patches = [ ./socket.patch ];
-
-  meta = with stdenv.lib; {
-    inherit (src.meta) homepage;
-    description = "C++ wrapper for czmq. Aims to be minimal, simple and consistent";
-    license = licenses.lgpl3;
-    platforms = platforms.linux ++ platforms.darwin;
-    maintainers = with maintainers; [ chris-martin ];
-  };
-}
diff --git a/nixpkgs/pkgs/development/libraries/czmqpp/socket.patch b/nixpkgs/pkgs/development/libraries/czmqpp/socket.patch
deleted file mode 100644
index 0464bcf77971..000000000000
--- a/nixpkgs/pkgs/development/libraries/czmqpp/socket.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- /src/socket.cpp
-+++ /src/socket.cpp
-@@ -60,12 +60,12 @@
- int socket::bind(const std::string& address)
- {
-     // format-security: format not a string literal and no format arguments.
--    return zsocket_bind(self_, address.c_str());
-+    return zsocket_bind(self_, "%s", address.c_str());
- }
- int socket::connect(const std::string& address)
- {
-     // format-security: format not a string literal and no format arguments.
--    return zsocket_connect(self_, address.c_str());
-+    return zsocket_connect(self_, "%s", address.c_str());
- }
-
- bool operator==(const socket& sock_a, const socket& sock_b)
diff --git a/nixpkgs/pkgs/development/libraries/dav1d/default.nix b/nixpkgs/pkgs/development/libraries/dav1d/default.nix
index d065554d7c9d..5542a37661ac 100644
--- a/nixpkgs/pkgs/development/libraries/dav1d/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dav1d/default.nix
@@ -1,30 +1,32 @@
 { stdenv, fetchFromGitLab
 , meson, ninja, nasm, pkgconfig
-, withTools ? false, SDL2
+, withTools ? false # "dav1d" binary
+, withExamples ? false, SDL2 # "dav1dplay" binary
 , useVulkan ? false, libplacebo, vulkan-loader, vulkan-headers
 }:
 
-assert useVulkan -> withTools;
+assert useVulkan -> withExamples;
 
 stdenv.mkDerivation rec {
   pname = "dav1d";
-  version = "0.4.0";
+  version = "0.5.2";
 
   src = fetchFromGitLab {
     domain = "code.videolan.org";
     owner = "videolan";
     repo = pname;
     rev = version;
-    sha256 = "1fbalfzw8j00vwbrh9h8kjdx6h99dr10vmvbpg3rhsspmxq9h66h";
+    sha256 = "0acxlgyz6c8ckw8vfgn60y2zg2n00l5xsq5jlxvwbh5w5pkc3ahf";
   };
 
   nativeBuildInputs = [ meson ninja nasm pkgconfig ];
   # TODO: doxygen (currently only HTML and not build by default).
-  buildInputs = stdenv.lib.optional withTools SDL2
+  buildInputs = stdenv.lib.optional withExamples SDL2
     ++ stdenv.lib.optionals useVulkan [ libplacebo vulkan-loader vulkan-headers ];
 
   mesonFlags= [
     "-Denable_tools=${stdenv.lib.boolToString withTools}"
+    "-Denable_examples=${stdenv.lib.boolToString withExamples}"
   ];
 
   meta = with stdenv.lib; {
diff --git a/nixpkgs/pkgs/development/libraries/dbus/default.nix b/nixpkgs/pkgs/development/libraries/dbus/default.nix
index 616ad869d57c..5024ea3ef249 100644
--- a/nixpkgs/pkgs/development/libraries/dbus/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dbus/default.nix
@@ -3,6 +3,7 @@
 , fetchurl
 , pkgconfig
 , expat
+, enableSystemd ? stdenv.isLinux && !stdenv.hostPlatform.isMusl
 , systemd
 , libX11 ? null
 , libICE ? null
@@ -15,6 +16,8 @@ assert
   x11Support ->
     libX11 != null && libICE != null && libSM != null;
 
+assert enableSystemd -> systemd != null;
+
 stdenv.mkDerivation rec {
   pname = "dbus";
   version = "1.12.16";
@@ -50,16 +53,18 @@ stdenv.mkDerivation rec {
     expat
   ];
 
-  buildInputs = lib.optionals x11Support [
-    libX11
-    libICE
-    libSM
-  ] ++ lib.optional stdenv.isLinux systemd;
+  buildInputs =
+    lib.optionals x11Support [
+      libX11
+      libICE
+      libSM
+    ] ++ lib.optional enableSystemd systemd;
   # ToDo: optional selinux?
 
   configureFlags = [
     "--enable-user-session"
     "--libexecdir=${placeholder ''out''}/libexec"
+    "--datadir=/etc"
     "--localstatedir=/var"
     "--runstatedir=/run"
     "--sysconfdir=/etc"
@@ -100,6 +105,7 @@ stdenv.mkDerivation rec {
     description = "Simple interprocess messaging system";
     homepage = http://www.freedesktop.org/wiki/Software/dbus/;
     license = licenses.gpl2Plus; # most is also under AFL-2.1
+    maintainers = with maintainers; [ worldofpeace ];
     platforms = platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/dconf/default.nix b/nixpkgs/pkgs/development/libraries/dconf/default.nix
new file mode 100644
index 000000000000..5b37088cd95f
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/dee/default.nix b/nixpkgs/pkgs/development/libraries/dee/default.nix
index 093cc2bdf058..dd26e5eb8baa 100644
--- a/nixpkgs/pkgs/development/libraries/dee/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dee/default.nix
@@ -1,11 +1,12 @@
 { stdenv
 , fetchgit
+, fetchpatch
 , pkgconfig
 , glib
 , icu
 , gobject-introspection
 , dbus-glib
-, vala_0_40
+, vala
 , python3
 , autoreconfHook
 }:
@@ -18,20 +19,26 @@ stdenv.mkDerivation rec {
 
   src = fetchgit {
     url = "https://git.launchpad.net/ubuntu/+source/dee";
-    rev = "import/1.2.7+17.10.20170616-4ubuntu1";
-    sha256 = "0q3d9d6ahcyibp6x23g1wvjfcppjh9v614s328yjmx47216z7394";
+    rev = "import/1.2.7+17.10.20170616-4ubuntu3";
+    sha256 = "09blrdj7229vscp4mkg0fabmcvc6jdpamvblrq86rbky7j2nnwlk";
   };
 
   patches = [
     "${src}/debian/patches/gtkdocize.patch"
     "${src}/debian/patches/strict-prototype.patch"
-    "${src}/debian/patches/icu-pkg-config.patch"
+    "${src}/debian/patches/vapi-skip-properties.patch"
+
+    # Fixes glib 2.62 deprecations
+    (fetchpatch {
+      name = "dee-1.2.7-deprecated-g_type_class_add_private.patch";
+      url = "https://src.fedoraproject.org/rpms/dee/raw/1a9a4ce3377074fabfca653ffe0287cd73aef82f/f/dee-1.2.7-deprecated-g_type_class_add_private.patch";
+      sha256 = "13nyprq7bb7lnzkcb7frcpzidbl836ycn5bvmwa2k0nhmj6ycbx5";
+    })
   ];
 
   nativeBuildInputs = [
     pkgconfig
-    # https://gitlab.gnome.org/GNOME/vala/issues/803
-    vala_0_40
+    vala
     autoreconfHook
     gobject-introspection
     python3
diff --git a/nixpkgs/pkgs/development/libraries/dirac/default.nix b/nixpkgs/pkgs/development/libraries/dirac/default.nix
deleted file mode 100644
index 93e5da5b792d..000000000000
--- a/nixpkgs/pkgs/development/libraries/dirac/default.nix
+++ /dev/null
@@ -1,31 +0,0 @@
-{ stdenv, fetchurl, doxygen }:
-
-stdenv.mkDerivation rec {
-  version = "1.0.2";
-  pname = "dirac";
-
-  src = fetchurl {
-    url = "mirror://sourceforge/dirac/${pname}-${version}.tar.gz";
-    sha256 = "1z803yzp17cj69wn11iyb13swqdd9xdzr58dsk6ghpr3ipqicsw1";
-  };
-
-  buildInputs = [ doxygen ];
-  enableParallelBuilding = true;
-
-  patches = [ ./dirac-1.0.2.patch ];
-
-  NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
-
-  postInstall = ''
-    # keep only necessary binaries
-    find $out/bin \( -name '*RGB*' -or -name '*YUV*' -or -name create_dirac_testfile.pl \) -delete
-  '';
-
-  meta = with stdenv.lib; {
-    homepage = https://sourceforge.net/projects/dirac;
-    description = "A general-purpose video codec based on wavelets";
-    platforms = platforms.linux;
-    license = with licenses; [ mpl11 gpl2 lgpl21 ];
-    maintainers = [ maintainers.igsha ];
-  };
-}
diff --git a/nixpkgs/pkgs/development/libraries/dirac/dirac-1.0.2.patch b/nixpkgs/pkgs/development/libraries/dirac/dirac-1.0.2.patch
deleted file mode 100644
index 3d253b8f6d67..000000000000
--- a/nixpkgs/pkgs/development/libraries/dirac/dirac-1.0.2.patch
+++ /dev/null
@@ -1,362 +0,0 @@
-diff -aur dirac-1.0.2/libdirac_byteio/parseunit_byteio.cpp dirac-1.0.2-modif/libdirac_byteio/parseunit_byteio.cpp
---- dirac-1.0.2/libdirac_byteio/parseunit_byteio.cpp	2008-05-02 09:57:19.000000000 +0400
-+++ dirac-1.0.2-modif/libdirac_byteio/parseunit_byteio.cpp	2016-02-10 19:39:09.838443767 +0300
-@@ -124,12 +124,9 @@
- 
-     if(prefix==PU_PREFIX)
-     {
--        unsigned char next_parse_code;
--
--        next_parse_code = InputUnByte();
-+        (void)InputUnByte();
-         // input next unit parse-offsets
--        int next_unit_next_parse_offset;
--        next_unit_next_parse_offset = ReadUintLit(PU_NEXT_PARSE_OFFSET_SIZE);
-+        (void)ReadUintLit(PU_NEXT_PARSE_OFFSET_SIZE);
- 
-         int next_unit_previous_parse_offset;
-         next_unit_previous_parse_offset = ReadUintLit(PU_PREVIOUS_PARSE_OFFSET_SIZE);
-diff -aur dirac-1.0.2/libdirac_common/mot_comp.cpp dirac-1.0.2-modif/libdirac_common/mot_comp.cpp
---- dirac-1.0.2/libdirac_common/mot_comp.cpp	2008-10-01 05:26:47.000000000 +0400
-+++ dirac-1.0.2-modif/libdirac_common/mot_comp.cpp	2016-02-10 19:50:18.453051800 +0300
-@@ -1064,10 +1064,10 @@
-         // We're doing bounds checking because we'll fall off the edge of the reference otherwise.
- 
-         //weights for doing linear interpolation, calculated from the remainder values
--        const ValueType linear_wts[4] = {  (2 - rmdr.x) * (2 - rmdr.y),    //tl
--                                           rmdr.x * (2 - rmdr.y),          //tr
--                                           (2 - rmdr.x) * rmdr.y,          //bl
--                                           rmdr.x * rmdr.y };              //br
-+        const ValueType linear_wts[4] = {  ValueType((2 - rmdr.x) * (2 - rmdr.y)),    //tl
-+                                           ValueType(rmdr.x * (2 - rmdr.y)),          //tr
-+                                           ValueType((2 - rmdr.x) * rmdr.y),          //bl
-+                                           ValueType(rmdr.x * rmdr.y) };              //br
- 
- 
-        for(int c = 0, uY = ref_start.y,BuY=BChk(uY,trueRefYlen),BuY1=BChk(uY+1,trueRefYlen);
-@@ -1116,10 +1116,10 @@
-     const ImageCoords ref_start( ( start_pos.x<<1 ) + roundvec.x ,( start_pos.y<<1 ) + roundvec.y );
- 
-     //weights for doing linear interpolation, calculated from the remainder values
--    const ValueType linear_wts[4] = {  (4 - rmdr.x) * (4 - rmdr.y),    //tl
--                                    rmdr.x * (4 - rmdr.y),          //tr
--                                    (4 - rmdr.x) * rmdr.y,          //bl
--                                    rmdr.x * rmdr.y };              //br
-+    const ValueType linear_wts[4] = {  ValueType((4 - rmdr.x) * (4 - rmdr.y)),    //tl
-+                                    ValueType(rmdr.x * (4 - rmdr.y)),          //tr
-+                                    ValueType((4 - rmdr.x) * rmdr.y),          //bl
-+                                    ValueType(rmdr.x * rmdr.y) };              //br
- 
-     //An additional stage to make sure the block to be copied does not fall outside
-     //the reference image.
-diff -aur dirac-1.0.2/libdirac_common/mot_comp_mmx.cpp dirac-1.0.2-modif/libdirac_common/mot_comp_mmx.cpp
---- dirac-1.0.2/libdirac_common/mot_comp_mmx.cpp	2008-01-09 13:50:23.000000000 +0300
-+++ dirac-1.0.2-modif/libdirac_common/mot_comp_mmx.cpp	2016-02-10 19:59:51.792793538 +0300
-@@ -244,10 +244,10 @@
-         // We're 2doing bounds checking because we'll fall off the edge of the reference otherwise.
- 
-         //weights for doing linear interpolation, calculated from the remainder values
--        const ValueType linear_wts[4] = {  (2 - rmdr.x) * (2 - rmdr.y),    //tl
--                                           rmdr.x * (2 - rmdr.y),          //tr
--                                           (2 - rmdr.x) * rmdr.y,          //bl
--                                           rmdr.x * rmdr.y };              //br
-+        const ValueType linear_wts[4] = {  ValueType((2 - rmdr.x) * (2 - rmdr.y)),    //tl
-+                                           ValueType(rmdr.x * (2 - rmdr.y)),          //tr
-+                                           ValueType((2 - rmdr.x) * rmdr.y),          //bl
-+                                           ValueType(rmdr.x * rmdr.y) };              //br
- 
-         ValueType act_cols1[4], act_cols2[4];
-         int uX, uY, c, l;
-diff -aur dirac-1.0.2/libdirac_common/mv_codec.cpp dirac-1.0.2-modif/libdirac_common/mv_codec.cpp
---- dirac-1.0.2/libdirac_common/mv_codec.cpp	2008-10-01 05:26:47.000000000 +0400
-+++ dirac-1.0.2-modif/libdirac_common/mv_codec.cpp	2016-02-10 19:51:57.634838245 +0300
-@@ -159,7 +159,7 @@
- // Main code function
- void PredModeCodec::DoWorkCode( MvData& in_data )
- {
--    int step,max; 
-+    int step; 
-     int split_depth;  
- 
-     for (m_sb_yp = 0, m_sb_tlb_y = 0;  m_sb_yp < in_data.SBSplit().LengthY();  ++m_sb_yp, m_sb_tlb_y += 4)
-@@ -169,7 +169,7 @@
-             split_depth = in_data.SBSplit()[m_sb_yp][m_sb_xp]; 
- 
-             step = 4  >>  (split_depth); 
--            max = (1 << split_depth); 
-+            //max = (1 << split_depth); 
-                         
-             //now do all the block modes and mvs in the mb            
-             for (m_b_yp = m_sb_tlb_y; m_b_yp < m_sb_tlb_y+4; m_b_yp += step)
-@@ -334,7 +334,7 @@
- // Main code function
- void VectorElementCodec::DoWorkCode( MvData& in_data )
- {
--    int step,max;
-+    int step;
-     int split_depth;
- 
-     for (m_sb_yp = 0, m_sb_tlb_y = 0;  m_sb_yp < in_data.SBSplit().LengthY();  ++m_sb_yp, m_sb_tlb_y += 4)
-@@ -344,7 +344,7 @@
-             split_depth = in_data.SBSplit()[m_sb_yp][m_sb_xp];
- 
-             step = 4  >>  (split_depth);
--            max = (1 << split_depth);
-+            //max = (1 << split_depth);
-                         
-             //now do all the block modes and mvs in the mb            
-             for (m_b_yp = m_sb_tlb_y; m_b_yp < m_sb_tlb_y+4; m_b_yp += step)
-@@ -500,7 +500,7 @@
- // Main code function
- void DCCodec::DoWorkCode( MvData& in_data )
- {
--    int step,max; 
-+    int step; 
-     int split_depth;  
-     
-     for (m_sb_yp = 0, m_sb_tlb_y = 0;  m_sb_yp < in_data.SBSplit().LengthY();  ++m_sb_yp, m_sb_tlb_y += 4)
-@@ -510,7 +510,7 @@
-             split_depth = in_data.SBSplit()[m_sb_yp][m_sb_xp]; 
- 
-             step = 4  >>  (split_depth); 
--            max = (1 << split_depth); 
-+            //max = (1 << split_depth); 
-                         
-             //now do all the block modes and mvs in the mb            
-             for (m_b_yp = m_sb_tlb_y; m_b_yp < m_sb_tlb_y+4; m_b_yp += step)
-diff -aur dirac-1.0.2/libdirac_common/wavelet_utils.cpp dirac-1.0.2-modif/libdirac_common/wavelet_utils.cpp
---- dirac-1.0.2/libdirac_common/wavelet_utils.cpp	2008-10-20 08:21:02.000000000 +0400
-+++ dirac-1.0.2-modif/libdirac_common/wavelet_utils.cpp	2016-02-10 19:58:16.205006445 +0300
-@@ -198,7 +198,6 @@
-     const bool field_coding = encparams.FieldCoding();
-     const ChromaFormat cformat = pparams.CFormat();
-     const float cpd = encparams.CPD()*cpd_scale_factor;
--    const PictureSort psort = pparams.PicSort();
- 
-     int xlen, ylen, xl, yl, xp, yp;
-     float xfreq, yfreq;
-diff -aur dirac-1.0.2/libdirac_encoder/picture_compress.cpp dirac-1.0.2-modif/libdirac_encoder/picture_compress.cpp
---- dirac-1.0.2/libdirac_encoder/picture_compress.cpp	2009-01-21 08:20:57.000000000 +0300
-+++ dirac-1.0.2-modif/libdirac_encoder/picture_compress.cpp	2016-02-10 20:08:17.935731263 +0300
-@@ -413,14 +413,12 @@
- 
-         const int depth=m_encparams.TransformDepth();
- 
--        PicArray* comp_data[3];
-         CoeffArray* coeff_data[3];
-         OneDArray<unsigned int>* est_bits[3];
-         float lambda[3];
- 
-         // Construction and definition of objects
-         for (int c=0;c<3;++c){
--            comp_data[c] = &my_picture.Data((CompSort) c );
- 	    coeff_data[c] = &my_picture.WltData((CompSort) c );
-             est_bits[c] =  new OneDArray<unsigned int>( Range( 1, 3*depth+1 ) );
-         }// c
-diff -aur dirac-1.0.2/libdirac_encoder/quant_chooser.cpp dirac-1.0.2-modif/libdirac_encoder/quant_chooser.cpp
---- dirac-1.0.2/libdirac_encoder/quant_chooser.cpp	2009-01-21 08:22:05.000000000 +0300
-+++ dirac-1.0.2-modif/libdirac_encoder/quant_chooser.cpp	2016-02-10 20:15:43.792954708 +0300
-@@ -340,7 +340,7 @@
-     {
-         for (int i=cblock.Xstart(); i<cblock.Xend(); ++i )
-         {
--            if ( (std::abs(m_coeff_data[j][i])<<2) >= u_threshold )
-+            if ( (int(std::abs(m_coeff_data[j][i]))<<2) >= u_threshold )
-                 can_skip = false;
-         }   
-     }
-@@ -349,13 +349,13 @@
- 
- CoeffType QuantChooser::BlockAbsMax( const Subband& node )
- {
--    int val( 0 );
-+    CoeffType val( 0 );
- 
-     for (int j=node.Yp() ; j<node.Yp()+node.Yl(); ++j)
-     {
-         for (int i=node.Xp() ; i<node.Xp()+node.Xl(); ++i)
-         {    
--            val = std::max( val , std::abs(m_coeff_data[j][i]) );
-+            val = std::max( val , CoeffType(std::abs(m_coeff_data[j][i])) );
-         }// i
-     }// j
- 
-diff -aur dirac-1.0.2/libdirac_encoder/seq_compress.cpp dirac-1.0.2-modif/libdirac_encoder/seq_compress.cpp
---- dirac-1.0.2/libdirac_encoder/seq_compress.cpp	2008-10-29 05:42:06.000000000 +0300
-+++ dirac-1.0.2-modif/libdirac_encoder/seq_compress.cpp	2016-02-10 20:16:24.108885403 +0300
-@@ -663,7 +663,6 @@
- 
- int FrameSequenceCompressor::CodedToDisplay( const int cnum )
- {
--    int div;
- 
-     if (m_L1_sep>0)
-     {
-@@ -672,7 +671,6 @@
-             return 0;
-         else if ((cnum-1)% m_L1_sep==0)
-         {//we have L1 or subsequent I pictures
--            div=(cnum-1)/m_L1_sep;
-             return cnum+m_L1_sep-1;
-         }
-         else//we have L2 pictures
-diff -aur dirac-1.0.2/libdirac_motionest/me_utils.cpp dirac-1.0.2-modif/libdirac_motionest/me_utils.cpp
---- dirac-1.0.2/libdirac_motionest/me_utils.cpp	2008-10-21 08:55:46.000000000 +0400
-+++ dirac-1.0.2-modif/libdirac_motionest/me_utils.cpp	2016-02-10 20:04:40.068175649 +0300
-@@ -684,10 +684,10 @@
-         // We're doing bounds checking because we'll fall off the edge of the reference otherwise.
- 
-        // weights for doing linear interpolation, calculated from the remainder values
--        const ValueType linear_wts[4] = {  (2 - rmdr.x) * (2 - rmdr.y),    //tl
--                                           rmdr.x * (2 - rmdr.y),          //tr
--                                           (2 - rmdr.x) * rmdr.y,          //bl
--                                           rmdr.x * rmdr.y };              //br
-+        const ValueType linear_wts[4] = {  ValueType((2 - rmdr.x) * (2 - rmdr.y)),    //tl
-+                                           ValueType(rmdr.x * (2 - rmdr.y)),          //tr
-+                                           ValueType((2 - rmdr.x) * rmdr.y),          //bl
-+                                           ValueType(rmdr.x * rmdr.y) };              //br
- 
-         const int refXlen( m_ref_data.LengthX() );
-         const int refYlen( m_ref_data.LengthY() );
-@@ -848,10 +848,10 @@
-         // We're doing bounds checking because we'll fall off the edge of the reference otherwise.
- 
-        // weights for doing linear interpolation, calculated from the remainder values
--        const ValueType linear_wts[4] = {  (2 - rmdr.x) * (2 - rmdr.y),    //tl
--                                           rmdr.x * (2 - rmdr.y),          //tr
--                                           (2 - rmdr.x) * rmdr.y,          //bl
--                                           rmdr.x * rmdr.y };              //br
-+        const ValueType linear_wts[4] = {  ValueType((2 - rmdr.x) * (2 - rmdr.y)),    //tl
-+                                           ValueType(rmdr.x * (2 - rmdr.y)),          //tr
-+                                           ValueType((2 - rmdr.x) * rmdr.y),          //bl
-+                                           ValueType(rmdr.x * rmdr.y) };              //br
- 
-         const int refXlen( m_ref_data.LengthX() );
-         const int refYlen( m_ref_data.LengthY() );
-@@ -908,10 +908,10 @@
-     const int pic_next( m_pic_data.LengthX() - dparams.Xl() );// go down a row and back up
- 
-     //weights for doing linear interpolation, calculated from the remainder values
--    const ValueType linear_wts[4] = {  (4 - rmdr.x) * (4 - rmdr.y),    //tl
--                                       rmdr.x * (4 - rmdr.y),          //tr
--                                       (4 - rmdr.x) * rmdr.y,          //bl
--                                       rmdr.x * rmdr.y };              //br
-+    const ValueType linear_wts[4] = {  ValueType((4 - rmdr.x) * (4 - rmdr.y)),    //tl
-+                                       ValueType(rmdr.x * (4 - rmdr.y)),          //tr
-+                                       ValueType((4 - rmdr.x) * rmdr.y),          //bl
-+                                       ValueType(rmdr.x * rmdr.y) };              //br
- 
-     bool bounds_check( false );
- 
-@@ -1039,10 +1039,10 @@
-     const int pic_next( m_pic_data.LengthX() - dparams.Xl() );// go down a row and back up
- 
-     //weights for doing linear interpolation, calculated from the remainder values
--    const ValueType linear_wts[4] = {  (4 - rmdr.x) * (4 - rmdr.y),    //tl
--                                       rmdr.x * (4 - rmdr.y),          //tr
--                                       (4 - rmdr.x) * rmdr.y,          //bl
--                                       rmdr.x * rmdr.y };              //br
-+    const ValueType linear_wts[4] = {  ValueType((4 - rmdr.x) * (4 - rmdr.y)),    //tl
-+                                       ValueType(rmdr.x * (4 - rmdr.y)),          //tr
-+                                       ValueType((4 - rmdr.x) * rmdr.y),          //bl
-+                                       ValueType(rmdr.x * rmdr.y) };              //br
- 
-     bool bounds_check( false );
- 
-@@ -1403,10 +1403,10 @@
-     }
-     else
-     {
--        const ValueType linear_wts[4] = {  (2 - rmdr1.x) * (2 - rmdr1.y),    //tl
--                                           rmdr1.x * (2 - rmdr1.y),          //tr
--                                           (2 - rmdr1.x) * rmdr1.y,          //bl
--                                           rmdr1.x * rmdr1.y };              //br
-+        const ValueType linear_wts[4] = {  ValueType((2 - rmdr1.x) * (2 - rmdr1.y)),    //tl
-+                                           ValueType(rmdr1.x * (2 - rmdr1.y)),          //tr
-+                                           ValueType((2 - rmdr1.x) * rmdr1.y),          //bl
-+                                           ValueType(rmdr1.x * rmdr1.y) };              //br
- 
-         // We're doing bounds checking because we'll fall off the edge of the reference otherwise.
-         for( int y=dparams.Yl(), ry=ref_start1.y, by=BChk(ry,m_ref_data1.LengthY()), by1=BChk(ry+1,m_ref_data1.LengthY()); 
-@@ -1513,10 +1513,10 @@
-     }
-     else
-     {
--        const ValueType linear_wts[4] = {  (2 - rmdr2.x) * (2 - rmdr2.y),    //tl
--                                           rmdr2.x * (2 - rmdr2.y),          //tr
--                                           (2 - rmdr2.x) * rmdr2.y,          //bl
--                                           rmdr2.x * rmdr2.y };              //br
-+        const ValueType linear_wts[4] = {  ValueType((2 - rmdr2.x) * (2 - rmdr2.y)),    //tl
-+                                           ValueType(rmdr2.x * (2 - rmdr2.y)),          //tr
-+                                           ValueType((2 - rmdr2.x) * rmdr2.y),          //bl
-+                                           ValueType(rmdr2.x * rmdr2.y) };              //br
- 
-         // We're doing bounds checking because we'll fall off the edge of the reference otherwise.
-         for( int y=dparams.Yl(), ry=ref_start2.y, by=BChk(ry,m_ref_data2.LengthY()),by1=BChk(ry+1,m_ref_data2.LengthY()); 
-@@ -1564,14 +1564,14 @@
-     const MVector rmdr2( mv2.x & 3 , mv2.y & 3 );
- 
-     //weights for doing linear interpolation, calculated from the remainder values
--    const ValueType linear_wts1[4] = {  (4 - rmdr1.x) * (4 - rmdr1.y),    //tl
--                                       rmdr1.x * (4 - rmdr1.y),          //tr
--                                       (4 - rmdr1.x) * rmdr1.y,          //bl
--                                       rmdr1.x * rmdr1.y };              //br
--    const ValueType linear_wts2[4] = {  (4 - rmdr2.x) * (4 - rmdr2.y),    //tl
--                                       rmdr2.x * (4 - rmdr2.y),          //tr
--                                       (4 - rmdr2.x) * rmdr2.y,          //bl
--                                       rmdr2.x * rmdr2.y };              //br
-+    const ValueType linear_wts1[4] = {  ValueType((4 - rmdr1.x) * (4 - rmdr1.y)),    //tl
-+                                        ValueType(rmdr1.x * (4 - rmdr1.y)),          //tr
-+                                        ValueType((4 - rmdr1.x) * rmdr1.y),          //bl
-+                                        ValueType(rmdr1.x * rmdr1.y) };              //br
-+    const ValueType linear_wts2[4] = {  ValueType((4 - rmdr2.x) * (4 - rmdr2.y)),    //tl
-+                                        ValueType(rmdr2.x * (4 - rmdr2.y)),          //tr
-+                                        ValueType((4 - rmdr2.x) * rmdr2.y),          //bl
-+                                        ValueType(rmdr2.x * rmdr2.y) };              //br
- 
-     //Where to start in the upconverted images
-     const ImageCoords ref_start1( ( dparams.Xp()<<1 ) + roundvec1.x ,( dparams.Yp()<<1 ) + roundvec1.y );
-diff -aur dirac-1.0.2/util/conversion/common/bitmap.cpp dirac-1.0.2-modif/util/conversion/common/bitmap.cpp
---- dirac-1.0.2/util/conversion/common/bitmap.cpp	2004-06-30 20:44:52.000000000 +0400
-+++ dirac-1.0.2-modif/util/conversion/common/bitmap.cpp	2016-02-10 20:19:58.355494888 +0300
-@@ -142,14 +142,9 @@
-         char signature[2];
-         int fileSize;
-         int dataOffset;
--        int size;
-         int planes;
-         int bitCount;
-         int compression;
--        int imageSize;
--        int xPixelsPerM, yPixelsPerM;
--        int coloursUsed;
--        int coloursImportant;
-         //Define buffer to read bytes into.
-         const int bufferSize = 54;
-         char buffer[bufferSize];
-@@ -175,7 +170,7 @@
-         //Reposition input buffer to skip over extra header data if necessary
-         //Should check success of operation (see The C++ Stand Lib, Josuttis, p665)
-         if (dataOffset>54) inbuf.pubseekoff(dataOffset-54, std::ios_base::cur, std::ios_base::in);
--        size = read4bytes(buffer+14);
-+        (void)read4bytes(buffer+14); // size
-         w = read4bytes(buffer+18);
-         h = read4bytes(buffer+22);
-         if ( fileSize != (dataOffset + height()*lineBufferSize()) ) input.setstate(std::ios::failbit);
-@@ -185,11 +180,11 @@
-         if ( bitCount != 24 ) input.setstate(std::ios::failbit);
-         compression = read4bytes(buffer+30);
-         if ( compression != 0 ) input.setstate(std::ios::failbit);
--        imageSize = read4bytes(buffer+34);
--        xPixelsPerM = read4bytes(buffer+38);
--        yPixelsPerM = read4bytes(buffer+42);
--        coloursUsed = read4bytes(buffer+46);
--        coloursImportant = read4bytes(buffer+50);
-+        (void)read4bytes(buffer+34); // imageSize
-+        (void)read4bytes(buffer+38); // xPixelsPerM
-+        (void)read4bytes(buffer+42); // yPixelsPerM
-+        (void)read4bytes(buffer+46); // coloursUsed
-+        (void)read4bytes(buffer+50); // coloursImportant
-         return input; }
- 
- }  // end namespace dirac_vu
diff --git a/nixpkgs/pkgs/development/libraries/dleyna-core/setup-hook.sh b/nixpkgs/pkgs/development/libraries/dleyna-core/setup-hook.sh
index 87b5c67dff58..287ad4dc1897 100644
--- a/nixpkgs/pkgs/development/libraries/dleyna-core/setup-hook.sh
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/dlib/default.nix b/nixpkgs/pkgs/development/libraries/dlib/default.nix
index dfa5509fb98e..6d6bef21f39e 100644
--- a/nixpkgs/pkgs/development/libraries/dlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dlib/default.nix
@@ -7,13 +7,13 @@
 
 stdenv.mkDerivation rec {
   pname = "dlib";
-  version = "19.17";
+  version = "19.19";
 
   src = fetchFromGitHub {
     owner = "davisking";
     repo = "dlib";
     rev ="v${version}";
-    sha256 = "0g11ilma6cll3bd2ahm66j1sjb9v4rxz3xjbfkcg5pjsvb49n029";
+    sha256 = "0574p46zf85nx33cam4yqcg20g94kkmrvi5689r1xshprr0szghp";
   };
 
   postPatch = ''
diff --git a/nixpkgs/pkgs/development/libraries/double-conversion/default.nix b/nixpkgs/pkgs/development/libraries/double-conversion/default.nix
index bc4bc8b23524..4d8f623b36a4 100644
--- a/nixpkgs/pkgs/development/libraries/double-conversion/default.nix
+++ b/nixpkgs/pkgs/development/libraries/double-conversion/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, cmake }:
+{ stdenv, lib, fetchFromGitHub, cmake, static ? false }:
 
 stdenv.mkDerivation rec {
   pname = "double-conversion";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" ];
 
   # Case sensitivity issue
   preConfigure = lib.optionalString stdenv.isDarwin ''
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "Binary-decimal and decimal-binary routines for IEEE doubles";
-    homepage = https://github.com/google/double-conversion;
+    homepage = "https://github.com/google/double-conversion";
     license = licenses.bsd3;
     platforms = platforms.unix;
     maintainers = with maintainers; [ abbradar ];
diff --git a/nixpkgs/pkgs/development/libraries/dqlite/default.nix b/nixpkgs/pkgs/development/libraries/dqlite/default.nix
index 093abe085f0a..84b4b1bab77f 100644
--- a/nixpkgs/pkgs/development/libraries/dqlite/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dqlite/default.nix
@@ -1,24 +1,36 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libuv, sqlite-replication }:
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, file, libco-canonical
+, libuv, raft-canonical, sqlite-replication }:
 
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
   pname = "dqlite";
-  version = "0.2.6";
+  version = "1.0.0";
 
   src = fetchFromGitHub {
-    owner = "CanonicalLtd";
+    owner = "canonical";
     repo = pname;
     rev = "v${version}";
-    sha256 = "13l7na5858v2ah1vim6lafmzajgkymfi5rd6bk14cm4vcnxc40wb";
+    sha256 = "0670c1c84lcf5vl3h6mlff00fz2fnm766bzlk526sjjzysx3zjya";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook file pkgconfig ];
+  buildInputs = [ libco-canonical.dev libuv raft-canonical.dev 
+                  sqlite-replication ];
 
-  buildInputs = [ libuv sqlite-replication ];
+  preConfigure= ''
+    substituteInPlace configure --replace /usr/bin/ " "
+  '';
+
+  doCheck = true;
+
+  outputs = [ "dev" "out" ];
 
   meta = {
-    description = "Expose a SQLite database over the network and replicate it across a cluster of peers";
+    description = ''
+      Expose a SQLite database over the network and replicate it across a
+      cluster of peers
+    '';
     homepage = https://github.com/CanonicalLtd/dqlite/;
     license = licenses.asl20;
     maintainers = with maintainers; [ joko ];
diff --git a/nixpkgs/pkgs/development/libraries/drumstick/default.nix b/nixpkgs/pkgs/development/libraries/drumstick/default.nix
index 756a03503b35..92c97436d7a8 100644
--- a/nixpkgs/pkgs/development/libraries/drumstick/default.nix
+++ b/nixpkgs/pkgs/development/libraries/drumstick/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   pname = "drumstick";
-  version = "1.1.2";
+  version = "1.1.3";
 
   src = fetchurl {
     url = "mirror://sourceforge/drumstick/${version}/${pname}-${version}.tar.bz2";
-    sha256 = "0kljqyqj7s1i2z52i24x7ail1bywn6dcxxfbad5c59drm8wv94bp";
+    sha256 = "1n9wvg79yvkygrkc8xd8pgrd3d7hqmr7gh24dccf0px23lla9b3m";
   };
 
   outputs = [ "out" "dev" "man" ];
diff --git a/nixpkgs/pkgs/development/libraries/eclib/default.nix b/nixpkgs/pkgs/development/libraries/eclib/default.nix
index 6aaefd8a2cc6..765e13fffb91 100644
--- a/nixpkgs/pkgs/development/libraries/eclib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/eclib/default.nix
@@ -14,7 +14,7 @@ assert withFlint -> flint != null;
 
 stdenv.mkDerivation rec {
   pname = "eclib";
-  version = "20190226"; # upgrade might break the sage interface
+  version = "20190909"; # upgrade might break the sage interface
   # sage tests to run:
   # src/sage/interfaces/mwrank.py
   # src/sage/libs/eclib
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     owner = "JohnCremona";
     repo = pname;
     rev = "v${version}";
-    sha256 = "1910np1xzyjzszay24xn4b81qhpsvhp5aix9vdpknplni2mq8kwb";
+    sha256 = "0y1vdi4120gdw56gg2dn3wh625yr9wpyk3wpbsd25w4lv83qq5da";
   };
   buildInputs = [
     pari
diff --git a/nixpkgs/pkgs/development/libraries/egl-wayland/default.nix b/nixpkgs/pkgs/development/libraries/egl-wayland/default.nix
new file mode 100644
index 000000000000..fa2c3687ba77
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/egl-wayland/eglmesaext.patch b/nixpkgs/pkgs/development/libraries/egl-wayland/eglmesaext.patch
new file mode 100644
index 000000000000..9384ecff9b0f
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/enet/default.nix b/nixpkgs/pkgs/development/libraries/enet/default.nix
index c0df404e60eb..bf6260ca7664 100644
--- a/nixpkgs/pkgs/development/libraries/enet/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/epoxy/default.nix b/nixpkgs/pkgs/development/libraries/epoxy/default.nix
index aa7b2ee9a059..362607eed181 100644
--- a/nixpkgs/pkgs/development/libraries/epoxy/default.nix
+++ b/nixpkgs/pkgs/development/libraries/epoxy/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, utilmacros, python
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, utilmacros, python3
 , libGL, libX11
 }:
 
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig utilmacros python ];
+  nativeBuildInputs = [ autoreconfHook pkgconfig utilmacros python3 ];
   buildInputs = [ libGL libX11 ];
 
   preConfigure = optionalString stdenv.isDarwin ''
diff --git a/nixpkgs/pkgs/development/libraries/exempi/default.nix b/nixpkgs/pkgs/development/libraries/exempi/default.nix
index 22c812ba4c21..5638db712451 100644
--- a/nixpkgs/pkgs/development/libraries/exempi/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/expat/default.nix b/nixpkgs/pkgs/development/libraries/expat/default.nix
index ef2574019459..bb86ac57832a 100644
--- a/nixpkgs/pkgs/development/libraries/expat/default.nix
+++ b/nixpkgs/pkgs/development/libraries/expat/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "expat-2.2.7";
+  name = "expat-2.2.8";
 
   src = fetchurl {
-    url = "mirror://sourceforge/expat/${name}.tar.bz2";
-    sha256 = "067cfhqwiswm4zynw7xaxl59mrrimaiyjhnn8byxma1i98pi1jfb";
+    url = "https://github.com/libexpat/libexpat/releases/download/R_2_2_8/${name}.tar.xz";
+    sha256 = "16vpj5mk3lps3x7fr8cs03rffx3ir4jilyqw0frayn6q94daijk1";
   };
 
   outputs = [ "out" "dev" ]; # TODO: fix referrers
diff --git a/nixpkgs/pkgs/development/libraries/farbfeld/default.nix b/nixpkgs/pkgs/development/libraries/farbfeld/default.nix
index a29cbb9bbd11..a528ad6f7f61 100644
--- a/nixpkgs/pkgs/development/libraries/farbfeld/default.nix
+++ b/nixpkgs/pkgs/development/libraries/farbfeld/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ libpng libjpeg ];
   nativeBuildInputs = [ makeWrapper ];
 
-  installFlags = "PREFIX=/ DESTDIR=$(out)";
+  installFlags = [ "PREFIX=/" "DESTDIR=$(out)" ];
   postInstall = ''
     wrapProgram "$out/bin/2ff" --prefix PATH : "${file}/bin"
   '';
diff --git a/nixpkgs/pkgs/development/libraries/farstream/default.nix b/nixpkgs/pkgs/development/libraries/farstream/default.nix
index e884bb41e20e..763caa811e34 100644
--- a/nixpkgs/pkgs/development/libraries/farstream/default.nix
+++ b/nixpkgs/pkgs/development/libraries/farstream/default.nix
@@ -1,11 +1,19 @@
-{ stdenv, fetchurl, libnice, pkgconfig, pythonPackages, gstreamer, gst-plugins-base
-, gst-python, gupnp-igd, gobject-introspection
-, gst-plugins-good, gst-plugins-bad, gst-libav
+{ stdenv
+, fetchurl
+, fetchpatch
+, libnice
+, pkgconfig
+, autoreconfHook
+, gstreamer
+, gst-plugins-base
+, gupnp-igd
+, gobject-introspection
+, gst-plugins-good
+, gst-plugins-bad
+, gst-libav
 }:
 
-let
-  inherit (pythonPackages) python pygobject2;
-in stdenv.mkDerivation rec {
+stdenv.mkDerivation rec {
   name = "farstream-0.2.8";
 
   outputs = [ "out" "dev" ];
@@ -15,17 +23,36 @@ in stdenv.mkDerivation rec {
     sha256 = "0249ncd20x5mf884fd8bw75c3118b9fdml837v4fib349xmrqfrb";
   };
 
-  buildInputs = [ libnice python pygobject2 gupnp-igd libnice ];
+  patches = [
+    # Python has not been used for ages
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/farstream/farstream/commit/73891c28fa27d5e65a71762e826f13747d743588.patch";
+      sha256 = "19pw1m8xhxyf5yhl6k898w240ra2k0m28gfv858x70c4wl786lrn";
+    })
+  ];
+
+  buildInputs = [
+    libnice
+    gupnp-igd
+    libnice
+  ];
 
-  nativeBuildInputs = [ pkgconfig gobject-introspection ];
+  nativeBuildInputs = [
+    pkgconfig
+    autoreconfHook
+    gobject-introspection
+  ];
 
   propagatedBuildInputs = [
-    gstreamer gst-plugins-base gst-python
-    gst-plugins-good gst-plugins-bad gst-libav
+    gstreamer
+    gst-plugins-base
+    gst-plugins-good
+    gst-plugins-bad
+    gst-libav
   ];
 
   meta = with stdenv.lib; {
-    homepage = https://www.freedesktop.org/wiki/Software/Farstream;
+    homepage = "https://www.freedesktop.org/wiki/Software/Farstream";
     description = "Audio/Video Communications Framework formely known as farsight";
     platforms = platforms.linux;
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/faudio/default.nix b/nixpkgs/pkgs/development/libraries/faudio/default.nix
new file mode 100644
index 000000000000..1658d69d7a1b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/faudio/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchFromGitHub, cmake, SDL2}:
+
+#TODO: tests
+
+stdenv.mkDerivation rec {
+	pname = "faudio";
+  version = "19.12";
+
+  src = fetchFromGitHub {
+    owner = "FNA-XNA";
+    repo = "FAudio";
+    rev = version;
+    sha256 = "0y8dc7lnhh69wcwqma9spyxcahfhbfyg92h35sqkin6qfh5mngxr";
+  };
+
+	nativeBuildInputs = [cmake];
+
+  buildInputs = [ SDL2 ];
+
+  meta = with stdenv.lib; {
+    description = "XAudio reimplementation focusing to develop a fully accurate DirectX audio library";
+    homepage = "https://github.com/FNA-XNA/FAudio";
+    license = licenses.zlib;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.marius851000 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/fdk-aac/default.nix b/nixpkgs/pkgs/development/libraries/fdk-aac/default.nix
index 70269002e2fe..16560f19c861 100644
--- a/nixpkgs/pkgs/development/libraries/fdk-aac/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/fflas-ffpack/1.nix b/nixpkgs/pkgs/development/libraries/fflas-ffpack/1.nix
deleted file mode 100644
index 4a276db12c02..000000000000
--- a/nixpkgs/pkgs/development/libraries/fflas-ffpack/1.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{stdenv, fetchurl, autoreconfHook, givaro_3_7, pkgconfig, openblas, gmpxx}:
-stdenv.mkDerivation rec {
-  pname = "fflas-ffpack";
-  version = "1.6.0";
-  src = fetchurl {
-    url = "http://linalg.org/fflas-ffpack-${version}.tar.gz";
-    sha256 = "02fr675278c65hfiy1chb903j4ix9i8yni1xc2g5nmsjcaf9vra9";
-  };
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
-  buildInputs = [ givaro_3_7 openblas gmpxx];
-  configureFlags = [
-    "--with-blas=-lopenblas"
-    "--with-gmp=${gmpxx.dev}"
-    "--with-givaro=${givaro_3_7}"
-  ];
-  meta = {
-    inherit version;
-    description = ''Finite Field Linear Algebra Subroutines'';
-    license = stdenv.lib.licenses.lgpl21Plus;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
-    homepage = https://linbox-team.github.io/fflas-ffpack/;
-  };
-}
diff --git a/nixpkgs/pkgs/development/libraries/fflas-ffpack/default.nix b/nixpkgs/pkgs/development/libraries/fflas-ffpack/default.nix
index d46d997f6447..b7d5d79544e1 100644
--- a/nixpkgs/pkgs/development/libraries/fflas-ffpack/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fflas-ffpack/default.nix
@@ -30,24 +30,25 @@ stdenv.mkDerivation rec {
     "--with-lapack-libs=-l${blas.linkName}"
   ] ++ stdenv.lib.optionals stdenv.isx86_64 {
     # disable SIMD instructions (which are enabled *when available* by default)
-    default        = [ "--disable-sse3" "--disable-ssse3" "--disable-sse41" "--disable-sse42" "--disable-avx" "--disable-avx2" "--disable-fma" "--disable-fma4" ];
-    westmere       = [                                                                        "--disable-avx" "--disable-avx2" "--disable-fma" "--disable-fma4" ];
-    sandybridge    = [                                                                                        "--disable-avx2" "--disable-fma" "--disable-fma4" ];
-    ivybridge      = [                                                                                        "--disable-avx2" "--disable-fma" "--disable-fma4" ];
-    haswell        = [                                                                                                                         "--disable-fma4" ];
-    broadwell      = [                                                                                                                         "--disable-fma4" ];
-    skylake        = [                                                                                                                         "--disable-fma4" ];
-    skylake-avx512 = [                                                                                                                         "--disable-fma4" ];
+    # for now we need to be careful to disable *all* relevant versions of an instruction set explicitly (https://github.com/linbox-team/fflas-ffpack/issues/284)
+    default        = [ "--disable-sse3" "--disable-ssse3" "--disable-sse41" "--disable-sse42" "--disable-avx" "--disable-avx2" "--disable-avx512f" "--disable-avx512dq" "--disable-avx512vl" "--disable-fma" "--disable-fma4" ];
+    westmere       = [                                                                        "--disable-avx" "--disable-avx2" "--disable-avx512f" "--disable-avx512dq" "--disable-avx512vl" "--disable-fma" "--disable-fma4" ];
+    sandybridge    = [                                                                                        "--disable-avx2" "--disable-avx512f" "--disable-avx512dq" "--disable-avx512vl" "--disable-fma" "--disable-fma4" ];
+    ivybridge      = [                                                                                        "--disable-avx2" "--disable-avx512f" "--disable-avx512dq" "--disable-avx512vl" "--disable-fma" "--disable-fma4" ];
+    haswell        = [                                                                                                                                                                       "--disable-fma4" ];
+    broadwell      = [                                                                                                                                                                       "--disable-fma4" ];
+    skylake        = [                                                                                                                                                                       "--disable-fma4" ];
+    skylake-avx512 = [                                                                                                                                                                       "--disable-fma4" ];
   }.${stdenv.hostPlatform.platform.gcc.arch or "default"};
 
   doCheck = true;
 
-  meta = {
+  meta = with stdenv.lib; {
     inherit version;
     description = ''Finite Field Linear Algebra Subroutines'';
-    license = stdenv.lib.licenses.lgpl21Plus;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.unix;
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ raskin timokau ];
+    platforms = platforms.unix;
     homepage = https://linbox-team.github.io/fflas-ffpack/;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/ffmpeg-full/default.nix b/nixpkgs/pkgs/development/libraries/ffmpeg-full/default.nix
index 78d291e86fac..214da206f562 100644
--- a/nixpkgs/pkgs/development/libraries/ffmpeg-full/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ffmpeg-full/default.nix
@@ -3,7 +3,7 @@
  *  Licensing options (yes some are listed twice, filters and such are not listed)
  */
 , gplLicensing ? true # GPL: fdkaac,openssl,frei0r,cdio,samba,utvideo,vidstab,x265,x265,xavs,avid,zvbi,x11grab
-, version3Licensing ? true # (L)GPL3: opencore-amrnb,opencore-amrwb,samba,vo-aacenc,vo-amrwbenc
+, version3Licensing ? true # (L)GPL3: libvmaf,opencore-amrnb,opencore-amrwb,samba,vo-aacenc,vo-amrwbenc
 , nonfreeLicensing ? false # NONFREE: openssl,fdkaac,blackmagic-design-desktop-video
 /*
  *  Build options
@@ -87,6 +87,7 @@
 , libv4l ? null # Video 4 Linux support
 , libva ? null # Vaapi hardware acceleration
 , libvdpau ? null # Vdpau hardware acceleration
+, libvmaf ? null # Netflix's VMAF (Video Multi-Method Assessment Fusion)
 , libvorbis ? null # Vorbis de/encoding, native encoder exists
 , libvpx ? null # VP8 & VP9 de/encoding
 , libwebp ? null # WebP encoder
@@ -103,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
@@ -233,16 +234,16 @@ 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 {
   pname = "ffmpeg-full";
-  version = "4.2.1";
+  version = "4.2.2";
 
   src = fetchurl {
     url = "https://www.ffmpeg.org/releases/ffmpeg-${version}.tar.xz";
-    sha256 = "1m5nkc61ihgcf0b2wabm0zyqa8sj3c0w8fi6kr879lb0kdzciiyf";
+    sha256 = "176jn1lcdf0gk7sa5l2mv0faqp5dsqdhx1gqcrgymqhfmdal4xfb";
   };
 
   patches = [ ./prefer-libdav1d-over-libaom.patch ];
@@ -352,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")
@@ -364,6 +366,7 @@ stdenv.mkDerivation rec {
     (enableFeature ((isLinux || isFreeBSD) && libva != null) "vaapi")
     (enableFeature (libvdpau != null) "vdpau")
     (enableFeature (libvorbis != null) "libvorbis")
+    (enableFeature (!isAarch64 && libvmaf != null && version3Licensing) "libvmaf")
     (enableFeature (libvpx != null) "libvpx")
     (enableFeature (libwebp != null) "libwebp")
     (enableFeature (libX11 != null && libXv != null && libXext != null) "xlib")
@@ -422,9 +425,10 @@ 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
     ++ optionals isLinux [ alsaLib libraw1394 libv4l ]
     ++ optional (isLinux && !isAarch64 && libmfx != null) libmfx
     ++ optional nvenc nv-codec-headers
@@ -463,6 +467,6 @@ stdenv.mkDerivation rec {
         licenses.lgpl21Plus
     );
     platforms = platforms.all;
-    maintainers = with maintainers; [ codyopel fuuzetsu ];
+    maintainers = with maintainers; [ codyopel ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/ffmpeg/2.8.nix b/nixpkgs/pkgs/development/libraries/ffmpeg/2.8.nix
index 5ffbc215d8b3..3b3fc900edea 100644
--- a/nixpkgs/pkgs/development/libraries/ffmpeg/2.8.nix
+++ b/nixpkgs/pkgs/development/libraries/ffmpeg/2.8.nix
@@ -1,7 +1,7 @@
 { callPackage, ... } @ args:
 
-callPackage ./generic.nix (args // rec {
-  version = "${branch}.14";
+callPackage ./generic.nix (rec {
+  version = "${branch}.15";
   branch = "2.8";
-  sha256 = "1g6x3lyjl1zlfksizj1ys61kj97yg0xf4dlr6sr5acpbja3a26yn";
-})
+  sha256 = "08gf493a1ici1rn6gda6bxkcsk3fqbs6pdr0phcifjkd3xn7yr1m";
+} // args)
diff --git a/nixpkgs/pkgs/development/libraries/ffmpeg/3.4.nix b/nixpkgs/pkgs/development/libraries/ffmpeg/3.4.nix
index bea367b2554e..6c16b55dfe8d 100644
--- a/nixpkgs/pkgs/development/libraries/ffmpeg/3.4.nix
+++ b/nixpkgs/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";
+  branch = "3.4.7";
+  sha256 = "0hj91gjps92f4w3yyqss89yrs6s75574hbj5gz9g5affd6294yhc";
   darwinFrameworks = [ Cocoa CoreMedia ];
-})
+} // args)
diff --git a/nixpkgs/pkgs/development/libraries/ffmpeg/4.nix b/nixpkgs/pkgs/development/libraries/ffmpeg/4.nix
index a0b95cecaaba..31cb0477c21a 100644
--- a/nixpkgs/pkgs/development/libraries/ffmpeg/4.nix
+++ b/nixpkgs/pkgs/development/libraries/ffmpeg/4.nix
@@ -4,9 +4,9 @@
 , ...
 }@args:
 
-callPackage ./generic.nix (args // rec {
-  version = "4.2.1";
+callPackage ./generic.nix (rec {
+  version = "4.2.2";
   branch = "4.2";
-  sha256 = "090naa6rj46pzkgh03bf51hbqdz356qqckr2pw6pykc6ysiryak8";
+  sha256 = "0p0f024rxrpk8pgmrprhfywq10rvdhrs0422wwcwlxkgqa3x285n";
   darwinFrameworks = [ Cocoa CoreMedia VideoToolbox ];
-})
+} // args)
diff --git a/nixpkgs/pkgs/development/libraries/ffmpeg/generic.nix b/nixpkgs/pkgs/development/libraries/ffmpeg/generic.nix
index 4c0ca0210cc8..956d2d7223f6 100644
--- a/nixpkgs/pkgs/development/libraries/ffmpeg/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/ffmpeg/generic.nix
@@ -1,8 +1,10 @@
-{ stdenv, fetchurl, pkgconfig, perl, texinfo, yasm
+{ stdenv, fetchurl, pkgconfig, addOpenGLRunpath, perl, texinfo, yasm
 , 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
@@ -42,7 +44,7 @@
 
 let
   inherit (stdenv) isDarwin isFreeBSD isLinux isAarch32;
-  inherit (stdenv.lib) optional optionals enableFeature;
+  inherit (stdenv.lib) optional optionals optionalString enableFeature filter;
 
   cmpVer = builtins.compareVersions;
   reqMin = requiredVersion: (cmpVer requiredVersion branch != 1);
@@ -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 {
 
@@ -81,7 +85,7 @@ stdenv.mkDerivation rec {
   setOutputFlags = false; # doesn't accept all and stores configureFlags in libs!
 
   configurePlatforms = [];
-  configureFlags = [
+  configureFlags = filter (v: v != null) ([
       "--arch=${stdenv.hostPlatform.parsed.cpu.name}"
       "--target_os=${stdenv.hostPlatform.parsed.kernel.name}"
     # License
@@ -92,13 +96,15 @@ stdenv.mkDerivation rec {
       (ifMinVer "0.6" "--enable-pic")
       (enableFeature runtimeCpuDetectBuild "runtime-cpudetect")
       "--enable-hardcoded-tables"
+    ] ++
       (if multithreadBuild then (
          if stdenv.isCygwin then
-           "--disable-pthreads --enable-w32threads"
+           ["--disable-pthreads" "--enable-w32threads"]
          else # Use POSIX threads by default
-           "--enable-pthreads --disable-w32threads")
+           ["--enable-pthreads" "--disable-w32threads"])
        else
-         "--disable-pthreads --disable-w32threads")
+         ["--disable-pthreads" "--disable-w32threads"])
+    ++ [
       (ifMinVer "0.9" "--disable-os2threads") # We don't support OS/2
       "--enable-network"
       (ifMinVer "2.4" "--enable-pixelutils")
@@ -135,6 +141,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")
@@ -155,14 +163,16 @@ stdenv.mkDerivation rec {
   ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
       "--cross-prefix=${stdenv.cc.targetPrefix}"
       "--enable-cross-compile"
-  ] ++ optional stdenv.cc.isClang "--cc=clang";
+  ] ++ optional stdenv.cc.isClang "--cc=clang");
 
-  nativeBuildInputs = [ perl pkgconfig texinfo yasm ];
+  nativeBuildInputs = [ addOpenGLRunpath perl pkgconfig texinfo yasm ];
 
   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
@@ -186,6 +196,10 @@ stdenv.mkDerivation rec {
       substituteInPlace $pc \
         --replace "includedir=$out" "includedir=''${!outputInclude}"
     done
+  '' + optionalString stdenv.isLinux ''
+    # Set RUNPATH so that libnvcuvid in /run/opengl-driver(-32)/lib can be found.
+    # See the explanation in addOpenGLRunpath.
+    addOpenGLRunpath $out/lib/libavcodec.so*
   '';
 
   installFlags = [ "install-man" ];
@@ -206,7 +220,7 @@ stdenv.mkDerivation rec {
     '';
     license = licenses.gpl3;
     platforms = platforms.all;
-    maintainers = with maintainers; [ codyopel fuuzetsu ];
+    maintainers = with maintainers; [ codyopel ];
     inherit branch;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/ffmpegthumbnailer/default.nix b/nixpkgs/pkgs/development/libraries/ffmpegthumbnailer/default.nix
index 45238690fe03..6f5b1840c249 100644
--- a/nixpkgs/pkgs/development/libraries/ffmpegthumbnailer/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ffmpegthumbnailer/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   pname = "ffmpegthumbnailer";
-  version = "2.2.0";
+  version = "2.2.2";
 
   src = fetchFromGitHub {
     owner = "dirkvdb";
     repo = "ffmpegthumbnailer";
     rev = version;
-    sha256 = "0kl8aa547icy9b05njps02a8sw4yn4f8fzs228kig247sn09s4cp";
+    sha256 = "1bakbr714j7yxdal1f5iq0gcl4cxggbbgj227ihdh5kvygqlwich";
   };
 
   nativeBuildInputs = [ cmake pkgconfig ];
diff --git a/nixpkgs/pkgs/development/libraries/ffms/default.nix b/nixpkgs/pkgs/development/libraries/ffms/default.nix
index c404a12f3dfd..30fb94aa2483 100644
--- a/nixpkgs/pkgs/development/libraries/ffms/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/filter-audio/default.nix b/nixpkgs/pkgs/development/libraries/filter-audio/default.nix
index 07f1c7ec917a..3438bfee07b4 100644
--- a/nixpkgs/pkgs/development/libraries/filter-audio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/filter-audio/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false;
 
-  makeFlags = "PREFIX=$(out)";
+  makeFlags = [ "PREFIX=$(out)" ];
 
   meta = with stdenv.lib; {
     description = "Lightweight audio filtering library made from webrtc code";
diff --git a/nixpkgs/pkgs/development/libraries/flatbuffers/default.nix b/nixpkgs/pkgs/development/libraries/flatbuffers/default.nix
index d96ceb5d26b8..11e86703616c 100644
--- a/nixpkgs/pkgs/development/libraries/flatbuffers/default.nix
+++ b/nixpkgs/pkgs/development/libraries/flatbuffers/default.nix
@@ -1,14 +1,14 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ stdenv, fetchFromGitHub, fetchpatch, cmake }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (rec {
   pname = "flatbuffers";
-  version = "1.10.0";
+  version = "1.11.0";
 
   src = fetchFromGitHub {
     owner = "google";
     repo = "flatbuffers";
     rev = "v${version}";
-    sha256 = "1b32kc5jp83l43w2gs1dkw2vqm2j0wi7xfxqa86m18n3l41ca734";
+    sha256 = "1gl8pnykzifh7pnnvl80f5prmj5ga60dp44inpv9az2k9zaqx3qr";
   };
 
   preConfigure = stdenv.lib.optional stdenv.buildPlatform.isDarwin ''
@@ -34,4 +34,12 @@ stdenv.mkDerivation rec {
     platforms = stdenv.lib.platforms.unix;
     homepage = https://google.github.io/flatbuffers/;
   };
-}
+} // stdenv.lib.optionalAttrs stdenv.hostPlatform.isMusl {
+  # Remove when updating to the next version.
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/google/flatbuffers/commit/2b52494047fb6e97af03e1801b42adc7ed3fd78a.diff";
+      sha256 = "01k07ws0f4w7nnl8nli795wgjm4p94lxd3kva4yf7nf3pg4p8arx";
+    })
+  ];
+})
diff --git a/nixpkgs/pkgs/development/libraries/flatcc/default.nix b/nixpkgs/pkgs/development/libraries/flatcc/default.nix
index 8518545665c9..d49f6d110de6 100644
--- a/nixpkgs/pkgs/development/libraries/flatcc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/flatcc/default.nix
@@ -5,13 +5,13 @@
 
 stdenv.mkDerivation rec {
   pname = "flatcc";
-  version = "0.5.3";
+  version = "0.6.0";
 
   src = fetchFromGitHub {
     owner = "dvidelabs";
     repo = "flatcc";
     rev = "v${version}";
-    sha256 = "06wnwvnkhw1rk0y3nncjmcyjy3bgpw8i9xqd5gpbhbrm38718cjk";
+    sha256 = "0cy79swgdbaf3zmsaqa6gz3b0fad2yqawwcnsipnpl9d8hn1linm";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/development/libraries/flatpak/default.nix b/nixpkgs/pkgs/development/libraries/flatpak/default.nix
index d29be4cb9304..c0a3d3718f34 100644
--- a/nixpkgs/pkgs/development/libraries/flatpak/default.nix
+++ b/nixpkgs/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
@@ -52,15 +52,14 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # TODO: some issues with temporary files
 
-  NIX_LDFLAGS = [
-    "-lpthread"
-  ];
+  NIX_LDFLAGS = "-lpthread";
 
   enableParallelBuilding = true;
 
   configureFlags = [
     "--with-system-bubblewrap=${bubblewrap}/bin/bwrap"
     "--with-system-dbus-proxy=${xdg-dbus-proxy}/bin/xdg-dbus-proxy"
+    "--with-dbus-config-dir=${placeholder "out"}/share/dbus-1/system.d"
     "--localstatedir=/var"
     "--enable-installed-tests"
   ];
@@ -75,6 +74,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/nixpkgs/pkgs/development/libraries/flint/default.nix b/nixpkgs/pkgs/development/libraries/flint/default.nix
index 20a80119b136..462d186c72df 100644
--- a/nixpkgs/pkgs/development/libraries/flint/default.nix
+++ b/nixpkgs/pkgs/development/libraries/flint/default.nix
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
   ];
 
   # issues with ntl -- https://github.com/wbhart/flint2/issues/487
-  NIX_CXXSTDLIB_COMPILE = [ "-std=c++11" ];
+  NIX_CXXSTDLIB_COMPILE = "-std=c++11";
 
   patches = [
     (fetchpatch {
diff --git a/nixpkgs/pkgs/development/libraries/fltk/1.4.nix b/nixpkgs/pkgs/development/libraries/fltk/1.4.nix
index eebe119d142f..1fe50b402cb6 100644
--- a/nixpkgs/pkgs/development/libraries/fltk/1.4.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/fltk/default.nix b/nixpkgs/pkgs/development/libraries/fltk/default.nix
index a22b5eef8d2e..fe7de504b4f3 100644
--- a/nixpkgs/pkgs/development/libraries/fltk/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/folks/default.nix b/nixpkgs/pkgs/development/libraries/folks/default.nix
index 84ab5fedebcd..38e4d2c6884a 100644
--- a/nixpkgs/pkgs/development/libraries/folks/default.nix
+++ b/nixpkgs/pkgs/development/libraries/folks/default.nix
@@ -30,13 +30,13 @@
 
 stdenv.mkDerivation rec {
   pname = "folks";
-  version = "0.12.1";
+  version = "0.13.1";
 
   outputs = [ "out" "dev" ];
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0xfl6rnzhdbmw1q26xiq34cdiy7a9karpi2r7wyplnnz1zaz5a9w";
+    sha256 = "0pda8sx4ap3lyri5fdrnakl29la1zkhwlc9bmnp13qigp1iwdw9x";
   };
 
   mesonFlags = [
diff --git a/nixpkgs/pkgs/development/libraries/folly/default.nix b/nixpkgs/pkgs/development/libraries/folly/default.nix
index b072df506a99..15f29ce77f59 100644
--- a/nixpkgs/pkgs/development/libraries/folly/default.nix
+++ b/nixpkgs/pkgs/development/libraries/folly/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   pname = "folly";
-  version = "2019.08.05.00";
+  version = "2019.11.11.00";
 
   src = fetchFromGitHub {
     owner = "facebook";
     repo = "folly";
     rev = "v${version}";
-    sha256 = "03arl9hg06rzbyaf3fzyk7q8d5mfbzfwmhqnfnvqcgzlqdj0gaa5";
+    sha256 = "1sgv7sdalbs7zhz3zcc95gn2h8j2xjf7hkw2c618zc3pdn6aa58w";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/development/libraries/fontconfig-ultimate/default.nix b/nixpkgs/pkgs/development/libraries/fontconfig-ultimate/default.nix
deleted file mode 100644
index b95d6dd559d4..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/fontconfig/2.10.nix b/nixpkgs/pkgs/development/libraries/fontconfig/2.10.nix
index 1d66735569d5..635baff796b7 100644
--- a/nixpkgs/pkgs/development/libraries/fontconfig/2.10.nix
+++ b/nixpkgs/pkgs/development/libraries/fontconfig/2.10.nix
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   # Don't try to write to /var/cache/fontconfig at install time.
-  installFlags = "sysconfdir=$(out)/etc fc_cachedir=$(TMPDIR)/dummy RUN_FC_CACHE_TEST=false";
+  installFlags = [ "sysconfdir=$(out)/etc" "fc_cachedir=$(TMPDIR)/dummy" "RUN_FC_CACHE_TEST=false" ];
 
   passthru = {
     # Empty for backward compatibility, there was no versioning before 2.11
diff --git a/nixpkgs/pkgs/development/libraries/fontconfig/default.nix b/nixpkgs/pkgs/development/libraries/fontconfig/default.nix
index 5c9a0ecc71b7..617e058bd8fc 100644
--- a/nixpkgs/pkgs/development/libraries/fontconfig/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fontconfig/default.nix
@@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   # Don't try to write to /var/cache/fontconfig at install time.
-  installFlags = "fc_cachedir=$(TMPDIR)/dummy RUN_FC_CACHE_TEST=false";
+  installFlags = [ "fc_cachedir=$(TMPDIR)/dummy" "RUN_FC_CACHE_TEST=false" ];
 
   postInstall = ''
     cd "$out/etc/fonts"
diff --git a/nixpkgs/pkgs/development/libraries/fontconfig/make-fonts-cache.nix b/nixpkgs/pkgs/development/libraries/fontconfig/make-fonts-cache.nix
index 5b98d6523b9a..f1a2e865bb73 100644
--- a/nixpkgs/pkgs/development/libraries/fontconfig/make-fonts-cache.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/forge/default.nix b/nixpkgs/pkgs/development/libraries/forge/default.nix
new file mode 100644
index 000000000000..83630aef9aa8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/forge/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchFromGitHub, cmake, pkgconfig
+, arrayfire, expat, fontconfig, freeimage, freetype, boost
+, mesa, libGLU, libGL, glfw3, SDL2, cudatoolkit
+}:
+
+stdenv.mkDerivation rec {
+  pname = "forge";
+  version = "1.0.4";
+
+  src = fetchFromGitHub {
+    owner = "arrayfire";
+    repo = "forge";
+    rev = "v${version}";
+    sha256 = "00pmky6kccd7pwi8sma79qpmzr2f9pbn6gym3gyqm64yckw6m484";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [
+    cmake
+    pkgconfig
+  ];
+
+  buildInputs = [
+    expat
+    fontconfig
+    freetype
+    boost.out
+    boost.dev
+    freeimage
+    mesa
+    libGLU libGL
+    glfw3
+    SDL2
+    cudatoolkit
+    arrayfire
+  ];
+
+  meta = with stdenv.lib; {
+    description = "An OpenGL interop library that can be used with ArrayFire or any other application using CUDA or OpenCL compute backend";
+    longDescription = ''
+      An OpenGL interop library that can be used with ArrayFire or any other application using CUDA or OpenCL compute backend.
+      The goal of Forge is to provide high performance OpenGL visualizations for C/C++ applications that use CUDA/OpenCL.
+      Forge uses OpenGL >=3.3 forward compatible contexts, so please make sure you have capable hardware before trying it out.
+    '';
+    license = licenses.bsd3;
+    homepage = "https://arrayfire.com/";
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ chessai ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/fox/fox-1.6.nix b/nixpkgs/pkgs/development/libraries/fox/fox-1.6.nix
index af387b7232f4..bb59a34b1cc7 100644
--- a/nixpkgs/pkgs/development/libraries/fox/fox-1.6.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/fplll/default.nix b/nixpkgs/pkgs/development/libraries/fplll/default.nix
index c2952cb47f1c..f53d55c2ca94 100644
--- a/nixpkgs/pkgs/development/libraries/fplll/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/freeglut/default.nix b/nixpkgs/pkgs/development/libraries/freeglut/default.nix
index 8412248b6170..16c35347bc5d 100644
--- a/nixpkgs/pkgs/development/libraries/freeglut/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/freenect/default.nix b/nixpkgs/pkgs/development/libraries/freenect/default.nix
index 41480789a08a..9520542481c8 100644
--- a/nixpkgs/pkgs/development/libraries/freenect/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/freetds/default.nix b/nixpkgs/pkgs/development/libraries/freetds/default.nix
index 0ff9cea3d27c..855ca0385dfd 100644
--- a/nixpkgs/pkgs/development/libraries/freetds/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/fribidi/default.nix b/nixpkgs/pkgs/development/libraries/fribidi/default.nix
index 9798347eaddf..3b0b30f573b5 100644
--- a/nixpkgs/pkgs/development/libraries/fribidi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fribidi/default.nix
@@ -10,20 +10,21 @@
 
 stdenv.mkDerivation rec {
   pname = "fribidi";
-  version = "1.0.5";
+  version = "1.0.7";
 
   outputs = [ "out" "devdoc" ];
 
-  # NOTE: 2018-06-06 v1.0.5: Only URL tarball has "Have pre-generated man pages: true", which works-around upstream usage of some rare ancient `c2man` fossil application.
+  # NOTE: Only URL tarball has "Have pre-generated man pages: true", which works-around upstream usage of some rare ancient `c2man` fossil application.
   src = fetchurl {
     url = "https://github.com/fribidi/fribidi/releases/download/v${version}/${pname}-${version}.tar.bz2";
-    sha256 = "1kp4b1hpx2ky20ixgy2xhj5iygfl7ps5k9kglh1z5i7mhykg4r3a";
+    sha256 = "0pckda4fcn0aw32lpycwdp25r2m7vca8zspq815ppi9gkwgg5das";
   };
 
   patches = [
     (fetchpatch {
-      url = "https://github.com/fribidi/fribidi/pull/88.patch";
-      sha256 = "1n4l6333vhbxfckwg101flmvq6bbygg66fjp69ddcjqaqb6gh9k9";
+      name = "CVE-2019-18397.patch";
+      url = "https://github.com/fribidi/fribidi/commit/034c6e9a1d296286305f4cfd1e0072b879f52568.patch";
+      sha256 = "102xrbf1l5gvavkxd6csx8pj3rlgcw10c0y4h4d40yhn84b1p0y8";
     })
   ];
 
diff --git a/nixpkgs/pkgs/development/libraries/fstrm/default.nix b/nixpkgs/pkgs/development/libraries/fstrm/default.nix
index 380f64cf523f..40ffe6918a4f 100644
--- a/nixpkgs/pkgs/development/libraries/fstrm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fstrm/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "fstrm";
-  version = "0.5.0";
+  version = "0.6.0";
 
   src = fetchFromGitHub {
     owner = "farsightsec";
     repo = "fstrm";
     rev = "v${version}";
-    sha256 = "1vm880h6vpnxqh7v0x17yfim6f2fbxwkm03ms58s2h9akmph9xm5";
+    sha256 = "0b6x9wgyn92vykkmd3ynhnpbdl77zb4wf4rm7p0h8p9pwq953hdm";
   };
 
   outputs = [ "bin" "out" "dev" ];
diff --git a/nixpkgs/pkgs/development/libraries/ftgl/default.nix b/nixpkgs/pkgs/development/libraries/ftgl/default.nix
index 289a57399854..a99228efcf4d 100644
--- a/nixpkgs/pkgs/development/libraries/ftgl/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gaia/default.nix b/nixpkgs/pkgs/development/libraries/gaia/default.nix
new file mode 100644
index 000000000000..b154f80c1dd2
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gamin/default.nix b/nixpkgs/pkgs/development/libraries/gamin/default.nix
index 4cff22457403..611c9faa851f 100644
--- a/nixpkgs/pkgs/development/libraries/gamin/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gamin/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, python, pkgconfig, glib }:
+{ stdenv, fetchurl, fetchpatch, pkgconfig, glib }:
 
 stdenv.mkDerivation (rec {
   name = "gamin-0.1.10";
@@ -10,13 +10,13 @@ stdenv.mkDerivation (rec {
 
   nativeBuildInputs = [ pkgconfig ];
 
-  buildInputs = [ python glib ];
+  buildInputs = [ glib ];
 
   # `_GNU_SOURCE' is needed, e.g., to get `struct ucred' from
   # <sys/socket.h> with Glibc 2.9.
   configureFlags = [
     "--disable-debug"
-    "--with-python=${python}"
+    "--without-python" # python3 not supported
     "CPPFLAGS=-D_GNU_SOURCE"
   ];
 
@@ -44,4 +44,3 @@ stdenv.mkDerivation (rec {
     sed -i 's/,--version-script=.*$/\\/' libgamin/Makefile
   '';
 })
-
diff --git a/nixpkgs/pkgs/development/libraries/garmintools/default.nix b/nixpkgs/pkgs/development/libraries/garmintools/default.nix
index c1f9c6ad0137..a086648c9124 100644
--- a/nixpkgs/pkgs/development/libraries/garmintools/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gcab/default.nix b/nixpkgs/pkgs/development/libraries/gcab/default.nix
index ee5988b30f57..c05bb95913e6 100644
--- a/nixpkgs/pkgs/development/libraries/gcab/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gcab/installed-tests-path.patch b/nixpkgs/pkgs/development/libraries/gcab/installed-tests-path.patch
new file mode 100644
index 000000000000..ab3b6b3fae3f
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gcr/default.nix b/nixpkgs/pkgs/development/libraries/gcr/default.nix
index dcb4df1419ec..cf0f22fdd408 100644
--- a/nixpkgs/pkgs/development/libraries/gcr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gcr/default.nix
@@ -1,53 +1,84 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gnupg, p11-kit, glib
-, libgcrypt, libtasn1, dbus-glib, gtk3, pango, gdk-pixbuf, atk
-, gobject-introspection, makeWrapper, libxslt, vala, gnome3
-, python2 }:
+{ 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.28.1";
+  version = "3.34.0";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "12qn7mcmxb45lz1gq3s3b34rimiyrrshkrpvxdw1fc0w26i4l84m";
-  };
-
-  passthru = {
-    updateScript = gnome3.updateScript { packageName = pname; };
+    sha256 = "0925snsixzkwh49xiayqmj6fcrmklqk8kyy0jkv7m64h9abm1pr9";
   };
 
   postPatch = ''
-    patchShebangs .
+    patchShebangs build/ gcr/fixtures/
   '';
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig intltool gobject-introspection libxslt makeWrapper vala ];
+  nativeBuildInputs = [
+    pkgconfig
+    gettext
+    gobject-introspection
+    libxslt
+    makeWrapper
+    vala
+  ];
+
+  buildInputs = [
+    gnupg
+    libgcrypt
+    libtasn1
+    pango
+  ];
 
-  buildInputs = let
-    gpg = gnupg.override { guiSupport = false; }; # prevent build cycle with pinentry_gnome
-  in [
-    gpg libgcrypt libtasn1 dbus-glib pango gdk-pixbuf atk
+  propagatedBuildInputs = [
+    glib
+    gtk3
+    p11-kit
   ];
 
-  propagatedBuildInputs = [ glib gtk3 p11-kit ];
+  checkInputs = [
+    python3
+  ];
 
-  checkInputs = [ python2 ];
   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/nixpkgs/pkgs/development/libraries/gdal/2.4.0.nix b/nixpkgs/pkgs/development/libraries/gdal/2.4.0.nix
index baf847d4e0a2..f914a112e106 100644
--- a/nixpkgs/pkgs/development/libraries/gdal/2.4.0.nix
+++ b/nixpkgs/pkgs/development/libraries/gdal/2.4.0.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, fetchpatch, unzip, libjpeg, libtiff, zlib
-, postgresql, mysql, libgeotiff, pythonPackages, proj, geos, openssl
+, postgresql, libmysqlclient, libgeotiff, pythonPackages, proj, geos, openssl
 , libpng, sqlite, libspatialite, poppler, hdf4, qhull, giflib, expat
 , libiconv, libxml2
 , netcdfSupport ? true, netcdf, hdf5, curl
@@ -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 ])
@@ -30,7 +39,7 @@ stdenv.mkDerivation rec {
     "--with-poppler=${poppler.dev}" # optional
     "--with-libz=${zlib.dev}"       # optional
     "--with-pg=${postgresql}/bin/pg_config"
-    "--with-mysql=${mysql.connector-c or mysql}/bin/mysql_config"
+    "--with-mysql=${libmysqlclient}/bin/mysql_config"
     "--with-geotiff=${libgeotiff.dev}"
     "--with-sqlite3=${sqlite.dev}"
     "--with-spatialite=${libspatialite}"
diff --git a/nixpkgs/pkgs/development/libraries/gdal/default.nix b/nixpkgs/pkgs/development/libraries/gdal/default.nix
index 413d4e19dde7..922877f6f461 100644
--- a/nixpkgs/pkgs/development/libraries/gdal/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gdal/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchFromGitHub, fetchpatch, unzip, libjpeg, libtiff, zlib
-, postgresql, mysql, libgeotiff, pythonPackages, proj, geos, openssl
+, postgresql, libmysqlclient, libgeotiff, pythonPackages, proj, geos, openssl
 , libpng, sqlite, libspatialite, poppler, hdf4, qhull, giflib, expat
 , libiconv, libxml2, autoreconfHook
 , netcdfSupport ? true, netcdf, hdf5, curl
@@ -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 ];
 
@@ -38,7 +46,7 @@ stdenv.mkDerivation rec {
     "--with-poppler=${poppler.dev}" # optional
     "--with-libz=${zlib.dev}"       # optional
     "--with-pg=${postgresql}/bin/pg_config"
-    "--with-mysql=${mysql.connector-c or mysql}/bin/mysql_config"
+    "--with-mysql=${libmysqlclient}/bin/mysql_config"
     "--with-geotiff=${libgeotiff}"
     "--with-sqlite3=${sqlite.dev}"
     "--with-spatialite=${libspatialite}"
diff --git a/nixpkgs/pkgs/development/libraries/gdal/gdal-1_11.nix b/nixpkgs/pkgs/development/libraries/gdal/gdal-1_11.nix
index a65740534146..6a086d9c998d 100644
--- a/nixpkgs/pkgs/development/libraries/gdal/gdal-1_11.nix
+++ b/nixpkgs/pkgs/development/libraries/gdal/gdal-1_11.nix
@@ -40,9 +40,7 @@ stdenv.mkDerivation rec {
   ];
 
   # Allow use of old proj_api.h
-  NIX_CFLAGS_COMPILE = [
-    "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"
-  ];
+  NIX_CFLAGS_COMPILE = "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1";
 
   # Prevent this:
   #
diff --git a/nixpkgs/pkgs/development/libraries/gdata-sharp/default.nix b/nixpkgs/pkgs/development/libraries/gdata-sharp/default.nix
index 1a3447f6674f..58036351a09f 100644
--- a/nixpkgs/pkgs/development/libraries/gdata-sharp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gdata-sharp/default.nix
@@ -37,5 +37,6 @@ in stdenv.mkDerivation {
 
     license = licenses.asl20;
     platforms = platforms.linux;
+    broken = true;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/gdbm/default.nix b/nixpkgs/pkgs/development/libraries/gdbm/default.nix
index 972e9022235a..830a311db706 100644
--- a/nixpkgs/pkgs/development/libraries/gdbm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gdbm/default.nix
@@ -4,9 +4,6 @@ stdenv.mkDerivation rec {
   pname = "gdbm";
   version = "1.18.1";
 
-  # FIXME: remove on update to > 1.18.1
-  NIX_CFLAGS_COMPILE = if stdenv.cc.isClang then "-Wno-error=return-type" else null;
-
   src = fetchurl {
     url = "mirror://gnu/gdbm/${pname}-${version}.tar.gz";
     sha256 = "1p4ibds6z3ccy65lkmd6lm7js0kwifvl53r0fd759fjxgr917rl6";
diff --git a/nixpkgs/pkgs/development/libraries/gdcm/default.nix b/nixpkgs/pkgs/development/libraries/gdcm/default.nix
index 29a30a1b157d..0b5e0af84ba2 100644
--- a/nixpkgs/pkgs/development/libraries/gdcm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gdcm/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, cmake, vtk, darwin }:
 
 stdenv.mkDerivation rec {
-  version = "3.0.1";
+  version = "3.0.4";
   pname = "gdcm";
 
   src = fetchurl {
     url = "mirror://sourceforge/gdcm/${pname}-${version}.tar.bz2";
-    sha256 = "1n206rr28f9ysd5yns6hc6vxwhwj1ck59p2j1wqyclm60zr84isq";
+    sha256 = "0g46l7fjvn37sg29m0nb7wlnnpnxmlm9ryp7vam26ni02l73paid";
   };
 
   dontUseCmakeBuildDir = true;
@@ -16,11 +16,11 @@ stdenv.mkDerivation rec {
     cd ../build
   '';
 
-  cmakeFlags = ''
-    -DGDCM_BUILD_APPLICATIONS=ON
-    -DGDCM_BUILD_SHARED_LIBS=ON
-    -DGDCM_USE_VTK=ON
-  '';
+  cmakeFlags = [
+    "-DGDCM_BUILD_APPLICATIONS=ON"
+    "-DGDCM_BUILD_SHARED_LIBS=ON"
+    "-DGDCM_USE_VTK=ON"
+  ];
 
   enableParallelBuilding = true;
   buildInputs = [ cmake vtk ] ++ stdenv.lib.optional stdenv.isDarwin [ darwin.apple_sdk.frameworks.ApplicationServices darwin.apple_sdk.frameworks.Cocoa ];
diff --git a/nixpkgs/pkgs/development/libraries/gdk-pixbuf/default.nix b/nixpkgs/pkgs/development/libraries/gdk-pixbuf/default.nix
index 59e7808057f4..9c2da3c5b695 100644
--- a/nixpkgs/pkgs/development/libraries/gdk-pixbuf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gdk-pixbuf/default.nix
@@ -1,16 +1,16 @@
-{ 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";
-  version = "2.38.1";
+  version = "2.40.0";
 in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
-    sha256 = "0fmbjgjcyym3qg46f64qgl7icdm4ii77flyc1mhk244rp8vgi7zi";
+    sha256 = "1rnlx9yfw970maxi2x6niaxmih5la11q1ilr7gzshz2kk585k0hm";
   };
 
   patches = [
@@ -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/nixpkgs/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh b/nixpkgs/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
index 5a7dcd792996..06958be32131 100644
--- a/nixpkgs/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gdl/default.nix b/nixpkgs/pkgs/development/libraries/gdl/default.nix
index 45a29e15ede8..c4baaa3fae98 100644
--- a/nixpkgs/pkgs/development/libraries/gdl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gdl/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "gdl";
-  version = "3.28.0";
+  version = "3.34.0";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gdl/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1dipnzqpxl0yfwzl2lqdf6vb3174gb9f1d5jndkq8505q7n9ik2j";
+    sha256 = "00ldva6wg6s4wlxmisiqzyz8ihsprra7sninx2rlqk6frpq312w5";
   };
 
   nativeBuildInputs = [ pkgconfig intltool ];
diff --git a/nixpkgs/pkgs/development/libraries/gegl/4.0.nix b/nixpkgs/pkgs/development/libraries/gegl/4.0.nix
index 0e3f79b1814c..b3e8ec2e1780 100644
--- a/nixpkgs/pkgs/development/libraries/gegl/4.0.nix
+++ b/nixpkgs/pkgs/development/libraries/gegl/4.0.nix
@@ -1,31 +1,135 @@
-{ stdenv, fetchurl, pkgconfig, glib, babl, libpng, cairo, libjpeg, which
-, librsvg, pango, gtk, bzip2, json-glib, gettext, autoreconfHook, libraw
-, gexiv2, libwebp, libintl }:
+{ stdenv
+, fetchurl
+, fetchpatch
+, pkgconfig
+, vala
+, gobject-introspection
+, gtk-doc
+, docbook_xsl
+, docbook_xml_dtd_43
+, glib
+, babl
+, libpng
+, cairo
+, libjpeg
+, librsvg
+, lensfun
+, libspiro
+, netsurf
+, pango
+, poly2tri-c
+, bzip2
+, json-glib
+, gettext
+, meson
+, ninja
+, libraw
+, gexiv2
+, libwebp
+, luajit
+, openexr
+, OpenCL
+}:
 
 stdenv.mkDerivation rec {
   pname = "gegl";
-  version = "0.4.16";
+  version = "0.4.18";
 
   outputs = [ "out" "dev" "devdoc" ];
   outputBin = "dev";
 
   src = fetchurl {
-    url = "https://download.gimp.org/pub/gegl/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
-    sha256 = "0njydcr6qdmfzh4fxx544681qxdpf7y6b2f47jcypn810dlxy4h1";
+    url = "https://download.gimp.org/pub/gegl/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0r6akqnrkvxizyhyi8sv40mxm7j4bcwjb6mqjpxy0zzbbfsdyin9";
   };
 
-  enableParallelBuilding = true;
+  patches = [
+    # Fix arch detection.
+    # https://gitlab.gnome.org/GNOME/gegl/merge_requests/53
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/gegl/commit/6bcf95fd0f32cf5e8b1ddbe17b14d9ad049bded8.patch";
+      sha256 = "0aqdr3y5mr47wq44jnhp97188bvpjlf56zrlmn8aazdf07r2apma";
+    })
 
-  doCheck = true;
+    # Fix Darwin build.
+    # https://gitlab.gnome.org/GNOME/gegl/merge_requests/54
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/gegl/commit/2bc06bfedee4fb25f6a966c8235b75292e24e55f.patch";
+      sha256 = "1psls61wsrdq5pzpvj22mrm46lpzrw3wkx6li7dv6fyb65wz2n4d";
+    })
+
+    # Fix test timeout. Downstream debian patch.
+    (fetchpatch {
+      url = "https://salsa.debian.org/gnome-team/gegl/raw/9b7520b38d87cd8ad4b39bf0b8c62d011da25169/debian/patches/increase_test_timeout.patch";
+      sha256 = "1prc1h1aipjd9db0i1j7nzga4zvk3vl8qsjpz1jzv1wwvz02isly";
+    })
+
+    # Remove gegl:simple / backend-file test that times out frequently
+    ./patches/no-simple-backend-file-test.patch
+  ];
+
+  nativeBuildInputs = [
+    pkgconfig
+    gettext
+    meson
+    ninja
+    vala
+    gobject-introspection
+    gtk-doc
+    docbook_xsl
+    docbook_xml_dtd_43
+  ];
 
   buildInputs = [
-    libpng cairo libjpeg librsvg pango gtk bzip2
-    libraw libwebp gexiv2
+    libpng
+    cairo
+    libjpeg
+    librsvg
+    lensfun
+    libspiro
+    netsurf.libnsgif
+    pango
+    poly2tri-c
+    bzip2
+    libraw
+    libwebp
+    gexiv2
+    luajit
+    openexr
+  ] ++ stdenv.lib.optional stdenv.isDarwin OpenCL;
+
+  # for gegl-4.0.pc
+  propagatedBuildInputs = [
+    glib
+    json-glib
+    babl
+  ];
+
+  mesonFlags = [
+    "-Ddocs=true"
+    "-Dmrg=disabled" # not sure what that is
+    "-Dsdl2=disabled"
+    "-Dpygobject=disabled"
+    "-Dlibav=disabled"
+    "-Dlibv4l=disabled"
+    "-Dlibv4l2=disabled"
+    "-Dumfpack=disabled"
+    # Disabled due to multiple vulnerabilities, see
+    # https://github.com/NixOS/nixpkgs/pull/73586
+    "-Djasper=disabled"
   ];
 
-  propagatedBuildInputs = [ glib json-glib babl ]; # for gegl-4.0.pc
+  # TODO: Fix missing math symbols in gegl seamless clone.
+  # It only appears when we use packaged poly2tri-c instead of vendored one.
+  NIX_CFLAGS_COMPILE = "-lm";
+
+  postPatch = ''
+    chmod +x tests/opencl/opencl_test.sh tests/buffer/buffer-tests-run.sh
+    patchShebangs tests/ff-load-save/tests_ff_load_save.sh tests/opencl/opencl_test.sh tests/buffer/buffer-tests-run.sh tools/xml_insert.sh
+  '';
 
-  nativeBuildInputs = [ pkgconfig gettext which autoreconfHook libintl ];
+  # tests fail to connect to the com.apple.fonts daemon in sandboxed mode
+  doCheck = !stdenv.isDarwin;
 
   meta = with stdenv.lib; {
     description = "Graph-based image processing framework";
diff --git a/nixpkgs/pkgs/development/libraries/gegl/patches/no-simple-backend-file-test.patch b/nixpkgs/pkgs/development/libraries/gegl/patches/no-simple-backend-file-test.patch
new file mode 100644
index 000000000000..bf07572182b3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gegl/patches/no-simple-backend-file-test.patch
@@ -0,0 +1,10 @@
+diff --git a/tests/simple/meson.build b/tests/simple/meson.build
+index 2c735d80a..ae4d50f2a 100644
+--- a/tests/simple/meson.build
++++ b/tests/simple/meson.build
+@@ -1,5 +1,4 @@
+ testnames = [
+-  'backend-file',
+   'buffer-cast',
+   'buffer-changes',
+   'buffer-extract',
diff --git a/nixpkgs/pkgs/development/libraries/geis/default.nix b/nixpkgs/pkgs/development/libraries/geis/default.nix
index 97b9ba087e28..1b3d5ba4b7c0 100644
--- a/nixpkgs/pkgs/development/libraries/geis/default.nix
+++ b/nixpkgs/pkgs/development/libraries/geis/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     sha256 = "1svhbjibm448ybq6gnjjzj0ak42srhihssafj0w402aj71lgaq4a";
   };
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=misleading-indentation" "-Wno-error=pointer-compare" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error=misleading-indentation -Wno-error=pointer-compare";
 
   hardeningDisable = [ "format" ];
 
diff --git a/nixpkgs/pkgs/development/libraries/geoclue/default.nix b/nixpkgs/pkgs/development/libraries/geoclue/default.nix
index cc2037791e01..8d94dacbb61b 100644
--- a/nixpkgs/pkgs/development/libraries/geoclue/default.nix
+++ b/nixpkgs/pkgs/development/libraries/geoclue/default.nix
@@ -7,14 +7,14 @@ with stdenv.lib;
 
 stdenv.mkDerivation rec {
   pname = "geoclue";
-  version = "2.5.3";
+  version = "2.5.5";
 
   src = fetchFromGitLab {
     domain = "gitlab.freedesktop.org";
     owner = pname;
     repo = pname;
     rev = version;
-    sha256 = "1wbpi74dw3p7izxwd57irz2i1g55r7wzl5h2yf0ns0hgq2njdfsg";
+    sha256 = "0a8wmf5v3x4035ixz9jypj7c6qknvs6gjv2zawa3msq1j75rf2r5";
   };
 
   patches = [
@@ -43,6 +43,7 @@ stdenv.mkDerivation rec {
     "--sysconfdir=/etc"
     "-Dsysconfdir_install=${placeholder "out"}/etc"
     "-Ddbus-srv-user=geoclue"
+    "-Ddbus-sys-dir=${placeholder "out"}/share/dbus-1/system.d"
   ] ++ optionals stdenv.isDarwin [
     "-D3g-source=false"
     "-Dcdma-source=false"
diff --git a/nixpkgs/pkgs/development/libraries/geoip/default.nix b/nixpkgs/pkgs/development/libraries/geoip/default.nix
index 1b1f7373709f..d55983952b8c 100644
--- a/nixpkgs/pkgs/development/libraries/geoip/default.nix
+++ b/nixpkgs/pkgs/development/libraries/geoip/default.nix
@@ -1,37 +1,45 @@
-# in geoipDatabase, you can insert a package defining ${geoipDatabase}/share/GeoIP
-# e.g. geolite-legacy
 { stdenv, fetchFromGitHub, autoreconfHook
-, drvName ? "geoip", geoipDatabase ? "/var/lib/geoip-databases" }:
+, drvName ? "geoip"
 
-let version = "1.6.12";
-    dataDir = if (stdenv.lib.isDerivation geoipDatabase) then "${toString geoipDatabase}/share/GeoIP" else geoipDatabase;
-in stdenv.mkDerivation {
-  name = "${drvName}-${version}";
+# in geoipDatabase, you can insert a package defining
+# "${geoipDatabase}/share/GeoIP" e.g. geolite-legacy
+, geoipDatabase ? "/var/lib/geoip-databases"
+}:
+
+let
+  dataDir = if stdenv.lib.isDerivation geoipDatabase
+    then "${toString geoipDatabase}/share/GeoIP"
+    else geoipDatabase;
+in
+stdenv.mkDerivation rec {
+  pname = drvName;
+  version = "1.6.12";
 
   src = fetchFromGitHub {
-    owner = "maxmind";
-    repo = "geoip-api-c";
-    rev = "v${version}";
+    owner  = "maxmind";
+    repo   = "geoip-api-c";
+    rev    = "v${version}";
     sha256 = "0ixyp3h51alnncr17hqp1p0rlqz9w69nlhm60rbzjjz3vjx52ajv";
   };
 
   nativeBuildInputs = [ autoreconfHook ];
 
+  # Cross compilation shenanigans
   configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "ac_cv_func_malloc_0_nonnull=yes"
     "ac_cv_func_realloc_0_nonnull=yes"
   ];
 
+  # Fix up the default data directory
   postConfigure = ''
     find . -name Makefile.in -exec sed -i -r 's#^pkgdatadir\s*=.+$#pkgdatadir = ${dataDir}#' {} \;
   '';
 
-  meta = {
-    description = "Geolocation API";
-    maintainers = [ stdenv.lib.maintainers.raskin ];
-    license = stdenv.lib.licenses.lgpl21;
-    platforms = stdenv.lib.platforms.unix;
-    homepage = http://geolite.maxmind.com/;
-    downloadPage = "http://geolite.maxmind.com/download/";
+  meta = with stdenv.lib; {
+    description = "An API for GeoIP/Geolocation databases";
+    maintainers = with maintainers; [ thoughtpolice raskin ];
+    license     = licenses.lgpl21;
+    platforms   = platforms.unix;
+    homepage    = "https://www.maxmind.com";
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/geos/default.nix b/nixpkgs/pkgs/development/libraries/geos/default.nix
index 3bed670cc307..e7fce696894f 100644
--- a/nixpkgs/pkgs/development/libraries/geos/default.nix
+++ b/nixpkgs/pkgs/development/libraries/geos/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, python }:
 
 stdenv.mkDerivation rec {
-  name = "geos-3.7.2";
+  name = "geos-3.7.3";
 
   src = fetchurl {
     url = "https://download.osgeo.org/geos/${name}.tar.bz2";
-    sha256 = "01vpkncvq1i1191agq03yg1h7d0igj10gv5z2mqk24nnwrdycri1";
+    sha256 = "0znaby3fs3fy7af5njrnmjnfsa80ac97fvamlnjiywddw3j5l0q2";
   };
 
   enableParallelBuilding = true;
diff --git a/nixpkgs/pkgs/development/libraries/gettext/CVE-2018-18751-bison.patch b/nixpkgs/pkgs/development/libraries/gettext/CVE-2018-18751-bison.patch
deleted file mode 100644
index b734c1c8b027..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/gettext/default.nix b/nixpkgs/pkgs/development/libraries/gettext/default.nix
index 9547c6c31ada..c2165a9d9c7a 100644
--- a/nixpkgs/pkgs/development/libraries/gettext/default.nix
+++ b/nixpkgs/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;
@@ -106,5 +86,5 @@ stdenv.mkDerivation rec {
 }
 
 // stdenv.lib.optionalAttrs stdenv.isDarwin {
-  makeFlags = "CFLAGS=-D_FORTIFY_SOURCE=0";
+  makeFlags = [ "CFLAGS=-D_FORTIFY_SOURCE=0" ];
 }
diff --git a/nixpkgs/pkgs/development/libraries/gettext/gettext-setup-hook.sh b/nixpkgs/pkgs/development/libraries/gettext/gettext-setup-hook.sh
index ad3763c29b64..69020146f84d 100644
--- a/nixpkgs/pkgs/development/libraries/gettext/gettext-setup-hook.sh
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gettext/gettext.git-2336451ed68d91ff4b5ae1acbc1eca30e47a86a9.patch b/nixpkgs/pkgs/development/libraries/gettext/gettext.git-2336451ed68d91ff4b5ae1acbc1eca30e47a86a9.patch
new file mode 100644
index 000000000000..4a19b11507ac
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gf2x/default.nix b/nixpkgs/pkgs/development/libraries/gf2x/default.nix
index b1a2524065a5..4697f28bb9fb 100644
--- a/nixpkgs/pkgs/development/libraries/gf2x/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gf2x/default.nix
@@ -1,20 +1,25 @@
 { stdenv
 , lib
-, fetchurl
+, fetchgit
+, autoreconfHook
 , optimize ? false # impure hardware optimizations
 }:
 stdenv.mkDerivation rec {
   pname = "gf2x";
-  version = "1.2"; # remember to also update the url
+  version = "1.3.0";
 
-  src = fetchurl {
-    # find link to latest version (with file id) here: https://gforge.inria.fr/projects/gf2x/
-    # Requested a predictable link:
-    # https://gforge.inria.fr/tracker/index.php?func=detail&aid=21704&group_id=1874&atid=6982
-    url = "https://gforge.inria.fr/frs/download.php/file/36934/gf2x-${version}.tar.gz";
-    sha256 = "0d6vh1mxskvv3bxl6byp7gxxw3zzpkldrxnyajhnl05m0gx7yhk1";
+  # upstream has plans to move to gitlab:
+  # https://github.com/NixOS/nixpkgs/pull/45299#issuecomment-564477936
+  src = fetchgit {
+    url = "https://scm.gforge.inria.fr/anonscm/git/gf2x/gf2x.git";
+    rev = "gf2x-${version}";
+    sha256 = "04g5jg0i4vz46b4w2dvbmahwzi3k6b8g515mfw7im1inc78s14id";
   };
 
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+
   # no actual checks present yet (as of 1.2), but can't hurt trying
   # for an indirect test, run ntl's test suite
   doCheck = true;
diff --git a/nixpkgs/pkgs/development/libraries/gflags/default.nix b/nixpkgs/pkgs/development/libraries/gflags/default.nix
index 2e818ea94ea5..b09936f29240 100644
--- a/nixpkgs/pkgs/development/libraries/gflags/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gflags/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ stdenv, fetchFromGitHub, cmake, enableShared ? true}:
 
 stdenv.mkDerivation rec {
   pname = "gflags";
@@ -17,8 +17,8 @@ stdenv.mkDerivation rec {
   preConfigure = "rm BUILD";
 
   cmakeFlags = [
-    "-DBUILD_SHARED_LIBS=ON"
-    "-DBUILD_STATIC_LIBS=ON"
+    "-DGFLAGS_BUILD_SHARED_LIBS=${if enableShared then "ON" else "OFF"}"
+    "-DGFLAGS_BUILD_STATIC_LIBS=ON"
   ];
 
   doCheck = false;
diff --git a/nixpkgs/pkgs/development/libraries/giflib/5.1.nix b/nixpkgs/pkgs/development/libraries/giflib/5.1.nix
deleted file mode 100644
index fee760b3ea26..000000000000
--- a/nixpkgs/pkgs/development/libraries/giflib/5.1.nix
+++ /dev/null
@@ -1,18 +0,0 @@
-{stdenv, fetchurl, xmlto, docbook_xml_dtd_412, docbook_xsl, libxml2 }:
-
-stdenv.mkDerivation {
-  name = "giflib-5.1.4";
-  src = fetchurl {
-    url = mirror://sourceforge/giflib/giflib-5.1.4.tar.bz2;
-    sha256 = "1md83dip8rf29y40cm5r7nn19705f54iraz6545zhwa6y8zyq9yz";
-  };
-
-  buildInputs = [ xmlto docbook_xml_dtd_412 docbook_xsl libxml2 ];
-  meta = {
-    description = "A library for reading and writing gif images";
-    platforms = stdenv.lib.platforms.unix;
-    license = stdenv.lib.licenses.mit;
-    maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
-    branch = "5.1";
-  };
-}
diff --git a/nixpkgs/pkgs/development/libraries/giflib/default.nix b/nixpkgs/pkgs/development/libraries/giflib/default.nix
new file mode 100644
index 000000000000..e2ff96d366a2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/giflib/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, fetchpatch, xmlto, docbook_xml_dtd_412, docbook_xsl, libxml2, fixDarwinDylibNames }:
+
+stdenv.mkDerivation rec {
+  name = "giflib-5.2.1";
+  src = fetchurl {
+    url = "mirror://sourceforge/giflib/${name}.tar.gz";
+    sha256 = "1gbrg03z1b6rlrvjyc6d41bc8j1bsr7rm8206gb1apscyii5bnii";
+  };
+
+  patches = stdenv.lib.optional stdenv.hostPlatform.isDarwin
+    (fetchpatch {
+      # https://sourceforge.net/p/giflib/bugs/133/
+      name = "darwin-soname.patch";
+      url = "https://sourceforge.net/p/giflib/bugs/_discuss/thread/4e811ad29b/c323/attachment/Makefile.patch";
+      sha256 = "12afkqnlkl3n1hywwgx8sqnhp3bz0c5qrwcv8j9hifw1lmfhv67r";
+      extraPrefix = "./";
+    });
+
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace 'PREFIX = /usr/local' 'PREFIX = ${builtins.placeholder "out"}'
+  '';
+
+  nativeBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
+
+  buildInputs = [ xmlto docbook_xml_dtd_412 docbook_xsl libxml2 ];
+
+  meta = {
+    description = "A library for reading and writing gif images";
+    platforms = stdenv.lib.platforms.unix;
+    license = stdenv.lib.licenses.mit;
+    maintainers = with stdenv.lib.maintainers; [ ];
+    branch = "5.2";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/git2/default.nix b/nixpkgs/pkgs/development/libraries/git2/default.nix
index 514d21def1e0..2d89355cffe0 100644
--- a/nixpkgs/pkgs/development/libraries/git2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/git2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig, python
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, python3
 , zlib, libssh2, openssl, http-parser, curl
 , libiconv, Security
 }:
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [ "-DTHREADSAFE=ON" ];
 
-  nativeBuildInputs = [ cmake python pkgconfig ];
+  nativeBuildInputs = [ cmake python3 pkgconfig ];
 
   buildInputs = [ zlib libssh2 openssl http-parser curl ]
     ++ stdenv.lib.optional stdenv.isDarwin Security;
diff --git a/nixpkgs/pkgs/development/libraries/gjs/default.nix b/nixpkgs/pkgs/development/libraries/gjs/default.nix
new file mode 100644
index 000000000000..7facdc1426fe
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gle/default.nix b/nixpkgs/pkgs/development/libraries/gle/default.nix
index dd72637f2eb0..d656473ba807 100644
--- a/nixpkgs/pkgs/development/libraries/gle/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/glfw/3.x.nix b/nixpkgs/pkgs/development/libraries/glfw/3.x.nix
index 6532d6f81b54..cf988d323994 100644
--- a/nixpkgs/pkgs/development/libraries/glfw/3.x.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/glib-networking/default.nix b/nixpkgs/pkgs/development/libraries/glib-networking/default.nix
index ae386f46bffc..63a773522a0d 100644
--- a/nixpkgs/pkgs/development/libraries/glib-networking/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glib-networking/default.nix
@@ -18,13 +18,13 @@
 
 stdenv.mkDerivation rec {
   pname = "glib-networking";
-  version = "2.60.3";
+  version = "2.62.2";
 
   outputs = [ "out" "installedTests" ];
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1mfw44qpmwvz6yzj8c6spx6z357wrmkk15byrkc5byagd82860fm";
+    sha256 = "0i2mw75297ql72h47vyvff3hqa0kcmqybblj52fqrarb0kfbhi06";
   };
 
   patches = [
@@ -79,7 +79,7 @@ stdenv.mkDerivation rec {
     };
 
     tests = {
-      installedTests = nixosTests.glib-networking;
+      installedTests = nixosTests.installed-tests.glib-networking;
     };
   };
 
diff --git a/nixpkgs/pkgs/development/libraries/glib/default.nix b/nixpkgs/pkgs/development/libraries/glib/default.nix
index de7505e6cde1..4a7d6cce90b0 100644
--- a/nixpkgs/pkgs/development/libraries/glib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glib/default.nix
@@ -1,4 +1,4 @@
-{ config, stdenv, fetchurl, gettext, meson, ninja, pkgconfig, perl, python3, glibcLocales
+{ config, stdenv, fetchurl, gettext, meson, ninja, pkgconfig, perl, python3
 , libiconv, zlib, libffi, pcre, libelf, gnome3, libselinux, bash, gnum4, gtk-doc, docbook_xsl, docbook_xml_dtd_45
 # use utillinuxMinimal to avoid circular dependency (utillinux, systemd, glib)
 , utillinuxMinimal ? null
@@ -8,7 +8,7 @@
 , doCheck ? config.doCheckByDefault or false
 , coreutils, dbus, libxml2, tzdata
 , desktop-file-utils, shared-mime-info
-, darwin
+, darwin, fetchpatch
 }:
 
 with stdenv.lib;
@@ -44,32 +44,53 @@ let
     done
     ln -sr -t "''${!outputInclude}/include/" "''${!outputInclude}"/lib/*/include/* 2>/dev/null || true
   '';
-
-  binPrograms = optional (!stdenv.isDarwin) "gapplication" ++ [ "gdbus" "gio" "gsettings" ];
 in
 
 stdenv.mkDerivation rec {
   pname = "glib";
-  version = "2.60.7";
+  version = "2.62.4";
 
   src = fetchurl {
     url = "mirror://gnome/sources/glib/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0433m0na8nc4cf0gidf4gfzz8k5d3dsssmh541qkpzcsaspw04lb";
+    sha256 = "1g2vj9lyh032kcwij7avx5d6a99rcsnkd07sbl9i55zsfw6h712c";
   };
 
-  patches = optional stdenv.isDarwin ./darwin-compilation.patch
-    ++ optional doCheck ./skip-timer-test.patch
-    ++ optionals stdenv.hostPlatform.isMusl [
-      ./quark_init_on_demand.patch
-      ./gobject_init_on_demand.patch
-    ] ++ [
-      ./schema-override-variable.patch
-      # Require substituteInPlace in postPatch
-      ./fix-gio-launch-desktop-path.patch
-    ];
+  patches = optionals stdenv.isDarwin [
+    ./darwin-compilation.patch
+  ] ++ optionals stdenv.hostPlatform.isMusl [
+    ./quark_init_on_demand.patch
+    ./gobject_init_on_demand.patch
+  ] ++ [
+    ./schema-override-variable.patch
+    # Require substituteInPlace in postPatch
+    ./fix-gio-launch-desktop-path.patch
+
+    # GLib contains many binaries used for different purposes;
+    # we will install them to different outputs:
+    # 1. Tools for desktop environment ($bin)
+    #    * gapplication (non-darwin)
+    #    * gdbus
+    #    * gio
+    #    * gio-launch-desktop (symlink to $out)
+    #    * gsettings
+    # 2. Development/build tools ($dev)
+    #    * gdbus-codegen
+    #    * gio-querymodules
+    #    * glib-compile-resources
+    #    * glib-compile-schemas
+    #    * glib-genmarshal
+    #    * glib-gettextize
+    #    * glib-mkenums
+    #    * gobject-query
+    #    * gresource
+    #    * gtester
+    #    * gtester-report
+    # 3. Tools for desktop environment that cannot go to $bin due to $out depending on them ($out)
+    #    * gio-launch-desktop
+    ./split-dev-programs.patch
+  ] ++ optional doCheck ./skip-timer-test.patch;
 
   outputs = [ "bin" "out" "dev" "devdoc" ];
-  outputBin = "dev";
 
   setupHook = ./setup-hook.sh;
 
@@ -84,7 +105,7 @@ stdenv.mkDerivation rec {
   ]);
 
   nativeBuildInputs = [
-    meson ninja pkgconfig perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 glibcLocales
+    meson ninja pkgconfig perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45
   ];
 
   propagatedBuildInputs = [ zlib libffi gettext libiconv ];
@@ -94,11 +115,10 @@ stdenv.mkDerivation rec {
     # Instead we just copy them over from the native output.
     "-Dgtk_doc=${if stdenv.hostPlatform == stdenv.buildPlatform then "true" else "false"}"
     "-Dnls=enabled"
+    "-Ddevbindir=${placeholder ''dev''}/bin"
   ];
 
-  LC_ALL = "en_US.UTF-8";
-
-  NIX_CFLAGS_COMPILE = [
+  NIX_CFLAGS_COMPILE = toString [
     "-Wno-error=nonnull"
     # Default for release buildtype but passed manually because
     # we're using plain
@@ -111,29 +131,16 @@ stdenv.mkDerivation rec {
 
     chmod +x gio/tests/gengiotypefuncs.py
     patchShebangs gio/tests/gengiotypefuncs.py
+    chmod +x docs/reference/gio/concat-files-helper.py
+    patchShebangs docs/reference/gio/concat-files-helper.py
     patchShebangs glib/gen-unicode-tables.pl
     patchShebangs tests/gen-casefold-txt.py
     patchShebangs tests/gen-casemap-txt.py
   '';
 
-  LIBELF_CFLAGS = optional stdenv.isFreeBSD "-I${libelf}";
-  LIBELF_LIBS = optional stdenv.isFreeBSD "-L${libelf} -lelf";
-
   DETERMINISTIC_BUILD = 1;
 
   postInstall = ''
-    mkdir -p $bin/bin
-    for app in ${concatStringsSep " " binPrograms}; do
-      mv "$dev/bin/$app" "$bin/bin"
-    done
-
-  '' + optionalString (!stdenv.isDarwin) ''
-    # Add gio-launch-desktop to $out so we can refer to it from $dev
-    mkdir $out/bin
-    mv "$dev/bin/gio-launch-desktop" "$out/bin/"
-    ln -s "$out/bin/gio-launch-desktop" "$bin/bin/"
-
-  '' + ''
     moveToOutput "share/glib-2.0" "$dev"
     substituteInPlace "$dev/bin/gdbus-codegen" --replace "$out" "$dev"
     sed -i "$dev/bin/glib-gettextize" -e "s|^gettext_dir=.*|gettext_dir=$dev/share/glib-2.0/gettext|"
@@ -141,6 +148,11 @@ stdenv.mkDerivation rec {
     # This file is *included* in gtk3 and would introduce runtime reference via __FILE__.
     sed '1i#line 1 "${pname}-${version}/include/glib-2.0/gobject/gobjectnotifyqueue.c"' \
       -i "$dev"/include/glib-2.0/gobject/gobjectnotifyqueue.c
+  '' + optionalString (!stdenv.isDarwin) ''
+    # Add gio-launch-desktop to $out so we can refer to it from $lib
+    mkdir $out/bin
+    mv "$bin/bin/gio-launch-desktop" "$out/bin/"
+    ln -s "$out/bin/gio-launch-desktop" "$bin/bin/"
   '' + optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
     cp -r ${buildPackages.glib.devdoc} $devdoc
   '';
@@ -173,6 +185,8 @@ stdenv.mkDerivation rec {
 
   inherit doCheck;
 
+  separateDebugInfo = stdenv.isLinux;
+
   passthru = rec {
     gioModuleDir = "lib/gio/modules";
     makeSchemaPath = dir: name: "${dir}/share/gsettings-schemas/${name}/glib-2.0/schemas";
@@ -185,7 +199,7 @@ stdenv.mkDerivation rec {
     description = "C library of programming buildings blocks";
     homepage    = https://www.gtk.org/;
     license     = licenses.lgpl21Plus;
-    maintainers = with maintainers; [ lovek323 raskin ];
+    maintainers = with maintainers; [ lovek323 raskin worldofpeace ];
     platforms   = platforms.unix;
 
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/glib/setup-hook.sh b/nixpkgs/pkgs/development/libraries/glib/setup-hook.sh
index a1cb1f40c58a..37c750b8db66 100644
--- a/nixpkgs/pkgs/development/libraries/glib/setup-hook.sh
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/glib/split-dev-programs.patch b/nixpkgs/pkgs/development/libraries/glib/split-dev-programs.patch
new file mode 100644
index 000000000000..9d3989a30a54
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glib/split-dev-programs.patch
@@ -0,0 +1,154 @@
+diff --git a/gio/gdbus-2.0/codegen/meson.build b/gio/gdbus-2.0/codegen/meson.build
+index 121e9e6bb..b76fa0188 100644
+--- a/gio/gdbus-2.0/codegen/meson.build
++++ b/gio/gdbus-2.0/codegen/meson.build
+@@ -16,7 +16,7 @@ gdbus_codegen_conf.set('DATADIR', glib_datadir)
+ # Install gdbus-codegen executable
+ gdbus_codegen = configure_file(input : 'gdbus-codegen.in',
+   output : 'gdbus-codegen',
+-  install_dir : get_option('bindir'),
++  install_dir : get_option('devbindir'),
+   configuration : gdbus_codegen_conf
+ )
+   # Provide tools for others when we're a subproject and they use the Meson GNOME module
+diff --git a/gio/meson.build b/gio/meson.build
+index 9a9e621b3..12e1d146a 100644
+--- a/gio/meson.build
++++ b/gio/meson.build
+@@ -830,14 +830,15 @@ pkg.generate(libgio,
+   variables : ['datadir=' + join_paths('${prefix}', get_option('datadir')),
+                'schemasdir=' + join_paths('${datadir}', schemas_subdir),
+                'bindir=' + join_paths('${prefix}', get_option('bindir')),
++               'devbindir=' + get_option('devbindir'),
+                'giomoduledir=' + giomodulesdir,
+                'gio=' + join_paths('${bindir}', 'gio'),
+-               'gio_querymodules=' + join_paths('${bindir}', 'gio-querymodules'),
+-               'glib_compile_schemas=' + join_paths('${bindir}', 'glib-compile-schemas'),
+-               'glib_compile_resources=' + join_paths('${bindir}', 'glib-compile-resources'),
++               'gio_querymodules=' + join_paths('${devbindir}', 'gio-querymodules'),
++               'glib_compile_schemas=' + join_paths('${devbindir}', 'glib-compile-schemas'),
++               'glib_compile_resources=' + join_paths('${devbindir}', 'glib-compile-resources'),
+                'gdbus=' + join_paths('${bindir}', 'gdbus'),
+-               'gdbus_codegen=' + join_paths('${bindir}', 'gdbus-codegen'),
+-               'gresource=' + join_paths('${bindir}', 'gresource'),
++               'gdbus_codegen=' + join_paths('${devbindir}', 'gdbus-codegen'),
++               'gresource=' + join_paths('${devbindir}', 'gresource'),
+                'gsettings=' + join_paths('${bindir}', 'gsettings')],
+   version : glib_version,
+   install_dir : glib_pkgconfigreldir,
+@@ -938,12 +939,14 @@ executable('gio', gio_tool_sources,
+ 
+ executable('gresource', 'gresource-tool.c',
+   install : true,
++  install_dir : get_option('devbindir'),
+   # intl.lib is not compatible with SAFESEH
+   link_args : noseh_link_args,
+   dependencies : [libelf, libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
+ 
+ gio_querymodules = executable('gio-querymodules', 'gio-querymodules.c', 'giomodule-priv.c',
+   install : true,
++  install_dir : get_option('devbindir'),
+   c_args : gio_c_args,
+   # intl.lib is not compatible with SAFESEH
+   link_args : noseh_link_args,
+@@ -952,6 +955,7 @@ gio_querymodules = executable('gio-querymodules', 'gio-querymodules.c', 'giomodu
+ glib_compile_schemas = executable('glib-compile-schemas',
+   [gconstructor_as_data_h, 'gvdb/gvdb-builder.c', 'glib-compile-schemas.c'],
+   install : true,
++  install_dir : get_option('devbindir'),
+   # intl.lib is not compatible with SAFESEH
+   link_args : noseh_link_args,
+   dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep])
+@@ -959,6 +963,7 @@ glib_compile_schemas = executable('glib-compile-schemas',
+ glib_compile_resources = executable('glib-compile-resources',
+   [gconstructor_as_data_h, 'gvdb/gvdb-builder.c', 'glib-compile-resources.c'],
+   install : true,
++  install_dir : get_option('devbindir'),
+   c_args : gio_c_args,
+   # intl.lib is not compatible with SAFESEH
+   link_args : noseh_link_args,
+diff --git a/glib/meson.build b/glib/meson.build
+index 91a48f194..80472a06b 100644
+--- a/glib/meson.build
++++ b/glib/meson.build
+@@ -375,9 +375,10 @@ pkg.generate(libglib,
+   subdirs : ['glib-2.0'],
+   extra_cflags : ['-I${libdir}/glib-2.0/include'] + win32_cflags,
+   variables : ['bindir=' + join_paths('${prefix}', get_option('bindir')),
+-               'glib_genmarshal=' + join_paths('${bindir}', 'glib-genmarshal'),
+-               'gobject_query=' + join_paths('${bindir}', 'gobject-query'),
+-               'glib_mkenums=' + join_paths('${bindir}', 'glib-mkenums')],
++               'devbindir=' + get_option('devbindir'),
++               'glib_genmarshal=' + join_paths('${devbindir}', 'glib-genmarshal'),
++               'gobject_query=' + join_paths('${devbindir}', 'gobject-query'),
++               'glib_mkenums=' + join_paths('${devbindir}', 'glib-mkenums')],
+   version : glib_version,
+   install_dir : glib_pkgconfigreldir,
+   filebase : 'glib-2.0',
+@@ -413,6 +414,7 @@ if host_system == 'windows'
+ else
+   gtester = executable('gtester', 'gtester.c',
+     install : true,
++    install_dir : get_option('devbindir'),
+     c_args : ['-UG_DISABLE_ASSERT'],
+     include_directories : configinc,
+     dependencies : [libglib_dep])
+@@ -424,7 +426,7 @@ report_conf.set('PYTHON', python_name)
+ configure_file(
+   input: 'gtester-report.in',
+   output: 'gtester-report',
+-  install_dir: get_option('bindir'),
++  install_dir: get_option('devbindir'),
+   configuration: report_conf,
+   install_mode: 'rwxr-xr-x'
+ )
+diff --git a/gobject/meson.build b/gobject/meson.build
+index c7805c556..22ec629a4 100644
+--- a/gobject/meson.build
++++ b/gobject/meson.build
+@@ -75,7 +75,7 @@ foreach tool: python_tools
+     input : tool + '.in',
+     output : tool,
+     configuration : python_tools_conf,
+-    install_dir : glib_bindir,
++    install_dir : get_option('devbindir'),
+   )
+ 
+   # Set variables for later use
+@@ -145,6 +145,7 @@ libgobject_dep = declare_dependency(link_with : libgobject,
+ 
+ executable('gobject-query', 'gobject-query.c',
+   install : true,
++  install_dir : get_option('devbindir'),
+   dependencies : [libglib_dep, libgobject_dep])
+ 
+ install_data('gobject_gdb.py', install_dir : join_paths(glib_pkgdatadir, 'gdb'))
+diff --git a/meson.build b/meson.build
+index 717d1bccb..fb0bee8a1 100644
+--- a/meson.build
++++ b/meson.build
+@@ -2118,7 +2118,7 @@ if have_sh
+   gettextize_conf.set('datarootdir', glib_datadir)
+   gettextize_conf.set('datadir', glib_datadir)
+   configure_file(input : 'glib-gettextize.in',
+-    install_dir : glib_bindir,
++    install_dir : get_option('devbindir'),
+     output : 'glib-gettextize',
+     configuration : gettextize_conf)
+ endif
+diff --git a/meson_options.txt b/meson_options.txt
+index 2c831e37e..5d8928577 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -3,6 +3,11 @@ option('runtime_libdir',
+        value : '',
+        description : 'install runtime libraries relative to libdir')
+ 
++option('devbindir',
++       type : 'string',
++       value : '',
++       description : 'bindir for development tools')
++
+ option('iconv',
+        type : 'combo',
+        choices : ['auto', 'libc', 'external'],
diff --git a/nixpkgs/pkgs/development/libraries/glibc/2.27-CVE-2019-19126.patch b/nixpkgs/pkgs/development/libraries/glibc/2.27-CVE-2019-19126.patch
new file mode 100644
index 000000000000..2c558f53b735
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/glibc/CVE-2018-11236.patch b/nixpkgs/pkgs/development/libraries/glibc/CVE-2018-11236.patch
new file mode 100644
index 000000000000..db86e7146f28
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibc/CVE-2018-11236.patch
@@ -0,0 +1,146 @@
+From 5460617d1567657621107d895ee2dd83bc1f88f2 Mon Sep 17 00:00:00 2001
+From: Paul Pluzhnikov <ppluzhnikov@google.com>
+Date: Tue, 8 May 2018 18:12:41 -0700
+Subject: [PATCH] Fix BZ 22786: integer addition overflow may cause stack
+ buffer overflow when realpath() input length is close to SSIZE_MAX.
+
+2018-05-09  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+	[BZ #22786]
+	* stdlib/canonicalize.c (__realpath): Fix overflow in path length
+	computation.
+	* stdlib/Makefile (test-bz22786): New test.
+	* stdlib/test-bz22786.c: New test.
+---
+ ChangeLog             |  8 +++++
+ stdlib/Makefile       |  2 +-
+ stdlib/canonicalize.c |  2 +-
+ stdlib/test-bz22786.c | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 100 insertions(+), 2 deletions(-)
+ create mode 100644 stdlib/test-bz22786.c
+
+diff --git a/stdlib/Makefile b/stdlib/Makefile
+index af1643c..1ddb1f9 100644
+--- a/stdlib/Makefile
++++ b/stdlib/Makefile
+@@ -84,7 +84,7 @@ tests		:= tst-strtol tst-strtod testmb testrand testsort testdiv   \
+ 		   tst-cxa_atexit tst-on_exit test-atexit-race 		    \
+ 		   test-at_quick_exit-race test-cxa_atexit-race             \
+ 		   test-on_exit-race test-dlclose-exit-race 		    \
+-		   tst-makecontext-align
++		   tst-makecontext-align test-bz22786
+ 
+ tests-internal	:= tst-strtod1i tst-strtod3 tst-strtod4 tst-strtod5i \
+ 		   tst-tls-atexit tst-tls-atexit-nodelete
+diff --git a/stdlib/canonicalize.c b/stdlib/canonicalize.c
+index 4135f3f..390fb43 100644
+--- a/stdlib/canonicalize.c
++++ b/stdlib/canonicalize.c
+@@ -181,7 +181,7 @@ __realpath (const char *name, char *resolved)
+ 		extra_buf = __alloca (path_max);
+ 
+ 	      len = strlen (end);
+-	      if ((long int) (n + len) >= path_max)
++	      if (path_max - n <= len)
+ 		{
+ 		  __set_errno (ENAMETOOLONG);
+ 		  goto error;
+diff --git a/stdlib/test-bz22786.c b/stdlib/test-bz22786.c
+new file mode 100644
+index 0000000..e7837f9
+--- /dev/null
++++ b/stdlib/test-bz22786.c
+@@ -0,0 +1,90 @@
++/* Bug 22786: test for buffer overflow in realpath.
++   Copyright (C) 2018 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <http://www.gnu.org/licenses/>.  */
++
++/* This file must be run from within a directory called "stdlib".  */
++
++#include <errno.h>
++#include <limits.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
++#include <sys/stat.h>
++#include <sys/types.h>
++#include <support/test-driver.h>
++#include <libc-diag.h>
++
++static int
++do_test (void)
++{
++  const char dir[] = "bz22786";
++  const char lnk[] = "bz22786/symlink";
++
++  rmdir (dir);
++  if (mkdir (dir, 0755) != 0 && errno != EEXIST)
++    {
++      printf ("mkdir %s: %m\n", dir);
++      return EXIT_FAILURE;
++    }
++  if (symlink (".", lnk) != 0 && errno != EEXIST)
++    {
++      printf ("symlink (%s, %s): %m\n", dir, lnk);
++      return EXIT_FAILURE;
++    }
++
++  const size_t path_len = (size_t) INT_MAX + 1;
++
++  DIAG_PUSH_NEEDS_COMMENT;
++#if __GNUC_PREREQ (7, 0)
++  /* GCC 7 warns about too-large allocations; here we need such
++     allocation to succeed for the test to work.  */
++  DIAG_IGNORE_NEEDS_COMMENT (7, "-Walloc-size-larger-than=");
++#endif
++  char *path = malloc (path_len);
++  DIAG_POP_NEEDS_COMMENT;
++
++  if (path == NULL)
++    {
++      printf ("malloc (%zu): %m\n", path_len);
++      return EXIT_UNSUPPORTED;
++    }
++
++  /* Construct very long path = "bz22786/symlink/aaaa....."  */
++  char *p = mempcpy (path, lnk, sizeof (lnk) - 1);
++  *(p++) = '/';
++  memset (p, 'a', path_len - (path - p) - 2);
++  p[path_len - (path - p) - 1] = '\0';
++
++  /* This call crashes before the fix for bz22786 on 32-bit platforms.  */
++  p = realpath (path, NULL);
++
++  if (p != NULL || errno != ENAMETOOLONG)
++    {
++      printf ("realpath: %s (%m)", p);
++      return EXIT_FAILURE;
++    }
++
++  /* Cleanup.  */
++  unlink (lnk);
++  rmdir (dir);
++
++  return 0;
++}
++
++#define TEST_FUNCTION do_test
++#include <support/test-driver.c>
+-- 
+2.9.3
+
diff --git a/nixpkgs/pkgs/development/libraries/glibc/CVE-2018-11237.patch b/nixpkgs/pkgs/development/libraries/glibc/CVE-2018-11237.patch
new file mode 100644
index 000000000000..ffc2cec1d577
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibc/CVE-2018-11237.patch
@@ -0,0 +1,55 @@
+From f51c8367685dc888a02f7304c729ed5277904aff Mon Sep 17 00:00:00 2001
+From: Andreas Schwab <schwab@suse.de>
+Date: Thu, 24 May 2018 14:39:18 +0200
+Subject: [PATCH] Don't write beyond destination in
+ __mempcpy_avx512_no_vzeroupper (bug 23196)
+
+When compiled as mempcpy, the return value is the end of the destination
+buffer, thus it cannot be used to refer to the start of it.
+
+(cherry picked from commit 9aaaab7c6e4176e61c59b0a63c6ba906d875dc0e)
+---
+ ChangeLog                                               | 9 +++++++++
+ NEWS                                                    | 7 +++++++
+ string/test-mempcpy.c                                   | 1 +
+ sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S | 5 +++--
+ 4 files changed, 20 insertions(+), 2 deletions(-)
+
+diff --git a/string/test-mempcpy.c b/string/test-mempcpy.c
+index c08fba8..d98ecdd 100644
+--- a/string/test-mempcpy.c
++++ b/string/test-mempcpy.c
+@@ -18,6 +18,7 @@
+    <http://www.gnu.org/licenses/>.  */
+ 
+ #define MEMCPY_RESULT(dst, len) (dst) + (len)
++#define MIN_PAGE_SIZE 131072
+ #define TEST_MAIN
+ #define TEST_NAME "mempcpy"
+ #include "test-string.h"
+diff --git a/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S b/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S
+index 23c0f7a..effc3ac 100644
+--- a/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S
++++ b/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S
+@@ -336,6 +336,7 @@ L(preloop_large):
+ 	vmovups	(%rsi), %zmm4
+ 	vmovups	0x40(%rsi), %zmm5
+ 
++	mov	%rdi, %r11
+ /* Align destination for access with non-temporal stores in the loop.  */
+ 	mov	%rdi, %r8
+ 	and	$-0x80, %rdi
+@@ -366,8 +367,8 @@ L(gobble_256bytes_nt_loop):
+ 	cmp	$256, %rdx
+ 	ja	L(gobble_256bytes_nt_loop)
+ 	sfence
+-	vmovups	%zmm4, (%rax)
+-	vmovups	%zmm5, 0x40(%rax)
++	vmovups	%zmm4, (%r11)
++	vmovups	%zmm5, 0x40(%r11)
+ 	jmp	L(check)
+ 
+ L(preloop_large_bkw):
+-- 
+2.9.3
+
diff --git a/nixpkgs/pkgs/development/libraries/glibc/common.nix b/nixpkgs/pkgs/development/libraries/glibc/common.nix
index 8e8e445f0173..32be2205bcc1 100644
--- a/nixpkgs/pkgs/development/libraries/glibc/common.nix
+++ b/nixpkgs/pkgs/development/libraries/glibc/common.nix
@@ -92,13 +92,21 @@ stdenv.mkDerivation ({
         url = "https://salsa.debian.org/glibc-team/glibc/raw/49767c9f7de4828220b691b29de0baf60d8a54ec/debian/patches/localedata/locale-C.diff";
         sha256 = "0irj60hs2i91ilwg5w7sqrxb695c93xg0ik7yhhq9irprd7fidn4";
       })
+
+      # https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5460617d1567657621107d895ee2dd83bc1f88f2
+      ./CVE-2018-11236.patch
+      # https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f51c8367685dc888a02f7304c729ed5277904aff
+      ./CVE-2018-11237.patch
+    ]
+    ++ lib.optionals stdenv.isx86_64 [
+      ./fix-x64-abi.patch
+      ./2.27-CVE-2019-19126.patch
     ]
-    ++ lib.optional stdenv.isx86_64 ./fix-x64-abi.patch
     ++ lib.optional stdenv.hostPlatform.isMusl ./fix-rpc-types-musl-conflicts.patch
     ++ lib.optional stdenv.buildPlatform.isDarwin ./darwin-cross-build.patch
 
     # Remove after upgrading to glibc 2.28+
-    ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) (fetchpatch {
+    ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform || stdenv.hostPlatform.isMusl) (fetchpatch {
       url = "https://sourceware.org/git/?p=glibc.git;a=patch;h=780684eb04298977bc411ebca1eadeeba4877833";
       name = "correct-pwent-parsing-issue-and-resulting-build.patch";
       sha256 = "08fja894vzaj8phwfhsfik6jj2pbji7kypy3q8pgxvsd508zdv1q";
diff --git a/nixpkgs/pkgs/development/libraries/glibc/default.nix b/nixpkgs/pkgs/development/libraries/glibc/default.nix
index eda71af59783..1a17595a1a32 100644
--- a/nixpkgs/pkgs/development/libraries/glibc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glibc/default.nix
@@ -5,6 +5,14 @@
 , buildPackages
 }:
 
+let
+  gdCflags = [
+    "-Wno-error=stringop-truncation"
+    "-Wno-error=missing-attributes"
+    "-Wno-error=array-bounds"
+  ];
+in
+
 callPackage ./common.nix { inherit stdenv; } {
     name = "glibc" + stdenv.lib.optionalString withGd "-gd";
 
@@ -40,7 +48,21 @@ callPackage ./common.nix { inherit stdenv; } {
     #      limit rebuilds by only disabling pie w/musl
       ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "pie";
 
-    NIX_CFLAGS_COMPILE = if withGd then "-Wno-error=stringop-truncation" else null;
+    NIX_CFLAGS_COMPILE = stdenv.lib.concatStringsSep " "
+      (if !stdenv.hostPlatform.isMusl
+        # TODO: This (returning a string or `null`, instead of a list) is to
+        #       not trigger a mass rebuild due to the introduction of the
+        #       musl-specific flags below.
+        #       At next change to non-musl glibc builds, remove this `then`
+        #       and the above condition, instead keeping only the `else` below.
+        then (stdenv.lib.optionals withGd gdCflags)
+        else
+          (builtins.concatLists [
+            (stdenv.lib.optionals withGd gdCflags)
+            # Fix -Werror build failure when building glibc with musl with GCC >= 8, see:
+            # https://github.com/NixOS/nixpkgs/pull/68244#issuecomment-544307798
+            (stdenv.lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias")
+          ]));
 
     # When building glibc from bootstrap-tools, we need libgcc_s at RPATH for
     # any program we run, because the gcc will have been placed at a new
diff --git a/nixpkgs/pkgs/development/libraries/glibmm/default.nix b/nixpkgs/pkgs/development/libraries/glibmm/default.nix
index 829dca04c18c..18963e31b6e2 100644
--- a/nixpkgs/pkgs/development/libraries/glibmm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glibmm/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "glibmm";
-  version = "2.60.0";
+  version = "2.62.0";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1g7jxqd270dv2d83r7pf5893mwpz7d5xib0q01na2yalh34v38d3";
+    sha256 = "1ziwx6r7k7wbvg4qq1rgrv8zninapgrmhn1hs6926a3krh9ryr9n";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/nixpkgs/pkgs/development/libraries/glm/default.nix b/nixpkgs/pkgs/development/libraries/glm/default.nix
index e7d4c934db81..d39d6f0d7a36 100644
--- a/nixpkgs/pkgs/development/libraries/glm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glm/default.nix
@@ -27,9 +27,7 @@ stdenv.mkDerivation rec {
     cp ${gcc7PlatformPatch} glm/simd/platform.h
   '';
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionals stdenv.isDarwin [
-    "-DGLM_COMPILER=0"
-  ];
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-DGLM_COMPILER=0";
 
   postInstall = ''
     mkdir -p $doc/share/doc/glm
@@ -46,7 +44,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/nixpkgs/pkgs/development/libraries/glog/default.nix b/nixpkgs/pkgs/development/libraries/glog/default.nix
index 6aa300e2b627..7809dc088427 100644
--- a/nixpkgs/pkgs/development/libraries/glog/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glog/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, perl }:
+{ stdenv, lib, fetchFromGitHub, fetchpatch, cmake, perl, static ? false }:
 
 stdenv.mkDerivation rec {
   pname = "glog";
@@ -11,13 +11,24 @@ stdenv.mkDerivation rec {
     sha256 = "1xd3maiipfbxmhc9rrblc5x52nxvkwxp14npg31y5njqvkvzax9b";
   };
 
-  nativeBuildInputs = [ autoreconfHook ];
+  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 = [ cmake ];
+
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" ];
 
   checkInputs = [ perl ];
   doCheck = false; # fails with "Mangled symbols (28 out of 380) found in demangle.dm"
 
   meta = with stdenv.lib; {
-    homepage = https://github.com/google/glog;
+    homepage = "https://github.com/google/glog";
     license = licenses.bsd3;
     description = "Library for application-level logging";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/gloox/default.nix b/nixpkgs/pkgs/development/libraries/gloox/default.nix
index 51e981a2a338..3343c78bea1c 100644
--- a/nixpkgs/pkgs/development/libraries/gloox/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/glui/default.nix b/nixpkgs/pkgs/development/libraries/glui/default.nix
index 59357bf6fb1b..d84a9227c3b8 100644
--- a/nixpkgs/pkgs/development/libraries/glui/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gmime/3.nix b/nixpkgs/pkgs/development/libraries/gmime/3.nix
index 81546e5c1272..754d5aa74114 100644
--- a/nixpkgs/pkgs/development/libraries/gmime/3.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gmp/6.x.nix b/nixpkgs/pkgs/development/libraries/gmp/6.x.nix
index d9ea5a71dd30..4b35f7828fe0 100644
--- a/nixpkgs/pkgs/development/libraries/gmp/6.x.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gnome-online-accounts/default.nix b/nixpkgs/pkgs/development/libraries/gnome-online-accounts/default.nix
index 9ae4a572d93b..adbb714c7b29 100644
--- a/nixpkgs/pkgs/development/libraries/gnome-online-accounts/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gnome-online-accounts/default.nix
@@ -1,43 +1,94 @@
-{ stdenv, fetchurl, pkgconfig, vala, glib, libxslt, gtk3, wrapGAppsHook
-, webkitgtk, json-glib, librest, libsecret, gtk-doc, gobject-introspection
-, gettext, icu, glib-networking, hicolor-icon-theme
-, libsoup, docbook_xsl, docbook_xml_dtd_412, gnome3, gcr, kerberos
+{ stdenv
+, fetchFromGitLab
+, pkgconfig
+, vala
+, glib
+, meson
+, ninja
+, python3
+, libxslt
+, gtk3
+, webkitgtk
+, json-glib
+, librest
+, libsecret
+, gtk-doc
+, gobject-introspection
+, gettext
+, icu
+, glib-networking
+, libsoup
+, docbook_xsl
+, docbook_xml_dtd_412
+, gnome3
+, gcr
+, kerberos
+, gvfs
+, dbus
+, wrapGAppsHook
 }:
 
-let
+stdenv.mkDerivation rec {
   pname = "gnome-online-accounts";
-  version = "3.32.0";
-in stdenv.mkDerivation rec {
-  name = "${pname}-${version}";
+  version = "3.34.1";
 
-  src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
-    sha256 = "1anlx0rb2hafg9929pgfms25mdz23sd0vdva06h6zlf8f5byc68w";
+  # https://gitlab.gnome.org/GNOME/gnome-online-accounts/issues/87
+  src = fetchFromGitLab {
+    domain = "gitlab.gnome.org";
+    owner = "GNOME";
+    repo = "gnome-online-accounts";
+    rev = version;
+    sha256 = "0ry06qw068rqn4y42953kwl6fkxpgfya58y87cd3zink6gj7q0fm";
   };
 
   outputs = [ "out" "man" "dev" "devdoc" ];
 
-  configureFlags = [
-    "--enable-media-server"
-    "--enable-kerberos"
-    "--enable-lastfm"
-    "--enable-todoist"
-    "--enable-gtk-doc"
-    "--enable-documentation"
+  mesonFlags = [
+    "-Dfedora=false" # not useful in NixOS or for NixOS users.
+    "-Dgtk_doc=true"
+    "-Dlastfm=true"
+    "-Dman=true"
+    "-Dmedia_server=true"
   ];
 
-  enableParallelBuilding = true;
-
   nativeBuildInputs = [
-    pkgconfig gobject-introspection vala gettext wrapGAppsHook
-    libxslt docbook_xsl docbook_xml_dtd_412 gtk-doc
-    hicolor-icon-theme # for setup-hook
+    dbus # used for checks and pkgconfig to install dbus service/s
+    docbook_xml_dtd_412
+    docbook_xsl
+    gettext
+    gobject-introspection
+    gtk-doc
+    libxslt
+    meson
+    ninja
+    pkgconfig
+    python3
+    vala
+    wrapGAppsHook
   ];
+
   buildInputs = [
-    glib gtk3 webkitgtk json-glib librest libsecret glib-networking icu libsoup
-    gcr kerberos
+    gcr
+    glib
+    glib-networking
+    gtk3
+    gvfs # OwnCloud, Google Drive
+    icu
+    json-glib
+    kerberos
+    librest
+    libsecret
+    libsoup
+    webkitgtk
   ];
 
+  NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0";
+
+  postPatch = ''
+    chmod +x meson_post_install.py
+    patchShebangs meson_post_install.py
+  '';
+
   passthru = {
     updateScript = gnome3.updateScript {
       packageName = pname;
@@ -46,7 +97,10 @@ in stdenv.mkDerivation rec {
   };
 
   meta = with stdenv.lib; {
+    homepage = "https://wiki.gnome.org/Projects/GnomeOnlineAccounts";
+    description = "Single sign-on framework for GNOME";
     platforms = platforms.linux;
+    license = licenses.lgpl2Plus;
     maintainers = gnome3.maintainers;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/gnu-efi/default.nix b/nixpkgs/pkgs/development/libraries/gnu-efi/default.nix
index af225cc50f24..b5b8add2db52 100644
--- a/nixpkgs/pkgs/development/libraries/gnu-efi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gnu-efi/default.nix
@@ -1,28 +1,33 @@
-{ stdenv, fetchurl, pciutils }: with stdenv.lib;
+{ 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" ];
 
   makeFlags = [
     "PREFIX=\${out}"
-    "CC=${stdenv.cc.targetPrefix}gcc"
-    "AS=${stdenv.cc.targetPrefix}as"
-    "LD=${stdenv.cc.targetPrefix}ld"
-    "AR=${stdenv.cc.targetPrefix}ar"
-    "RANLIB=${stdenv.cc.targetPrefix}ranlib"
-    "OBJCOPY=${stdenv.cc.targetPrefix}objcopy"
-  ] ++ stdenv.lib.optional stdenv.isAarch32 "ARCH=arm"
-    ++ stdenv.lib.optional stdenv.isAarch64 "ARCH=aarch64";
+    "HOSTCC=${buildPackages.stdenv.cc.targetPrefix}cc"
+    "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
+  ];
 
   meta = with stdenv.lib; {
     description = "GNU EFI development toolchain";
diff --git a/nixpkgs/pkgs/development/libraries/gnutls-kdh/generic.nix b/nixpkgs/pkgs/development/libraries/gnutls-kdh/generic.nix
index cb81b52b7301..6079387fc720 100644
--- a/nixpkgs/pkgs/development/libraries/gnutls-kdh/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/gnutls-kdh/generic.nix
@@ -90,5 +90,6 @@ stdenv.mkDerivation {
     license = licenses.lgpl21Plus;
     maintainers = with maintainers; [ leenaars ];
     platforms = platforms.all;
+    broken = true;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/gnutls/default.nix b/nixpkgs/pkgs/development/libraries/gnutls/default.nix
index 1b17f4c800f5..deef141c5dfe 100644
--- a/nixpkgs/pkgs/development/libraries/gnutls/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gnutls/default.nix
@@ -1,6 +1,6 @@
 { config, lib, stdenv, fetchurl, zlib, lzo, libtasn1, nettle, pkgconfig, lzip
 , perl, gmp, autoconf, autogen, automake, libidn, p11-kit, libiconv
-, unbound, dns-root-data, gettext, cacert
+, unbound, dns-root-data, gettext, cacert, utillinux
 , guileBindings ? config.gnutls.guile or false, guile
 , tpmSupport ? false, trousers, which, nettools, libunistring
 , withSecurity ? false, Security  # darwin Security.framework
@@ -8,7 +8,7 @@
 
 assert guileBindings -> guile != null;
 let
-  version = "3.6.9";
+  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 = "1jqz5s3lv8sa53348cfi9nr5pw5l55n8m40b8msdvv0pb2jzqca3";
+    sha256 = "1y1wadpsrj5ai603xv5bgssl9v0pb1si2hg14zqdnmcsvgri5fpv";
   };
 
   outputs = [ "bin" "dev" "out" "man" "devdoc" ];
@@ -67,7 +67,7 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ perl pkgconfig ]
     ++ lib.optionals (isDarwin && !withSecurity) [ autoconf automake ]
-    ++ lib.optionals doCheck [ which nettools ];
+    ++ lib.optionals doCheck [ which nettools utillinux ];
 
   propagatedBuildInputs = [ nettle ];
 
diff --git a/nixpkgs/pkgs/development/libraries/gobject-introspection/default.nix b/nixpkgs/pkgs/development/libraries/gobject-introspection/default.nix
index 43695d8db585..81df734a2ce3 100644
--- a/nixpkgs/pkgs/development/libraries/gobject-introspection/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gobject-introspection/default.nix
@@ -9,7 +9,7 @@
 
 let
   pname = "gobject-introspection";
-  version = "1.60.2";
+  version = "1.62.0";
 in
 with stdenv.lib;
 stdenv.mkDerivation rec {
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
-    sha256 = "172ymc1vbg2rclq1rszx4y32vm900nn1mc4qg1a4mqxjiwvf5pzz";
+    sha256 = "18lhglg9v6y83lhqzyifc1z0wrlawzrhzzxx0a3h1g7xaz97xvmi";
   };
 
   outputs = [ "out" "dev" "man" ];
diff --git a/nixpkgs/pkgs/development/libraries/goffice/default.nix b/nixpkgs/pkgs/development/libraries/goffice/default.nix
index a18bdb177449..f41fa73a6ef4 100644
--- a/nixpkgs/pkgs/development/libraries/goffice/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gom/default.nix b/nixpkgs/pkgs/development/libraries/gom/default.nix
index 9a947c3ff828..e006f8cd6f8e 100644
--- a/nixpkgs/pkgs/development/libraries/gom/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix b/nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix
index 7dd075e440e5..be7132dc845b 100644
--- a/nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix
@@ -1,65 +1,62 @@
-{ stdenv, grpc, curl, cmake, pkgconfig, fetchFromGitHub, doxygen, protobuf, crc32c, c-ares, nlohmann_json, fetchurl }:
+{ stdenv, clang-tools, grpc, curl, cmake, pkgconfig, fetchFromGitHub, doxygen, protobuf, crc32c, c-ares, fetchurl, openssl, zlib }:
 let
-  googleapis_rev = "a8ee1416f4c588f2ab92da72e7c1f588c784d3e6";
-  googleapis = fetchurl {
-    name = "${googleapis_rev}.tar.gz";
-    url = "https://github.com/googleapis/googleapis/archive/${googleapis_rev}.tar.gz";
-    sha256 = "1kxi27r034p7jfldhvgpbn6rqqqddycnja47m6jyjxj4rcmrp2kb";
+  googleapis = fetchFromGitHub {
+    owner = "googleapis";
+    repo = "googleapis";
+    rev = "9c9f778aedde02f9826d2ae5d0f9c96409ba0f25";
+    sha256 = "1gd3nwv8qf503wy6km0ad6akdvss9w5b1k3jqizy5gah1fkirkpi";
+  };
+  googleapis-cpp-cmakefiles = stdenv.mkDerivation rec {
+    pname = "googleapis-cpp-cmakefiles";
+    version = "0.1.5";
+    src = fetchFromGitHub {
+      owner = "googleapis";
+      repo = "cpp-cmakefiles";
+      rev = "v${version}";
+      sha256 = "02zkcq2wl831ayd9qy009xvfx7q80pgycx7mzz9vknwd0nn6dd0n";
+    };
+
+    nativeBuildInputs = [ cmake pkgconfig ];
+    buildInputs = [ c-ares c-ares.cmake-config grpc openssl protobuf zlib ];
+
+    postPatch = ''
+      sed -e 's,https://github.com/googleapis/googleapis/archive/9c9f778aedde02f9826d2ae5d0f9c96409ba0f25.tar.gz,file://${googleapis},' \
+      -i CMakeLists.txt
+    '';
+  };
+  _nlohmann_json = fetchurl {
+    url = "https://github.com/nlohmann/json/releases/download/v3.4.0/json.hpp";
+    sha256 = "0pw3jpi572irbp2dqclmyhgic6k9rxav5mpp9ygbp9xj48gnvnk3";
   };
 in stdenv.mkDerivation rec {
   pname = "google-cloud-cpp";
-  version = "0.11.0";
+  version = "0.14.0";
 
   src = fetchFromGitHub {
     owner = "googleapis";
     repo = "google-cloud-cpp";
     rev = "v${version}";
-    sha256 = "1w942gzyv01ym1cv2a417x92zxra9s2v3xz5crcv84j919f616f8";
+    sha256 = "15wci4m8h6py7fqfziq8mp5m6pxp2h1cbh5rp2k90mk5js4jb9pa";
   };
 
-  buildInputs = [ curl grpc protobuf nlohmann_json crc32c c-ares c-ares.cmake-config ];
-  nativeBuildInputs = [ cmake pkgconfig doxygen ];
+  buildInputs = [ curl crc32c c-ares c-ares.cmake-config googleapis-cpp-cmakefiles grpc protobuf ];
+  nativeBuildInputs = [ clang-tools cmake pkgconfig doxygen ];
 
   outputs = [ "out" "dev" ];
 
   postPatch = ''
-    NLOHMANN_SHA256=$(sha256sum ${nlohmann_json}/include/nlohmann/json.hpp | cut -f1 -d' ')
-    sed -e 's,https://github.com/nlohmann/json/releases/download/.*,file://${nlohmann_json}/include/nlohmann/json.hpp"),' \
-        -e "s,JSON_SHA256 .*,JSON_SHA256 ''${NLOHMANN_SHA256}," \
-        -i cmake/DownloadNlohmannJson.cmake
-
-    sed -e 's,https://github.com/googleapis/googleapis/archive/${googleapis_rev}.tar.gz,file://${googleapis},' \
-        -i cmake/external/googleapis.cmake
-
-    # Fixup the library path. It would build a path like /build/external//nix/store/…-foo/lib/foo.so for each library instead of /build/external/lib64/foo.so
-    sed -e 's,''${CMAKE_INSTALL_LIBDIR},lib64,g' \
-        -e 's,;lib64,lib,g' \
-        -i cmake/ExternalProjectHelper.cmake
-  '';
-
-  preFixup = ''
-    mv --no-clobber $out/lib64/cmake/* $out/lib/cmake
-    mv --no-clobber $out/lib64/pkgconfig/* $out/lib/pkgconfig
-    rmdir $out/lib64/cmake $out/lib64/pkgconfig
-    find $out/lib64
-
-    for file in $out/lib/pkgconfig/*; do
-      sed -e 's,\''${prefix}//,/,g' -i $file
-    done
+    sed -e 's,https://github.com/nlohmann/json/releases/download/v3.4.0/json.hpp,file://${_nlohmann_json},' \
+    -i cmake/DownloadNlohmannJson.cmake
   '';
 
   cmakeFlags = [
-    "-DGOOGLE_CLOUD_CPP_BIGTABLE_ENABLE_INSTALL=no"
-    "-DGOOGLE_CLOUD_CPP_DEPENDENCY_PROVIDER=package"
-    "-DGOOGLE_CLOUD_CPP_GOOGLEAPIS_PROVIDER=external"
     "-DBUILD_SHARED_LIBS:BOOL=ON"
-    "-DGOOGLE_CLOUD_CPP_INSTALL_RPATH=$(out)/lib"
   ];
 
   meta = with stdenv.lib; {
     license = with licenses; [ asl20 ];
     homepage = https://github.com/googleapis/google-cloud-cpp;
     description = "C++ Idiomatic Clients for Google Cloud Platform services";
-    maintainers = with maintainers; [ andir ];
+    maintainers = with maintainers; [ andir flokli ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/gperftools/default.nix b/nixpkgs/pkgs/development/libraries/gperftools/default.nix
index bc10c9f9bdd6..0e9857549850 100644
--- a/nixpkgs/pkgs/development/libraries/gperftools/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gperftools/default.nix
@@ -16,9 +16,8 @@ stdenv.mkDerivation rec {
     substituteInPlace libtool --replace stdc++ c++
   '';
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionals stdenv.isDarwin [
-    "-D_XOPEN_SOURCE" "-Wno-aligned-allocation-unavailable"
-  ];
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin
+    "-D_XOPEN_SOURCE -Wno-aligned-allocation-unavailable";
 
   # some packages want to link to the static tcmalloc_minimal
   # to drop the runtime dependency on gperftools
diff --git a/nixpkgs/pkgs/development/libraries/gpgme/default.nix b/nixpkgs/pkgs/development/libraries/gpgme/default.nix
index 26d5e9c88c75..ed2b5563bd37 100644
--- a/nixpkgs/pkgs/development/libraries/gpgme/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gpgme/default.nix
@@ -47,12 +47,12 @@ stdenv.mkDerivation rec {
   # fit in the limit. https://github.com/NixOS/nix/pull/1085
     ++ lib.optionals stdenv.isDarwin [ "--disable-gpg-test" ];
 
-  NIX_CFLAGS_COMPILE =
+  NIX_CFLAGS_COMPILE = toString (
     # qgpgme uses Q_ASSERT which retains build inputs at runtime unless
     # debugging is disabled
     lib.optional (qtbase != null) "-DQT_NO_DEBUG"
     # https://www.gnupg.org/documentation/manuals/gpgme/Largefile-Support-_0028LFS_0029.html
-    ++ lib.optional (system == "i686-linux") "-D_FILE_OFFSET_BITS=64";
+    ++ lib.optional (system == "i686-linux") "-D_FILE_OFFSET_BITS=64");
 
   checkInputs = [ which ];
 
@@ -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/nixpkgs/pkgs/development/libraries/graphene-hardened-malloc/default.nix b/nixpkgs/pkgs/development/libraries/graphene-hardened-malloc/default.nix
index 66c5d8eb061a..be32a74ea45a 100644
--- a/nixpkgs/pkgs/development/libraries/graphene-hardened-malloc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/graphene-hardened-malloc/default.nix
@@ -52,6 +52,6 @@ stdenv.mkDerivation rec {
     '';
     license = licenses.mit;
     maintainers = with maintainers; [ ris ];
-    platforms = platforms.linux;
+    platforms = [ "x86_64-linux" ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/graphene/default.nix b/nixpkgs/pkgs/development/libraries/graphene/default.nix
index f1a9dacd4e2b..e540604c9cb9 100644
--- a/nixpkgs/pkgs/development/libraries/graphene/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/grib-api/default.nix b/nixpkgs/pkgs/development/libraries/grib-api/default.nix
index 38243ce5a6d8..0c9e4bf31563 100644
--- a/nixpkgs/pkgs/development/libraries/grib-api/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/grilo-plugins/chromaprint-gst-plugins.patch b/nixpkgs/pkgs/development/libraries/grilo-plugins/chromaprint-gst-plugins.patch
new file mode 100644
index 000000000000..cb6a1a354945
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/grilo-plugins/chromaprint-gst-plugins.patch
@@ -0,0 +1,13 @@
+diff --git a/src/chromaprint/grl-chromaprint.c b/src/chromaprint/grl-chromaprint.c
+index 5a3598b..8979291 100644
+--- a/src/chromaprint/grl-chromaprint.c
++++ b/src/chromaprint/grl-chromaprint.c
+@@ -111,6 +111,8 @@
+ 
+   gst_init (NULL, NULL);
+ 
++  @load_plugins@
++
+   source = grl_chromaprint_source_new ();
+   grl_registry_register_source (registry,
+                                 plugin,
diff --git a/nixpkgs/pkgs/development/libraries/grilo-plugins/default.nix b/nixpkgs/pkgs/development/libraries/grilo-plugins/default.nix
index 118a910a1683..ddf29c2dcd8c 100644
--- a/nixpkgs/pkgs/development/libraries/grilo-plugins/default.nix
+++ b/nixpkgs/pkgs/development/libraries/grilo-plugins/default.nix
@@ -1,5 +1,6 @@
 { stdenv
 , fetchurl
+, substituteAll
 , meson
 , ninja
 , pkgconfig
@@ -16,8 +17,10 @@
 , libgdata
 , libmediaart
 , grilo
+, gst_all_1
 , gnome-online-accounts
 , gmime
+, gom
 , json-glib
 , avahi
 , tracker
@@ -28,13 +31,28 @@
 
 stdenv.mkDerivation rec {
   pname = "grilo-plugins";
-  version = "0.3.9";
+  version = "0.3.10";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1hv84b56qjic8vz8iz46ikhrxx31l29ilbr8dm5qcghbd8ikw8j1";
+    sha256 = "0jldaixc4kzycn5v8ixkjld1n0z3dp0l1p3vchgdwpvdvc7kcfw0";
   };
 
+  patches = [
+    # grl-chromaprint requires the following GStreamer elements:
+    # * fakesink (gstreamer)
+    # * playbin (gst-plugins-base)
+    # * chromaprint (gst-plugins-bad)
+    (substituteAll {
+      src = ./chromaprint-gst-plugins.patch;
+      load_plugins = stdenv.lib.concatMapStrings (plugin: ''gst_registry_scan_path(gst_registry_get(), "${plugin}/lib/gstreamer-1.0");'') (with gst_all_1; [
+        gstreamer
+        gst-plugins-base
+        gst-plugins-bad
+      ]);
+    })
+  ];
+
   nativeBuildInputs = [
     meson
     ninja
@@ -57,11 +75,13 @@ stdenv.mkDerivation rec {
     libarchive
     libsoup
     gmime
+    gom
     json-glib
     avahi
     libmediaart
     tracker
     dleyna-server
+    gst_all_1.gstreamer
   ];
 
   passthru = {
diff --git a/nixpkgs/pkgs/development/libraries/grilo/default.nix b/nixpkgs/pkgs/development/libraries/grilo/default.nix
index b2a7f0bd5aef..79ccc9319720 100644
--- a/nixpkgs/pkgs/development/libraries/grilo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/grilo/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl, meson, ninja, pkgconfig, gettext, vala, glib, liboauth, gtk3
-, gtk-doc, docbook_xsl, docbook_xml_dtd_43, fetchpatch
+, gtk-doc, docbook_xsl, docbook_xml_dtd_43
 , libxml2, gnome3, gobject-introspection, libsoup, totem-pl-parser }:
 
 let
   pname = "grilo";
-  version = "0.3.9"; # if you change minor, also change ./setup-hook.sh
+  version = "0.3.10"; # if you change minor, also change ./setup-hook.sh
 in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
@@ -13,30 +13,13 @@ in stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
-    sha256 = "1wnabc69730jsv8dljj5ik8g7p581nw60mw1mkgamkzjcb6821bk";
+    sha256 = "1s7ilyywf18q26aj5c4709kfizqywjlnacp4jzmj9v9i9kkv4i3y";
   };
 
   setupHook = ./setup-hook.sh;
 
   mesonFlags = [
-    "-Dgtk_doc=true"
-  ];
-
-  patches = [
-    # https://gitlab.gnome.org/GNOME/grilo/merge_requests/45
-    # commits are from a separate branch so they shouldn't 404
-    (fetchpatch {
-      url = "https://gitlab.gnome.org/worldofpeace/grilo/commit/f6993c2a8a6c1a6246372569f9f7a9179955c95e.patch";
-      sha256 = "1x4s0ahs60dqyphgv2dy3x2sjnxv5ydd55kdlcjsys5870ijwbi8";
-    })
-    (fetchpatch {
-      url = "https://gitlab.gnome.org/worldofpeace/grilo/commit/61bca28b141162a33eb2fb575ef1daf0f21c7741.patch";
-      sha256 = "1147xbmaq61myfwxz0pagdv056krfmh1s78qjbiy5k7k203qrjz0";
-    })
-    (fetchpatch {
-      url = "https://gitlab.gnome.org/worldofpeace/grilo/commit/363b198a062eeb8aaa5489ea9720e69d428e885c.patch";
-      sha256 = "01w1bfzdbnxy5l37b2z7a9h2mrxziqkzdw02dybjphy85nb0hz5w";
-    })
+    "-Denable-gtk-doc=true"
   ];
 
   nativeBuildInputs = [
diff --git a/nixpkgs/pkgs/development/libraries/grpc/default.nix b/nixpkgs/pkgs/development/libraries/grpc/default.nix
index d45aba1cb378..abcd3abaf309 100644
--- a/nixpkgs/pkgs/development/libraries/grpc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/grpc/default.nix
@@ -1,14 +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.23.0"; # N.B: if you change this, change pythonPackages.grpcio and pythonPackages.grpcio-tools to a matching version too
+  version = "1.26.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 = "14svfy7lvz8lf6b7zg1fbypj2n46n9gq0ldgnv85jm0ikv72cgv6";
+    sha256 = "1fxydarl00vbhd9q153qn4ax1yc6xrd8wij6bfy9j8chipw1bgir";
+    fetchSubmodules = true;
   };
+  patches = [
+    # Fix build on armv6l (https://github.com/grpc/grpc/pull/21341)
+    (fetchpatch {
+      url = "https://github.com/grpc/grpc/commit/198d221e775cf73455eeb863672e7a6274d217f1.patch";
+      sha256 = "11k35w6ffvl192rgzzj2hzyzjhizdgk7i56zdkx6v60zxnyfn7yq";
+    })
+  ];
+
   nativeBuildInputs = [ cmake pkgconfig ];
   buildInputs = [ zlib c-ares c-ares.cmake-config openssl protobuf gflags ];
 
diff --git a/nixpkgs/pkgs/development/libraries/gsettings-desktop-schemas/default.nix b/nixpkgs/pkgs/development/libraries/gsettings-desktop-schemas/default.nix
index ffb8be85d3ac..ea6e08811afa 100644
--- a/nixpkgs/pkgs/development/libraries/gsettings-desktop-schemas/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gsettings-desktop-schemas/default.nix
@@ -7,11 +7,11 @@
 
 stdenv.mkDerivation rec {
   pname = "gsettings-desktop-schemas";
-  version = "3.32.0";
+  version = "3.34.0";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gsettings-desktop-schemas/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0d8a6479vappgplq5crdr3ah0ykqcr3fw533wkx9v1a8lnrv8n9d";
+    sha256 = "1bayr76aylawf2fhyjhv9zgk4kpv7ivrrmd80khb0h3h1wk092r8";
   };
 
   passthru = {
diff --git a/nixpkgs/pkgs/development/libraries/gsl/default.nix b/nixpkgs/pkgs/development/libraries/gsl/default.nix
index 1fd086ca23c7..966d6a8ffd5d 100644
--- a/nixpkgs/pkgs/development/libraries/gsl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gsl/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   # do not let -march=skylake to enable FMA (https://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html)
-  NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.isx86_64 "-mno-fma";
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isx86_64 "-mno-fma";
 
   # https://lists.gnu.org/archive/html/bug-gsl/2015-11/msg00012.html
   doCheck = stdenv.hostPlatform.system != "i686-linux" && stdenv.hostPlatform.system != "aarch64-linux";
diff --git a/nixpkgs/pkgs/development/libraries/gsl/gsl-1_16.nix b/nixpkgs/pkgs/development/libraries/gsl/gsl-1_16.nix
index e5772c8772ec..ae102ac60307 100644
--- a/nixpkgs/pkgs/development/libraries/gsl/gsl-1_16.nix
+++ b/nixpkgs/pkgs/development/libraries/gsl/gsl-1_16.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   # do not let -march=skylake to enable FMA (https://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html)
-  NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.isx86_64 "-mno-fma";
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isx86_64 "-mno-fma";
 
   patches = [
     (fetchpatch {
diff --git a/nixpkgs/pkgs/development/libraries/gsmlib/default.nix b/nixpkgs/pkgs/development/libraries/gsmlib/default.nix
new file mode 100644
index 000000000000..88bec83e624f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsmlib/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchFromGitHub, autoreconfHook }:
+stdenv.mkDerivation rec {
+  pname = "gsmlib";
+  version = "unstable-2017-10-06";
+  src = fetchFromGitHub {
+    owner = "x-logLT";
+    repo = "gsmlib";
+    rev = "4f794b14450132f81673f7d3570c5a859aecf7ae";
+    sha256 = "16v8aj914ac1ipf14a867ljib3gy7fhzd9ypxnsg9l0zi8mm3ml5";
+  };
+  nativeBuildInputs = [ autoreconfHook ];
+  meta = with stdenv.lib; {
+    description = "Library to access GSM mobile phones through GSM modems";
+    homepage = "https://github.com/x-logLT/gsmlib";
+    license = licenses.lgpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.misuzu ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gsound/default.nix b/nixpkgs/pkgs/development/libraries/gsound/default.nix
index 337a2472babd..b1869193a093 100644
--- a/nixpkgs/pkgs/development/libraries/gsound/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gsound/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib, libcanberra, gobject-introspection, libtool, gnome3 }:
+{ stdenv, fetchurl, pkgconfig, glib, vala, libcanberra, gobject-introspection, libtool, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "gsound";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "bba8ff30eea815037e53bee727bbd5f0b6a2e74d452a7711b819a7c444e78e53";
   };
 
-  nativeBuildInputs = [ pkgconfig gobject-introspection libtool gnome3.vala ];
+  nativeBuildInputs = [ pkgconfig gobject-introspection libtool vala ];
   buildInputs = [ glib libcanberra ];
 
   passthru = {
diff --git a/nixpkgs/pkgs/development/libraries/gspell/default.nix b/nixpkgs/pkgs/development/libraries/gspell/default.nix
index fd6b12ccaac1..8adb6264e375 100644
--- a/nixpkgs/pkgs/development/libraries/gspell/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gspell/default.nix
@@ -2,7 +2,7 @@
 
 let
   pname = "gspell";
-  version = "1.8.1";
+  version = "1.8.2";
 in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
@@ -11,7 +11,7 @@ in stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
-    sha256 = "1rdv873ixhwr15jwgc2z6k6y0hj353fqnwsy7zkh0c30qwiiv6l1";
+    sha256 = "1miybm1z5cl91i25l7mfqlxhv7j8yy8rcgi0s1bgbb2vm71rb4dv";
   };
 
   propagatedBuildInputs = [ enchant2 ]; # required for pkgconfig
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/bad/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/bad/default.nix
index 735ab4e6e18e..9b2d3d0e2470 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/bad/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix
index 81d914581321..178f6a1fe893 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix
index f0f01a977fd1..3dd7a547de96 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gstreamer/core/setup-hook.sh b/nixpkgs/pkgs/development/libraries/gstreamer/core/setup-hook.sh
index b8c741af578f..026a4e5f55a0 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/core/setup-hook.sh
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gstreamer/ges/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/ges/default.nix
index 810cee650ca8..6e9a604f7946 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/ges/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gstreamer/good/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/good/default.nix
index c801684b0659..a7c2bcf838e7 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/good/default.nix
+++ b/nixpkgs/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
+, python3
+, 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
+    python3
+    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/nixpkgs/pkgs/development/libraries/gstreamer/legacy/gst-plugins-base/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/legacy/gst-plugins-base/default.nix
index db75705c825a..eed9d423fdb9 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/legacy/gst-plugins-base/default.nix
+++ b/nixpkgs/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
@@ -18,11 +18,18 @@ stdenv.mkDerivation rec {
     sha256 = "0jp6hjlra98cnkal4n6bdmr577q8mcyp3c08s3a02c4hjhw5rr0z";
   };
 
-  patchPhase = ''
+  patches = [
+    ./gcc-4.9.patch
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/commit/f672277509705c4034bc92a141eefee4524d15aa.patch";
+      name = "CVE-2019-9928.patch";
+      sha256 = "1dlamsmyr7chrb6vqqmwikqvvqcx5l7k72p98448qm6k59ndnimc";
+    })
+  ];
+
+  postPatch = ''
     sed -i 's@/bin/echo@echo@g' configure
     sed -i -e 's/^   /\t/' docs/{libs,plugins}/Makefile.in
-
-    patch -p1 < ${./gcc-4.9.patch}
   '';
 
   outputs = [ "out" "dev" ];
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh b/nixpkgs/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh
index 65ce26112519..636e20b732b4 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gstreamer/libav/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/libav/default.nix
index 1847b8d0c12b..e36eba370071 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/libav/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/default.nix
index 5c571fa4a1e7..dfb18754c839 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gstreamer/ugly/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/ugly/default.nix
index 552ab1ec2921..870b4468860f 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/ugly/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gstreamer/vaapi/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/vaapi/default.nix
index adb495689e33..cac56f64cc91 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/vaapi/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gstreamer/validate/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/validate/default.nix
index ad013d1570e1..9439ddd94e8f 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/validate/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gtest/default.nix b/nixpkgs/pkgs/development/libraries/gtest/default.nix
index 5fecd45b7da1..4326be597246 100644
--- a/nixpkgs/pkgs/development/libraries/gtest/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gtk-engine-bluecurve/default.nix b/nixpkgs/pkgs/development/libraries/gtk-engine-bluecurve/default.nix
new file mode 100644
index 000000000000..99ca221f5ba2
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gtk-engine-murrine/default.nix b/nixpkgs/pkgs/development/libraries/gtk-engine-murrine/default.nix
new file mode 100644
index 000000000000..9acb7b25a0dd
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gtk-engines/default.nix b/nixpkgs/pkgs/development/libraries/gtk-engines/default.nix
new file mode 100644
index 000000000000..2f56f6eb4c5c
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gtk-layer-shell/default.nix b/nixpkgs/pkgs/development/libraries/gtk-layer-shell/default.nix
new file mode 100644
index 000000000000..c00e8035f18b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk-layer-shell/default.nix
@@ -0,0 +1,40 @@
+{ stdenv
+, fetchFromGitHub
+, meson
+, ninja
+, pkgconfig
+, wayland
+, gtk3
+, gobject-introspection
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gtk-layer-shell";
+  version = "0.1.0";
+
+  src = fetchFromGitHub {
+    owner = "wmww";
+    repo = "gtk-layer-shell";
+    rev = "v${version}";
+    sha256 = "1fwvlbwp5w1zly6mksvlzbx18ikq4bh7pdj9q0k94qlj6x2zdwg8";
+  };
+
+  nativeBuildInputs = [
+    meson ninja pkgconfig
+  ];
+
+  buildInputs = [
+    wayland gtk3 gobject-introspection
+  ];
+
+  mesonFlags = [
+    "-Dout=${placeholder "out"}"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "A library to create panels and other desktop components for Wayland using the Layer Shell protocol";
+    license = licenses.mit;
+    maintainers = with maintainers; [ eonpatapon ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtk/2.x.nix b/nixpkgs/pkgs/development/libraries/gtk/2.x.nix
index f1a53390467a..932527eed092 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/2.x.nix
+++ b/nixpkgs/pkgs/development/libraries/gtk/2.x.nix
@@ -25,19 +25,22 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  setupHook = ./setup-hook.sh;
+  setupHooks =  [
+    ./hooks/gtk2-clean-immodules-cache.sh
+    ./hooks/drop-icon-theme-cache.sh
+  ];
 
-  nativeBuildInputs = [ setupHook perl pkgconfig gettext gobject-introspection ];
+  nativeBuildInputs = setupHooks ++ [ perl pkgconfig gettext gobject-introspection ];
 
   patches = [
-    ./2.0-immodules.cache.patch
-    ./gtk2-theme-paths.patch
+    ./patches/2.0-immodules.cache.patch
+    ./patches/gtk2-theme-paths.patch
   ] ++ optionals stdenv.isDarwin [
     (fetchpatch {
       url = https://bug557780.bugzilla-attachments.gnome.org/attachment.cgi?id=306776;
       sha256 = "0sp8f1r5c4j2nlnbqgv7s7nxa4cfwigvm033hvhb1ld652pjag4r";
     })
-    ./2.0-darwin-x11.patch
+    ./patches/2.0-darwin-x11.patch
   ];
 
   propagatedBuildInputs = with xorg;
diff --git a/nixpkgs/pkgs/development/libraries/gtk/3.x.nix b/nixpkgs/pkgs/development/libraries/gtk/3.x.nix
index aee97d9bad00..60432614433b 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/3.x.nix
+++ b/nixpkgs/pkgs/development/libraries/gtk/3.x.nix
@@ -3,6 +3,9 @@
 , fetchpatch
 , pkgconfig
 , gettext
+, docbook_xsl
+, docbook_xml_dtd_43
+, gtk-doc
 , meson
 , ninja
 , python3
@@ -24,7 +27,6 @@
 , libxkbcommon
 , gmp
 , gnome3
-, hicolor-icon-theme
 , gsettings-desktop-schemas
 , sassc
 , x11Support ? stdenv.isLinux
@@ -34,6 +36,7 @@
 , wayland-protocols
 , xineramaSupport ? stdenv.isLinux
 , cupsSupport ? stdenv.isLinux
+, withGtkDoc ? stdenv.isLinux
 , cups ? null
 , AppKit
 , Cocoa
@@ -45,44 +48,47 @@ with stdenv.lib;
 
 stdenv.mkDerivation rec {
   pname = "gtk+3";
-  version = "3.24.10";
+  version = "3.24.12";
 
-  outputs = [ "out" "dev" ];
+  outputs = [ "out" "dev" ] ++ optional withGtkDoc "devdoc";
   outputBin = "dev";
 
-  setupHook = ./gtk3-setup-hook.sh;
+  setupHooks = [
+    ./hooks/gtk3-clean-immodules-cache.sh
+    ./hooks/drop-icon-theme-cache.sh
+  ];
 
   src = fetchurl {
     url = "mirror://gnome/sources/gtk+/${stdenv.lib.versions.majorMinor version}/gtk+-${version}.tar.xz";
-    sha256 = "00qvq1r96ikdalv7xzgng1kad9i0rcahqk01gwhxl3xrw83z3a1m";
+    sha256 = "10xyyhlfb0yk4hglngxh2zsv9xrxkqv343df8h01dvagc6jyp10k";
   };
 
   patches = [
-    ./3.0-immodules.cache.patch
+    ./patches/3.0-immodules.cache.patch
     (fetchpatch {
       name = "Xft-setting-fallback-compute-DPI-properly.patch";
       url = "https://bug757142.bugzilla-attachments.gnome.org/attachment.cgi?id=344123";
       sha256 = "0g6fhqcv8spfy3mfmxpyji93k8d4p4q4fz1v9a1c1cgcwkz41d7p";
     })
     # https://gitlab.gnome.org/GNOME/gtk/merge_requests/1002
-    ./01-build-Fix-path-handling-in-pkgconfig.patch
+    ./patches/01-build-Fix-path-handling-in-pkgconfig.patch
   ] ++ optionals stdenv.isDarwin [
     # X11 module requires <gio/gdesktopappinfo.h> which is not installed on Darwin
     # let’s drop that dependency in similar way to how other parts of the library do it
     # e.g. https://gitlab.gnome.org/GNOME/gtk/blob/3.24.4/gtk/gtk-launch.c#L31-33
-    ./3.0-darwin-x11.patch
+    ./patches/3.0-darwin-x11.patch
   ];
 
+  separateDebugInfo = stdenv.isLinux;
+
   mesonFlags = [
+    "-Dgtk_doc=${boolToString withGtkDoc}"
     "-Dtests=false"
   ];
 
   # These are the defines that'd you'd get with --enable-debug=minimum (default).
   # See: https://developer.gnome.org/gtk3/stable/gtk-building.html#extra-configuration-options
-  NIX_CFLAGS_COMPILE = [
-    "-DG_ENABLE_DEBUG"
-    "-DG_DISABLE_CAST_CHECKS"
-  ];
+  NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS";
 
   postPatch = ''
     files=(
@@ -103,14 +109,16 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     gettext
     gobject-introspection
-    hicolor-icon-theme # setup-hook
     makeWrapper
     meson
     ninja
     pkgconfig
     python3
     sassc
-    setupHook
+  ] ++ setupHooks ++ optionals withGtkDoc [
+    docbook_xml_dtd_43
+    docbook_xsl
+    gtk-doc
   ];
 
   buildInputs = [
@@ -192,7 +200,7 @@ stdenv.mkDerivation rec {
     '';
     homepage = https://www.gtk.org/;
     license = licenses.lgpl2Plus;
-    maintainers = with maintainers; [ raskin vcunat lethalman ];
+    maintainers = with maintainers; [ raskin vcunat lethalman worldofpeace ];
     platforms = platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/gtk/hooks/drop-icon-theme-cache.sh b/nixpkgs/pkgs/development/libraries/gtk/hooks/drop-icon-theme-cache.sh
new file mode 100644
index 000000000000..f28a856c4f50
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk/hooks/drop-icon-theme-cache.sh
@@ -0,0 +1,19 @@
+# shellcheck shell=bash
+
+# Packages often run gtk-update-icon-cache to include their icons in themes’ icon cache.
+# However, since each package is installed to its own prefix, the files will only collide.
+dropIconThemeCache() {
+    if [[ -z "${dontDropIconThemeCache:-}" ]]; then
+        local icondir="${out:?}/share/icons"
+        if [[ -d "${icondir}" ]]; then
+            # App icons are supposed to go to hicolor theme, since it is a fallback theme as per [icon-theme-spec], but some might still choose to install stylized icons to other themes.
+            find "${icondir}" -name 'icon-theme.cache' -print0 \
+              | while IFS= read -r -d '' file; do
+                echo "Removing ${file}"
+                rm -f "${file}"
+            done
+        fi
+    fi
+}
+
+preFixupPhases="${preFixupPhases-} dropIconThemeCache"
diff --git a/nixpkgs/pkgs/development/libraries/gtk/setup-hook.sh b/nixpkgs/pkgs/development/libraries/gtk/hooks/gtk2-clean-immodules-cache.sh
index c2b0ab502db7..dde991fd27cd 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/setup-hook.sh
+++ b/nixpkgs/pkgs/development/libraries/gtk/hooks/gtk2-clean-immodules-cache.sh
@@ -1,8 +1,10 @@
+# shellcheck shell=bash
+
 fixupOutputHooks+=(_gtk2CleanComments)
 
 # Clean comments that link to generator of the file
 _gtk2CleanComments() {
-    local f="$prefix/lib/gtk-2.0/2.10.0/immodules.cache"
+    local f="${prefix:?}/lib/gtk-2.0/2.10.0/immodules.cache"
     if [ -f "$f" ]; then
         sed 's|Created by .*bin/gtk-query-|Created by bin/gtk-query-|' -i "$f"
     fi
diff --git a/nixpkgs/pkgs/development/libraries/gtk/gtk3-setup-hook.sh b/nixpkgs/pkgs/development/libraries/gtk/hooks/gtk3-clean-immodules-cache.sh
index bddeb2d25d50..d2d5287831a0 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/gtk3-setup-hook.sh
+++ b/nixpkgs/pkgs/development/libraries/gtk/hooks/gtk3-clean-immodules-cache.sh
@@ -1,10 +1,11 @@
+# shellcheck shell=bash
+
 fixupOutputHooks+=(_gtk3CleanComments)
 
 # Clean comments that link to generator of the file
 _gtk3CleanComments() {
-    local f="$prefix/lib/gtk-3.0/3.0.0/immodules.cache"
+    local f="${prefix:?}/lib/gtk-3.0/3.0.0/immodules.cache"
     if [ -f "$f" ]; then
         sed 's|Created by .*bin/gtk-query-|Created by bin/gtk-query-|' -i "$f"
     fi
 }
-
diff --git a/nixpkgs/pkgs/development/libraries/gtk/01-build-Fix-path-handling-in-pkgconfig.patch b/nixpkgs/pkgs/development/libraries/gtk/patches/01-build-Fix-path-handling-in-pkgconfig.patch
index ec69a12514fe..ec69a12514fe 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/01-build-Fix-path-handling-in-pkgconfig.patch
+++ b/nixpkgs/pkgs/development/libraries/gtk/patches/01-build-Fix-path-handling-in-pkgconfig.patch
diff --git a/nixpkgs/pkgs/development/libraries/gtk/2.0-darwin-x11.patch b/nixpkgs/pkgs/development/libraries/gtk/patches/2.0-darwin-x11.patch
index 9725cfb84260..9725cfb84260 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/2.0-darwin-x11.patch
+++ b/nixpkgs/pkgs/development/libraries/gtk/patches/2.0-darwin-x11.patch
diff --git a/nixpkgs/pkgs/development/libraries/gtk/2.0-immodules.cache.patch b/nixpkgs/pkgs/development/libraries/gtk/patches/2.0-immodules.cache.patch
index 1b8231756e71..1b8231756e71 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/2.0-immodules.cache.patch
+++ b/nixpkgs/pkgs/development/libraries/gtk/patches/2.0-immodules.cache.patch
diff --git a/nixpkgs/pkgs/development/libraries/gtk/3.0-darwin-x11.patch b/nixpkgs/pkgs/development/libraries/gtk/patches/3.0-darwin-x11.patch
index 86631634b5bd..86631634b5bd 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/3.0-darwin-x11.patch
+++ b/nixpkgs/pkgs/development/libraries/gtk/patches/3.0-darwin-x11.patch
diff --git a/nixpkgs/pkgs/development/libraries/gtk/3.0-immodules.cache.patch b/nixpkgs/pkgs/development/libraries/gtk/patches/3.0-immodules.cache.patch
index bbe5f28dbd3e..bbe5f28dbd3e 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/3.0-immodules.cache.patch
+++ b/nixpkgs/pkgs/development/libraries/gtk/patches/3.0-immodules.cache.patch
diff --git a/nixpkgs/pkgs/development/libraries/gtk/gtk2-theme-paths.patch b/nixpkgs/pkgs/development/libraries/gtk/patches/gtk2-theme-paths.patch
index edd69b078076..edd69b078076 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/gtk2-theme-paths.patch
+++ b/nixpkgs/pkgs/development/libraries/gtk/patches/gtk2-theme-paths.patch
diff --git a/nixpkgs/pkgs/development/libraries/gtkd/default.nix b/nixpkgs/pkgs/development/libraries/gtkd/default.nix
index 31a3242cdef5..0b2df597be57 100644
--- a/nixpkgs/pkgs/development/libraries/gtkd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gtkd/default.nix
@@ -1,69 +1,75 @@
-{ stdenv, fetchzip, atk, cairo, dmd, gdk-pixbuf, gnome3, gst_all_1, librsvg
-, glib, gtk3, gtksourceview, libgda, libpeas, pango, pkgconfig, which, vte }:
+{ stdenv, fetchzip, fetchpatch, atk, cairo, dmd, gdk-pixbuf, gnome3, gst_all_1, librsvg
+, glib, gtk3, gtksourceview4, libgda, libpeas, pango, pkgconfig, which, vte }:
 
 let
-  inherit (gst_all_1) gstreamer gst-plugins-base;
+  inherit (gst_all_1) gstreamer gst-plugins-base gst-plugins-bad;
 in stdenv.mkDerivation rec {
   pname = "gtkd";
-  version = "3.8.5";
+  version = "3.9.0";
 
   src = fetchzip {
     url = "https://gtkd.org/Downloads/sources/GtkD-${version}.zip";
-    sha256 = "12n2njsaplra7x15nqwrj2hrf8a27pfjj2mck4mkzxv03qk6mqky";
+    sha256 = "12kc4s5gp6gn456d8pzhww1ggi9qbxldmcpp6855297g2x8xxy5p";
     stripRoot = false;
   };
 
   nativeBuildInputs = [ dmd pkgconfig which ];
   propagatedBuildInputs = [
-    atk cairo gdk-pixbuf glib gstreamer gst-plugins-base gtk3 gtksourceview
+    atk cairo gdk-pixbuf glib gstreamer gst-plugins-base gtk3 gtksourceview4
     libgda libpeas librsvg pango vte
   ];
 
+  patches = [
+    # Fix makefile not installing .pc's
+    (fetchpatch {
+      url = "https://github.com/gtkd-developers/GtkD/commit/a9db09117ab27127ca4c3b8d2f308fae483a9199.patch";
+      sha256 = "0ngyqifw1kandc1vk01kms3z65pcisfd75q7z09rml96glhfzjd6";
+    })
+  ];
+
   prePatch = ''
     substituteAll ${./paths.d} generated/gtkd/gtkd/paths.d
-    substituteInPlace src/cairo/c/functions-compiletime.d \
-      --replace libcairo.so.2 ${cairo}/lib/libcairo.so.2 \
-      --replace libcairo.dylib ${cairo}/lib/libcairo.dylib
-    substituteInPlace src/cairo/c/functions-runtime.d \
-      --replace libcairo.so.2 ${cairo}/lib/libcairo.so.2 \
-      --replace libcairo.dylib ${cairo}/lib/libcairo.dylib
-    substituteInPlace generated/gtkd/gdkpixbuf/c/functions.d \
-      --replace libgdk_pixbuf-2.0.so.0 ${gdk-pixbuf}/lib/libgdk_pixbuf-2.0.so.0 \
-      --replace libgdk_pixbuf-2.0.0.dylib ${gdk-pixbuf}/lib/libgdk_pixbuf-2.0.0.dylib
+
+    substituteInPlace generated/gstreamer/gst/app/c/functions.d \
+      --replace libgstapp-1.0.so.0 ${gst-plugins-base}/lib/libgstapp-1.0.so.0 \
+      --replace libgstapp-1.0.0.dylib ${gst-plugins-base}/lib/libgstapp-1.0.0.dylib
+
+    substituteInPlace generated/gstreamer/gst/base/c/functions.d \
+      --replace libgstbase-1.0.so.0 ${gstreamer.out}/lib/libgstbase-1.0.so.0 \
+      --replace libgstbase-1.0.0.dylib ${gstreamer.out}/lib/libgstbase-1.0.0.dylib
+
+    substituteInPlace generated/gstreamer/gst/mpegts/c/functions.d \
+      --replace libgstmpegts-1.0.so.0 ${gst-plugins-bad.out}/lib/libgstmpegts-1.0.so.0 \
+      --replace libgstmpegts-1.0.0.dylib ${gst-plugins-bad.out}/lib/libgstmpegts-1.0.0.dylib
+
+    substituteInPlace generated/gstreamer/gstinterfaces/c/functions.d \
+      --replace libgstvideo-1.0.so.0 ${gst-plugins-base}/lib/libgstvideo-1.0.so.0 \
+      --replace libgstvideo-1.0.0.dylib ${gst-plugins-base}/lib/libgstvideo-1.0.0.dylib
+
+    substituteInPlace generated/gstreamer/gstreamer/c/functions.d \
+      --replace libgstreamer-1.0.so.0 ${gstreamer}/lib/libgstreamer-1.0.so.0 \
+      --replace libgstreamer-1.0.0.dylib ${gstreamer}/lib/libgstreamer-1.0.0.dylib
+
     substituteInPlace generated/gtkd/atk/c/functions.d \
       --replace libatk-1.0.so.0 ${atk}/lib/libatk-1.0.so.0 \
       --replace libatk-1.0.0.dylib ${atk}/lib/libatk-1.0.0.dylib
-    substituteInPlace generated/gtkd/pango/c/functions.d \
-      --replace libpango-1.0.so.0 ${pango.out}/lib/libpango-1.0.so.0 \
-      --replace libpangocairo-1.0.so.0 ${pango.out}/lib/libpangocairo-1.0.so.0 \
-      --replace libpango-1.0.0.dylib ${pango.out}/lib/libpango-1.0.0.dylib \
-      --replace libpangocairo-1.0.0.dylib ${pango.out}/lib/libpangocairo-1.0.0.dylib
-    substituteInPlace generated/gtkd/gobject/c/functions.d \
-      --replace libgobject-2.0.so.0 ${glib.out}/lib/libgobject-2.0.so.0 \
-      --replace libgobject-2.0.0.dylib ${glib.out}/lib/libgobject-2.0.0.dylib
-    substituteInPlace generated/gtkd/rsvg/c/functions.d \
-      --replace librsvg-2.so.2 ${librsvg}/lib/librsvg-2.so.2 \
-      --replace librsvg-2.2.dylib ${librsvg}/lib/librsvg-2.2.dylib
+
     substituteInPlace generated/gtkd/cairo/c/functions.d \
       --replace libcairo.so.2 ${cairo}/lib/libcairo.so.2 \
       --replace libcairo.dylib ${cairo}/lib/libcairo.dylib
+
     substituteInPlace generated/gtkd/gdk/c/functions.d \
       --replace libgdk-3.so.0 ${gtk3}/lib/libgdk-3.so.0 \
       --replace libgdk-3.0.dylib ${gtk3}/lib/libgdk-3.0.dylib
-    substituteInPlace generated/peas/peas/c/functions.d \
-      --replace libpeas-1.0.so.0 ${libpeas}/lib/libpeas-1.0.so.0 \
-      --replace libpeas-gtk-1.0.so.0 ${libpeas}/lib/libpeas-gtk-1.0.so.0 \
-      --replace libpeas-1.0.0.dylib ${libpeas}/lib/libpeas-1.0.0.dylib \
-      --replace gtk-1.0.0.dylib ${libpeas}/lib/gtk-1.0.0.dylib
-    substituteInPlace generated/vte/vte/c/functions.d \
-      --replace libvte-2.91.so.0 ${vte}/lib/libvte-2.91.so.0 \
-      --replace libvte-2.91.0.dylib ${vte}/lib/libvte-2.91.0.dylib
-    substituteInPlace generated/gstreamer/gstinterfaces/c/functions.d \
-      --replace libgstvideo-1.0.so.0 ${gst-plugins-base}/lib/libgstvideo-1.0.so.0 \
-      --replace libgstvideo-1.0.0.dylib ${gst-plugins-base}/lib/libgstvideo-1.0.0.dylib
-    substituteInPlace generated/sourceview/gsv/c/functions.d \
-      --replace libgtksourceview-3.0.so.1 ${gtksourceview}/lib/libgtksourceview-3.0.so.1 \
-      --replace libgtksourceview-3.0.1.dylib ${gtksourceview}/lib/libgtksourceview-3.0.1.dylib
+
+    substituteInPlace generated/gtkd/gdkpixbuf/c/functions.d \
+      --replace libgdk_pixbuf-2.0.so.0 ${gdk-pixbuf}/lib/libgdk_pixbuf-2.0.so.0 \
+      --replace libgdk_pixbuf-2.0.0.dylib ${gdk-pixbuf}/lib/libgdk_pixbuf-2.0.0.dylib
+
+    substituteInPlace generated/gtkd/gio/c/functions.d \
+      --replace libgio-2.0.so.0 ${glib.out}/lib/libgio-2.0.so.0 \
+      --replace libgio-2.0.0.dylib ${glib.out}/lib/libgio-2.0.0.dylib
+
     substituteInPlace generated/gtkd/glib/c/functions.d \
       --replace libglib-2.0.so.0 ${glib.out}/lib/libglib-2.0.so.0 \
       --replace libgmodule-2.0.so.0 ${glib.out}/lib/libgmodule-2.0.so.0 \
@@ -71,20 +77,46 @@ in stdenv.mkDerivation rec {
       --replace libglib-2.0.0.dylib ${glib.out}/lib/libglib-2.0.0.dylib \
       --replace libgmodule-2.0.0.dylib ${glib.out}/lib/libgmodule-2.0.0.dylib \
       --replace libgobject-2.0.0.dylib ${glib.out}/lib/libgobject-2.0.0.dylib
-    substituteInPlace generated/gtkd/gio/c/functions.d \
-      --replace libgio-2.0.so.0 ${glib.out}/lib/libgio-2.0.so.0 \
-      --replace libgio-2.0.0.dylib ${glib.out}/lib/libgio-2.0.0.dylib
-    substituteInPlace generated/gstreamer/gstreamer/c/functions.d \
-      --replace libgstreamer-1.0.so.0 ${gstreamer}/lib/libgstreamer-1.0.so.0 \
-      --replace libgstreamer-1.0.0.dylib ${gstreamer}/lib/libgstreamer-1.0.0.dylib
+
+    substituteInPlace generated/gtkd/gobject/c/functions.d \
+      --replace libgobject-2.0.so.0 ${glib.out}/lib/libgobject-2.0.so.0 \
+      --replace libgobject-2.0.0.dylib ${glib.out}/lib/libgobject-2.0.0.dylib
+
     substituteInPlace generated/gtkd/gtk/c/functions.d \
       --replace libgdk-3.so.0 ${gtk3}/lib/libgdk-3.so.0 \
       --replace libgtk-3.so.0 ${gtk3}/lib/libgtk-3.so.0 \
       --replace libgdk-3.0.dylib ${gtk3}/lib/libgdk-3.0.dylib \
       --replace libgtk-3.0.dylib ${gtk3}/lib/libgtk-3.0.dylib
+
+    substituteInPlace generated/gtkd/pango/c/functions.d \
+      --replace libpango-1.0.so.0 ${pango.out}/lib/libpango-1.0.so.0 \
+      --replace libpangocairo-1.0.so.0 ${pango.out}/lib/libpangocairo-1.0.so.0 \
+      --replace libpango-1.0.0.dylib ${pango.out}/lib/libpango-1.0.0.dylib \
+      --replace libpangocairo-1.0.0.dylib ${pango.out}/lib/libpangocairo-1.0.0.dylib
+
+    substituteInPlace generated/gtkd/rsvg/c/functions.d \
+      --replace librsvg-2.so.2 ${librsvg}/lib/librsvg-2.so.2 \
+      --replace librsvg-2.2.dylib ${librsvg}/lib/librsvg-2.2.dylib
+
+    substituteInPlace generated/peas/peas/c/functions.d \
+      --replace libpeas-1.0.so.0 ${libpeas}/lib/libpeas-1.0.so.0 \
+      --replace libpeas-gtk-1.0.so.0 ${libpeas}/lib/libpeas-gtk-1.0.so.0 \
+      --replace libpeas-1.0.0.dylib ${libpeas}/lib/libpeas-1.0.0.dylib \
+      --replace gtk-1.0.0.dylib ${libpeas}/lib/gtk-1.0.0.dylib
+
+    substituteInPlace generated/sourceview/gsv/c/functions.d \
+      --replace libgtksourceview-4.so.0 ${gtksourceview4}/lib/libgtksourceview-4.so.0 \
+      --replace libgtksourceview-4.0.dylib ${gtksourceview4}/lib/libgtksourceview-4.0.dylib
+
+    substituteInPlace generated/vte/vte/c/functions.d \
+      --replace libvte-2.91.so.0 ${vte}/lib/libvte-2.91.so.0 \
+      --replace libvte-2.91.0.dylib ${vte}/lib/libvte-2.91.0.dylib
   '';
 
-  installFlags = "prefix=$(out)";
+  makeFlags  = [
+    "prefix=${placeholder "out"}"
+    "PKG_CONFIG=${pkgconfig}/bin/pkg-config"
+  ];
 
   meta = with stdenv.lib; {
     description = "D binding and OO wrapper for GTK";
diff --git a/nixpkgs/pkgs/development/libraries/gtkd/paths.d b/nixpkgs/pkgs/development/libraries/gtkd/paths.d
index 0f857136499f..8793da440690 100644
--- a/nixpkgs/pkgs/development/libraries/gtkd/paths.d
+++ b/nixpkgs/pkgs/development/libraries/gtkd/paths.d
@@ -103,8 +103,8 @@ else version(darwin)
 		LIBRARY.GLGDK:         "libgdkglext-3.0.dylib",
 		LIBRARY.GLGTK:         "libgtkglext-3.0.dylib",
 		LIBRARY.GDA:           "@libgda@/lib/libgda-2.dylib",
-		LIBRARY.GSV:           "@gtksourceview@/lib/libgtksourceview-3.0.dylib",
-		LIBRARY.GSV1:          "@gtksourceview@/lib/libgtksourceview-3.0.dylib",
+		LIBRARY.GSV:           "@gtksourceview4@/lib/libgtksourceview-4.0.dylib",
+		LIBRARY.GSV1:          "@gtksourceview4@/lib/libgtksourceview-4.0.dylib",
 		LIBRARY.GSTREAMER:     "@gstreamer@/lib/libgstreamer-1.0.dylib",
 		LIBRARY.GSTINTERFACES: "@gst_plugins_base@/lib/libgstvideo-1.0.dylib",
 		LIBRARY.VTE:           "@vte@/lib/libvte-2.91.dylib",
@@ -131,8 +131,8 @@ else
 		LIBRARY.GLGDK:         "libgdkglext-3.0.so.0",
 		LIBRARY.GLGTK:         "libgtkglext-3.0.so.0",
 		LIBRARY.GDA:           "@libgda@/lib/libgda-4.0.so.4",
-		LIBRARY.GSV:           "@gtksourceview@/lib/libgtksourceview-3.0.so.0",
-		LIBRARY.GSV1:          "@gtksourceview@/lib/libgtksourceview-3.0.so.1",
+		LIBRARY.GSV:           "@gtksourceview4@/lib/libgtksourceview-4.so.0",
+		LIBRARY.GSV1:          "@gtksourceview4@/lib/libgtksourceview-4.so.0",
 		LIBRARY.GSTREAMER:     "@gstreamer@/lib/libgstreamer-1.0.so.0",
 		LIBRARY.GSTINTERFACES: "@gst_plugins_base@/lib/libgstvideo-1.0.so.0",
 		LIBRARY.VTE:           "@vte@/lib/libvte-2.91.so.0",
diff --git a/nixpkgs/pkgs/development/libraries/gtkmm/3.x.nix b/nixpkgs/pkgs/development/libraries/gtkmm/3.x.nix
index f977af046ca2..d79e739f80c6 100644
--- a/nixpkgs/pkgs/development/libraries/gtkmm/3.x.nix
+++ b/nixpkgs/pkgs/development/libraries/gtkmm/3.x.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "gtkmm";
-  version = "3.24.1";
+  version = "3.24.2";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1zfj89spr8ianib5y10wcw63ybdmyjy58a15vqs0m8jq4knl5znx";
+    sha256 = "1hxdnhavjyvbcpxhd5z17l9fj4182028s66lc0s16qqqrldhjwbd";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/nixpkgs/pkgs/development/libraries/gtksourceview/4.x.nix b/nixpkgs/pkgs/development/libraries/gtksourceview/4.x.nix
index fde94e79f056..d3a7d849062e 100644
--- a/nixpkgs/pkgs/development/libraries/gtksourceview/4.x.nix
+++ b/nixpkgs/pkgs/development/libraries/gtksourceview/4.x.nix
@@ -1,13 +1,14 @@
-{ stdenv, fetchurl, pkgconfig, atk, cairo, glib, gtk3, pango, vala
-, libxml2, perl, gettext, gnome3, gobject-introspection, dbus, xvfb_run, shared-mime-info }:
+{ stdenv, fetchurl, pkgconfig, atk, cairo, glib, gtk3, pango, fribidi, vala
+, libxml2, perl, gettext, gnome3, gobject-introspection, dbus, xvfb_run, shared-mime-info
+, meson, ninja }:
 
 stdenv.mkDerivation rec {
   pname = "gtksourceview";
-  version = "4.2.0";
+  version = "4.4.0";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gtksourceview/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0xgnjj7jd56wbl99s76sa1vjq9bkz4mdsxwgwlcphg689liyncf4";
+    sha256 = "16k8kqw9w775f1ijsk898hp210an5mv4yfyrmik9m8khxx593nwx";
   };
 
   propagatedBuildInputs = [
@@ -19,11 +20,11 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig gettext perl gobject-introspection vala ];
+  nativeBuildInputs = [ meson ninja pkgconfig gettext perl gobject-introspection vala ];
 
   checkInputs = [ xvfb_run dbus ];
 
-  buildInputs = [ atk cairo glib pango libxml2 ];
+  buildInputs = [ atk cairo glib pango fribidi libxml2 ];
 
   patches = [ ./4.x-nix_share_path.patch ];
 
@@ -31,11 +32,10 @@ stdenv.mkDerivation rec {
 
   doCheck = stdenv.isLinux;
   checkPhase = ''
-    NO_AT_BRIDGE=1 \
     XDG_DATA_DIRS="$XDG_DATA_DIRS:${shared-mime-info}/share" \
     xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
       --config-file=${dbus.daemon}/share/dbus-1/session.conf \
-      make check
+      meson test --no-rebuild --print-errorlogs
   '';
 
   passthru = {
diff --git a/nixpkgs/pkgs/development/libraries/gtkspell/3.nix b/nixpkgs/pkgs/development/libraries/gtkspell/3.nix
index 54b4b001d817..b68c814ad543 100644
--- a/nixpkgs/pkgs/development/libraries/gtkspell/3.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/gts/default.nix b/nixpkgs/pkgs/development/libraries/gts/default.nix
index 9cc079d61030..18640e923e8b 100644
--- a/nixpkgs/pkgs/development/libraries/gts/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gts/default.nix
@@ -1,17 +1,20 @@
-{ fetchurl, stdenv, glib, pkgconfig, gettext }:
+{ fetchurl, stdenv, pkgconfig, autoreconfHook, gettext, glib }:
 
 
 stdenv.mkDerivation rec {
   pname = "gts";
   version = "0.7.6";
 
+  outputs = [ "bin" "dev" "out" ];
+
   src = fetchurl {
     url = "mirror://sourceforge/gts/${pname}-${version}.tar.gz";
     sha256 = "07mqx09jxh8cv9753y2d2jsv7wp8vjmrd7zcfpbrddz3wc9kx705";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ glib gettext ];
+  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  buildInputs = [ gettext ];
+  propagatedBuildInputs = [ glib ];
 
   doCheck = false; # fails with "permission denied"
 
diff --git a/nixpkgs/pkgs/development/libraries/gvfs/default.nix b/nixpkgs/pkgs/development/libraries/gvfs/default.nix
index 8b3bc30a6616..f8db6f573d93 100644
--- a/nixpkgs/pkgs/development/libraries/gvfs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gvfs/default.nix
@@ -14,7 +14,7 @@
 , libgphoto2
 , avahi
 , libarchive
-, fuse
+, fuse3
 , libcdio
 , libxml2
 , libxslt
@@ -36,15 +36,16 @@
 , libsecret
 , libgdata
 , python3
+, gsettings-desktop-schemas
 }:
 
 stdenv.mkDerivation rec {
   pname = "gvfs";
-  version = "1.40.2";
+  version = "1.42.2";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "07lpcfric3h0302n9b1pwa38mjb76r9s98kg2867y2d1qvzfivxx";
+    sha256 = "0jgrbid8a61hgh05wl8c4f4638x7dffd5vip02jmladxfdszjymm";
   };
 
   postPatch = ''
@@ -76,7 +77,7 @@ stdenv.mkDerivation rec {
     libgphoto2
     avahi
     libarchive
-    fuse
+    fuse3
     libcdio
     samba
     libmtp
@@ -87,6 +88,7 @@ stdenv.mkDerivation rec {
     libcdio-paranoia
     libnfs
     openssh
+    gsettings-desktop-schemas
     # TODO: a ligther version of libsoup to have FTP/HTTP support?
   ] ++ stdenv.lib.optionals gnomeSupport [
     gnome3.libsoup
diff --git a/nixpkgs/pkgs/development/libraries/harfbuzz/default.nix b/nixpkgs/pkgs/development/libraries/harfbuzz/default.nix
index 3f7d1a2c3526..42f68eea83f2 100644
--- a/nixpkgs/pkgs/development/libraries/harfbuzz/default.nix
+++ b/nixpkgs/pkgs/development/libraries/harfbuzz/default.nix
@@ -8,7 +8,7 @@
 }:
 
 let
-  version = "2.6.1";
+  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 = "0kw4c04jd8c8ili3j1glgv0wsr207313fs3jh2rawf53m8zznlf6";
+    sha256 = "04iwq13w6zkdhljmsxrzgg4fyh04qnwfn57rgrl9kmijc7cvh4wl";
   };
 
   postPatch = ''
diff --git a/nixpkgs/pkgs/development/libraries/hspell/dicts.nix b/nixpkgs/pkgs/development/libraries/hspell/dicts.nix
index ec6b304dc3ce..83942c2c1dde 100644
--- a/nixpkgs/pkgs/development/libraries/hspell/dicts.nix
+++ b/nixpkgs/pkgs/development/libraries/hspell/dicts.nix
@@ -1,42 +1,38 @@
 { stdenv, hspell }:
 
 let
-  dict = a: stdenv.mkDerivation ({
+  dict = variant: a: stdenv.mkDerivation ({
     inherit (hspell) src patchPhase nativeBuildInputs;
+    buildFlags = [ variant ];
+
     meta = hspell.meta // {
       broken = true;
-      description = "${a.buildFlags} Hebrew dictionary";
+      description = "${variant} Hebrew dictionary";
     } // (if a ? meta then a.meta else {});
   } // (removeAttrs a ["meta"]));
 in
 {
   recurseForDerivations = true;
 
-  aspell = dict {
+  aspell = dict "aspell" {
     name = "aspell-dict-he-${hspell.version}";
 
-    buildFlags = "aspell";
-
     installPhase = ''
       mkdir -p $out/lib/aspell
       cp -v he_affix.dat he.wl $out/lib/aspell'';
   };
 
-  myspell = dict {
+  myspell = dict "myspell" {
     name = "myspell-dict-he-${hspell.version}";
 
-    buildFlags = "myspell";
-
     installPhase = ''
       mkdir -p $out/lib/myspell
       cp -v he.dic he.aff $out/lib/myspell'';
   };
 
-  hunspell = dict {
+  hunspell = dict "hunspell" {
     name = "hunspell-dict-he-${hspell.version}";
 
-    buildFlags = "hunspell";
-
     installPhase = ''
       mkdir -p $out/lib
       cp -rv hunspell $out/lib'';
diff --git a/nixpkgs/pkgs/development/libraries/http-parser/default.nix b/nixpkgs/pkgs/development/libraries/http-parser/default.nix
index 76173bc5b998..4b1a695ca551 100644
--- a/nixpkgs/pkgs/development/libraries/http-parser/default.nix
+++ b/nixpkgs/pkgs/development/libraries/http-parser/default.nix
@@ -16,7 +16,7 @@ in stdenv.mkDerivation {
   NIX_CFLAGS_COMPILE = "-Wno-error";
   patches = [ ./build-shared.patch ];
   makeFlags = [ "DESTDIR=" "PREFIX=$(out)" ];
-  buildFlags = "library";
+  buildFlags = [ "library" ];
   doCheck = true;
   checkTarget = "test";
 
diff --git a/nixpkgs/pkgs/development/libraries/hunspell/default.nix b/nixpkgs/pkgs/development/libraries/hunspell/default.nix
index a8dcea0059a2..f2f8cdcab205 100644
--- a/nixpkgs/pkgs/development/libraries/hunspell/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/hunspell/dictionaries.nix b/nixpkgs/pkgs/development/libraries/hunspell/dictionaries.nix
index 3e1799d82cde..fb64aa81d1a0 100644
--- a/nixpkgs/pkgs/development/libraries/hunspell/dictionaries.nix
+++ b/nixpkgs/pkgs/development/libraries/hunspell/dictionaries.nix
@@ -722,4 +722,14 @@ in rec {
       platforms = platforms.all;
     };
   };
+
+  /* RUSSIAN */
+
+  ru_RU = ru-ru;
+  ru-ru = mkDictFromLibreOffice {
+    shortName = "ru-ru";
+    dictFileName = "ru_RU";
+    shortDescription = "Russian (Russian)";
+    license = with stdenv.lib.licenses; [ mpl20 lgpl3 ];
+  };
 }
diff --git a/nixpkgs/pkgs/development/libraries/hwloc/default.nix b/nixpkgs/pkgs/development/libraries/hwloc/default.nix
index 0f4ce4e6b97c..ffa64858b758 100644
--- a/nixpkgs/pkgs/development/libraries/hwloc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/hwloc/default.nix
@@ -7,7 +7,7 @@ assert x11Support -> libX11 != null && cairo != null;
 with stdenv.lib;
 
 let
-  version = "2.0.4";
+  version = "2.1.0";
   versmm = versions.major version + "." + versions.minor version;
   name = "hwloc-${version}";
 
@@ -16,7 +16,7 @@ in stdenv.mkDerivation {
 
   src = fetchurl {
     url = "https://www.open-mpi.org/software/hwloc/v${versmm}/downloads/${name}.tar.bz2";
-    sha256 = "1aa7s208gdijk19vvzzahyl8pglk1va3yd6kdbpfa5pz5ms0ag35";
+    sha256 = "0qh8s7pphz0m5cwb7liqmc17xzfs23xhz5wn24r6ikvjyx99fhhr";
   };
 
   configureFlags = [
diff --git a/nixpkgs/pkgs/development/libraries/hyperscan/default.nix b/nixpkgs/pkgs/development/libraries/hyperscan/default.nix
index bc0ce15a083d..d389b69087ba 100644
--- a/nixpkgs/pkgs/development/libraries/hyperscan/default.nix
+++ b/nixpkgs/pkgs/development/libraries/hyperscan/default.nix
@@ -11,12 +11,12 @@
 
 stdenv.mkDerivation rec {
   pname = "hyperscan";
-  version = "5.1.1";
+  version = "5.2.1";
 
   src = fetchFromGitHub {
     owner = "intel";
     repo = pname;
-    sha256 = "11adkz5ln2d2jywwlmixfnwqp5wxskq1104hmmcpws590lhkjv6j";
+    sha256 = "09dgvmjhdbrfgrsmjljl4wn06a8zlv9sd4d4l6h6bfbz57d35f95";
     rev = "v${version}";
   };
 
diff --git a/nixpkgs/pkgs/development/libraries/hyphen/default.nix b/nixpkgs/pkgs/development/libraries/hyphen/default.nix
new file mode 100644
index 000000000000..9f30ff54823f
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/icu/58.nix b/nixpkgs/pkgs/development/libraries/icu/58.nix
index f7763ba49da1..e53e4e3737ed 100644
--- a/nixpkgs/pkgs/development/libraries/icu/58.nix
+++ b/nixpkgs/pkgs/development/libraries/icu/58.nix
@@ -10,5 +10,5 @@ import ./base.nix {
   version = "58.2";
   sha256 = "036shcb3f8bm1lynhlsb4kpjm9s9c2vdiir01vg216rs2l8482ib";
   patches = [ keywordFix ];
-  patchFlags = "-p4";
+  patchFlags = [ "-p4" ];
 }
diff --git a/nixpkgs/pkgs/development/libraries/icu/base.nix b/nixpkgs/pkgs/development/libraries/icu/base.nix
index 0a8cb7d46843..e51224433e8b 100644
--- a/nixpkgs/pkgs/development/libraries/icu/base.nix
+++ b/nixpkgs/pkgs/development/libraries/icu/base.nix
@@ -1,4 +1,4 @@
-{ version, sha256, patches ? [], patchFlags ? "" }:
+{ version, sha256, patches ? [], patchFlags ? [] }:
 { stdenv, lib, fetchurl, fixDarwinDylibNames
   # Cross-compiled icu4c requires a build-root of a native compile
 , buildRootOnly ? false, nativeBuildRoot
@@ -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/nixpkgs/pkgs/development/libraries/ilmbase/default.nix b/nixpkgs/pkgs/development/libraries/ilmbase/default.nix
index 5cc0f7c1f46d..00cdda1e5708 100644
--- a/nixpkgs/pkgs/development/libraries/ilmbase/default.nix
+++ b/nixpkgs/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";
@@ -19,9 +20,19 @@ stdenv.mkDerivation rec {
   depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [ automake autoconf libtool which ];
 
-  NIX_CFLAGS_LINK = [ "-pthread" ];
+  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/nixpkgs/pkgs/development/libraries/incrtcl/default.nix b/nixpkgs/pkgs/development/libraries/incrtcl/default.nix
index f74477eab384..e7f575b04be7 100644
--- a/nixpkgs/pkgs/development/libraries/incrtcl/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/intel-gmmlib/default.nix b/nixpkgs/pkgs/development/libraries/intel-gmmlib/default.nix
index 53b89f17ea5c..6c872272e379 100644
--- a/nixpkgs/pkgs/development/libraries/intel-gmmlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/intel-gmmlib/default.nix
@@ -4,13 +4,13 @@
 
 stdenv.mkDerivation rec {
   pname = "intel-gmmlib";
-  version = "19.2.3";
+  version = "19.3.4";
 
   src = fetchFromGitHub {
     owner  = "intel";
     repo   = "gmmlib";
     rev    = "${pname}-${version}";
-    sha256 = "0hki53czv1na7h5b06fcwkd8bhn690ywg6dwjfs3x9fa4g48kqjb";
+    sha256 = "1vgh14vdmwr34l6rfzmbpsdwp4xi7qp8lg527p16pm7nv0bwx2zk";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/development/libraries/intel-media-driver/default.nix b/nixpkgs/pkgs/development/libraries/intel-media-driver/default.nix
index e3dbfa52db22..176f28093048 100644
--- a/nixpkgs/pkgs/development/libraries/intel-media-driver/default.nix
+++ b/nixpkgs/pkgs/development/libraries/intel-media-driver/default.nix
@@ -5,13 +5,13 @@
 
 stdenv.mkDerivation rec {
   pname = "intel-media-driver";
-  version = "19.2";
+  version = "19.3.0";
 
   src = fetchFromGitHub {
     owner  = "intel";
     repo   = "media-driver";
     rev    = "intel-media-${version}";
-    sha256 = "118cg1grzm62lppaygvh7mgxn23bicjkwjwpxhbyqs9g6yhdj3p8";
+    sha256 = "1vzh11qr7dwmi3d10nq46k754h3q1yya71nk2jgicaj2mm0ylzx6";
   };
 
   cmakeFlags = [
diff --git a/nixpkgs/pkgs/development/libraries/intel-media-sdk/default.nix b/nixpkgs/pkgs/development/libraries/intel-media-sdk/default.nix
index 67bee86bfa93..0ca31f551e89 100644
--- a/nixpkgs/pkgs/development/libraries/intel-media-sdk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/intel-media-sdk/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   pname = "intel-media-sdk";
-  version = "19.1.0";
+  version = "19.4.0";
 
   src = fetchurl {
     url = "https://github.com/Intel-Media-SDK/MediaSDK/archive/intel-mediasdk-${version}.tar.gz";
-    sha256 = "1gligrg6khzmwcy6miikljj75hhxqy0a95qzc8m61ipx5c8igdpv";
+    sha256 = "1l8wjb933wdl3vyq6r36a9pgf8n6pm9g9vcp3m393hixwzzl16i8";
   };
 
   # 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/nixpkgs/pkgs/development/libraries/irrlicht/default.nix b/nixpkgs/pkgs/development/libraries/irrlicht/default.nix
index 35ef14cbc135..788772888c6d 100644
--- a/nixpkgs/pkgs/development/libraries/irrlicht/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/iso-codes/default.nix b/nixpkgs/pkgs/development/libraries/iso-codes/default.nix
index 37d6c0643c73..1766abb2aac9 100644
--- a/nixpkgs/pkgs/development/libraries/iso-codes/default.nix
+++ b/nixpkgs/pkgs/development/libraries/iso-codes/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "iso-codes";
-  version = "4.3";
+  version = "4.4";
 
   src = fetchurl {
     url = "https://salsa.debian.org/iso-codes-team/iso-codes/-/archive/${pname}-${version}/${pname}-${pname}-${version}.tar.bz2";
-    sha256 = "11n3sccwapfr7npxad8m3xmc7w8i11kk70ffbz25gj82bn8rylvb";
+    sha256 = "02x0wcz783ammkdrmrh31wsmww481xbkbz70vf766ivbnn5sfxn6";
   };
 
   patchPhase = ''
diff --git a/nixpkgs/pkgs/development/libraries/itk/4.x.nix b/nixpkgs/pkgs/development/libraries/itk/4.x.nix
index df016d9fcac0..7e24ba901e59 100644
--- a/nixpkgs/pkgs/development/libraries/itk/4.x.nix
+++ b/nixpkgs/pkgs/development/libraries/itk/4.x.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, cmake, libX11, libuuid, xz, vtk }:
 
 stdenv.mkDerivation rec {
-  name = "itk-4.13.1";
+  name = "itk-4.13.2";
 
   src = fetchurl {
-    url = mirror://sourceforge/itk/InsightToolkit-4.13.1.tar.xz;
-    sha256 = "0p4cspgbnjsnkjz8nfg092yaxz8qkqi2nkxjdv421d0zrmi0i2al";
+    url = mirror://sourceforge/itk/InsightToolkit-4.13.2.tar.xz;
+    sha256 = "19cgfpd63gqrvc3m27m394gy2d7w79g5y6lvznb5qqr49lihbgns";
   };
 
   cmakeFlags = [
diff --git a/nixpkgs/pkgs/development/libraries/jasper/default.nix b/nixpkgs/pkgs/development/libraries/jasper/default.nix
index 1bad3394b6ac..093fd0c5f28a 100644
--- a/nixpkgs/pkgs/development/libraries/jasper/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/java/hsqldb/builder.sh b/nixpkgs/pkgs/development/libraries/java/hsqldb/builder.sh
deleted file mode 100755
index d7de23ab95eb..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/java/hsqldb/default.nix b/nixpkgs/pkgs/development/libraries/java/hsqldb/default.nix
index a478ab0fc502..d9139ec1d823 100644
--- a/nixpkgs/pkgs/development/libraries/java/hsqldb/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/java/lombok/default.nix b/nixpkgs/pkgs/development/libraries/java/lombok/default.nix
index be3ddfff4c84..09cec4631416 100644
--- a/nixpkgs/pkgs/development/libraries/java/lombok/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/lombok/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "lombok-1.18.8";
+  name = "lombok-1.18.10";
 
   src = fetchurl {
     url = "https://projectlombok.org/downloads/${name}.jar";
-    sha256 = "1z14rc3fh03qvn2xkjrb7ha0hddv3f3vsp781xm336sp4cl9b5h3";
+    sha256 = "1ymjwxg01dq8qq89hx23yvk5h46hwfb8ihbqbvabmz1vh9afjdi8";
   };
 
   buildCommand = ''
diff --git a/nixpkgs/pkgs/development/libraries/java/smack/default.nix b/nixpkgs/pkgs/development/libraries/java/smack/default.nix
index e28925c65bb2..d5f8ac217f3d 100644
--- a/nixpkgs/pkgs/development/libraries/java/smack/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/java/swt/default.nix b/nixpkgs/pkgs/development/libraries/java/swt/default.nix
index a93d77742915..b0fdca112186 100644
--- a/nixpkgs/pkgs/development/libraries/java/swt/default.nix
+++ b/nixpkgs/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,10 +36,10 @@ 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" ];
+  NIX_LFLAGS = toString (map (x: "-L${lib.getLib x}/lib") [ xorg.libX11 pango gdk-pixbuf glib ]) +
+    " -lX11 -lpango-1.0 -lgdk_pixbuf-2.0 -lglib-2.0";
 
   buildPhase = ''
     unzip src.zip -d src
diff --git a/nixpkgs/pkgs/development/libraries/jbig2dec/default.nix b/nixpkgs/pkgs/development/libraries/jbig2dec/default.nix
index 04a165866faf..2dff3bafdd30 100644
--- a/nixpkgs/pkgs/development/libraries/jbig2dec/default.nix
+++ b/nixpkgs/pkgs/development/libraries/jbig2dec/default.nix
@@ -1,19 +1,21 @@
-{ stdenv, fetchurl, python }:
+{ stdenv, fetchurl, python3, autoconf }:
 
 stdenv.mkDerivation rec {
-  name = "jbig2dec-0.14";
+  name = "jbig2dec-0.17";
 
   src = fetchurl {
-    url = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs922/${name}.tar.gz";
-    sha256 = "0k01hp0q4275fj4rbr1gy64svfraw5w7wvwl08yjhvsnpb1rid11";
+    url = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs950/${name}.tar.gz";
+    sha256 = "0wpvslmwazia3z8gyk343kbq6yj47pxr4x5yjvx332v309qssazp";
   };
 
   postPatch = ''
     patchShebangs test_jbig2dec.py
   '';
 
-  checkInputs = [ python ];
-  doCheck = false; # fails 1 of 4 tests
+  buildInputs = [ autoconf ];
+
+  checkInputs = [ python3 ];
+  doCheck = true;
 
   meta = {
     homepage = https://www.jbig2dec.com/;
diff --git a/nixpkgs/pkgs/development/libraries/jitterentropy/default.nix b/nixpkgs/pkgs/development/libraries/jitterentropy/default.nix
index 726e00b58bba..6492077eee41 100644
--- a/nixpkgs/pkgs/development/libraries/jitterentropy/default.nix
+++ b/nixpkgs/pkgs/development/libraries/jitterentropy/default.nix
@@ -1,19 +1,26 @@
 { stdenv, fetchFromGitHub }:
 stdenv.mkDerivation rec {
   pname = "jitterentropy";
-  version = "2.1.2";
+  version = "2.2.0";
 
   src = fetchFromGitHub {
     owner = "smuellerDD";
     repo = "jitterentropy-library";
     rev = "v${version}";
-    sha256 = "10yl1hi0hysr53wzy2i8brs0qqnxh46mz3dcjh5mk0ad03wvbfsl";
+    sha256 = "0n2l1fxr7bynnarpwdjifb2fvlsq8w5wmfh31yk5nrc756cjlgyw";
   };
+  patches = [
+    # Can be removed when upgrading beyond 2.2.0
+    ./reproducible-manpages.patch
+  ];
 
   enableParallelBuilding = true;
 
   preInstall = ''
     mkdir -p $out/include
+    substituteInPlace Makefile \
+      --replace "install -m 0755 -s" \
+                'install -m 0755 -s --strip-program $(STRIP)'
   '';
 
   installFlags = [
diff --git a/nixpkgs/pkgs/development/libraries/jitterentropy/reproducible-manpages.patch b/nixpkgs/pkgs/development/libraries/jitterentropy/reproducible-manpages.patch
new file mode 100644
index 000000000000..68de5a8ae781
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/jitterentropy/reproducible-manpages.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile b/Makefile
+index 4ff069b..3b8714a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -58,7 +58,7 @@ cppcheck:
+ install:
+ 	install -d -m 0755 $(DESTDIR)$(PREFIX)/share/man/man3
+ 	install -m 644 doc/$(NAME).3 $(DESTDIR)$(PREFIX)/share/man/man3/
+-	gzip -9 $(DESTDIR)$(PREFIX)/share/man/man3/$(NAME).3
++	gzip -n -9 $(DESTDIR)$(PREFIX)/share/man/man3/$(NAME).3
+ 	install -d -m 0755 $(DESTDIR)$(PREFIX)/$(LIBDIR)
+ 	install -m 0755 -s lib$(NAME).so.$(LIBVERSION) $(DESTDIR)$(PREFIX)/$(LIBDIR)/
+ 	install -d -m 0755 $(DESTDIR)$(PREFIX)/$(INCDIR)
diff --git a/nixpkgs/pkgs/development/libraries/jsoncpp/default.nix b/nixpkgs/pkgs/development/libraries/jsoncpp/default.nix
index c62f1e2de3f3..72158e186ac2 100644
--- a/nixpkgs/pkgs/development/libraries/jsoncpp/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/jsonrpc-glib/default.nix b/nixpkgs/pkgs/development/libraries/jsonrpc-glib/default.nix
index 8012c6b3b149..b12495467212 100644
--- a/nixpkgs/pkgs/development/libraries/jsonrpc-glib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/jsonrpc-glib/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, meson, ninja, glib, json-glib, pkgconfig, gobject-introspection, vala, gtk-doc, docbook_xsl, docbook_xml_dtd_43, gnome3 }:
 stdenv.mkDerivation rec {
   pname = "jsonrpc-glib";
-  version = "3.32.0";
+  version = "3.34.0";
 
   outputs = [ "out" "dev" "devdoc" ];
 
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1sx6xvzzdm9k0vfmpgg07abz7a9kar20h1a9ml0wgjdxr0valq5w";
+    sha256 = "0j05x4xv2cp3cbmp30m68z8g4rdw7b030ip4wszyfj9ya15v5kni";
   };
 
   mesonFlags = [
diff --git a/nixpkgs/pkgs/development/libraries/kdb/default.nix b/nixpkgs/pkgs/development/libraries/kdb/default.nix
index 4a403a19964e..03eabc6447b4 100644
--- a/nixpkgs/pkgs/development/libraries/kdb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/kdb/default.nix
@@ -1,7 +1,7 @@
 {
   mkDerivation, lib, fetchurl,
   extra-cmake-modules,
-  qtbase, qttranslations, kcoreaddons, python2, sqlite, postgresql, mysql
+  qtbase, qttranslations, kcoreaddons, python2, sqlite, postgresql, libmysqlclient
 }:
 
 mkDerivation rec {
@@ -15,7 +15,7 @@ mkDerivation rec {
 
   nativeBuildInputs = [ extra-cmake-modules ];
 
-  buildInputs = [ qttranslations kcoreaddons python2 sqlite postgresql mysql.connector-c ];
+  buildInputs = [ qttranslations kcoreaddons python2 sqlite postgresql libmysqlclient ];
 
   propagatedBuildInputs = [ qtbase ];
 
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/breeze-icons.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/breeze-icons.nix
index c8382ed3408b..d9192b940364 100644
--- a/nixpkgs/pkgs/development/libraries/kde-frameworks/breeze-icons.nix
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/breeze-icons.nix
@@ -1,10 +1,14 @@
-{ mkDerivation, lib, extra-cmake-modules, gtk3, qtsvg }:
+{ mkDerivation, lib, extra-cmake-modules, gtk3, qtsvg, hicolor-icon-theme }:
 
 mkDerivation {
   name = "breeze-icons";
   meta = { maintainers = [ lib.maintainers.ttuegel ]; };
   nativeBuildInputs = [ extra-cmake-modules gtk3 ];
   buildInputs = [ qtsvg ];
+  propagatedBuildInputs = [
+    hicolor-icon-theme
+  ];
+  dontDropIconThemeCache = true;
   outputs = [ "out" ]; # only runtime outputs
   postInstall = ''
     gtk-update-icon-cache "''${out:?}/share/icons/breeze"
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/default.nix
index ef1171b17601..d18dea1c3817 100644
--- a/nixpkgs/pkgs/development/libraries/kde-frameworks/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/nix-lib-path.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/nix-lib-path.patch
index bd105d2b4a9c..f019e67d3f08 100644
--- a/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/nix-lib-path.patch
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/nix-lib-path.patch
@@ -1,8 +1,8 @@
 diff --git a/kde-modules/KDEInstallDirs.cmake b/kde-modules/KDEInstallDirs.cmake
-index 275fd65..a04596c 100644
+index 0acd33f..c04b0a5 100644
 --- a/kde-modules/KDEInstallDirs.cmake
 +++ b/kde-modules/KDEInstallDirs.cmake
-@@ -232,34 +232,6 @@
+@@ -236,35 +236,6 @@
  # GNUInstallDirs code deals with re-configuring, but that is dealt with
  # by the _define_* macros in this module).
  set(_LIBDIR_DEFAULT "lib")
@@ -17,6 +17,7 @@ index 275fd65..a04596c 100644
 -# See https://wiki.debian.org/Multiarch
 -if((CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU")
 -   AND NOT CMAKE_CROSSCOMPILING
+-   AND NOT EXISTS "/etc/arch-release"
 -   AND NOT DEFINED ENV{FLATPAK_ID})
 -  if (EXISTS "/etc/debian_version") # is this a debian system ?
 -    if(CMAKE_LIBRARY_ARCHITECTURE)
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh b/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh
index 4df086ddbf21..4135f6bfd7aa 100644
--- a/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh
@@ -42,24 +42,23 @@ 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
 }
 postHooks+=(ecmPostHook)
 
-xdgDataSubdirs=(
-    "doc" "config.kcfg" "kconf_update" "kservices5" "kservicetypes5" \
+xdgDataSubdirs=( \
+    "config.kcfg" "kconf_update" "kservices5" "kservicetypes5" \
     "kxmlgui5" "knotifications5" "icons" "locale" "sounds" "templates" \
     "wallpapers" "applications" "desktop-directories" "mime" "appdata" "dbus-1" \
 )
 
-
 ecmHostPathSeen=( )
 
 ecmUnseenHostPath() {
@@ -104,5 +103,10 @@ ecmHostPathHook() {
     then
         qtWrapperArgs+=(--prefix INFOPATH : "$infoDir")
     fi
+
+    if [ -d "$1/dbus-1" ]
+    then
+        propagatedUserEnvPkgs+=" $1"
+    fi
 }
-addEnvHooks "$hostOffset" ecmHostPathHook
+addEnvHooks "$targetOffset" ecmHostPathHook
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/fetch.sh b/nixpkgs/pkgs/development/libraries/kde-frameworks/fetch.sh
index 096376ca6712..c76ff9fb2c81 100644
--- a/nixpkgs/pkgs/development/libraries/kde-frameworks/fetch.sh
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/fetch.sh
@@ -1 +1 @@
-WGET_ARGS=( https://download.kde.org/stable/frameworks/5.61/ )
+WGET_ARGS=( https://download.kde.org/stable/frameworks/5.64/ )
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kcalendarcore.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kcalendarcore.nix
new file mode 100644
index 000000000000..e0b6c5313bb9
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/kde-frameworks/kconfigwidgets/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kconfigwidgets/default.nix
index e06d9547de07..3d7c7cdedefa 100644
--- a/nixpkgs/pkgs/development/libraries/kde-frameworks/kconfigwidgets/default.nix
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kconfigwidgets/default.nix
@@ -1,13 +1,13 @@
 {
   mkDerivation, lib, extra-cmake-modules,
-  kauth, kcodecs, kconfig, kdoctools, kguiaddons, ki18n, kwidgetsaddons, qtbase,
+  kauth, kcodecs, kconfig, kdoctools, kguiaddons, ki18n, kwidgetsaddons, qttools, qtbase,
 }:
 
 mkDerivation {
   name = "kconfigwidgets";
   meta = { maintainers = [ lib.maintainers.ttuegel ]; };
   nativeBuildInputs = [ extra-cmake-modules kdoctools ];
-  buildInputs = [ kguiaddons ki18n qtbase ];
+  buildInputs = [ kguiaddons ki18n qtbase qttools ];
   propagatedBuildInputs = [ kauth kcodecs kconfig kwidgetsaddons ];
   patches = [ ./0001-qdiriterator-follow-symlinks.patch ];
   outputs = [ "out" "dev" ];
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/ki18n.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/ki18n.nix
index 3b9ca74bbd07..69ad2fbc737e 100644
--- a/nixpkgs/pkgs/development/libraries/kde-frameworks/ki18n.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/kde-frameworks/kiconthemes/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kiconthemes/default.nix
index 4b8e0059377d..8faac005f2ac 100644
--- a/nixpkgs/pkgs/development/libraries/kde-frameworks/kiconthemes/default.nix
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kiconthemes/default.nix
@@ -2,7 +2,7 @@
   mkDerivation, lib, copyPathsToStore,
   extra-cmake-modules,
   breeze-icons, karchive, kcoreaddons, kconfigwidgets, ki18n, kitemviews,
-  qtbase, qtsvg,
+  qtbase, qtsvg, qttools,
 }:
 
 mkDerivation {
@@ -13,5 +13,5 @@ mkDerivation {
   buildInputs = [
     breeze-icons karchive kcoreaddons kconfigwidgets ki18n kitemviews
   ];
-  propagatedBuildInputs = [ qtbase qtsvg ];
+  propagatedBuildInputs = [ qtbase qtsvg qttools ];
 }
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kio/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kio/default.nix
index 281778d9d07f..fee21a6a9235 100644
--- a/nixpkgs/pkgs/development/libraries/kde-frameworks/kio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kio/default.nix
@@ -1,6 +1,6 @@
 {
   mkDerivation, lib, copyPathsToStore,
-  extra-cmake-modules, kdoctools,
+  extra-cmake-modules, kdoctools, qttools,
   karchive, kbookmarks, kcompletion, kconfig, kconfigwidgets, kcoreaddons,
   kdbusaddons, ki18n, kiconthemes, kitemviews, kjobwidgets, knotifications,
   kservice, ktextwidgets, kwallet, kwidgetsaddons, kwindowsystem, kxmlgui,
@@ -18,7 +18,8 @@ mkDerivation {
   ];
   propagatedBuildInputs = [
     kbookmarks kcompletion kconfig kcoreaddons kitemviews kjobwidgets kservice
-    kxmlgui qtbase solid
+    kxmlgui qtbase qttools solid
   ];
+  outputs = [ "out" "dev" ];
   patches = (copyPathsToStore (lib.readPathsFromFile ./. ./series));
 }
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/knewstuff.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/knewstuff.nix
index 70f3cbb3c37e..df384648e6a3 100644
--- a/nixpkgs/pkgs/development/libraries/kde-frameworks/knewstuff.nix
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/knewstuff.nix
@@ -1,9 +1,9 @@
 {
-  mkDerivation, lib,
+  mkDerivation, lib, fetchpatch,
   extra-cmake-modules,
   attica, karchive, kcompletion, kconfig, kcoreaddons, ki18n, kiconthemes,
   kio, kitemviews, kservice, ktextwidgets, kwidgetsaddons, kxmlgui, qtbase,
-  qtdeclarative,
+  qtdeclarative, kirigami2,
 }:
 
 mkDerivation {
@@ -12,7 +12,13 @@ mkDerivation {
   nativeBuildInputs = [ extra-cmake-modules ];
   buildInputs = [
     karchive kcompletion kconfig kcoreaddons ki18n kiconthemes kio kitemviews
-    ktextwidgets kwidgetsaddons qtbase qtdeclarative
+    ktextwidgets kwidgetsaddons qtbase qtdeclarative kirigami2
   ];
   propagatedBuildInputs = [ attica kservice kxmlgui ];
+
+  patches = [ (fetchpatch {
+    url = "https://github.com/KDE/knewstuff/commit/dbf788c10130eaa3f5ea37a7f22eb4569471aa04.patch";
+    sha256 = "1225rgqg1j120nvhgsahvsq2xlkg91lr37zp14x19krixxgx521j";
+    revert = true;
+  }) ];
 }
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kplotting.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kplotting.nix
index 380fd8fc5e34..1774b044b165 100644
--- a/nixpkgs/pkgs/development/libraries/kde-frameworks/kplotting.nix
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kplotting.nix
@@ -1,5 +1,5 @@
 { mkDerivation, lib
-, extra-cmake-modules, qtbase
+, extra-cmake-modules, qttools, qtbase
 }:
 
 mkDerivation {
@@ -9,6 +9,6 @@ mkDerivation {
     broken = builtins.compareVersions qtbase.version "5.7.0" < 0;
   };
   nativeBuildInputs = [ extra-cmake-modules ];
-  propagatedBuildInputs = [ qtbase ];
+  propagatedBuildInputs = [ qtbase qttools ];
   outputs = [ "out" "dev" ];
 }
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/ktextwidgets.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/ktextwidgets.nix
index 8b082f7f3655..604066b96394 100644
--- a/nixpkgs/pkgs/development/libraries/kde-frameworks/ktextwidgets.nix
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/ktextwidgets.nix
@@ -1,6 +1,6 @@
 {
   mkDerivation, lib,
-  extra-cmake-modules,
+  extra-cmake-modules, qttools,
   kcompletion, kconfig, kconfigwidgets, ki18n, kiconthemes, kservice,
   kwindowsystem, qtbase, sonnet,
 }:
@@ -12,5 +12,5 @@ mkDerivation {
   buildInputs = [
     kcompletion kconfig kconfigwidgets kiconthemes kservice kwindowsystem
   ];
-  propagatedBuildInputs = [ ki18n qtbase sonnet ];
+  propagatedBuildInputs = [ ki18n qtbase qttools sonnet ];
 }
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kwindowsystem/platform-plugins-path.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kwindowsystem/platform-plugins-path.patch
index ae0da37922e9..27501732210f 100644
--- a/nixpkgs/pkgs/development/libraries/kde-frameworks/kwindowsystem/platform-plugins-path.patch
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kwindowsystem/platform-plugins-path.patch
@@ -1,21 +1,24 @@
-Index: kwindowsystem-5.32.0/src/pluginwrapper.cpp
+Index: kwindowsystem-5.64.0/src/pluginwrapper.cpp
 ===================================================================
---- kwindowsystem-5.32.0.orig/src/pluginwrapper.cpp
-+++ kwindowsystem-5.32.0/src/pluginwrapper.cpp
-@@ -37,14 +37,9 @@ Q_GLOBAL_STATIC(KWindowSystemPluginWrapp
+--- 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()) {
--        QDir pluginDir(path + QLatin1Literal("/kf5/org.kde.kwindowsystem.platforms"));
+-    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"));
-+    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);
      }
      return ret;
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kxmlgui.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kxmlgui.nix
index b9aede81f9a9..5adcf281e622 100644
--- a/nixpkgs/pkgs/development/libraries/kde-frameworks/kxmlgui.nix
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kxmlgui.nix
@@ -1,6 +1,6 @@
 {
   mkDerivation, lib,
-  extra-cmake-modules,
+  extra-cmake-modules, qttools,
   attica, kconfig, kconfigwidgets, kglobalaccel, ki18n, kiconthemes, kitemviews,
   ktextwidgets, kwindowsystem, qtbase, sonnet,
 }:
@@ -13,5 +13,5 @@ mkDerivation {
     attica kglobalaccel ki18n kiconthemes kitemviews ktextwidgets kwindowsystem
     sonnet
   ];
-  propagatedBuildInputs = [ kconfig kconfigwidgets qtbase ];
+  propagatedBuildInputs = [ kconfig kconfigwidgets qtbase qttools ];
 }
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/srcs.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/srcs.nix
index 549f99a55886..32edca387102 100644
--- a/nixpkgs/pkgs/development/libraries/kde-frameworks/srcs.nix
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/srcs.nix
@@ -3,635 +3,651 @@
 
 {
   attica = {
-    version = "5.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/attica-5.61.0.tar.xz";
-      sha256 = "9d3ad34c17223333b5a77144cc5a9d941cbb7baa01ab4a2ffe34ae9398c90dde";
-      name = "attica-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/baloo-5.61.0.tar.xz";
-      sha256 = "dd559e06237843f51d68eb5001b835037d4b2f6d62b7dc4d040961f9863632f1";
-      name = "baloo-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/bluez-qt-5.61.0.tar.xz";
-      sha256 = "0ea647de61fcc18a85c660fa8e05fe93072a713a8d00a018ba8e99ea790e5d27";
-      name = "bluez-qt-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/breeze-icons-5.61.0.tar.xz";
-      sha256 = "1d260a01a2617f5f755d2eb38423af19bf4a1a2ccfa9339b441b4f6be6381c30";
-      name = "breeze-icons-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/extra-cmake-modules-5.61.0.tar.xz";
-      sha256 = "a86a3b12c8a540af822131a8d65586d985267b1d642c29b4815b6c7870bc126c";
-      name = "extra-cmake-modules-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/frameworkintegration-5.61.0.tar.xz";
-      sha256 = "a1a2bbb15d287b67643750cb5414ceb10c6583861dd5c00118010d409f106efb";
-      name = "frameworkintegration-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kactivities-5.61.0.tar.xz";
-      sha256 = "0d7d7e5bd68541ad1dcf1f96c7205330cb7b075c6ff0d8b46774e781eff84af5";
-      name = "kactivities-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kactivities-stats-5.61.0.tar.xz";
-      sha256 = "9062eb0f189f1b50674e65a7db9a4b821c628acd1ac650000cebbf1f7bdf0068";
-      name = "kactivities-stats-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kapidox-5.61.0.tar.xz";
-      sha256 = "3c948c87c7f7b16a3835f7df8387c110efe5fefecf8a7d6ffa1cae647be0669f";
-      name = "kapidox-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/karchive-5.61.0.tar.xz";
-      sha256 = "457ed420449630625cb161fcc9bedc7c6a16527f48d6db4008aea76cdb948387";
-      name = "karchive-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kauth-5.61.0.tar.xz";
-      sha256 = "b04458f32046b2dd61b48118646180df63d2c843cb2d53560aaa15168df087f1";
-      name = "kauth-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kbookmarks-5.61.0.tar.xz";
-      sha256 = "24f87ff1acc5f0c257518f67af277b454566e607f82eb09e75b4a6ed02403377";
-      name = "kbookmarks-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kcmutils-5.61.0.tar.xz";
-      sha256 = "b8b79ef2f4513fbe5e4c61cf4726ed33b95efffabdd512fcc2dcff23c23cdfa7";
-      name = "kcmutils-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kcodecs-5.61.0.tar.xz";
-      sha256 = "4604323e44c1be7547f25b43b71bd541048c3d036a7fc5ca74e5ece9792ff5ee";
-      name = "kcodecs-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kcompletion-5.61.0.tar.xz";
-      sha256 = "68697be65d6c9e0053fc3e504170d23c3162c05a0a9027249c575bc6dc8bd3ec";
-      name = "kcompletion-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kconfig-5.61.0.tar.xz";
-      sha256 = "94c0e292a5d57e014aa745be6b59a989118ead1252d56c768f2719b5c6471372";
-      name = "kconfig-5.61.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.61.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.61/kconfigwidgets-5.61.0.tar.xz";
-      sha256 = "4cc1e55c5f994abbec03b32bef73bdf54c2613199a446ad63f4ced6e3a0e2165";
-      name = "kconfigwidgets-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kcoreaddons-5.61.0.tar.xz";
-      sha256 = "6a4ea2eca77944c24fe63d2f7111913db721533d5971497cb5bdd2cac896e813";
-      name = "kcoreaddons-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kcrash-5.61.0.tar.xz";
-      sha256 = "83e6333ea0cd7d1ded3fa84f126e3c86a010d7bdb7fd183e7c5d42a8b8e74db8";
-      name = "kcrash-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kdbusaddons-5.61.0.tar.xz";
-      sha256 = "f24fadc71670591bb679cde68147e53819f6c3d56126ecbafe59688fc47b347d";
-      name = "kdbusaddons-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kdeclarative-5.61.0.tar.xz";
-      sha256 = "464a77f88cce72c1616654c371068c11d51e484e0de5c0c5e032126d71afedaa";
-      name = "kdeclarative-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kded-5.61.0.tar.xz";
-      sha256 = "ca970111cb2d0073305a226cc005e2085952c2a02703168a775f954d27d723bc";
-      name = "kded-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/portingAids/kdelibs4support-5.61.0.tar.xz";
-      sha256 = "ae6f7c10e1fe67ded687f38a8ab3c8d483ae06ae69344bd1e683af752cf40b5c";
-      name = "kdelibs4support-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kdesignerplugin-5.61.0.tar.xz";
-      sha256 = "6b204dffbb4897f51143650d75383b5a3ddf4254455e5827d316c7b4ee7b3f33";
-      name = "kdesignerplugin-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kdesu-5.61.0.tar.xz";
-      sha256 = "398e74bdfe695ec2d7b57ce78f9fce3e19bb447a8eb5924441718a8f7384f888";
-      name = "kdesu-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/portingAids/kdewebkit-5.61.0.tar.xz";
-      sha256 = "1ee2a00ee3d95df9270e8c3d434568cda8f42151e361bc07fe374bf0f7afe211";
-      name = "kdewebkit-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kdnssd-5.61.0.tar.xz";
-      sha256 = "02d70e5ee18697867c1a12373c1dbe31e1efba1fcb1e26bba3c75472cd3b271d";
-      name = "kdnssd-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kdoctools-5.61.0.tar.xz";
-      sha256 = "e48d8f8f075171c6b83189999a10552c772c6a7e9a115a2643414f9ecec77c6f";
-      name = "kdoctools-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kemoticons-5.61.0.tar.xz";
-      sha256 = "cfc17de43320fbb353be30ae8d5b448b88da6f83bd23e29d678cd95a4bd7a380";
-      name = "kemoticons-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kfilemetadata-5.61.0.tar.xz";
-      sha256 = "15f20af053c71c1e5ba6c6ade90b7cce27645b27ee30f1e6e73038e81a2c958e";
-      name = "kfilemetadata-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kglobalaccel-5.61.0.tar.xz";
-      sha256 = "ad6bd2648e39854369555dd8a0823b08d9631f3638472627eb80e01d9902150e";
-      name = "kglobalaccel-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kguiaddons-5.61.0.tar.xz";
-      sha256 = "40cefa421b5ad5cf211875a35408ba526a5fb34e5ba19ebbda718dbf6b742520";
-      name = "kguiaddons-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kholidays-5.61.0.tar.xz";
-      sha256 = "ce3d879824a3e429b468008c1ccec5de44c07299d412ea32f9a2a814c27c08c1";
-      name = "kholidays-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/portingAids/khtml-5.61.0.tar.xz";
-      sha256 = "5d8612b584eecf96959d56bb75b1470b3b34ff7176cef7a0a15bc2531b21720b";
-      name = "khtml-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/ki18n-5.61.0.tar.xz";
-      sha256 = "d8c0594268b386ee42823360aa937c664cf04eedac8232bc18a653a9c52491d9";
-      name = "ki18n-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kiconthemes-5.61.0.tar.xz";
-      sha256 = "341741abd0b8aeeec8a2a87fe781b4ec1ab593563b1c063cdfdccead3706cdd7";
-      name = "kiconthemes-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kidletime-5.61.0.tar.xz";
-      sha256 = "8fb302dcc5b891ac2f06b5278bd6e08043772f3325bc209175c945280621fca2";
-      name = "kidletime-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kimageformats-5.61.0.tar.xz";
-      sha256 = "5a81359a043e201b29e205dd93559de077e0317d26712cb1c07e624d76aeb207";
-      name = "kimageformats-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kinit-5.61.0.tar.xz";
-      sha256 = "1806bba9cc3f4d9c5ed23f49eca30707e8f74a99d35f5022130a46a395f2858f";
-      name = "kinit-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kio-5.61.0.tar.xz";
-      sha256 = "1fa35126f8167bdbe029e515d01c8d4b91a07556ce6d5c9418e0ea10d7c2e44e";
-      name = "kio-5.61.0.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kirigami2-5.61.0.tar.xz";
-      sha256 = "afdbe922f0627330319f22834d6631af13edb0081c687422d36acb8697a88c30";
-      name = "kirigami2-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kitemmodels-5.61.0.tar.xz";
-      sha256 = "47db271ba24904933629ed00f7a4f916a19969967dcfbfd59ae5e98f08f89d68";
-      name = "kitemmodels-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kitemviews-5.61.0.tar.xz";
-      sha256 = "0447b361444a853409f65e2fb5650cc95eb799ca54a5d7e15cd6d8ca527002da";
-      name = "kitemviews-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kjobwidgets-5.61.0.tar.xz";
-      sha256 = "5246c2a230e3b4e9d7ba87c5a6b13b5f96fef6af0d1262f27f91fa0c619cf378";
-      name = "kjobwidgets-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/portingAids/kjs-5.61.0.tar.xz";
-      sha256 = "968e1592c98ee260d80644bf4631bf09479512e48fa878887ee3b9d6d57d3d17";
-      name = "kjs-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/portingAids/kjsembed-5.61.0.tar.xz";
-      sha256 = "d8e0afad638574c31c89d716d78456ce51ffe6dd03eae6787bc9b4f8b52d5b44";
-      name = "kjsembed-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/portingAids/kmediaplayer-5.61.0.tar.xz";
-      sha256 = "ae15a4a39e6530b505d699fb1b1ab3fd5f0e64d87dd758db17702463e44ce181";
-      name = "kmediaplayer-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/knewstuff-5.61.0.tar.xz";
-      sha256 = "87f8ec030223f5f0e4e39de8407fc0d28542e48e057c1752adb2466c55fe365b";
-      name = "knewstuff-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/knotifications-5.61.0.tar.xz";
-      sha256 = "f72ce6394465316a5324e38afb07f4f71d5f8e281d09b5cf340246c9905568ac";
-      name = "knotifications-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/knotifyconfig-5.61.0.tar.xz";
-      sha256 = "bbd2260a98f70779415369ca1d99807bc3e57f618024b9663d2a462a74169bee";
-      name = "knotifyconfig-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kpackage-5.61.0.tar.xz";
-      sha256 = "8ff82d14fe0dd92ac774d5cd9cd6334b01574f0f5c584266f97359dde5db9a5f";
-      name = "kpackage-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kparts-5.61.0.tar.xz";
-      sha256 = "f223b38f34f009bb25511ce7d97c607102cbb0a1bd0253ec1b7d1fe1b7c81436";
-      name = "kparts-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kpeople-5.61.0.tar.xz";
-      sha256 = "549edacd7b63d704dd165bc803ae03f8d9e8c1ba31f8dbaea3f7e12c466b4298";
-      name = "kpeople-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kplotting-5.61.0.tar.xz";
-      sha256 = "95781b50bef0e081e48b472b4fcbbcd3301ec45245498261e4a3ec8e42b892ba";
-      name = "kplotting-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kpty-5.61.0.tar.xz";
-      sha256 = "b91a88c00d3387927d1f6886a04e6e5bcc615ee1d0e72f647d51320ebf73471c";
-      name = "kpty-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/portingAids/kross-5.61.0.tar.xz";
-      sha256 = "103837799febbd62365a6445db046a2ee4add13d7d250abf925872cac642986e";
-      name = "kross-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/krunner-5.61.0.tar.xz";
-      sha256 = "f32ea603a9bcb9c2e39231f99bfc6079d118eebbf2c72e0818e2a9cd060543be";
-      name = "krunner-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kservice-5.61.0.tar.xz";
-      sha256 = "4489ac4553522bb76604e284338ab37a7a2369eea45dadd96a955fedf8ca99f9";
-      name = "kservice-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/ktexteditor-5.61.0.tar.xz";
-      sha256 = "ae99eacb445f8bc27af379d1ec54e8df4d25f601fc12053bc2928a8c639ad0cb";
-      name = "ktexteditor-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/ktextwidgets-5.61.0.tar.xz";
-      sha256 = "a2fddad3dda750ea6bdb104c460e50586946ded3e1f46a8729dbd304016a0b5a";
-      name = "ktextwidgets-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kunitconversion-5.61.0.tar.xz";
-      sha256 = "e5ffa3ff954c46b2416823467fcecd37c6ddb8304529703bc9cc3a24b74b6c24";
-      name = "kunitconversion-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kwallet-5.61.0.tar.xz";
-      sha256 = "628ded35a8f44750a770bf10bba9a763994660923a689eee05f8dfb7e92baec8";
-      name = "kwallet-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kwayland-5.61.0.tar.xz";
-      sha256 = "42d3bc629710e09074006af288986b00683853660648c9364fb09d49db3f0e07";
-      name = "kwayland-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kwidgetsaddons-5.61.0.tar.xz";
-      sha256 = "5abc169f431fba18418f23ff1749414d8318baff868a7b821916cc44508c6891";
-      name = "kwidgetsaddons-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kwindowsystem-5.61.0.tar.xz";
-      sha256 = "17958b612e751e838aa7a0d4f8c7a8a8d83d3f4ace5498fe1f2b8650a2d8f984";
-      name = "kwindowsystem-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kxmlgui-5.61.0.tar.xz";
-      sha256 = "867ff1c3ad464bb6268d00ca290569ef1da7659d3fd2f6349015bc3e2562836b";
-      name = "kxmlgui-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/kxmlrpcclient-5.61.0.tar.xz";
-      sha256 = "382b4730e4b32c1d300f8fdb6269e40995ec282ebe1cbb044ab1a2b2b68c3a1a";
-      name = "kxmlrpcclient-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/modemmanager-qt-5.61.0.tar.xz";
-      sha256 = "c9883a3aac7415045a03f0bda435a2a5ff7523538868b72dffa8e4b40e88502a";
-      name = "modemmanager-qt-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/networkmanager-qt-5.61.0.tar.xz";
-      sha256 = "1ded63af93957a04292e965ecce06388f183d3adc555b4f3d33337ee15d858c3";
-      name = "networkmanager-qt-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/oxygen-icons5-5.61.0.tar.xz";
-      sha256 = "1ca8f6e42186d069cb4f0581914b147cabc3be3e720c382e77048be134bb1b26";
-      name = "oxygen-icons5-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/plasma-framework-5.61.0.tar.xz";
-      sha256 = "873d604aadbe21ba38cdb12b778d3baf121a54e6155596f0ebee1840138060fe";
-      name = "plasma-framework-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/prison-5.61.0.tar.xz";
-      sha256 = "9ebab1755e9d7cb01b2aa6e8b63640eb112d8557073423abdb94faecb42d87ab";
-      name = "prison-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/purpose-5.61.0.tar.xz";
-      sha256 = "810a660d0a4d6de41e1b4d00fcb039d3b099ceae65ec96261ca8dd1fba458d08";
-      name = "purpose-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/qqc2-desktop-style-5.61.0.tar.xz";
-      sha256 = "26042c4f939b94caa559cba3ef171ef7bb1490f57c9907f5e4b30a701659abb4";
-      name = "qqc2-desktop-style-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/solid-5.61.0.tar.xz";
-      sha256 = "c3a032086eacbb836fc102bd77236285ad5a808c0537ff55dbacda539ba3eacf";
-      name = "solid-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/sonnet-5.61.0.tar.xz";
-      sha256 = "4c8818897ea5dac25e0120acfd4e15c44adf2ee76749870b8f70178f1a3d8b29";
-      name = "sonnet-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/syndication-5.61.0.tar.xz";
-      sha256 = "2803b2960dd23492ad002e0f23563c9f06500ddc144dd0be2e3e0ef2f6c1f576";
-      name = "syndication-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/syntax-highlighting-5.61.0.tar.xz";
-      sha256 = "475392c03534d7b5301ff2e02461444e463ad4def985da81ad4b315660416721";
-      name = "syntax-highlighting-5.61.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.61.0";
+    version = "5.64.0";
     src = fetchurl {
-      url = "${mirror}/stable/frameworks/5.61/threadweaver-5.61.0.tar.xz";
-      sha256 = "e7a0cecfaa60c7a8e4bdd4dfe842fb54a344d331a6c62316c147d8dc2a5e5843";
-      name = "threadweaver-5.61.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/nixpkgs/pkgs/development/libraries/kf5gpgmepp/default.nix b/nixpkgs/pkgs/development/libraries/kf5gpgmepp/default.nix
new file mode 100644
index 000000000000..32aa17e687eb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kf5gpgmepp/default.nix
@@ -0,0 +1,24 @@
+{ mkDerivation, lib, fetchgit, cmake, extra-cmake-modules, qtbase, boost, gpgme }:
+
+mkDerivation {
+  pname = "kf5gpgmepp";
+  version = "16.08.3";
+
+  src = fetchgit {
+    url = "https://anongit.kde.org/gpgmepp.git";
+    rev = "9826f6674e496ce575f606d17c318566381b3b15";
+    sha256 = "02ck2l3s8s7xh44blqaqnc5k49ccicdnzvhiwa67a3zgicz5i0vh";
+  };
+
+  buildInputs = [ extra-cmake-modules qtbase boost ];
+  propagatedBuildInputs = [ gpgme ];
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    license = [ licenses.lgpl2 ];
+    maintainers = [ maintainers.ehmry ];
+    platforms = platforms.linux;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/khronos-ocl-icd-loader/default.nix b/nixpkgs/pkgs/development/libraries/khronos-ocl-icd-loader/default.nix
new file mode 100644
index 000000000000..a57b103b0d91
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/khronos-ocl-icd-loader/tracing.patch b/nixpkgs/pkgs/development/libraries/khronos-ocl-icd-loader/tracing.patch
new file mode 100644
index 000000000000..415a1b1dfe49
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/kmsxx/default.nix b/nixpkgs/pkgs/development/libraries/kmsxx/default.nix
index 71e88559dee6..70058db4c0a2 100644
--- a/nixpkgs/pkgs/development/libraries/kmsxx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/kmsxx/default.nix
@@ -1,25 +1,25 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig, libdrm, python }:
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, libdrm
+, withPython ? false, python }:
 
 stdenv.mkDerivation {
   pname = "kmsxx";
-  version = "2018-10-23";
+  version = "2019-10-28";
 
   src = fetchFromGitHub {
     owner = "tomba";
     repo = "kmsxx";
     fetchSubmodules = true;
-    rev = "c0093c91f0fa2fd6a5b9d1b206a6f44dcd55bfb5";
-    sha256 = "03rv92r938nxb4k4gwcvxy76jnhxdx6x60b58jws83285hd9rgkf";
+    rev = "d29da28c7f2a0212d834136fe64fb8ca96a0a235";
+    sha256 = "0r94qjyy3s36s32s1xkzij0g2pfwigmyrshw8ni2xli7mg87g1zm";
   };
 
   enableParallelBuilding = true;
 
+  cmakeFlags = stdenv.lib.optional (!withPython) "-DKMSXX_ENABLE_PYTHON=OFF";
+
   nativeBuildInputs = [ cmake pkgconfig ];
   buildInputs = [ libdrm python ];
 
-  pythonPath = [ ];
-  passthru.python = python;
-
   meta = with stdenv.lib; {
     description = "C++11 library, utilities and python bindings for Linux kernel mode setting";
     homepage = https://github.com/tomba/kmsxx;
diff --git a/nixpkgs/pkgs/development/libraries/ldns/default.nix b/nixpkgs/pkgs/development/libraries/ldns/default.nix
index 1aa208c2044f..74ac59fef283 100644
--- a/nixpkgs/pkgs/development/libraries/ldns/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/leatherman/default.nix b/nixpkgs/pkgs/development/libraries/leatherman/default.nix
index a84e6b5c08df..b7b9b019b639 100644
--- a/nixpkgs/pkgs/development/libraries/leatherman/default.nix
+++ b/nixpkgs/pkgs/development/libraries/leatherman/default.nix
@@ -2,16 +2,21 @@
 
 stdenv.mkDerivation rec {
   pname = "leatherman";
-  version = "1.7.1";
+  version = "1.9.1";
 
   src = fetchFromGitHub {
-    sha256 = "0m2dm1gzwj0kwyl031bif89h3n4znml3m5n97hywlbra58ni8km1";
+    sha256 = "1aij0prpf7rvxx25qjf1krf0szb922hq9m6q58p90f5bjgymfzwh";
     rev = version;
     repo = "leatherman";
     owner = "puppetlabs";
   };
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=ignored-qualifiers" "-Wno-error=class-memaccess" "-Wno-error=catch-value" ];
+  NIX_CFLAGS_COMPILE = builtins.toString [
+    "-Wno-error=ignored-qualifiers"
+    "-Wno-error=class-memaccess"
+    "-Wno-error=catch-value"
+    "-Wno-error=deprecated-copy"
+  ];
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ boost curl ruby ];
@@ -19,7 +24,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
-    homepage = https://github.com/puppetlabs/leatherman/;  
+    homepage = https://github.com/puppetlabs/leatherman/;
     description = "A collection of C++ and CMake utility libraries";
     license = licenses.asl20;
     maintainers = [ maintainers.womfoo ];
diff --git a/nixpkgs/pkgs/development/libraries/leptonica/default.nix b/nixpkgs/pkgs/development/libraries/leptonica/default.nix
index 62c01e4f3560..e26f4f6022aa 100644
--- a/nixpkgs/pkgs/development/libraries/leptonica/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libaal/default.nix b/nixpkgs/pkgs/development/libraries/libaal/default.nix
index 11b31d62b5d6..87eeac4b4f5f 100644
--- a/nixpkgs/pkgs/development/libraries/libaal/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libabigail/default.nix b/nixpkgs/pkgs/development/libraries/libabigail/default.nix
new file mode 100644
index 000000000000..dc19adfb6a66
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libabigail/default.nix
@@ -0,0 +1,59 @@
+{ stdenv
+, fetchurl
+, autoreconfHook
+, elfutils
+, libxml2
+, pkgconfig
+, strace
+, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libabigail";
+  version = "1.6";
+
+  outputs = [ "bin" "out" "dev" ];
+
+  src = fetchurl {
+    url = "https://mirrors.kernel.org/sourceware/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "04j07lhvwbp6qp8pdwbf7iqnr7kgpabmqylsw4invpmzwnyp6g6g";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkgconfig
+    strace
+  ];
+
+  buildInputs = [
+    elfutils
+    libxml2
+  ];
+
+  checkInputs = [
+    python3
+  ];
+
+  configureFlags = [
+    "--enable-bash-completion=yes"
+    "--enable-cxx11=yes"
+  ];
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  preCheck = ''
+    # runtestdiffpkg needs cache directory
+    export XDG_CACHE_HOME="$TEMPDIR"
+    patchShebangs tests/
+  '';
+
+  meta = with stdenv.lib; {
+    description = "ABI Generic Analysis and Instrumentation Library";
+    homepage = "https://sourceware.org/libabigail/";
+    license = licenses.lgpl3Plus;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libabw/default.nix b/nixpkgs/pkgs/development/libraries/libabw/default.nix
index f953c170ab50..a37d4756cbd8 100644
--- a/nixpkgs/pkgs/development/libraries/libabw/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libabw/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libabw";
-  version = "0.1.2";
+  version = "0.1.3";
 
   src = fetchurl {
     url = "https://dev-www.libreoffice.org/src/libabw/${pname}-${version}.tar.xz";
-    sha256 = "11949iscdb99f2jplxjd39282jxcrf2fw0sqbh5dl7gqb96r8whb";
+    sha256 = "1vbfrmnvib3cym0yyyabnd8xpx4f7wp20vnn09s6dln347fajqz7";
   };
 
   # Boost 1.59 compatability fix
diff --git a/nixpkgs/pkgs/development/libraries/libagar/default.nix b/nixpkgs/pkgs/development/libraries/libagar/default.nix
index 48fb0f1153e7..c0a43efc27ea 100644
--- a/nixpkgs/pkgs/development/libraries/libagar/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libagar/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, pkgconfig, libtool, perl, bsdbuild, gettext, mandoc
-, libpng, libjpeg, xlibsWrapper, libXinerama, freetype, SDL, libGLU_combined
-, libsndfile, portaudio, mysql, fontconfig
+, libpng, libjpeg, xlibsWrapper, libXinerama, freetype, SDL, libGLU, libGL
+, libsndfile, portaudio, libmysqlclient, fontconfig
 }:
 
 let srcs = import ./srcs.nix { inherit fetchurl; }; in
@@ -19,8 +19,8 @@ stdenv.mkDerivation {
     "--enable-nls=yes"
     "--with-gettext=${gettext}"
     "--with-jpeg=${libjpeg.dev}"
-    "--with-gl=${libGLU_combined}"
-    "--with-mysql=${mysql.connector-c}"
+    "--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 mysql.connector-c mandoc
+    bsdbuild perl xlibsWrapper libXinerama SDL libGL libmysqlclient mandoc
     freetype.dev libpng libjpeg.dev fontconfig portaudio libsndfile
   ];
 
diff --git a/nixpkgs/pkgs/development/libraries/libao/default.nix b/nixpkgs/pkgs/development/libraries/libao/default.nix
index f67b3cee607b..2d7edee4041c 100644
--- a/nixpkgs/pkgs/development/libraries/libao/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libappindicator/default.nix b/nixpkgs/pkgs/development/libraries/libappindicator/default.nix
index 46cc30a8944f..e9fccaf28abf 100644
--- a/nixpkgs/pkgs/development/libraries/libappindicator/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libav/default.nix b/nixpkgs/pkgs/development/libraries/libav/default.nix
index feeb4de15e1b..43cfe2ef251c 100644
--- a/nixpkgs/pkgs/development/libraries/libav/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libav/default.nix
@@ -103,7 +103,7 @@ let
     setOutputFlags = false;
 
     # alltools to build smaller tools, incl. aviocat, ismindex, qt-faststart, etc.
-    buildFlags = "all alltools install-man";
+    buildFlags = [ "all" "alltools" "install-man" ];
 
 
     postInstall = ''
diff --git a/nixpkgs/pkgs/development/libraries/libbfd/default.nix b/nixpkgs/pkgs/development/libraries/libbfd/default.nix
index 89ca984767b3..15561677ad5a 100644
--- a/nixpkgs/pkgs/development/libraries/libbfd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libbfd/default.nix
@@ -31,7 +31,7 @@ stdenv.mkDerivation {
   dontUpdateAutotoolsGnuConfigScripts = true;
 
   nativeBuildInputs = [ autoreconfHook bison ];
-  buildInputs = [ libiberty zlib ];
+  buildInputs = [ libiberty zlib.dev ];
 
   configurePlatforms = [ "build" "host" ];
   configureFlags = [
diff --git a/nixpkgs/pkgs/development/libraries/libbladeRF/default.nix b/nixpkgs/pkgs/development/libraries/libbladeRF/default.nix
index c8c58315b648..043f3500b0c3 100644
--- a/nixpkgs/pkgs/development/libraries/libbladeRF/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libbladeRF/default.nix
@@ -10,7 +10,7 @@ let
     sha256 = "0is79dhsyp9xmlnfdr1i5s1c22ipjafk9d35jpn5dynpvj86m99c";
   };
 
-  version = "2.2.0";
+  version = "2.2.1";
 
 in stdenv.mkDerivation {
   pname = "libbladeRF";
@@ -20,7 +20,7 @@ in stdenv.mkDerivation {
     owner = "Nuand";
     repo = "bladeRF";
     rev = "libbladeRF_v${version}";
-    sha256 = "0mdj5dkqg69gp0xw6gkhp86nxnm9g7az5rplnncxkp4p1kr35rnl";
+    sha256 = "0g89al4kwfbx1l3zjddgb9ay4mhr7zk0ndchca3sm1vq2j47nf4l";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/nixpkgs/pkgs/development/libraries/libblockdev/default.nix b/nixpkgs/pkgs/development/libraries/libblockdev/default.nix
index 6deb89a80ea2..4982157c3ba0 100644
--- a/nixpkgs/pkgs/development/libraries/libblockdev/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libblockdev/default.nix
@@ -6,13 +6,13 @@
 }:
 stdenv.mkDerivation rec {
   pname = "libblockdev";
-  version = "2.22";
+  version = "2.23";
 
   src = fetchFromGitHub {
     owner = "storaged-project";
     repo = "libblockdev";
     rev = "${version}-1";
-    sha256 = "03y4ps37wbi9p1136q0xzgshfnrjg4lgy8pgm1a3ihfcjnbwrbnq";
+    sha256 = "09gp9h05vy3llhnrg98gny8g57kgwnbi8522qyzjwyv7nmhs4zhz";
   };
 
   outputs = [ "out" "dev" "devdoc" ];
diff --git a/nixpkgs/pkgs/development/libraries/libbluray/default.nix b/nixpkgs/pkgs/development/libraries/libbluray/default.nix
index 517251e137ef..daa349ca6309 100644
--- a/nixpkgs/pkgs/development/libraries/libbluray/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libbluray/default.nix
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = optional withAACS libaacs;
 
-  NIX_LDFLAGS = [
+  NIX_LDFLAGS = toString [
     (optionalString withAACS   "-L${libaacs}/lib -laacs")
     (optionalString withBDplus "-L${libbdplus}/lib -lbdplus")
   ];
diff --git a/nixpkgs/pkgs/development/libraries/libbsd/darwin.patch b/nixpkgs/pkgs/development/libraries/libbsd/darwin.patch
index 0f9cc9aaf964..340eb47a6301 100644
--- a/nixpkgs/pkgs/development/libraries/libbsd/darwin.patch
+++ b/nixpkgs/pkgs/development/libraries/libbsd/darwin.patch
@@ -1,30 +1,26 @@
 diff --git a/configure.ac b/configure.ac
-index 55fcfe6..1e26c93 100644
+index 6e9496d..60b6e4c 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -51,15 +51,19 @@ AS_CASE([$host_os],
-     AC_SEARCH_LIBS([clock_gettime], [rt], [CLOCK_GETTIME_LIBS="-lrt"])
-     AC_SUBST([CLOCK_GETTIME_LIBS])
-     LIBS="$saved_LIBS"
-+    AM_CONDITIONAL([BUILD_LINK_VERSION_SCRIPT], [1])
-   ],
-   [*-musl*], [
-     # Upstream refuses to define this, we will do it ourselves then.
-     AC_DEFINE([__MUSL__], [1], [Define to 1 if we are building for musl])
-+    AM_CONDITIONAL([BUILD_LINK_VERSION_SCRIPT], [1])
-   ],
--)
-+  [
-+  AM_CONDITIONAL([BUILD_LINK_VERSION_SCRIPT], [1])
-+  ])
+@@ -44,6 +44,8 @@ AC_SUBST([TESTU01_LIBS])
+ AM_CONDITIONAL([HAVE_LIBTESTU01],
+                [test "x$ac_cv_lib_testu01_unif01_CreateExternGenBits" = "xyes"])
+ 
++AX_CHECK_VSCRIPT
++
+ is_windows=no
+ AS_CASE([$host_os],
+   [*-gnu*], [
+@@ -68,7 +70,7 @@ AS_CASE([$host_os],
+ AM_CONDITIONAL([OS_WINDOWS], [test "x$is_windows" = "xyes"])
  
  # Checks for header files.
--AC_CHECK_HEADERS([sys/ndir.h sys/dir.h ndir.h dirent.h])
-+AC_CHECK_HEADERS([sys/ndir.h sys/dir.h ndir.h dirent.h nlist.h])
+-AC_CHECK_HEADERS([sys/ndir.h sys/dir.h ndir.h dirent.h grp.h])
++AC_CHECK_HEADERS([sys/ndir.h sys/dir.h ndir.h dirent.h grp.h nlist.h])
  
  # Checks for typedefs, structures, and compiler characteristics.
  AC_C_INLINE
-@@ -143,7 +147,8 @@ AC_LINK_IFELSE(
+@@ -169,7 +171,8 @@ AC_LINK_IFELSE(
  
  AC_CHECK_FUNCS([clearenv dirfd fopencookie __fpurge \
                  getauxval getentropy getexecname getline \
@@ -60,19 +56,168 @@ index f987fee..a1e17ed 100644
  
  #if !defined(__GLIBC__) || \
      (defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 25) || !defined(_GNU_SOURCE)))
+diff --git a/m4/ax_check_vscript.m4 b/m4/ax_check_vscript.m4
+new file mode 100644
+index 0000000..9851f32
+--- /dev/null
++++ b/m4/ax_check_vscript.m4
+@@ -0,0 +1,142 @@
++# ===========================================================================
++#     https://www.gnu.org/software/autoconf-archive/ax_check_vscript.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++#   AX_CHECK_VSCRIPT
++#
++# DESCRIPTION
++#
++#   Check whether the linker supports version scripts.  Version scripts are
++#   used when building shared libraries to bind symbols to version nodes
++#   (helping to detect incompatibilities) or to limit the visibility of
++#   non-public symbols.
++#
++#   Output:
++#
++#   If version scripts are supported, VSCRIPT_LDFLAGS will contain the
++#   appropriate flag to pass to the linker.  On GNU systems this would
++#   typically be "-Wl,--version-script", and on Solaris it would typically
++#   be "-Wl,-M".
++#
++#   Two Automake conditionals are also set:
++#
++#    HAVE_VSCRIPT is true if the linker supports version scripts with
++#    entries that use simple wildcards, like "local: *".
++#
++#    HAVE_VSCRIPT_COMPLEX is true if the linker supports version scripts with
++#    pattern matching wildcards, like "global: Java_*".
++#
++#   On systems that do not support symbol versioning, such as Mac OS X, both
++#   conditionals will be false.  They will also be false if the user passes
++#   "--disable-symvers" on the configure command line.
++#
++#   Example:
++#
++#    configure.ac:
++#
++#     AX_CHECK_VSCRIPT
++#
++#    Makefile.am:
++#
++#     if HAVE_VSCRIPT
++#     libfoo_la_LDFLAGS += $(VSCRIPT_LDFLAGS),@srcdir@/libfoo.map
++#     endif
++#
++#     if HAVE_VSCRIPT_COMPLEX
++#     libbar_la_LDFLAGS += $(VSCRIPT_LDFLAGS),@srcdir@/libbar.map
++#     endif
++#
++# LICENSE
++#
++#   Copyright (c) 2014 Kevin Cernekee <cernekee@gmail.com>
++#
++#   Copying and distribution of this file, with or without modification, are
++#   permitted in any medium without royalty provided the copyright notice
++#   and this notice are preserved. This file is offered as-is, without any
++#   warranty.
++
++#serial 2
++
++# _AX_CHECK_VSCRIPT(flag, global-sym, action-if-link-succeeds, [junk-file=no])
++AC_DEFUN([_AX_CHECK_VSCRIPT], [
++  AC_LANG_PUSH([C])
++  ax_check_vscript_save_flags="$LDFLAGS"
++  echo "V1 { global: $2; local: *; };" > conftest.map
++  AS_IF([test x$4 = xyes], [
++    echo "{" >> conftest.map
++  ])
++  LDFLAGS="$LDFLAGS -Wl,$1,conftest.map"
++  AC_LINK_IFELSE([AC_LANG_PROGRAM([[int show, hide;]], [])], [$3])
++  LDFLAGS="$ax_check_vscript_save_flags"
++  rm -f conftest.map
++  AC_LANG_POP([C])
++]) dnl _AX_CHECK_VSCRIPT
++
++AC_DEFUN([AX_CHECK_VSCRIPT], [
++
++  AC_ARG_ENABLE([symvers],
++    AS_HELP_STRING([--disable-symvers],
++                   [disable library symbol versioning [default=auto]]),
++    [want_symvers=$enableval],
++    [want_symvers=yes]
++  )
++
++  AS_IF([test x$want_symvers = xyes], [
++
++    dnl First test --version-script and -M with a simple wildcard.
++
++    AC_CACHE_CHECK([linker version script flag], ax_cv_check_vscript_flag, [
++      ax_cv_check_vscript_flag=unsupported
++      _AX_CHECK_VSCRIPT([--version-script], [show], [
++        ax_cv_check_vscript_flag=--version-script
++      ])
++      AS_IF([test x$ax_cv_check_vscript_flag = xunsupported], [
++        _AX_CHECK_VSCRIPT([-M], [show], [ax_cv_check_vscript_flag=-M])
++      ])
++
++      dnl The linker may interpret -M (no argument) as "produce a load map."
++      dnl If "-M conftest.map" doesn't fail when conftest.map contains
++      dnl obvious syntax errors, assume this is the case.
++
++      AS_IF([test x$ax_cv_check_vscript_flag != xunsupported], [
++        _AX_CHECK_VSCRIPT([$ax_cv_check_vscript_flag], [show],
++	                  [ax_cv_check_vscript_flag=unsupported], [yes])
++      ])
++    ])
++
++    dnl If the simple wildcard worked, retest with a complex wildcard.
++
++    AS_IF([test x$ax_cv_check_vscript_flag != xunsupported], [
++      ax_check_vscript_flag=$ax_cv_check_vscript_flag
++      AC_CACHE_CHECK([if version scripts can use complex wildcards],
++                     ax_cv_check_vscript_complex_wildcards, [
++        ax_cv_check_vscript_complex_wildcards=no
++        _AX_CHECK_VSCRIPT([$ax_cv_check_vscript_flag], [sh*], [
++        ax_cv_check_vscript_complex_wildcards=yes])
++      ])
++      ax_check_vscript_complex_wildcards="$ax_cv_check_vscript_complex_wildcards"
++    ], [
++      ax_check_vscript_flag=
++      ax_check_vscript_complex_wildcards=no
++    ])
++  ], [
++    AC_MSG_CHECKING([linker version script flag])
++    AC_MSG_RESULT([disabled])
++
++    ax_check_vscript_flag=
++    ax_check_vscript_complex_wildcards=no
++  ])
++
++  AS_IF([test x$ax_check_vscript_flag != x], [
++    VSCRIPT_LDFLAGS="-Wl,$ax_check_vscript_flag"
++    AC_SUBST([VSCRIPT_LDFLAGS])
++  ])
++
++  AM_CONDITIONAL([HAVE_VSCRIPT],
++    [test x$ax_check_vscript_flag != x])
++  AM_CONDITIONAL([HAVE_VSCRIPT_COMPLEX],
++    [test x$ax_check_vscript_complex_wildcards = xyes])
++
++]) dnl AX_CHECK_VSCRIPT
 diff --git a/src/Makefile.am b/src/Makefile.am
-index f3cc0fa..3aaecd4 100644
+index 8384b92..e2c8e15 100644
 --- a/src/Makefile.am
 +++ b/src/Makefile.am
-@@ -56,8 +56,10 @@ libbsd_la_DEPENDENCIES = \
- libbsd_la_LIBADD = \
- 	$(CLOCK_GETTIME_LIBS)
+@@ -65,8 +65,11 @@ libbsd_la_LIBADD = \
+ 	$(ARC4RANDOM_ATFORK_LIBS) \
+ 	$(nil)
  libbsd_la_LDFLAGS = \
 -	-Wl,--version-script=$(srcdir)/libbsd.map \
  	-version-number $(LIBBSD_ABI)
-+if BUILD_LINK_VERSION_SCRIPT
-+libbsd_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libbsd.map
++if HAVE_VSCRIPT
++libbsd_la_LDFLAGS += $(VSCRIPT_LDFLAGS),@srcdir@/libbsd.map
 +endif
++
  libbsd_la_SOURCES = \
  	arc4random.c \
  	arc4random.h \
@@ -175,23 +320,28 @@ index b3c8d5e..602f54e 100644
  
  #include <string.h>
 diff --git a/src/local-link.h b/src/local-link.h
-index d518dcf..84694a2 100644
+index 0d4351a..fc520af 100644
 --- a/src/local-link.h
 +++ b/src/local-link.h
-@@ -27,7 +27,11 @@
+@@ -27,6 +27,11 @@
  #ifndef LIBBSD_LOCAL_LINK_H
  #define LIBBSD_LOCAL_LINK_H
  
 +#ifdef __MACH__
 +#define libbsd_link_warning(symbol, msg)
++#define libbsd_symver_default(alias, symbol, version)
++#define libbsd_symver_variant(alias, symbol, version)
 +#else
  #define libbsd_link_warning(symbol, msg) \
  	static const char libbsd_emit_link_warning_##symbol[] \
- 		__attribute__((used,section(".gnu.warning." #symbol))) = msg;
+ 		__attribute__((__used__,__section__(".gnu.warning." #symbol))) = msg;
+@@ -45,3 +50,4 @@
+ #endif
+ 
  #endif
 +#endif
 diff --git a/src/nlist.c b/src/nlist.c
-index 0932f59..4502048 100644
+index 228c220..46c2d77 100644
 --- a/src/nlist.c
 +++ b/src/nlist.c
 @@ -41,6 +41,7 @@
@@ -202,7 +352,7 @@ index 0932f59..4502048 100644
  #include "local-elf.h"
  
  #define SIZE_T_MAX 0xffffffffU
-@@ -265,3 +266,4 @@ nlist(const char *name, struct nlist *list)
+@@ -280,3 +281,4 @@ nlist(const char *name, struct nlist *list)
  	(void)close(fd);
  	return (n);
  }
@@ -227,12 +377,12 @@ index f9f6195..2bc5fb4 100644
  
  static void handler(int);
 diff --git a/src/setproctitle.c b/src/setproctitle.c
-index 038ac7d..e9ee09c 100644
+index ff32aa3..51ed833 100644
 --- a/src/setproctitle.c
 +++ b/src/setproctitle.c
-@@ -32,6 +32,10 @@
- #include <unistd.h>
+@@ -33,6 +33,10 @@
  #include <string.h>
+ #include "local-link.h"
  
 +#ifdef __MACH__
 +extern char **environ;
@@ -241,30 +391,16 @@ index 038ac7d..e9ee09c 100644
  static struct {
  	/* Original value. */
  	const char *arg0;
-@@ -280,16 +284,22 @@ setproctitle_impl(const char *fmt, ...)
- 		*++nul = '\0';
- 	}
- }
-+#ifndef __MACH__
- __asm__(".symver setproctitle_impl,setproctitle@@LIBBSD_0.5");
-+#endif
- 
- /* The original function introduced in 0.2 was a stub, it only got implemented
+@@ -287,7 +291,8 @@ libbsd_symver_default(setproctitle, setproctitle_impl, LIBBSD_0.5);
   * in 0.5, make the implementation available in the old version as an alias
   * for code linking against that version, and change the default to use the
   * new version, so that new code depends on the implemented version. */
 -#ifdef HAVE_TYPEOF
 +#ifdef __MACH__
-+void setproctitle_stub(const char *fmt, ...);
-+#elif HAVE_TYPEOF
- extern typeof(setproctitle_impl) setproctitle_stub __attribute__((alias("setproctitle_impl")));
- #else
- void setproctitle_stub(const char *fmt, ...)
- 	__attribute__((alias("setproctitle_impl")));
- #endif
-+#ifndef __MACH__
- __asm__(".symver setproctitle_stub,setproctitle@LIBBSD_0.2");
-+#endif
++#elif defined(HAVE_TYPEOF)
+ extern __typeof__(setproctitle_impl)
+ setproctitle_stub
+ 	__attribute__((__alias__("setproctitle_impl")));
 diff --git a/src/strlcat.c b/src/strlcat.c
 index 14c53a1..5961c17 100644
 --- a/src/strlcat.c
@@ -316,46 +452,3 @@ index e6afde5..da680c9 100644
  	*p = '\0';
  }
 +#endif
-diff --git a/src/unvis.c b/src/unvis.c
-index 94e3e7a..fba4c66 100644
---- a/src/unvis.c
-+++ b/src/unvis.c
-@@ -565,11 +565,15 @@ strnunvis_openbsd(char *dst, const char *src, size_t dlen)
- {
- 	return strnunvisx(dst, dlen, src, 0);
- }
-+#ifndef __MACH__
- __asm__(".symver strnunvis_openbsd,strnunvis@@LIBBSD_0.2");
-+#endif
- 
- int
- strnunvis_netbsd(char *dst, size_t dlen, const char *src)
- {
- 	return strnunvisx(dst, dlen, src, 0);
- }
-+#ifndef __MACH__
- __asm__(".symver strnunvis_netbsd,strnunvis@LIBBSD_0.9.1");
-+#endif
-diff --git a/src/vis.c b/src/vis.c
-index c2cd2d8..2d84330 100644
---- a/src/vis.c
-+++ b/src/vis.c
-@@ -723,14 +723,18 @@ strnvis_openbsd(char *mbdst, const char *mbsrc, size_t dlen, int flags)
- {
- 	return istrsenvisxl(&mbdst, &dlen, mbsrc, flags, "", NULL);
- }
-+#ifndef __MACH__
- __asm__(".symver strnvis_openbsd,strnvis@@LIBBSD_0.2");
-+#endif
- 
- int
- strnvis_netbsd(char *mbdst, size_t dlen, const char *mbsrc, int flags)
- {
- 	return istrsenvisxl(&mbdst, &dlen, mbsrc, flags, "", NULL);
- }
-+#ifndef __MACH__
- __asm__(".symver strnvis_netbsd,strnvis@LIBBSD_0.9.1");
-+#endif
- 
- int
- stravis(char **mbdstp, const char *mbsrc, int flags)
diff --git a/nixpkgs/pkgs/development/libraries/libbsd/default.nix b/nixpkgs/pkgs/development/libraries/libbsd/default.nix
index fe4af163a542..e251295a4c79 100644
--- a/nixpkgs/pkgs/development/libraries/libbsd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libbsd/default.nix
@@ -2,20 +2,18 @@
 
 stdenv.mkDerivation rec {
   pname = "libbsd";
-  version = "0.9.1";
+  version = "0.10.0";
 
   src = fetchurl {
     url = "https://libbsd.freedesktop.org/releases/${pname}-${version}.tar.xz";
-    sha256 = "1957w2wi7iqar978qlfsm220dwywnrh5m58nrnn9zmi74ds3bn2n";
+    sha256 = "11x8q45jvjvf2dvgclds64mscyg10lva33qinf2hwgc84v3svf1l";
   };
 
   # darwin changes configure.ac which means we need to regenerate
   # the configure scripts
   nativeBuildInputs = [ autoreconfHook ];
 
-  patches = stdenv.lib.optional stdenv.isDarwin ./darwin.patch
-    # Suitable for all but limited to musl to avoid rebuild
-    ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./musl.patch;
+  patches = [ ./darwin.patch ];
 
   meta = with stdenv.lib; {
     description = "Common functions found on BSD systems";
diff --git a/nixpkgs/pkgs/development/libraries/libbsd/musl.patch b/nixpkgs/pkgs/development/libraries/libbsd/musl.patch
deleted file mode 100644
index fc07cfb6e855..000000000000
--- a/nixpkgs/pkgs/development/libraries/libbsd/musl.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Source: maxice8
-Upstream: no
-Reason: fixes compilation
-
---- a/src/flopen.c
-+++ b/src/flopen.c
-@@ -34,6 +34,7 @@
- #include <errno.h>
- #include <stdarg.h>
- #include <unistd.h>
-+#include <fcntl.h>
- 
- #include <libutil.h>
- 
diff --git a/nixpkgs/pkgs/development/libraries/libburn/default.nix b/nixpkgs/pkgs/development/libraries/libburn/default.nix
index 01588187936c..b6cadf9df189 100644
--- a/nixpkgs/pkgs/development/libraries/libburn/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libburn/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libburn";
-  version = "1.5.0";
+  version = "1.5.2";
 
   src = fetchurl {
     url = "http://files.libburnia-project.org/releases/${pname}-${version}.tar.gz";
-    sha256 = "1gg2kgnqvaa2fwghai62prxz6slpak1f6bvgjh8m4dn16v114asq";
+    sha256 = "09sjrvq8xsj1gnl2wwyv4lbmicyzzl6x1ac2rrn53xnp34bxnckv";
   };
 
   meta = with stdenv.lib; {
diff --git a/nixpkgs/pkgs/development/libraries/libcaca/default.nix b/nixpkgs/pkgs/development/libraries/libcaca/default.nix
index 8949ea8e390e..7773fe46c0ce 100644
--- a/nixpkgs/pkgs/development/libraries/libcaca/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcaca/default.nix
@@ -19,12 +19,12 @@ stdenv.mkDerivation rec {
     (if x11Support then "--enable-x11" else "--disable-x11")
     ];
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optional (!x11Support) "-DX_DISPLAY_MISSING";
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!x11Support) "-DX_DISPLAY_MISSING";
 
   enableParallelBuilding = true;
 
   propagatedBuildInputs = [ ncurses zlib pkgconfig (imlib2.override { inherit x11Support; }) ]
-    ++ stdenv.lib.optionals x11Support [ libX11 libXext];
+    ++ stdenv.lib.optionals x11Support [ libX11 libXext ];
 
   postInstall = ''
     mkdir -p $dev/bin
diff --git a/nixpkgs/pkgs/development/libraries/libcbor/default.nix b/nixpkgs/pkgs/development/libraries/libcbor/default.nix
index 4d56c0f1403b..4949d657669b 100644
--- a/nixpkgs/pkgs/development/libraries/libcbor/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcbor/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # needs "-DWITH_TESTS=ON", but fails w/compilation error
 
-  NIX_CFLAGS_COMPILE = [ "-fno-lto" ];
+  NIX_CFLAGS_COMPILE = "-fno-lto";
 
   meta = with stdenv.lib; {
     description = "CBOR protocol implementation for C and others";
diff --git a/nixpkgs/pkgs/development/libraries/libcdaudio/default.nix b/nixpkgs/pkgs/development/libraries/libcdaudio/default.nix
index c48818972b58..df7e93de063c 100644
--- a/nixpkgs/pkgs/development/libraries/libcdaudio/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libcec/default.nix b/nixpkgs/pkgs/development/libraries/libcec/default.nix
index 2688881e66d3..070cb58149c4 100644
--- a/nixpkgs/pkgs/development/libraries/libcec/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libcef/default.nix b/nixpkgs/pkgs/development/libraries/libcef/default.nix
index e161948db404..03cc3b2beb45 100644
--- a/nixpkgs/pkgs/development/libraries/libcef/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcef/default.nix
@@ -1,7 +1,8 @@
 { stdenv, fetchurl, cmake, alsaLib, atk, cairo, cups, dbus, expat, fontconfig
 , GConf, gdk-pixbuf, glib, gtk2, libX11, libxcb, libXcomposite, libXcursor
 , libXdamage, libXext, libXfixes, libXi, libXrandr, libXrender, libXScrnSaver
-, libXtst, nspr, nss, pango, libpulseaudio, systemd }:
+, libXtst, nspr, nss, pango, libpulseaudio, systemd, at-spi2-atk, at-spi2-core
+}:
 
 let
   libPath =
@@ -9,20 +10,24 @@ let
       alsaLib atk cairo cups dbus expat fontconfig GConf gdk-pixbuf glib gtk2
       libX11 libxcb libXcomposite libXcursor libXdamage libXext libXfixes libXi
       libXrandr libXrender libXScrnSaver libXtst nspr nss pango libpulseaudio
-      systemd
+      systemd at-spi2-core at-spi2-atk
     ];
 in
 stdenv.mkDerivation rec {
   pname = "cef-binary";
-  version = "3.3497.1833.g13f506f";
+  version = "74.1.14-g50c3c5c";
+
   src = fetchurl {
-    url = "http://opensource.spotify.com/cefbuilds/cef_binary_${version}_linux64.tar.bz2";
-    sha256 = "02v22yx1ga2yxagjblzkfw0ax7zkrdpc959l1a15m8nah3y7xf9p";
+    name = "cef_binary_74.1.14+g50c3c5c+chromium-74.0.3729.131_linux64_minimal.tar.bz2";
+    url = "http://opensource.spotify.com/cefbuilds/cef_binary_74.1.19%2Bgb62bacf%2Bchromium-74.0.3729.157_linux64_minimal.tar.bz2";
+    sha256 = "0v3540kq4y68gq7mb4d8a9issm363lm5ngrd6d96pcc7vckkw4wn";
   };
+
   nativeBuildInputs = [ cmake ];
-  makeFlags = "libcef_dll_wrapper";
+  makeFlags = [ "libcef_dll_wrapper" ];
   dontStrip = true;
   dontPatchELF = true;
+
   installPhase = ''
     mkdir -p $out/lib/ $out/share/cef/
     cp libcef_dll_wrapper/libcef_dll_wrapper.a $out/lib/
diff --git a/nixpkgs/pkgs/development/libraries/libcerf/default.nix b/nixpkgs/pkgs/development/libraries/libcerf/default.nix
index fd5ee8dcaaf9..0ffb20859677 100644
--- a/nixpkgs/pkgs/development/libraries/libcerf/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libchamplain/default.nix b/nixpkgs/pkgs/development/libraries/libchamplain/default.nix
index 519c94dd9956..48446d87b8d8 100644
--- a/nixpkgs/pkgs/development/libraries/libchamplain/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libchamplain/default.nix
@@ -3,11 +3,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libchamplain";
-  version = "0.12.19";
+  version = "0.12.20";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "191aid1qsfkab5whbzj2r3g63dpdgrwp5141mfywvqyvdhr2x11n";
+    sha256 = "0rihpb0npqpihqcdz4w03rq6xl7jdckfqskvv9diq2hkrnzv8ch2";
   };
 
   outputs = [ "out" "dev" "devdoc" ];
diff --git a/nixpkgs/pkgs/development/libraries/libck/default.nix b/nixpkgs/pkgs/development/libraries/libck/default.nix
new file mode 100644
index 000000000000..934a250ac7cb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libck/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "ck";
+  version = "0.7.0";
+
+  src = fetchFromGitHub {
+    owner = "concurrencykit";
+    repo = pname;
+    rev = version;
+    sha256 = "1w7g0y1n7jslca693fb8sanlfi1biq956dw6avdx6pf3c2s7l9jd";
+  };
+
+  dontDisableStatic = true;
+
+  meta = with stdenv.lib; {
+    description = "High-performance concurrency research library";
+    longDescription = ''
+      Concurrency primitives, safe memory reclamation mechanisms and non-blocking data structures for the research, design and implementation of high performance concurrent systems.
+    '';
+    license = with licenses; [ asl20 bsd2 ];
+    homepage = "http://concurrencykit.org/";
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ chessai ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libclc/default.nix b/nixpkgs/pkgs/development/libraries/libclc/default.nix
index 78f5e9d233ca..119adcb4ef2b 100644
--- a/nixpkgs/pkgs/development/libraries/libclc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libclc/default.nix
@@ -32,5 +32,6 @@ stdenv.mkDerivation {
     description = "Implementation of the library requirements of the OpenCL C programming language";
     license = licenses.mit;
     platforms = platforms.all;
+    broken = true;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libco-canonical/default.nix b/nixpkgs/pkgs/development/libraries/libco-canonical/default.nix
new file mode 100644
index 000000000000..56974fcca7b6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libco-canonical/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchFromGitHub, pkgconfig }:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  pname = "libco-canonical";
+  version = "20";
+
+  src = fetchFromGitHub {
+    owner = "canonical";
+    repo = "libco";
+    rev = "v${version}";
+    sha256 = "0r5b1r0sxngx349s5a3zkkvfw5by9y492kr34b25gjspzvjchlxq";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  makeFlags = [ "PREFIX=${placeholder "out"}" ];
+
+  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";
+    license = licenses.isc;
+    maintainers = with maintainers; [ wucke13 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcouchbase/0001-Fix-timeouts-in-libcouchbase-testsuite.patch b/nixpkgs/pkgs/development/libraries/libcouchbase/0001-Fix-timeouts-in-libcouchbase-testsuite.patch
new file mode 100644
index 000000000000..1c57757f855c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcouchbase/0001-Fix-timeouts-in-libcouchbase-testsuite.patch
@@ -0,0 +1,36 @@
+From 58237e64fa77ec5cdec658b3295f71ec899175fa Mon Sep 17 00:00:00 2001
+From: Maximilian Bosch <maximilian@mbosch.me>
+Date: Sat, 5 Oct 2019 13:47:59 +0200
+Subject: [PATCH] Fix timeouts in libcouchbase testsuite
+
+Nix-specific patch. Basically
+https://github.com/couchbase/libcouchbase/commit/b272f6ab88be523bbcf9d5c4252d07fccb023fe5, but
+rebased onto 2.10.4.
+---
+ src/ssl/ssl_e.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/ssl/ssl_e.c b/src/ssl/ssl_e.c
+index f4506cf..734a3e6 100644
+--- a/src/ssl/ssl_e.c
++++ b/src/ssl/ssl_e.c
+@@ -210,10 +210,16 @@ flush_ssl_data(lcbio_ESSL *es)
+      * calls. While we could have done this inline with the send() call this
+      * would make future optimization more difficult. */
+     GT_WRITE_DONE:
++#if !LCB_CAN_OPTIMIZE_SSL_BIO
++    BIO_get_mem_ptr(es->wbio, &wmb);
++#endif
+     while (wmb->length > (size_t)tmp_len) {
+         char dummy[4096];
+         unsigned to_read = MINIMUM(wmb->length-tmp_len, sizeof dummy);
+         BIO_read(es->wbio, dummy, to_read);
++#if !LCB_CAN_OPTIMIZE_SSL_BIO
++        BIO_get_mem_ptr(es->wbio, &wmb);
++#endif
+     }
+     BIO_clear_retry_flags(es->wbio);
+     return 0;
+-- 
+2.23.0
+
diff --git a/nixpkgs/pkgs/development/libraries/libcouchbase/default.nix b/nixpkgs/pkgs/development/libraries/libcouchbase/default.nix
index 23b39bca1f3a..53ec231dec96 100644
--- a/nixpkgs/pkgs/development/libraries/libcouchbase/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcouchbase/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "1yfmcx65aqd5l87scha6kmm2s38n85ci3gg0h6qfs16s3jfi6bw7";
   };
 
-  cmakeFlags = "-DLCB_NO_MOCK=ON";
+  cmakeFlags = [ "-DLCB_NO_MOCK=ON" ];
 
   nativeBuildInputs = [ cmake pkgconfig ];
   buildInputs = [ libevent openssl ];
@@ -19,6 +19,8 @@ stdenv.mkDerivation rec {
   # Running tests in parallel does not work
   enableParallelChecking = false;
 
+  patches = [ ./0001-Fix-timeouts-in-libcouchbase-testsuite.patch ];
+
   doCheck = !stdenv.isDarwin;
 
   meta = with stdenv.lib; {
diff --git a/nixpkgs/pkgs/development/libraries/libctb/default.nix b/nixpkgs/pkgs/development/libraries/libctb/default.nix
new file mode 100644
index 000000000000..161c7c98c63f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libctb/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl }:
+stdenv.mkDerivation rec {
+  pname = "libctb";
+  version = "0.16";
+  src = fetchurl {
+    url = "https://iftools.com/download/files/legacy/${pname}-${version}.tar.gz";
+    sha256 = "027wh89d0qyly3d9m6rg4x7x1gqz3y3cnxlgk0k8xgygcrm05c0w";
+  };
+  patches = [
+    ./include-kbhit.patch
+  ];
+  sourceRoot = "${pname}-${version}/build";
+  makeFlags = [
+    "prefix=$(out)"
+  ];
+  meta = with stdenv.lib; {
+    description = "Communications toolbox";
+    homepage = "https://iftools.com";
+    license = licenses.lgpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.misuzu ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libctb/include-kbhit.patch b/nixpkgs/pkgs/development/libraries/libctb/include-kbhit.patch
new file mode 100644
index 000000000000..76b4e38fadb9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libctb/include-kbhit.patch
@@ -0,0 +1,13 @@
+diff --git a/GNUmakefile b/GNUmakefile
+index e39a687..026f9c4 100644
+--- a/GNUmakefile
++++ b/GNUmakefile
+@@ -140,7 +140,7 @@ all: ../lib/libctb$(LIBFLAG)$(GPIBFLAG)-0.16.a ../lib/libctb$(LIBFLAG)$(GPIBFLAG
+
+ install: install_ctb_lib install_ctb_dll
+ 	$(INSTALL) -d $(DESTDIR)$(prefix)/include/ctb-0.16
+-	for f in ctb.h fifo.h getopt.h $(GPIBINC) iobase.h linux/serport.h linux/timer.h portscan.h serport.h serportx.h timer.h; do \
++	for f in ctb.h fifo.h getopt.h $(GPIBINC) iobase.h kbhit.h linux/serport.h linux/timer.h portscan.h serport.h serportx.h timer.h; do \
+ 	if test ! -d $(DESTDIR)$(prefix)/include/ctb-0.16/`dirname $$f` ; then \
+ 	$(INSTALL) -d $(DESTDIR)$(prefix)/include/ctb-0.16/`dirname $$f`; \
+ 	fi; \
diff --git a/nixpkgs/pkgs/development/libraries/libcutl/default.nix b/nixpkgs/pkgs/development/libraries/libcutl/default.nix
index 81122a6eb520..b13805aa37aa 100644
--- a/nixpkgs/pkgs/development/libraries/libcutl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcutl/default.nix
@@ -1,23 +1,29 @@
 { stdenv, fetchurl, xercesc }:
-let
-    major = "1.9";
-    minor = "0";
-in
-with stdenv; with lib;
-mkDerivation rec {
-  name = "libcutl-${major}.${minor}";
 
-  meta = {
-    description = "A collection of generic and independent components such as meta-programming tests, smart pointers, containers, compiler building blocks" ;
+stdenv.mkDerivation rec {
+  pname = "libcutl";
+  version = "1.10.0";
+
+  meta = with stdenv.lib; {
+    description = "C++ utility library from Code Synthesis";
+    longDescription = ''
+        libcutl is a C++ utility library.
+        It contains a collection of generic and independent components such as 
+        meta-programming tests, smart pointers, containers, compiler building blocks, etc.
+    '';
+    homepage = "https://codesynthesis.com/projects/libcutl/";
+    changelog = "https://git.codesynthesis.com/cgit/libcutl/libcutl/plain/NEWS?h=${version}";
     platforms = platforms.all;
     maintainers = with maintainers; [ ];
     license = licenses.mit;
   };
 
+  majmin = builtins.head ( builtins.match "([[:digit:]]\.[[:digit:]]+)\.*" "${version}" );
   src = fetchurl {
-    url = "https://codesynthesis.com/download/libcutl/1.9/${name}.tar.bz2";
-    sha1 = "0e8d255145afbc339a3284ef85a43f4baf3fec43";
+    url = "https://codesynthesis.com/download/${pname}/${majmin}/${pname}-${version}.tar.bz2";
+    sha256 = "070j2x02m4gm1fn7gnymrkbdxflgzxwl7m96aryv8wp3f3366l8j";
   };
 
   buildInputs = [ xercesc ];
+  enableParallelBuilding = true;
 }
diff --git a/nixpkgs/pkgs/development/libraries/libdazzle/default.nix b/nixpkgs/pkgs/development/libraries/libdazzle/default.nix
index 5b6d92d629dc..173ad6d2e853 100644
--- a/nixpkgs/pkgs/development/libraries/libdazzle/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdazzle/default.nix
@@ -1,35 +1,28 @@
 { stdenv, fetchurl, ninja, meson, pkgconfig, vala, gobject-introspection, libxml2
-, gtk-doc, docbook_xsl, docbook_xml_dtd_43, glibcLocales, dbus, xvfb_run, glib, gtk3, gnome3 }:
+, gtk-doc, docbook_xsl, docbook_xml_dtd_43, dbus, xvfb_run, glib, gtk3, gnome3 }:
 
-let
-  version = "3.32.3";
+stdenv.mkDerivation rec {
   pname = "libdazzle";
-in
-stdenv.mkDerivation {
-  name = "${pname}-${version}";
+  version = "3.34.1";
 
   outputs = [ "out" "dev" "devdoc" ];
   outputBin = "dev";
 
   src = fetchurl {
     url = "mirror://gnome/sources/libdazzle/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1s37hv12ikfzhvh86qzgmfcjm3wvp12l2vsr0whl5xmm2harp3bc";
+    sha256 = "01cmcrd75b7ns7j2b4p6h7pv68vjhkcl9zbvzzx7pf4vknxir61x";
   };
 
-  nativeBuildInputs = [ ninja meson pkgconfig vala gobject-introspection libxml2 gtk-doc docbook_xsl docbook_xml_dtd_43 glibcLocales dbus xvfb_run ];
+  nativeBuildInputs = [ ninja meson pkgconfig vala gobject-introspection libxml2 gtk-doc docbook_xsl docbook_xml_dtd_43 dbus xvfb_run ];
   buildInputs = [ glib gtk3 ];
 
   mesonFlags = [
     "-Denable_gtk_doc=true"
   ];
 
-  LC_ALL = "en_US.UTF-8";
-
-  # https://gitlab.gnome.org/GNOME/libdazzle/issues/25
-  doCheck = false;
+  doCheck = true;
 
   checkPhase = ''
-    export NO_AT_BRIDGE=1
     xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
       --config-file=${dbus.daemon}/share/dbus-1/session.conf \
       meson test --print-errorlogs
diff --git a/nixpkgs/pkgs/development/libraries/libdbi-drivers/default.nix b/nixpkgs/pkgs/development/libraries/libdbi-drivers/default.nix
index 99cd636b03b8..52b8a32fab4a 100644
--- a/nixpkgs/pkgs/development/libraries/libdbi-drivers/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdbi-drivers/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, libdbi
-, mysql ? null
+, libmysqlclient ? null
 , sqlite ? null
 , postgresql ? null
 }:
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3";
   };
 
-  buildInputs = [ libdbi sqlite postgresql ] ++ optional (mysql != null) mysql.connector-c;
+  buildInputs = [ libdbi sqlite postgresql ] ++ optional (libmysqlclient != null) libmysqlclient;
 
   postPatch = ''
     sed -i '/SQLITE3_LIBS/ s/-lsqlite/-lsqlite3/' configure;
@@ -26,10 +26,10 @@ stdenv.mkDerivation rec {
     "--enable-libdbi"
     "--with-dbi-incdir=${libdbi}/include"
     "--with-dbi-libdir=${libdbi}/lib"
-  ] ++ optionals (mysql != null) [
+  ] ++ optionals (libmysqlclient != null) [
     "--with-mysql"
-    "--with-mysql-incdir=${mysql.connector-c}/include/mysql"
-    "--with-mysql-libdir=${mysql.connector-c}/lib/mysql"
+    "--with-mysql-incdir=${libmysqlclient}/include/mysql"
+    "--with-mysql-libdir=${libmysqlclient}/lib/mysql"
   ] ++ optionals (sqlite != null) [
     "--with-sqlite3"
     "--with-sqlite3-incdir=${sqlite.dev}/include/sqlite"
diff --git a/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/default.nix b/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/default.nix
index 72c3ca0e2b05..6b4be0db4144 100644
--- a/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
   buildInputs = [ qt4 ];
   nativeBuildInputs = [ cmake ];
 
-  cmakeFlags = "-DWITH_DOC=OFF";
+  cmakeFlags = [ "-DWITH_DOC=OFF" ];
 
   meta = with stdenv.lib; {
     description = "Provides a Qt implementation of the DBusMenu spec";
diff --git a/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix b/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix
index 2ae4eec99ecc..279dcb6bc834 100644
--- a/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix
+++ b/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ qtbase ];
   nativeBuildInputs = [ cmake ];
 
-  cmakeFlags = "-DWITH_DOC=OFF";
+  cmakeFlags = [ "-DWITH_DOC=OFF" ];
 
   meta = with stdenv.lib; {
     homepage = https://launchpad.net/libdbusmenu-qt;
diff --git a/nixpkgs/pkgs/development/libraries/libdbusmenu/default.nix b/nixpkgs/pkgs/development/libraries/libdbusmenu/default.nix
index a7bfe7f17a24..770e95472ea5 100644
--- a/nixpkgs/pkgs/development/libraries/libdbusmenu/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdbusmenu/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, lib, file
 , pkgconfig, intltool
 , glib, dbus-glib, json-glib
-, gobject-introspection, vala, gnome-doc-utils
+, gobject-introspection, vala
 , gtkVersion ? null, gtk2 ? null, gtk3 ? null }:
 
 with lib;
@@ -18,11 +18,10 @@ stdenv.mkDerivation rec {
     sha256 = "12l7z8dhl917iy9h02sxmpclnhkdjryn08r8i4sr8l3lrlm4mk5r";
   };
 
-  nativeBuildInputs = [ vala pkgconfig intltool ];
+  nativeBuildInputs = [ vala pkgconfig intltool gobject-introspection ];
 
   buildInputs = [
     glib dbus-glib json-glib
-    gobject-introspection gnome-doc-utils
   ] ++ optional (gtkVersion != null) (if gtkVersion == "2" then gtk2 else gtk3);
 
   postPatch = ''
diff --git a/nixpkgs/pkgs/development/libraries/libde265/default.nix b/nixpkgs/pkgs/development/libraries/libde265/default.nix
index 3c31ba805d89..918f76753891 100644
--- a/nixpkgs/pkgs/development/libraries/libde265/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libde265/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchFromGitHub, autoreconfHook, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  version = "1.0.3";
+  version = "1.0.4";
   pname = "libde265";
 
   src = fetchFromGitHub {
     owner = "strukturag";
     repo = "libde265";
     rev = "v${version}";
-    sha256 = "049g77f6c5sbk1h534zi9akj3y5h8zwnca5c9kqqjkn7f17irk10";
+    sha256 = "0svxrhh1pv7xpj75svz0iw1sq5i6z2grj7sc3q11hl63666hzh7d";
   };
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
diff --git a/nixpkgs/pkgs/development/libraries/libdigidocpp/default.nix b/nixpkgs/pkgs/development/libraries/libdigidocpp/default.nix
index 4aec6fdef917..c4a351739b61 100644
--- a/nixpkgs/pkgs/development/libraries/libdigidocpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdigidocpp/default.nix
@@ -2,12 +2,12 @@
 , xercesc, xml-security-c, pkgconfig, xsd, zlib, xalanc, xxd }:
 
 stdenv.mkDerivation rec {
-  version = "3.13.7";
+  version = "3.14.1";
   pname = "libdigidocpp";
 
   src = fetchurl {
      url = "https://github.com/open-eid/libdigidocpp/releases/download/v${version}/libdigidocpp-${version}.tar.gz";
-     sha256 = "1d8yx8avijp55p53fz4pd4ihjz6nyap0g8dq23bwg33411mdiqff";
+     sha256 = "0yrcfw5i1jddz7x3j9zzlcwjlzdbi10wns7kbblbp03nx7vk2vqy";
   };
 
   nativeBuildInputs = [ cmake pkgconfig xxd ];
diff --git a/nixpkgs/pkgs/development/libraries/libdrm/default.nix b/nixpkgs/pkgs/development/libraries/libdrm/default.nix
index d5cbbccba015..61ca98e2256c 100644
--- a/nixpkgs/pkgs/development/libraries/libdrm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdrm/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libdrm";
-  version = "2.4.99";
+  version = "2.4.100";
 
   src = fetchurl {
     url = "https://dri.freedesktop.org/${pname}/${pname}-${version}.tar.bz2";
-    sha256 = "0pnsw4bmajzdbz8pk4wswdmw93shhympf2q9alhbnpfjgsf57gsd";
+    sha256 = "0p8a1l3a3s40i81mawm8nhrbk7p97ss05qkawp1yx73c30lchz67";
   };
 
   outputs = [ "out" "dev" "bin" ];
diff --git a/nixpkgs/pkgs/development/libraries/libdvbpsi/default.nix b/nixpkgs/pkgs/development/libraries/libdvbpsi/default.nix
index aed6f05fec4f..3a83d01353fd 100644
--- a/nixpkgs/pkgs/development/libraries/libdvbpsi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdvbpsi/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libdvbpsi";
-  version = "1.3.2";
+  version = "1.3.3";
 
   src = fetchurl {
     url = "http://get.videolan.org/libdvbpsi/${version}/${pname}-${version}.tar.bz2";
-    sha256 = "1zn5hfv4qbahmydbwh59a3b480s3m5ss27r6ml35gqdip7r3jkmc";
+    sha256 = "04h1l3vrkrdsrvkgzcr51adk10g6hxcxvgjphyyxz718ry5rkd82";
   };
 
   meta = {
diff --git a/nixpkgs/pkgs/development/libraries/libdynd/default.nix b/nixpkgs/pkgs/development/libraries/libdynd/default.nix
index 249f3f4f21a4..c02a6f9a5025 100644
--- a/nixpkgs/pkgs/development/libraries/libdynd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdynd/default.nix
@@ -16,13 +16,14 @@ stdenv.mkDerivation {
     "-DDYND_BUILD_BENCHMARKS=OFF"
   ];
 
-  # added to fix build with gcc7
-  NIX_CFLAGS_COMPILE = [
+  # added to fix build with gcc7+
+  NIX_CFLAGS_COMPILE = builtins.toString [
     "-Wno-error=implicit-fallthrough"
     "-Wno-error=nonnull"
     "-Wno-error=tautological-compare"
     "-Wno-error=class-memaccess"
     "-Wno-error=parentheses"
+    "-Wno-error=deprecated-copy"
   ];
 
   buildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/development/libraries/libebml/default.nix b/nixpkgs/pkgs/development/libraries/libebml/default.nix
index 2d15e419a764..591ad72e4ecc 100644
--- a/nixpkgs/pkgs/development/libraries/libebml/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libechonest/default.nix b/nixpkgs/pkgs/development/libraries/libechonest/default.nix
index 855386114c1c..cde046bf1327 100644
--- a/nixpkgs/pkgs/development/libraries/libechonest/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libechonest/default.nix
@@ -1,20 +1,36 @@
-{ stdenv, fetchurl, cmake, qt4, qjson, doxygen, boost }:
+{ stdenv, fetchFromGitHub, fetchpatch, cmake, doxygen, qt4, qjson }:
 
 stdenv.mkDerivation rec {
   pname = "libechonest";
-  version = "2.3.0";
+  version = "2.3.1";
 
-  src = fetchurl {
-    url = "http://files.lfranchi.com/${pname}-${version}.tar.bz2";
-    sha1 = "cf1b279c96f15c87c36fdeb23b569a60cdfb01db";
+  src = fetchFromGitHub {
+    owner = "lfranchi";
+    repo = pname;
+    rev = version;
+    sha256 = "0xbavf9f355dl1d3qv59x4ryypqrdanh9xdvw2d0q66l008crdkq";
   };
 
-  buildInputs = [ cmake qt4 qjson doxygen boost ];
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/lfranchi/libechonest/commit/009514f65044823ef29045397d4b58dd04d09977.patch";
+      sha256 = "0dmmpi7hixdngwiv045ilqrzyzkf56xpfyihcsx5i3xya2m0mynx";
+    })
+    (fetchpatch {
+      url = "https://github.com/lfranchi/libechonest/commit/3ce779536d56a163656e8098913f923e6cda2b5c.patch";
+      sha256 = "1vasd3sgqah562vxk71jibyws5cbihjjfnffd50qvdm2xqgvbx94";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake doxygen ];
+  buildInputs = [ qt4 qjson ];
+
   enableParallelBuilding = true;
+  doCheck = false; # requires network access
 
   meta = {
     description = "A C++/Qt wrapper around the Echo Nest API";
-    homepage = http://projects.kde.org/projects/playground/libs/libechonest;
+    homepage = "https://projects.kde.org/projects/playground/libs/libechonest";
     license = stdenv.lib.licenses.gpl2Plus;
     platforms = stdenv.lib.platforms.unix;
   };
diff --git a/nixpkgs/pkgs/development/libraries/libedit/default.nix b/nixpkgs/pkgs/development/libraries/libedit/default.nix
index e46a7ec33c4d..97532d616189 100644
--- a/nixpkgs/pkgs/development/libraries/libedit/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libedit/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libedit";
-  version = "20190324-3.1";
+  version = "20191025-3.1";
 
   src = fetchurl {
     url = "https://thrysoee.dk/editline/${pname}-${version}.tar.gz";
-    sha256 = "1bhvp8xkkgrg89k4ci1k8vjl3nhb6szd4ghy9lp4jrfgq58hz3xc";
+    sha256 = "0fdznw6fklis39xqk30ihw8dl8kdw9fzq1z42jmbyy6lc1k07zvd";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/nixpkgs/pkgs/development/libraries/libev/default.nix b/nixpkgs/pkgs/development/libraries/libev/default.nix
index 56710945ecb1..42d3b9435697 100644
--- a/nixpkgs/pkgs/development/libraries/libev/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libev/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libev";
-  version="4.27";
+  version="4.31";
 
   src = fetchurl {
     url = "http://dist.schmorp.de/libev/Attic/${pname}-${version}.tar.gz";
-    sha256 = "0kil23cgsp0r5shvnwwbsy7fzxb62sxqzqbkbkfp5w54ipy2cm9d";
+    sha256 = "0nkfqv69wfyy2bpga4d53iqydycpik8jp8x6q70353hia8mmv1gd";
   };
 
   meta = {
diff --git a/nixpkgs/pkgs/development/libraries/libevdev/default.nix b/nixpkgs/pkgs/development/libraries/libevdev/default.nix
index b0383b7f7428..7a61437b5eee 100644
--- a/nixpkgs/pkgs/development/libraries/libevdev/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libevdev/default.nix
@@ -1,14 +1,15 @@
-{ stdenv, fetchurl, python }:
+{ stdenv, fetchurl, python3 }:
 
 stdenv.mkDerivation rec {
-  name = "libevdev-1.7.0";
+  pname = "libevdev";
+  version = "1.8.0";
 
   src = fetchurl {
-    url = "https://www.freedesktop.org/software/libevdev/${name}.tar.xz";
-    sha256 = "0sg3lbjn68qaq3yz2k735h29kaf3fmx7b5m1x7rm2fnhn7rf3nqi";
+    url = "https://www.freedesktop.org/software/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "04a2klvii0in9ln8r85mk2cm73jq8ry2m3yzmf2z8xyjxzjcmlr0";
   };
 
-  buildInputs = [ python ];
+  buildInputs = [ python3 ];
 
   meta = with stdenv.lib; {
     description = "Wrapper library for evdev devices";
diff --git a/nixpkgs/pkgs/development/libraries/libevdevplus/default.nix b/nixpkgs/pkgs/development/libraries/libevdevplus/default.nix
new file mode 100644
index 000000000000..f538aab64adf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libevdevplus/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchFromGitHub, cmake, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  pname = "libevdevplus";
+  version = "2019-10-01";
+
+  src  = fetchFromGitHub {
+    owner  = "YukiWorkshop";
+    repo   = "libevdevPlus";
+    rev    = "e863df2ade43e2c7d7748cc33ca27fb3eed325ca";
+    sha256 = "18z6pn4j7fhmwwh0q22ip5nn7sc1hfgwvkdzqhkja60i8cw2cvvj";
+  };
+
+  nativeBuildInputs = [ cmake pkgconfig ];
+
+  meta = with stdenv.lib; {
+    inherit (src.meta) homepage;
+    description = "Easy-to-use event device library in C++";
+    license = licenses.mit;
+    maintainers = with maintainers; [ willibutz ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libexecinfo/default.nix b/nixpkgs/pkgs/development/libraries/libexecinfo/default.nix
index 2eee9bafe44b..4519cc7dd744 100644
--- a/nixpkgs/pkgs/development/libraries/libexecinfo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libexecinfo/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "CC:=$(CC)" "AR:=$(AR)" ];
 
-  patchFlags = "-p0";
+  patchFlags = [ "-p0" ];
 
   installPhase = ''
     install -Dm644 execinfo.h stacktraverse.h -t $out/include
diff --git a/nixpkgs/pkgs/development/libraries/libexif/default.nix b/nixpkgs/pkgs/development/libraries/libexif/default.nix
index 5a8f5126680e..833ccf5dca5d 100644
--- a/nixpkgs/pkgs/development/libraries/libexif/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libextractor/default.nix b/nixpkgs/pkgs/development/libraries/libextractor/default.nix
index 8fd01dbd506a..ea155440c8d1 100644
--- a/nixpkgs/pkgs/development/libraries/libextractor/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libf2c/default.nix b/nixpkgs/pkgs/development/libraries/libf2c/default.nix
index 2de407e8f639..10a0d179d3e9 100644
--- a/nixpkgs/pkgs/development/libraries/libf2c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libf2c/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     unzip ${src}
   '';
 
-  makeFlags = "-f makefile.u";
+  makeFlags = [ "-f" "makefile.u" ];
 
   installPhase = ''
     mkdir -p $out/include $out/lib
diff --git a/nixpkgs/pkgs/development/libraries/libfakekey/default.nix b/nixpkgs/pkgs/development/libraries/libfakekey/default.nix
index 196f0e50bef8..3c2431915433 100644
--- a/nixpkgs/pkgs/development/libraries/libfakekey/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfakekey/default.nix
@@ -11,9 +11,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ libX11 libXi libXtst xorgproto ];
-  NIX_LDFLAGS = [
-    "-lX11"
-  ];
+  NIX_LDFLAGS = "-lX11";
 
   meta = with stdenv.lib; {
     description = "X virtual keyboard library";
diff --git a/nixpkgs/pkgs/development/libraries/libfaketime/default.nix b/nixpkgs/pkgs/development/libraries/libfaketime/default.nix
index 10e9efed26ab..10cc5cace7b5 100644
--- a/nixpkgs/pkgs/development/libraries/libfaketime/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfaketime/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libfaketime";
-  version = "0.9.7";
+  version = "0.9.8";
 
   src = fetchurl {
     url = "https://github.com/wolfcw/libfaketime/archive/v${version}.tar.gz";
-    sha256 = "07l189881q0hybzmlpjyp7r5fwz23iafkm957bwy4gnmn9lg6rad";
+    sha256 = "18s2hjm4sbrlg6sby944z87yslnq9s85p7j892hyr42qrlvq4a06";
   };
 
   patches = [
diff --git a/nixpkgs/pkgs/development/libraries/libffi/3.2.1-cygwin.patch b/nixpkgs/pkgs/development/libraries/libffi/3.2.1-cygwin.patch
deleted file mode 100644
index f3b38dbd1c16..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/libffi/default.nix b/nixpkgs/pkgs/development/libraries/libffi/default.nix
index 2918276ef211..cc080e7c6388 100644
--- a/nixpkgs/pkgs/development/libraries/libffi/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libfido2/default.nix b/nixpkgs/pkgs/development/libraries/libfido2/default.nix
index 5fefdad08e76..a0f44a332205 100644
--- a/nixpkgs/pkgs/development/libraries/libfido2/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libfilezilla/default.nix b/nixpkgs/pkgs/development/libraries/libfilezilla/default.nix
index 9b6c1d505c1e..0fa5c3a7db0e 100644
--- a/nixpkgs/pkgs/development/libraries/libfilezilla/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfilezilla/default.nix
@@ -9,11 +9,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libfilezilla";
-  version = "0.18.1";
+  version = "0.19.3";
 
   src = fetchurl {
     url = "https://download.filezilla-project.org/${pname}/${pname}-${version}.tar.bz2";
-    sha256 = "15vzi95ibp6a9n4jjfs78z4b1iym8x1yv849gjipxzx64y5awyyb";
+    sha256 = "0fml6whdbfcwc8nfjhvrnidkscv6q2x988zf3alfjl2mdpw4jgd4";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/nixpkgs/pkgs/development/libraries/libfprint/default.nix b/nixpkgs/pkgs/development/libraries/libfprint/default.nix
index 410496a7bb77..6819ffba21c3 100644
--- a/nixpkgs/pkgs/development/libraries/libfprint/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfprint/default.nix
@@ -1,34 +1,51 @@
-{ thinkpad ? false, stdenv, fetchFromGitHub, fetchurl, pkgconfig, meson, ninja, libusb, pixman, glib, nss, gtk3
-, coreutils, gtk-doc, docbook_xsl, docbook_xml_dtd_43, openssl ? null }:
-
-assert thinkpad -> openssl != null;
+{ stdenv
+, fetchurl
+, pkgconfig
+, meson
+, ninja
+, gusb
+, pixman
+, glib
+, nss
+, gobject-introspection
+, coreutils
+, gtk-doc
+, docbook_xsl
+, docbook_xml_dtd_43
+}:
 
 stdenv.mkDerivation rec {
-  pname = "libfprint" + stdenv.lib.optionalString thinkpad "-thinkpad";
-  version = "0.99.0";
-
-  src = {
-    libfprint-thinkpad =
-      fetchFromGitHub {
-        owner = "3v1n0";
-        repo = "libfprint";
-        rev = "2e2e3821717e9042e93a995bdbd3d00f2df0be9c";
-        sha256 = "1vps1wrp7hskf13f7jrv0dwry2fcid76x2w463wplngp63cj7b3b";
-      };
-    libfprint = fetchurl {
-      url = "https://gitlab.freedesktop.org/libfprint/libfprint/uploads/82ba3cef5bdf72997df711eacdb13c0f/libfprint-${version}.tar.xz";
-      sha256 = "16r4nl40y0jri57jiqmdz4s87byblx22lbhyvqpljd6mqm5rg187";
-    };
-  }.${pname};
-
-  buildInputs = [ libusb pixman glib nss gtk3 ]
-    ++ stdenv.lib.optional thinkpad openssl;
+  pname = "libfprint";
+  version = "1.90";
 
-  nativeBuildInputs = [ pkgconfig meson ninja gtk-doc docbook_xsl docbook_xml_dtd_43 ];
-
-  mesonFlags = [ "-Dudev_rules_dir=lib/udev/rules.d" "-Dx11-examples=false" ];
+  src = fetchurl {
+    url = "https://gitlab.freedesktop.org/libfprint/libfprint/uploads/1bba17b5daa130aa548bc7ea96dc58c4/libfprint-1.90.0.tar.xz";
+    sha256 = "930f530df369ff874d7971f0b7c7bdb7c81597e91af4668694b98fe30b4b3371";
+  };
 
-  preConfigure = ''
+  nativeBuildInputs = [
+    pkgconfig
+    meson
+    ninja
+    gtk-doc
+    docbook_xsl
+    docbook_xml_dtd_43
+    gobject-introspection
+  ];
+
+  buildInputs = [
+    gusb
+    pixman
+    glib
+    nss
+  ];
+
+  mesonFlags = [
+    "-Dudev_rules_dir=${placeholder "out"}/lib/udev/rules.d"
+    "-Dx11-examples=false"
+  ];
+
+  postPatch = ''
     substituteInPlace libfprint/meson.build \
       --replace /bin/echo ${coreutils}/bin/echo
   '';
diff --git a/nixpkgs/pkgs/development/libraries/libfpx/default.nix b/nixpkgs/pkgs/development/libraries/libfpx/default.nix
index f4863eb33f26..97df5107409a 100644
--- a/nixpkgs/pkgs/development/libraries/libfpx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfpx/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   # Darwin gets misdetected as Windows without this
-  NIX_CFLAGS_COMPILE = if stdenv.isDarwin then "-D__unix" else null;
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-D__unix";
 
   patches = [
     (fetchpatch {
diff --git a/nixpkgs/pkgs/development/libraries/libfsm/default.nix b/nixpkgs/pkgs/development/libraries/libfsm/default.nix
index ce7d615f4d31..78f1f66623a4 100644
--- a/nixpkgs/pkgs/development/libraries/libfsm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfsm/default.nix
@@ -4,13 +4,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libfsm";
-  version = "0.1pre1869_${builtins.substring 0 7 src.rev}";
+  version = "0.1pre1905_${builtins.substring 0 8 src.rev}";
 
   src = fetchFromGitHub {
     owner  = "katef";
-    repo   = "libfsm";
-    rev    = "f70c3c5778a79eeecb52f9fd35c7cbc241db0ed6";
-    sha256 = "1hgv272jdv6dwnsdjajyky537z84q0cwzspw9br46qj51h8gkwvx";
+    repo   = pname;
+    rev    = "bd5937fad42b26a86bac1fe3ec49eff73581bd1d";
+    sha256 = "1q3grbmvjnnvc2sshswbd40cc2j2hnwibmljcqx9jqgda0wd6pgv";
     fetchSubmodules = true;
   };
 
@@ -22,12 +22,16 @@ stdenv.mkDerivation rec {
   # if we use stdenv vs clangStdenv, we don't know which, and CC=cc in all
   # cases.) it's unclear exactly what should be done if we want those flags,
   # but the defaults work fine.
-  buildPhase = "PREFIX=$out bmake -r install";
+  buildPhase = "PREFIX=$out bmake -r -j$NIX_BUILD_CORES";
+  installPhase = ''
+    PREFIX=$out bmake -r install
+    runHook postInstall
+  '';
 
   # fix up multi-output install. we also have to fix the pkgconfig libdir
   # file; it uses prefix=$out; libdir=${prefix}/lib, which is wrong in
   # our case; libdir should really be set to the $lib output.
-  installPhase = ''
+  postInstall = ''
     mkdir -p $lib $dev/lib
 
     mv $out/lib             $lib/lib
diff --git a/nixpkgs/pkgs/development/libraries/libftdi/1.x.nix b/nixpkgs/pkgs/development/libraries/libftdi/1.x.nix
index 1b00ff4c0fbb..26002725d91b 100644
--- a/nixpkgs/pkgs/development/libraries/libftdi/1.x.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libftdi/default.nix b/nixpkgs/pkgs/development/libraries/libftdi/default.nix
index 08ec1d84a3f0..3dffbd075e93 100644
--- a/nixpkgs/pkgs/development/libraries/libftdi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libftdi/default.nix
@@ -14,7 +14,7 @@ with stdenv; mkDerivation rec {
 
   # Hack to avoid TMPDIR in RPATHs.
   preFixup = ''rm -rf "$(pwd)" '';
-  configureFlags = lib.optional (!isDarwin) [ "--with-async-mode" ];
+  configureFlags = lib.optional (!isDarwin) "--with-async-mode";
 
   # allow async mode. from ubuntu. see:
   #   https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/libftdi/trusty/view/head:/debian/patches/04_async_mode.diff
diff --git a/nixpkgs/pkgs/development/libraries/libgcrypt/default.nix b/nixpkgs/pkgs/development/libraries/libgcrypt/default.nix
index 75d8e6710e09..e7a9ec60a6d2 100644
--- a/nixpkgs/pkgs/development/libraries/libgcrypt/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libgda/default.nix b/nixpkgs/pkgs/development/libraries/libgda/default.nix
index bb6402dc4287..a1871f6b2e65 100644
--- a/nixpkgs/pkgs/development/libraries/libgda/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgda/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl, pkgconfig, intltool, itstool, libxml2, gtk3, openssl, gnome3, gobject-introspection, vala, libgee
 , overrideCC, gcc6
-, mysqlSupport ? false, mysql ? null
+, mysqlSupport ? false, libmysqlclient ? null
 , postgresSupport ? false, postgresql ? null
 }:
 
-assert mysqlSupport -> mysql != null;
+assert mysqlSupport -> libmysqlclient != null;
 assert postgresSupport -> postgresql != null;
 
 (if stdenv.isAarch64 then overrideCC stdenv gcc6 else stdenv).mkDerivation rec {
@@ -15,9 +15,18 @@ assert postgresSupport -> postgresql != null;
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "16vxv2qvysh22s8h9h6irx96sacagxkz0i4qgi1wc6ibly6fvjjr";
   };
-  configureFlags = with stdenv.lib; [ "--enable-gi-system-install=no" ]
-    ++ (optional (mysqlSupport) "--with-mysql=yes")
-    ++ (optional (postgresSupport) "--with-postgres=yes");
+  configureFlags = with stdenv.lib; [
+    "--enable-gi-system-install=no"
+    "--with-mysql=${if mysqlSupport then "yes" else "no"}"
+    "--with-postgres=${if postgresSupport then "yes" else "no"}"
+
+    # macOS builds use the sqlite source code that comes with libgda,
+    # as opposed to using the system or brewed sqlite3, which is not supported on macOS,
+    # as mentioned in https://github.com/GNOME/libgda/blob/95eeca4b0470f347c645a27f714c62aa6e59f820/libgda/sqlite/README#L31,
+    # which references the paper https://web.archive.org/web/20100610151539/http://lattice.umiacs.umd.edu/files/functions_tr.pdf
+    # See also https://github.com/Homebrew/homebrew-core/blob/104f9ecd02854a82372b64d63d41356555378a52/Formula/libgda.rb
+    "--enable-system-sqlite=${if stdenv.isDarwin then "no" else "yes"}"
+  ];
 
   enableParallelBuilding = true;
 
@@ -25,7 +34,7 @@ assert postgresSupport -> postgresql != null;
 
   nativeBuildInputs = [ pkgconfig intltool itstool libxml2 gobject-introspection vala ];
   buildInputs = with stdenv.lib; [ gtk3 openssl libgee ]
-    ++ optional (mysqlSupport) mysql.connector-c
+    ++ optional (mysqlSupport) libmysqlclient
     ++ optional (postgresSupport) postgresql;
 
   passthru = {
@@ -39,6 +48,6 @@ assert postgresSupport -> postgresql != null;
     homepage = https://www.gnome-db.org/;
     license = [ licenses.lgpl2 licenses.gpl2 ];
     maintainers = gnome3.maintainers;
-    platforms = platforms.linux;
+    platforms = platforms.linux ++ platforms.darwin;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libgdata/default.nix b/nixpkgs/pkgs/development/libraries/libgdata/default.nix
index c7ff6d10da39..6830d47df74b 100644
--- a/nixpkgs/pkgs/development/libraries/libgdata/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libgdiplus/default.nix b/nixpkgs/pkgs/development/libraries/libgdiplus/default.nix
index 558da91fcbf1..54bf091e5ea9 100644
--- a/nixpkgs/pkgs/development/libraries/libgdiplus/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgdiplus/default.nix
@@ -2,39 +2,27 @@
 , libtiff, giflib, libjpeg, libpng
 , libXrender, libexif, autoreconfHook, fetchpatch }:
 
-stdenv.mkDerivation {
-  name = "libgdiplus-5.6.1";
+stdenv.mkDerivation rec {
+  pname = "libgdiplus";
+  version = "6.0.4";
 
   src = fetchFromGitHub {
     owner = "mono";
     repo = "libgdiplus";
-    rev = "5.6.1";
-    sha256 = "023xf3l2s0mxcdbl2viglzrkhx3lwcrpm66fiq7cfdqz80d4vsj2";
+    rev = version;
+    sha256 = "1pf3yhwq9qk0w3yv9bb8qlwwqkffg7xb4sgc8yqdnn6pa56i3vmn";
   };
 
   NIX_LDFLAGS = "-lgif";
 
-  patches = [ # Series of patches cherry-picked from master, all fixes various sigsegv (or required by other patch)
-    (fetchpatch {
-          url = "https://github.com/mono/libgdiplus/commit/d33a2580a94701ff33abe28c22881d6173be57d0.patch";
-          sha256 = "0rr54jylscn4icqjprqhwrncyr92r0d7kmfrrq3myskplpqv1c11";
-    })
-    (fetchpatch {
-          url ="https://github.com/mono/libgdiplus/commit/aa6aa53906935572f52f519fe4ab9ebedc051d08.patch";
-          sha256 = "1wg0avm8qv5cb4vk80baflfzszm6q7ydhn89c3h6kq68hg6zsf1f";
-    })
-    (fetchpatch {
-          url = "https://github.com/mono/libgdiplus/commit/81e45a1d5a3ac3cf035bcc3fabb2859818b6cc04.patch";
-          sha256 = "07wmc88cd1lqifs5x6npryni65jyy9gi8lgr2i1lb7v0fhvlyswg";
-    })
-  ];
-
   outputs = [ "out" "dev" ];
 
   hardeningDisable = [ "format" ];
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
 
+  configureFlags = stdenv.lib.optional stdenv.cc.isClang "--host=${stdenv.hostPlatform.system}";
+
   buildInputs =
     [ glib cairo fontconfig libtiff giflib
       libjpeg libpng libXrender libexif
diff --git a/nixpkgs/pkgs/development/libraries/libglvnd/default.nix b/nixpkgs/pkgs/development/libraries/libglvnd/default.nix
index b976c9c36b83..55b801b0b0d5 100644
--- a/nixpkgs/pkgs/development/libraries/libglvnd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libglvnd/default.nix
@@ -1,48 +1,55 @@
-{ stdenv, lib, fetchFromGitHub, fetchpatch, autoreconfHook, python2, pkgconfig, libX11, libXext, xorgproto, addOpenGLRunpath }:
+{ stdenv, lib, fetchFromGitHub, fetchpatch, autoreconfHook, python3, pkgconfig, libX11, libXext, xorgproto, addOpenGLRunpath }:
 
 stdenv.mkDerivation rec {
   pname = "libglvnd";
-  version = "1.0.0";
+  version = "1.2.0";
 
   src = fetchFromGitHub {
     owner = "NVIDIA";
     repo = "libglvnd";
     rev = "v${version}";
-    sha256 = "1a126lzhd2f04zr3rvdl6814lfl0j077spi5dsf2alghgykn5iif";
+    sha256 = "1hyywwjsmvsd7di603f7iznjlccqlc7yvz0j59gax7bljm9wb6ni";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig python2 addOpenGLRunpath ];
+  nativeBuildInputs = [ autoreconfHook pkgconfig python3 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 " ""
     substituteInPlace src/EGL/Makefile.am \
       --replace "-Wl,-Bsymbolic " ""
+    substituteInPlace src/GLdispatch/Makefile.am \
+      --replace "-Xlinker --version-script=$(VERSION_SCRIPT)" "-Xlinker"
   '';
 
-  NIX_CFLAGS_COMPILE = [
+  NIX_CFLAGS_COMPILE = toString ([
     "-UDEFAULT_EGL_VENDOR_CONFIG_DIRS"
     # FHS paths are added so that non-NixOS applications can find vendor files.
     "-DDEFAULT_EGL_VENDOR_CONFIG_DIRS=\"${addOpenGLRunpath.driverLink}/share/glvnd/egl_vendor.d:/etc/glvnd/egl_vendor.d:/usr/share/glvnd/egl_vendor.d\""
 
     "-Wno-error=array-bounds"
-  ] ++ lib.optional stdenv.cc.isClang "-Wno-error";
+  ] ++ lib.optional stdenv.cc.isClang "-Wno-error");
 
   # Indirectly: https://bugs.freedesktop.org/show_bug.cgi?id=35268
   configureFlags  = stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-tls";
 
-  # Upstream patch fixing use of libdl, should be in next release.
-  patches = [
-    (fetchpatch {
-      url = "https://github.com/NVIDIA/libglvnd/commit/0177ade40262e31a80608a8e8e52d3da7163dccf.patch";
-      sha256 = "1rnz5jw2gvx4i1lcp0k85jz9xgr3dgzsd583m2dlxkaf2a09j89d";
-    })
-  ] ++ stdenv.lib.optional stdenv.isDarwin
-    (fetchpatch {
-      url = "https://github.com/NVIDIA/libglvnd/commit/294ccb2f49107432567e116e13efac586580a4cc.patch";
-      sha256 = "01339wg27cypv93221rhk3885vxbsg8kvbfyia77jmjdcnwrdwm2";
-    });
   outputs = [ "out" "dev" ];
 
   # Set RUNPATH so that libGLX can find driver libraries in /run/opengl-driver(-32)/lib.
diff --git a/nixpkgs/pkgs/development/libraries/libgnomekbd/default.nix b/nixpkgs/pkgs/development/libraries/libgnomekbd/default.nix
index 0951ab1fe0c0..21523bf2e1a5 100644
--- a/nixpkgs/pkgs/development/libraries/libgnomekbd/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libgnurl/default.nix b/nixpkgs/pkgs/development/libraries/libgnurl/default.nix
index 0bb3af37eee1..a1e8ef76394a 100644
--- a/nixpkgs/pkgs/development/libraries/libgnurl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgnurl/default.nix
@@ -3,11 +3,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libgnurl";
-  version = "7.65.3";
+  version = "7.67.0";
 
   src = fetchurl {
     url = "mirror://gnu/gnunet/gnurl-${version}.tar.gz";
-    sha256 = "19l7jw3x83qk7yay5968pc39vzvxl55mhn1nmjh51miyda405qa9";
+    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/nixpkgs/pkgs/development/libraries/libgpg-error/default.nix b/nixpkgs/pkgs/development/libraries/libgpg-error/default.nix
index d7fb35897dc4..c02bc7f0ed3e 100644
--- a/nixpkgs/pkgs/development/libraries/libgpg-error/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgpg-error/default.nix
@@ -39,6 +39,7 @@ in stdenv.mkDerivation (rec {
     sed '/BUILD_TIMESTAMP=/s/=.*/=1970-01-01T00:01+0000/' -i ./configure
   '' + lib.optionalString (stdenv.hostPlatform.isAarch32 && stdenv.buildPlatform != stdenv.hostPlatform) ''
     ln -s lock-obj-pub.arm-unknown-linux-gnueabi.h src/syscfg/lock-obj-pub.linux-gnueabihf.h
+    ln -s lock-obj-pub.arm-unknown-linux-gnueabi.h src/syscfg/lock-obj-pub.linux-gnueabi.h
   '' + lib.optionalString (stdenv.hostPlatform.isx86_64 && stdenv.hostPlatform.isMusl) ''
     ln -s lock-obj-pub.x86_64-pc-linux-musl.h src/syscfg/lock-obj-pub.linux-musl.h
   '' + lib.optionalString (stdenv.hostPlatform.isAarch32 && stdenv.hostPlatform.isMusl) ''
@@ -78,6 +79,6 @@ in stdenv.mkDerivation (rec {
 
     license = licenses.lgpl2Plus;
     platforms = platforms.all;
-    maintainers = [ maintainers.fuuzetsu maintainers.vrthra ];
+    maintainers = [ maintainers.vrthra ];
   };
 } // genPosixLockObjOnlyAttrs)
diff --git a/nixpkgs/pkgs/development/libraries/libgpod/default.nix b/nixpkgs/pkgs/development/libraries/libgpod/default.nix
index d561ebcd7afb..063588e9f1e5 100644
--- a/nixpkgs/pkgs/development/libraries/libgpod/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libgroove/default.nix b/nixpkgs/pkgs/development/libraries/libgroove/default.nix
index 511af0b613b8..bea3c85260c9 100644
--- a/nixpkgs/pkgs/development/libraries/libgroove/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgroove/default.nix
@@ -20,6 +20,6 @@ stdenv.mkDerivation rec {
     homepage = https://github.com/andrewrk/libgroove;
     license = licenses.mit;
     platforms = platforms.unix;
-    maintainers = with maintainers; [ andrewrk ma27 ];
+    maintainers = with maintainers; [ andrewrk ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libgsf/default.nix b/nixpkgs/pkgs/development/libraries/libgsf/default.nix
index 89a72bba8724..a60d3a165334 100644
--- a/nixpkgs/pkgs/development/libraries/libgsf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgsf/default.nix
@@ -1,5 +1,5 @@
 { fetchurl, stdenv, pkgconfig, intltool, gettext, glib, libxml2, zlib, bzip2
-, python, perl, gdk-pixbuf, libiconv, libintl, gnome3 }:
+, perl, gdk-pixbuf, libiconv, libintl, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "libgsf";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig intltool libintl ];
 
-  buildInputs = [ gettext bzip2 zlib python ];
+  buildInputs = [ gettext bzip2 zlib ];
   checkInputs = [ perl ];
 
   propagatedBuildInputs = [ libxml2 glib gdk-pixbuf libiconv ];
diff --git a/nixpkgs/pkgs/development/libraries/libgudev/default.nix b/nixpkgs/pkgs/development/libraries/libgudev/default.nix
index b52a2b1e0fa9..8023acb75d28 100644
--- a/nixpkgs/pkgs/development/libraries/libgudev/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libguestfs/appliance.nix b/nixpkgs/pkgs/development/libraries/libguestfs/appliance.nix
index 9c2b317ab086..ad4a93517e92 100644
--- a/nixpkgs/pkgs/development/libraries/libguestfs/appliance.nix
+++ b/nixpkgs/pkgs/development/libraries/libguestfs/appliance.nix
@@ -1,9 +1,9 @@
 { fetchzip }:
 
 fetchzip {
-  name = "libguestfs-appliance-1.38.0";
-  url = "http://libguestfs.org/download/binaries/appliance/appliance-1.38.0.tar.xz";
-  sha256 = "15rxwj5qjflizxk7slpbrj9lcwkd2lgm52f5yv101qba4yyn3g76";
+  name = "libguestfs-appliance-1.40.1";
+  url = "http://download.libguestfs.org/binaries/appliance/appliance-1.40.1.tar.xz";
+  sha256 = "00863mm08p55cv6w8awp7y0lv894rcrm70mjwqfc8nc4yyb70xlm";
 
   meta = {
     hydraPlatforms = []; # Hydra fails with "Output limit exceeded"
diff --git a/nixpkgs/pkgs/development/libraries/libguestfs/default.nix b/nixpkgs/pkgs/development/libraries/libguestfs/default.nix
index 9b50ddd4b7f4..8d480c2d8829 100644
--- a/nixpkgs/pkgs/development/libraries/libguestfs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libguestfs/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, pkgconfig, autoreconfHook, makeWrapper
 , ncurses, cpio, gperf, cdrkit, flex, bison, qemu, pcre, augeas, libxml2
 , acl, libcap, libcap_ng, libconfig, systemd, fuse, yajl, libvirt, hivex
-, gmp, readline, file, numactl, xen, libapparmor
+, gmp, readline, file, numactl, xen, libapparmor, jansson
 , getopt, perlPackages, ocamlPackages
 , appliance ? null
 , javaSupport ? false, jdk ? null }:
@@ -11,16 +11,16 @@ assert javaSupport -> jdk != null;
 
 stdenv.mkDerivation rec {
   pname = "libguestfs";
-  version = "1.38.6";
+  version = "1.40.2";
 
   src = fetchurl {
-    url = "http://libguestfs.org/download/1.38-stable/libguestfs-${version}.tar.gz";
-    sha256 = "1v2mggx2jlaq4m3p5shc46gzf7vmaayha6r0nwdnyzd7x6q0is7p";
+    url = "http://libguestfs.org/download/1.40-stable/${pname}-${version}.tar.gz";
+    sha256 = "ad6562c48c38e922a314cb45a90996843d81045595c4917f66b02a6c2dfe8058";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook makeWrapper pkgconfig ];
   buildInputs = [
-    makeWrapper autoreconfHook ncurses cpio gperf
+    ncurses cpio gperf jansson
     cdrkit flex bison qemu pcre augeas libxml2 acl libcap libcap_ng libconfig
     systemd fuse yajl libvirt gmp readline file hivex
     numactl xen libapparmor getopt perlPackages.ModuleBuild
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
     ++ stdenv.lib.optionals (!javaSupport) [ "--disable-java" "--without-java" ];
   patches = [ ./libguestfs-syms.patch ];
   NIX_CFLAGS_COMPILE="-I${libxml2.dev}/include/libxml2/";
-  installFlags = "REALLY_INSTALL=yes";
+  installFlags = [ "REALLY_INSTALL=yes" ];
   enableParallelBuilding = true;
 
   postInstall = ''
@@ -65,6 +65,8 @@ stdenv.mkDerivation rec {
 
   doInstallCheck = appliance != null;
   installCheckPhase = ''
+    runHook preInstallCheck
+
     export HOME=$(mktemp -d) # avoid access to /homeless-shelter/.guestfish
 
     ${qemu}/bin/qemu-img create -f qcow2 disk1.img 10G
@@ -77,12 +79,14 @@ stdenv.mkDerivation rec {
     mkfs ext2 /dev/sda1
     list-filesystems
     EOF
+
+    runHook postInstallCheck
   '';
 
   meta = with stdenv.lib; {
     description = "Tools for accessing and modifying virtual machine disk images";
-    license = licenses.gpl2;
-    homepage = http://libguestfs.org/;
+    license = with licenses; [ gpl2 lgpl21 ];
+    homepage = "http://libguestfs.org/";
     maintainers = with maintainers; [offline];
     platforms = platforms.linux;
   };
diff --git a/nixpkgs/pkgs/development/libraries/libgweather/default.nix b/nixpkgs/pkgs/development/libraries/libgweather/default.nix
index 5e35a43fb9d4..e51a10cfe8a3 100644
--- a/nixpkgs/pkgs/development/libraries/libgweather/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgweather/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libgweather";
-  version = "3.32.2";
+  version = "3.34.0";
 
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "00iwbllh8dmnqch0ysng9xhkzzs3ir9jl9f4hp41vbvg1pq5zv98";
+    sha256 = "1fgiqswkhiaijanml3mb16ajn5aanrk7x6yiwagp9n9rssam6902";
   };
 
   nativeBuildInputs = [ meson ninja pkgconfig gettext vala gtk-doc docbook_xsl docbook_xml_dtd_43 gobject-introspection python3 ];
diff --git a/nixpkgs/pkgs/development/libraries/libhandy/default.nix b/nixpkgs/pkgs/development/libraries/libhandy/default.nix
index c4f353fb6d51..88736113ee53 100644
--- a/nixpkgs/pkgs/development/libraries/libhandy/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libheif/default.nix b/nixpkgs/pkgs/development/libraries/libheif/default.nix
index 02c4dd334813..a6e072ef76f7 100644
--- a/nixpkgs/pkgs/development/libraries/libheif/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libheif/default.nix
@@ -2,13 +2,15 @@
 
 stdenv.mkDerivation rec {
   pname = "libheif";
-  version = "1.5.0";
+  version = "1.6.1";
+
+  outputs = [ "bin" "out" "dev" "man" ];
 
   src = fetchFromGitHub {
     owner = "strukturag";
     repo = "libheif";
     rev = "v${version}";
-    sha256 = "1nvfjmnha06689imm8v24nlc011814gc9xq3x54cnmqvh5gn98ah";
+    sha256 = "0l3mj11lp4974kaym3aidm4wriqzls13gz22s67l6341yhsc42n6";
   };
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
diff --git a/nixpkgs/pkgs/development/libraries/libical/default.nix b/nixpkgs/pkgs/development/libraries/libical/default.nix
index 050cba5460d9..69c4b3aeb74e 100644
--- a/nixpkgs/pkgs/development/libraries/libical/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libical/default.nix
@@ -15,7 +15,7 @@
 
 stdenv.mkDerivation rec {
   pname = "libical";
-  version = "3.0.5";
+  version = "3.0.7";
 
   outputs = [ "out" "dev" ]; # "devdoc" ];
 
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     owner = "libical";
     repo = "libical";
     rev = "v${version}";
-    sha256 = "03kjc4s1svmzkmzkr0irgczq37aslhj4bxnvjqav0jwa2zrynhra";
+    sha256 = "1ppf8jlpiclq3jprhx889y5lgf6lc2q4d8wy2zavzsxgnsqf67il";
   };
 
   nativeBuildInputs = [
diff --git a/nixpkgs/pkgs/development/libraries/libicns/default.nix b/nixpkgs/pkgs/development/libraries/libicns/default.nix
index 298d6124505c..27ec8b17c0d2 100644
--- a/nixpkgs/pkgs/development/libraries/libicns/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libiconv/setup-hook.sh b/nixpkgs/pkgs/development/libraries/libiconv/setup-hook.sh
index f89361a62998..120cf06c61b5 100644
--- a/nixpkgs/pkgs/development/libraries/libiconv/setup-hook.sh
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libid3tag/default.nix b/nixpkgs/pkgs/development/libraries/libid3tag/default.nix
index 674862d694c7..c6d430e10fc0 100644
--- a/nixpkgs/pkgs/development/libraries/libid3tag/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libidn2/default.nix b/nixpkgs/pkgs/development/libraries/libidn2/default.nix
index 7e7b691e3c19..c1363d7a9284 100644
--- a/nixpkgs/pkgs/development/libraries/libidn2/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libimagequant/default.nix b/nixpkgs/pkgs/development/libraries/libimagequant/default.nix
index 9c2dd920c9f3..44fa395204bb 100644
--- a/nixpkgs/pkgs/development/libraries/libimagequant/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libimagequant/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libimagequant";
-  version = "2.12.5";
+  version = "2.12.6";
 
   src = fetchFromGitHub {
     owner = "ImageOptim";
     repo = pname;
     rev = version;
-    sha256 = "0cp68w04ja5pv77ssfafsn958w9hh9zb8crrlb5j3gsrcmdc032k";
+    sha256 = "00w7fny3xf14cfyhbdnmqyh9ddqdh1irvgzxd35a2z65kp7vnvj0";
   };
 
   preConfigure = ''
diff --git a/nixpkgs/pkgs/development/libraries/libindicate/default.nix b/nixpkgs/pkgs/development/libraries/libindicate/default.nix
deleted file mode 100644
index f6dc85b629dd..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/libinjection/default.nix b/nixpkgs/pkgs/development/libraries/libinjection/default.nix
new file mode 100644
index 000000000000..b3bdbb41588a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libinjection/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchFromGitHub
+, python
+}:
+
+stdenv.mkDerivation rec {
+  pname   = "libinjection";
+  version = "3.10.0";
+
+  src = fetchFromGitHub {
+    owner  = "client9";
+    repo   = pname;
+    rev    = "refs/tags/v${version}";
+    sha256 = "0chsgam5dqr9vjfhdcp8cgk7la6nf3lq44zs6z6si98cq743550g";
+  };
+
+  nativeBuildInputs = [ python ];
+
+  patchPhase = ''
+    patchShebangs src
+    substituteInPlace src/Makefile \
+      --replace /usr/local $out
+  '';
+
+  configurePhase = "cd src";
+  buildPhase = "make all";
+
+  # no binaries, so out = library, dev = headers
+  outputs = [ "out" "dev" ];
+
+  meta = with stdenv.lib; {
+    description = "SQL / SQLI tokenizer parser analyzer";
+    homepage    = "https://github.com/client9/libinjection";
+    license     = licenses.bsd3;
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libinput/default.nix b/nixpkgs/pkgs/development/libraries/libinput/default.nix
index 044ef2dd6a79..8d48082e1d9c 100644
--- a/nixpkgs/pkgs/development/libraries/libinput/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libisds/default.nix b/nixpkgs/pkgs/development/libraries/libisds/default.nix
new file mode 100644
index 000000000000..4ed5a8309644
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libisoburn/default.nix b/nixpkgs/pkgs/development/libraries/libisoburn/default.nix
index cefce19d4659..633f19cef798 100644
--- a/nixpkgs/pkgs/development/libraries/libisoburn/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libisofs/default.nix b/nixpkgs/pkgs/development/libraries/libisofs/default.nix
index 59726094c4ae..2c1bb3b3b8e3 100644
--- a/nixpkgs/pkgs/development/libraries/libisofs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libisofs/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libisofs";
-  version = "1.5.0";
+  version = "1.5.2";
 
   src = fetchurl {
     url = "http://files.libburnia-project.org/releases/${pname}-${version}.tar.gz";
-    sha256 = "001l3akf3wb6msl9man776w560iqyvsbwwzs7d7y7msx13irspys";
+    sha256 = "002mcyqwg625a8hqvsrmgm26mhhfwj0j7rahfhsqirmk02b16npg";
   };
 
   buildInputs = [ attr zlib ];
diff --git a/nixpkgs/pkgs/development/libraries/libite/default.nix b/nixpkgs/pkgs/development/libraries/libite/default.nix
index 73801102ba38..34ca7406d697 100644
--- a/nixpkgs/pkgs/development/libraries/libite/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libite/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libite";
-  version = "2.0.2";
+  version = "2.1.0";
 
   src = fetchFromGitHub {
     owner = "troglobit";
     repo = "libite";
     rev = "v${version}";
-    sha256 = "0qk7231c1xwvjhkc9w7hasvafvgns10cx9kdhfdbc4r1hsh6d1ca";
+    sha256 = "0fi3j3y37id24cgy3868pyvxkd6mvbbraalvpm99f5dhrxdlv961";
   };
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
diff --git a/nixpkgs/pkgs/development/libraries/libivykis/default.nix b/nixpkgs/pkgs/development/libraries/libivykis/default.nix
index bd1432b8a21b..17cca74c7d29 100644
--- a/nixpkgs/pkgs/development/libraries/libivykis/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libivykis/default.nix
@@ -3,11 +3,11 @@
 stdenv.mkDerivation rec {
   pname = "libivykis";
 
-  version = "0.42.3";
+  version = "0.42.4";
 
   src = fetchurl {
     url = "mirror://sourceforge/libivykis/${version}/ivykis-${version}.tar.gz";
-    sha256 = "1v0ajkm531v4zxzn2x90yb5ab81ssqv2y0fib24wbsggbkajbc69";
+    sha256 = "0abi0rc3wnncvr68hy6rmzp96x6napd7fs1mff20dr8lb0jyvy3f";
   };
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
diff --git a/nixpkgs/pkgs/development/libraries/libjpeg-drop/default.nix b/nixpkgs/pkgs/development/libraries/libjpeg-drop/default.nix
index 4e9c165e71fb..8ed1c9bf92fe 100644
--- a/nixpkgs/pkgs/development/libraries/libjpeg-drop/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libjpeg-drop/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
   '';
 
   configureFlags = []
-    ++ optional static [ "--enable-static" "--disable-shared" ];
+    ++ optionals static [ "--enable-static" "--disable-shared" ];
 
   outputs = [ "bin" "dev" "out" "man" ];
 
diff --git a/nixpkgs/pkgs/development/libraries/libjpeg-turbo/default.nix b/nixpkgs/pkgs/development/libraries/libjpeg-turbo/default.nix
index cb32b22f45e4..f05ac6d521bf 100644
--- a/nixpkgs/pkgs/development/libraries/libjpeg-turbo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libjpeg-turbo/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, nasm }:
+{ stdenv, fetchurl, cmake, nasm, enableStatic ? false }:
 
 stdenv.mkDerivation rec {
 
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake nasm ];
 
   cmakeFlags = [
-    "-DENABLE_STATIC=0"
+    "-DENABLE_STATIC=${if enableStatic then "1" else "0"}"
   ];
 
   doInstallCheck = true;
diff --git a/nixpkgs/pkgs/development/libraries/libksi/default.nix b/nixpkgs/pkgs/development/libraries/libksi/default.nix
index b4e9f2bdf885..f155c0d85065 100644
--- a/nixpkgs/pkgs/development/libraries/libksi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libksi/default.nix
@@ -1,13 +1,14 @@
 { stdenv, fetchFromGitHub, autoreconfHook, openssl, curl }:
 
-stdenv.mkDerivation {
-  name = "libksi-2015-07-03";
+stdenv.mkDerivation rec {
+  pname = "libksi";
+  version = "3.20.3025";
 
   src = fetchFromGitHub {
     owner = "Guardtime";
-    repo = "libksi";
-    rev = "b82dd65bd693722db92397cbe0920170e0d2ae1c";
-    sha256 = "1sqd31l55kx6knl0sg26ail1k5rgmamq8760p6aj7bpb4jwb8r1n";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0cagysr8j92r6g7f0mwrlkpn9xz9ncz2v3jymh47j3ljxmfbagpz";
   };
 
   nativeBuildInputs = [ autoreconfHook ];
diff --git a/nixpkgs/pkgs/development/libraries/liblockfile/default.nix b/nixpkgs/pkgs/development/libraries/liblockfile/default.nix
index aba751bae5ce..bfc9036abe32 100644
--- a/nixpkgs/pkgs/development/libraries/liblockfile/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liblockfile/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   _name   = "liblockfile";
-  version = "1.15";
+  version = "1.16";
   name    = "${_name}-${version}";
 
   src = fetchurl {
     url = "mirror://debian/pool/main/libl/${_name}/${_name}_${version}.orig.tar.gz";
-    sha256 = "04ml9isvdl72fbr1825x7jb680xp8aprdq4pag32ahyjqk909cmh";
+    sha256 = "0s8wj3y6mf1g47nvinkkm5avmqz0z6yxmdrnxpjwgz6krql3hvng";
   };
 
   preConfigure = ''
diff --git a/nixpkgs/pkgs/development/libraries/liblouis/default.nix b/nixpkgs/pkgs/development/libraries/liblouis/default.nix
index 0f73be7ebcea..932edd20e9a6 100644
--- a/nixpkgs/pkgs/development/libraries/liblouis/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libmad/001-mips_removal_h_constraint.patch b/nixpkgs/pkgs/development/libraries/libmad/001-mips_removal_h_constraint.patch
deleted file mode 100644
index 1d8b385e0c57..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/libmad/default.nix b/nixpkgs/pkgs/development/libraries/libmad/default.nix
index f6df090e8b5d..24de4aa2e4a0 100644
--- a/nixpkgs/pkgs/development/libraries/libmad/default.nix
+++ b/nixpkgs/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 = "0hcxzz9ql1fizyqbsgdchdwi7bvchfr72172j43hpyj53p0yabc6";
+    })
+  ];
 
   # 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/nixpkgs/pkgs/development/libraries/libmad/optimize.diff b/nixpkgs/pkgs/development/libraries/libmad/optimize.diff
deleted file mode 100644
index 1418dc927073..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/libmad/pkgconfig.patch b/nixpkgs/pkgs/development/libraries/libmad/pkgconfig.patch
deleted file mode 100644
index 0ac88acb8415..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/libmanette/default.nix b/nixpkgs/pkgs/development/libraries/libmanette/default.nix
index 701238750512..2f7f46974b0b 100644
--- a/nixpkgs/pkgs/development/libraries/libmanette/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmanette/default.nix
@@ -1,22 +1,40 @@
-{ stdenv, fetchurl, ninja, meson, pkgconfig, vala, gobject-introspection
-, glib, libgudev, libevdev, gnome3 }:
+{ stdenv
+, fetchurl
+, ninja
+, meson
+, pkgconfig
+, vala
+, gobject-introspection
+, glib
+, libgudev
+, libevdev
+, gnome3
+}:
 
-let
-  version = "0.2.2";
+stdenv.mkDerivation rec {
   pname = "libmanette";
-in
-stdenv.mkDerivation {
-  name = "${pname}-${version}";
+  version = "0.2.3";
 
   outputs = [ "out" "dev" ];
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1lpprk2qz1lsqf9xj6kj2ciyc1zmjhj5lwd584qkh7jgz2x9y6wb";
+    sha256 = "1zxh7jn2zg7hivmal5zxam6fxvjsd1w6hlw0m2kysk76b8anbw60";
   };
 
-  nativeBuildInputs = [ meson ninja pkgconfig vala gobject-introspection ];
-  buildInputs = [ glib libgudev libevdev ];
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkgconfig
+    vala
+    gobject-introspection
+  ];
+
+  buildInputs = [
+    glib
+    libgudev
+    libevdev
+  ];
 
   doCheck = true;
 
@@ -28,7 +46,7 @@ stdenv.mkDerivation {
 
   meta = with stdenv.lib; {
     description = "A simple GObject game controller library";
-    homepage = https://wiki.gnome.org/Apps/Builder;
+    homepage = "https://gitlab.gnome.org/aplazas/libmanette";
     license = licenses.lgpl21Plus;
     maintainers = gnome3.maintainers;
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/libmatchbox/default.nix b/nixpkgs/pkgs/development/libraries/libmatchbox/default.nix
index 3786c5e77d3a..98875e48f57f 100644
--- a/nixpkgs/pkgs/development/libraries/libmatchbox/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmatchbox/default.nix
@@ -6,9 +6,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libXft libICE pango libjpeg ];
   propagatedBuildInputs = [ libX11 libXext libpng ];
-  NIX_LDFLAGS = [
-    "-lX11"
-  ];
+  NIX_LDFLAGS = "-lX11";
 
   src = fetchurl {
     url = "https://downloads.yoctoproject.org/releases/matchbox/libmatchbox/${version}/libmatchbox-${version}.tar.bz2";
diff --git a/nixpkgs/pkgs/development/libraries/libmaxminddb/default.nix b/nixpkgs/pkgs/development/libraries/libmaxminddb/default.nix
index 46ed250b7b19..5cf12ea46ba0 100644
--- a/nixpkgs/pkgs/development/libraries/libmaxminddb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmaxminddb/default.nix
@@ -2,17 +2,17 @@
 
 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; {
     description = "C library for working with MaxMind geolocation DB files";
     homepage = https://github.com/maxmind/libmaxminddb;
-    license = licenses.apsl20;
+    license = licenses.asl20;
     platforms = platforms.all;
     maintainers = [ maintainers.vcunat ];
   };
diff --git a/nixpkgs/pkgs/development/libraries/libmbim/default.nix b/nixpkgs/pkgs/development/libraries/libmbim/default.nix
index 7a7bd1153280..a49e0eaaac67 100644
--- a/nixpkgs/pkgs/development/libraries/libmbim/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmbim/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libmbim";
-  version = "1.18.2";
+  version = "1.20.4";
 
   src = fetchurl {
     url = "https://www.freedesktop.org/software/libmbim/${pname}-${version}.tar.xz";
-    sha256 = "0s4jsfsydp2vykv7lnimalp9i680aas1qcx7zdpjiic64b5g48vp";
+    sha256 = "1s6k6vm4hyma7nafm1gjssl9lq9nkkiska462xpiz7xh16j0h9xc";
   };
 
   outputs = [ "out" "dev" "man" ];
diff --git a/nixpkgs/pkgs/development/libraries/libmediaart/default.nix b/nixpkgs/pkgs/development/libraries/libmediaart/default.nix
index 569c567e9282..20a63fd6eb03 100644
--- a/nixpkgs/pkgs/development/libraries/libmediaart/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmediaart/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, meson, ninja, pkgconfig, vala, gtk-doc, docbook_xsl, docbook_xml_dtd_412, glib, gdk-pixbuf, gobject-introspection, gnome3 }:
+{ stdenv, fetchurl, meson, ninja, pkgconfig, vala, gtk-doc, docbook_xsl, docbook_xml_dtd_412, glib, gdk-pixbuf, gobject-introspection, gnome3, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "libmediaart";
@@ -14,6 +14,14 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ meson ninja pkgconfig vala gtk-doc docbook_xsl docbook_xml_dtd_412 gobject-introspection ];
   buildInputs = [ glib gdk-pixbuf ];
 
+  patches = [
+    # https://bugzilla.gnome.org/show_bug.cgi?id=792272
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/libmediaart/commit/a704d0b6cfea091274bd79aca6d15f19b4f6e5b5.patch";
+      sha256 = "0606qfmdqxcxrydv1fgwq11hmas34ba4a5kzbbqdhfh0h9ldgwkv";
+    })
+  ];
+
   # FIXME: Turn on again when https://github.com/NixOS/nixpkgs/issues/53701
   # is fixed on master.
   doCheck = false;
diff --git a/nixpkgs/pkgs/development/libraries/libmemcached/default.nix b/nixpkgs/pkgs/development/libraries/libmemcached/default.nix
index 57053103417a..5655bfe968b9 100644
--- a/nixpkgs/pkgs/development/libraries/libmemcached/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmemcached/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
   buildInputs = [ libevent ];
   propagatedBuildInputs = [ cyrus_sasl ];
 
-  NIX_CFLAGS_COMPILE = [ "-fpermissive"/*gcc7*/ ];
+  NIX_CFLAGS_COMPILE = "-fpermissive";
 
   meta = with stdenv.lib; {
     homepage = https://libmemcached.org;
diff --git a/nixpkgs/pkgs/development/libraries/libmesode/default.nix b/nixpkgs/pkgs/development/libraries/libmesode/default.nix
index 7ec06b51e8cb..de09d142d481 100644
--- a/nixpkgs/pkgs/development/libraries/libmesode/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmesode/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libmesode";
-  version = "0.9.2";
+  version = "0.9.3";
 
   src = fetchFromGitHub {
     owner = "boothj5";
     repo = "libmesode";
     rev = version;
-    sha256 = "06f5nfaypvxrbsinxa1k2vrxrs7kqmg38g4wwwk5d63hpn1pj8ak";
+    sha256 = "0xzfg1xx88cn36352nnjlb1p7xyw32yqkhjzq10px88iaaqz1vv0";
   };
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
diff --git a/nixpkgs/pkgs/development/libraries/libmicrohttpd/default.nix b/nixpkgs/pkgs/development/libraries/libmicrohttpd/default.nix
index f8f4439a3dfe..ba4d74e4d484 100644
--- a/nixpkgs/pkgs/development/libraries/libmicrohttpd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmicrohttpd/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libmicrohttpd";
-  version = "0.9.66";
+  version = "0.9.69";
 
   src = fetchurl {
     url = "mirror://gnu/libmicrohttpd/${pname}-${version}.tar.gz";
-    sha256 = "06xblz77bnn29y7sl43avxbcrjbw486x3416plpr3x3l2pdx8rjf";
+    sha256 = "0zp34zgcahym5kp2r83gfb5wnr8yf643a26k6zk96x3qica6p6zv";
   };
 
   outputs = [ "out" "dev" "devdoc" "info" ];
diff --git a/nixpkgs/pkgs/development/libraries/libminc/default.nix b/nixpkgs/pkgs/development/libraries/libminc/default.nix
index aea7a5959fac..53b6af40b512 100644
--- a/nixpkgs/pkgs/development/libraries/libminc/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libmodule/default.nix b/nixpkgs/pkgs/development/libraries/libmodule/default.nix
index bcd20c3b4076..26b81d4d4129 100644
--- a/nixpkgs/pkgs/development/libraries/libmodule/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libmpeg2/default.nix b/nixpkgs/pkgs/development/libraries/libmpeg2/default.nix
index 4c886078aa8b..2351ce2b5549 100644
--- a/nixpkgs/pkgs/development/libraries/libmpeg2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmpeg2/default.nix
@@ -10,13 +10,13 @@ stdenv.mkDerivation rec {
   };
 
   # Otherwise clang fails with 'duplicate symbol ___sputc'
-  buildFlags = stdenv.lib.optionalString stdenv.isDarwin "CFLAGS=-std=gnu89";
+  buildFlags = stdenv.lib.optional stdenv.isDarwin "CFLAGS=-std=gnu89";
 
   meta = {
     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/nixpkgs/pkgs/development/libraries/libmypaint/default.nix b/nixpkgs/pkgs/development/libraries/libmypaint/default.nix
index 91e0b5ef0722..c36633edfff3 100644
--- a/nixpkgs/pkgs/development/libraries/libmypaint/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libnabo/default.nix b/nixpkgs/pkgs/development/libraries/libnabo/default.nix
index 9414ebdcc2a0..4c3ceee1e561 100644
--- a/nixpkgs/pkgs/development/libraries/libnabo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnabo/default.nix
@@ -15,9 +15,9 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  cmakeFlags = "
-    -DEIGEN_INCLUDE_DIR=${eigen}/include/eigen3
-  ";
+  cmakeFlags = [
+    "-DEIGEN_INCLUDE_DIR=${eigen}/include/eigen3"
+  ];
 
   doCheck = true;
   checkTarget = "test";
diff --git a/nixpkgs/pkgs/development/libraries/libnats-c/default.nix b/nixpkgs/pkgs/development/libraries/libnats-c/default.nix
new file mode 100644
index 000000000000..3916ff35f696
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnats-c/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub
+, cmake, protobuf, protobufc
+, libsodium, openssl
+}:
+
+stdenv.mkDerivation rec {
+  pname   = "libnats";
+  version = "2.1.0";
+
+  src = fetchFromGitHub {
+    owner  = "nats-io";
+    repo   = "nats.c";
+    rev    = "refs/tags/v${version}";
+    sha256 = "16a0f0gvrmyrqvmh6vinqny3qhm6wyzw5ijnn3r82b1gqlpws0fz";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libsodium openssl protobuf protobufc ];
+
+  separateDebugInfo = true;
+  enableParallelBuilding = true;
+  outputs = [ "out" "dev" ];
+
+  meta = with stdenv.lib; {
+    description = "C API for the NATS messaging system";
+    homepage    = "https://github.com/nats-io/nats.c";
+    license     = licenses.asl20;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libndctl/default.nix b/nixpkgs/pkgs/development/libraries/libndctl/default.nix
index bfff0c845225..613103db69f2 100644
--- a/nixpkgs/pkgs/development/libraries/libndctl/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libnftnl/default.nix b/nixpkgs/pkgs/development/libraries/libnftnl/default.nix
index 815ed3a6bd40..a4f98eed4177 100644
--- a/nixpkgs/pkgs/development/libraries/libnftnl/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libngspice/default.nix b/nixpkgs/pkgs/development/libraries/libngspice/default.nix
index d9b2df6148aa..ffecfcb61d09 100644
--- a/nixpkgs/pkgs/development/libraries/libngspice/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libnice/default.nix b/nixpkgs/pkgs/development/libraries/libnice/default.nix
index f4ce1f6eea03..90bdb06bb7f6 100644
--- a/nixpkgs/pkgs/development/libraries/libnice/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libnotify/default.nix b/nixpkgs/pkgs/development/libraries/libnotify/default.nix
index d4ac3ae8dc9e..59039aadb895 100644
--- a/nixpkgs/pkgs/development/libraries/libnotify/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libofx/default.nix b/nixpkgs/pkgs/development/libraries/libofx/default.nix
index 6723c08f0822..76276f0ce0fc 100644
--- a/nixpkgs/pkgs/development/libraries/libofx/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libogg/default.nix b/nixpkgs/pkgs/development/libraries/libogg/default.nix
index 71a8e528771b..4f7c5f38123d 100644
--- a/nixpkgs/pkgs/development/libraries/libogg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libogg/default.nix
@@ -1,15 +1,23 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, fetchpatch }:
 
 stdenv.mkDerivation rec {
-  name = "libogg-1.3.3";
+  name = "libogg-1.3.4";
 
   src = fetchurl {
     url = "http://downloads.xiph.org/releases/ogg/${name}.tar.xz";
-    sha256 = "022wjlzn8fx7mfby4pcgyjwx8zir7jr7cizichh3jgaki8bwcgsg";
+    sha256 = "1zlk33vxvxr0l9lhkbhkdwvylw96d2n0fnd3d8dl031hph9bqqy1";
   };
 
   outputs = [ "out" "dev" "doc" ];
 
+  patches = stdenv.lib.optionals stdenv.isDarwin [
+    # Fix unsigned typedefs on darwin. Remove with the next release https://github.com/xiph/ogg/pull/64
+    (fetchpatch {
+      url = "https://github.com/xiph/ogg/commit/c8fca6b4a02d695b1ceea39b330d4406001c03ed.patch";
+      sha256 = "1s72g37y87x0a74zjji9vx2hyk86kr4f2l3m4y2fipvlf9348b3f";
+    })
+  ];
+
   meta = with stdenv.lib; {
     description = "Media container library to manipulate Ogg files";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/liboping/default.nix b/nixpkgs/pkgs/development/libraries/liboping/default.nix
index ff8f200a3bba..b2594d7c1d70 100644
--- a/nixpkgs/pkgs/development/libraries/liboping/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liboping/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1n2wkmvw6n80ybdwkjq8ka43z2x8mvxq49byv61b52iyz69slf7b";
   };
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=format-truncation" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error=format-truncation";
 
   buildInputs = [ ncurses perl ];
 
diff --git a/nixpkgs/pkgs/development/libraries/libosmium/default.nix b/nixpkgs/pkgs/development/libraries/libosmium/default.nix
index eeb8fec5f930..e6abe620aaf0 100644
--- a/nixpkgs/pkgs/development/libraries/libosmium/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libosmium/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libosmium";
-  version = "2.15.2";
+  version = "2.15.4";
 
   src = fetchFromGitHub {
     owner = "osmcode";
     repo = "libosmium";
     rev = "v${version}";
-    sha256 = "1fh8wl4grs1c0g9whx90kd4jva3k9b6zbb1cl3isay489gwndgss";
+    sha256 = "0mlcvqrhp40bzj5r5j9nfc5vbis8hmzcq9xi8jylkciyydaynhz4";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/development/libraries/libosmpbf/default.nix b/nixpkgs/pkgs/development/libraries/libosmpbf/default.nix
index 4be744e7ba93..416101cad0aa 100644
--- a/nixpkgs/pkgs/development/libraries/libosmpbf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libosmpbf/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
 
   sourceRoot = "OSM-binary-1.3.3/src";
 
-  installFlags = "PREFIX=$(out)";
+  installFlags = [ "PREFIX=$(out)" ];
 
   meta = {
     homepage = https://github.com/scrosby/OSM-binary;
diff --git a/nixpkgs/pkgs/development/libraries/libowfat/default.nix b/nixpkgs/pkgs/development/libraries/libowfat/default.nix
index 8c0094a3152b..73029c76818b 100644
--- a/nixpkgs/pkgs/development/libraries/libowfat/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libowfat/default.nix
@@ -19,10 +19,11 @@ stdenv.mkDerivation rec {
       'install -m 644 $(INCLUDES) $(DESTDIR)$(INCLUDEDIR)'
   '';
 
-  makeFlags = "prefix=$(out)";
+  makeFlags = [ "prefix=$(out)" ];
   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/nixpkgs/pkgs/development/libraries/libpcap/default.nix b/nixpkgs/pkgs/development/libraries/libpcap/default.nix
index f7cbfeab4709..b704878b1644 100644
--- a/nixpkgs/pkgs/development/libraries/libpcap/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpcap/default.nix
@@ -1,11 +1,12 @@
-{ stdenv, fetchurl, fetchpatch, flex, bison }:
+{ stdenv, fetchurl, flex, bison }:
 
 stdenv.mkDerivation rec {
-  name = "libpcap-1.9.0";
+  pname = "libpcap";
+  version = "1.9.1";
 
   src = fetchurl {
-    url = "https://www.tcpdump.org/release/${name}.tar.gz";
-    sha256 = "06bhydl4vr4z9c3vahl76f2j96z1fbrcl7wwismgs4sris08inrf";
+    url = "https://www.tcpdump.org/release/${pname}-${version}.tar.gz";
+    sha256 = "153h1378diqyc27jjgz6gg5nxmb4ddk006d9xg69nqavgiikflk3";
   };
 
   nativeBuildInputs = [ flex bison ];
@@ -27,15 +28,6 @@ stdenv.mkDerivation rec {
     substituteInPlace configure --replace " -arch i386" ""
   '';
 
-  patches = [
-    # https://github.com/the-tcpdump-group/libpcap/pull/735
-    (fetchpatch {
-      name = "add-missing-limits-h-include-pr735.patch";
-      url = https://github.com/the-tcpdump-group/libpcap/commit/aafa3512b7b742f5e66a5543e41974cc5e7eebfa.patch;
-      sha256 = "05zb4hx9g24gx07bi02rprk2rn7fdc1ss3249dv5x36qkasnfhvf";
-    })
-  ];
-
   meta = with stdenv.lib; {
     homepage = https://www.tcpdump.org;
     description = "Packet Capture Library";
diff --git a/nixpkgs/pkgs/development/libraries/libpeas/default.nix b/nixpkgs/pkgs/development/libraries/libpeas/default.nix
index 314d5884501f..cdb1b95935f4 100644
--- a/nixpkgs/pkgs/development/libraries/libpeas/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpeas/default.nix
@@ -1,25 +1,27 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gnome3
+{ stdenv, fetchurl, meson, ninja, pkgconfig, gettext, gnome3
 , glib, gtk3, gobject-introspection, python3, ncurses
 }:
 
 stdenv.mkDerivation rec {
   pname = "libpeas";
-  version = "1.22.0";
+  version = "1.24.0";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0qm908kisyjzjxvygdl18hjqxvvgkq9w0phs2g55pck277sw0bsv";
+    sha256 = "1yg6r0srz3knhgvplprl3pikrq5c02dmdxgfwcynd6hjih9h16hb";
   };
 
-  configureFlags = [ "--enable-python3" ];
-
-  nativeBuildInputs = [ pkgconfig intltool gobject-introspection ];
+  nativeBuildInputs = [ pkgconfig meson ninja gettext gobject-introspection ];
   buildInputs =  [ glib gtk3 ncurses python3 python3.pkgs.pygobject3 ];
   propagatedBuildInputs = [
     # Required by libpeas-1.0.pc
     gobject-introspection
   ];
 
+  patches = [
+    ./fix-libpeas-gtk-pc.patch
+  ];
+
   passthru = {
     updateScript = gnome3.updateScript {
       packageName = pname;
diff --git a/nixpkgs/pkgs/development/libraries/libpeas/fix-libpeas-gtk-pc.patch b/nixpkgs/pkgs/development/libraries/libpeas/fix-libpeas-gtk-pc.patch
new file mode 100644
index 000000000000..8016939716d9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpeas/fix-libpeas-gtk-pc.patch
@@ -0,0 +1,22 @@
+diff --git a/libpeas-gtk/meson.build b/libpeas-gtk/meson.build
+index bf590de..00def42 100644
+--- a/libpeas-gtk/meson.build
++++ b/libpeas-gtk/meson.build
+@@ -111,10 +111,17 @@ libpeas_gtk_test_dep = declare_dependency(
+   sources: libpeas_gtk_dep_sources,
+ )
+ 
++libpeas_gtk_pc_reqs = [
++  glib_dep,
++  gtk_dep,
++  package_string + ' >= @0@'.format(version)
++]
++
+ libpeas_gtk_pc = pkg.generate(
+   libpeas_gtk_sha,
+   name: package_gtk_string,
+   description: 'GObject plugins library widgetery',
++  requires: libpeas_gtk_pc_reqs,
+   subdirs: package_string,
+   install_dir: pkgconfigdir,
+ )
diff --git a/nixpkgs/pkgs/development/libraries/libpfm/default.nix b/nixpkgs/pkgs/development/libraries/libpfm/default.nix
index d0572de537eb..3398d3feb94f 100644
--- a/nixpkgs/pkgs/development/libraries/libpfm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpfm/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, enableShared ? true }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (rec {
   version = "4.10.1";
   pname = "libpfm";
 
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     "SYS=${stdenv.hostPlatform.uname.system}"
   ];
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error";
 
   meta = with stdenv.lib; {
     description = "Helper library to program the performance monitoring events";
@@ -30,4 +30,8 @@ stdenv.mkDerivation rec {
     maintainers = [ maintainers.pierron ];
     platforms = platforms.linux;
   };
+} // stdenv.lib.optionalAttrs ( ! enableShared )
+{
+  CONFIG_PFMLIB_SHARED = "n";
 }
+)
diff --git a/nixpkgs/pkgs/development/libraries/libphonenumber/default.nix b/nixpkgs/pkgs/development/libraries/libphonenumber/default.nix
index 4cb327ff527b..c864ccc70acd 100644
--- a/nixpkgs/pkgs/development/libraries/libphonenumber/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libphonenumber/default.nix
@@ -1,17 +1,14 @@
 { stdenv, fetchFromGitHub, cmake, gmock, boost, pkgconfig, protobuf, icu }:
 
-let
-  version = "8.9.9";
-in
-stdenv.mkDerivation {
-  name = "phonenumber-${version}";
-  inherit version;
+stdenv.mkDerivation rec {
+  pname = "phonenumber";
+  version = "8.10.20";
 
   src = fetchFromGitHub {
     owner = "googlei18n";
     repo = "libphonenumber";
     rev = "v${version}";
-    sha256 = "005visnfnr84blgdi0yp4hrzskwbsnawrzv6lqfi9f073l6w5j6w";
+    sha256 = "12xszrd4mrjabhzsp0xvy2qx2rxl36y5a00xfsh0w7bc299rq13v";
   };
 
   nativeBuildInputs = [
diff --git a/nixpkgs/pkgs/development/libraries/libplacebo/default.nix b/nixpkgs/pkgs/development/libraries/libplacebo/default.nix
index 3fd8f86612c7..cee6d3f1845b 100644
--- a/nixpkgs/pkgs/development/libraries/libplacebo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libplacebo/default.nix
@@ -12,16 +12,18 @@
 
 stdenv.mkDerivation rec {
   pname = "libplacebo";
-  version = "1.18.0";
+  version = "1.29.1";
 
   src = fetchFromGitLab {
     domain = "code.videolan.org";
     owner = "videolan";
     repo = pname;
     rev = "v${version}";
-    sha256 = "0ib12i2491piwiz0g5n5izr5jmn5fhwzicq97vfki3r7wrdb54mz";
+    sha256 = "1ly5bwy0pwgvqigpaak8hnig5hksjwf0pzvj3mdv3j2f6f7ya2zz";
   };
 
+  postPatch = "substituteInPlace meson.build --replace 1.29.0 1.29.1";
+
   nativeBuildInputs = [
     meson
     ninja
diff --git a/nixpkgs/pkgs/development/libraries/libpng/12.nix b/nixpkgs/pkgs/development/libraries/libpng/12.nix
index 2cd8c1debaf2..14ae1156087b 100644
--- a/nixpkgs/pkgs/development/libraries/libpng/12.nix
+++ b/nixpkgs/pkgs/development/libraries/libpng/12.nix
@@ -3,11 +3,11 @@
 assert stdenv.hostPlatform == stdenv.buildPlatform -> zlib != null;
 
 stdenv.mkDerivation rec {
-  name = "libpng-1.2.57";
+  name = "libpng-1.2.59";
 
   src = fetchurl {
     url = "mirror://sourceforge/libpng/${name}.tar.xz";
-    sha256 = "1n2lrzjkm5jhfg2bs10q398lkwbbx742fi27zgdgx0x23zhj0ihg";
+    sha256 = "1izw9ybm27llk8531w6h4jp4rk2rxy2s9vil16nwik5dp0amyqxl";
   };
 
   outputs = [ "out" "dev" "man" ];
@@ -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/nixpkgs/pkgs/development/libraries/libpng/default.nix b/nixpkgs/pkgs/development/libraries/libpng/default.nix
index 849f7d29ef6d..95ef62013464 100644
--- a/nixpkgs/pkgs/development/libraries/libpng/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libpointmatcher/default.nix b/nixpkgs/pkgs/development/libraries/libpointmatcher/default.nix
index cd841a9d8f84..20b2988417cc 100644
--- a/nixpkgs/pkgs/development/libraries/libpointmatcher/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpointmatcher/default.nix
@@ -16,9 +16,9 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  cmakeFlags = "
-    -DEIGEN_INCLUDE_DIR=${eigen}/include/eigen3
-  ";
+  cmakeFlags = [
+    "-DEIGEN_INCLUDE_DIR=${eigen}/include/eigen3"
+  ];
 
   doCheck = true;
   checkPhase = ''
diff --git a/nixpkgs/pkgs/development/libraries/libproxy/default.nix b/nixpkgs/pkgs/development/libraries/libproxy/default.nix
index 773acd035355..8d4febcde288 100644
--- a/nixpkgs/pkgs/development/libraries/libproxy/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libproxy/default.nix
@@ -6,12 +6,11 @@
 , fetchpatch
 , dbus
 , networkmanager
-, spidermonkey_38
+, spidermonkey_60
 , pcre
 , gsettings-desktop-schemas
 , glib
 , makeWrapper
-, python2
 , python3
 , SystemConfiguration
 , CoreFoundation
@@ -29,7 +28,7 @@ stdenv.mkDerivation rec {
     sha256 = "10swd3x576pinx33iwsbd4h15fbh2snmfxzcmab4c56nb08qlbrs";
   };
 
-  outputs = [ "out" "dev" "py2" "py3" ];
+  outputs = [ "out" "dev" "py3" ];
 
   nativeBuildInputs = [
     pkgconfig
@@ -39,7 +38,6 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     pcre
-    python2
     python3
     zlib
   ] ++ (if stdenv.hostPlatform.isDarwin then [
@@ -48,18 +46,32 @@ stdenv.mkDerivation rec {
     JavaScriptCore
   ] else [
     glib
-    spidermonkey_38
+    spidermonkey_60
     dbus
     networkmanager
   ]);
 
   cmakeFlags = [
     "-DWITH_MOZJS=ON"
-    "-DPYTHON2_SITEPKG_DIR=${placeholder "py2"}/${python2.sitePackages}"
+    "-DWITH_PYTHON2=OFF"
     "-DPYTHON3_SITEPKG_DIR=${placeholder "py3"}/${python3.sitePackages}"
   ];
 
-  patches = stdenv.lib.optionals stdenv.isDarwin [
+  patches = [
+    # Make build with spidermonkey_60
+    (fetchpatch {
+      url = "https://github.com/libproxy/libproxy/pull/86.patch";
+      sha256 = "17c06ilinrnzr7xnnmw9pc6zrncyaxcdd6r6k1ah5p156skbykfs";
+    })
+    (fetchpatch {
+      url = "https://github.com/libproxy/libproxy/pull/87.patch";
+      sha256 = "0sagzfwm16f33inbkwsp88w9wmrd034rjmw0y8d122f7k1qfx6zc";
+    })
+    (fetchpatch {
+      url = "https://github.com/libproxy/libproxy/pull/95.patch";
+      sha256 = "18vyr6wlis9zfwml86606jpgb9mss01l9aj31iiciml8p857aixi";
+    })
+  ] ++ stdenv.lib.optionals stdenv.isDarwin [
     (fetchpatch {
       url = "https://github.com/libproxy/libproxy/commit/44158f03f8522116758d335688ed840dfcb50ac8.patch";
       sha256 = "0axfvb6j7gcys6fkwi9dkn006imhvm3kqr83gpwban8419n0q5v1";
diff --git a/nixpkgs/pkgs/development/libraries/libpsl/default.nix b/nixpkgs/pkgs/development/libraries/libpsl/default.nix
index 15aa7c9e22d1..d2012760dcf6 100644
--- a/nixpkgs/pkgs/development/libraries/libpsl/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libpwquality/default.nix b/nixpkgs/pkgs/development/libraries/libpwquality/default.nix
index 60c01565e63e..b0d5513ca0ff 100644
--- a/nixpkgs/pkgs/development/libraries/libpwquality/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpwquality/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libpwquality";
-  version = "1.4.0";
+  version = "1.4.2";
 
   src = fetchFromGitHub {
     owner = "libpwquality";
     repo = "libpwquality";
     rev = "${pname}-${version}";
-    sha256 = "0k564hj2q13z5ag8cj6rnkzm1na7001k4chz4f736p6aqvspv0bd";
+    sha256 = "0n4pjhm7wfivk0wizggaxq4y4mcxic876wcarjabkp5z9k14y36h";
   };
 
   nativeBuildInputs = [ autoreconfHook perl ];
diff --git a/nixpkgs/pkgs/development/libraries/libqalculate/default.nix b/nixpkgs/pkgs/development/libraries/libqalculate/default.nix
index 894907c23fc8..d369eebd88fd 100644
--- a/nixpkgs/pkgs/development/libraries/libqalculate/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libqalculate/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libqalculate";
-  version = "3.4.0";
+  version = "3.6.0";
 
   src = fetchFromGitHub {
     owner = "qalculate";
     repo = "libqalculate";
     rev = "v${version}";
-    sha256 = "046fi8cqfqh0ila3kc4sg75yvg24wmghlja2fmhkj96fjjfkzsss";
+    sha256 = "0qfdgxb46c18cp43z67n986xhj6x0sa95hryq42spf1p5ymbylqy";
   };
 
   outputs = [ "out" "dev" "doc" ];
diff --git a/nixpkgs/pkgs/development/libraries/libqmi/default.nix b/nixpkgs/pkgs/development/libraries/libqmi/default.nix
index 930eafc96759..6c78eb977c9c 100644
--- a/nixpkgs/pkgs/development/libraries/libqmi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libqmi/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libqmi";
-  version = "1.22.4";
+  version = "1.24.0";
 
   src = fetchurl {
     url = "https://www.freedesktop.org/software/libqmi/${pname}-${version}.tar.xz";
-    sha256 = "1wgrrb9vb3myl8xgck8ik86876ycbg8crylybs3ssi21vrxqwnsc";
+    sha256 = "0yccw97pqn8afy96k5ssk7qi6r3wjshcnxk14k77qikkqa89zdmf";
   };
 
   outputs = [ "out" "dev" "devdoc" ];
diff --git a/nixpkgs/pkgs/development/libraries/libqtav/default.nix b/nixpkgs/pkgs/development/libraries/libqtav/default.nix
index 22245f5fa2ab..dd6318444e78 100644
--- a/nixpkgs/pkgs/development/libraries/libqtav/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libqtav/default.nix
@@ -30,7 +30,7 @@ mkDerivation rec {
   # Make sure libqtav finds its libGL dependency at both link and run time
   # by adding libGL to rpath. Not sure why it wasn't done automatically like
   # the other libraries as `libGL` is part of our `buildInputs`.
-  NIX_CFLAGS_LINK = [ "-Wl,-rpath,${libGL}/lib"];
+  NIX_CFLAGS_LINK = "-Wl,-rpath,${libGL}/lib";
 
   preFixup = ''
     mkdir -p "$out/bin"
diff --git a/nixpkgs/pkgs/development/libraries/libraspberrypi/default.nix b/nixpkgs/pkgs/development/libraries/libraspberrypi/default.nix
new file mode 100644
index 000000000000..ec31a29d0538
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libraw/default.nix b/nixpkgs/pkgs/development/libraries/libraw/default.nix
index 360b2c15a632..00288e359dfb 100644
--- a/nixpkgs/pkgs/development/libraries/libraw/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libraw/default.nix
@@ -1,17 +1,20 @@
-{ 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";
-  version = "0.19.3";
+  version = "0.19.5";
 
   src = fetchurl {
     url = "https://www.libraw.org/data/LibRaw-${version}.tar.gz";
-    sha256 = "0xs1qb6pcvc4c43fy5xi3nkqxcif77gakkw99irf0fc5iccdd5px";
+    sha256 = "1x827sh6vl8j3ll2ihkcr234y07f31hi1v7sl08jfw3irkbn58j0";
   };
 
   outputs = [ "out" "lib" "dev" "doc" ];
 
-  buildInputs = [ jasper ];
+  buildInputs = stdenv.lib.optionals withJpeg2k [ jasper ];
 
   propagatedBuildInputs = [ lcms2 ];
 
diff --git a/nixpkgs/pkgs/development/libraries/librdf/redland.nix b/nixpkgs/pkgs/development/libraries/librdf/redland.nix
index 30d8d8a94e9d..8835490187d1 100644
--- a/nixpkgs/pkgs/development/libraries/librdf/redland.nix
+++ b/nixpkgs/pkgs/development/libraries/librdf/redland.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, pkgconfig, openssl, libxslt, perl
 , curl, pcre, libxml2, librdf_rasqal, gmp
-, mysql, withMysql ? false
+, libmysqlclient, withMysql ? false
 , postgresql, withPostgresql ? false
 , sqlite, withSqlite ? true
 , db, withBdb ? false
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ perl pkgconfig ];
 
   buildInputs = [ openssl libxslt curl pcre libxml2 gmp ]
-    ++ stdenv.lib.optional withMysql mysql.connector-c
+    ++ stdenv.lib.optional withMysql libmysqlclient
     ++ stdenv.lib.optional withSqlite sqlite
     ++ stdenv.lib.optional withPostgresql postgresql
     ++ stdenv.lib.optional withBdb db;
diff --git a/nixpkgs/pkgs/development/libraries/libre/default.nix b/nixpkgs/pkgs/development/libraries/libre/default.nix
index e365ec7a01ac..433597cde6f5 100644
--- a/nixpkgs/pkgs/development/libraries/libre/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/librealsense/default.nix b/nixpkgs/pkgs/development/libraries/librealsense/default.nix
index 468bcfb0a18f..91c093c991ac 100644
--- a/nixpkgs/pkgs/development/libraries/librealsense/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/librem/default.nix b/nixpkgs/pkgs/development/libraries/librem/default.nix
index aeda663342e4..012ac2a46a74 100644
--- a/nixpkgs/pkgs/development/libraries/librem/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libressl/default.nix b/nixpkgs/pkgs/development/libraries/libressl/default.nix
index 4bfa6cd0b8e4..285d7b607e7b 100644
--- a/nixpkgs/pkgs/development/libraries/libressl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libressl/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchurl, lib, cmake, cacert }:
+{ stdenv, fetchurl, lib, cmake, cacert, fetchpatch, buildShared ? true }:
 
 let
 
-  generic = { version, sha256 }: stdenv.mkDerivation rec {
+  generic = { version, sha256, patches ? [] }: stdenv.mkDerivation rec {
     pname = "libressl";
     inherit version;
 
@@ -15,13 +15,14 @@ let
 
     cmakeFlags = [
       "-DENABLE_NC=ON"
-      "-DBUILD_SHARED_LIBS=ON"
       # Ensure that the output libraries do not require an executable stack.
       # Without this define, assembly files in libcrypto do not include a
       # .note.GNU-stack section, and if that section is missing from any object,
       # the linker will make the stack executable.
       "-DCMAKE_C_FLAGS=-DHAVE_GNU_STACK"
-    ];
+      # libressl will append this to the regular prefix for libdir
+      "-DCMAKE_INSTALL_LIBDIR=lib"
+    ] ++ lib.optional buildShared "-DBUILD_SHARED_LIBS=ON";
 
     # The autoconf build is broken as of 2.9.1, resulting in the following error:
     # libressl-2.9.1/tls/.libs/libtls.a', needed by 'handshake_table'.
@@ -31,6 +32,8 @@ let
       rm configure
     '';
 
+    inherit patches;
+
     # Since 2.9.x the default location can't be configured from the build using
     # DEFAULT_CA_FILE anymore, instead we have to patch the default value.
     postPatch = lib.optionalString (lib.versionAtLeast version "2.9.2") ''
@@ -61,18 +64,19 @@ let
 
 in {
 
-  libressl_2_8 = generic {
-    version = "2.8.3";
-    sha256 = "0xw4z4z6m7lyf1r4m2w2w1k7as791c04ygnfk4d7d0ki0h9hnr4v";
-  };
-
   libressl_2_9 = generic {
     version = "2.9.2";
     sha256 = "1m6mz515dcbrbnyz8hrpdfjzdmj1c15vbgnqxdxb89g3z9kq3iy4";
+    patches = stdenv.lib.optional stdenv.hostPlatform.isMusl [
+      (fetchpatch {
+        url = "https://github.com/libressl-portable/portable/pull/529/commits/a747aacc23607c993cc481378782b2c7dd5bc53b.patch";
+        sha256 = "0wbrcscdkjpk4mhh7f3saghi4smia4lhf7fl6la3ahhgx1krn5zm";
+      })
+    ];
   };
 
   libressl_3_0 = generic {
-    version = "3.0.0";
-    sha256 = "0xiwri6xcnl3wb5nbc4aw8pv32s3hp13r9v465yr8wykaw211n81";
+    version = "3.0.2";
+    sha256 = "13ir2lpxz8y1m151k7lrx306498nzfhwlvgkgv97v5cvywmifyyz";
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/librseq/default.nix b/nixpkgs/pkgs/development/libraries/librseq/default.nix
new file mode 100644
index 000000000000..d4619ba4320e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librseq/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchFromGitHub
+, autoreconfHook, linuxHeaders
+}:
+
+stdenv.mkDerivation rec {
+  pname = "librseq";
+  version = "0.1.0pre54_${builtins.substring 0 7 src.rev}";
+
+  src = fetchFromGitHub {
+    owner  = "compudj";
+    repo   = "librseq";
+    rev    = "152600188dd214a0b2c6a8c66380e50c6ad27154";
+    sha256 = "0mivjmgdkgrr6z2gz3k6q6wgnvyvw9xzy65f6ipvqva68sxhk0mx";
+  };
+
+  outputs = [ "out" "dev" ];
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ linuxHeaders ];
+
+  separateDebugInfo = true;
+  enableParallelBuilding = true;
+
+  # The share/ subdir only contains a doc/ with a README.md that just describes
+  # how to compile the library, which clearly isn't very useful! So just get
+  # rid of it anyway.
+  postInstall = ''
+    rm -rf $out/share
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Userspace library for the Linux Restartable Sequence API";
+    homepage    = "https://github.com/compudj/librseq";
+    license     = licenses.lgpl21;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librsvg/default.nix b/nixpkgs/pkgs/development/libraries/librsvg/default.nix
index 4653b8b86a26..11c7f3fed84e 100644
--- a/nixpkgs/pkgs/development/libraries/librsvg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/librsvg/default.nix
@@ -1,25 +1,24 @@
 { lib, stdenv, fetchurl, pkgconfig, glib, gdk-pixbuf, pango, cairo, libxml2, libgsf
 , bzip2, libcroco, libintl, darwin, rustc, cargo, gnome3
-, withGTK ? false, gtk3 ? null
 , vala, gobject-introspection }:
 
 let
   pname = "librsvg";
-  version = "2.44.15";
+  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 = "1p4cifnxppz2qwsk2wvn2a6c7dpvgfrsf5vlhdkmsd373czm9396";
+    sha256 = "0afc82nsxc6kw136xid4vcq9kmq4rmgzzk8bh2pvln2cnvirwnxl";
   };
 
   outputs = [ "out" "dev" "installedTests" ];
 
   buildInputs = [ libxml2 libgsf bzip2 libcroco pango libintl ];
 
-  propagatedBuildInputs = [ glib gdk-pixbuf cairo ] ++ lib.optional withGTK gtk3;
+  propagatedBuildInputs = [ glib gdk-pixbuf cairo ];
 
   nativeBuildInputs = [ pkgconfig rustc cargo vala gobject-introspection ]
     ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
diff --git a/nixpkgs/pkgs/development/libraries/librsync/default.nix b/nixpkgs/pkgs/development/libraries/librsync/default.nix
index 79b05619ac59..02a8abb7c856 100644
--- a/nixpkgs/pkgs/development/libraries/librsync/default.nix
+++ b/nixpkgs/pkgs/development/libraries/librsync/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "librsync";
-  version = "2.0.2";
+  version = "2.2.1";
 
   src = fetchFromGitHub {
     owner = "librsync";
     repo = "librsync";
     rev = "v${version}";
-    sha256 = "1qnr4rk93mhggqjh2025clmlhhgnjhq983p1vbh8i1g8aiqdnapi";
+    sha256 = "08wdlxsa9zg2pyasz1lwg70d5psi4amv81v4yxwffx67ndzb9yp5";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/development/libraries/libscrypt/default.nix b/nixpkgs/pkgs/development/libraries/libscrypt/default.nix
index b9ae1f829a1b..3083136526bf 100644
--- a/nixpkgs/pkgs/development/libraries/libscrypt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libscrypt/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   buildFlags = stdenv.lib.optional stdenv.isDarwin "LDFLAGS= CFLAGS_EXTRA=";
 
   installFlags = [ "PREFIX=$(out)" ];
-  installTargets = if stdenv.isDarwin then "install-osx" else "install";
+  installTargets = stdenv.lib.optional stdenv.isDarwin "install-osx";
 
   doCheck = true;
 
diff --git a/nixpkgs/pkgs/development/libraries/libsearpc/default.nix b/nixpkgs/pkgs/development/libraries/libsearpc/default.nix
index b2a799674771..9bf246f556d3 100644
--- a/nixpkgs/pkgs/development/libraries/libsearpc/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libseccomp/default.nix b/nixpkgs/pkgs/development/libraries/libseccomp/default.nix
index 8c9c6ac107ce..08c276c4d558 100644
--- a/nixpkgs/pkgs/development/libraries/libseccomp/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libsecret/default.nix b/nixpkgs/pkgs/development/libraries/libsecret/default.nix
index 6c2723bbd907..ca2449adefd5 100644
--- a/nixpkgs/pkgs/development/libraries/libsecret/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsecret/default.nix
@@ -1,13 +1,13 @@
 { 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";
-  version = "0.18.8";
+  version = "0.19.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "058x64689k55wxfkdp4svhnwvv8jmqm7z5mrynybl38f4sfqiyiv";
+    sha256 = "0fhflcsr70b1pps2pcvqcbdhip2ny5am9nbm634f4sj5g40y30w5";
   };
 
   postPatch = ''
@@ -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
@@ -41,6 +41,8 @@ stdenv.mkDerivation rec {
   passthru = {
     updateScript = gnome3.updateScript {
       packageName = pname;
+      # Does not seem to use the odd-unstable policy: https://gitlab.gnome.org/GNOME/libsecret/issues/30
+      versionPolicy = "none";
     };
   };
 
diff --git a/nixpkgs/pkgs/development/libraries/libsexy/default.nix b/nixpkgs/pkgs/development/libraries/libsexy/default.nix
deleted file mode 100644
index cb22d9f97bc7..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/libsodium/default.nix b/nixpkgs/pkgs/development/libraries/libsodium/default.nix
index 8c88abd2c441..a2b6ba6224e2 100644
--- a/nixpkgs/pkgs/development/libraries/libsodium/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsodium/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   outputs = [ "out" "dev" ];
-  separateDebugInfo = stdenv.isLinux;
+  separateDebugInfo = stdenv.isLinux && stdenv.hostPlatform.libc != "musl";
 
   enableParallelBuilding = true;
 
diff --git a/nixpkgs/pkgs/development/libraries/libsolv/default.nix b/nixpkgs/pkgs/development/libraries/libsolv/default.nix
index 263623c3d37c..c3fe1ad619af 100644
--- a/nixpkgs/pkgs/development/libraries/libsolv/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsolv/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchFromGitHub, cmake, ninja, zlib, expat, rpm, db }:
 
 stdenv.mkDerivation rec {
-  version  = "0.7.5";
+  version  = "0.7.9";
   pname = "libsolv";
 
   src = fetchFromGitHub {
     owner  = "openSUSE";
     repo   = "libsolv";
     rev    = version;
-    sha256 = "0khks19i01s9h297c7af4bpq448abs2pqw55scf56xfdvxpv23aw";
+    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/nixpkgs/pkgs/development/libraries/libsoup/default.nix b/nixpkgs/pkgs/development/libraries/libsoup/default.nix
index 5f88ba80cd6a..2d2f2da6a399 100644
--- a/nixpkgs/pkgs/development/libraries/libsoup/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsoup/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, glib, libxml2, meson, ninja, pkgconfig, gnome3
 , gnomeSupport ? true, sqlite, glib-networking, gobject-introspection, vala
-, libpsl, python3 }:
+, libpsl, python3, brotli }:
 
 stdenv.mkDerivation rec {
   pname = "libsoup";
-  version = "2.66.2";
+  version = "2.68.3";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0amfw1yvy1kjrg41rfh2vvrw5gkwnyckqbw1fab50hm6xc1acbmx";
+    sha256 = "1yxs0ax4rq3g0lgkbv7mz497rqj16iyyizddyc13gzxh6n7b0jsk";
   };
 
   postPatch = ''
@@ -17,15 +17,16 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  buildInputs = [ python3 sqlite libpsl ];
+  buildInputs = [ python3 sqlite libpsl brotli ];
   nativeBuildInputs = [ meson ninja pkgconfig gobject-introspection vala ];
   propagatedBuildInputs = [ glib libxml2 ];
 
   mesonFlags = [
     "-Dtls_check=false" # glib-networking is a runtime dependency, not a compile-time dependency
-    "-Dgssapi=false"
-    "-Dvapi=true"
+    "-Dgssapi=disabled"
+    "-Dvapi=enabled"
     "-Dgnome=${if gnomeSupport then "true" else "false"}"
+    "-Dntlm=disabled"
   ];
 
   doCheck = false; # ERROR:../tests/socket-test.c:37:do_unconnected_socket_test: assertion failed (res == SOUP_STATUS_OK): (2 == 200)
diff --git a/nixpkgs/pkgs/development/libraries/libspectrum/default.nix b/nixpkgs/pkgs/development/libraries/libspectrum/default.nix
new file mode 100644
index 000000000000..c09a45abf594
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libspotify/default.nix b/nixpkgs/pkgs/development/libraries/libspotify/default.nix
index 9ef3d6654138..1b0953df4e65 100644
--- a/nixpkgs/pkgs/development/libraries/libspotify/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libspotify/default.nix
@@ -50,11 +50,11 @@ else stdenv.mkDerivation {
   buildInputs = stdenv.lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") unzip;
 
   # linux-specific
-  installFlags = stdenv.lib.optionalString (isLinux)
+  installFlags = stdenv.lib.optional isLinux
     "prefix=$(out)";
-  patchPhase = stdenv.lib.optionalString (isLinux)
+  patchPhase = stdenv.lib.optionalString isLinux
     "${gnused}/bin/sed -i 's/ldconfig//' Makefile";
-  postInstall = stdenv.lib.optionalString (isLinux)
+  postInstall = stdenv.lib.optionalString isLinux
     "mv -v share $out";
 
   passthru = {
diff --git a/nixpkgs/pkgs/development/libraries/libstrophe/default.nix b/nixpkgs/pkgs/development/libraries/libstrophe/default.nix
index 0ef96f675055..b48bd15909de 100644
--- a/nixpkgs/pkgs/development/libraries/libstrophe/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libstrophe/default.nix
@@ -2,17 +2,17 @@
 
 stdenv.mkDerivation rec {
   pname = "libstrophe";
-  version = "0.9.2";
+  version = "0.9.3";
 
   src = fetchFromGitHub {
     owner = "strophe";
-    repo = "libstrophe";
+    repo = pname;
     rev = version;
-    sha256 = "1milna92h8wzxax8ll362zvb70091nmfks5lmd105vk0478zraca";
+    sha256 = "1g1l0w9z9hdy5ncdvd9097gi7k7783did6py5h9camlpb2fnk5mk";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ automake autoconf openssl expat libtool check ];
+  nativeBuildInputs = [ automake autoconf pkgconfig libtool check ];
+  buildInputs = [ openssl expat ];
 
   dontDisableStatic = true;
 
@@ -27,9 +27,9 @@ stdenv.mkDerivation rec {
       minimal dependencies and is configurable for various environments. It
       runs well on both Linux, Unix, and Windows based platforms.
     '';
-    homepage = http://strophe.im/libstrophe/;
-    license = with stdenv.lib.licenses; [gpl3 mit];
+    homepage = "http://strophe.im/libstrophe/";
+    license = with stdenv.lib.licenses; [ gpl3 mit ];
     platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [devhell flosse];
+    maintainers = with stdenv.lib.maintainers; [ devhell flosse ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libsvm/default.nix b/nixpkgs/pkgs/development/libraries/libsvm/default.nix
index fcd010b46cc3..99eccc3436fd 100644
--- a/nixpkgs/pkgs/development/libraries/libsvm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsvm/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libsvm";
-  version = "3.23";
+  version = "3.24";
 
   src = fetchurl {
     url = "https://www.csie.ntu.edu.tw/~cjlin/libsvm/libsvm-${version}.tar.gz";
-    sha256 = "0jpaq0rr92x38p4nk3gjan79ip67m6p80anb28z1d8601miysyi5";
+    sha256 = "15l69y23fxslrap415dvqb383x5fxvbffp9giszjfqjf38h1m26m";
   };
 
   buildPhase = ''
diff --git a/nixpkgs/pkgs/development/libraries/libtcod/default.nix b/nixpkgs/pkgs/development/libraries/libtcod/default.nix
index 6d95d81e5d9c..d81f3f820015 100644
--- a/nixpkgs/pkgs/development/libraries/libtcod/default.nix
+++ b/nixpkgs/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 {
 
@@ -19,9 +19,9 @@ stdenv.mkDerivation {
     echo 'INSTALL(DIRECTORY include DESTINATION .)' >> CMakeLists.txt
   '';
 
-  cmakeFlags="-DLIBTCOD_SAMPLES=OFF";
+  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/nixpkgs/pkgs/development/libraries/libtermkey/default.nix b/nixpkgs/pkgs/development/libraries/libtermkey/default.nix
index 38a09218dd1d..989d26b64e1b 100644
--- a/nixpkgs/pkgs/development/libraries/libtermkey/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libtermkey/default.nix
@@ -1,23 +1,24 @@
-{ stdenv, lib, fetchzip, libtool, pkgconfig, ncurses }:
+{ stdenv, lib, fetchzip, libtool, pkgconfig, ncurses, unibilium }:
 
 stdenv.mkDerivation rec {
   pname = "libtermkey";
 
-  version = "0.20";
+  version = "0.22";
 
   src = fetchzip {
     url = "http://www.leonerd.org.uk/code/libtermkey/libtermkey-${version}.tar.gz";
-    sha256 = "1i5a2zangq61ba1vdkag34ig5g4gzccldccdbcmqmk93saa6lkbx";
+    sha256 = "02dks6bj7n23lj005yq41azf95wh3hapmgc2lzyh12vigkjh67rg";
   };
 
   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/nixpkgs/pkgs/development/libraries/libtiff/default.nix b/nixpkgs/pkgs/development/libraries/libtiff/default.nix
index 093d6a185443..795ed439093b 100644
--- a/nixpkgs/pkgs/development/libraries/libtiff/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libtiff/default.nix
@@ -9,12 +9,12 @@
 }:
 
 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";
   };
 
   outputs = [ "bin" "dev" "out" "man" "doc" ];
diff --git a/nixpkgs/pkgs/development/libraries/libtommath/default.nix b/nixpkgs/pkgs/development/libraries/libtommath/default.nix
index 8ce82bcf07c7..0fde422b9aab 100644
--- a/nixpkgs/pkgs/development/libraries/libtommath/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libtoxcore/default.nix b/nixpkgs/pkgs/development/libraries/libtoxcore/default.nix
index e9267df5047b..76362f8f8835 100644
--- a/nixpkgs/pkgs/development/libraries/libtoxcore/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libtxc_dxtn/default.nix b/nixpkgs/pkgs/development/libraries/libtxc_dxtn/default.nix
index 5ac456a60f61..600b1fb510ad 100644
--- a/nixpkgs/pkgs/development/libraries/libtxc_dxtn/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libtxc_dxtn_s2tc/default.nix b/nixpkgs/pkgs/development/libraries/libtxc_dxtn_s2tc/default.nix
index 4959674f0ad2..f9f44f5a6531 100644
--- a/nixpkgs/pkgs/development/libraries/libtxc_dxtn_s2tc/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libui/default.nix b/nixpkgs/pkgs/development/libraries/libui/default.nix
index e333e73de3ff..57385d1b4101 100644
--- a/nixpkgs/pkgs/development/libraries/libui/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libui/default.nix
@@ -1,21 +1,22 @@
-{ stdenv, fetchgit, cmake, pkgconfig, gtk3, Cocoa }:
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, gtk3, Cocoa }:
 
 let
   shortName = "libui";
-  version   = "3.1a";
+  version   = "4.1a";
   backend   = if stdenv.isDarwin then "darwin" else "unix";
 in
 
 stdenv.mkDerivation {
   name = "${shortName}-${version}";
-  src  = fetchgit {
-    url    = "https://github.com/andlabs/libui.git";
-    rev    = "6ebdc96b93273c3cedf81159e7843025caa83058";
-    sha256 = "1lpbfa298c61aarlzgp7vghrmxg1274pzxh1j9isv8x758gk6mfn";
+  src  = fetchFromGitHub {
+    owner  = "andlabs";
+    repo   = "libui";
+    rev    = "alpha4.1";
+    sha256 = "0bm6xvqk4drg2kw6d304x6mlfal7gh8mbl5a9f0509smmdzgdkwm";
   };
 
   nativeBuildInputs = [ cmake pkgconfig ];
-  buildInputs = stdenv.lib.optional stdenv.isLinux gtk3
+  propagatedBuildInputs = stdenv.lib.optional stdenv.isLinux gtk3
     ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa ];
 
   preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
diff --git a/nixpkgs/pkgs/development/libraries/libuinputplus/default.nix b/nixpkgs/pkgs/development/libraries/libuinputplus/default.nix
new file mode 100644
index 000000000000..700a4701fc87
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libuinputplus/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchFromGitHub, cmake, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  pname = "libuinputplus";
+  version = "2019-10-01";
+
+  src  = fetchFromGitHub {
+    owner  = "YukiWorkshop";
+    repo   = "libuInputPlus";
+    rev    = "962f180b4cc670e1f5cc73c2e4d5d196ae52d630";
+    sha256 = "0jy5i7bmjad7hw1qcyjl4swqribp2027s9g3609zwj7lj8z5x0bg";
+  };
+
+  nativeBuildInputs = [ cmake pkgconfig ];
+
+  meta = with stdenv.lib; {
+    inherit (src.meta) homepage;
+    description = "Easy-to-use uinput library in C++";
+    license = licenses.mit;
+    maintainers = with maintainers; [ willibutz ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libunique/default.nix b/nixpkgs/pkgs/development/libraries/libunique/default.nix
index b96fdf5eeddc..d6566978a6bb 100644
--- a/nixpkgs/pkgs/development/libraries/libunique/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libunique/default.nix
@@ -9,7 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "1fsgvmncd9caw552lyfg8swmsd6bh4ijjsph69bwacwfxwf09j75";
   };
 
-  NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
+  # glib-2.62 deprecations
+  NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS";
 
   # Patches from Gentoo portage
   patches = [
diff --git a/nixpkgs/pkgs/development/libraries/libunity/default.nix b/nixpkgs/pkgs/development/libraries/libunity/default.nix
index 2baaa14b88ea..daaf3de6bcc7 100644
--- a/nixpkgs/pkgs/development/libraries/libunity/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libunity/default.nix
@@ -43,6 +43,11 @@ stdenv.mkDerivation {
     libdbusmenu
   ];
 
+  patches = [
+    # See: https://gitlab.gnome.org/GNOME/vala/issues/766
+    ./fix-vala.patch
+  ];
+
   preConfigure = ''
     intltoolize
   '';
diff --git a/nixpkgs/pkgs/development/libraries/libunity/fix-vala.patch b/nixpkgs/pkgs/development/libraries/libunity/fix-vala.patch
new file mode 100644
index 000000000000..ec34229b4443
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libunity/fix-vala.patch
@@ -0,0 +1,36 @@
+diff -ru old/libunity/src/unity-aggregator-scope.vala libunity/src/unity-aggregator-scope.vala
+--- old/libunity/src/unity-aggregator-scope.vala	1969-12-31 19:00:01.000000000 -0500
++++ libunity/src/unity-aggregator-scope.vala	2019-09-21 17:06:12.663864891 -0400
+@@ -51,7 +51,7 @@
+    */
+   public abstract int category_index_for_scope_id (string scope_id);
+ 
+-  public AggregatorScope (string dbus_path_, string id_, MergeMode merge_mode = AggregatorScope.MergeMode.OWNER_SCOPE, bool proxy_filter_hints = false)
++  protected AggregatorScope (string dbus_path_, string id_, MergeMode merge_mode = AggregatorScope.MergeMode.OWNER_SCOPE, bool proxy_filter_hints = false)
+   {
+     Object (dbus_path: dbus_path_, id: id_, is_master: true,
+             merge_mode: merge_mode, proxy_filter_hints: proxy_filter_hints);
+diff -ru old/libunity/src/unity-deprecated-scope.vala libunity/src/unity-deprecated-scope.vala
+--- old/libunity/src/unity-deprecated-scope.vala	1969-12-31 19:00:01.000000000 -0500
++++ libunity/src/unity-deprecated-scope.vala	2019-09-21 17:06:39.721627805 -0400
+@@ -61,7 +61,7 @@
+   internal CategorySet _categories;
+   internal FilterSet _filters;
+    
+-  public DeprecatedScopeBase (string dbus_path_, string id_)
++  protected DeprecatedScopeBase (string dbus_path_, string id_)
+   {
+     Object (dbus_path: dbus_path_, id: id_);
+   }
+diff -ru old/libunity/tools/preview-renderer.vala libunity/tools/preview-renderer.vala
+--- old/libunity/tools/preview-renderer.vala	1969-12-31 19:00:01.000000000 -0500
++++ libunity/tools/preview-renderer.vala	2019-09-21 17:09:16.201522110 -0400
+@@ -63,7 +63,7 @@
+      */
+     public abstract class GridRenderer: PreviewRenderer
+     {
+-        public GridRenderer()
++        protected GridRenderer()
+         {
+             Object();
+         }
diff --git a/nixpkgs/pkgs/development/libraries/liburing/default.nix b/nixpkgs/pkgs/development/libraries/liburing/default.nix
index 855c6ce280ec..386354b48e4d 100644
--- a/nixpkgs/pkgs/development/libraries/liburing/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liburing/default.nix
@@ -4,54 +4,14 @@
 
 stdenv.mkDerivation rec {
   pname = "liburing";
-  version = "0.1";
+  version = "0.2";
 
   src = fetchgit {
-    url    = "http://git.kernel.dk/liburing";
-    rev    = "refs/tags/liburing-${version}";
-    sha256 = "038iqsbm9bdmlwvmb899bc6g1rw5dalr990azynbvgn8qs5adysh";
+    url    = "http://git.kernel.dk/${pname}";
+    rev    = "refs/tags/${pname}-${version}";
+    sha256 = "0dxq7qjrwndgavrrc6y2wg54ia3y5wkmcyhpdk4l5pvh7hw6kpdz";
   };
 
-  patches = [
-
-    # This patch re-introduces support for aarch64-linux, by adding the
-    # necessary memory barrier primitives for it to work.
-    #
-    # Already upstream: remove when moving to the next version
-    (fetchpatch {
-      url    = "http://git.kernel.dk/cgit/liburing/patch/?id=0520db454c29f1d96cda6cf6cedeb93df65301e8";
-      sha256 = "1i8133sb1imzxpplmhlhnaxkffgplhj40vanivc6clbibvhgwpq6";
-    })
-
-    # This patch shuffles the name of the io_uring memory barrier primitives.
-    # They were using extremely common names by accident, which caused
-    # namespace conflicts with many other projects using the same names. Note:
-    # this does not change the user-visible API of liburing (liburing is
-    # designed exactly to hide the necessary memory barriers when using the
-    # io_uring syscall directly). It only changes the names of some internals.
-    # The only reason this caused problems at all is because memory barrier
-    # primitives are written as preprocessor defines, in a common header file,
-    # which get included unilaterally.
-    #
-    # Already upstream: remove when moving to the next version
-    (fetchpatch {
-      url    = "http://git.kernel.dk/cgit/liburing/patch/?id=552c6a08d04c74d20eeaa86f535bfd553b352370";
-      sha256 = "123d6jdqfy7b8aq9f6ax767n48hhbx6pln3nlrp623595i8zz3wf";
-    })
-
-    # Finally, this patch fixes the aarch64-linux support introduced by the
-    # first patch, but which was _broken_ by the second patch, in a horrid
-    # twist of fate: it neglected to change the names of the aarch64 barriers
-    # appropriately.
-    #
-    # Already upstream: remove when moving to the next version
-    (fetchpatch {
-      url    = "http://git.kernel.dk/cgit/liburing/patch/?id=6e9dd0c8c50b5988a0c77532c9c2bd6afd4790d2";
-      sha256 = "11mqa1bp2pdfqh08gpcd98kg7lh3rrng41b4l1wvhxdbvg5rfw9c";
-    })
-
-  ];
-
   separateDebugInfo = true;
   enableParallelBuilding = true;
 
@@ -70,11 +30,12 @@ stdenv.mkDerivation rec {
     mkdir -p $out/bin
     cp ./examples/io_uring-cp examples/io_uring-test $out/bin
     cp ./examples/link-cp $out/bin/io_uring-link-cp
+    cp ./examples/ucontext-cp $out/bin/io_uring-ucontext-cp
   '';
 
   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/nixpkgs/pkgs/development/libraries/libusb1/default.nix b/nixpkgs/pkgs/development/libraries/libusb1/default.nix
index 19a8025359a0..9d90304042c8 100644
--- a/nixpkgs/pkgs/development/libraries/libusb1/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libusb1/default.nix
@@ -1,4 +1,14 @@
-{ stdenv, fetchurl, pkgconfig, systemd ? null, libobjc, IOKit, withStatic ? false }:
+{ stdenv
+, fetchurl
+, pkgconfig
+, enableSystemd ? stdenv.isLinux && !stdenv.hostPlatform.isMusl
+, systemd ? null
+, libobjc
+, IOKit
+, withStatic ? false
+}:
+
+assert enableSystemd -> systemd != null;
 
 stdenv.mkDerivation (rec {
   pname = "libusb";
@@ -13,13 +23,13 @@ stdenv.mkDerivation (rec {
 
   nativeBuildInputs = [ pkgconfig ];
   propagatedBuildInputs =
-    stdenv.lib.optional stdenv.isLinux systemd ++
+    stdenv.lib.optional enableSystemd systemd ++
     stdenv.lib.optionals stdenv.isDarwin [ libobjc IOKit ];
 
   NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s";
 
   preFixup = stdenv.lib.optionalString stdenv.isLinux ''
-    sed 's,-ludev,-L${systemd.lib}/lib -ludev,' -i $out/lib/libusb-1.0.la
+    sed 's,-ludev,-L${stdenv.lib.getLib systemd}/lib -ludev,' -i $out/lib/libusb-1.0.la
   '';
 
   meta = with stdenv.lib; {
diff --git a/nixpkgs/pkgs/development/libraries/libuv/default.nix b/nixpkgs/pkgs/development/libraries/libuv/default.nix
index 07f99a058d8b..524896b8bfd2 100644
--- a/nixpkgs/pkgs/development/libraries/libuv/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libuv/default.nix
@@ -1,14 +1,14 @@
 { stdenv, lib, fetchFromGitHub, autoconf, automake, libtool, pkgconfig, ApplicationServices, CoreServices }:
 
 stdenv.mkDerivation rec {
-  version = "1.30.1";
+  version = "1.34.0";
   pname = "libuv";
 
   src = fetchFromGitHub {
     owner = pname;
     repo = pname;
     rev = "v${version}";
-    sha256 = "16l207g9qwckxn0vnbnwiybhw6083imdwyfd6ipfsl44b1m8jmf7";
+    sha256 = "0vcrrqf0zqgsfmgbyl45qhajyab98kxqq66l0w4lkj5say86aln8";
   };
 
   postPatch = let
diff --git a/nixpkgs/pkgs/development/libraries/libvdpau/default.nix b/nixpkgs/pkgs/development/libraries/libvdpau/default.nix
index 792a31bcf9f9..e6a57f1e38c4 100644
--- a/nixpkgs/pkgs/development/libraries/libvdpau/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libvdpau/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   configureFlags = stdenv.lib.optional stdenv.isLinux
     "--with-module-dir=${mesa.drivers.driverLink}/lib/vdpau";
 
-  NIX_LDFLAGS = if stdenv.isDarwin then "-lX11" else null;
+  NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lX11";
 
   installFlags = [ "moduledir=$(out)/lib/vdpau" ];
 
diff --git a/nixpkgs/pkgs/development/libraries/libvirt-glib/default.nix b/nixpkgs/pkgs/development/libraries/libvirt-glib/default.nix
index 1803ce1dc20a..7dd874ebc836 100644
--- a/nixpkgs/pkgs/development/libraries/libvirt-glib/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libvmaf/default.nix b/nixpkgs/pkgs/development/libraries/libvmaf/default.nix
new file mode 100644
index 000000000000..82c76f7ea372
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvmaf/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub, autoconf, automake, intltool, libtool, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  pname = "libvmaf";
+  version = "1.3.15";
+
+  src = fetchFromGitHub {
+    owner = "netflix";
+    repo = "vmaf";
+    rev = "v${version}";
+    sha256="10kgcdf06hzhbl5r7zsllq88bxbyn282hfqx5i3hkp66fpq896d2";
+  };
+
+  nativeBuildInputs = [ autoconf automake intltool libtool pkgconfig ];
+  outputs = [ "out" "dev" ];
+  doCheck = true;
+
+  postFixup = ''
+    substituteInPlace "$dev/lib/pkgconfig/libvmaf.pc" \
+      --replace "includedir=/usr/local/include" "includedir=$dev"
+  '';
+
+  makeFlags = [ "INSTALL_PREFIX=${placeholder "out"}" ];
+
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/Netflix/vmaf";
+    description = "Perceptual video quality assessment based on multi-method fusion (VMAF)";
+    platforms = platforms.linux;
+    license = licenses.asl20;
+    maintainers = [ maintainers.cfsmp3 ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvncserver/default.nix b/nixpkgs/pkgs/development/libraries/libvncserver/default.nix
index 0a7819743e03..c9adad6f6454 100644
--- a/nixpkgs/pkgs/development/libraries/libvncserver/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libvorbis/default.nix b/nixpkgs/pkgs/development/libraries/libvorbis/default.nix
index 5457b1075a3e..263fa0a5216d 100644
--- a/nixpkgs/pkgs/development/libraries/libvorbis/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libvterm-neovim/default.nix b/nixpkgs/pkgs/development/libraries/libvterm-neovim/default.nix
index 231b426e6a7d..50ee7e4d3873 100644
--- a/nixpkgs/pkgs/development/libraries/libvterm-neovim/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libwacom/default.nix b/nixpkgs/pkgs/development/libraries/libwacom/default.nix
index a4f0a44e60bf..7d7dd94eff49 100644
--- a/nixpkgs/pkgs/development/libraries/libwacom/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libwacom/default.nix
@@ -1,17 +1,22 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, glib, pkgconfig, udev, libgudev }:
+{ stdenv, fetchFromGitHub, meson, ninja, glib, pkgconfig, udev, libgudev }:
 
 stdenv.mkDerivation rec {
   pname = "libwacom";
-  version = "0.33";
+  version = "1.1";
+
+  outputs = [ "out" "dev" ];
 
   src = fetchFromGitHub {
     owner = "linuxwacom";
     repo = "libwacom";
     rev = "libwacom-${version}";
-    sha256 = "0np0a7rpnlm9iqw1i8ycz5mprin6bb99p4h522v9vjk4lhzsp34m";
+    sha256 = "037vnyfg7nim6h3f4m04w6a9pr6hi04df14qpys580kf5xnf87nz";
   };
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  nativeBuildInputs = [ pkgconfig meson ninja ];
+
+  mesonFlags = [ "-Dtests=false" ];
+
   buildInputs = [ glib udev libgudev ];
 
   meta = with stdenv.lib; {
diff --git a/nixpkgs/pkgs/development/libraries/libwebp/default.nix b/nixpkgs/pkgs/development/libraries/libwebp/default.nix
index fc9932567cfa..56c3f638d52d 100644
--- a/nixpkgs/pkgs/development/libraries/libwebp/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libwhereami/default.nix b/nixpkgs/pkgs/development/libraries/libwhereami/default.nix
index cafd25ede0ae..8e190f998d56 100644
--- a/nixpkgs/pkgs/development/libraries/libwhereami/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libwhereami/default.nix
@@ -2,16 +2,16 @@
 
 stdenv.mkDerivation rec {
   pname = "libwhereami";
-  version = "0.2.2";
+  version = "0.3.1";
 
   src = fetchFromGitHub {
-    sha256 = "084n153jaq8fmhjififk0xlx1d1i3lclnw2j3ly8bixvc392vzly";
+    sha256 = "16xjb6zp60ma76aa3kq3q8i8zn0n61gf39fny12cny8nggwjpbww";
     rev = version;
     repo = "libwhereami";
     owner = "puppetlabs";
   };
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=catch-value" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error=catch-value";
 
   nativeBuildInputs = [ cmake ];
 
@@ -24,8 +24,7 @@ stdenv.mkDerivation rec {
     description = "Library to report hypervisor information from inside a VM";
     license = licenses.asl20;
     maintainers = [ maintainers.womfoo ];
-    platforms = platforms.linux;
-    badPlatforms = platforms.arm;
+    platforms = with platforms; [ "i686-linux" "x86_64-linux" ]; # fails on aarch64
   };
 
 }
diff --git a/nixpkgs/pkgs/development/libraries/libwmf/default.nix b/nixpkgs/pkgs/development/libraries/libwmf/default.nix
index e7aa5f7ecc9f..5c684c7fd778 100644
--- a/nixpkgs/pkgs/development/libraries/libwmf/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libwps/default.nix b/nixpkgs/pkgs/development/libraries/libwps/default.nix
index e8f397548853..61b777a52433 100644
--- a/nixpkgs/pkgs/development/libraries/libwps/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libwps/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ boost librevenge zlib ];
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=implicit-fallthrough" ]; # newly detected by gcc-7
+  NIX_CFLAGS_COMPILE = "-Wno-error=implicit-fallthrough";
 
   meta = with stdenv.lib; {
     homepage = http://libwps.sourceforge.net/;
diff --git a/nixpkgs/pkgs/development/libraries/libx86emu/default.nix b/nixpkgs/pkgs/development/libraries/libx86emu/default.nix
index f361b3e1b1f7..cef2c6aeb1bb 100644
--- a/nixpkgs/pkgs/development/libraries/libx86emu/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libx86emu/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libx86emu";
-  version = "2.3";
+  version = "2.4";
 
   src = fetchFromGitHub {
     owner = "wfeldt";
     repo = "libx86emu";
     rev = version;
-    sha256 = "158mrg9xb0sb4l3s60084j6i7nr90smpsks9f02gbssk495h2k8l";
+    sha256 = "0r55ij8f5mab2kg6kvy5n2bw6avzp75nsxigbzy7dgik9zwsxvr4";
   };
 
   nativeBuildInputs = [ perl ];
diff --git a/nixpkgs/pkgs/development/libraries/libxklavier/default.nix b/nixpkgs/pkgs/development/libraries/libxklavier/default.nix
index 9408b0c45877..b088ba198b22 100644
--- a/nixpkgs/pkgs/development/libraries/libxklavier/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxklavier/default.nix
@@ -14,6 +14,8 @@ stdenv.mkDerivation rec {
     sha256 = "1w1x5mrgly2ldiw3q2r6y620zgd89gk7n90ja46775lhaswxzv7a";
   };
 
+  patches = [ ./honor-XKB_CONFIG_ROOT.patch ];
+
   outputs = [ "out" "dev" "devdoc" ];
 
   # TODO: enable xmodmap support, needs xmodmap DB
diff --git a/nixpkgs/pkgs/development/libraries/libxklavier/honor-XKB_CONFIG_ROOT.patch b/nixpkgs/pkgs/development/libraries/libxklavier/honor-XKB_CONFIG_ROOT.patch
new file mode 100644
index 000000000000..93b768eeb202
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxklavier/honor-XKB_CONFIG_ROOT.patch
@@ -0,0 +1,89 @@
+From 999a419f4b36764a7269650a7f965d48bd4b73f7 Mon Sep 17 00:00:00 2001
+From: Louis Bettens <louis@bettens.info>
+Date: Sat, 28 Dec 2019 14:30:58 +0100
+Subject: [PATCH] honor $XKB_CONFIG_ROOT
+
+---
+ libxklavier/xklavier_config_xkb.c | 30 +++++++++++++++++++++++++-----
+ 1 file changed, 25 insertions(+), 5 deletions(-)
+
+diff --git a/libxklavier/xklavier_config_xkb.c b/libxklavier/xklavier_config_xkb.c
+index baec569..00e8de5 100644
+--- a/libxklavier/xklavier_config_xkb.c
++++ b/libxklavier/xklavier_config_xkb.c
+@@ -45,6 +45,18 @@
+ #define XK_XKB_KEYS
+ #include <X11/keysymdef.h>
+ 
++static const gchar *
++xkl_xkb_get_base_path(void)
++{
++	const gchar *base_path;
++
++	base_path = g_getenv ("XKB_CONFIG_ROOT");
++	if (!base_path)
++		base_path = XKB_BASE;
++
++	return base_path;
++}
++
+ #ifdef LIBXKBFILE_PRESENT
+ static XkbRF_RulesPtr xkl_rules;
+ 
+@@ -65,7 +77,8 @@ xkl_rules_set_load(XklEngine * engine)
+ 
+ 	locale = setlocale(LC_ALL, NULL);
+ 
+-	g_snprintf(file_name, sizeof file_name, XKB_BASE "/rules/%s", rf);
++	g_snprintf(file_name, sizeof file_name, "%s/rules/%s",
++		   xkl_xkb_get_base_path(), rf);
+ 	xkl_debug(160, "Loading rules from [%s]\n", file_name);
+ 
+ 	rules_set = XkbRF_Load(file_name, locale, True, True);
+@@ -98,10 +111,14 @@ gboolean
+ xkl_xkb_load_config_registry(XklConfigRegistry * config,
+ 			     gboolean if_extras_needed)
+ {
+-	return xkl_config_registry_load_helper(config,
++	const gchar *rules_path = g_strdup_printf("%s/rules",
++					  xkl_xkb_get_base_path());
++	gboolean ok = xkl_config_registry_load_helper(config,
+ 					       XKB_DEFAULT_RULESET,
+-					       XKB_BASE "/rules",
++					       rules_path,
+ 					       if_extras_needed);
++	g_free(rules_path);
++	return ok;
+ }
+ 
+ #ifdef LIBXKBFILE_PRESENT
+@@ -249,6 +266,7 @@ xkl_config_get_keyboard(XklEngine * engine,
+ 		pid_t cpid, pid;
+ 		int status = 0;
+ 		FILE *tmpxkb;
++		const gchar *opt_I;
+ 
+ 		xkl_debug(150, "tmp XKB/XKM file names: [%s]/[%s]\n",
+ 			  xkb_fn, xkm_fn);
+@@ -296,14 +314,16 @@ xkl_config_get_keyboard(XklEngine * engine,
+ 				break;
+ 			case 0:
+ 				/* child */
++				opt_I = g_strdup_printf("-I%s", xkl_xkb_get_base_path());
+ 				xkl_debug(160, "Executing %s\n", XKBCOMP);
+ 				xkl_debug(160, "%s %s %s %s %s %s %s %s\n",
+ 					  XKBCOMP, XKBCOMP, "-w0", "-I",
+-					  "-I" XKB_BASE, "-xkm", xkb_fn,
++					  opt_I, "-xkm", xkb_fn,
+ 					  xkm_fn);
+ 				execl(XKBCOMP, XKBCOMP, "-w0", "-I",
+-				      "-I" XKB_BASE, "-xkm", xkb_fn,
++				      opt_I, "-xkm", xkb_fn,
+ 				      xkm_fn, NULL);
++				g_free(opt_I);
+ 				xkl_debug(0, "Could not exec %s: %d\n",
+ 					  XKBCOMP, errno);
+ 				exit(1);
+-- 
+2.24.1
+
diff --git a/nixpkgs/pkgs/development/libraries/libxl/default.nix b/nixpkgs/pkgs/development/libraries/libxl/default.nix
index 44949cf2deb4..8618fc80a525 100644
--- a/nixpkgs/pkgs/development/libraries/libxl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxl/default.nix
@@ -2,14 +2,15 @@
 
 stdenv.mkDerivation rec {
   pname = "libxl";
-  version = "3.8.4";
+  version = "3.8.7";
 
   src = fetchurl {
     url = "http://www.libxl.com/download/${pname}-lin-${version}.tar.gz";
-    sha256 = "0jnvc9ilir3lvs81l6ldnyf6jbfsy7bcs5pkc75qfnvz01y7p6as";
+    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/nixpkgs/pkgs/development/libraries/libxls/default.nix b/nixpkgs/pkgs/development/libraries/libxls/default.nix
index 126589966464..c111a13d2984 100644
--- a/nixpkgs/pkgs/development/libraries/libxls/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxls/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libxls";
-  version = "1.5.1";
+  version = "1.5.2";
 
   src = fetchurl {
     url = "https://github.com/libxls/libxls/releases/download/v${version}/libxls-${version}.tar.gz";
-    sha256 = "0dam8qgbc5ykzaxmrjhpmfm8lnlcdk6cbpzyaya91qwwa80qbj1v";
+    sha256 = "1akadsyl10rp101ccjmrxr7933c3v641k377bn74jv6cdkcm4zld";
   };
 
   nativeBuildInputs = [ unzip ];
diff --git a/nixpkgs/pkgs/development/libraries/libxml2/default.nix b/nixpkgs/pkgs/development/libraries/libxml2/default.nix
index 04954f3e1f5f..57a7294c887d 100644
--- a/nixpkgs/pkgs/development/libraries/libxml2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxml2/default.nix
@@ -1,27 +1,38 @@
 { 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"
     ++ lib.optional (enableStatic && enableShared) "static";
-  propagatedBuildOutputs = "out bin" + lib.optionalString pythonSupport " py";
+  propagatedBuildOutputs = [ "out" "bin" ] ++ lib.optional pythonSupport "py";
 
   buildInputs = lib.optional pythonSupport python
     ++ lib.optional (pythonSupport && python?isPy3 && python.isPy3) ncurses
@@ -42,13 +53,19 @@ 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";
 
   preInstall = lib.optionalString pythonSupport
     ''substituteInPlace python/libxml2mod.la --replace "${python}" "$py"'';
-  installFlags = lib.optionalString pythonSupport
-    ''pythondir="$(py)/lib/${python.libPrefix}/site-packages"'';
+  installFlags = lib.optional pythonSupport
+    "pythondir=\"${placeholder ''py''}/lib/${python.libPrefix}/site-packages\"";
 
   postFixup = ''
     moveToOutput bin/xml2-config "$dev"
diff --git a/nixpkgs/pkgs/development/libraries/libxml2/utf8-xmlErrorFuncHandler.patch b/nixpkgs/pkgs/development/libraries/libxml2/utf8-xmlErrorFuncHandler.patch
new file mode 100644
index 000000000000..9f4c99b09341
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libxmlb/default.nix b/nixpkgs/pkgs/development/libraries/libxmlb/default.nix
index 4800a6c405c3..75fffa83d24b 100644
--- a/nixpkgs/pkgs/development/libraries/libxmlb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxmlb/default.nix
@@ -1,6 +1,5 @@
 { stdenv
 , fetchFromGitHub
-, fetchpatch
 , docbook_xml_dtd_43
 , docbook_xsl
 , glib
@@ -17,7 +16,7 @@
 
 stdenv.mkDerivation rec {
   pname = "libxmlb";
-  version = "0.1.11";
+  version = "0.1.13";
 
   outputs = [ "out" "lib" "dev" "devdoc" "installedTests" ];
 
@@ -25,17 +24,10 @@ stdenv.mkDerivation rec {
     owner = "hughsie";
     repo = "libxmlb";
     rev = version;
-    sha256 = "1503v76w7543snqyjxykiqa5va62zb0ccn3jlw0gpdx8973v80mr";
+    sha256 = "14bk7bk08mjbildak1l7jq7idcyask7384vigpq9zmwai1gax4s7";
   };
 
   patches = [
-    # Fix installed tests
-    # https://github.com/hughsie/libxmlb/pull/2
-    (fetchpatch {
-      url = "https://github.com/hughsie/libxmlb/commit/78850c8b0f644f729fa21e2bf9ebed0d9d6010f3.diff";
-      sha256 = "0zw7c6vy8hscln7za7ijqd9svirach3zdskvbzyxxcsm3xcwxpjm";
-    })
-
     ./installed-tests-path.patch
   ];
 
@@ -70,7 +62,7 @@ stdenv.mkDerivation rec {
 
   passthru = {
     tests = {
-      installed-tests = nixosTests.libxmlb;
+      installed-tests = nixosTests.installed-tests.libxmlb;
     };
   };
 
diff --git a/nixpkgs/pkgs/development/libraries/libxslt/default.nix b/nixpkgs/pkgs/development/libraries/libxslt/default.nix
index 1a3efee176a0..6d12329a7f51 100644
--- a/nixpkgs/pkgs/development/libraries/libxslt/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/libyaml-cpp/default.nix b/nixpkgs/pkgs/development/libraries/libyaml-cpp/default.nix
index fbc4b4bcec57..0dec9daee6ac 100644
--- a/nixpkgs/pkgs/development/libraries/libyaml-cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libyaml-cpp/default.nix
@@ -2,20 +2,20 @@
 
 stdenv.mkDerivation rec {
   pname = "libyaml-cpp";
-  version = "0.6.2";
+  version = "0.6.3";
 
   src = fetchFromGitHub {
     owner = "jbeder";
     repo = "yaml-cpp";
     rev = "yaml-cpp-${version}";
-    sha256 = "16lclpa487yghf9019wymj419wkyx4795wv9q7539hhimajw9kpb";
+    sha256 = "0ykkxzxcwwiv8l8r697gyqh1nl582krpvi7m7l6b40ijnk4pw30s";
   };
 
   outputs = [ "out" "dev" ];
 
   nativeBuildInputs = [ cmake ];
 
-  cmakeFlags = "-DBUILD_SHARED_LIBS=ON -DYAML_CPP_BUILD_TESTS=OFF";
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DYAML_CPP_BUILD_TESTS=OFF" ];
 
   meta = with stdenv.lib; {
     inherit (src.meta) homepage;
diff --git a/nixpkgs/pkgs/development/libraries/libzip/default.nix b/nixpkgs/pkgs/development/libraries/libzip/default.nix
index 43a5f7dc8413..9f9331b90dd4 100644
--- a/nixpkgs/pkgs/development/libraries/libzip/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/lightning/default.nix b/nixpkgs/pkgs/development/libraries/lightning/default.nix
index 8a5026e307f6..24d99e691a28 100644
--- a/nixpkgs/pkgs/development/libraries/lightning/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lightning/default.nix
@@ -4,11 +4,11 @@ with stdenv.lib;
 stdenv.mkDerivation rec {
 
   pname = "lightning";
-  version = "2.1.2";
+  version = "2.1.3";
 
   src = fetchurl {
     url = "mirror://gnu/lightning/${pname}-${version}.tar.gz";
-    sha256 = "0sbs2lm8b9in2m8d52zf0x9gpp40x6r7sl6sha92yq3pr78rwa4v";
+    sha256 = "1jgxbq2cm51dzi3zhz38mmgwdcgs328mfl8iviw8dxn6dn36p1gd";
   };
 
   checkInputs = [ libopcodes ];
diff --git a/nixpkgs/pkgs/development/libraries/lightstep-tracer-cpp/default.nix b/nixpkgs/pkgs/development/libraries/lightstep-tracer-cpp/default.nix
index 7f82d49462c5..7fba3f3baa66 100644
--- a/nixpkgs/pkgs/development/libraries/lightstep-tracer-cpp/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/linbox/default.nix b/nixpkgs/pkgs/development/libraries/linbox/default.nix
index 70320ead5d11..709a237aed9b 100644
--- a/nixpkgs/pkgs/development/libraries/linbox/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/liquidfun/default.nix b/nixpkgs/pkgs/development/libraries/liquidfun/default.nix
index 2df7ef94cf36..74952456e642 100644
--- a/nixpkgs/pkgs/development/libraries/liquidfun/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/live555/default.nix b/nixpkgs/pkgs/development/libraries/live555/default.nix
index 57dcb3ee6a6a..84907a428605 100644
--- a/nixpkgs/pkgs/development/libraries/live555/default.nix
+++ b/nixpkgs/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.08.16";
+  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 = "1y77dc5qxd731w96x707iibavmkfayy5s557d7lasg742h36lcqv";
+    sha256 = "144y2wsfpaclkj7srx85f3y3parzn7vbjmzc2afc62wdsb9gn46d";
   };
 
   postPatch = ''
@@ -54,7 +54,8 @@ stdenv.mkDerivation rec {
 
   meta = with lib; {
     description = "Set of C++ libraries for multimedia streaming, using open standard protocols (RTP/RTCP, RTSP, SIP)";
-    homepage = http://www.live555.com/liveMedia/;
+    homepage = "http://www.live555.com/liveMedia/";
+    changelog = "http://www.live555.com/liveMedia/public/changelog.txt";
     license = licenses.lgpl21Plus;
     platforms = platforms.unix;
     broken = stdenv.hostPlatform.isAarch64;
diff --git a/nixpkgs/pkgs/development/libraries/lmdb/default.nix b/nixpkgs/pkgs/development/libraries/lmdb/default.nix
index 830ec7bdaee2..25bac68faf6a 100644
--- a/nixpkgs/pkgs/development/libraries/lmdb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lmdb/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   postUnpack = "sourceRoot=\${sourceRoot}/libraries/liblmdb";
 
   patches = [ ./hardcoded-compiler.patch ];
-  patchFlags = "-p3";
+  patchFlags = [ "-p3" ];
 
   outputs = [ "bin" "out" "dev" ];
 
diff --git a/nixpkgs/pkgs/development/libraries/log4cplus/default.nix b/nixpkgs/pkgs/development/libraries/log4cplus/default.nix
index cc86ab19379d..3a4b182dd94b 100644
--- a/nixpkgs/pkgs/development/libraries/log4cplus/default.nix
+++ b/nixpkgs/pkgs/development/libraries/log4cplus/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl }:
 
 let
-  name = "log4cplus-2.0.4";
+  name = "log4cplus-2.0.5";
 in
 stdenv.mkDerivation {
   inherit name;
 
   src = fetchurl {
     url = "mirror://sourceforge/log4cplus/${name}.tar.bz2";
-    sha256 = "0lh2i22znx573jchcfy4n5lrr9yjg2hd3iphhlih61zzmd67p2hc";
+    sha256 = "05gb0crf440da3vcaxavglzvsldw8hsvxq3xvvj73mzniv3bz3dk";
   };
 
   meta = {
diff --git a/nixpkgs/pkgs/development/libraries/mapnik/default.nix b/nixpkgs/pkgs/development/libraries/mapnik/default.nix
index 1feea915c025..53c4594f535b 100644
--- a/nixpkgs/pkgs/development/libraries/mapnik/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/mbedtls/1.3.nix b/nixpkgs/pkgs/development/libraries/mbedtls/1.3.nix
deleted file mode 100644
index 8b8d8cd0be80..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/mbedtls/default.nix b/nixpkgs/pkgs/development/libraries/mbedtls/default.nix
index a06d082b2269..603b9be610a1 100644
--- a/nixpkgs/pkgs/development/libraries/mbedtls/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mbedtls/default.nix
@@ -11,13 +11,14 @@
 
 stdenv.mkDerivation rec {
   pname = "mbedtls";
-  version = "2.17.0";
+  name = "mbedtls-${version}";
+  version = "2.16.3"; # nixpkgs-update: no auto update
 
   src = fetchFromGitHub {
     owner = "ARMmbed";
     repo = "mbedtls";
     rev = "${pname}-${version}";
-    sha256 = "1mk3xv61wvqqrzd6jnrz8csyfnwwwwpjzywj3fsfy99p51d7wqgw";
+    sha256 = "1mzh92yyz93099a1gb2wvwc76jv12d1k1wg9k3dimbgczxgrkirc";
   };
 
   nativeBuildInputs = [ cmake ninja perl python ];
diff --git a/nixpkgs/pkgs/development/libraries/mediastreamer/default.nix b/nixpkgs/pkgs/development/libraries/mediastreamer/default.nix
index 93e73a44bc9c..0204223d127c 100644
--- a/nixpkgs/pkgs/development/libraries/mediastreamer/default.nix
+++ b/nixpkgs/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,21 +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\""
+  NIX_CFLAGS_COMPILE = toString [
+    "-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/nixpkgs/pkgs/development/libraries/mediastreamer/msopenh264.nix b/nixpkgs/pkgs/development/libraries/mediastreamer/msopenh264.nix
index 38261bd1e53a..f1e9fc301510 100644
--- a/nixpkgs/pkgs/development/libraries/mediastreamer/msopenh264.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/mesa/default.nix b/nixpkgs/pkgs/development/libraries/mesa/default.nix
index cf1bdaf64323..761d6594bd01 100644
--- a/nixpkgs/pkgs/development/libraries/mesa/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mesa/default.nix
@@ -27,22 +27,22 @@
 with stdenv.lib;
 
 let
-  version = "19.1.5";
-  branch  = head (splitString "." version);
+  version = "19.3.1";
+  branch  = versions.major version;
 in
 
 stdenv.mkDerivation {
   pname = "mesa";
   inherit version;
 
-  src =  fetchurl {
+  src = fetchurl {
     urls = [
       "ftp://ftp.freedesktop.org/pub/mesa/mesa-${version}.tar.xz"
       "ftp://ftp.freedesktop.org/pub/mesa/${version}/mesa-${version}.tar.xz"
       "ftp://ftp.freedesktop.org/pub/mesa/older-versions/${branch}.x/${version}/mesa-${version}.tar.xz"
       "https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz"
     ];
-    sha256 = "1d3frncljickn5yi2ch1w2phwxhxpi6diyac3cbin9f76m7f2m3v";
+    sha256 = "0ndfpqry08s74yw4x3ydyhim6v4ywg0b4yhaazq7zaankjv1v5fd";
   };
 
   prePatch = "patchShebangs .";
@@ -167,7 +167,7 @@ stdenv.mkDerivation {
     substituteInPlace "$dev/lib/pkgconfig/dri.pc" --replace "$drivers" "${libglvnd.driverLink}"
 
     # remove pkgconfig files for GL/EGL; they are provided by libGL.
-    rm $dev/lib/pkgconfig/{gl,egl}.pc
+    rm -f $dev/lib/pkgconfig/{gl,egl}.pc
 
     # Update search path used by pkg-config
     for pc in $dev/lib/pkgconfig/{d3d,dri,xatracker}.pc; do
diff --git a/nixpkgs/pkgs/development/libraries/mesa/disk_cache-include-dri-driver-path-in-cache-key.patch b/nixpkgs/pkgs/development/libraries/mesa/disk_cache-include-dri-driver-path-in-cache-key.patch
index 1e280b64ee5f..8ce3473dd32f 100644
--- a/nixpkgs/pkgs/development/libraries/mesa/disk_cache-include-dri-driver-path-in-cache-key.patch
+++ b/nixpkgs/pkgs/development/libraries/mesa/disk_cache-include-dri-driver-path-in-cache-key.patch
@@ -1,4 +1,4 @@
-From 2a1e32b4105fe95413a615a44d40938920ea1a19 Mon Sep 17 00:00:00 2001
+From 6d22383149e4cdc646c68e29238f41d895a4705b Mon Sep 17 00:00:00 2001
 From: David McFarland <corngood@gmail.com>
 Date: Mon, 6 Aug 2018 15:52:11 -0300
 Subject: [PATCH] disk_cache: include dri driver path in cache key
@@ -12,10 +12,10 @@ timestamps in /nix/store are zero.
  3 files changed, 15 insertions(+), 1 deletion(-)
 
 diff --git a/meson_options.txt b/meson_options.txt
-index a723b5406cf..65a8954291f 100644
+index 626baf3..579c15b 100644
 --- a/meson_options.txt
 +++ b/meson_options.txt
-@@ -330,3 +330,9 @@ option(
+@@ -341,6 +341,12 @@ option(
    value : true,
    description : 'Enable direct rendering in GLX and EGL for DRI',
  )
@@ -25,11 +25,14 @@ index a723b5406cf..65a8954291f 100644
 +  value : '',
 +  description : 'Mesa cache key.'
 +)
+ option(
+   'I-love-half-baked-turnips',
+   type : 'boolean',
 diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
-index 0aa2646a9bb..bd784d38e21 100644
+index 0cd92ca..fc1c173 100644
 --- a/src/util/disk_cache.c
 +++ b/src/util/disk_cache.c
-@@ -389,8 +389,10 @@ disk_cache_create(const char *gpu_name, const char *driver_id,
+@@ -395,8 +395,10 @@ disk_cache_create(const char *gpu_name, const char *driver_id,
  
     /* Create driver id keys */
     size_t id_size = strlen(driver_id) + 1;
@@ -40,7 +43,7 @@ index 0aa2646a9bb..bd784d38e21 100644
     cache->driver_keys_blob_size += gpu_name_size;
  
     /* We sometimes store entire structs that contains a pointers in the cache,
-@@ -411,6 +413,7 @@ disk_cache_create(const char *gpu_name, const char *driver_id,
+@@ -417,6 +419,7 @@ disk_cache_create(const char *gpu_name, const char *driver_id,
     uint8_t *drv_key_blob = cache->driver_keys_blob;
     DRV_KEY_CPY(drv_key_blob, &cache_version, cv_size)
     DRV_KEY_CPY(drv_key_blob, driver_id, id_size)
@@ -49,13 +52,13 @@ index 0aa2646a9bb..bd784d38e21 100644
     DRV_KEY_CPY(drv_key_blob, &ptr_size, ptr_size_size)
     DRV_KEY_CPY(drv_key_blob, &driver_flags, driver_flags_size)
 diff --git a/src/util/meson.build b/src/util/meson.build
-index 397c2228129..77013563e5d 100644
+index f69ebe9..e2bd8e2 100644
 --- a/src/util/meson.build
 +++ b/src/util/meson.build
-@@ -120,7 +120,12 @@ libmesa_util = static_library(
+@@ -158,7 +158,12 @@ _libmesa_util = static_library(
    [files_mesa_util, format_srgb],
    include_directories : inc_common,
-   dependencies : [dep_zlib, dep_clock, dep_thread, dep_atomic, dep_m],
+   dependencies : deps_for_libmesa_util,
 -  c_args : [c_msvc_compat_args, c_vis_args],
 +  c_args : [
 +    c_msvc_compat_args, c_vis_args,
@@ -67,5 +70,5 @@ index 397c2228129..77013563e5d 100644
  )
  
 -- 
-2.19.2
+2.24.1
 
diff --git a/nixpkgs/pkgs/development/libraries/mesa/stubs.nix b/nixpkgs/pkgs/development/libraries/mesa/stubs.nix
index 5cb6ac3d4d13..a53f2dc28e77 100644
--- a/nixpkgs/pkgs/development/libraries/mesa/stubs.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/mimalloc/default.nix b/nixpkgs/pkgs/development/libraries/mimalloc/default.nix
index 728b41176766..b3f63ec7e9b9 100644
--- a/nixpkgs/pkgs/development/libraries/mimalloc/default.nix
+++ b/nixpkgs/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}";
-  version = "1.0.8";
+  pname   = "mimalloc";
+  version = "1.1.0";
 
   src = fetchFromGitHub {
     owner  = "microsoft";
-    repo   = "mimalloc";
+    repo   = pname;
     rev    = "refs/tags/v${version}";
-    sha256 = "04k2d3x84q2jfqdjxngy98hlw6czmigsqlf7gi3mhs6682n127r5";
+    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/nixpkgs/pkgs/development/libraries/minixml/default.nix b/nixpkgs/pkgs/development/libraries/minixml/default.nix
index 5bdacbba11d3..73b045aa9647 100644
--- a/nixpkgs/pkgs/development/libraries/minixml/default.nix
+++ b/nixpkgs/pkgs/development/libraries/minixml/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "mxml";
-  version = "3.0";
+  version = "3.1";
 
   src = fetchFromGitHub {
     owner = "michaelrsweet";
     repo = "mxml";
     rev = "v${version}";
-    sha256 = "0madp2v2md3xq96aham91byns6qy4byd5pbg28q827fdahfhpmq7";
+    sha256 = "1kv36fxxh7bwfydhb90zjgsrvpyzvx1p5d0ayfvd3j8gip2rjhnp";
   };
 
   enableParallelBuilding = true;
diff --git a/nixpkgs/pkgs/development/libraries/minizip/default.nix b/nixpkgs/pkgs/development/libraries/minizip/default.nix
index c88a978574a7..5ee1f38ca8b5 100644
--- a/nixpkgs/pkgs/development/libraries/minizip/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/mlt/default.nix b/nixpkgs/pkgs/development/libraries/mlt/default.nix
index 5099991c117f..b56e33e40241 100644
--- a/nixpkgs/pkgs/development/libraries/mlt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mlt/default.nix
@@ -6,13 +6,13 @@
 
 stdenv.mkDerivation rec {
   pname = "mlt";
-  version = "6.16.0";
+  version = "6.18.0";
 
   src = fetchFromGitHub {
     owner = "mltframework";
     repo = "mlt";
     rev = "v${version}";
-    sha256 = "1362fv63p34kza9v4b71b6wakgvsa2vdx9y0g28x3yh4cp4k97kx";
+    sha256 = "0iiqym15n8kbnjzj0asmm86gs23yykz0va5b475cc4v2vv5admgx";
   };
 
   buildInputs = [
@@ -24,8 +24,7 @@ stdenv.mkDerivation rec {
   # Mostly taken from:
   # http://www.kdenlive.org/user-manual/downloading-and-installing-kdenlive/installing-source/installing-mlt-rendering-engine
   configureFlags = [
-    "--avformat-swscale" "--enable-gpl" "--enable-gpl" "--enable-gpl3"
-    "--enable-opengl"
+    "--avformat-swscale" "--enable-gpl" "--enable-gpl3" "--enable-opengl"
   ];
 
   enableParallelBuilding = true;
@@ -43,7 +42,7 @@ stdenv.mkDerivation rec {
     description = "Open source multimedia framework, designed for television broadcasting";
     homepage = https://www.mltframework.org;
     license = licenses.gpl3;
-    maintainers = [ maintainers.tohl ];
+    maintainers = with maintainers; [ tohl peti ];
     platforms = platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/mlt/qt-5.nix b/nixpkgs/pkgs/development/libraries/mlt/qt-5.nix
index f017e4452a64..4d7ecd92e618 100644
--- a/nixpkgs/pkgs/development/libraries/mlt/qt-5.nix
+++ b/nixpkgs/pkgs/development/libraries/mlt/qt-5.nix
@@ -7,13 +7,13 @@ let inherit (stdenv.lib) getDev; in
 
 stdenv.mkDerivation rec {
   pname = "mlt";
-  version = "6.16.0";
+  version = "6.18.0";
 
   src = fetchFromGitHub {
     owner = "mltframework";
     repo = "mlt";
     rev = "v${version}";
-    sha256 = "1362fv63p34kza9v4b71b6wakgvsa2vdx9y0g28x3yh4cp4k97kx";
+    sha256 = "0iiqym15n8kbnjzj0asmm86gs23yykz0va5b475cc4v2vv5admgx";
   };
 
   buildInputs = [
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
 
   # mlt is unable to cope with our multi-prefix Qt build
   # because it does not use CMake or qmake.
-  NIX_CFLAGS_COMPILE = [ "-I${getDev qtsvg}/include/QtSvg" ];
+  NIX_CFLAGS_COMPILE = "-I${getDev qtsvg}/include/QtSvg";
 
   CXXFLAGS = "-std=c++11";
 
diff --git a/nixpkgs/pkgs/development/libraries/mm-common/default.nix b/nixpkgs/pkgs/development/libraries/mm-common/default.nix
index f590653df6ba..9a789a58ccac 100644
--- a/nixpkgs/pkgs/development/libraries/mm-common/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mm-common/default.nix
@@ -1,14 +1,26 @@
-{ stdenv, fetchurl, gnome3 }:
+{ stdenv
+, fetchurl
+, gnome3
+, meson
+, python3
+, ninja
+}:
 
 stdenv.mkDerivation rec {
   pname = "mm-common";
-  version = "0.9.12";
+  version = "1.0.0";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "02vwgv404b56wxy0gnm9xq9fvzgn9dhfqcy2hhl78ljv3v7drzyf";
+    sha256 = "1m4w33da9f4rx2d6kdj3ix3kl0gn16ml82v2mdn4hljr3q29nzdr";
   };
 
+  nativeBuildInputs = [
+    meson
+    python3
+    ninja
+  ];
+
   passthru = {
     updateScript = gnome3.updateScript {
       packageName = pname;
@@ -25,7 +37,7 @@ stdenv.mkDerivation rec {
       control repository. An installation of mm-common is not required for
       building tarball releases, unless configured to use maintainer-mode.
     '';
-    homepage = https://www.gtkmm.org;
+    homepage = "https://www.gtkmm.org";
     license = licenses.gpl2Plus;
     maintainers = gnome3.maintainers;
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/mpich/default.nix b/nixpkgs/pkgs/development/libraries/mpich/default.nix
index 2232bfb9a38b..21803de5e062 100644
--- a/nixpkgs/pkgs/development/libraries/mpich/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/mps/default.nix b/nixpkgs/pkgs/development/libraries/mps/default.nix
index ec3b4e201477..8c1f3aea4667 100644
--- a/nixpkgs/pkgs/development/libraries/mps/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mps/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ sqlite ];
 
   # needed for 1.116.0 to build with gcc7
-  NIX_CFLAGS_COMPILE = [
+  NIX_CFLAGS_COMPILE = toString [
     "-Wno-implicit-fallthrough"
     "-Wno-error=clobbered"
     "-Wno-error=cast-function-type"
diff --git a/nixpkgs/pkgs/development/libraries/muparser/default.nix b/nixpkgs/pkgs/development/libraries/muparser/default.nix
index d058322660cf..4d3fe41dff82 100644
--- a/nixpkgs/pkgs/development/libraries/muparser/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/mygui/default.nix b/nixpkgs/pkgs/development/libraries/mygui/default.nix
index 0907f0174c99..c277b7934b9b 100644
--- a/nixpkgs/pkgs/development/libraries/mygui/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/nanoflann/default.nix b/nixpkgs/pkgs/development/libraries/nanoflann/default.nix
index 5c0238fe41ea..8480cc868c1f 100644
--- a/nixpkgs/pkgs/development/libraries/nanoflann/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/nco/default.nix b/nixpkgs/pkgs/development/libraries/nco/default.nix
index c842eac4311e..7b03c32ada58 100644
--- a/nixpkgs/pkgs/development/libraries/nco/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/ncurses/default.nix b/nixpkgs/pkgs/development/libraries/ncurses/default.nix
index 708ba46b42eb..540ea71abfb8 100644
--- a/nixpkgs/pkgs/development/libraries/ncurses/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/ndi/default.nix b/nixpkgs/pkgs/development/libraries/ndi/default.nix
new file mode 100644
index 000000000000..fcf9457c691c
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/netcdf/default.nix b/nixpkgs/pkgs/development/libraries/netcdf/default.nix
index 0c597fc4b335..1436fb021271 100644
--- a/nixpkgs/pkgs/development/libraries/netcdf/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/nettle/default.nix b/nixpkgs/pkgs/development/libraries/nettle/default.nix
index 900451351c82..36c9f0e6ac75 100644
--- a/nixpkgs/pkgs/development/libraries/nettle/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nettle/default.nix
@@ -1,10 +1,10 @@
 { callPackage, fetchurl, ... } @ args:
 
 callPackage ./generic.nix (args // rec {
-  version = "3.4.1";
+  version = "3.5.1";
 
   src = fetchurl {
     url = "mirror://gnu/nettle/nettle-${version}.tar.gz";
-    sha256 = "1bcji95n1iz9p9vsgdgr26v6s7zhpsxfbjjwpqcihpfd6lawyhgr";
+    sha256 = "06clvkdfxhlbagn4afssylmn5vrak59dlmnvy8b2xc31hycs3k3m";
   };
 })
diff --git a/nixpkgs/pkgs/development/libraries/nghttp2/default.nix b/nixpkgs/pkgs/development/libraries/nghttp2/default.nix
index d02247196b1a..57ed58912751 100644
--- a/nixpkgs/pkgs/development/libraries/nghttp2/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix b/nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix
index 129cc7ed84c3..43a7cf15c15b 100644
--- a/nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   pname = "nlohmann_json";
-  version = "3.6.1";
+  version = "3.7.3";
 
   src = fetchFromGitHub {
     owner = "nlohmann";
     repo = "json";
     rev = "v${version}";
-    sha256 = "1dgx3j9pb0f52dh73z8dpwdy79bra1qi5vpl66b9inq4gamf813z";
+    sha256 = "04rry1xzis71z5gj1ylcj8b4li5q18zxhcwaviwvi3hx0frzxl9w";
   };
 
   nativeBuildInputs = [ cmake ];
@@ -18,9 +18,14 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [
     "-DBuildTests=${if doCheck then "ON" else "OFF"}"
+    "-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";
 
   meta = with stdenv.lib; {
     description = "Header only C++ library for the JSON file format";
diff --git a/nixpkgs/pkgs/development/libraries/nspr/default.nix b/nixpkgs/pkgs/development/libraries/nspr/default.nix
index b62fa1cb704f..44195ce325ba 100644
--- a/nixpkgs/pkgs/development/libraries/nspr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nspr/default.nix
@@ -2,7 +2,7 @@
 , CoreServices ? null
 , buildPackages }:
 
-let version = "4.21"; 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 = "0nkbgk0x31nfm4xl8la0a3vrnpa8gzkh7g4k65p7n880n73k5shm";
+    sha256 = "1l0ksiny032jijgk0g76wf0kiq673i01izj7jrs2h5d1yq6rm9ch";
   };
 
   patches = [
diff --git a/nixpkgs/pkgs/development/libraries/nss/default.nix b/nixpkgs/pkgs/development/libraries/nss/default.nix
index b6b1d406eacd..2e611c8975d7 100644
--- a/nixpkgs/pkgs/development/libraries/nss/default.nix
+++ b/nixpkgs/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";
+  version = "3.48";
   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 = "1vqcl6wxn2nsm2fmlwzmxyagrsj1p1y9bc54b2i2nq45s94rcsbb";
+    sha256 = "1b7qs1q7jqhw9dvkdznanzhc5dyq4bwx0biywszy3qx4hqm8571z";
   };
 
   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 =
@@ -37,7 +38,7 @@ in stdenv.mkDerivation rec {
       ./ckpem.patch
     ];
 
-  patchFlags = "-p0";
+  patchFlags = [ "-p0" ];
 
   postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
     substituteInPlace nss/coreconf/Darwin.mk --replace '@executable_path/$(notdir $@)' "$out/lib/\$(notdir \$@)"
diff --git a/nixpkgs/pkgs/development/libraries/nss_wrapper/default.nix b/nixpkgs/pkgs/development/libraries/nss_wrapper/default.nix
index 79eb4d1e10e4..40ee4f890d49 100644
--- a/nixpkgs/pkgs/development/libraries/nss_wrapper/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/nsss/default.nix b/nixpkgs/pkgs/development/libraries/nsss/default.nix
index cd1205e2c7d4..5c8bf8dedc1e 100644
--- a/nixpkgs/pkgs/development/libraries/nsss/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nsss/default.nix
@@ -4,8 +4,8 @@ with skawarePackages;
 
 buildPackage {
   pname = "nsss";
-  version = "0.0.1.1";
-  sha256 = "14y1vl7n8vd5fh9bwiwwxxslisli8pz3a2f1sfv12l0p8ngpgm57";
+  version = "0.0.2.1";
+  sha256 = "1arzl4492wv42rvv6xs8h5d3qpy9nwxv5l84inzabs6s9f9nlxax";
 
   description = "An implementation of a subset of the pwd.h, group.h and shadow.h family of functions.";
 
diff --git a/nixpkgs/pkgs/development/libraries/ntl/default.nix b/nixpkgs/pkgs/development/libraries/ntl/default.nix
index e83fe2e7e7b6..a4d1e275a0a8 100644
--- a/nixpkgs/pkgs/development/libraries/ntl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ntl/default.nix
@@ -14,11 +14,11 @@ assert withGf2x -> gf2x != null;
 
 stdenv.mkDerivation rec {
   pname = "ntl";
-  version = "11.3.2";
+  version = "11.4.3";
 
   src = fetchurl {
     url = "http://www.shoup.net/ntl/ntl-${version}.tar.gz";
-    sha256 = "17bfsvn72zjqfibnxscyf4hbk3inndh4r89jd2zg7mgqmd2k3fl4";
+    sha256 = "1lisp3064rch3jaa2wrhy1s9kll7i3ka3d0y6lj6l3l4ckfcrhdp";
   };
 
   buildInputs = [
@@ -67,6 +67,8 @@ stdenv.mkDerivation rec {
     # Upstream contact: maintainer is victorshoup on GitHub. Alternatively the
     # email listed on the homepage.
     homepage = http://www.shoup.net/ntl/;
+    # also locally at "${src}/doc/tour-changes.html";
+    changelog = "https://www.shoup.net/ntl/doc/tour-changes.html";
     maintainers = with maintainers; [ timokau ];
     license = licenses.gpl2Plus;
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/ntrack/default.nix b/nixpkgs/pkgs/development/libraries/ntrack/default.nix
index b79f940affa3..803906b13437 100644
--- a/nixpkgs/pkgs/development/libraries/ntrack/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ntrack/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig python ];
 
   # error: ISO C does not support '__FUNCTION__' predefined identifier [-Werror=pedantic]
-  NIX_CFLAGS_COMPILE = [ "-Wno-error" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error";
 
   configureFlags = [ "--without-gobject" "CFLAGS=--std=gnu99" ];
 
diff --git a/nixpkgs/pkgs/development/libraries/nuspell/default.nix b/nixpkgs/pkgs/development/libraries/nuspell/default.nix
index db542ec93a92..c1f354a1ac98 100644
--- a/nixpkgs/pkgs/development/libraries/nuspell/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/nvidia-texture-tools/default.nix b/nixpkgs/pkgs/development/libraries/nvidia-texture-tools/default.nix
index 73b5e3fe772e..70c48631981f 100644
--- a/nixpkgs/pkgs/development/libraries/nvidia-texture-tools/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nvidia-texture-tools/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "nvidia-texture-tools";
-  version = "2.1.0";
+  version = "unstable-2019-10-27";
 
   src = fetchFromGitHub {
     owner = "castano";
     repo = "nvidia-texture-tools";
-    rev = version;
-    sha256 = "0p8ja0k323nkgm07z0qlslg6743vimy9rf3wad2968az0vwzjjyx";
+    rev = "a131e4c6b0b7c9c73ccc3c9e6f1c7e165be86bcc";
+    sha256 = "1qzyr3ib5dpxyq1y33lq02qv4cww075sm9bm4f651d34q5x38sk3";
   };
 
   nativeBuildInputs = [ cmake ];
@@ -37,5 +37,6 @@ stdenv.mkDerivation rec {
     homepage = https://github.com/castano/nvidia-texture-tools;
     license = licenses.mit;
     platforms = platforms.unix;
+    broken = stdenv.isAarch64;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/ogre/1.10.x.nix b/nixpkgs/pkgs/development/libraries/ogre/1.10.x.nix
index d847f447048d..b66759524faf 100644
--- a/nixpkgs/pkgs/development/libraries/ogre/1.10.x.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/ogre/1.9.x.nix b/nixpkgs/pkgs/development/libraries/ogre/1.9.x.nix
index 2855d1139c3d..ced015801859 100644
--- a/nixpkgs/pkgs/development/libraries/ogre/1.9.x.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/ogre/default.nix b/nixpkgs/pkgs/development/libraries/ogre/default.nix
index dc3bf8cf0097..235da872392d 100644
--- a/nixpkgs/pkgs/development/libraries/ogre/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/ois/default.nix b/nixpkgs/pkgs/development/libraries/ois/default.nix
index 15e83cf9d769..c1b065dbf2b4 100644
--- a/nixpkgs/pkgs/development/libraries/ois/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ois/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  patchFlags = "-p0";
+  patchFlags = [ "-p0" ];
 
   buildInputs = [
     autoconf automake libtool libX11 xorgproto libXi libXaw
diff --git a/nixpkgs/pkgs/development/libraries/olm/default.nix b/nixpkgs/pkgs/development/libraries/olm/default.nix
index dd3f83a0130d..8fbdf28965bf 100644
--- a/nixpkgs/pkgs/development/libraries/olm/default.nix
+++ b/nixpkgs/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;
@@ -22,7 +15,16 @@ stdenv.mkDerivation rec {
   # requires optimisation but memory operations are compiled with -O0
   hardeningDisable = ["fortify"];
 
-  makeFlags = if stdenv.cc.isClang then [ "CC=cc" ] else null;
+  makeFlags = stdenv.lib.optional stdenv.cc.isClang "CC=cc";
 
-  installFlags = "PREFIX=$(out)";
+  installFlags = [
+    "PREFIX=${placeholder ''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/nixpkgs/pkgs/development/libraries/oniguruma/default.nix b/nixpkgs/pkgs/development/libraries/oniguruma/default.nix
index 8a1e1d37c1d5..e4cbfc7f0b4f 100644
--- a/nixpkgs/pkgs/development/libraries/oniguruma/default.nix
+++ b/nixpkgs/pkgs/development/libraries/oniguruma/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "onig";
-  version = "6.9.3";
+  version = "6.9.4";
 
   src = fetchFromGitHub {
     owner = "kkos";
     repo = "oniguruma";
     rev = "v${version}";
-    sha256 = "0wzmqpjmxpryk83acbyhl9gwgm43ixbwraga2g5li9kx88mv4k0n";
+    sha256 = "11imbhj4p5w8lvrmcczccm1zq014h9j85r51z2ibb8jhf5p3lslh";
   };
 
   nativeBuildInputs = [ cmake ];
@@ -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/nixpkgs/pkgs/development/libraries/onnxruntime/default.nix b/nixpkgs/pkgs/development/libraries/onnxruntime/default.nix
new file mode 100644
index 000000000000..33bc4c6e82c2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/onnxruntime/default.nix
@@ -0,0 +1,67 @@
+{ stdenv, fetchFromGitHub, glibcLocales
+, cmake, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "onnxruntime";
+  version = "1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "microsoft";
+    repo = "onnxruntime";
+    rev = "v${version}";
+    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
+    fetchSubmodules = true;
+  };
+
+  # TODO: build server, and move .so's to lib output
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [
+    cmake
+    python3 # for shared-lib or server
+  ];
+
+  cmakeDir = "../cmake";
+
+  cmakeFlags = [
+    "-Donnxruntime_USE_OPENMP=ON"
+    "-Donnxruntime_BUILD_SHARED_LIB=ON"
+    "-Donnxruntime_ENABLE_LTO=ON"
+  ];
+
+  # ContribOpTest.StringNormalizerTest sets locale to en_US.UTF-8"
+  preCheck = stdenv.lib.optionalString stdenv.isLinux ''
+    export LOCALE_ARCHIVE="${glibcLocales}/lib/locale/locale-archive"
+  '';
+  doCheck = true;
+
+  postInstall = ''
+    rm -r $out/bin   # ctest runner
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Cross-platform, high performance scoring engine for ML models";
+    longDescription = ''
+      ONNX Runtime is a performance-focused complete scoring engine
+      for Open Neural Network Exchange (ONNX) models, with an open
+      extensible architecture to continually address the latest developments
+      in AI and Deep Learning. ONNX Runtime stays up to date with the ONNX
+      standard with complete implementation of all ONNX operators, and
+      supports all ONNX releases (1.2+) with both future and backwards
+      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/nixpkgs/pkgs/development/libraries/opae/default.nix b/nixpkgs/pkgs/development/libraries/opae/default.nix
index 32b131159572..46b03720d16c 100644
--- a/nixpkgs/pkgs/development/libraries/opae/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opae/default.nix
@@ -20,6 +20,11 @@ stdenv.mkDerivation rec {
 
   doCheck = false;
 
+  NIX_CFLAGS_COMPILE = [
+    "-Wno-error=format-truncation"
+    "-Wno-error=address-of-packed-member"
+  ];
+
   nativeBuildInputs = [ cmake doxygen perl python2Packages.sphinx ];
   buildInputs = [ libuuid json_c python2 ];
 
diff --git a/nixpkgs/pkgs/development/libraries/opal/default.nix b/nixpkgs/pkgs/development/libraries/opal/default.nix
deleted file mode 100644
index dd19fccd822a..000000000000
--- a/nixpkgs/pkgs/development/libraries/opal/default.nix
+++ /dev/null
@@ -1,43 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, ptlib, srtp, libtheora, speex, gnome3
-, ffmpeg, x264, cyrus_sasl, openldap, openssl, expat, unixODBC }:
-
-stdenv.mkDerivation rec {
-  pname = "opal";
-  version = "3.10.10";
-
-  src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "f208985003461b2743575eccac13ad890b3e5baac35b68ddef17162460aff864";
-  };
-
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ ptlib srtp libtheora speex
-                  ffmpeg x264 cyrus_sasl openldap openssl expat unixODBC ];
-  propagatedBuildInputs = [ speex ];
-
-  configureFlags = [ "--enable-h323" ];
-
-  enableParallelBuilding = true;
-
-  NIX_CFLAGS_COMPILE = "-D__STDC_CONSTANT_MACROS=1 -std=gnu++98";
-
-  patches = [ ./disable-samples-ftbfs.diff ./libav9.patch ./libav10.patch ];
-
-  meta = with stdenv.lib; {
-    description = "VoIP library";
-    maintainers = [ maintainers.raskin ];
-    platforms = platforms.linux;
-    homepage = "http://www.opalvoip.org/";
-    license = with licenses; [ bsdOriginal mpl10 gpl2Plus lgpl21 ];
-  };
-
-  passthru = {
-    updateInfo = {
-      downloadPage = "http://ftp.gnome.org/pub/GNOME/sources/opal";
-    };
-    updateScript = gnome3.updateScript {
-      packageName = pname;
-    };
-  };
-}
-
diff --git a/nixpkgs/pkgs/development/libraries/opal/disable-samples-ftbfs.diff b/nixpkgs/pkgs/development/libraries/opal/disable-samples-ftbfs.diff
deleted file mode 100644
index 1b0738216079..000000000000
--- a/nixpkgs/pkgs/development/libraries/opal/disable-samples-ftbfs.diff
+++ /dev/null
@@ -1,14 +0,0 @@
-Index: opal-3.10.4~dfsg/Makefile.in
-===================================================================
---- opal-3.10.4~dfsg.orig/Makefile.in	2012-02-22 10:08:36.000000000 +1100
-+++ opal-3.10.4~dfsg/Makefile.in	2012-03-08 08:32:44.000000000 +1100
-@@ -45,8 +45,7 @@
-            samples/codectest \
-            samples/callgen \
-            samples/opalecho \
--           samples/faxopal \
--           samples/c_api
-+           samples/faxopal 
- ifeq ($(OPAL_IVR),yes)
- SUBDIRS += samples/opalmcu \
-            samples/ivropal \
diff --git a/nixpkgs/pkgs/development/libraries/opal/libav10.patch b/nixpkgs/pkgs/development/libraries/opal/libav10.patch
deleted file mode 100644
index 3e02704f8998..000000000000
--- a/nixpkgs/pkgs/development/libraries/opal/libav10.patch
+++ /dev/null
@@ -1,208 +0,0 @@
-Description: Fix compilation against libav10 
-Author: Reinhard Tartler <siretart@tauware.de>
-Bug-Debian: http://bugs.debian.org/739439
-
---- a/plugins/video/H.263-1998/h263-1998.cxx
-+++ b/plugins/video/H.263-1998/h263-1998.cxx
-@@ -94,7 +94,7 @@ static struct StdSizes {
-   { CIF16_WIDTH, CIF16_HEIGHT, PLUGINCODEC_CIF16_MPI },
- };
- 
--static FFMPEGLibrary FFMPEGLibraryInstance(CODEC_ID_H263P);
-+static FFMPEGLibrary FFMPEGLibraryInstance(AV_CODEC_ID_H263P);
- 
- 
- /////////////////////////////////////////////////////////////////////////////
-@@ -203,7 +203,7 @@ H263_Base_EncoderContext::~H263_Base_Enc
-   PTRACE(4, m_prefix, "Encoder closed");
- }
- 
--bool H263_Base_EncoderContext::Init(CodecID codecId)
-+bool H263_Base_EncoderContext::Init(AVCodecID codecId)
- {
-   PTRACE(5, m_prefix, "Opening encoder");
- 
-@@ -589,7 +589,7 @@ void H263_RFC2190_EncoderContext::RTPCal
- 
- bool H263_RFC2190_EncoderContext::Init()
- {
--  if (!H263_Base_EncoderContext::Init(CODEC_ID_H263))
-+  if (!H263_Base_EncoderContext::Init(AV_CODEC_ID_H263))
-     return false;
- 
- #if LIBAVCODEC_RTP_MODE
-@@ -632,7 +632,7 @@ H263_RFC2429_EncoderContext::~H263_RFC24
- 
- bool H263_RFC2429_EncoderContext::Init()
- {
--  return H263_Base_EncoderContext::Init(CODEC_ID_H263P);
-+  return H263_Base_EncoderContext::Init(AV_CODEC_ID_H263P);
- }
- 
- 
-@@ -656,7 +656,7 @@ H263_Base_DecoderContext::H263_Base_Deco
-   if (!FFMPEGLibraryInstance.Load())
-     return;
- 
--  if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(CODEC_ID_H263)) == NULL) {
-+  if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(AV_CODEC_ID_H263)) == NULL) {
-     PTRACE(1, m_prefix, "Codec not found for decoder");
-     return;
-   }
---- a/plugins/video/H.264/h264-x264.cxx
-+++ b/plugins/video/H.264/h264-x264.cxx
-@@ -105,7 +105,7 @@ static struct PluginCodec_information Li
- 
- ///////////////////////////////////////////////////////////////////////////////
- 
--FFMPEGLibrary FFMPEGLibraryInstance(CODEC_ID_H264);
-+FFMPEGLibrary FFMPEGLibraryInstance(AV_CODEC_ID_H264);
- 
- PLUGINCODEC_CONTROL_LOG_FUNCTION_DEF
- 
-@@ -1065,17 +1065,17 @@ class MyDecoder : public PluginCodec<MY_
-          allows you to fail the create operation (return false), which cannot
-          be done in the normal C++ constructor. */
- 
--      if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(CODEC_ID_H264)) == NULL)
-+      if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(AV_CODEC_ID_H264)) == NULL)
-         return false;
- 
-       if ((m_context = FFMPEGLibraryInstance.AvcodecAllocContext(m_codec)) == NULL)
-         return false;
- 
-       m_context->workaround_bugs = FF_BUG_AUTODETECT;
--      m_context->idct_algo = FF_IDCT_H264;
-+      m_context->idct_algo = FF_IDCT_AUTO;
-       m_context->error_concealment = FF_EC_GUESS_MVS | FF_EC_DEBLOCK;
-       m_context->flags = CODEC_FLAG_INPUT_PRESERVED | CODEC_FLAG_EMU_EDGE;
--      m_context->flags2 = CODEC_FLAG2_SKIP_RD |
-+      m_context->flags2 = 
- #ifdef CODEC_FLAG2_DROP_FRAME_TIMECODE
-                           CODEC_FLAG2_DROP_FRAME_TIMECODE |
- #endif
---- a/plugins/video/MPEG4-ffmpeg/mpeg4.cxx
-+++ b/plugins/video/MPEG4-ffmpeg/mpeg4.cxx
-@@ -205,7 +205,7 @@ const static struct mpeg4_resolution {
-     { 0 }
- };
- 
--FFMPEGLibrary FFMPEGLibraryInstance(CODEC_ID_MPEG4);
-+FFMPEGLibrary FFMPEGLibraryInstance(AV_CODEC_ID_MPEG4);
- 
- 
- static bool mpeg4IsIframe (BYTE * frameBuffer, unsigned int frameLen )
-@@ -688,7 +688,7 @@ void MPEG4EncoderContext::ResizeEncoding
- 
- bool MPEG4EncoderContext::OpenCodec()
- {
--  if((m_avcodec = FFMPEGLibraryInstance.AvcodecFindEncoder(CODEC_ID_MPEG4)) == NULL){
-+  if((m_avcodec = FFMPEGLibraryInstance.AvcodecFindEncoder(AV_CODEC_ID_MPEG4)) == NULL){
-     PTRACE(1, "MPEG4", "Encoder not found");
-     return false;
-   }
-@@ -1390,7 +1390,7 @@ void MPEG4DecoderContext::ResizeDecoding
- 
- bool MPEG4DecoderContext::OpenCodec()
- {
--    if ((m_avcodec = FFMPEGLibraryInstance.AvcodecFindDecoder(CODEC_ID_MPEG4)) == NULL) {
-+    if ((m_avcodec = FFMPEGLibraryInstance.AvcodecFindDecoder(AV_CODEC_ID_MPEG4)) == NULL) {
-         PTRACE(1, "MPEG4", "Decoder not found for encoder");
-         return false;
-     }
---- a/plugins/video/H.263-1998/h263-1998.h
-+++ b/plugins/video/H.263-1998/h263-1998.h
-@@ -115,7 +115,7 @@ class H263_Base_EncoderContext
-     virtual ~H263_Base_EncoderContext();
- 
-     virtual bool Init() = 0;
--    virtual bool Init(CodecID codecId);
-+    virtual bool Init(AVCodecID codecId);
- 
-     virtual bool SetOptions(const char * const * options);
-     virtual void SetOption(const char * option, const char * value);
---- a/plugins/video/common/dyna.cxx
-+++ b/plugins/video/common/dyna.cxx
-@@ -217,14 +217,14 @@ static void logCallbackFFMPEG(void * avc
- #endif
- 
- 
--FFMPEGLibrary::FFMPEGLibrary(CodecID codec)
-+FFMPEGLibrary::FFMPEGLibrary(AVCodecID codec)
- {
-   m_codec = codec;
--  if (m_codec==CODEC_ID_H264)
-+  if (m_codec==AV_CODEC_ID_H264)
-       snprintf( m_codecString, sizeof(m_codecString), "H264");
--  if (m_codec==CODEC_ID_H263P)
-+  if (m_codec==AV_CODEC_ID_H263P)
-       snprintf( m_codecString, sizeof(m_codecString), "H263+");
--  if (m_codec==CODEC_ID_MPEG4)
-+  if (m_codec==AV_CODEC_ID_MPEG4)
-       snprintf( m_codecString, sizeof(m_codecString), "MPEG4");
-   m_isLoadedOK = false;
- }
-@@ -268,12 +268,12 @@ bool FFMPEGLibrary::Load()
-   return true;
- }
- 
--AVCodec *FFMPEGLibrary::AvcodecFindEncoder(enum CodecID id)
-+AVCodec *FFMPEGLibrary::AvcodecFindEncoder(enum AVCodecID id)
- {
-   return avcodec_find_encoder(id);
- }
- 
--AVCodec *FFMPEGLibrary::AvcodecFindDecoder(enum CodecID id)
-+AVCodec *FFMPEGLibrary::AvcodecFindDecoder(enum AVCodecID id)
- {
-   WaitAndSignal m(processLock);
- 
-@@ -308,13 +308,18 @@ int FFMPEGLibrary::AvcodecClose(AVCodecC
-   return avcodec_close(ctx);
- }
- 
-+#undef  FFMAX
-+#define FFMAX(a,b) ((a) > (b) ? (a) : (b)) 
- int FFMPEGLibrary::AvcodecEncodeVideo(AVCodecContext *ctx, BYTE *buf, int buf_size, const AVFrame *pict)
- {
-+  AVPacket pkt = { 0 };
-+  int ret, got_output;
-   int res;
- 
--  res = avcodec_encode_video(ctx, buf, buf_size, pict);
-+  ret = avcodec_encode_video2(ctx, &pkt, pict, &got_output);
- 
--  PTRACE(6, m_codecString, "DYNA\tEncoded into " << res << " bytes, max " << buf_size);
-+  PTRACE(6, m_codecString, "DYNA\tEncoded into " << ret << " bytes, max " << buf_size);
-+  memcpy(buf, pkt.data, FFMAX(pkt.size, buf_size));
-   return res;
- }
- 
---- a/plugins/video/common/dyna.h
-+++ b/plugins/video/common/dyna.h
-@@ -88,13 +88,13 @@ class DynaLink
- class FFMPEGLibrary 
- {
-   public:
--    FFMPEGLibrary(CodecID codec);
-+    FFMPEGLibrary(AVCodecID codec);
-     ~FFMPEGLibrary();
- 
-     bool Load();
- 
--    AVCodec *AvcodecFindEncoder(enum CodecID id);
--    AVCodec *AvcodecFindDecoder(enum CodecID id);
-+    AVCodec *AvcodecFindEncoder(enum AVCodecID id);
-+    AVCodec *AvcodecFindDecoder(enum AVCodecID id);
-     AVCodecContext *AvcodecAllocContext(AVCodec*);
-     AVFrame *AvcodecAllocFrame(void);
-     int AvcodecOpen(AVCodecContext *ctx, AVCodec *codec);
-@@ -117,7 +117,7 @@ class FFMPEGLibrary
-     DynaLink m_libAvcodec;
-     DynaLink m_libAvutil;
- 
--    CodecID m_codec;
-+    AVCodecID m_codec;
-     char m_codecString[32];
- 
-     bool m_isLoadedOK;
diff --git a/nixpkgs/pkgs/development/libraries/opal/libav9.patch b/nixpkgs/pkgs/development/libraries/opal/libav9.patch
deleted file mode 100644
index f91a8c033fe3..000000000000
--- a/nixpkgs/pkgs/development/libraries/opal/libav9.patch
+++ /dev/null
@@ -1,543 +0,0 @@
-Description: Backport changes for the libav 9 API
- Also replace loading of libavcodec and libavutil via dlopen by linking against
- it.
-Author: Sebastian Ramacher <sramacher@debian.org>
-Bug-Debian: http://bugs.debian.org/720824
-Last-Update: 2013-09-12
-
---- a/plugins/video/H.263-1998/h263-1998.cxx
-+++ b/plugins/video/H.263-1998/h263-1998.cxx
-@@ -216,7 +216,7 @@
-     return false;
-   }
- 
--  m_context = FFMPEGLibraryInstance.AvcodecAllocContext();
-+  m_context = FFMPEGLibraryInstance.AvcodecAllocContext(m_codec);
-   if (m_context == NULL) {
-     PTRACE(1, m_prefix, "Failed to allocate context for encoder");
-     return false;
-@@ -312,6 +312,7 @@
-     return;
-   }
- 
-+#ifdef CODEC_FLAG_H263P_UMV
-   if (STRCMPI(option, H263_ANNEX_D) == 0) {
-     // Annex D: Unrestructed Motion Vectors
-     // Level 2+ 
-@@ -322,6 +323,7 @@
-       m_context->flags &= ~CODEC_FLAG_H263P_UMV; 
-     return;
-   }
-+#endif
- 
- #if 0 // DO NOT ENABLE THIS FLAG. FFMPEG IS NOT THREAD_SAFE WHEN THIS FLAG IS SET
-   if (STRCMPI(option, H263_ANNEX_F) == 0) {
-@@ -356,6 +358,7 @@
-     return;
-   }
- 
-+#ifdef CODEC_FLAG_H263P_SLICE_STRUCT
-   if (STRCMPI(option, H263_ANNEX_K) == 0) {
-     // Annex K: Slice Structure
-     // does not work with eyeBeam
-@@ -365,7 +368,9 @@
-       m_context->flags &= ~CODEC_FLAG_H263P_SLICE_STRUCT; 
-     return;
-   }
-+#endif
- 
-+#ifdef CODEC_FLAG_H263P_AIV
-   if (STRCMPI(option, H263_ANNEX_S) == 0) {
-     // Annex S: Alternative INTER VLC mode
-     // does not work with eyeBeam
-@@ -375,6 +380,7 @@
-       m_context->flags &= ~CODEC_FLAG_H263P_AIV; 
-     return;
-   }
-+#endif
- 
-   if (STRCMPI(option, PLUGINCODEC_MEDIA_PACKETIZATION) == 0 ||
-       STRCMPI(option, PLUGINCODEC_MEDIA_PACKETIZATIONS) == 0) {
-@@ -450,15 +456,6 @@
-   PTRACE(5, m_prefix, "qmax set to " << m_context->qmax);
-   PTRACE(5, m_prefix, "payload size set to " << m_context->rtp_payload_size);
- 
--  #define CODEC_TRACER_FLAG(tracer, flag) \
--    PTRACE(4, m_prefix, #flag " is " << ((m_context->flags & flag) ? "enabled" : "disabled"));
--  CODEC_TRACER_FLAG(tracer, CODEC_FLAG_H263P_UMV);
--  CODEC_TRACER_FLAG(tracer, CODEC_FLAG_OBMC);
--  CODEC_TRACER_FLAG(tracer, CODEC_FLAG_AC_PRED);
--  CODEC_TRACER_FLAG(tracer, CODEC_FLAG_H263P_SLICE_STRUCT)
--  CODEC_TRACER_FLAG(tracer, CODEC_FLAG_LOOP_FILTER);
--  CODEC_TRACER_FLAG(tracer, CODEC_FLAG_H263P_AIV);
--
-   return FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec) == 0;
- }
- 
-@@ -521,7 +518,7 @@
- 
-     // Need to copy to local buffer to guarantee 16 byte alignment
-     memcpy(m_inputFrame->data[0], OPAL_VIDEO_FRAME_DATA_PTR(header), header->width*header->height*3/2);
--    m_inputFrame->pict_type = (flags & PluginCodec_CoderForceIFrame) ? FF_I_TYPE : AV_PICTURE_TYPE_NONE;
-+    m_inputFrame->pict_type = (flags & PluginCodec_CoderForceIFrame) ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_NONE;
- 
-     /*
-     m_inputFrame->pts = (int64_t)srcRTP.GetTimestamp()*m_context->time_base.den/m_context->time_base.num/VIDEO_CLOCKRATE;
-@@ -603,13 +600,19 @@
-   m_context->rtp_callback = &H263_RFC2190_EncoderContext::RTPCallBack;
-   m_context->opaque = this; // used to separate out packets from different encode threads
- 
-+#ifdef CODEC_FLAG_H263P_UMV
-   m_context->flags &= ~CODEC_FLAG_H263P_UMV;
-+#endif
-   m_context->flags &= ~CODEC_FLAG_4MV;
- #if LIBAVCODEC_RTP_MODE
-   m_context->flags &= ~CODEC_FLAG_H263P_AIC;
- #endif
-+#ifdef CODEC_FLAG_H263P_AIV
-   m_context->flags &= ~CODEC_FLAG_H263P_AIV;
-+#endif
-+#ifdef CODEC_FLAG_H263P_SLICE_STRUCT
-   m_context->flags &= ~CODEC_FLAG_H263P_SLICE_STRUCT;
-+#endif
- 
-   return true;
- }
-@@ -658,7 +661,7 @@
-     return;
-   }
- 
--  m_context = FFMPEGLibraryInstance.AvcodecAllocContext();
-+  m_context = FFMPEGLibraryInstance.AvcodecAllocContext(m_codec);
-   if (m_context == NULL) {
-     PTRACE(1, m_prefix, "Failed to allocate context for decoder");
-     return;
---- a/plugins/video/H.264/h264-x264.cxx
-+++ b/plugins/video/H.264/h264-x264.cxx
-@@ -48,6 +48,7 @@
- #include "shared/h264frame.h"
- #include "shared/x264wrap.h"
- 
-+#include <cstdio>
- 
- #define MY_CODEC      x264                                  // Name of codec (use C variable characters)
- #define MY_CODEC_LOG "x264"
-@@ -1067,18 +1068,17 @@
-       if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(CODEC_ID_H264)) == NULL)
-         return false;
- 
--      if ((m_context = FFMPEGLibraryInstance.AvcodecAllocContext()) == NULL)
-+      if ((m_context = FFMPEGLibraryInstance.AvcodecAllocContext(m_codec)) == NULL)
-         return false;
- 
-       m_context->workaround_bugs = FF_BUG_AUTODETECT;
--      m_context->error_recognition = FF_ER_AGGRESSIVE;
-       m_context->idct_algo = FF_IDCT_H264;
-       m_context->error_concealment = FF_EC_GUESS_MVS | FF_EC_DEBLOCK;
-       m_context->flags = CODEC_FLAG_INPUT_PRESERVED | CODEC_FLAG_EMU_EDGE;
--      m_context->flags2 = CODEC_FLAG2_BRDO |
--                          CODEC_FLAG2_MEMC_ONLY |
-+      m_context->flags2 = CODEC_FLAG2_SKIP_RD |
-+#ifdef CODEC_FLAG2_DROP_FRAME_TIMECODE
-                           CODEC_FLAG2_DROP_FRAME_TIMECODE |
--                          CODEC_FLAG2_SKIP_RD |
-+#endif
-                           CODEC_FLAG2_CHUNKS;
- 
-       if ((m_picture = FFMPEGLibraryInstance.AvcodecAllocFrame()) == NULL)
---- a/plugins/video/MPEG4-ffmpeg/mpeg4.cxx
-+++ b/plugins/video/MPEG4-ffmpeg/mpeg4.cxx
-@@ -589,17 +589,14 @@
-     m_avpicture->quality = m_videoQMin;
- 
- #ifdef USE_ORIG
--    m_avcontext->flags |= CODEC_FLAG_PART;   // data partitioning
-     m_avcontext->flags |= CODEC_FLAG_4MV;    // 4 motion vectors
- #else
-     m_avcontext->max_b_frames=0; /*don't use b frames*/
-     m_avcontext->flags|=CODEC_FLAG_AC_PRED;
--    m_avcontext->flags|=CODEC_FLAG_H263P_UMV;
-     /*c->flags|=CODEC_FLAG_QPEL;*/ /*don't enable this one: this forces profile_level to advanced simple profile */
-     m_avcontext->flags|=CODEC_FLAG_4MV;
-     m_avcontext->flags|=CODEC_FLAG_GMC;
-     m_avcontext->flags|=CODEC_FLAG_LOOP_FILTER;
--    m_avcontext->flags|=CODEC_FLAG_H263P_SLICE_STRUCT;
- #endif
-     m_avcontext->opaque = this;              // for use in RTP callback
- }
-@@ -691,7 +688,12 @@
- 
- bool MPEG4EncoderContext::OpenCodec()
- {
--  m_avcontext = FFMPEGLibraryInstance.AvcodecAllocContext();
-+  if((m_avcodec = FFMPEGLibraryInstance.AvcodecFindEncoder(CODEC_ID_MPEG4)) == NULL){
-+    PTRACE(1, "MPEG4", "Encoder not found");
-+    return false;
-+  }
-+
-+  m_avcontext = FFMPEGLibraryInstance.AvcodecAllocContext(m_avcodec);
-   if (m_avcontext == NULL) {
-     PTRACE(1, "MPEG4", "Encoder failed to allocate context for encoder");
-     return false;
-@@ -703,11 +705,6 @@
-     return false;
-   }
- 
--  if((m_avcodec = FFMPEGLibraryInstance.AvcodecFindEncoder(CODEC_ID_MPEG4)) == NULL){
--    PTRACE(1, "MPEG4", "Encoder not found");
--    return false;
--  }
--
- #if PLUGINCODEC_TRACING
-   // debugging flags
-   if (PTRACE_CHECK(4)) {
-@@ -804,7 +801,7 @@
-         // Should the next frame be an I-Frame?
-         if ((flags & PluginCodec_CoderForceIFrame) || (m_frameNum == 0))
-         {
--            m_avpicture->pict_type = FF_I_TYPE;
-+            m_avpicture->pict_type = AV_PICTURE_TYPE_I;
-         }
-         else // No IFrame requested, let avcodec decide what to do
-         {
-@@ -1325,7 +1322,6 @@
- 
- void MPEG4DecoderContext::SetStaticDecodingParams() {
-     m_avcontext->flags |= CODEC_FLAG_4MV; 
--    m_avcontext->flags |= CODEC_FLAG_PART;
-     m_avcontext->workaround_bugs = 0; // no workaround for buggy implementations
- }
- 
-@@ -1399,7 +1395,7 @@
-         return false;
-     }
-         
--    m_avcontext = FFMPEGLibraryInstance.AvcodecAllocContext();
-+    m_avcontext = FFMPEGLibraryInstance.AvcodecAllocContext(m_avcodec);
-     if (m_avcontext == NULL) {
-         PTRACE(1, "MPEG4", "Decoder failed to allocate context");
-         return false;
---- a/plugins/video/common/dyna.cxx
-+++ b/plugins/video/common/dyna.cxx
-@@ -38,6 +38,13 @@
-  *                 Matthias Schneider (ma30002000@yahoo.de)
-  */
- #include "dyna.h"
-+#include <cstdio>
-+#include <cstdarg>
-+
-+extern "C" {
-+#include <libavcodec/avcodec.h>
-+#include <libavutil/mem.h>
-+}
- 
- bool DynaLink::Open(const char *name)
- {
-@@ -228,101 +235,15 @@
-   m_libAvutil.Close();
- }
- 
--#define CHECK_AVUTIL(name, func) \
--      (seperateLibAvutil ? \
--        m_libAvutil.GetFunction(name,  (DynaLink::Function &)func) : \
--        m_libAvcodec.GetFunction(name, (DynaLink::Function &)func) \
--       ) \
--
--
- bool FFMPEGLibrary::Load()
- {
-   WaitAndSignal m(processLock);
-   if (IsLoaded())
-     return true;
- 
--  bool seperateLibAvutil = false;
--
--#ifdef LIBAVCODEC_LIB_NAME
--  if (m_libAvcodec.Open(LIBAVCODEC_LIB_NAME))
--    seperateLibAvutil = true;
--  else
--#endif
--  if (m_libAvcodec.Open("libavcodec"))
--    seperateLibAvutil = false;
--  else if (m_libAvcodec.Open("avcodec-" AV_STRINGIFY(LIBAVCODEC_VERSION_MAJOR)))
--    seperateLibAvutil = true;
--  else {
--    PTRACE(1, m_codecString, "Failed to load FFMPEG libavcodec library");
--    return false;
--  }
--
--  if (seperateLibAvutil &&
--        !(
--#ifdef LIBAVUTIL_LIB_NAME
--          m_libAvutil.Open(LIBAVUTIL_LIB_NAME) ||
--#endif
--          m_libAvutil.Open("libavutil") ||
--          m_libAvutil.Open("avutil-" AV_STRINGIFY(LIBAVUTIL_VERSION_MAJOR))
--        ) ) {
--    PTRACE(1, m_codecString, "Failed to load FFMPEG libavutil library");
--    return false;
--  }
--
--  strcpy(m_libAvcodec.m_codecString, m_codecString);
--  strcpy(m_libAvutil.m_codecString,  m_codecString);
--
--  if (!m_libAvcodec.GetFunction("avcodec_init", (DynaLink::Function &)Favcodec_init))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("av_init_packet", (DynaLink::Function &)Fav_init_packet))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_register_all", (DynaLink::Function &)Favcodec_register_all))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_find_encoder", (DynaLink::Function &)Favcodec_find_encoder))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_find_decoder", (DynaLink::Function &)Favcodec_find_decoder))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_alloc_context", (DynaLink::Function &)Favcodec_alloc_context))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_alloc_frame", (DynaLink::Function &)Favcodec_alloc_frame))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_open", (DynaLink::Function &)Favcodec_open))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_close", (DynaLink::Function &)Favcodec_close))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_encode_video", (DynaLink::Function &)Favcodec_encode_video))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_decode_video2", (DynaLink::Function &)Favcodec_decode_video))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_set_dimensions", (DynaLink::Function &)Favcodec_set_dimensions))
--    return false;
--
--  if (!CHECK_AVUTIL("av_free", Favcodec_free))
--    return false;
--
--  if(!m_libAvcodec.GetFunction("avcodec_version", (DynaLink::Function &)Favcodec_version))
--    return false;
--
--  if (!CHECK_AVUTIL("av_log_set_level", FAv_log_set_level))
--    return false;
--
--  if (!CHECK_AVUTIL("av_log_set_callback", FAv_log_set_callback))
--    return false;
--
-   // must be called before using avcodec lib
- 
--  unsigned libVer = Favcodec_version();
-+  unsigned libVer = avcodec_version();
-   if (libVer != LIBAVCODEC_VERSION_INT) {
-     PTRACE(2, m_codecString, "Warning: compiled against libavcodec headers from version "
-            << LIBAVCODEC_VERSION_MAJOR << '.' << LIBAVCODEC_VERSION_MINOR << '.' << LIBAVCODEC_VERSION_MICRO
-@@ -334,8 +255,7 @@
-            << (libVer >> 16) << ((libVer>>8) & 0xff) << (libVer & 0xff));
-   }
- 
--  Favcodec_init();
--  Favcodec_register_all ();
-+  avcodec_register_all();
- 
- #if PLUGINCODEC_TRACING
-   AvLogSetLevel(AV_LOG_DEBUG);
-@@ -350,49 +270,49 @@
- 
- AVCodec *FFMPEGLibrary::AvcodecFindEncoder(enum CodecID id)
- {
--  return Favcodec_find_encoder(id);
-+  return avcodec_find_encoder(id);
- }
- 
- AVCodec *FFMPEGLibrary::AvcodecFindDecoder(enum CodecID id)
- {
-   WaitAndSignal m(processLock);
- 
--  return Favcodec_find_decoder(id);
-+  return avcodec_find_decoder(id);
- }
- 
--AVCodecContext *FFMPEGLibrary::AvcodecAllocContext(void)
-+AVCodecContext *FFMPEGLibrary::AvcodecAllocContext(AVCodec *codec)
- {
-   WaitAndSignal m(processLock);
- 
--  return Favcodec_alloc_context();
-+  return avcodec_alloc_context3(codec);
- }
- 
- AVFrame *FFMPEGLibrary::AvcodecAllocFrame(void)
- {
-   WaitAndSignal m(processLock);
- 
--  return Favcodec_alloc_frame();
-+  return avcodec_alloc_frame();
- }
- 
- int FFMPEGLibrary::AvcodecOpen(AVCodecContext *ctx, AVCodec *codec)
- {
-   WaitAndSignal m(processLock);
- 
--  return Favcodec_open(ctx, codec);
-+  return avcodec_open2(ctx, codec, NULL);
- }
- 
- int FFMPEGLibrary::AvcodecClose(AVCodecContext *ctx)
- {
-   WaitAndSignal m(processLock);
- 
--  return Favcodec_close(ctx);
-+  return avcodec_close(ctx);
- }
- 
- int FFMPEGLibrary::AvcodecEncodeVideo(AVCodecContext *ctx, BYTE *buf, int buf_size, const AVFrame *pict)
- {
-   int res;
- 
--  res = Favcodec_encode_video(ctx, buf, buf_size, pict);
-+  res = avcodec_encode_video(ctx, buf, buf_size, pict);
- 
-   PTRACE(6, m_codecString, "DYNA\tEncoded into " << res << " bytes, max " << buf_size);
-   return res;
-@@ -401,35 +321,35 @@
- int FFMPEGLibrary::AvcodecDecodeVideo(AVCodecContext *ctx, AVFrame *pict, int *got_picture_ptr, BYTE *buf, int buf_size)
- {
-   AVPacket avpkt;
--  Fav_init_packet(&avpkt);
-+  av_init_packet(&avpkt);
-   avpkt.data = buf;
-   avpkt.size = buf_size;
- 
--  return Favcodec_decode_video(ctx, pict, got_picture_ptr, &avpkt);
-+  return avcodec_decode_video2(ctx, pict, got_picture_ptr, &avpkt);
- }
- 
- void FFMPEGLibrary::AvcodecFree(void * ptr)
- {
-   WaitAndSignal m(processLock);
- 
--  Favcodec_free(ptr);
-+  av_free(ptr);
- }
- 
- void FFMPEGLibrary::AvSetDimensions(AVCodecContext *s, int width, int height)
- {
-   WaitAndSignal m(processLock);
- 
--  Favcodec_set_dimensions(s, width, height);
-+  avcodec_set_dimensions(s, width, height);
- }
- 
- void FFMPEGLibrary::AvLogSetLevel(int level)
- {
--  FAv_log_set_level(level);
-+  av_log_set_level(level);
- }
- 
- void FFMPEGLibrary::AvLogSetCallback(void (*callback)(void*, int, const char*, va_list))
- {
--  FAv_log_set_callback(callback);
-+  av_log_set_callback(callback);
- }
- 
- bool FFMPEGLibrary::IsLoaded()
---- a/plugins/video/common/dyna.h
-+++ b/plugins/video/common/dyna.h
-@@ -95,7 +95,7 @@
- 
-     AVCodec *AvcodecFindEncoder(enum CodecID id);
-     AVCodec *AvcodecFindDecoder(enum CodecID id);
--    AVCodecContext *AvcodecAllocContext(void);
-+    AVCodecContext *AvcodecAllocContext(AVCodec*);
-     AVFrame *AvcodecAllocFrame(void);
-     int AvcodecOpen(AVCodecContext *ctx, AVCodec *codec);
-     int AvcodecClose(AVCodecContext *ctx);
-@@ -120,26 +120,6 @@
-     CodecID m_codec;
-     char m_codecString[32];
- 
--    void (*Favcodec_init)(void);
--    void (*Fav_init_packet)(AVPacket *pkt);
--
--    void (*Favcodec_register_all)(void);
--    AVCodec *(*Favcodec_find_encoder)(enum CodecID id);
--    AVCodec *(*Favcodec_find_decoder)(enum CodecID id);
--    AVCodecContext *(*Favcodec_alloc_context)(void);
--    AVFrame *(*Favcodec_alloc_frame)(void);
--    int (*Favcodec_open)(AVCodecContext *ctx, AVCodec *codec);
--    int (*Favcodec_close)(AVCodecContext *ctx);
--    int (*Favcodec_encode_video)(AVCodecContext *ctx, BYTE *buf, int buf_size, const AVFrame *pict);
--    int (*Favcodec_decode_video)(AVCodecContext *ctx, AVFrame *pict, int *got_picture_ptr, AVPacket *avpkt);
--    unsigned (*Favcodec_version)(void);
--    void (*Favcodec_set_dimensions)(AVCodecContext *ctx, int width, int height);
--
--    void (*Favcodec_free)(void *);
--
--    void (*FAv_log_set_level)(int level);
--    void (*FAv_log_set_callback)(void (*callback)(void*, int, const char*, va_list));
--
-     bool m_isLoadedOK;
- };
- 
---- a/plugins/video/common/ffmpeg.h
-+++ b/plugins/video/common/ffmpeg.h
-@@ -45,11 +45,13 @@
- 
- #include "platform.h"
- 
--#include "libavcodec/avcodec.h"
-+extern "C" {
-+#include <libavcodec/avcodec.h>
- // AVPacket was declared in avformat.h before April 2009
- #if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(52, 25, 0)
--#include "libavformat/avformat.h"
-+#include <libavformat/avformat.h>
- #endif
-+}
- 
- #ifndef LIBAVCODEC_VERSION_INT
- #error Libavcodec include is not correct
---- a/plugins/video/H.263-1998/Makefile.in
-+++ b/plugins/video/H.263-1998/Makefile.in
-@@ -34,8 +34,8 @@
-              $(COMMONDIR)/mpi.cxx \
-              $(COMMONDIR)/dyna.cxx
- 
--CFLAGS += @LIBAVCODEC_CFLAGS@ -I$(COMMONDIR)
--LIBS   += @DL_LIBS@
-+CFLAGS += @LIBAVCODEC_CFLAGS@ @LIBAVUTIL_CFLAGS@ -I$(COMMONDIR)
-+LIBS   += @DL_LIBS@ @LIBAVCODEC_LIBS@ @LIBAVUTIL_LIBS@
- 
- HAVE_LIBAVCODEC_RTP_MODE=@HAVE_LIBAVCODEC_RTP_MODE@
- ifeq ($(HAVE_LIBAVCODEC_RTP_MODE),yes)
---- a/plugins/video/H.264/Makefile.in
-+++ b/plugins/video/H.264/Makefile.in
-@@ -34,8 +34,8 @@
-            $(SHAREDDIR)/x264wrap.cxx \
-            $(COMMONDIR)/dyna.cxx \
- 
--CFLAGS += @LIBAVCODEC_CFLAGS@ -I$(COMMONDIR) -DLIB_DIR='"$(libdir)"' -DVC_PLUGIN_DIR='"@VC_PLUGIN_DIR@"'
--LIBS   += @DL_LIBS@
-+CFLAGS += @LIBAVCODEC_CFLAGS@ @LIBAVUTIL_CFLAGS@ -I$(COMMONDIR) -DLIB_DIR='"$(libdir)"' -DVC_PLUGIN_DIR='"@VC_PLUGIN_DIR@"'
-+LIBS   += @DL_LIBS@ @LIBAVCODEC_LIBS@ @LIBAVUTIL_LIBS@
- 
- IS_H264_LICENSED:=@IS_H264_LICENSED@
- ifeq ($(IS_H264_LICENSED),yes)
---- a/plugins/video/MPEG4-ffmpeg/Makefile.in
-+++ b/plugins/video/MPEG4-ffmpeg/Makefile.in
-@@ -30,8 +30,8 @@
- SRCDIR    := .
- SRCS      := mpeg4.cxx $(COMMONDIR)/dyna.cxx
- 
--CFLAGS += @LIBAVCODEC_CFLAGS@ -I$(COMMONDIR)
--LIBS   += @DL_LIBS@
-+CFLAGS += @LIBAVCODEC_CFLAGS@ @LIBAVUTIL_CFLAGS@ -I$(COMMONDIR)
-+LIBS   += @DL_LIBS@ @LIBAVCODEC_LIBS@ @LIBAVUTIL_LIBS@
- 
- # Add LIBAVCODEC_SOURCE_DIR to the include path so we can #include <libavcodec/...h>
- # Also add libavutil, so ffmpeg headers can #include "log.h".
diff --git a/nixpkgs/pkgs/development/libraries/openal-soft/default.nix b/nixpkgs/pkgs/development/libraries/openal-soft/default.nix
index 89ac85b752b7..20528ac9284f 100644
--- a/nixpkgs/pkgs/development/libraries/openal-soft/default.nix
+++ b/nixpkgs/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 = []
@@ -27,9 +35,9 @@ stdenv.mkDerivation rec {
     ++ optional pulseSupport libpulseaudio
     ++ optionals stdenv.isDarwin [ CoreServices AudioUnit AudioToolbox ];
 
-  NIX_LDFLAGS = []
+  NIX_LDFLAGS = toString ([]
     ++ optional alsaSupport "-lasound"
-    ++ optional pulseSupport "-lpulse";
+    ++ optional pulseSupport "-lpulse");
 
   meta = {
     description = "OpenAL alternative";
diff --git a/nixpkgs/pkgs/development/libraries/openal-soft/search-out.patch b/nixpkgs/pkgs/development/libraries/openal-soft/search-out.patch
new file mode 100644
index 000000000000..0f9c2abad3c3
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/openbabel/default.nix b/nixpkgs/pkgs/development/libraries/openbabel/default.nix
index 26bcf3d20ff6..3838e1103ba3 100644
--- a/nixpkgs/pkgs/development/libraries/openbabel/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/openbsm/default.nix b/nixpkgs/pkgs/development/libraries/openbsm/default.nix
index 25e7267b3c9f..269b0138091b 100644
--- a/nixpkgs/pkgs/development/libraries/openbsm/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/opencl-clang/default.nix b/nixpkgs/pkgs/development/libraries/opencl-clang/default.nix
new file mode 100644
index 000000000000..50794863defb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencl-clang/default.nix
@@ -0,0 +1,97 @@
+{ stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, git
+
+, llvmPackages_8
+, spirv-llvm-translator
+
+, buildWithPatches ? true
+}:
+
+let
+  llvmPkgs = llvmPackages_8 // {
+    inherit spirv-llvm-translator;
+  };
+
+  inherit (stdenv.lib) getVersion;
+
+  addPatches = component: pkg:
+    with builtins; with stdenv.lib;
+    let path = "${passthru.patchesOut}/${component}";
+    in pkg.overrideAttrs (super: {
+      postPatch = (if super ? postPatch then super.postPatch + "\n" else "") + ''
+        for p in ${path}/*
+        do
+          patch -p1 -i "$p"
+        done
+      '';
+    });
+
+  passthru = rec {
+
+    clang-unwrapped = addPatches "clang" llvmPkgs.clang-unwrapped;
+
+    clang = llvmPkgs.clang.override {
+      cc = clang-unwrapped;
+    };
+
+    patchesOut = stdenv.mkDerivation rec {
+      pname = "opencl-clang-patches";
+      inherit (lib) version src patches;
+      installPhase = ''
+        [ -d patches ] && cp -r patches/ $out || mkdir $out
+        mkdir -p $out/clang $out/spirv
+      '';
+    };
+
+    spirv-llvm-translator = addPatches "spirv" llvmPkgs.spirv-llvm-translator;
+
+  };
+
+  lib = let
+    inherit (llvmPkgs) llvm;
+    inherit (if buildWithPatches then passthru else llvmPkgs) clang-unwrapped spirv-llvm-translator;
+  in
+    stdenv.mkDerivation rec {
+      pname = "opencl-clang";
+      version = "unstable-2019-08-16";
+
+      inherit passthru;
+
+      src = fetchFromGitHub {
+        owner = "intel";
+        repo = "opencl-clang";
+        rev = "94af090661d7c953c516c97a25ed053c744a0737";
+        sha256 = "05cg89m62nqjqm705h7gpdz4jd4hiczg8944dcjsvaybrqv3hcm5";
+      };
+
+      patches = [
+      # Build script tries to find Clang OpenCL headers under ${llvm}
+      # Work around it by specifying that directory manually.
+        ./opencl-headers-dir.patch
+      ];
+
+      nativeBuildInputs = [ cmake git ];
+
+      buildInputs = [ clang-unwrapped llvm spirv-llvm-translator ];
+
+      cmakeFlags = [
+        "-DPREFERRED_LLVM_VERSION=${getVersion llvm}"
+        "-DOPENCL_HEADERS_DIR=${clang-unwrapped}/lib/clang/${getVersion clang-unwrapped}/include/"
+
+        "-DLLVMSPIRV_INCLUDED_IN_LLVM=OFF"
+        "-DSPIRV_TRANSLATOR_DIR=${spirv-llvm-translator}"
+      ];
+
+      meta = with stdenv.lib; {
+        homepage    = https://github.com/intel/opencl-clang/;
+        description = "A clang wrapper library with an OpenCL-oriented API and the ability to compile OpenCL C kernels to SPIR-V modules";
+        license     = licenses.ncsa;
+        platforms   = platforms.all;
+        maintainers = with maintainers; [ gloaming ];
+      };
+    };
+in
+  lib
diff --git a/nixpkgs/pkgs/development/libraries/opencl-clang/opencl-headers-dir.patch b/nixpkgs/pkgs/development/libraries/opencl-clang/opencl-headers-dir.patch
new file mode 100644
index 000000000000..70343b8ee197
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencl-clang/opencl-headers-dir.patch
@@ -0,0 +1,25 @@
+diff --git a/cl_headers/CMakeLists.txt b/cl_headers/CMakeLists.txt
+index 3dd2ea4..aeae6e9 100644
+--- a/cl_headers/CMakeLists.txt
++++ b/cl_headers/CMakeLists.txt
+@@ -11,12 +11,14 @@ add_custom_command(
+ )
+ endfunction(copy_file)
+ 
+-if(USE_PREBUILT_LLVM)
+-    set(OPENCL_HEADERS_DIR
+-      "${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}/include/")
+-else(USE_PREBUILT_LLVM)
+-    set(OPENCL_HEADERS_DIR "${CLANG_SOURCE_DIR}/lib/Headers")
+-endif(USE_PREBUILT_LLVM)
++if(NOT DEFINED OPENCL_HEADERS_DIR)
++  if(USE_PREBUILT_LLVM)
++      set(OPENCL_HEADERS_DIR
++        "${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}/include/")
++  else(USE_PREBUILT_LLVM)
++      set(OPENCL_HEADERS_DIR "${CLANG_SOURCE_DIR}/lib/Headers")
++  endif(USE_PREBUILT_LLVM)
++endif()
+ copy_file(${OPENCL_HEADERS_DIR}/opencl-c.h opencl-c.h)
+ 
+ add_custom_target (
diff --git a/nixpkgs/pkgs/development/libraries/opencolorio/default.nix b/nixpkgs/pkgs/development/libraries/opencolorio/default.nix
index cbd05848173a..06eff9d17f36 100644
--- a/nixpkgs/pkgs/development/libraries/opencolorio/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/opencsg/default.nix b/nixpkgs/pkgs/development/libraries/opencsg/default.nix
index 1fdddf930cfd..cf46077a56cd 100644
--- a/nixpkgs/pkgs/development/libraries/opencsg/default.nix
+++ b/nixpkgs/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;
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   preConfigure = ''
     rm example/Makefile src/Makefile
-    qmakeFlags="$qmakeFlags INSTALLDIR=$out"
+    qmakeFlags=("''${qmakeFlags[@]}" "INSTALLDIR=$out")
   '';
 
   postInstall = ''
diff --git a/nixpkgs/pkgs/development/libraries/opencv/3.x.nix b/nixpkgs/pkgs/development/libraries/opencv/3.x.nix
index d8946dae095b..642facf166a6 100644
--- a/nixpkgs/pkgs/development/libraries/opencv/3.x.nix
+++ b/nixpkgs/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:
@@ -208,7 +208,7 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ cmake pkgconfig unzip ];
 
-  NIX_CFLAGS_COMPILE = lib.optional enableEXR "-I${ilmbase.dev}/include/OpenEXR";
+  NIX_CFLAGS_COMPILE = lib.optionalString enableEXR "-I${ilmbase.dev}/include/OpenEXR";
 
   # Configure can't find the library without this.
   OpenBLAS_HOME = lib.optionalString enableOpenblas openblas;
diff --git a/nixpkgs/pkgs/development/libraries/opencv/4.x.nix b/nixpkgs/pkgs/development/libraries/opencv/4.x.nix
index aa4c7afa4dbe..9fffd3d94770 100644
--- a/nixpkgs/pkgs/development/libraries/opencv/4.x.nix
+++ b/nixpkgs/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
@@ -36,20 +36,20 @@
 }:
 
 let
-  version = "4.1.0";
+  version = "4.1.2";
 
   src = fetchFromGitHub {
     owner  = "opencv";
     repo   = "opencv";
     rev    = version;
-    sha256 = "0m1f51m11iz4vxfrmnhawksd669ld247rlfdq5fhkvfk3r7aidw6";
+    sha256 = "0c98ziwvfrzdzwn52a36d37n5rac8zmxq2jn479bzfaii1bib8xx";
   };
 
   contribSrc = fetchFromGitHub {
     owner  = "opencv";
     repo   = "opencv_contrib";
     rev    = version;
-    sha256 = "1phmmba96m5znjf3wxwhxavgzgp3bs5qqsjk9ay1i63rdacz4vlf";
+    sha256 = "10ryyxhggin5dk5glf4ycyrfryqf50f4bs10biv6nxlrrinm2di4";
   };
 
   # Contrib must be built in order to enable Tesseract support:
@@ -130,10 +130,10 @@ let
   ade = rec {
     src = fetchurl {
       url = "https://github.com/opencv/ade/archive/${name}";
-      sha256 = "1r85vdkvcka7bcxk69pd0ai4hld4iakpj4xl0xbinx3p9pv5a4l8";
+      sha256 = "04n9na2bph706bdxnnqfcbga4cyj8kd9s9ni7qyvnpj5v98jwvlm";
     };
-    name = "v0.1.1d.zip";
-    md5 = "37479d90e3a5d47f132f512b22cbe206";
+    name = "v0.1.1f.zip";
+    md5 = "b624b995ec9c439cbc2e9e6ee940d3a2";
     dst = ".cache/ade";
   };
 
@@ -161,14 +161,6 @@ stdenv.mkDerivation {
     cp --no-preserve=mode -r "${contribSrc}/modules" "$NIX_BUILD_TOP/source/opencv_contrib"
   '';
 
-  patches = [
-    (fetchpatch {
-      url = "https://github.com/opencv/opencv/commit/5691d998ead1d9b0542bcfced36c2dceb3a59023.patch";
-      name = "CVE-2019-14493.patch";
-      sha256 = "14qva9f5z10apz5q0skdyiclr9sgkhab4fzksy1w3b6j6hg4wm7m";
-    })
-  ];
-
   # This prevents cmake from using libraries in impure paths (which
   # causes build failure on non NixOS)
   # Also, work around https://github.com/NixOS/nixpkgs/issues/26304 with
@@ -229,7 +221,7 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ cmake pkgconfig unzip ];
 
-  NIX_CFLAGS_COMPILE = lib.optional enableEXR "-I${ilmbase.dev}/include/OpenEXR";
+  NIX_CFLAGS_COMPILE = lib.optionalString enableEXR "-I${ilmbase.dev}/include/OpenEXR";
 
   # Configure can't find the library without this.
   OpenBLAS_HOME = lib.optionalString enableOpenblas openblas;
diff --git a/nixpkgs/pkgs/development/libraries/opencv/default.nix b/nixpkgs/pkgs/development/libraries/opencv/default.nix
index b91a1489eb69..ad27742d0b4c 100644
--- a/nixpkgs/pkgs/development/libraries/opencv/default.nix
+++ b/nixpkgs/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
@@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake pkgconfig unzip ];
 
-  NIX_CFLAGS_COMPILE = lib.optional enableEXR "-I${ilmbase.dev}/include/OpenEXR";
+  NIX_CFLAGS_COMPILE = lib.optionalString enableEXR "-I${ilmbase.dev}/include/OpenEXR";
 
   cmakeFlags = [
     (opencvFlag "TIFF" enableTIFF)
diff --git a/nixpkgs/pkgs/development/libraries/opendbx/default.nix b/nixpkgs/pkgs/development/libraries/opendbx/default.nix
index f954aaf72457..16ec6a5c1103 100644
--- a/nixpkgs/pkgs/development/libraries/opendbx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opendbx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, readline, mysql, postgresql, sqlite }:
+{ stdenv, fetchurl, readline, libmysqlclient, postgresql, sqlite }:
 
 stdenv.mkDerivation rec {
   name = "opendbx-1.4.6";
@@ -9,12 +9,12 @@ stdenv.mkDerivation rec {
   };
 
   preConfigure = ''
-    export CPPFLAGS="-I${mysql.connector-c}/include/mysql"
-    export LDFLAGS="-L${mysql.connector-c}/lib/mysql -L${postgresql}/lib"
+    export CPPFLAGS="-I${libmysqlclient}/include/mysql"
+    export LDFLAGS="-L${libmysqlclient}/lib/mysql -L${postgresql}/lib"
     configureFlagsArray=(--with-backends="mysql pgsql sqlite3")
   '';
 
-  buildInputs = [ readline mysql.connector-c postgresql sqlite ];
+  buildInputs = [ readline libmysqlclient postgresql sqlite ];
 
   meta = with stdenv.lib; {
     description = "Extremely lightweight but extensible database access library written in C";
diff --git a/nixpkgs/pkgs/development/libraries/openexr/default.nix b/nixpkgs/pkgs/development/libraries/openexr/default.nix
index 9eef138c532e..328bce35357f 100644
--- a/nixpkgs/pkgs/development/libraries/openexr/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/openexrid-unstable/default.nix b/nixpkgs/pkgs/development/libraries/openexrid-unstable/default.nix
index b8a3c4a81e00..92cd343cf6a1 100644
--- a/nixpkgs/pkgs/development/libraries/openexrid-unstable/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/openfst/default.nix b/nixpkgs/pkgs/development/libraries/openfst/default.nix
index 6554d025311b..51ed495a9959 100644
--- a/nixpkgs/pkgs/development/libraries/openfst/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openfst/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "openfst";
-  version = "1.7.2";
+  version = "1.7.4";
 
   src = fetchurl {
     url = "http://www.openfst.org/twiki/pub/FST/FstDownload/${pname}-${version}.tar.gz";
-    sha256 = "0fqgk8195kz21is09gwzwnrg7fr9526bi9mh4apyskapz27pbhr1";
+    sha256 = "0drhq5348vbaccpa0z3jvd5hyv5bm2i9xrak1wb4yvl2mx77dbmh";
   };
   meta = {
     description = "Library for working with finite-state transducers";
diff --git a/nixpkgs/pkgs/development/libraries/openh264/default.nix b/nixpkgs/pkgs/development/libraries/openh264/default.nix
index cd91a1325978..fe46d25421a1 100644
--- a/nixpkgs/pkgs/development/libraries/openh264/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/openmpi/default.nix b/nixpkgs/pkgs/development/libraries/openmpi/default.nix
index 4ab2dd418558..5996dda1e74e 100644
--- a/nixpkgs/pkgs/development/libraries/openmpi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openmpi/default.nix
@@ -1,5 +1,8 @@
 { stdenv, fetchurl, fetchpatch, gfortran, perl, libnl
-, rdma-core, zlib, numactl, libevent, hwloc, pkgsTargetTarget
+, rdma-core, zlib, numactl, libevent, hwloc, pkgsTargetTarget, symlinkJoin
+
+# Enable CUDA support
+, cudaSupport ? false, cudatoolkit ? null
 
 # Enable the Sun Grid Engine bindings
 , enableSGE ? false
@@ -8,26 +11,24 @@
 , enablePrefix ? false
 }:
 
+assert !cudaSupport || cudatoolkit != null;
+
 let
-  version = "4.0.1";
+  version = "4.0.2";
 
+  cudatoolkit_joined = symlinkJoin {
+    name = "${cudatoolkit.name}-unsplit";
+    paths = [ cudatoolkit.out cudatoolkit.lib ];
+  };
 in stdenv.mkDerivation rec {
   pname = "openmpi";
   inherit version;
 
   src = with stdenv.lib.versions; fetchurl {
     url = "https://www.open-mpi.org/software/ompi/v${major version}.${minor version}/downloads/${pname}-${version}.tar.bz2";
-    sha256 = "02cpzcp113gj5hb0j2xc0cqma2fn04i2i0bzf80r71120p9bdryc";
+    sha256 = "0ms0zvyxyy3pnx9qwib6zaljyp2b3ixny64xvq3czv3jpr8zf2wh";
   };
 
-  patches = [
-    (fetchpatch {
-      name = "openmpi-mca_btl_vader_component_close-segfault.patch";
-      url = "https://github.com/open-mpi/ompi/pull/6526.patch";
-      sha256 = "0s7ac9rkcj3fi6ampkvy76njlj478yyr4zvypjc7licy6dgr595x";
-    })
-  ];
-
   postPatch = ''
     patchShebangs ./
 
@@ -41,15 +42,20 @@ in stdenv.mkDerivation rec {
 
   buildInputs = with stdenv; [ gfortran zlib ]
     ++ lib.optionals isLinux [ libnl numactl ]
+    ++ lib.optionals cudaSupport [ cudatoolkit ]
     ++ [ libevent hwloc ]
     ++ lib.optional (isLinux || isFreeBSD) rdma-core;
 
   nativeBuildInputs = [ perl ];
 
-  configureFlags = with stdenv; [ "--disable-mca-dso" ]
+  configureFlags = with stdenv; lib.optional (!cudaSupport) "--disable-mca-dso"
     ++ lib.optional isLinux  "--with-libnl=${libnl.dev}"
     ++ lib.optional enableSGE "--with-sge"
     ++ lib.optional enablePrefix "--enable-mpirun-prefix-by-default"
+    # TODO: add UCX support, which is recommended to use with cuda for the most robust OpenMPI build
+    # https://github.com/openucx/ucx
+    # https://www.open-mpi.org/faq/?category=buildcuda
+    ++ lib.optionals cudaSupport [ "--with-cuda=${cudatoolkit_joined}" "--enable-dlopen" ]
     ;
 
   enableParallelBuilding = true;
@@ -77,6 +83,10 @@ in stdenv.mkDerivation rec {
 
   doCheck = true;
 
+  passthru = {
+    inherit cudaSupport cudatoolkit;
+  };
+
   meta = with stdenv.lib; {
     homepage = https://www.open-mpi.org/;
     description = "Open source MPI-3 implementation";
diff --git a/nixpkgs/pkgs/development/libraries/openscenegraph/default.nix b/nixpkgs/pkgs/development/libraries/openscenegraph/default.nix
index 1398e829dd5c..b12ca67655b9 100644
--- a/nixpkgs/pkgs/development/libraries/openscenegraph/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/openssl/default.nix b/nixpkgs/pkgs/development/libraries/openssl/default.nix
index 03082eab0917..3a5a37cc4779 100644
--- a/nixpkgs/pkgs/development/libraries/openssl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openssl/default.nix
@@ -44,10 +44,11 @@ let
     # TODO(@Ericson2314): Improve with mass rebuild
     configurePlatforms = [];
     configureScript = {
-        x86_64-darwin  = "./Configure darwin64-x86_64-cc";
-        x86_64-solaris = "./Configure solaris64-x86_64-gcc";
         armv6l-linux = "./Configure linux-armv4 -march=armv6";
         armv7l-linux = "./Configure linux-armv4 -march=armv7-a";
+        x86_64-darwin  = "./Configure darwin64-x86_64-cc";
+        x86_64-linux = "./Configure linux-x86_64";
+        x86_64-solaris = "./Configure solaris64-x86_64-gcc";
       }.${stdenv.hostPlatform.system} or (
         if stdenv.hostPlatform == stdenv.buildPlatform
           then "./config"
@@ -95,7 +96,11 @@ let
     '' +
     ''
       mkdir -p $bin
+    '' + stdenv.lib.optionalString (!stdenv.hostPlatform.isWindows)
+    ''
       substituteInPlace $out/bin/c_rehash --replace ${buildPackages.perl} ${perl}
+    '' +
+    ''
       mv $out/bin $bin/
 
       mkdir $dev
@@ -107,7 +112,7 @@ let
       rmdir $out/etc/ssl/{certs,private}
     '';
 
-    postFixup = ''
+    postFixup = stdenv.lib.optionalString (!stdenv.hostPlatform.isWindows) ''
       # Check to make sure the main output doesn't depend on perl
       if grep -r '${buildPackages.perl}' $out; then
         echo "Found an erroneous dependency on perl ^^^" >&2
@@ -127,8 +132,8 @@ let
 in {
 
   openssl_1_0_2 = common {
-    version = "1.0.2s";
-    sha256 = "15mbmg8hf7s12vr3v2bdc0pi9y4pdbnsxhzk4fyyap42jaa5rgfa";
+    version = "1.0.2t";
+    sha256 = "1g67ra0ph7gpz6fgvv1i96d792jmd6ymci5kk53vbikszr74djql";
     patches = [
       ./1.0.2/nix-ssl-cert-file.patch
 
@@ -139,8 +144,8 @@ in {
   };
 
   openssl_1_1 = common {
-    version = "1.1.1c";
-    sha256 = "142c7zdlz06hjrrvinb9f276czc78bnkyhd9xma621qmmmwk1yzn";
+    version = "1.1.1d";
+    sha256 = "1whinyw402z3b9xlb3qaxv4b9sk4w1bgh9k0y8df1z4x3yy92fhy";
     patches = [
       ./1.1/nix-ssl-cert-file.patch
 
diff --git a/nixpkgs/pkgs/development/libraries/openvdb/default.nix b/nixpkgs/pkgs/development/libraries/openvdb/default.nix
index 800acebac34c..840da0461706 100644
--- a/nixpkgs/pkgs/development/libraries/openvdb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openvdb/default.nix
@@ -3,13 +3,13 @@
 stdenv.mkDerivation rec
 {
   pname = "openvdb";
-  version = "6.1.0";
+  version = "6.2.1";
 
   src = fetchFromGitHub {
     owner = "dreamworksanimation";
     repo = "openvdb";
     rev = "v${version}";
-    sha256 = "0rs50741c4m0jgc7k2fdyinvm7hhjrbg0wls6whqaghbbaf1lhpk";
+    sha256 = "1ypkzdkgsbcczfvrqblnxfzm13w0mdkskgqmgvmbfi66vpaazdrf";
   };
 
   outputs = [ "out" ];
@@ -20,21 +20,22 @@ stdenv.mkDerivation rec
     sourceRoot=$(echo */openvdb)
   '';
 
-  installTargets = "install_lib";
+  installTargets = [ "install_lib" ];
 
   enableParallelBuilding = true;
 
-  buildFlags = ''lib
-    DESTDIR=$(out)
-    HALF_LIB=-lHalf
-    TBB_LIB=-ltbb
-    BLOSC_LIB=-lblosc
-    LOG4CPLUS_LIB=
-    BLOSC_INCLUDE_DIR=${c-blosc}/include/
-    BLOSC_LIB_DIR=${c-blosc}/lib/
-  '';
-
-  installFlags = ''DESTDIR=$(out)'';
+  buildFlags = [
+    "lib"
+    "DESTDIR=$(out)"
+    "HALF_LIB=-lHalf"
+    "TBB_LIB=-ltbb"
+    "BLOSC_LIB=-lblosc"
+    "LOG4CPLUS_LIB="
+    "BLOSC_INCLUDE_DIR=${c-blosc}/include/"
+    "BLOSC_LIB_DIR=${c-blosc}/lib/"
+  ];
+
+  installFlags = [ "DESTDIR=$(out)" ];
 
   NIX_CFLAGS_COMPILE="-I${openexr.dev}/include/OpenEXR -I${ilmbase.dev}/include/OpenEXR/";
   NIX_LDFLAGS="-lboost_iostreams";
diff --git a/nixpkgs/pkgs/development/libraries/openxr-loader/default.nix b/nixpkgs/pkgs/development/libraries/openxr-loader/default.nix
index 8013d6865855..6cf03bc990c4 100644
--- a/nixpkgs/pkgs/development/libraries/openxr-loader/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openxr-loader/default.nix
@@ -1,18 +1,18 @@
-{ stdenv, fetchFromGitHub, cmake, python3, libX11, libXxf86vm, libXrandr }:
+{ stdenv, fetchFromGitHub, cmake, python3, libX11, libXxf86vm, libXrandr, vulkan-headers, libGL }:
 
 stdenv.mkDerivation rec {
   pname = "openxr-loader";
-  version = "1.0.2";
+  version = "1.0.3";
 
   src = fetchFromGitHub {
     owner = "KhronosGroup";
     repo = "OpenXR-SDK-Source";
     rev = "release-${version}";
-    sha256 = "11lkihykwkq0sbmijqxmn52lg6mcn6gkcpj1c7fhzm0hm1b9p9dn";
+    sha256 = "0hqf0z38gk4id8d6vcms66mh3gllh2xib5mr11069sh9ak6b3mmp";
   };
 
   nativeBuildInputs = [ cmake python3 ];
-  buildInputs = [ libX11 libXxf86vm libXrandr ];
+  buildInputs = [ libX11 libXxf86vm libXrandr vulkan-headers libGL ];
   enableParallelBuilding = true;
 
   cmakeFlags = [ "-DBUILD_TESTS=OFF" ];
diff --git a/nixpkgs/pkgs/development/libraries/openzwave/default.nix b/nixpkgs/pkgs/development/libraries/openzwave/default.nix
index 3d5988f8114e..a9dbcf9ffb27 100644
--- a/nixpkgs/pkgs/development/libraries/openzwave/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openzwave/default.nix
@@ -3,7 +3,7 @@
 , systemd }:
 
 let
-  version = "2018-11-13";
+  version = "2019-12-08";
 
 in stdenv.mkDerivation {
   pname = "openzwave";
@@ -14,8 +14,8 @@ in stdenv.mkDerivation {
   src = fetchFromGitHub {
     owner = "home-assistant";
     repo = "open-zwave";
-    rev = "0679daef6aa5a39e2441a68f7b45cfe022c4d961";
-    sha256 = "1d13maj93i6h792cbvqpx43ffss44dxmvbwj2777vzvvjib8m4n8";
+    rev = "2cd2137025c529835e4893a7b87c3d56605b2681";
+    sha256 = "04g8fb4f4ihakvvsmzcnncgfdd2ikmki7s22i9c6layzdwavbwf1";
   };
 
   nativeBuildInputs = [ doxygen fontconfig graphviz-nox libxml2 pkgconfig which ];
diff --git a/nixpkgs/pkgs/development/libraries/oracle-instantclient/default.nix b/nixpkgs/pkgs/development/libraries/oracle-instantclient/default.nix
index a7865fc7f4be..aba9c75ad465 100644
--- a/nixpkgs/pkgs/development/libraries/oracle-instantclient/default.nix
+++ b/nixpkgs/pkgs/development/libraries/oracle-instantclient/default.nix
@@ -53,7 +53,7 @@ let
 
   shortArch = {
     x86_64-linux = "linux";
-    x86_64-darwin = "macos";
+    x86_64-darwin = "mac";
   }.${stdenv.hostPlatform.system} or throwSystem;
 
   # calculate the filename of a single zip file
diff --git a/nixpkgs/pkgs/development/libraries/orcania/default.nix b/nixpkgs/pkgs/development/libraries/orcania/default.nix
index 6a7fd78d514f..bc27011c5887 100644
--- a/nixpkgs/pkgs/development/libraries/orcania/default.nix
+++ b/nixpkgs/pkgs/development/libraries/orcania/default.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchFromGitHub, cmake, check, subunit }:
 stdenv.mkDerivation rec {
   pname = "orcania";
-  version = "2.0.1";
+  version = "2.1.0";
 
   src = fetchFromGitHub {
     owner = "babelouest";
     repo = pname;
     rev = "v${version}";
-    sha256 = "1kq1cpayflh4xy442q6prrkalm8lcz2cxydrp1fv8ppq1cnq4zr7";
+    sha256 = "1zp2rk267dfmfap6qsyn7maivrpid8s3rkicwk1q5v6j20cgh1f8";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/development/libraries/ortp/default.nix b/nixpkgs/pkgs/development/libraries/ortp/default.nix
index 58f355b27fe1..68e890e33682 100644
--- a/nixpkgs/pkgs/development/libraries/ortp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ortp/default.nix
@@ -1,24 +1,25 @@
 { 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";
   };
 
+  NIX_CFLAGS_COMPILE = "-Wno-error=stringop-truncation";
+
   buildInputs = [ bctoolbox ];
   nativeBuildInputs = [ cmake ];
 
   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/nixpkgs/pkgs/development/libraries/p11-kit/default.nix b/nixpkgs/pkgs/development/libraries/p11-kit/default.nix
index 9ca329c67613..f13ae141a816 100644
--- a/nixpkgs/pkgs/development/libraries/p11-kit/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/packr/default.nix b/nixpkgs/pkgs/development/libraries/packr/default.nix
index e2be8ded31cb..4482a9cd312d 100644
--- a/nixpkgs/pkgs/development/libraries/packr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/packr/default.nix
@@ -5,13 +5,13 @@
 
 buildGoModule rec {
   pname = "packr";
-  version = "2.6.0";
+  version = "2.7.1";
 
   src = fetchFromGitHub {
     owner = "gobuffalo";
     repo = pname;
     rev = "v${version}";
-    sha256 = "11bd0s3hyzvhcg1q0iahv2w9f0w1k57jfxgswhz7dyndxvvr2b8i";
+    sha256 = "0m5kl2fq8gf1v4vllgag2xl8fd382sdgqrcdb8f5alsnrdn08kb9";
   };
 
   subPackages = [ "packr" "v2/packr2" ];
diff --git a/nixpkgs/pkgs/development/libraries/pango/default.nix b/nixpkgs/pkgs/development/libraries/pango/default.nix
index 0f84b382f4de..ecb0f16c72c5 100644
--- a/nixpkgs/pkgs/development/libraries/pango/default.nix
+++ b/nixpkgs/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,26 +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";
-    })
-  ];
-
   mesonFlags = [
-    "-Denable_docs=${if stdenv.isDarwin then "false" else "true"}"
+    "-Dgtk_doc=${if stdenv.isDarwin then "false" else "true"}"
   ];
 
   enableParallelBuilding = true;
diff --git a/nixpkgs/pkgs/development/libraries/pangox-compat/default.nix b/nixpkgs/pkgs/development/libraries/pangox-compat/default.nix
deleted file mode 100644
index 1ae2f1b81321..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/partio/default.nix b/nixpkgs/pkgs/development/libraries/partio/default.nix
index b08936dd34de..ba042562320b 100644
--- a/nixpkgs/pkgs/development/libraries/partio/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/pcaudiolib/default.nix b/nixpkgs/pkgs/development/libraries/pcaudiolib/default.nix
index 5a02229cb0e2..1831d9692493 100644
--- a/nixpkgs/pkgs/development/libraries/pcaudiolib/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/pcre/default.nix b/nixpkgs/pkgs/development/libraries/pcre/default.nix
index 2e111240758d..cf08f9893697 100644
--- a/nixpkgs/pkgs/development/libraries/pcre/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/pcre2/default.nix b/nixpkgs/pkgs/development/libraries/pcre2/default.nix
index e27c71314d97..b988c4ea02cc 100644
--- a/nixpkgs/pkgs/development/libraries/pcre2/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix b/nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix
index ef7633dadaf3..d79078c28369 100644
--- a/nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix
+++ b/nixpkgs/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
@@ -45,24 +37,29 @@ stdenv.mkDerivation {
             gst-plugins-bad
             gst-libav
           ]);
-    in [
+    in toString [
       # This flag should be picked up through pkgconfig, but it isn't.
       "-I${gst_all_1.gstreamer.dev}/lib/gstreamer-1.0/include"
 
       ''-DGST_PLUGIN_PATH_1_0="${gstPluginPaths}"''
     ];
 
-  buildInputs = with gst_all_1;
-    [ gstreamer gst-plugins-base phonon ]
-    ++ (if withQt5 then [ qtbase qtx11extras ] else [ qt4 ]);
-
-  # cleanup: the build system creates (empty) $out/$out/share/icons (double prefix)
-  # if DESTDIR is unset
-  DESTDIR="/";
+  buildInputs = with gst_all_1; [
+    gstreamer
+    gst-plugins-base
+    phonon
+    qtbase
+    qtx11extras
+  ];
 
-  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/nixpkgs/pkgs/development/libraries/phonon/backends/vlc.nix b/nixpkgs/pkgs/development/libraries/phonon/backends/vlc.nix
index 98c6be85672c..9ed137e4f450 100644
--- a/nixpkgs/pkgs/development/libraries/phonon/backends/vlc.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/phonon/default.nix b/nixpkgs/pkgs/development/libraries/phonon/default.nix
index dc32c4ebfb05..86e3caaa1486 100644
--- a/nixpkgs/pkgs/development/libraries/phonon/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/physics/apfel/default.nix b/nixpkgs/pkgs/development/libraries/physics/apfel/default.nix
index 5302ad21258a..4ebfd6fbfa37 100644
--- a/nixpkgs/pkgs/development/libraries/physics/apfel/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/physics/applgrid/default.nix b/nixpkgs/pkgs/development/libraries/physics/applgrid/default.nix
index edda5148068a..3e2a53d81dd8 100644
--- a/nixpkgs/pkgs/development/libraries/physics/applgrid/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/physics/fastjet-contrib/default.nix b/nixpkgs/pkgs/development/libraries/physics/fastjet-contrib/default.nix
new file mode 100644
index 000000000000..2bc5b12dfb77
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/physics/fastjet/default.nix b/nixpkgs/pkgs/development/libraries/physics/fastjet/default.nix
index 826362cc586b..96eb13d11cdc 100644
--- a/nixpkgs/pkgs/development/libraries/physics/fastjet/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/fastjet/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "fastjet";
-  version = "3.3.2";
+  version = "3.3.3";
 
   src = fetchurl {
     url = "http://fastjet.fr/repo/fastjet-${version}.tar.gz";
-    sha256 = "1hk3k7dyik640dzg21filpywc2dl862nl2hbpg384hf5pw9syn9z";
+    sha256 = "0avkgn19plq593p872hirr0yj2vgjvsi88w68ngarbp55hla1c1h";
   };
 
   buildInputs = [ python2 ];
diff --git a/nixpkgs/pkgs/development/libraries/physics/geant4/datasets-hook.sh b/nixpkgs/pkgs/development/libraries/physics/geant4/datasets-hook.sh
index 14e3b8f2fc38..8aed8b8832b3 100644
--- a/nixpkgs/pkgs/development/libraries/physics/geant4/datasets-hook.sh
+++ b/nixpkgs/pkgs/development/libraries/physics/geant4/datasets-hook.sh
@@ -1,5 +1,5 @@
 @name@ () {
-    export G4@envvar@DATA="@out@/data"
+    export G4@envvar@DATA="@datadir@"
 }
 
 postHooks+=(@name@)
diff --git a/nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix b/nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix
index 88f2dc2cd6d4..22fda0cf9800 100644
--- a/nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix
@@ -1,12 +1,13 @@
-{ stdenv, fetchurl, }:
+{ stdenv, fetchurl, geant_version }:
 
 let
-  mkDataset = { name, version, sha256, envvar}:
+  mkDataset = { name, version, sha256, envvar }:
     stdenv.mkDerivation {
       inherit name version;
+      inherit geant_version;
 
       src = fetchurl {
-        url = "https://geant4-data.web.cern.ch/geant4-data/datasets/${name}.${version}.tar.gz";
+        url = "https://cern.ch/geant4-data/datasets/${name}.${version}.tar.gz";
         inherit sha256;
       };
 
@@ -14,9 +15,10 @@ let
       dontBuild = true;
       dontConfigure = true;
 
+      datadir = "${placeholder "out"}/share/Geant4-${geant_version}/data/${name}${version}";
       installPhase = ''
-        mkdir -p $out/data
-        mv ./* $out/data
+        mkdir -p $datadir
+        mv ./* $datadir
       '';
 
       inherit envvar;
@@ -40,37 +42,37 @@ in
 
     {
       name = "G4EMLOW";
-      version = "7.3";
-      sha256 = "583aa7f34f67b09db7d566f904c54b21e95a9ac05b60e2bfb794efb569dba14e";
+      version = "7.7";
+      sha256 = "16dec6adda6477a97424d749688d73e9bd7d0b84d0137a67cf341f1960984663";
       envvar = "LE";
     }
 
     {
       name = "G4PhotonEvaporation";
-      version = "5.2";
-      sha256 = "83607f8d36827b2a7fca19c9c336caffbebf61a359d0ef7cee44a8bcf3fc2d1f";
+      version = "5.3";
+      sha256 = "d47ababc8cbe548065ef644e9bd88266869e75e2f9e577ebc36bc55bf7a92ec8";
       envvar = "LEVELGAMMA";
     }
 
     {
       name = "G4RadioactiveDecay";
-      version = "5.2";
-      sha256 = "99c038d89d70281316be15c3c98a66c5d0ca01ef575127b6a094063003e2af5d";
+      version = "5.3";
+      sha256 = "5c8992ac57ae56e66b064d3f5cdfe7c2fee76567520ad34a625bfb187119f8c1";
       envvar = "RADIOACTIVE";
     }
 
     {
       name = "G4SAIDDATA";
-      version = "1.1";
-      sha256 = "a38cd9a83db62311922850fe609ecd250d36adf264a88e88c82ba82b7da0ed7f";
+      version = "2.0";
+      sha256 = "1d26a8e79baa71e44d5759b9f55a67e8b7ede31751316a9e9037d80090c72e91";
       envvar = "SAIDXS";
     }
 
     {
-      name = "G4NEUTRONXS";
-      version = "1.4";
-      sha256 = "57b38868d7eb060ddd65b26283402d4f161db76ed2169437c266105cca73a8fd";
-      envvar = "NEUTRONXS";
+      name = "G4PARTICLEXS";
+      version = "1.1";
+      sha256 = "100a11c9ed961152acfadcc9b583a9f649dda4e48ab314fcd4f333412ade9d62";
+      envvar = "PARTICLEXS";
     }
 
     {
@@ -81,6 +83,13 @@ in
     }
 
     {
+      name = "G4INCL";
+      version = "1.0";
+      sha256 = "716161821ae9f3d0565fbf3c2cf34f4e02e3e519eb419a82236eef22c2c4367d";
+      envvar = "INCL";
+    }
+
+    {
       name = "G4PII";
       version = "1.3";
       sha256 = "6225ad902675f4381c98c6ba25fc5a06ce87549aa979634d3d03491d6616e926";
diff --git a/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix b/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix
index 4ec117777857..007e4ad0c32f 100644
--- a/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix
@@ -30,18 +30,18 @@
 , libXpm
 
 # For enableQT, enableXM, enableOpenGLX11, enableRaytracerX11.
-, libGLU_combined
+, libGLU, libGL
 , xlibsWrapper
 , libXmu
 }:
 
-stdenv.mkDerivation {
-  version = "10.4.1";
+stdenv.mkDerivation rec {
+  version = "10.5.1";
   pname = "geant4";
 
   src = fetchurl{
-    url = "http://cern.ch/geant4-data/releases/geant4.10.04.p01.tar.gz";
-    sha256 = "a3eb13e4f1217737b842d3869dc5b1fb978f761113e74bd4eaf6017307d234dd";
+    url = "http://cern.ch/geant4-data/releases/geant4.10.05.p01.tar.gz";
+    sha256 = "f4a292220500fad17e0167ce3153e96e3410ecbe96284e572dc707f63523bdff";
   };
 
   cmakeFlags = [
@@ -64,7 +64,7 @@ stdenv.mkDerivation {
 
   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 ]
@@ -78,7 +78,10 @@ stdenv.mkDerivation {
   setupHook = ./geant4-hook.sh;
 
   passthru = {
-    data = import ./datasets.nix { inherit stdenv fetchurl; };
+    data = import ./datasets.nix {
+          inherit stdenv fetchurl;
+          geant_version = version;
+      };
   };
 
   # Set the myriad of envars required by Geant4 if we use a nix-shell.
@@ -95,7 +98,7 @@ stdenv.mkDerivation {
     '';
     homepage = http://www.geant4.org;
     license = licenses.g4sl;
-    maintainers = with maintainers; [ tmplt ];
+    maintainers = with maintainers; [ tmplt omnipotententity ];
     platforms = platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/physics/geant4/g4py/default.nix b/nixpkgs/pkgs/development/libraries/physics/geant4/g4py/default.nix
index 3d6891c48e2b..dddd7078b86e 100644
--- a/nixpkgs/pkgs/development/libraries/physics/geant4/g4py/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/geant4/g4py/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
   inherit (geant4_nomt) version src;
   pname = "g4py";
 
-  sourceRoot = "geant4.10.04.p01/environments/g4py";
+  sourceRoot = "geant4.10.05.p01/environments/g4py";
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ geant4_nomt xercesc boost_python python ];
diff --git a/nixpkgs/pkgs/development/libraries/physics/hepmc3/default.nix b/nixpkgs/pkgs/development/libraries/physics/hepmc3/default.nix
index 3116c4d36bba..d8aff555e556 100644
--- a/nixpkgs/pkgs/development/libraries/physics/hepmc3/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/hepmc3/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "hepmc3";
-  version = "3.1.1";
+  version = "3.1.2";
 
   src = fetchurl {
     url = "http://hepmc.web.cern.ch/hepmc/releases/HepMC3-${version}.tar.gz";
-    sha256 = "1fs8ha5issls886g03azpwamry1k633zjrcx51v7g7vg9nbckjrg";
+    sha256 = "1izcldnjbyn6myr7nv7b4jivf2vmdi64ng9gk1vjh998755hfcs1";
   };
 
   buildInputs = [ cmake root ];
diff --git a/nixpkgs/pkgs/development/libraries/physics/herwig/default.nix b/nixpkgs/pkgs/development/libraries/physics/herwig/default.nix
index d252e62286b0..d52f92d96394 100644
--- a/nixpkgs/pkgs/development/libraries/physics/herwig/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/physics/pythia/default.nix b/nixpkgs/pkgs/development/libraries/physics/pythia/default.nix
index 0398175a9a28..c37d4b9d2f1a 100644
--- a/nixpkgs/pkgs/development/libraries/physics/pythia/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix b/nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix
index ad5f994620ff..e962303f5f06 100644
--- a/nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix
@@ -1,15 +1,16 @@
-{ stdenv, fetchurl, gfortran }:
+{ stdenv, fetchurl, gfortran, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "QCDNUM";
-  version = "17-01-13";
+  version = "17-01-15";
 
   src = fetchurl {
     url = "http://www.nikhef.nl/user/h24/qcdnum-files/download/qcdnum${builtins.replaceStrings ["-"] [""] version}.tar.gz";
-    sha256 = "0568rjviwvjkfihq2ka7g91vmialr31ryn7c69iqf13rcv5vzcw7";
+    sha256 = "0ibk1sppss45qh0g8i2c99alkx82xdbss3p55f5367bxjx4iqvvg";
   };
 
   nativeBuildInputs = [ gfortran ];
+  buildInputs = [ zlib ];
 
   enableParallelBuilding = true;
 
diff --git a/nixpkgs/pkgs/development/libraries/physics/rivet/default.nix b/nixpkgs/pkgs/development/libraries/physics/rivet/default.nix
index 914eee5c286b..95e44f2364cb 100644
--- a/nixpkgs/pkgs/development/libraries/physics/rivet/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/physics/thepeg/default.nix b/nixpkgs/pkgs/development/libraries/physics/thepeg/default.nix
index fa293eab3500..15c94668581d 100644
--- a/nixpkgs/pkgs/development/libraries/physics/thepeg/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/pipewire/default.nix b/nixpkgs/pkgs/development/libraries/pipewire/default.nix
index cc12cd02a693..3efbea97c5e9 100644
--- a/nixpkgs/pkgs/development/libraries/pipewire/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pipewire/default.nix
@@ -9,13 +9,13 @@ let
   };
 in stdenv.mkDerivation rec {
   pname = "pipewire";
-  version = "0.2.6";
+  version = "0.2.7";
 
   src = fetchFromGitHub {
     owner = "PipeWire";
     repo = "pipewire";
     rev = version;
-    sha256 = "1rv1cprga0zy696pjk6gbb29p7nrbkvyla9iviii0pigflgnz6yl";
+    sha256 = "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc";
   };
 
   outputs = [ "out" "lib" "dev" "doc" ];
diff --git a/nixpkgs/pkgs/development/libraries/plib/default.nix b/nixpkgs/pkgs/development/libraries/plib/default.nix
index c9e8c632c7f1..bbc5eb21c276 100644
--- a/nixpkgs/pkgs/development/libraries/plib/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/plplot/default.nix b/nixpkgs/pkgs/development/libraries/plplot/default.nix
new file mode 100644
index 000000000000..e99ddc3dd085
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/plplot/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, cmake }:
+
+stdenv.mkDerivation rec {
+  pname   = "plplot";
+  version = "5.15.0";
+
+  src = fetchurl {
+    url = "https://downloads.sourceforge.net/project/${pname}/${pname}/${version}%20Source/${pname}-${version}.tar.gz";
+    sha256 = "0ywccb6bs1389zjfmc9zwdvdsvlpm7vg957whh6b5a96yvcf8bdr";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=OFF" "-DBUILD_TEST=ON" ];
+
+  doCheck = true;
+
+  meta = with stdenv.lib; {
+    description = "Cross-platform scientific graphics plotting library";
+    homepage    = "https://plplot.org";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms   = platforms.unix;
+    license     = licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pmdk/default.nix b/nixpkgs/pkgs/development/libraries/pmdk/default.nix
index e945154c0034..27351522789c 100644
--- a/nixpkgs/pkgs/development/libraries/pmdk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pmdk/default.nix
@@ -4,13 +4,13 @@
 
 stdenv.mkDerivation rec {
   pname = "pmdk";
-  version = "1.6";
+  version = "1.7";
 
   src = fetchFromGitHub {
     owner  = "pmem";
     repo   = "pmdk";
     rev    = "refs/tags/${version}";
-    sha256 = "11h9h5ifgaa5f6v9y77s5lmsj7k61qg52992s1361cmvl0ndgl9k";
+    sha256 = "1833sq0f1msaqwn31dn1fp37a6d5zp995i9gkazanydmppi2qy0i";
   };
 
   nativeBuildInputs = [ autoconf pkgconfig ];
diff --git a/nixpkgs/pkgs/development/libraries/poco/default.nix b/nixpkgs/pkgs/development/libraries/poco/default.nix
index c19e343f19ae..ecd20d545d58 100644
--- a/nixpkgs/pkgs/development/libraries/poco/default.nix
+++ b/nixpkgs/pkgs/development/libraries/poco/default.nix
@@ -1,20 +1,20 @@
-{ stdenv, fetchurl, cmake, pkgconfig, zlib, pcre, expat, sqlite, openssl, unixODBC, mysql }:
+{ stdenv, fetchurl, cmake, pkgconfig, zlib, pcre, expat, sqlite, openssl, unixODBC, libmysqlclient }:
 
 stdenv.mkDerivation rec {
   pname = "poco";
 
-  version = "1.9.2";
+  version = "1.9.4";
 
   src = fetchurl {
     url = "https://pocoproject.org/releases/${pname}-${version}/${pname}-${version}-all.tar.gz";
-    sha256 = "0jkbxw6z8l7zpr7bh2xcyzk8a5apzyz4ranhl66gxna1ay0gpzvd";
+    sha256 = "0xzxi3r4v2076kcxhj7b1achma2lqy01spshxq8sfh0jn5bz4d7b";
   };
 
   nativeBuildInputs = [ cmake pkgconfig ];
 
-  buildInputs = [ zlib pcre expat sqlite openssl unixODBC mysql.connector-c ];
+  buildInputs = [ zlib pcre expat sqlite openssl unixODBC libmysqlclient ];
 
-  MYSQL_DIR = mysql.connector-c;
+  MYSQL_DIR = libmysqlclient;
   MYSQL_INCLUDE_DIR = "${MYSQL_DIR}/include/mysql";
 
   cmakeFlags = [
diff --git a/nixpkgs/pkgs/development/libraries/polkit/default.nix b/nixpkgs/pkgs/development/libraries/polkit/default.nix
index b5b9f1f7fa4d..17163c2206cd 100644
--- a/nixpkgs/pkgs/development/libraries/polkit/default.nix
+++ b/nixpkgs/pkgs/development/libraries/polkit/default.nix
@@ -1,15 +1,19 @@
-{ stdenv, fetchurl, pkgconfig, glib, expat, pam, perl
+{ stdenv, fetchurl, pkgconfig, glib, expat, pam, perl, fetchpatch
 , intltool, spidermonkey_60 , gobject-introspection, libxslt, docbook_xsl, dbus
 , docbook_xml_dtd_412, gtk-doc, coreutils
-, useSystemd ? stdenv.isLinux, systemd
-, withGnome ? true
-, doCheck ? stdenv.isLinux
+, useSystemd ? (stdenv.isLinux && !stdenv.hostPlatform.isMusl), systemd, elogind
+, 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,
+# or being unrelated to that.
+, doCheck ? (stdenv.isLinux && !stdenv.hostPlatform.isMusl)
 }:
 
 let
 
   system = "/run/current-system/sw";
-  setuid = "/run/wrappers/bin"; #TODO: from <nixos> config.security.wrapperDir;
+  setuid = "/run/wrappers/bin";
 
 in
 
@@ -22,6 +26,24 @@ stdenv.mkDerivation rec {
     sha256 = "1c9lbpndh5zis22f154vjrhnqw65z8s85nrgl42v738yf6g0q5w8";
   };
 
+  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/commit/5dd4e22efd05d55833c4634b56e473812b5acbf2.patch";
+      sha256 = "17lv7xj5ksa27iv4zpm4zwd4iy8zbwjj4ximslfq3sasiz9kxhlp";
+    })
+  ] ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
+    # Make netgroup support optional (musl does not have it)
+    # Upstream MR: https://gitlab.freedesktop.org/polkit/polkit/merge_requests/10
+    # We use the version of the patch that Alpine uses successfully.
+    (fetchpatch {
+      name = "make-innetgr-optional.patch";
+      url = "https://git.alpinelinux.org/aports/plain/main/polkit/make-innetgr-optional.patch?id=391e7de6ced1a96c2dac812e0b12f1d7e0ea705e";
+      sha256 = "1p9qqqhnrfyjvvd50qh6vpl256kyfblm1qnhz5pm09klrl1bh1n4";
+    })
+  ];
+
   postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
     sed -i -e "s/-Wl,--as-needed//" configure.ac
   '';
@@ -32,11 +54,14 @@ stdenv.mkDerivation rec {
     [ glib gtk-doc pkgconfig intltool perl ]
     ++ [ libxslt docbook_xsl docbook_xml_dtd_412 ]; # man pages
   buildInputs =
-    [ glib expat pam spidermonkey_60 ]
-    ++ stdenv.lib.optional useSystemd systemd
-    ++ stdenv.lib.optional withGnome gobject-introspection;
+    [ expat pam spidermonkey_60 ]
+    # 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;
 
-  NIX_CFLAGS_COMPILE = " -Wno-deprecated-declarations "; # for polkit 0.114 and glib 2.56
+  propagatedBuildInputs = [
+    glib # in .pc Requires
+  ];
 
   preConfigure = ''
     chmod +x test/mocklibc/bin/mocklibc{,-test}.in
@@ -61,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 = [
@@ -75,7 +100,7 @@ stdenv.mkDerivation rec {
   ];
 
   inherit doCheck;
-  checkInputs = [dbus];
+  checkInputs = [ dbus ];
   checkPhase = ''
     # tests need access to the system bus
     dbus-run-session --config-file=${./system_bus.conf} -- sh -c 'DBUS_SYSTEM_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS make check'
@@ -86,6 +111,6 @@ stdenv.mkDerivation rec {
     description = "A toolkit for defining and handling the policy that allows unprivileged processes to speak to privileged processes";
     license = licenses.gpl2;
     platforms = platforms.unix;
-    maintainers = [ ];
+    maintainers = with maintainers; [ worldofpeace ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/poly2tri-c/default.nix b/nixpkgs/pkgs/development/libraries/poly2tri-c/default.nix
new file mode 100644
index 000000000000..a3e42b3ae4b2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/poly2tri-c/default.nix
@@ -0,0 +1,42 @@
+{ stdenv
+, fetchFromGitHub
+, autoreconfHook
+, pkgconfig
+, glib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "poly2tri-c";
+  version = "0.1.0";
+
+  outputs = [ "bin" "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "Paul-Browne";
+    repo = "poly2tri-c";
+    rev = "p2tc-${version}";
+    sha256 = "158vm3wqfxs22b74kqc4prlvjny38qqm3kz5wrgasmx0qciwh0g8";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkgconfig
+  ];
+
+  buildInputs = [
+    glib
+  ];
+
+  NIX_CFLAGS_COMPILE = [
+    "--std=gnu99"
+    "-Wno-error"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Library for generating, refining and rendering 2-Dimensional Constrained Delaunay Triangulations";
+    homepage = "https://code.google.com/archive/p/poly2tri-c/";
+    license = licenses.bsd3;
+    maintainers = with stdenv.lib.maintainers; [ jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/poppler/0.61-CVE-2019-9959.patch b/nixpkgs/pkgs/development/libraries/poppler/0.61-CVE-2019-9959.patch
new file mode 100644
index 000000000000..5c2af7a2adc2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/poppler/0.61-CVE-2019-9959.patch
@@ -0,0 +1,20 @@
+diff --git a/poppler/JPEG2000Stream.cc b/poppler/JPEG2000Stream.cc
+--- a/poppler/JPEG2000Stream.cc
++++ b/poppler/JPEG2000Stream.cc
+@@ -201,7 +201,7 @@ void JPXStream::init()
+   if (getDict()) smaskInData = getDict()->lookup("SMaskInData");
+ 
+   int bufSize = BUFFER_INITIAL_SIZE;
+-  if (oLen.isInt()) bufSize = oLen.getInt();
++  if (oLen.isInt() && oLen.getInt() > 0) bufSize = oLen.getInt();
+ 
+   if (cspace.isArray() && cspace.arrayGetLength() > 0) {
+
+@@ -365,7 +365,7 @@ void JPXStream::init()
+   }
+ 
+   int bufSize = BUFFER_INITIAL_SIZE;
+-  if (oLen.isInt()) bufSize = oLen.getInt();
++  if (oLen.isInt() && oLen.getInt() > 0) bufSize = oLen.getInt();
+ 
+   if (cspace.isArray() && cspace.arrayGetLength() > 0) {
diff --git a/nixpkgs/pkgs/development/libraries/poppler/0.61.nix b/nixpkgs/pkgs/development/libraries/poppler/0.61.nix
index 633c3d69618b..cb9cf16531c5 100644
--- a/nixpkgs/pkgs/development/libraries/poppler/0.61.nix
+++ b/nixpkgs/pkgs/development/libraries/poppler/0.61.nix
@@ -8,7 +8,7 @@
 }:
 
 let
-  version = "0.61.0";
+  version = "0.61.1";
   mkFlag = optset: flag: "-DENABLE_${flag}=${if optset then "on" else "off"}";
 in
 stdenv.mkDerivation rec {
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "${meta.homepage}/poppler-${version}.tar.xz";
-    sha256 = "0zrbb1b77k6bm2qdnra08jnbyllv6vj29790igmp6fzs59xf3kak";
+    sha256 = "1afdrxxkaivvviazxkg5blsf2x24sjkfj92ib0d3q5pm8dihjrhj";
   };
 
   outputs = [ "out" "dev" ];
@@ -27,6 +27,7 @@ stdenv.mkDerivation rec {
       url = "https://cgit.freedesktop.org/poppler/poppler/patch/?id=004e3c10df0abda214f0c293f9e269fdd979c5ee";
       sha256 = "1l8713s57xc6g81bldw934rsfm140fqc7ggd50ha5mxdl1b3app2";
     })
+    ./0.61-CVE-2019-9959.patch
   ];
 
   buildInputs = [ libiconv libintl ] ++ lib.optional withData poppler_data;
diff --git a/nixpkgs/pkgs/development/libraries/poppler/default.nix b/nixpkgs/pkgs/development/libraries/poppler/default.nix
index 28408cb91f88..eb1e9ec732ff 100644
--- a/nixpkgs/pkgs/development/libraries/poppler/default.nix
+++ b/nixpkgs/pkgs/development/libraries/poppler/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, cmake, ninja, pkgconfig, libiconv, libintl
+{ stdenv, lib, fetchurl, fetchpatch, cmake, ninja, pkgconfig, libiconv, libintl
 , zlib, curl, cairo, freetype, fontconfig, lcms, libjpeg, openjpeg
 , withData ? true, poppler_data
 , qt5Support ? false, qtbase ? null
@@ -7,16 +7,16 @@
 , 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" ];
diff --git a/nixpkgs/pkgs/development/libraries/portaudio/default.nix b/nixpkgs/pkgs/development/libraries/portaudio/default.nix
index 92b56467aee9..68daece490fa 100644
--- a/nixpkgs/pkgs/development/libraries/portaudio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/portaudio/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   buildInputs = [ libjack2 ]
     ++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib;
 
-  configureFlags = [ "--disable-mac-universal --enable-cxx" ];
+  configureFlags = [ "--disable-mac-universal" "--enable-cxx" ];
 
   NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=nullability-inferred-on-nested-type -Wno-error=nullability-completeness-on-arrays";
 
diff --git a/nixpkgs/pkgs/development/libraries/precice/default.nix b/nixpkgs/pkgs/development/libraries/precice/default.nix
new file mode 100644
index 000000000000..cdce346fe792
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/prometheus-cpp/default.nix b/nixpkgs/pkgs/development/libraries/prometheus-cpp/default.nix
index 6f49db4d206f..624b23f4d600 100644
--- a/nixpkgs/pkgs/development/libraries/prometheus-cpp/default.nix
+++ b/nixpkgs/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 ];
@@ -28,9 +28,10 @@ stdenv.mkDerivation rec {
     "-DUSE_THIRDPARTY_LIBRARIES=OFF"
     "-DCIVETWEB_INCLUDE_DIR=${civetweb.dev}/include"
     "-DCIVETWEB_CXX_LIBRARY=${civetweb}/lib/libcivetweb${stdenv.targetPlatform.extensions.sharedLibrary}"
+    "-DBUILD_SHARED_LIBS=ON"
   ];
 
-  NIX_LDFLAGS = [ "-ldl" ];
+  NIX_LDFLAGS = "-ldl";
 
   meta = {
     description = "Prometheus Client Library for Modern C++";
diff --git a/nixpkgs/pkgs/development/libraries/protobuf/3.10.nix b/nixpkgs/pkgs/development/libraries/protobuf/3.10.nix
new file mode 100644
index 000000000000..5ecb8e67f841
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobuf/3.10.nix
@@ -0,0 +1,6 @@
+{ callPackage, ... }:
+
+callPackage ./generic-v3.nix {
+  version = "3.10.1";
+  sha256 = "1kbi2i1m5c7ss02ip8h0bdzvns4dgxx30a5c0iiph8g2ns02lr33";
+}
diff --git a/nixpkgs/pkgs/development/libraries/protobuf/3.11.nix b/nixpkgs/pkgs/development/libraries/protobuf/3.11.nix
new file mode 100644
index 000000000000..7e89463aad6c
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/protobuf/3.9.nix b/nixpkgs/pkgs/development/libraries/protobuf/3.9.nix
index a2f3e0e01646..e74d5c527b1d 100644
--- a/nixpkgs/pkgs/development/libraries/protobuf/3.9.nix
+++ b/nixpkgs/pkgs/development/libraries/protobuf/3.9.nix
@@ -1,6 +1,6 @@
 { callPackage, ... }:
 
 callPackage ./generic-v3.nix {
-  version = "3.9.1";
-  sha256 = "0vv85xb65dx6fa76fsnyps13kaamvwfzd8hr6ii1payr73x4zy2h";
+  version = "3.9.2";
+  sha256 = "080zxa9w1pxp5y05aiwc0c8mlqkkh98wmid4l7m99cliphsd4qnn";
 }
diff --git a/nixpkgs/pkgs/development/libraries/protolock/default.nix b/nixpkgs/pkgs/development/libraries/protolock/default.nix
new file mode 100644
index 000000000000..f1eb3ae51f32
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protolock/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "protolock";
+  version = "0.15.0";
+
+  src = fetchFromGitHub {
+    owner = "nilslice";
+    repo = "protolock";
+    rev = "v${version}";
+    sha256 = "0qg26vcqdhgy91p6wiv16dq73ay0fymran3d8ylca9264zwi2vxw";
+  };
+
+  modSha256 = "1q755ipqsfpr41s5fxzmx50lwcdqc5a7akwx6mzn789w2z07x8lg";
+
+  postInstall = ''
+    rm $out/bin/plugin*
+  '';
+
+  meta = with lib; {
+    description = "Protocol Buffer companion tool. Track your .proto files and prevent changes to messages and services which impact API compatibility. https://protolock.dev";
+    homepage = "https://github.com/nilslice/protolock";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ groodt ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pstreams/default.nix b/nixpkgs/pkgs/development/libraries/pstreams/default.nix
new file mode 100644
index 000000000000..a734ac1e9fdf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pstreams/default.nix
@@ -0,0 +1,40 @@
+{ stdenv
+, fetchgit
+}:
+
+stdenv.mkDerivation rec {
+  pname = "PStreams";
+  version = "1.0.1";
+
+  src = fetchgit {
+    url = https://git.code.sf.net/p/pstreams/code;
+    rev = let dot2Underscore = stdenv.lib.strings.stringAsChars (c: if c == "." then "_" else c);
+          in "RELEASE_${dot2Underscore version}";
+    sha256 = "0r8aj0nh5mkf8cvnzl8bdy4nm7i74vs83axxfimcd74kjfn0irys";
+  };
+
+  makeFlags = [ "prefix=${placeholder "out"}" ];
+  dontBuild = true;
+  doCheck = true;
+
+  preInstall = "rm INSTALL";
+    # `make install` fails on case-insensitive file systems (e.g. APFS by
+    # default) because this target exists
+
+  meta = with stdenv.lib; {
+    description = "POSIX Process Control in C++";
+    longDescription = ''
+      PStreams allows you to run another program from your C++ application and
+      to transfer data between the two programs similar to shell pipelines.
+
+      In the simplest case, a PStreams class is like a C++ wrapper for the
+      POSIX.2 functions popen(3) and pclose(3), using C++ iostreams instead of
+      C's stdio library.
+    '';
+    homepage = http://pstreams.sourceforge.net/;
+    downloadPage = http://pstreams.sourceforge.net/download/;
+    maintainers = with maintainers; [ arthur ];
+    license = licenses.boost;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ptlib/default.nix b/nixpkgs/pkgs/development/libraries/ptlib/default.nix
deleted file mode 100644
index e7abedf31214..000000000000
--- a/nixpkgs/pkgs/development/libraries/ptlib/default.nix
+++ /dev/null
@@ -1,59 +0,0 @@
-{ stdenv, fetchurl, fetchpatch, pkgconfig, bison, flex, unixODBC, gnome3
-, openssl, openldap, cyrus_sasl, kerberos, expat, SDL, libdv, libv4l, alsaLib }:
-
-stdenv.mkDerivation rec {
-  pname = "ptlib";
-  version = "2.10.11";
-
-  src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1jf27mjz8vqnclhrhrpn7niz4c177kcjbd1hc7vn65ihcqfz05rs";
-  };
-
-  NIX_CFLAGS_COMPILE = "-std=gnu++98";
-
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ bison flex unixODBC openssl openldap
-                  cyrus_sasl kerberos expat SDL libdv libv4l alsaLib ];
-
-  enableParallelBuilding = true;
-
-  patches = [
-    (fetchpatch { url = http://sources.debian.net/data/main/p/ptlib/2.10.11~dfsg-2.1/debian/patches/bison-fix;
-      sha256 = "0vzv9kyn9s628z8wy2gva380gi1rmhxilwlg5pikl5a0wn8p46nw";
-    })
-    (fetchpatch { url = http://sources.debian.net/data/main/p/ptlib/2.10.11~dfsg-2.1/debian/patches/no-sslv3;
-      sha256 = "172s1dnnrl54p9sf1nl7s475sm78rpw3p8jxi0pdx6izzl8hcdr0";
-    })
-    (fetchpatch {
-      name = "openssl-1.1.patch";
-      url = "https://git.archlinux.org/svntogit/packages.git/plain/trunk/openssl-1.1.0.patch?h=packages/ptlib&id=1dfa9f55e7e030d261228fca27dda82979ca7f30";
-      sha256 = "11hdgyyibycg0wf5ls0wk9hksa4jd434i86xqiccbyg17n4l6lc1";
-    })
-    ./ptlib-2.10.11-glibc-2.26.patch
-  ];
-
-  # fix typedef clashes with unixODBC>=2.3.5
-  postPatch = ''
-    substituteInPlace include/ptlib/unix/ptlib/contain.h \
-      --replace "typedef uintptr_t    UINT" "typedef unsigned int    UINT" \
-      --replace "typedef wchar_t                 WCHAR" "typedef unsigned short          WCHAR"
-  '';
-
-  meta = with stdenv.lib; {
-    description = "Portable Tools from OPAL VoIP";
-    maintainers = [ maintainers.raskin ];
-    homepage = "http://www.opalvoip.org/";
-    platforms = platforms.linux;
-    license = with licenses; [ beerware bsdOriginal mpl10 ];
-  };
-
-  passthru = {
-    updateInfo = {
-      downloadPage = "http://ftp.gnome.org/sources/ptlib/";
-    };
-    updateScript = gnome3.updateScript {
-      packageName = pname;
-    };
-  };
-}
diff --git a/nixpkgs/pkgs/development/libraries/ptlib/ptlib-2.10.11-glibc-2.26.patch b/nixpkgs/pkgs/development/libraries/ptlib/ptlib-2.10.11-glibc-2.26.patch
deleted file mode 100644
index 300c3736abf7..000000000000
--- a/nixpkgs/pkgs/development/libraries/ptlib/ptlib-2.10.11-glibc-2.26.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/ptlib/unix/channel.cxx b/src/ptlib/unix/channel.cxx
-index 3b17dda..2dcaa18 100644
---- a/src/ptlib/unix/channel.cxx
-+++ b/src/ptlib/unix/channel.cxx
-@@ -36,7 +36,7 @@
- 
- #include <ptlib.h>
- #include <sys/ioctl.h>
--
-+#include <sys/uio.h>
- 
- #include "../common/pchannel.cxx"
- 
diff --git a/nixpkgs/pkgs/development/libraries/pybind11/default.nix b/nixpkgs/pkgs/development/libraries/pybind11/default.nix
deleted file mode 100644
index 7dfbdc4d64a0..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/pybind11/no_test_cmake_build.patch b/nixpkgs/pkgs/development/libraries/pybind11/no_test_cmake_build.patch
deleted file mode 100644
index c5d6ecc4481e..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qca2/default.nix b/nixpkgs/pkgs/development/libraries/qca2/default.nix
index 19b11a60e7b6..4894bee96092 100644
--- a/nixpkgs/pkgs/development/libraries/qca2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qca2/default.nix
@@ -1,16 +1,16 @@
-{ stdenv, fetchurl, openssl_1_0_2, cmake, pkgconfig, qt, darwin }:
+{ stdenv, fetchurl, openssl, cmake, pkgconfig, qt, darwin }:
 
 stdenv.mkDerivation rec {
   pname = "qca";
-  version = "2.1.3";
+  version = "2.2.1";
 
   src = fetchurl {
-    url = "http://download.kde.org/stable/qca/${version}/src/qca-${version}.tar.xz";
-    sha256 = "0lz3n652z208daxypdcxiybl0a9fnn6ida0q7fh5f42269mdhgq0";
+    url = "http://download.kde.org/stable/qca/${version}/qca-${version}.tar.xz";
+    sha256 = "00kv1vsrc8fp556hm8s6yw3240vx3l4067q6vfxrb3gdwgcd45np";
   };
 
   nativeBuildInputs = [ cmake pkgconfig ];
-  buildInputs = [ openssl_1_0_2 qt ]
+  buildInputs = [ openssl qt ]
     ++ stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
 
   enableParallelBuilding = true;
diff --git a/nixpkgs/pkgs/development/libraries/qgnomeplatform/default.nix b/nixpkgs/pkgs/development/libraries/qgnomeplatform/default.nix
index 94c69a4a14b3..3626e15cfc75 100644
--- a/nixpkgs/pkgs/development/libraries/qgnomeplatform/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/qoauth/default.nix b/nixpkgs/pkgs/development/libraries/qoauth/default.nix
index 0d9ae21e87e3..83e904e53eb2 100644
--- a/nixpkgs/pkgs/development/libraries/qoauth/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qoauth/default.nix
@@ -18,8 +18,8 @@ stdenv.mkDerivation {
   buildInputs = [ qt5.qtbase qca2-qt5 ];
   nativeBuildInputs = [ qt5.qmake ];
 
-  NIX_CFLAGS_COMPILE = [ "-I${qca2-qt5}/include/Qca-qt5/QtCrypto" ];
-  NIX_LDFLAGS = [ "-lqca-qt5" ];
+  NIX_CFLAGS_COMPILE = "-I${qca2-qt5}/include/Qca-qt5/QtCrypto";
+  NIX_LDFLAGS = "-lqca-qt5";
 
   meta = with stdenv.lib; {
     description = "Qt library for OAuth authentication";
diff --git a/nixpkgs/pkgs/development/libraries/qpdf/default.nix b/nixpkgs/pkgs/development/libraries/qpdf/default.nix
index 789a63bef74d..68362be596b6 100644
--- a/nixpkgs/pkgs/development/libraries/qpdf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qpdf/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, libjpeg, zlib, perl }:
 
-let version = "8.4.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 = "1hrys6zmia8fw6f6ih3ckgsc1jr12fizdwaiy7dyd64kxxjhm8v9";
+    sha256 = "0ygd80wxcmh613n04x2kmf8wlsl0drxyd5wwdcrm1rzj0xwvpfrs";
   };
 
   nativeBuildInputs = [ perl ];
diff --git a/nixpkgs/pkgs/development/libraries/qrupdate/default.nix b/nixpkgs/pkgs/development/libraries/qrupdate/default.nix
index 85e45d3fad03..3e0dc99f81fc 100644
--- a/nixpkgs/pkgs/development/libraries/qrupdate/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qrupdate/default.nix
@@ -28,9 +28,7 @@ stdenv.mkDerivation {
 
   buildFlags = [ "lib" "solib" ];
 
-  installTargets = if stdenv.isDarwin
-                   then ["install-staticlib" "install-shlib"]
-                   else "install";
+  installTargets = stdenv.lib.optionals stdenv.isDarwin [ "install-staticlib" "install-shlib" ];
 
   buildInputs = [ gfortran openblas ];
 
diff --git a/nixpkgs/pkgs/development/libraries/qscintilla/default.nix b/nixpkgs/pkgs/development/libraries/qscintilla/default.nix
index 43f0e431bb15..a8be20b73b12 100644
--- a/nixpkgs/pkgs/development/libraries/qscintilla/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qscintilla/default.nix
@@ -4,22 +4,26 @@
 , fixDarwinDylibNames
 }:
 
-# Fix Xcode 8 compilation problem
-let xcodePatch =
-  fetchurl { url = "https://raw.githubusercontent.com/Homebrew/formula-patches/a651d71/qscintilla2/xcode-8.patch";
-             sha256 = "1a88309fdfd421f4458550b710a562c622d72d6e6fdd697107e4a43161d69bc9"; };
-in
-stdenv.mkDerivation rec {
-  pname = "qscintilla";
-  version = "2.9.4";
+let
+  # Fix Xcode 8 compilation problem
+  xcodePatch = fetchurl {
+    url = "https://raw.githubusercontent.com/Homebrew/formula-patches/a651d71/qscintilla2/xcode-8.patch";
+    sha256 = "1a88309fdfd421f4458550b710a562c622d72d6e6fdd697107e4a43161d69bc9";
+  };
+
+  pname = "qscintilla-qt${if withQt5 then "5" else "4"}";
+  version = "2.11.2";
 
-  name = "${pname}-${if withQt5 then "qt5" else "qt4"}-${version}";
+in stdenv.mkDerivation rec {
+  inherit pname version;
 
   src = fetchurl {
-    url = "mirror://sourceforge/pyqt/QScintilla2/QScintilla-${version}/QScintilla_gpl-${version}.zip";
-    sha256 = "04678skipydx68zf52vznsfmll2v9aahr66g50lcqbr6xsmgr1yi";
+    url = "https://www.riverbankcomputing.com/static/Downloads/QScintilla/${version}/QScintilla_gpl-${version}.tar.gz";
+    sha256 = "18glb2v07mwfz6p8qmwhzcaaczyc36x3gn9wx8ndm7q6d93xr6q2";
   };
 
+  sourceRoot = "QScintilla_gpl-${version}/Qt4Qt5";
+
   buildInputs = [ (if withQt5 then qtbase else qt4) ];
 
   propagatedBuildInputs = lib.optional (withQt5 && stdenv.isDarwin) qtmacextras;
@@ -28,24 +32,25 @@ stdenv.mkDerivation rec {
     ++ (if withQt5 then [ qmake ] else [ qmake4Hook ])
     ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
+  patches = (lib.optional (stdenv.isDarwin && withQt5) xcodePatch) ++
+            (lib.optional (!withQt5) ./fix-qt4-build.patch );
 
-  patches = lib.optional (stdenv.isDarwin && withQt5) [ xcodePatch ];
+  # Make sure that libqscintilla2.so is available in $out/lib since it is expected
+  # by some packages such as sqlitebrowser
+  postFixup = ''
+    ln -s $out/lib/libqscintilla2_qt?.so $out/lib/libqscintilla2.so
+  '';
 
   enableParallelBuilding = true;
 
-  preConfigure = ''
-    cd Qt4Qt5
-    sed -i qscintilla.pro \
-      -e "s,\$\$\\[QT_INSTALL_LIBS\\],$out/lib," \
-      -e "s,\$\$\\[QT_INSTALL_HEADERS\\],$out/include/," \
-      -e "s,\$\$\\[QT_INSTALL_TRANSLATIONS\\],$out/translations," \
-    ${if withQt5 then ''
-      -e "s,\$\$\\[QT_HOST_DATA\\]/mkspecs,$out/mkspecs," \
-      -e "s,\$\$\\[QT_INSTALL_DATA\\]/mkspecs,$out/mkspecs," \
-      -e "s,\$\$\\[QT_INSTALL_DATA\\],$out/share,"
-    '' else ''
-      -e "s,\$\$\\[QT_INSTALL_DATA\\],$out/share/qt,"
-    ''}
+  postPatch = ''
+    substituteInPlace qscintilla.pro \
+      --replace '$$[QT_INSTALL_LIBS]'         $out/lib \
+      --replace '$$[QT_INSTALL_HEADERS]'      $out/include \
+      --replace '$$[QT_INSTALL_TRANSLATIONS]' $out/translations \
+      --replace '$$[QT_HOST_DATA]/mkspecs'    $out/mkspecs \
+      --replace '$$[QT_INSTALL_DATA]/mkspecs' $out/mkspecs \
+      --replace '$$[QT_INSTALL_DATA]'         $out/share${lib.optionalString (! withQt5) "/qt"}
   '';
 
   meta = with stdenv.lib; {
@@ -64,9 +69,9 @@ stdenv.mkDerivation rec {
       proportional fonts, bold and italics, multiple foreground and
       background colours and multiple fonts.
     '';
-    homepage = http://www.riverbankcomputing.com/software/qscintilla/intro;
+    homepage = https://www.riverbankcomputing.com/software/qscintilla/intro;
     license = with licenses; [ gpl2 gpl3 ]; # and commercial
-    platforms = platforms.unix;
     maintainers = with maintainers; [ peterhoeg ];
+    platforms = platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/qscintilla/fix-qt4-build.patch b/nixpkgs/pkgs/development/libraries/qscintilla/fix-qt4-build.patch
new file mode 100644
index 000000000000..520a55b1ea21
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qscintilla/fix-qt4-build.patch
@@ -0,0 +1,11 @@
+diff -ur QScintilla_gpl-2.11.2/Qt4Qt5/Qsci/qsciscintillabase.h QScintilla_gpl-2.11.2-fix/Qt4Qt5/Qsci/qsciscintillabase.h
+--- Qt4Qt5/Qsci/qsciscintillabase.h	2019-06-25 14:49:27.000000000 +0200
++++ Qt4Qt5-fix/Qsci/qsciscintillabase.h	2019-10-04 10:22:26.337474261 +0200
+@@ -27,6 +27,7 @@
+ #include <QByteArray>
+ #include <QPoint>
+ #include <QTimer>
++#include <QUrl>
+ 
+ #include <Qsci/qsciglobal.h>
+ 
diff --git a/nixpkgs/pkgs/development/libraries/qt-3/default.nix b/nixpkgs/pkgs/development/libraries/qt-3/default.nix
index 3b3f406485c7..98519ae294a4 100644
--- a/nixpkgs/pkgs/development/libraries/qt-3/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-3/default.nix
@@ -5,10 +5,10 @@
 , xineramaSupport ? true, libXinerama ? null
 , cursorSupport ? true, libXcursor ? null
 , threadSupport ? true
-, mysqlSupport ? false, mysql ? null
+, 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
 }:
 
@@ -16,8 +16,8 @@ assert xftSupport -> libXft != null;
 assert xrenderSupport -> xftSupport && libXrender != null;
 assert xrandrSupport -> libXrandr != null;
 assert cursorSupport -> libXcursor != null;
-assert mysqlSupport -> mysql != null;
-assert openglSupport -> libGLU_combined != null && libXmu != null;
+assert mysqlSupport -> libmysqlclient != 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"
@@ -62,7 +62,7 @@ stdenv.mkDerivation {
   ] ++ stdenv.lib.optionals cursorSupport [
     "-L${libXcursor.out}/lib -I${libXcursor.dev}/include"
   ] ++ stdenv.lib.optionals mysqlSupport [
-    "-qt-sql-mysql" "-L${mysql.connector-c}/lib/mysql" "-I${mysql.connector-c}/include/mysql"
+    "-qt-sql-mysql" "-L${libmysqlclient}/lib/mysql" "-I${libmysqlclient}/include/mysql"
   ] ++ stdenv.lib.optionals xftSupport [
     "-L${libXft.out}/lib" "-I${libXft.dev}/include"
     "-L${libXft.freetype.out}/lib" "-I${libXft.freetype.dev}/include"
diff --git a/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/default.nix b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/default.nix
index b5a10e8f11a7..25953949eb76 100644
--- a/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/default.nix
@@ -2,7 +2,7 @@
 , libXrender, libXinerama, libXcursor, libXv, libXext
 , libXfixes, libXrandr, libSM, freetype, fontconfig, zlib, libjpeg, libpng
 , libmng, which, libGLU, openssl, dbus, cups, pkgconfig
-, libtiff, glib, icu, mysql, postgresql, sqlite, perl, coreutils, libXi
+, libtiff, glib, icu, libmysqlclient, postgresql, sqlite, perl, coreutils, libXi
 , buildMultimedia ? stdenv.isLinux, alsaLib, gstreamer, gst-plugins-base
 , buildWebkit ? (stdenv.isLinux || stdenv.isDarwin)
 , libGLSupported ? stdenv.lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
@@ -93,6 +93,12 @@ stdenv.mkDerivation rec {
       #})
       ./qt4-gcc6.patch
       ./qt4-openssl-1.1.patch
+      (fetchpatch {
+        name = "gcc9-foreach.patch";
+        url = "https://salsa.debian.org/qt-kde-team/qt/qt4-x11/raw/"
+          + "0d4a3dd61ccb156dee556c214dbe91c04d44a717/debian/patches/gcc9-qforeach.patch";
+        sha256 = "0dzn6qxrgxb75rvck9kmy5gspawdn970wsjw56026dhkih8cp3pg";
+      })
     ]
     ++ lib.optional gtkStyle (substituteAll ({
         src = ./dlopen-gtkstyle.diff;
@@ -166,7 +172,7 @@ stdenv.mkDerivation rec {
     (mk (!stdenv.isFreeBSD) "opengl") "-xrender" "-xrandr" "-xinerama" "-xcursor" "-xinput" "-xfixes" "-fontconfig"
     "-qdbus" (mk (cups != null) "cups") "-glib" "-dbus-linked" "-openssl-linked"
 
-    "-${if mysql != null then "plugin" else "no"}-sql-mysql" "-system-sqlite"
+    "-${if libmysqlclient != null then "plugin" else "no"}-sql-mysql" "-system-sqlite"
 
     "-exceptions" "-xmlpatterns"
 
@@ -192,7 +198,7 @@ stdenv.mkDerivation rec {
   buildInputs =
     [ cups # Qt dlopen's libcups instead of linking to it
       postgresql sqlite libjpeg libmng libtiff icu ]
-    ++ lib.optionals (mysql != null) [ mysql.connector-c ]
+    ++ lib.optionals (libmysqlclient != null) [ libmysqlclient ]
     ++ lib.optionals gtkStyle [ gtk2 gdk-pixbuf ]
     ++ lib.optionals stdenv.isDarwin [ ApplicationServices OpenGL Cocoa AGL libcxx libobjc ];
 
@@ -200,13 +206,13 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  NIX_CFLAGS_COMPILE =
+  NIX_CFLAGS_COMPILE = toString (
     # with gcc7 the warnings blow the log over Hydra's limit
     [ "-Wno-expansion-to-defined" "-Wno-unused-local-typedefs" ]
     ++ lib.optional stdenv.isLinux "-std=gnu++98" # gnu++ in (Obj)C flags is no good on Darwin
     ++ lib.optionals (stdenv.isFreeBSD || stdenv.isDarwin)
       [ "-I${glib.dev}/include/glib-2.0" "-I${glib.out}/lib/glib-2.0/include" ]
-    ++ lib.optional stdenv.isDarwin "-I${libcxx}/include/c++/v1";
+    ++ lib.optional stdenv.isDarwin "-I${libcxx}/include/c++/v1");
 
   NIX_LDFLAGS = lib.optionalString (stdenv.isFreeBSD || stdenv.isDarwin) "-lglib-2.0";
 
diff --git a/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt4-gcc6.patch b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt4-gcc6.patch
index 000e345cf132..dfd1d8b893b0 100644
--- a/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt4-gcc6.patch
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt4-gcc6.patch
@@ -5,7 +5,7 @@
  	# Check gcc's version
  	case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
 -	    5*|4*|3.4*)
-+	    8*|7*|6*|5*|4*|3.4*)
++	    9*|8*|7*|6*|5*|4*|3.4*)
  		;;
              3.3*)
                  canBuildWebKit="no"
@@ -14,7 +14,7 @@
          COMPILER_VERSION="3.*"
          ;;
 -    5*|4.*)
-+    8*|7*|6*|5*|4.*)
++    9*|8*|7*|6*|5*|4.*)
          COMPILER_VERSION="4"
          ;;
      *)
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.11/default.nix b/nixpkgs/pkgs/development/libraries/qt-5/5.11/default.nix
index 296db2eab2db..a10c50c9946b 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/5.11/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.11/default.nix
@@ -53,6 +53,10 @@ let
     qtbase = [
       ./qtbase.patch
       ./qtbase-fixguicmake.patch
+      (fetchpatch {
+        url = "https://code.qt.io/cgit/qt/qtbase.git/patch/?id=a52d7861edfb5956";
+        sha256 = "0as047qybh6w9xz2wd569kixwsibj3qid5nkd3l5w5v3lk80af3v";
+      })
     ];
     qtdeclarative = [ ./qtdeclarative.patch ];
     qtscript = [
@@ -69,6 +73,13 @@ let
     qtwebengine = [
       ./qtwebengine-no-build-skip.patch
       ./qtwebengine-darwin-no-platform-check.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";
+      })
     ];
     qtwebkit = [ ./qtwebkit.patch ];
   };
@@ -152,9 +163,7 @@ let
       qmake = makeSetupHook {
         deps = [ self.qtbase.dev ];
         substitutions = {
-          inherit (stdenv) isDarwin;
-          qtbase_dev = self.qtbase.dev;
-          fix_qt_builtin_paths = ../hooks/fix-qt-builtin-paths.sh;
+          fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
         };
       } ../hooks/qmake-hook.sh;
 
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.11/fetch.sh b/nixpkgs/pkgs/development/libraries/qt-5/5.11/fetch.sh
deleted file mode 100644
index 2ab3dd71c24f..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.11/qtbase-fixguicmake.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.11/qtbase-fixguicmake.patch
deleted file mode 100644
index 8b46d432812a..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.11/qtbase.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.11/qtbase.patch
deleted file mode 100644
index 7d8407f6daf8..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.11/qtdeclarative.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.11/qtdeclarative.patch
deleted file mode 100644
index cfa68eb8102c..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.11/qtscript.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.11/qtscript.patch
deleted file mode 100644
index 5508dec1280e..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.11/qtserialport.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.11/qtserialport.patch
deleted file mode 100644
index f25524e80bcf..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.11/qttools.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.11/qttools.patch
deleted file mode 100644
index 622efc35b6b6..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-no-platform-check.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.11/qtwebengine-darwin-no-platform-check.patch
deleted file mode 100644
index 3e1a8762b361..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.11/qtwebengine-no-build-skip.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.11/qtwebengine-no-build-skip.patch
deleted file mode 100644
index f332d5e1bb2b..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.11/qtwebkit.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.11/qtwebkit.patch
deleted file mode 100644
index b94a4b76cbab..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.11/srcs.nix b/nixpkgs/pkgs/development/libraries/qt-5/5.11/srcs.nix
deleted file mode 100644
index cff49b180337..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.12/default.nix b/nixpkgs/pkgs/development/libraries/qt-5/5.12/default.nix
index 7b4addd91617..8d27f3a0d4ba 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/5.12/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/default.nix
@@ -16,7 +16,7 @@ top-level attribute to `top-level/all-packages.nix`.
 
 {
   newScope,
-  stdenv, fetchurl, fetchFromGitHub, makeSetupHook, makeWrapper,
+  stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper,
   bison, cups ? null, harfbuzz, libGL, perl,
   gstreamer, gst-plugins-base, gtk3, dconf,
   llvmPackages_5,
@@ -50,15 +50,36 @@ let
   };
 
   patches = {
-    qtbase = [
-      ./qtbase.patch
-      ./qtbase-fixguicmake.patch
-    ];
+    qtbase =
+      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
+        ./qtbase.patch.d/0004-qtbase-replace-libdir.patch
+        ./qtbase.patch.d/0005-qtbase-cmake.patch
+        ./qtbase.patch.d/0006-qtbase-gtk3.patch
+        ./qtbase.patch.d/0007-qtbase-xcursor.patch
+        ./qtbase.patch.d/0008-qtbase-xcompose.patch
+        ./qtbase.patch.d/0009-qtbase-tzdir.patch
+        ./qtbase.patch.d/0010-qtbase-qtpluginpath.patch
+        ./qtbase.patch.d/0011-qtbase-assert.patch
+        ./qtbase.patch.d/0012-fix-header_module.patch
+      ];
     qtdeclarative = [ ./qtdeclarative.patch ];
     qtscript = [ ./qtscript.patch ];
     qtserialport = [ ./qtserialport.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.isDarwin ./qtwebengine-darwin-no-platform-check.patch;
     qtwebkit = [ ./qtwebkit.patch ]
@@ -148,9 +169,7 @@ let
       qmake = makeSetupHook {
         deps = [ self.qtbase.dev ];
         substitutions = {
-          inherit (stdenv) isDarwin;
-          qtbase_dev = self.qtbase.dev;
-          fix_qt_builtin_paths = ../hooks/fix-qt-builtin-paths.sh;
+          fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
         };
       } ../hooks/qmake-hook.sh;
 
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/fetch.sh b/nixpkgs/pkgs/development/libraries/qt-5/5.12/fetch.sh
index a4d2fc82ff2d..9f99879511e6 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/5.12/fetch.sh
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/fetch.sh
@@ -1 +1 @@
-WGET_ARGS=( http://download.qt.io/official_releases/qt/5.12/5.12.3/submodules/ )
+WGET_ARGS=( http://download.qt.io/official_releases/qt/5.12/5.12.6/submodules/ )
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase-fixguicmake.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase-fixguicmake.patch
deleted file mode 100644
index 8b46d432812a..000000000000
--- a/nixpkgs/pkgs/development/libraries/qt-5/5.12/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/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch
deleted file mode 100644
index 87ed0ddc4d4c..000000000000
--- a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch
+++ /dev/null
@@ -1,1146 +0,0 @@
-diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/common/mac.conf qtbase-everywhere-src-5.12.3-b/mkspecs/common/mac.conf
---- qtbase-everywhere-src-5.12.3-a/mkspecs/common/mac.conf	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/mkspecs/common/mac.conf	2019-07-10 09:35:08.917628566 -0500
-@@ -24,7 +24,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 -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/create_cmake.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/create_cmake.prf
---- qtbase-everywhere-src-5.12.3-a/mkspecs/features/create_cmake.prf	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/create_cmake.prf	2019-07-10 09:35:08.917628566 -0500
-@@ -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()
-@@ -318,7 +293,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 -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in qtbase-everywhere-src-5.12.3-b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
---- qtbase-everywhere-src-5.12.3-a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in	2019-07-10 09:35:08.917628566 -0500
-@@ -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
-@@ -272,25 +228,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()
-@@ -309,25 +253,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()
-@@ -346,11 +278,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 -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/mac/default_post.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/mac/default_post.prf
---- qtbase-everywhere-src-5.12.3-a/mkspecs/features/mac/default_post.prf	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/mac/default_post.prf	2019-07-10 09:35:08.917628566 -0500
-@@ -64,202 +64,6 @@
-     }
- }
- 
--# 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
--
- !macx-xcode {
-     generate_xcode_project.commands = @$(QMAKE) -spec macx-xcode $(EXPORT__PRO_FILE_)
-     generate_xcode_project.target = xcodeproj
-diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/mac/default_pre.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/mac/default_pre.prf
---- qtbase-everywhere-src-5.12.3-a/mkspecs/features/mac/default_pre.prf	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/mac/default_pre.prf	2019-07-10 09:35:08.917628566 -0500
-@@ -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 -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/mac/sdk.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/mac/sdk.prf
---- qtbase-everywhere-src-5.12.3-a/mkspecs/features/mac/sdk.prf	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/mac/sdk.prf	2019-07-10 09:35:08.917628566 -0500
-@@ -1,54 +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)
--
--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 -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qml_module.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qml_module.prf
---- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qml_module.prf	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qml_module.prf	2019-07-10 09:35:08.917628566 -0500
-@@ -54,7 +54,7 @@
- 
- qmldir.files = $$qmldir_file
- install_qml_files: qmldir.files += $$fq_qml_files
--qmldir.path = $$[QT_INSTALL_QML]/$$TARGETPATH
-+qmldir.path = $$NIX_OUTPUT_QML/$$TARGETPATH
- INSTALLS += qmldir
- 
- qmlfiles.base = $$_PRO_FILE_PWD_
-diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qml_plugin.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qml_plugin.prf
---- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qml_plugin.prf	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qml_plugin.prf	2019-07-10 09:35:08.918628595 -0500
-@@ -50,7 +50,7 @@
- 
- DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
- 
--target.path = $$[QT_INSTALL_QML]/$$TARGETPATH
-+target.path = $$NIX_OUTPUT_QML/$$TARGETPATH
- INSTALLS += target
- 
- # Some final setup
-diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_app.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_app.prf
---- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_app.prf	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_app.prf	2019-07-10 09:35:08.918628595 -0500
-@@ -30,7 +30,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 -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_build_paths.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_build_paths.prf
---- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_build_paths.prf	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_build_paths.prf	2019-07-10 09:35:08.918628595 -0500
-@@ -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
- }
-diff -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_common.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_common.prf
---- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_common.prf	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_common.prf	2019-07-10 09:35:08.918628595 -0500
-@@ -34,8 +34,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 -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_docs.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_docs.prf
---- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_docs.prf	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_docs.prf	2019-07-10 09:35:08.918628595 -0500
-@@ -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 -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_example_installs.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_example_installs.prf
---- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_example_installs.prf	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_example_installs.prf	2019-07-10 09:35:08.918628595 -0500
-@@ -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 -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_functions.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_functions.prf
---- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_functions.prf	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_functions.prf	2019-07-10 09:35:08.918628595 -0500
-@@ -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 -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_installs.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_installs.prf
---- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_installs.prf	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_installs.prf	2019-07-10 09:35:08.918628595 -0500
-@@ -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,35 +23,35 @@
- #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
-     generated_privates: \
-         private_headers.CONFIG += no_check_exist
-     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 -aur qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_plugin.prf qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_plugin.prf
---- qtbase-everywhere-src-5.12.3-a/mkspecs/features/qt_plugin.prf	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/mkspecs/features/qt_plugin.prf	2019-07-10 09:35:08.918628595 -0500
-@@ -88,7 +88,7 @@
-     }
- }
- 
--target.path = $$[QT_INSTALL_PLUGINS]/$$PLUGIN_TYPE
-+target.path = $$NIX_OUTPUT_PLUGIN/$$PLUGIN_TYPE
- INSTALLS += target
- 
- TARGET = $$qt5LibraryTarget($$TARGET)
-diff -aur qtbase-everywhere-src-5.12.3-a/src/corelib/kernel/qcoreapplication.cpp qtbase-everywhere-src-5.12.3-b/src/corelib/kernel/qcoreapplication.cpp
---- qtbase-everywhere-src-5.12.3-a/src/corelib/kernel/qcoreapplication.cpp	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/src/corelib/kernel/qcoreapplication.cpp	2019-07-10 09:35:08.919628625 -0500
-@@ -2668,6 +2668,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));
-+            }
-+        }
-+
-         QString libPathEnv = qEnvironmentVariable("QT_PLUGIN_PATH");
-         if (!libPathEnv.isEmpty()) {
-             QStringList paths = libPathEnv.split(QDir::listSeparator(), QString::SkipEmptyParts);
-diff -aur qtbase-everywhere-src-5.12.3-a/src/corelib/kernel/qcore_mac_p.h qtbase-everywhere-src-5.12.3-b/src/corelib/kernel/qcore_mac_p.h
---- qtbase-everywhere-src-5.12.3-a/src/corelib/kernel/qcore_mac_p.h	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/src/corelib/kernel/qcore_mac_p.h	2019-07-10 09:35:08.920628655 -0500
-@@ -212,7 +212,7 @@
- 
- // --------------------------------------------------------------------------
- 
--#if !defined(QT_BOOTSTRAPPED)
-+#if 0
- 
- QT_END_NAMESPACE
- #include <os/activity.h>
-@@ -290,7 +290,19 @@
- 
- #define QT_APPLE_SCOPED_LOG_ACTIVITY(...) QAppleLogActivity scopedLogActivity = QT_APPLE_LOG_ACTIVITY(__VA_ARGS__).enter();
- 
--#endif // !defined(QT_BOOTSTRAPPED)
-+#else // !defined(QT_BOOTSTRAPPED)
-+
-+#define QT_APPLE_LOG_ACTIVITY_WITH_PARENT3(...)
-+#define QT_APPLE_LOG_ACTIVITY_WITH_PARENT2(...)
-+#define QT_APPLE_LOG_ACTIVITY_WITH_PARENT(...)
-+
-+#define QT_APPLE_LOG_ACTIVITY2(...)
-+#define QT_APPLE_LOG_ACTIVITY1(...)
-+#define QT_APPLE_LOG_ACTIVITY(...)
-+
-+#define QT_APPLE_SCOPED_LOG_ACTIVITY(...)
-+
-+#endif
- 
- // -------------------------------------------------------------------------
- 
-Only in qtbase-everywhere-src-5.12.3-b/src/corelib/kernel: qcore_mac_p.h.orig
-diff -aur qtbase-everywhere-src-5.12.3-a/src/corelib/Qt5CoreConfigExtras.cmake.in qtbase-everywhere-src-5.12.3-b/src/corelib/Qt5CoreConfigExtras.cmake.in
---- qtbase-everywhere-src-5.12.3-a/src/corelib/Qt5CoreConfigExtras.cmake.in	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/src/corelib/Qt5CoreConfigExtras.cmake.in	2019-07-10 09:35:08.918628595 -0500
-@@ -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 -aur qtbase-everywhere-src-5.12.3-a/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in qtbase-everywhere-src-5.12.3-b/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in
---- qtbase-everywhere-src-5.12.3-a/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in	2019-07-10 09:35:08.918628595 -0500
-@@ -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 -aur qtbase-everywhere-src-5.12.3-a/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in qtbase-everywhere-src-5.12.3-b/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
---- qtbase-everywhere-src-5.12.3-a/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/src/corelib/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in	2019-07-10 09:35:08.918628595 -0500
-@@ -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 -aur qtbase-everywhere-src-5.12.3-a/src/corelib/tools/qtimezoneprivate_tz.cpp qtbase-everywhere-src-5.12.3-b/src/corelib/tools/qtimezoneprivate_tz.cpp
---- qtbase-everywhere-src-5.12.3-a/src/corelib/tools/qtimezoneprivate_tz.cpp	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/src/corelib/tools/qtimezoneprivate_tz.cpp	2019-07-10 09:35:08.919628625 -0500
-@@ -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 -aur qtbase-everywhere-src-5.12.3-a/src/dbus/Qt5DBusConfigExtras.cmake.in qtbase-everywhere-src-5.12.3-b/src/dbus/Qt5DBusConfigExtras.cmake.in
---- qtbase-everywhere-src-5.12.3-a/src/dbus/Qt5DBusConfigExtras.cmake.in	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/src/dbus/Qt5DBusConfigExtras.cmake.in	2019-07-10 09:35:08.919628625 -0500
-@@ -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 -aur qtbase-everywhere-src-5.12.3-a/src/gui/Qt5GuiConfigExtras.cmake.in qtbase-everywhere-src-5.12.3-b/src/gui/Qt5GuiConfigExtras.cmake.in
---- qtbase-everywhere-src-5.12.3-a/src/gui/Qt5GuiConfigExtras.cmake.in	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/src/gui/Qt5GuiConfigExtras.cmake.in	2019-07-10 09:35:08.919628625 -0500
-@@ -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 -aur qtbase-everywhere-src-5.12.3-a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp qtbase-everywhere-src-5.12.3-b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
---- qtbase-everywhere-src-5.12.3-a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp	2019-07-10 09:35:08.919628625 -0500
-@@ -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 -aur qtbase-everywhere-src-5.12.3-a/src/plugins/platforms/xcb/qxcbcursor.cpp qtbase-everywhere-src-5.12.3-b/src/plugins/platforms/xcb/qxcbcursor.cpp
---- qtbase-everywhere-src-5.12.3-a/src/plugins/platforms/xcb/qxcbcursor.cpp	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/src/plugins/platforms/xcb/qxcbcursor.cpp	2019-07-10 09:35:08.919628625 -0500
-@@ -317,10 +317,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) {
-Only in qtbase-everywhere-src-5.12.3-b/src/plugins/platforms/xcb: qxcbcursor.cpp.orig
-diff -aur qtbase-everywhere-src-5.12.3-a/src/plugins/platformthemes/gtk3/main.cpp qtbase-everywhere-src-5.12.3-b/src/plugins/platformthemes/gtk3/main.cpp
---- qtbase-everywhere-src-5.12.3-a/src/plugins/platformthemes/gtk3/main.cpp	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/src/plugins/platformthemes/gtk3/main.cpp	2019-07-10 09:35:08.919628625 -0500
-@@ -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 -aur qtbase-everywhere-src-5.12.3-a/src/testlib/qappletestlogger.cpp qtbase-everywhere-src-5.12.3-b/src/testlib/qappletestlogger.cpp
---- qtbase-everywhere-src-5.12.3-a/src/testlib/qappletestlogger.cpp	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/src/testlib/qappletestlogger.cpp	2019-07-10 09:35:08.920628655 -0500
-@@ -43,7 +43,7 @@
- 
- QT_BEGIN_NAMESPACE
- 
--#if defined(QT_USE_APPLE_UNIFIED_LOGGING)
-+#if defined(QT_USE_APPLE_UNIFIED_LOGGING) && 0
- 
- using namespace QTestPrivate;
- 
-diff -aur qtbase-everywhere-src-5.12.3-a/src/testlib/qtestassert.h qtbase-everywhere-src-5.12.3-b/src/testlib/qtestassert.h
---- qtbase-everywhere-src-5.12.3-a/src/testlib/qtestassert.h	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/src/testlib/qtestassert.h	2019-07-10 09:35:08.919628625 -0500
-@@ -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 -aur qtbase-everywhere-src-5.12.3-a/src/widgets/Qt5WidgetsConfigExtras.cmake.in qtbase-everywhere-src-5.12.3-b/src/widgets/Qt5WidgetsConfigExtras.cmake.in
---- qtbase-everywhere-src-5.12.3-a/src/widgets/Qt5WidgetsConfigExtras.cmake.in	2019-04-09 04:51:26.000000000 -0500
-+++ qtbase-everywhere-src-5.12.3-b/src/widgets/Qt5WidgetsConfigExtras.cmake.in	2019-07-10 09:35:08.919628625 -0500
-@@ -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/mkspecs/features/mac/sdk.mk b/mkspecs/features/mac/sdk.mk
-index c40f58c987..e69de29bb2 100644
---- a/mkspecs/features/mac/sdk.mk
-+++ b/mkspecs/features/mac/sdk.mk
-@@ -1,25 +0,0 @@
--
--ifeq ($(QT_MAC_SDK_NO_VERSION_CHECK),)
--    CHECK_SDK_COMMAND = /usr/bin/xcrun --sdk $(EXPORT_QMAKE_MAC_SDK) -show-sdk-version 2>&1
--    CURRENT_MAC_SDK_VERSION := $(shell DEVELOPER_DIR=$(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) $(CHECK_SDK_COMMAND))
--    ifneq ($(CURRENT_MAC_SDK_VERSION),$(EXPORT_QMAKE_MAC_SDK_VERSION))
--        # We don't want to complain about out of date SDK unless the target needs to be remade.
--        # This covers use-cases such as running 'make check' after moving the build to a
--        # computer without Xcode or with a different Xcode version.
--        TARGET_UP_TO_DATE := $(shell QT_MAC_SDK_NO_VERSION_CHECK=1 $(MAKE) --question $(QMAKE_TARGET) && echo 1 || echo 0)
--        ifeq ($(TARGET_UP_TO_DATE),0)
--            ifneq ($(findstring missing DEVELOPER_DIR path,$(CURRENT_MAC_SDK_VERSION)),)
--                $(info The developer dir $(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) is no longer valid.)
--            else ifneq ($(findstring SDK "$(EXPORT_QMAKE_MAC_SDK)" cannot be located,$(CURRENT_MAC_SDK_VERSION)),)
--                $(info The developer dir $(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) no longer contains the $(EXPORT_QMAKE_MAC_SDK_VERSION) platform SDK.)
--            else ifneq ($(CURRENT_MAC_SDK_VERSION),)
--                $(info The platform SDK has been changed from version $(EXPORT_QMAKE_MAC_SDK_VERSION) to version $(CURRENT_MAC_SDK_VERSION).)
--            else
--                $(info Unknown error resolving current platform SDK version.)
--            endif
--            $(info This requires a fresh build. Please wipe the build directory completely,)
--            $(info including any .qmake.stash and .qmake.cache files generated by qmake.)
--            $(error ^)
--        endif
--    endif
--endif
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0001-qtbase-mkspecs-mac.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
new file mode 100644
index 000000000000..bb535b8a0c0e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
@@ -0,0 +1,403 @@
+From 361a9395704ca1ee170a8bb3823ba860293eecee Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Tue, 17 Sep 2019 05:34:00 -0500
+Subject: [PATCH 01/12] qtbase-mkspecs-mac
+
+---
+ mkspecs/common/mac.conf               |   2 +-
+ 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
+--- a/mkspecs/common/mac.conf
++++ b/mkspecs/common/mac.conf
+@@ -24,7 +24,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/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
+index 993f4d56a9..b80ec1e801 100644
+--- a/mkspecs/features/mac/default_post.prf
++++ b/mkspecs/features/mac/default_post.prf
+@@ -68,208 +68,6 @@ 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 {
+-    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
+-
+-    bundle_version = $$VERSION
+-    isEmpty(bundle_version): bundle_version = 1.0.0
+-
+-    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_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}
+-}
+-
+-!equals(sdk_version, $$QMAKE_MAC_SDK_VERSION) {
+-    # Explicit SDK version has been set, respect that
+-    QMAKE_LFLAGS += -Wl,-sdk_version -Wl,$$sdk_version
+-}
+-
+-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
+-
+ !macx-xcode {
+     generate_xcode_project.commands = @$(QMAKE) -spec macx-xcode \"$(EXPORT__PRO_FILE_)\" $$QMAKE_ARGS
+     generate_xcode_project.target = xcodeproj
+diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf
+index e3534561a5..3b01424e67 100644
+--- a/mkspecs/features/mac/default_pre.prf
++++ b/mkspecs/features/mac/default_pre.prf
+@@ -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 --git a/mkspecs/features/mac/sdk.mk b/mkspecs/features/mac/sdk.mk
+index c40f58c987..e69de29bb2 100644
+--- a/mkspecs/features/mac/sdk.mk
++++ b/mkspecs/features/mac/sdk.mk
+@@ -1,25 +0,0 @@
+-
+-ifeq ($(QT_MAC_SDK_NO_VERSION_CHECK),)
+-    CHECK_SDK_COMMAND = /usr/bin/xcrun --sdk $(EXPORT_QMAKE_MAC_SDK) -show-sdk-version 2>&1
+-    CURRENT_MAC_SDK_VERSION := $(shell DEVELOPER_DIR=$(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) $(CHECK_SDK_COMMAND))
+-    ifneq ($(CURRENT_MAC_SDK_VERSION),$(EXPORT_QMAKE_MAC_SDK_VERSION))
+-        # We don't want to complain about out of date SDK unless the target needs to be remade.
+-        # This covers use-cases such as running 'make check' after moving the build to a
+-        # computer without Xcode or with a different Xcode version.
+-        TARGET_UP_TO_DATE := $(shell QT_MAC_SDK_NO_VERSION_CHECK=1 $(MAKE) --question $(QMAKE_TARGET) && echo 1 || echo 0)
+-        ifeq ($(TARGET_UP_TO_DATE),0)
+-            ifneq ($(findstring missing DEVELOPER_DIR path,$(CURRENT_MAC_SDK_VERSION)),)
+-                $(info The developer dir $(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) is no longer valid.)
+-            else ifneq ($(findstring SDK "$(EXPORT_QMAKE_MAC_SDK)" cannot be located,$(CURRENT_MAC_SDK_VERSION)),)
+-                $(info The developer dir $(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) no longer contains the $(EXPORT_QMAKE_MAC_SDK_VERSION) platform SDK.)
+-            else ifneq ($(CURRENT_MAC_SDK_VERSION),)
+-                $(info The platform SDK has been changed from version $(EXPORT_QMAKE_MAC_SDK_VERSION) to version $(CURRENT_MAC_SDK_VERSION).)
+-            else
+-                $(info Unknown error resolving current platform SDK version.)
+-            endif
+-            $(info This requires a fresh build. Please wipe the build directory completely,)
+-            $(info including any .qmake.stash and .qmake.cache files generated by qmake.)
+-            $(error ^)
+-        endif
+-    endif
+-endif
+diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
+index 3a9c2778bb..e69de29bb2 100644
+--- a/mkspecs/features/mac/sdk.prf
++++ b/mkspecs/features/mac/sdk.prf
+@@ -1,61 +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"): \
+-        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)
+-
+-isEmpty(QMAKE_EXPORT_INCDIR_OPENGL) {
+-    QMAKE_EXPORT_INCDIR_OPENGL = $$QMAKE_INCDIR_OPENGL
+-    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)
+-}
+-- 
+2.23.GIT
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0002-qtbase-mac.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0002-qtbase-mac.patch
new file mode 100644
index 000000000000..9f0c66651844
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0002-qtbase-mac.patch
@@ -0,0 +1,116 @@
+From 203c9338dc92c2c36007cfe6633387348976637e Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Tue, 17 Sep 2019 05:37:15 -0500
+Subject: [PATCH 02/12] qtbase-mac
+
+---
+ src/corelib/kernel/qcore_mac_p.h | 16 ++++++++++++++--
+ src/testlib/qappletestlogger.cpp |  2 +-
+ src/testlib/qappletestlogger_p.h |  2 +-
+ src/testlib/qtestcase.cpp        |  2 +-
+ src/testlib/qtestlog.cpp         |  2 +-
+ src/testlib/qtestlog_p.h         |  2 +-
+ 6 files changed, 19 insertions(+), 7 deletions(-)
+
+diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h
+index f96e7358..650946b7 100644
+--- a/src/corelib/kernel/qcore_mac_p.h
++++ b/src/corelib/kernel/qcore_mac_p.h
+@@ -212,7 +212,7 @@ private:
+ 
+ // --------------------------------------------------------------------------
+ 
+-#if !defined(QT_BOOTSTRAPPED)
++#if 0
+ 
+ QT_END_NAMESPACE
+ #include <os/activity.h>
+@@ -290,7 +290,19 @@ QT_MAC_WEAK_IMPORT(_os_activity_current);
+ 
+ #define QT_APPLE_SCOPED_LOG_ACTIVITY(...) QAppleLogActivity scopedLogActivity = QT_APPLE_LOG_ACTIVITY(__VA_ARGS__).enter();
+ 
+-#endif // !defined(QT_BOOTSTRAPPED)
++#else // !defined(QT_BOOTSTRAPPED)
++
++#define QT_APPLE_LOG_ACTIVITY_WITH_PARENT3(...)
++#define QT_APPLE_LOG_ACTIVITY_WITH_PARENT2(...)
++#define QT_APPLE_LOG_ACTIVITY_WITH_PARENT(...)
++
++#define QT_APPLE_LOG_ACTIVITY2(...)
++#define QT_APPLE_LOG_ACTIVITY1(...)
++#define QT_APPLE_LOG_ACTIVITY(...)
++
++#define QT_APPLE_SCOPED_LOG_ACTIVITY(...)
++
++#endif
+ 
+ // -------------------------------------------------------------------------
+ 
+diff --git a/src/testlib/qappletestlogger.cpp b/src/testlib/qappletestlogger.cpp
+index dfeadebd..2a74330c 100644
+--- a/src/testlib/qappletestlogger.cpp
++++ b/src/testlib/qappletestlogger.cpp
+@@ -43,7 +43,7 @@
+ 
+ QT_BEGIN_NAMESPACE
+ 
+-#if defined(QT_USE_APPLE_UNIFIED_LOGGING)
++#if defined(QT_USE_APPLE_UNIFIED_LOGGING) && 0
+ 
+ using namespace QTestPrivate;
+ 
+diff --git a/src/testlib/qappletestlogger_p.h b/src/testlib/qappletestlogger_p.h
+index 62c6d95c..f8e0a3b7 100644
+--- a/src/testlib/qappletestlogger_p.h
++++ b/src/testlib/qappletestlogger_p.h
+@@ -57,7 +57,7 @@
+ 
+ QT_BEGIN_NAMESPACE
+ 
+-#if defined(QT_USE_APPLE_UNIFIED_LOGGING)
++#if defined(QT_USE_APPLE_UNIFIED_LOGGING) && 0
+ class QAppleTestLogger : public QAbstractTestLogger
+ {
+ public:
+diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
+index 0c935a1f..22f2d75d 100644
+--- a/src/testlib/qtestcase.cpp
++++ b/src/testlib/qtestcase.cpp
+@@ -850,7 +850,7 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml)
+ 
+     bool addFallbackLogger = !explicitLoggerRequested;
+ 
+-#if defined(QT_USE_APPLE_UNIFIED_LOGGING)
++#if defined(QT_USE_APPLE_UNIFIED_LOGGING) && 0
+     // Any explicitly requested loggers will be added by now, so we can check if they use stdout
+     const bool safeToAddAppleLogger = !AppleUnifiedLogger::willMirrorToStderr() || !QTestLog::loggerUsingStdout();
+     if (safeToAddAppleLogger && QAppleTestLogger::debugLoggingEnabled()) {
+diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp
+index 57bb7d95..33fb8162 100644
+--- a/src/testlib/qtestlog.cpp
++++ b/src/testlib/qtestlog.cpp
+@@ -460,7 +460,7 @@ void QTestLog::addLogger(LogMode mode, const char *filename)
+     case QTestLog::TAP:
+         logger = new QTapTestLogger(filename);
+         break;
+-#if defined(QT_USE_APPLE_UNIFIED_LOGGING)
++#if defined(QT_USE_APPLE_UNIFIED_LOGGING) && 0
+     case QTestLog::Apple:
+         logger = new QAppleTestLogger;
+         break;
+diff --git a/src/testlib/qtestlog_p.h b/src/testlib/qtestlog_p.h
+index e63e89a7..213b6945 100644
+--- a/src/testlib/qtestlog_p.h
++++ b/src/testlib/qtestlog_p.h
+@@ -68,7 +68,7 @@ class Q_TESTLIB_EXPORT QTestLog
+ public:
+     enum LogMode {
+         Plain = 0, XML, LightXML, XunitXML, CSV, TeamCity, TAP
+-#if defined(QT_USE_APPLE_UNIFIED_LOGGING)
++#if defined(QT_USE_APPLE_UNIFIED_LOGGING) && 0
+         , Apple
+ #endif
+ #if defined(HAVE_XCTEST)
+-- 
+2.23.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0003-qtbase-mkspecs.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0003-qtbase-mkspecs.patch
new file mode 100644
index 000000000000..d5d8e70b788f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0003-qtbase-mkspecs.patch
@@ -0,0 +1,465 @@
+From 8bdbddc2e5fef1553b1ba0297d3c03b38e9b947b Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Wed, 18 Sep 2019 05:39:39 -0500
+Subject: [PATCH 03/12] qtbase-mkspecs
+
+---
+ mkspecs/features/create_cmake.prf             | 53 ++++--------
+ .../data/cmake/Qt5BasicConfig.cmake.in        | 80 +------------------
+ mkspecs/features/qml_module.prf               |  2 +-
+ mkspecs/features/qml_plugin.prf               |  2 +-
+ mkspecs/features/qt_app.prf                   |  2 +-
+ mkspecs/features/qt_build_paths.prf           |  4 +-
+ mkspecs/features/qt_docs.prf                  | 10 +--
+ mkspecs/features/qt_example_installs.prf      |  2 +-
+ mkspecs/features/qt_functions.prf             |  2 +-
+ mkspecs/features/qt_installs.prf              | 22 ++---
+ mkspecs/features/qt_plugin.prf                |  2 +-
+ 11 files changed, 39 insertions(+), 142 deletions(-)
+
+diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
+index 00da9bd33f..bd166fbfea 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
+@@ -70,45 +70,20 @@ 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
+ 
+-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
+ 
+@@ -188,7 +163,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()
+@@ -333,7 +308,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 c729892889..c60ef16e64 100644
+--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
++++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+@@ -3,30 +3,6 @@ if (CMAKE_VERSION VERSION_LESS 3.1.0)
+     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 @@ 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}\"
+@@ -69,11 +41,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
+@@ -89,24 +57,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}$${CMAKE_QT_STEM}.framework\"
+-      \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Headers\"
++      \"$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework\"
++      \"$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.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}$${CMAKE_QT_STEM}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/\"
+-        \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.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}$${CMAKE_QT_STEM}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/\"
++        \"$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\"
+     )
+ !!ELSE
+     set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
+@@ -122,7 +79,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
+@@ -272,25 +228,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()
+@@ -309,25 +253,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()
+@@ -346,11 +278,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/qml_module.prf b/mkspecs/features/qml_module.prf
+index 57cfec78b3..5cbd7c52ef 100644
+--- a/mkspecs/features/qml_module.prf
++++ b/mkspecs/features/qml_module.prf
+@@ -51,7 +51,7 @@ builtin_resources {
+ # Install rules
+ qmldir.base = $$qmldir_path
+ qmldir.files = $$qmldir_file
+-qmldir.path = $$[QT_INSTALL_QML]/$$TARGETPATH
++qmldir.path = $$NIX_OUTPUT_QML/$$TARGETPATH
+ INSTALLS += qmldir
+ 
+ qmlfiles.base = $$_PRO_FILE_PWD_
+diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf
+index ad8ecdf5f1..804634b22e 100644
+--- a/mkspecs/features/qml_plugin.prf
++++ b/mkspecs/features/qml_plugin.prf
+@@ -50,7 +50,7 @@ load(qt_build_paths)
+ 
+ DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
+ 
+-target.path = $$[QT_INSTALL_QML]/$$TARGETPATH
++target.path = $$NIX_OUTPUT_QML/$$TARGETPATH
+ INSTALLS += target
+ 
+ # Some final setup
+diff --git a/mkspecs/features/qt_app.prf b/mkspecs/features/qt_app.prf
+index 8354f30eea..62028fef8e 100644
+--- a/mkspecs/features/qt_app.prf
++++ b/mkspecs/features/qt_app.prf
+@@ -30,7 +30,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 3bb3823a8e..655b7b7db8 100644
+--- a/mkspecs/features/qt_build_paths.prf
++++ b/mkspecs/features/qt_build_paths.prf
+@@ -24,6 +24,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_docs.prf b/mkspecs/features/qt_docs.prf
+index 3b74cd4dd5..6bfbbe6e2d 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 43b58817fe..e635b8f67a 100644
+--- a/mkspecs/features/qt_example_installs.prf
++++ b/mkspecs/features/qt_example_installs.prf
+@@ -88,7 +88,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 1ebca17366..b784441da0 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,35 +23,35 @@
+ #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
+     generated_privates: \
+         private_headers.CONFIG += no_check_exist
+     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 40528a65e2..903f795284 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)
+-- 
+2.23.GIT
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0004-qtbase-replace-libdir.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0004-qtbase-replace-libdir.patch
new file mode 100644
index 000000000000..f2cf54880d4a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0004-qtbase-replace-libdir.patch
@@ -0,0 +1,68 @@
+From 492f6555bb09f207c83387441f0f23ba4602dfff Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Wed, 18 Sep 2019 05:39:50 -0500
+Subject: [PATCH 04/12] qtbase-replace-libdir
+
+---
+ mkspecs/features/qt_common.prf | 20 ++------------------
+ mkspecs/features/qt_module.prf |  5 +----
+ 2 files changed, 3 insertions(+), 22 deletions(-)
+
+diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
+index caecb68a84..d3aa3ba570 100644
+--- a/mkspecs/features/qt_common.prf
++++ b/mkspecs/features/qt_common.prf
+@@ -30,32 +30,16 @@ contains(TEMPLATE, .*lib) {
+         rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*
+     else: \
+         rplbase = $$MODULE_BASE_OUTDIR
+-    host_build {
+-        qqt_libdir = \$\$\$\$[QT_HOST_LIBS]
+-        qt_libdir = $$[QT_HOST_LIBS]
+-    } else {
+-        qqt_libdir = \$\$\$\$[QT_INSTALL_LIBS]
+-        qt_libdir = $$[QT_INSTALL_LIBS]
+-    }
++    qt_libdir = $$NIX_OUTPUT_OUT/lib
+     contains(QMAKE_DEFAULT_LIBDIRS, $$qt_libdir) {
+-        lib_replace0.match = $$rplbase/lib/
+-        lib_replace0.replace = $$qqt_libdir/
+-        lib_replace0.CONFIG = path
+-        QMAKE_PRL_INSTALL_REPLACE += lib_replace0
+         lib_replace.match = "[^ ']*$$rplbase/lib"
+         lib_replace.replace =
+     } else {
+         lib_replace.match = $$rplbase/lib
+-        lib_replace.replace = $$qqt_libdir
++        lib_replace.replace = $$qt_libdir
+     }
+     lib_replace.CONFIG = path
+     QMAKE_PRL_INSTALL_REPLACE += lib_replace
+-    !equals(qt_libdir, $$rplbase/lib) {
+-        qtlibdir_replace.match = $$qt_libdir
+-        qtlibdir_replace.replace = $$qqt_libdir
+-        qtlibdir_replace.CONFIG = path
+-        QMAKE_PRL_INSTALL_REPLACE += qtlibdir_replace
+-    }
+ }
+ 
+ # The remainder of this file must not apply to host tools/libraries,
+diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
+index ee7de22059..9015b30d73 100644
+--- a/mkspecs/features/qt_module.prf
++++ b/mkspecs/features/qt_module.prf
+@@ -303,10 +303,7 @@ load(qt_targets)
+ }
+ !lib_bundle:unix {
+     CONFIG += create_libtool
+-    host_build: \
+-        QMAKE_LIBTOOL_LIBDIR = $$[QT_HOST_LIBS]
+-    else: \
+-        QMAKE_LIBTOOL_LIBDIR = "=$$[QT_INSTALL_LIBS/raw]"
++    QMAKE_LIBTOOL_LIBDIR = $$NIX_OUTPUT_OUT/lib
+     !isEmpty(lib_replace0.match) {
+         ltlib_replace0.match = $$lib_replace0.match
+         ltlib_replace0.replace = $$QMAKE_LIBTOOL_LIBDIR/
+-- 
+2.23.GIT
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0005-qtbase-cmake.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0005-qtbase-cmake.patch
new file mode 100644
index 000000000000..64a88f300d84
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0005-qtbase-cmake.patch
@@ -0,0 +1,194 @@
+From 6f53835deae80b28ec5c1c9a5c0294bbcc87f91b Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Tue, 17 Sep 2019 05:34:28 -0500
+Subject: [PATCH 05/12] qtbase-cmake
+
+---
+ mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in  |  2 +-
+ mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in |  4 ++--
+ src/corelib/Qt5CoreConfigExtras.cmake.in             | 10 +++++-----
+ src/corelib/Qt5CoreConfigExtrasMkspecDir.cmake.in    |  2 +-
+ .../Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in  |  2 +-
+ src/dbus/Qt5DBusConfigExtras.cmake.in                | 12 ++----------
+ src/gui/Qt5GuiConfigExtras.cmake.in                  |  6 +++---
+ src/widgets/Qt5WidgetsConfigExtras.cmake.in          |  2 +-
+ 8 files changed, 16 insertions(+), 24 deletions(-)
+
+diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+index c60ef16e64..e354ab9156 100644
+--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
++++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+@@ -278,7 +278,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 5baf0fdb10..3583745aea 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/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
+index e0652fdcf9..450b2a2d28 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
+@@ -116,7 +116,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
+@@ -130,7 +130,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/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 84dbbfebd4..8ad0720c5c 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/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
+-- 
+2.23.GIT
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0006-qtbase-gtk3.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0006-qtbase-gtk3.patch
new file mode 100644
index 000000000000..ed1c61e76787
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0006-qtbase-gtk3.patch
@@ -0,0 +1,48 @@
+From 5bf1785809baf6be7fb5904ce6cefdb761f2c278 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Tue, 17 Sep 2019 05:35:33 -0500
+Subject: [PATCH 06/12] qtbase-gtk3
+
+---
+ src/plugins/platformthemes/gtk3/main.cpp | 17 ++++++++++++++++-
+ 1 file changed, 16 insertions(+), 1 deletion(-)
+
+diff --git a/src/plugins/platformthemes/gtk3/main.cpp b/src/plugins/platformthemes/gtk3/main.cpp
+index fb1c425d8e..bb8bab9795 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;
+ }
+-- 
+2.23.GIT
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0007-qtbase-xcursor.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0007-qtbase-xcursor.patch
new file mode 100644
index 000000000000..2fd9e9509d63
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0007-qtbase-xcursor.patch
@@ -0,0 +1,29 @@
+From 35e80f303ae6a6c4c53ba8eb3d84574cc03d68d8 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Tue, 17 Sep 2019 05:35:58 -0500
+Subject: [PATCH 07/12] qtbase-xcursor
+
+---
+ src/plugins/platforms/xcb/qxcbcursor.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
+index fbadab4d50..c83ce0af5b 100644
+--- a/src/plugins/platforms/xcb/qxcbcursor.cpp
++++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
+@@ -317,10 +317,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) {
+-- 
+2.23.GIT
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0008-qtbase-xcompose.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0008-qtbase-xcompose.patch
new file mode 100644
index 000000000000..af45be94fecb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0008-qtbase-xcompose.patch
@@ -0,0 +1,30 @@
+From b7c1c103ba04e76ae498f87ca9ef2c4e09e36d7e Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Tue, 17 Sep 2019 05:36:10 -0500
+Subject: [PATCH 08/12] qtbase-xcompose
+
+---
+ .../compose/generator/qtablegenerator.cpp                    | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+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()
+-- 
+2.23.GIT
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0009-qtbase-tzdir.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0009-qtbase-tzdir.patch
new file mode 100644
index 000000000000..03466b69afbe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0009-qtbase-tzdir.patch
@@ -0,0 +1,51 @@
+From db9686362ae34e02538e449e0edfe3d61065b2e9 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Tue, 17 Sep 2019 05:36:25 -0500
+Subject: [PATCH 09/12] qtbase-tzdir
+
+---
+ src/corelib/tools/qtimezoneprivate_tz.cpp | 20 ++++++++++++++------
+ 1 file changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp
+index 57bc000af5..d7d8119682 100644
+--- a/src/corelib/tools/qtimezoneprivate_tz.cpp
++++ b/src/corelib/tools/qtimezoneprivate_tz.cpp
+@@ -77,7 +77,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");
+ 
+@@ -656,12 +660,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;
++            }
+         }
+     }
+ 
+-- 
+2.23.GIT
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0010-qtbase-qtpluginpath.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0010-qtbase-qtpluginpath.patch
new file mode 100644
index 000000000000..2c03521286a6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0010-qtbase-qtpluginpath.patch
@@ -0,0 +1,32 @@
+From a3aaebda6d4b302cd202c21e306c55d3715e9b0d Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Tue, 17 Sep 2019 05:36:41 -0500
+Subject: [PATCH 10/12] qtbase-qtpluginpath
+
+---
+ src/corelib/kernel/qcoreapplication.cpp | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
+index db6546028a..cc97c46004 100644
+--- a/src/corelib/kernel/qcoreapplication.cpp
++++ b/src/corelib/kernel/qcoreapplication.cpp
+@@ -2694,6 +2694,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));
++            }
++        }
++
+         QString libPathEnv = qEnvironmentVariable("QT_PLUGIN_PATH");
+         if (!libPathEnv.isEmpty()) {
+             QStringList paths = libPathEnv.split(QDir::listSeparator(), QString::SkipEmptyParts);
+-- 
+2.23.GIT
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0011-qtbase-assert.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0011-qtbase-assert.patch
new file mode 100644
index 000000000000..b4e0ab762298
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0011-qtbase-assert.patch
@@ -0,0 +1,32 @@
+From 4f93027de0e9b825c4b7853d583e9b02a0443c6b Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Tue, 17 Sep 2019 05:37:04 -0500
+Subject: [PATCH 11/12] qtbase-assert
+
+---
+ src/testlib/qtestassert.h | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+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
+ 
+-- 
+2.23.GIT
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0012-fix-header_module.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0012-fix-header_module.patch
new file mode 100644
index 000000000000..1e2c68688b04
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0012-fix-header_module.patch
@@ -0,0 +1,25 @@
+From 821db0c3056a813e2d0d36fbb2c7361df5559b05 Mon Sep 17 00:00:00 2001
+From: Will Dietz <w@wdtz.org>
+Date: Mon, 30 Sep 2019 20:15:40 -0500
+Subject: [PATCH 12/12] fix header_module
+
+---
+ mkspecs/features/qt_module.prf | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
+index 9015b30d73..7347c791b4 100644
+--- a/mkspecs/features/qt_module.prf
++++ b/mkspecs/features/qt_module.prf
+@@ -84,7 +84,7 @@ header_module {
+         CONFIG  += qt_no_install_library
+ 
+     # Allow creation of .prl, .la and .pc files.
+-    target.path = $$[QT_INSTALL_LIBS]
++    target.path = $$NIX_OUTPUT_OUT/lib
+     target.CONFIG += dummy_install
+     INSTALLS    += target
+ } else {
+-- 
+2.23.GIT
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0013-define-kiosurfacesuccess.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0013-define-kiosurfacesuccess.patch
new file mode 100644
index 000000000000..a43a46d8a69b
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.12/srcs.nix b/nixpkgs/pkgs/development/libraries/qt-5/5.12/srcs.nix
index ce567c3a2bcd..b4494593fd0b 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/5.12/srcs.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/srcs.nix
@@ -3,323 +3,323 @@
 
 {
   qt3d = {
-    version = "5.12.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qt3d-everywhere-src-5.12.3.tar.xz";
-      sha256 = "8997f07c816bbc6dd43fc2171801178bc65e704d35039998530cfa49837eaa7d";
-      name = "qt3d-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtactiveqt-everywhere-src-5.12.3.tar.xz";
-      sha256 = "15a5fde0a069f402bea9f422d8d2c46af440d202122c6307c2a6be642d20dc0f";
-      name = "qtactiveqt-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtandroidextras-everywhere-src-5.12.3.tar.xz";
-      sha256 = "866b3fbcfc2cbebdb83b5adec4e5d0bd29b0e0b0762d66fb3fef0b400e37254f";
-      name = "qtandroidextras-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtbase-everywhere-src-5.12.3.tar.xz";
-      sha256 = "fddfd8852ef7503febeed67b876d1425160869ae2b1ae8e10b3fb0fedc5fe701";
-      name = "qtbase-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtcanvas3d-everywhere-src-5.12.3.tar.xz";
-      sha256 = "c0821f1232c6bcd00648af9a5d1eade8e0397c6bfff60621e0fcdfc75561baea";
-      name = "qtcanvas3d-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtcharts-everywhere-src-5.12.3.tar.xz";
-      sha256 = "820c94b2bf5d73e921fe99be1e3a03a6f012d96574a08e504d68db237522b3a9";
-      name = "qtcharts-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtconnectivity-everywhere-src-5.12.3.tar.xz";
-      sha256 = "01518cee71a8d53b9c2387f8c7facbcc2c4d63ab3b79462edfa06ba3bfeae661";
-      name = "qtconnectivity-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtdatavis3d-everywhere-src-5.12.3.tar.xz";
-      sha256 = "f6d073c4575542f8ff6de3ac3b6e8dde6ae2d87e98119de7a13bc984aa967313";
-      name = "qtdatavis3d-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtdeclarative-everywhere-src-5.12.3.tar.xz";
-      sha256 = "839881cd6996e35c351bc7d560372ebb91e61f3688957c33248c4f31ea007fa7";
-      name = "qtdeclarative-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtdoc-everywhere-src-5.12.3.tar.xz";
-      sha256 = "ce5e9d0f48d108c48d742ab2127ead735270d7b525103c6cf409683d7fc8334f";
-      name = "qtdoc-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtgamepad-everywhere-src-5.12.3.tar.xz";
-      sha256 = "5d046869e9646912936e3622efa755d85ccc8eddba91f5b12880cfb5e6489642";
-      name = "qtgamepad-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtgraphicaleffects-everywhere-src-5.12.3.tar.xz";
-      sha256 = "772c98a009cc82ac290f868906c5aa719e4608ef3c5905d69ef7402b15924a73";
-      name = "qtgraphicaleffects-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtimageformats-everywhere-src-5.12.3.tar.xz";
-      sha256 = "db5a9e784f9c327c1e6830b1550311024cc91202d3b8dde82cd0944164298be2";
-      name = "qtimageformats-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtlocation-everywhere-src-5.12.3.tar.xz";
-      sha256 = "52d589be2852ada0c000b06cc411b61e521cd0797470be567fd1625bcc9d75c6";
-      name = "qtlocation-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtmacextras-everywhere-src-5.12.3.tar.xz";
-      sha256 = "38dedd29d07ea9e4e92a7ef28f9e03c06cf9a1525aee4f8084310c519f5b47ed";
-      name = "qtmacextras-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtmultimedia-everywhere-src-5.12.3.tar.xz";
-      sha256 = "a30beeb37fb284d93522e29c01fb8d12726f40e9248e80b70b1f8ab60197a301";
-      name = "qtmultimedia-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtnetworkauth-everywhere-src-5.12.3.tar.xz";
-      sha256 = "dd6bf334be29fb82adaeecb184779328b4ad33a069528b9954d9c07f2d889332";
-      name = "qtnetworkauth-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtpurchasing-everywhere-src-5.12.3.tar.xz";
-      sha256 = "a848f1e1022af38571f5ab0c4ec4b904c12fa6ef19154d44abbcaeb35156753e";
-      name = "qtpurchasing-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtquickcontrols-everywhere-src-5.12.3.tar.xz";
-      sha256 = "68ae03b35eaa44a24c3f663b842252053c9f2b00b18841fd39ff7d2150986f46";
-      name = "qtquickcontrols-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtquickcontrols2-everywhere-src-5.12.3.tar.xz";
-      sha256 = "e855e8369c3cb5a2ebcd2028a2a195ba73945fd9d5bc26134706c2fa14e99b3a";
-      name = "qtquickcontrols2-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtremoteobjects-everywhere-src-5.12.3.tar.xz";
-      sha256 = "3475a409127739930e0bf833cea5f7f605adc66ab25fac39b72ce4bf3039cc42";
-      name = "qtremoteobjects-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtscript-everywhere-src-5.12.3.tar.xz";
-      sha256 = "0f37bf032a2370bd08667aad053f5a57717ea49596c16bf6cfb32b0d6e5c1f9e";
-      name = "qtscript-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtscxml-everywhere-src-5.12.3.tar.xz";
-      sha256 = "70c4b1f8e23560cf54e69aeb3ded4078434e6f78e1b9573fbad1ddace5fc4b19";
-      name = "qtscxml-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtsensors-everywhere-src-5.12.3.tar.xz";
-      sha256 = "7f63fedf60fdf110a3fc529568c7226d7acd59cc5eaee908f4d5a969e34005fc";
-      name = "qtsensors-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtserialbus-everywhere-src-5.12.3.tar.xz";
-      sha256 = "792cd2d411d2ebd737f5d09580f8db479cd35f2f7e7cedb4412075ef20fcfe4d";
-      name = "qtserialbus-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtserialport-everywhere-src-5.12.3.tar.xz";
-      sha256 = "1faf7df4a1f9028bef1ce79330badb4e5cbbba9f717c53cafc5aea41eed1de51";
-      name = "qtserialport-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtspeech-everywhere-src-5.12.3.tar.xz";
-      sha256 = "ed211822765744553fb5abeb97058420668b18a50d985061d949a0e068ee64f5";
-      name = "qtspeech-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtsvg-everywhere-src-5.12.3.tar.xz";
-      sha256 = "f666438dbf6816b7534e539b95e3fa4405f11d7e2e2bbcde34f2db5ae0f27dc2";
-      name = "qtsvg-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qttools-everywhere-src-5.12.3.tar.xz";
-      sha256 = "c9e92d2f0d369e44bb1a60e9fa6d970f8d9893d653212305e04be5e6daec2cd8";
-      name = "qttools-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qttranslations-everywhere-src-5.12.3.tar.xz";
-      sha256 = "eefcec0a91c302548f9d948a138b8ec77d78570ce818931bd8475b1bff1205ca";
-      name = "qttranslations-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtvirtualkeyboard-everywhere-src-5.12.3.tar.xz";
-      sha256 = "7b83af4527310de4ab81146622f3a46677daabf05556d0e33a2e25ca2aa13b22";
-      name = "qtvirtualkeyboard-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtwayland-everywhere-src-5.12.3.tar.xz";
-      sha256 = "f0b45ad84180730e2d5a1249eb20c6357869b4b78f45eb266c2f2b17f77d86ff";
-      name = "qtwayland-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtwebchannel-everywhere-src-5.12.3.tar.xz";
-      sha256 = "72d1620bcc94e14caa91ddf344c84cd1288aa9479e00b1bb3b5e51f92efe088a";
-      name = "qtwebchannel-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtwebengine-everywhere-src-5.12.3.tar.xz";
-      sha256 = "3ff3bac12d75aa0f3fd993bb7077fe411f7b0e6a3993af6f8b039d48e3dc4317";
-      name = "qtwebengine-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtwebglplugin-everywhere-src-5.12.3.tar.xz";
-      sha256 = "23da63013101e97c4e663bb4f6dbb1c7b4386679c634680d3b8d79bcc59d26b3";
-      name = "qtwebglplugin-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtwebsockets-everywhere-src-5.12.3.tar.xz";
-      sha256 = "258883225c5e089015c4036f31019aa8f5bb013ecd8eecd193342e606319a577";
-      name = "qtwebsockets-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtwebview-everywhere-src-5.12.3.tar.xz";
-      sha256 = "f904e7fd7e755527e5bc4633c6f7c144065a3ffea473bf01fffb730385a983c5";
-      name = "qtwebview-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtwinextras-everywhere-src-5.12.3.tar.xz";
-      sha256 = "2b6319f7dd19fc19b028685c163a69f0a10e610d7554411d4660c1b5e42ada3b";
-      name = "qtwinextras-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtx11extras-everywhere-src-5.12.3.tar.xz";
-      sha256 = "85e3ae5177970c2d8656226d7535d0dff5764c100e55a79a59161d80754ba613";
-      name = "qtx11extras-everywhere-src-5.12.3.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.3";
+    version = "5.12.6";
     src = fetchurl {
-      url = "${mirror}/official_releases/qt/5.12/5.12.3/submodules/qtxmlpatterns-everywhere-src-5.12.3.tar.xz";
-      sha256 = "e0b98e7c92cd791a9b354d090788347db78f14c47579384fe22d0b650c1d8a61";
-      name = "qtxmlpatterns-everywhere-src-5.12.3.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/nixpkgs/pkgs/development/libraries/qt-5/5.9/default.nix b/nixpkgs/pkgs/development/libraries/qt-5/5.9/default.nix
deleted file mode 100644
index a872f212ff71..000000000000
--- a/nixpkgs/pkgs/development/libraries/qt-5/5.9/default.nix
+++ /dev/null
@@ -1,172 +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 ]
-      ++ 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 = {
-          inherit (stdenv) isDarwin;
-          qtbase_dev = self.qtbase.dev;
-          fix_qt_builtin_paths = ../hooks/fix-qt-builtin-paths.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/nixpkgs/pkgs/development/libraries/qt-5/5.9/fetch.sh b/nixpkgs/pkgs/development/libraries/qt-5/5.9/fetch.sh
deleted file mode 100644
index 17ebe1e532df..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtbase-fixguicmake.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtbase-fixguicmake.patch
deleted file mode 100644
index 8b46d432812a..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtbase-openssl_1_1.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtbase-openssl_1_1.patch
deleted file mode 100644
index d5f4d7527cb4..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtbase.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtbase.patch
deleted file mode 100644
index f87c508a3800..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtdeclarative.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtdeclarative.patch
deleted file mode 100644
index bb1bbbeb05e0..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtscript.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtscript.patch
deleted file mode 100644
index 5508dec1280e..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtserialport.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtserialport.patch
deleted file mode 100644
index f25524e80bcf..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.9/qttools.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.9/qttools.patch
deleted file mode 100644
index fbba439ef7a5..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtwebengine-clang-fix.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtwebengine-clang-fix.patch
deleted file mode 100644
index cf082cddd11a..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtwebengine-darwin-no-platform-check.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtwebengine-darwin-no-platform-check.patch
deleted file mode 100644
index 7156c41c5ec1..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtwebengine-no-build-skip.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtwebengine-no-build-skip.patch
deleted file mode 100644
index f332d5e1bb2b..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtwebkit.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.9/qtwebkit.patch
deleted file mode 100644
index 718bda361943..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/5.9/srcs.nix b/nixpkgs/pkgs/development/libraries/qt-5/5.9/srcs.nix
deleted file mode 100644
index 09b6293daebc..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qmake-libtool.sh b/nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qmake-libtool.sh
new file mode 100644
index 000000000000..5acaeb824466
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qmake-libtool.sh
@@ -0,0 +1,14 @@
+# Fix libtool libraries generated by qmake.
+# qmake started inserting filenames of shared objects instead of the appropriate
+# linker flags. fixQmakeLibtool searches for broken libtool libraries and
+# replaces the filenames with the linker flags that should have been there.
+fixQmakeLibtool() {
+    if [ -d "$1" ]; then
+        find "$1" -name '*.la' | while read la; do
+            sed -i "$la" \
+                -e '/^dependency_libs/ s,\(/[^ ]\+\)/lib\([^/ ]\+\)\.so,-L\1 -l\2,g'
+        done
+    fi
+}
+
+fixupOutputHooks+=('fixQmakeLibtool $prefix')
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh b/nixpkgs/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
index eef2c7d24dfc..7f6ddb76ad57 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
+++ b/nixpkgs/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
@@ -1,14 +1,27 @@
+. @fix_qmake_libtool@
+
+qmakeFlags=( ${qmakeFlags-} )
+
+qmakePrePhase() {
+    qmakeFlags=( \
+        "PREFIX=$out" \
+        "NIX_OUTPUT_OUT=$out" \
+        "NIX_OUTPUT_DEV=${!outputDev}" \
+        "NIX_OUTPUT_BIN=${!outputBin}" \
+        "NIX_OUTPUT_DOC=${!outputDev}/${qtDocPrefix:?}" \
+        "NIX_OUTPUT_QML=${!outputBin}/${qtQmlPrefix:?}" \
+        "NIX_OUTPUT_PLUGIN=${!outputBin}/${qtPluginPrefix:?}" \
+        "${qmakeFlags[@]}" \
+    )
+}
+prePhases+=" qmakePrePhase"
+
 qmakeConfigurePhase() {
     runHook preConfigure
 
-    qmake PREFIX=$out \
-          NIX_OUTPUT_OUT=$out \
-          NIX_OUTPUT_DEV=${!outputDev} \
-          NIX_OUTPUT_BIN=${!outputBin} \
-          NIX_OUTPUT_DOC=${!outputDev}/${qtDocPrefix:?} \
-          NIX_OUTPUT_QML=${!outputBin}/${qtQmlPrefix:?} \
-          NIX_OUTPUT_PLUGIN=${!outputBin}/${qtPluginPrefix:?} \
-          $qmakeFlags
+    echo "QMAKEPATH=$QMAKEPATH"
+    echo qmake "${qmakeFlags[@]}"
+    qmake "${qmakeFlags[@]}"
 
     if ! [[ -v enableParallelBuilding ]]; then
         enableParallelBuilding=1
@@ -18,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/nixpkgs/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh b/nixpkgs/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
index 436c2e1d032a..9f2a9f06f1ab 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/hooks/qttools-setup-hook.sh b/nixpkgs/pkgs/development/libraries/qt-5/hooks/qttools-setup-hook.sh
index b09cf5f46c9c..c320a7974471 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/hooks/qttools-setup-hook.sh
+++ b/nixpkgs/pkgs/development/libraries/qt-5/hooks/qttools-setup-hook.sh
@@ -1 +1 @@
-qmakeFlags="$qmakeFlags${qmakeFlags:+ }QMAKE_LRELEASE=@dev@/bin/lrelease"
+qmakeFlags+=( "QMAKE_LRELEASE=@dev@/bin/lrelease" )
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh b/nixpkgs/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh
index d2aadbd956a8..7356c8ee3560 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/qt-5/mkDerivation.nix b/nixpkgs/pkgs/development/libraries/qt-5/mkDerivation.nix
index 95357c096dfd..2c6333cb0204 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/mkDerivation.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/mkDerivation.nix
@@ -12,9 +12,9 @@ let
     qmakeFlags = [ ("CONFIG+=" + (if debug then "debug" else "release")) ]
               ++ (args.qmakeFlags or []);
 
-    NIX_CFLAGS_COMPILE =
+    NIX_CFLAGS_COMPILE = toString (
       optional (!debug) "-DQT_NO_DEBUG"
-      ++ lib.toList (args.NIX_CFLAGS_COMPILE or []);
+      ++ lib.toList (args.NIX_CFLAGS_COMPILE or []));
 
     cmakeFlags =
       (args.cmakeFlags or [])
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix
index e2c71a77062e..bc23d0f9cafe 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix
@@ -2,7 +2,7 @@
   stdenv, lib,
   src, patches, version, qtCompatVersion,
 
-  coreutils, bison, flex, gdb, gperf, lndir, perl, pkgconfig, python2,
+  coreutils, bison, flex, gdb, gperf, lndir, perl, pkgconfig, python3,
   which,
   # darwin support
   darwin, libiconv,
@@ -14,7 +14,7 @@
   zlib,
 
   # optional dependencies
-  cups ? null, mysql ? null, postgresql ? null,
+  cups ? null, libmysqlclient ? null, postgresql ? null,
   withGtk3 ? false, dconf ? null, gtk3 ? null,
 
   # options
@@ -31,6 +31,8 @@ assert withGtk3 -> gtk3 != null;
 
 let
   compareVersion = v: builtins.compareVersions version v;
+  qmakeCacheName =
+    if compareVersion "5.12.4" < 0 then ".qmake.cache" else ".qmake.stash";
 in
 
 stdenv.mkDerivation {
@@ -47,7 +49,7 @@ stdenv.mkDerivation {
 
       # Image formats
       libjpeg libpng libtiff
-      (if compareVersion "5.9.0" >= 0 then pcre2 else pcre16)
+      (if compareVersion "5.9.0" < 0 then pcre16 else pcre2)
     ]
     ++ (
       if stdenv.isDarwin
@@ -56,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
         [
@@ -73,18 +75,19 @@ stdenv.mkDerivation {
     );
 
   buildInputs =
-    lib.optionals (!stdenv.isDarwin)
+    [ python3 ]
+    ++ lib.optionals (!stdenv.isDarwin)
     (
       [ libinput ]
       ++ lib.optional withGtk3 gtk3
     )
     ++ lib.optional developerBuild gdb
     ++ lib.optional (cups != null) cups
-    ++ lib.optional (mysql != null) mysql.connector-c
+    ++ lib.optional (libmysqlclient != null) libmysqlclient
     ++ lib.optional (postgresql != null) postgresql;
 
   nativeBuildInputs =
-    [ bison flex gperf lndir perl pkgconfig python2 which ];
+    [ bison flex gperf lndir perl pkgconfig which ];
 
   propagatedNativeBuildInputs = [ lndir ];
 
@@ -98,6 +101,7 @@ stdenv.mkDerivation {
     . "$fix_qt_builtin_paths"
     . "$fix_qt_module_paths"
     . ${../hooks/move-qt-dev-tools.sh}
+    . ${../hooks/fix-qmake-libtool.sh}
   '';
 
   postPatch =
@@ -166,13 +170,17 @@ stdenv.mkDerivation {
     export LD=$CXX
     ''}
 
-    configureFlags+="\
-        -plugindir $out/$qtPluginPrefix \
-        -qmldir $out/$qtQmlPrefix \
-        -docdir $out/$qtDocPrefix"
+    NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QT_PLUGIN_PREFIX=\"$qtPluginPrefix\""
+  '';
 
-    createQmakeCache() {
-        cat >>"$1" <<EOF
+  postConfigure = ''
+    qmakeCacheInjectNixOutputs() {
+        local cache="$1/${qmakeCacheName}"
+        echo "qmakeCacheInjectNixOutputs: $cache"
+        if ! [ -f "$cache" ]; then
+            echo >&2 "qmakeCacheInjectNixOutputs: WARNING: $cache does not exist"
+        fi
+        cat >>"$cache" <<EOF
     NIX_OUTPUT_BIN = $bin
     NIX_OUTPUT_DEV = $dev
     NIX_OUTPUT_OUT = $out
@@ -183,29 +191,21 @@ stdenv.mkDerivation {
     }
 
     find . -name '.qmake.conf' | while read conf; do
-        cache=$(dirname $conf)/.qmake.cache
-        echo "Creating \`$cache'"
-        createQmakeCache "$cache"
+        qmakeCacheInjectNixOutputs "$(dirname $conf)"
     done
-
-    NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QT_PLUGIN_PREFIX=\"$qtPluginPrefix\""
   '';
 
-
-  NIX_CFLAGS_COMPILE =
-    [
-      "-Wno-error=sign-compare" # freetype-2.5.4 changed signedness of some struct fields
-      ''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"''
-      ''-D${if compareVersion "5.11.0" >= 0 then "LIBRESOLV_SO" else "NIXPKGS_LIBRESOLV"}="${stdenv.cc.libc.out}/lib/libresolv"''
-      ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"''
-    ]
-
-    ++ lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"''
+  NIX_CFLAGS_COMPILE = toString ([
+    "-Wno-error=sign-compare" # freetype-2.5.4 changed signedness of some struct fields
+    ''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"''
+    ''-D${if compareVersion "5.11.0" >= 0 then "LIBRESOLV_SO" else "NIXPKGS_LIBRESOLV"}="${stdenv.cc.libc.out}/lib/libresolv"''
+    ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"''
+  ] ++ lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"''
     ++ lib.optionals withGtk3 [
          ''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"''
          ''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"''
        ]
-    ++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC";
+    ++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC");
 
   prefixKey = "-prefix ";
 
@@ -214,10 +214,13 @@ stdenv.mkDerivation {
   # To prevent these failures, we need to override PostgreSQL detection.
   PSQL_LIBS = lib.optionalString (postgresql != null) "-L${postgresql.lib}/lib -lpq";
 
-  # -no-eglfs, -no-directfb, -no-linuxfb and -no-kms because of the current minimalist mesa
   # TODO Remove obsolete and useless flags once the build will be totally mastered
   configureFlags =
     [
+      "-plugindir $(out)/$(qtPluginPrefix)"
+      "-qmldir $(out)/$(qtQmlPrefix)"
+      "-docdir $(out)/$(qtDocPrefix)"
+
       "-verbose"
       "-confirm-license"
       "-opensource"
@@ -285,7 +288,7 @@ stdenv.mkDerivation {
       "-L" "${openssl.out}/lib"
       "-I" "${openssl.dev}/include"
       "-system-sqlite"
-      ''-${if mysql != null then "plugin" else "no"}-sql-mysql''
+      ''-${if libmysqlclient != null then "plugin" else "no"}-sql-mysql''
       ''-${if postgresql != null then "plugin" else "no"}-sql-psql''
 
       "-make libs"
@@ -321,11 +324,6 @@ stdenv.mkDerivation {
 
           "-libinput"
 
-          "-no-eglfs"
-          "-no-gbm"
-          "-no-kms"
-          "-no-linuxfb"
-
           ''-${lib.optionalString (cups == null) "no-"}cups''
           "-dbus-linked"
           "-glib"
@@ -349,9 +347,9 @@ stdenv.mkDerivation {
           "-L" "${cups.lib}/lib"
           "-I" "${cups.dev}/include"
         ]
-        ++ lib.optionals (mysql != null) [
-          "-L" "${mysql.out}/lib"
-          "-I" "${mysql.out}/include"
+        ++ lib.optionals (libmysqlclient != null) [
+          "-L" "${libmysqlclient}/lib"
+          "-I" "${libmysqlclient}/include"
         ]
     );
 
@@ -392,13 +390,11 @@ stdenv.mkDerivation {
       moveToOutput bin "$dev"
     ''
 
-    + (
-        # fixup .pc file (where to find 'moc' etc.)
-        ''
-          sed -i "$dev/lib/pkgconfig/Qt5Core.pc" \
-              -e "/^host_bins=/ c host_bins=$dev/bin"
-        ''
-    );
+    # fixup .pc file (where to find 'moc' etc.)
+    + ''
+      sed -i "$dev/lib/pkgconfig/Qt5Core.pc" \
+          -e "/^host_bins=/ c host_bins=$dev/bin"
+    '';
 
   setupHook = ../hooks/qtbase-setup-hook.sh;
 
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
index c96aef3f4da5..df444eee2eb5 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
@@ -103,7 +103,7 @@ EOF
       --replace 'libs = [ "sandbox" ]' 'libs = [ "/usr/lib/libsandbox.1.dylib" ]'
     '');
 
-  NIX_CFLAGS_COMPILE = [
+  NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [
     # with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit
     "-Wno-class-memaccess"
   ] ++ lib.optionals (stdenv.hostPlatform.platform.gcc.arch or "" == "sandybridge") [
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebkit.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
index 78404ddffa87..542afdd55da0 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
@@ -50,13 +50,12 @@ qtModule {
     export qmakeFlags="$qmakeFlags CONFIG+=silent"
   '';
 
-  NIX_CFLAGS_COMPILE =
-    [
+  NIX_CFLAGS_COMPILE = [
       # with gcc7 this warning blows the log over Hydra's limit
       "-Wno-expansion-to-defined"
-      # with gcc8, -Wclass-memaccess became part of -Wall and this too exceeds the logging limit
-      "-Wno-class-memaccess"
     ]
+    # with gcc8, -Wclass-memaccess became part of -Wall and this too exceeds the logging limit
+    ++ optional stdenv.cc.isGNU "-Wno-class-memaccess"
     # with clang this warning blows the log over Hydra's limit
     ++ optional stdenv.isDarwin "-Wno-inconsistent-missing-override"
     ++ optionals flashplayerFix
diff --git a/nixpkgs/pkgs/development/libraries/qtkeychain/0002-Fix-install-name-Darwin.patch b/nixpkgs/pkgs/development/libraries/qtkeychain/0002-Fix-install-name-Darwin.patch
new file mode 100644
index 000000000000..30d93cd7bf8b
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/qtkeychain/default.nix b/nixpkgs/pkgs/development/libraries/qtkeychain/default.nix
index 3de84d859111..5b963255b65f 100644
--- a/nixpkgs/pkgs/development/libraries/qtkeychain/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qtkeychain/default.nix
@@ -19,17 +19,17 @@ 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" ];
 
   nativeBuildInputs = [ cmake ]
-    ++ stdenv.lib.optional (!stdenv.isDarwin) [ pkgconfig ] # for finding libsecret
+    ++ stdenv.lib.optionals (!stdenv.isDarwin) [ pkgconfig ] # for finding libsecret
   ;
 
-  buildInputs = stdenv.lib.optional (!stdenv.isDarwin) [ libsecret ]
+  buildInputs = stdenv.lib.optionals (!stdenv.isDarwin) [ libsecret ]
     ++ (if withQt5 then [ qtbase qttools ] else [ qt4 ])
-    ++ stdenv.lib.optional stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+    ++ stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
       CoreFoundation Security
     ])
   ;
diff --git a/nixpkgs/pkgs/development/libraries/qtpbfimageplugin/default.nix b/nixpkgs/pkgs/development/libraries/qtpbfimageplugin/default.nix
index 8ad908013bdc..5f3f8c4a66af 100644
--- a/nixpkgs/pkgs/development/libraries/qtpbfimageplugin/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix b/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix
index 88330712dcd4..7c2a99804c4d 100644
--- a/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "qtstyleplugin-kvantum-qt4";
-  version = "0.11.0";
+  version = "0.11.2";
 
   src = fetchFromGitHub {
     owner = "tsujan";
     repo = "Kvantum";
     rev = "V${version}";
-    sha256 = "0aqlv7mj7r9vjm6pvb8pv3cyx35lgz8rjjas3k8wfdr3sqyyy25g";
+    sha256 = "1jcfv96ws6sm3kc2q8zriwqhry24qbq3zbp8gkqw75wssbv82rmc";
   };
 
   nativeBuildInputs = [ qmake4Hook ];
diff --git a/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix b/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix
index dc11cb560910..71ca8e720a41 100644
--- a/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix
@@ -1,18 +1,24 @@
-{ stdenv, fetchFromGitHub, qmake, qtbase, qtsvg, qtx11extras, kwindowsystem, libX11, libXext, qttools }:
+{ stdenv, fetchFromGitHub, qmake, qtbase, qtsvg, qtx11extras, kwindowsystem
+, libX11, libXext, qttools, wrapQtAppsHook
+}:
 
 stdenv.mkDerivation rec {
   pname = "qtstyleplugin-kvantum";
-  version = "0.11.0";
+  version = "0.11.2";
 
   src = fetchFromGitHub {
     owner = "tsujan";
     repo = "Kvantum";
     rev = "V${version}";
-    sha256 = "0aqlv7mj7r9vjm6pvb8pv3cyx35lgz8rjjas3k8wfdr3sqyyy25g";
+    sha256 = "1jcfv96ws6sm3kc2q8zriwqhry24qbq3zbp8gkqw75wssbv82rmc";
   };
 
-  nativeBuildInputs = [ qmake qttools ];
-  buildInputs = [ qtbase qtsvg qtx11extras kwindowsystem libX11 libXext  ];
+  nativeBuildInputs = [
+    qmake qttools wrapQtAppsHook
+  ];
+  buildInputs = [
+    qtbase qtsvg qtx11extras kwindowsystem libX11 libXext
+  ];
 
   sourceRoot = "source/Kvantum";
 
diff --git a/nixpkgs/pkgs/development/libraries/qtutilities/default.nix b/nixpkgs/pkgs/development/libraries/qtutilities/default.nix
index 9eb43991bd6d..b6f424ee35c9 100644
--- a/nixpkgs/pkgs/development/libraries/qtutilities/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qtutilities/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "qtutilities";
-  version = "6.0.0";
+  version = "6.0.2";
 
   src = fetchFromGitHub {
     owner = "Martchus";
     repo = pname;
     rev = "v${version}";
-    sha256 = "0d2x4djr8lqb4vad8g8vxvd1sgki4issxhyy5r32snh2i8pxpbp9";
+    sha256 = "1hsi6c1466m5lgh8ayhf3hj4ddy6ambraagzgvvy7g370z4mx2yw";
   };
 
   buildInputs = [ qtbase cpp-utilities ];
diff --git a/nixpkgs/pkgs/development/libraries/quesoglc/default.nix b/nixpkgs/pkgs/development/libraries/quesoglc/default.nix
index 2e47a2135657..fe24d0fcddfd 100644
--- a/nixpkgs/pkgs/development/libraries/quesoglc/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/quickder/default.nix b/nixpkgs/pkgs/development/libraries/quickder/default.nix
index 14bfd40a5932..529d361f206f 100644
--- a/nixpkgs/pkgs/development/libraries/quickder/default.nix
+++ b/nixpkgs/pkgs/development/libraries/quickder/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchFromGitHub, python2Packages, hexio
-, which, cmake, bash, arpa2cm, git, asn2quickder, pkgconfig }:
+, cmake, bash, arpa2cm, git, asn2quickder }:
 
 stdenv.mkDerivation rec {
   pname = "quickder";
@@ -12,20 +12,17 @@ stdenv.mkDerivation rec {
     repo = "quick-der";
   };
 
+  nativeBuildInputs = [ cmake ];
+
   buildInputs = with python2Packages; [
     arpa2cm
     asn1ate
-    bash
-    cmake
-    git
     hexio
     pyparsing
     python
     six
-    which
     asn1ate
     asn2quickder
-    pkgconfig
   ];
 
   postPatch = ''
@@ -39,9 +36,6 @@ stdenv.mkDerivation rec {
   cmakeFlags = [
     "-DNO_TESTING=ON"
     "-DARPA2CM_TOOLCHAIN_DIR=$out/share/ARPA2CM/toolchain/"
-    "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
-    "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
-    "-DPACKAGE_NO_PACKAGE_REGISTRY=ON"
   ];
 
   preConfigure = ''
diff --git a/nixpkgs/pkgs/development/libraries/rabbitmq-c/default.nix b/nixpkgs/pkgs/development/libraries/rabbitmq-c/default.nix
index fe48d99b383c..487de0976bd4 100644
--- a/nixpkgs/pkgs/development/libraries/rabbitmq-c/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/raft-canonical/default.nix b/nixpkgs/pkgs/development/libraries/raft-canonical/default.nix
new file mode 100644
index 000000000000..515fbc602d90
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/raft-canonical/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, file, libuv }:
+
+stdenv.mkDerivation rec {
+  pname = "raft-canonical";
+  version = "0.9.6";
+
+  src = fetchFromGitHub {
+    owner = "canonical";
+    repo = "raft";
+    rev = "v${version}";
+    sha256 = "083il7b5kw3pc7m5p9xjpb9dlvfarc51sni92mkgm9ckc32x9vpp";
+  };
+
+  nativeBuildInputs = [ autoreconfHook file pkgconfig ];
+  buildInputs = [ libuv ];
+
+  preConfigure = ''
+    substituteInPlace configure --replace /usr/bin/ " "
+  '';
+
+  doCheck = false;
+  # Due to
+  #io_uv_recv/success/first                                    [ ERROR ]
+  #Error: test/lib/dir.c:97: No such file or directory
+  #Error: child killed by signal 6 (Aborted)
+
+  outputs = [ "dev" "out" ];
+
+  meta = with stdenv.lib; {
+    description = ''
+      Fully asynchronous C implementation of the Raft consensus protocol
+    '';
+    longDescription = ''
+      The library has modular design: its core part implements only the core
+      Raft algorithm logic, in a fully platform independent way. On top of
+      that, a pluggable interface defines the I/O implementation for networking
+      (send/receive RPC messages) and disk persistence (store log entries and
+      snapshots).
+    '';
+    homepage = "https://github.com/canonical/raft";
+    license = licenses.asl20;
+    maintainers = [ maintainers.wucke13 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/randomx/default.nix b/nixpkgs/pkgs/development/libraries/randomx/default.nix
new file mode 100644
index 000000000000..9e6cdfecb954
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/range-v3/default.nix b/nixpkgs/pkgs/development/libraries/range-v3/default.nix
index e02b22af7565..56c5754831ef 100644
--- a/nixpkgs/pkgs/development/libraries/range-v3/default.nix
+++ b/nixpkgs/pkgs/development/libraries/range-v3/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "range-v3";
-  version = "0.5.0";
+  version = "0.10.0";
 
   src = fetchFromGitHub {
     owner = "ericniebler";
     repo = "range-v3";
     rev = version;
-    sha256 = "0fzbpaa4vwlivi417zxm1d6v4lkp5c9f5bd706nn2fmw3zxjj815";
+    sha256 = "1h9h5j7pdi0afpip9ncq76h1xjhvb8bnm585q17afz2l4fydy8qj";
   };
 
   nativeBuildInputs = [ cmake ];
@@ -23,6 +23,6 @@ stdenv.mkDerivation rec {
     homepage = https://github.com/ericniebler/range-v3;
     license = licenses.boost;
     platforms = platforms.all;
-    maintainers = with maintainers; [ xwvvvvwx ];
+    maintainers = with maintainers; [ primeos xwvvvvwx ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/rdkafka/default.nix b/nixpkgs/pkgs/development/libraries/rdkafka/default.nix
index 165e9716a977..cb1b176ce353 100644
--- a/nixpkgs/pkgs/development/libraries/rdkafka/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rdkafka/default.nix
@@ -2,16 +2,17 @@
 
 stdenv.mkDerivation rec {
   pname = "rdkafka";
-  version = "1.0.1";
+  version = "1.3.0";
 
   src = fetchFromGitHub {
     owner = "edenhill";
     repo = "librdkafka";
     rev = "v${version}";
-    sha256 = "1jxwsizqwckjzirh9gsvlca46z4y3i47vcifs1fh8gxb2lvdfgwb";
+    sha256 = "1arwpvva2b1m3yd618s59v38gwsi0nnm07g6yc9dapcgxrkg5n0h";
   };
 
   nativeBuildInputs = [ pkgconfig ];
+
   buildInputs = [ zlib perl python openssl ];
 
   NIX_CFLAGS_COMPILE = "-Wno-error=strict-overflow";
@@ -20,6 +21,8 @@ stdenv.mkDerivation rec {
     patchShebangs .
   '';
 
+  enableParallelBuilding = true;
+
   meta = with stdenv.lib; {
     description = "librdkafka - Apache Kafka C/C++ client library";
     homepage = https://github.com/edenhill/librdkafka;
diff --git a/nixpkgs/pkgs/development/libraries/readline/6.2.nix b/nixpkgs/pkgs/development/libraries/readline/6.2.nix
index 54aa42439d97..af59e50ec5e2 100644
--- a/nixpkgs/pkgs/development/libraries/readline/6.2.nix
+++ b/nixpkgs/pkgs/development/libraries/readline/6.2.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation (rec {
 
   propagatedBuildInputs = [ncurses];
 
-  patchFlags = "-p0";
+  patchFlags = [ "-p0" ];
   patches =
     [ ./link-against-ncurses.patch
       ./no-arch_only.patch
diff --git a/nixpkgs/pkgs/development/libraries/readline/6.3.nix b/nixpkgs/pkgs/development/libraries/readline/6.3.nix
index 73ed823d2be5..1e5d9a0a664b 100644
--- a/nixpkgs/pkgs/development/libraries/readline/6.3.nix
+++ b/nixpkgs/pkgs/development/libraries/readline/6.3.nix
@@ -12,13 +12,11 @@ stdenv.mkDerivation {
 
   propagatedBuildInputs = [ncurses];
 
-  patchFlags = "-p0";
+  patchFlags = [ "-p0" ];
 
-  configureFlags =
-    stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
-    [ # This test requires running host code
-      "bash_cv_wcwidth_broken=no"
-    ];
+  configureFlags = stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
+    # This test requires running host code
+    "bash_cv_wcwidth_broken=no";
 
   patches =
     [ ./link-against-ncurses.patch
diff --git a/nixpkgs/pkgs/development/libraries/readline/7.0.nix b/nixpkgs/pkgs/development/libraries/readline/7.0.nix
index 11d5c3780154..065d65449867 100644
--- a/nixpkgs/pkgs/development/libraries/readline/7.0.nix
+++ b/nixpkgs/pkgs/development/libraries/readline/7.0.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ncurses];
 
-  patchFlags = "-p0";
+  patchFlags = [ "-p0" ];
 
   upstreamPatches =
     (let
diff --git a/nixpkgs/pkgs/development/libraries/readline/8.0.nix b/nixpkgs/pkgs/development/libraries/readline/8.0.nix
index cdc36617c52d..7fbef9a986ab 100644
--- a/nixpkgs/pkgs/development/libraries/readline/8.0.nix
+++ b/nixpkgs/pkgs/development/libraries/readline/8.0.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ncurses];
 
-  patchFlags = "-p0";
+  patchFlags = [ "-p0" ];
 
   upstreamPatches =
     (let
diff --git a/nixpkgs/pkgs/development/libraries/rnnoise/default.nix b/nixpkgs/pkgs/development/libraries/rnnoise/default.nix
new file mode 100644
index 000000000000..fe6b75446b21
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/robin-map/default.nix b/nixpkgs/pkgs/development/libraries/robin-map/default.nix
index 87c855251e0f..4aba29c58305 100644
--- a/nixpkgs/pkgs/development/libraries/robin-map/default.nix
+++ b/nixpkgs/pkgs/development/libraries/robin-map/default.nix
@@ -5,13 +5,13 @@
 
 stdenv.mkDerivation rec {
   pname = "robin-map";
-  version = "0.6.1";
+  version = "0.6.2";
 
   src = fetchFromGitHub {
     owner = "Tessil";
     repo = pname;
     rev = "v${version}";
-    sha256 = "0blvvbr14f0drbd6dp0cs8x4ng3ppb5i72dmhk43ylg6yjgh4fhq";
+    sha256 = "0y532zg0aaqz3fpv785n2drwpnryaclr53drpqimnbf3cs0jw997";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/development/libraries/rocksdb/default.nix b/nixpkgs/pkgs/development/libraries/rocksdb/default.nix
index 1b6b5b1b57bf..2d3d1e8d722d 100644
--- a/nixpkgs/pkgs/development/libraries/rocksdb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rocksdb/default.nix
@@ -1,23 +1,37 @@
-{ 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.2.2";
+  version = "6.4.6";
 
   src = fetchFromGitHub {
     owner = "facebook";
     repo = pname;
     rev = "v${version}";
-    sha256 = "0wz9rfj8gk6gyabh9anl67fqm5dw2z866y1a0k0j2lmcaag537r2";
+    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 "
   '';
 
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-error=deprecated-copy -Wno-error=pessimizing-move";
+
   cmakeFlags = [
     "-DPORTABLE=1"
     "-DWITH_JEMALLOC=0"
@@ -30,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/nixpkgs/pkgs/development/libraries/safefile/default.nix b/nixpkgs/pkgs/development/libraries/safefile/default.nix
index b69cd56d35d0..5136bac2de05 100644
--- a/nixpkgs/pkgs/development/libraries/safefile/default.nix
+++ b/nixpkgs/pkgs/development/libraries/safefile/default.nix
@@ -8,8 +8,6 @@ stdenv.mkDerivation rec {
     sha256 = "1y0gikds2nr8jk8smhrl617njk23ymmpxyjb2j1xbj0k82xspv78";
   };
 
-  buildInputs = [];
-
   passthru = {
     updateScript = ''
       #!${runtimeShell}
diff --git a/nixpkgs/pkgs/development/libraries/schroedinger/default.nix b/nixpkgs/pkgs/development/libraries/schroedinger/default.nix
index 25126edbc0f4..1831161979d3 100644
--- a/nixpkgs/pkgs/development/libraries/schroedinger/default.nix
+++ b/nixpkgs/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";
   };
 
@@ -18,7 +15,7 @@ stdenv.mkDerivation {
 
   doCheck = (!stdenv.isDarwin);
 
-  patchFlags = "-p0";
+  patchFlags = [ "-p0" ];
   patches = [
     (fetchpatch {
       url = "https://raw.githubusercontent.com/macports/macports-ports/master/multimedia/schroedinger/files/patch-testsuite-Makefile.am.diff";
@@ -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/nixpkgs/pkgs/development/libraries/science/benchmark/papi/default.nix b/nixpkgs/pkgs/development/libraries/science/benchmark/papi/default.nix
index 35d0914e3f76..53ae70f5bf8a 100644
--- a/nixpkgs/pkgs/development/libraries/science/benchmark/papi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/benchmark/papi/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
     sha256 = "13mngf9kl0y2wfxqvkad0smdaag7k8fvw82b4312gx62nwhc1i6r";
   };
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=format-truncation" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error=format-truncation";
 
   preConfigure = ''
     cd src
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/elastix/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/elastix/default.nix
index 5f4cbbaa5670..4cfc07c1cbaa 100644
--- a/nixpkgs/pkgs/development/libraries/science/biology/elastix/default.nix
+++ b/nixpkgs/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 ];
 
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix
index 0b13696ad5f8..7d771414fb01 100644
--- a/nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--enable-libcurl" ]; # optional but strongly recommended
 
-  installFlags = "prefix=$(out)";
+  installFlags = [ "prefix=$(out)" ];
 
   preCheck = ''
     patchShebangs test/
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/mirtk/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/mirtk/default.nix
index e6c58b96e5c7..4291e11ed33f 100644
--- a/nixpkgs/pkgs/development/libraries/science/biology/mirtk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/biology/mirtk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, gtest, fetchFromGitHub, cmake, boost, eigen, python, vtk, zlib }:
+{ stdenv, gtest, fetchFromGitHub, cmake, boost, eigen, python, vtk, zlib, tbb }:
 
 stdenv.mkDerivation rec {
   version = "2.0.0";
@@ -12,7 +12,11 @@ stdenv.mkDerivation rec {
     fetchSubmodules = true;
   };
 
-  cmakeFlags = "-DWITH_VTK=ON -DBUILD_ALL_MODULES=ON";
+  cmakeFlags = [
+    "-DWITH_VTK=ON"
+    "-DBUILD_ALL_MODULES=ON"
+    "-DWITH_TBB=ON"
+  ];
 
   doCheck = true;
 
@@ -30,7 +34,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   nativeBuildInputs = [ cmake gtest ];
-  buildInputs = [ boost eigen python vtk zlib ];
+  buildInputs = [ boost eigen python vtk zlib tbb ];
 
   meta = with stdenv.lib; {
     homepage = "https://github.com/BioMedIA/MIRTK";
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/nifticlib/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/nifticlib/default.nix
index 51eed36312dd..8c7da7968f5c 100644
--- a/nixpkgs/pkgs/development/libraries/science/biology/nifticlib/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/science/math/QuadProgpp/default.nix b/nixpkgs/pkgs/development/libraries/science/math/QuadProgpp/default.nix
index d43331464067..69ccbfc26b40 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/QuadProgpp/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/science/math/brial/default.nix b/nixpkgs/pkgs/development/libraries/science/math/brial/default.nix
index f08f6425655f..56a78b00cd64 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/brial/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/science/math/caffe2/default.nix b/nixpkgs/pkgs/development/libraries/science/math/caffe2/default.nix
index 26ec1237601f..a5c373ecde97 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/caffe2/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/science/math/clmagma/default.nix b/nixpkgs/pkgs/development/libraries/science/math/clmagma/default.nix
new file mode 100644
index 000000000000..b5c59a83277d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/clmagma/default.nix
@@ -0,0 +1,75 @@
+{ stdenv, fetchurl, gfortran, opencl-headers, clblas, ocl-icd, mkl, intel-ocl }:
+
+with stdenv.lib;
+
+let 
+  version = "1.3.0";
+  incfile = builtins.toFile "make.inc.custom" ''
+    CC        = g++
+    FORT      = gfortran
+    
+    ARCH      = ar
+    ARCHFLAGS = cr
+    RANLIB    = ranlib
+
+    OPTS      = -fPIC -O3 -DADD_ -Wall
+    FOPTS     = -fPIC -O3 -DADD_ -Wall -x f95-cpp-input
+    F77OPTS   = -fPIC -O3 -DADD_ -Wall
+    LDOPTS    = -fPIC
+   
+    -include make.check-mkl
+    -include make.check-clblas
+    
+    # Gnu mkl is not available I guess?
+    #LIB       = -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lpthread -lm -fopenmp
+    LIB        = -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lm -fopenmp
+    LIB       += -lclBLAS -lOpenCL
+    
+    LIBDIR    = -L$(MKLROOT)/lib/intel64 \
+                -L$(MKLROOT)/../compiler/lib/intel64 \
+                -L$(clBLAS)/lib64
+    
+    INC       = -I$(clBLAS)/include 
+               #-I$(AMDAPP)/include
+  '';  
+in stdenv.mkDerivation {
+  name = "clmagma-${version}";
+  src = fetchurl {
+    url = "http://icl.cs.utk.edu/projectsfiles/magma/cl/clmagma-${version}.tar.gz";
+    sha256 = "1n27ny0xhwirw2ydn46pfcwy53gzia9zbam4irx44fd4d7f9ydv7";
+    name = "clmagma-${version}.tar.gz";
+  };
+
+  buildInputs = [ 
+    gfortran 
+    clblas 
+    opencl-headers 
+    ocl-icd  
+    mkl
+    intel-ocl
+  ];
+
+  enableParallelBuilding=true;
+
+  MKLROOT   = "${mkl}";
+  clBLAS    = "${clblas}";
+
+  # Otherwise build looks for it in /run/opengl-driver/etc/OpenCL/vendors, 
+  # which is not available.
+  OPENCL_VENDOR_PATH="${intel-ocl}/etc/OpenCL/vendors";
+
+  preBuild = ''  
+    # By default it tries to use GPU, and thus fails for CPUs
+    sed -i "s/CL_DEVICE_TYPE_GPU/CL_DEVICE_TYPE_DEFAULT/" interface_opencl/clmagma_runtime.cpp   
+    sed -i "s%/usr/local/clmagma%/$out%" Makefile.internal
+    cp ${incfile} make.inc
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Matrix Algebra on GPU and Multicore Architectures, OpenCL port";
+    license = licenses.bsd3;
+    homepage = http://icl.cs.utk.edu/magma/index.html;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ volhovm ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/cudnn/default.nix b/nixpkgs/pkgs/development/libraries/science/math/cudnn/default.nix
index a33e3ec20096..8cd74939959d 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/cudnn/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix b/nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix
index f0f5829ce465..5a17e807bd43 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix
@@ -46,7 +46,7 @@ stdenv.mkDerivation {
 
   passthru = {
     inherit cudatoolkit;
-    majorVersion = lib.head (lib.splitString "." version);
+    majorVersion = lib.versions.major version;
   };
 
   meta = with stdenv.lib; {
diff --git a/nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix b/nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix
index a93ede63a263..2bb284477e6d 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix
@@ -142,26 +142,27 @@ stdenv.mkDerivation {
     numpy pkgconfig six sphinx suitesparse sympy ufl vtk zlib
     ] ++ stdenv.lib.optionals pythonBindings [ ply python numpy swig ];
   patches = [ ./unicode.patch ];
-  cmakeFlags = "-DDOLFIN_CXX_FLAGS=-std=c++11"
-    + " -DDOLFIN_AUTO_DETECT_MPI=OFF"
-    + " -DDOLFIN_ENABLE_CHOLMOD=" + (if suitesparse != null then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_DOCS=" + (if docs then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_GTEST=" + (if gtest != null then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_HDF5=" + (if hdf5 != null then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_MPI=" + (if mpi != null then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_PARMETIS=OFF"
-    + " -DDOLFIN_ENABLE_PETSC4PY=OFF"
-    + " -DDOLFIN_ENABLE_PETSC=OFF"
-    + " -DDOLFIN_ENABLE_PYTHON=" + (if pythonBindings then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_SCOTCH=OFF"
-    + " -DDOLFIN_ENABLE_SLEPC4PY=OFF"
-    + " -DDOLFIN_ENABLE_SLEPC=OFF"
-    + " -DDOLFIN_ENABLE_SPHINX=" + (if sphinx != null then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_TESTING=" + (if doCheck then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_TRILINOS=OFF"
-    + " -DDOLFIN_ENABLE_UMFPACK=" + (if suitesparse != null then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_VTK=" + (if vtk != null then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_ZLIB=" + (if zlib != null then "ON" else "OFF");
+  cmakeFlags = [ "-DDOLFIN_CXX_FLAGS=-std=c++11"
+    "-DDOLFIN_AUTO_DETECT_MPI=OFF"
+    ("-DDOLFIN_ENABLE_CHOLMOD=" + (if suitesparse != null then "ON" else "OFF"))
+    ("-DDOLFIN_ENABLE_DOCS=" + (if docs then "ON" else "OFF"))
+    ("-DDOLFIN_ENABLE_GTEST=" + (if gtest != null then "ON" else "OFF"))
+    ("-DDOLFIN_ENABLE_HDF5=" + (if hdf5 != null then "ON" else "OFF"))
+    ("-DDOLFIN_ENABLE_MPI=" + (if mpi != null then "ON" else "OFF"))
+    "-DDOLFIN_ENABLE_PARMETIS=OFF"
+    "-DDOLFIN_ENABLE_PETSC4PY=OFF"
+    "-DDOLFIN_ENABLE_PETSC=OFF"
+    ("-DDOLFIN_ENABLE_PYTHON=" + (if pythonBindings then "ON" else "OFF"))
+    "-DDOLFIN_ENABLE_SCOTCH=OFF"
+    "-DDOLFIN_ENABLE_SLEPC4PY=OFF"
+    "-DDOLFIN_ENABLE_SLEPC=OFF"
+    ("-DDOLFIN_ENABLE_SPHINX=" + (if sphinx != null then "ON" else "OFF"))
+    ("-DDOLFIN_ENABLE_TESTING=" + (if doCheck then "ON" else "OFF"))
+    "-DDOLFIN_ENABLE_TRILINOS=OFF"
+    ("-DDOLFIN_ENABLE_UMFPACK=" + (if suitesparse != null then "ON" else "OFF"))
+    ("-DDOLFIN_ENABLE_VTK=" + (if vtk != null then "ON" else "OFF"))
+    ("-DDOLFIN_ENABLE_ZLIB=" + (if zlib != null then "ON" else "OFF"))
+  ];
   checkPhase = ''
     make runtests
   '';
diff --git a/nixpkgs/pkgs/development/libraries/science/math/lcalc/makefile.patch b/nixpkgs/pkgs/development/libraries/science/math/lcalc/makefile.patch
index f55bbe3f24fa..5c22cf0b84e8 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/lcalc/makefile.patch
+++ b/nixpkgs/pkgs/development/libraries/science/math/lcalc/makefile.patch
@@ -104,10 +104,10 @@ index 84e4e88..56ca676 100644
 -	cp -rf ../include $(INSTALL_DIR)/include/Lfunction
 +	install -d $(INSTALL_DIR)/bin
 +	install -d $(INSTALL_DIR)/$(LIB_DIR)
-+	install -d $(INSTALL_DIR)/include/libLfunction
++	install -d $(INSTALL_DIR)/include/Lfunction
 +	install lcalc $(INSTALL_DIR)/bin
 +	install libLfunction.so $(INSTALL_DIR)/$(LIB_DIR)
-+	install -m 644 -t $(INSTALL_DIR)/include/libLfunction ../include/*.h
++	install -m 644 -t $(INSTALL_DIR)/include/Lfunction ../include/*.h
  
  
  SRCS = Lcommandline.cc Lcommandline_elliptic.cc Lcommandline_globals.cc Lcommandline_misc.cc Lcommandline_numbertheory.cc Lcommandline_twist.cc Lcommandline_values_zeros.cc Lgamma.cc Lglobals.cc Lmisc.cc Lriemannsiegel.cc Lriemannsiegel_blfi.cc cmdline.c
diff --git a/nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix b/nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix
index 076376dc3c15..a7d01e22d962 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/science/math/magma/default.nix b/nixpkgs/pkgs/development/libraries/science/math/magma/default.nix
index ef4e89aecb84..6a07ebdb862f 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/magma/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/magma/default.nix
@@ -24,6 +24,10 @@ in stdenv.mkDerivation {
 
   MKLROOT = optionalString mklSupport mkl;
 
+  preConfigure = ''
+    export CC=${cudatoolkit.cc}/bin/gcc CXX=${cudatoolkit.cc}/bin/g++
+  '';
+
   enableParallelBuilding=true;
   buildFlags = [ "magma" "magma_sparse" ];
 
diff --git a/nixpkgs/pkgs/development/libraries/science/math/mkl/default.nix b/nixpkgs/pkgs/development/libraries/science/math/mkl/default.nix
index 2dcac58bf6ca..604413c96d8a 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/mkl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/mkl/default.nix
@@ -1,13 +1,27 @@
-{ stdenvNoCC, fetchurl, rpmextract, undmg, darwin }:
+{ stdenvNoCC, fetchurl, rpmextract, undmg, darwin, enableStatic ? false }:
 /*
   For details on using mkl as a blas provider for python packages such as numpy,
   numexpr, scipy, etc., see the Python section of the NixPkgs manual.
 */
-stdenvNoCC.mkDerivation (rec {
-  name = "mkl-${version}";
-  version = "${date}.${rel}";
-  date = "2019.3";
-  rel = "199";
+let
+  # Release notes and download URLs are here:
+  # https://registrationcenter.intel.com/en/products/
+  version = "${year}.${spot}.${rel}";
+  year = "2019";
+
+  # Darwin is pinned to 2019.3 because the DMG does not unpack; see here for details:
+  # https://github.com/matthewbauer/undmg/issues/4
+  spot = if stdenvNoCC.isDarwin then "3" else "5";
+  rel = if stdenvNoCC.isDarwin then "199" else "281";
+
+  rpm-ver = "${year}.${spot}-${rel}-${year}.${spot}-${rel}";
+
+  # Intel openmp uses its own versioning, but shares the spot release patch.
+  openmp-ver = "19.0.${spot}-${rel}-19.0.${spot}-${rel}";
+
+in stdenvNoCC.mkDerivation {
+  pname = "mkl";
+  inherit version;
 
   src = if stdenvNoCC.isDarwin
     then
@@ -17,29 +31,58 @@ stdenvNoCC.mkDerivation (rec {
       })
     else
       (fetchurl {
-        url = "http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/15275/l_mkl_${version}.tgz";
-        sha256 = "13rb2v2872jmvzcqm4fqsvhry0j2r5cn4lqql4wpqbl1yia2pph6";
+        url = "https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/15816/l_mkl_${version}.tgz";
+        sha256 = "0zkk4rrq7g44acxaxhpd2053r66w169mww6917an0lxhd52fm5cr";
       });
 
   nativeBuildInputs = if stdenvNoCC.isDarwin
     then
-      [ undmg
-        darwin.cctools
-      ]
+      [ undmg darwin.cctools ]
     else
       [ rpmextract ];
 
   buildPhase = if stdenvNoCC.isDarwin then ''
-      for f in Contents/Resources/pkg/*.tgz; do
-          tar xzvf $f
-      done
+    for f in Contents/Resources/pkg/*.tgz; do
+      tar xzvf $f
+    done
   '' else ''
-    rpmextract rpm/intel-mkl-common-c-${date}-${rel}-${date}-${rel}.noarch.rpm
-    rpmextract rpm/intel-mkl-core-rt-${date}-${rel}-${date}-${rel}.x86_64.rpm
-    rpmextract rpm/intel-openmp-19.0.3-${rel}-19.0.3-${rel}.x86_64.rpm
-  '';
+    # Common stuff
+    rpmextract rpm/intel-mkl-core-${rpm-ver}.x86_64.rpm
+    rpmextract rpm/intel-mkl-common-c-${rpm-ver}.noarch.rpm
+    rpmextract rpm/intel-mkl-common-f-${rpm-ver}.noarch.rpm
+
+    # Dynamic libraries
+    rpmextract rpm/intel-mkl-cluster-rt-${rpm-ver}.x86_64.rpm
+    rpmextract rpm/intel-mkl-core-rt-${rpm-ver}.x86_64.rpm
+    rpmextract rpm/intel-mkl-gnu-f-rt-${rpm-ver}.x86_64.rpm
+    rpmextract rpm/intel-mkl-gnu-rt-${rpm-ver}.x86_64.rpm
 
-  installPhase = if stdenvNoCC.isDarwin then ''
+    # Intel OpenMP runtime
+    rpmextract rpm/intel-openmp-${openmp-ver}.x86_64.rpm
+  '' + (if enableStatic then ''
+    # Static libraries
+    rpmextract rpm/intel-mkl-cluster-${rpm-ver}.x86_64.rpm
+    rpmextract rpm/intel-mkl-gnu-${rpm-ver}.x86_64.rpm
+    rpmextract rpm/intel-mkl-gnu-f-${rpm-ver}.x86_64.rpm
+  '' else ''
+    # Take care of installing dynamic-only PkgConfig files during the installPhase
+  ''
+  );
+
+  installPhase = ''
+    for f in $(find . -name 'mkl*.pc') ; do
+      bn=$(basename $f)
+      substituteInPlace $f \
+        --replace "prefix=<INSTALLDIR>/mkl" "prefix=$out" \
+        --replace "lib/intel64_lin" "lib"
+    done
+
+    for f in $(find opt/intel -name 'mkl*iomp.pc') ; do
+      substituteInPlace $f \
+        --replace "../compiler/lib" "lib"
+    done
+  '' +
+    (if stdenvNoCC.isDarwin then ''
       mkdir -p $out/lib
 
       cp -r compilers_and_libraries_${version}/mac/mkl/include $out/
@@ -48,26 +91,37 @@ stdenvNoCC.mkDerivation (rec {
       cp -r compilers_and_libraries_${version}/mac/compiler/lib/* $out/lib/
       cp -r compilers_and_libraries_${version}/mac/mkl/lib/* $out/lib/
       cp -r compilers_and_libraries_${version}/mac/tbb/lib/* $out/lib/
+
+      mkdir -p $out/lib/pkgconfig
+      cp -r compilers_and_libraries_${version}/mac/mkl/bin/pkgconfig/* $out/lib/pkgconfig
   '' else ''
       mkdir -p $out/lib
+      cp license.txt $out/lib/
 
       cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/include $out/
 
+      mkdir -p $out/lib/pkgconfig
+  '') +
+    (if enableStatic then ''
       cp -r opt/intel/compilers_and_libraries_${version}/linux/compiler/lib/intel64_lin/* $out/lib/
       cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/lib/intel64_lin/* $out/lib/
-      cp license.txt $out/lib/
-  '';
+      cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/bin/pkgconfig/* $out/lib/pkgconfig
+    '' else ''
+      cp -r opt/intel/compilers_and_libraries_${version}/linux/compiler/lib/intel64_lin/*.so* $out/lib/
+      cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/lib/intel64_lin/*.so* $out/lib/
+      cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/bin/pkgconfig/*dynamic*.pc $out/lib/pkgconfig
+    '');
 
   # fixDarwinDylibName fails for libmkl_cdft_core.dylib because the
   # larger updated load commands do not fit. Use install_name_tool
   # explicitly and ignore the error.
   postFixup = stdenvNoCC.lib.optionalString stdenvNoCC.isDarwin ''
-      for f in $out/lib/*.dylib; do
-          install_name_tool -id $out/lib/$(basename $f) $f || true
-      done
-      install_name_tool -change @rpath/libiomp5.dylib $out/lib/libiomp5.dylib $out/lib/libmkl_intel_thread.dylib
-      install_name_tool -change @rpath/libtbb.dylib $out/lib/libtbb.dylib $out/lib/libmkl_tbb_thread.dylib
-      install_name_tool -change @rpath/libtbbmalloc.dylib $out/lib/libtbbmalloc.dylib $out/lib/libtbbmalloc_proxy.dylib
+    for f in $out/lib/*.dylib; do
+      install_name_tool -id $out/lib/$(basename $f) $f || true
+    done
+    install_name_tool -change @rpath/libiomp5.dylib $out/lib/libiomp5.dylib $out/lib/libmkl_intel_thread.dylib
+    install_name_tool -change @rpath/libtbb.dylib $out/lib/libtbb.dylib $out/lib/libmkl_tbb_thread.dylib
+    install_name_tool -change @rpath/libtbbmalloc.dylib $out/lib/libtbbmalloc.dylib $out/lib/libtbbmalloc_proxy.dylib
   '';
 
   # Per license agreement, do not modify the binary
@@ -85,12 +139,6 @@ stdenvNoCC.mkDerivation (rec {
     homepage = https://software.intel.com/en-us/mkl;
     license = licenses.issl;
     platforms = [ "x86_64-linux" "x86_64-darwin" ];
-    maintainers = [ maintainers.bhipple ];
+    maintainers = with maintainers; [ bhipple ];
   };
- } // stdenvNoCC.lib.optionalAttrs stdenvNoCC.isLinux {
-  # Since on Linux binaries are unmodified, we can make them
-  # fixed-output derivations.
-	outputHashAlgo = "sha256";
-	outputHashMode = "recursive";
-	outputHash = "101krzh2mjbfx8kvxim2zphdvgg7iijhbf9xdz3ad3ncgybxbdvw";
- })
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix b/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix
index f8d392691ab2..a26cf38a9d09 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix
@@ -8,6 +8,7 @@
 # See https://github.com/xianyi/OpenBLAS/blob/develop/TargetList.txt
 , target ? null
 , enableStatic ? false
+, enableShared ? true
 }:
 
 with stdenv.lib;
@@ -60,7 +61,7 @@ let
       TARGET = setTarget "ATHLON";
       DYNAMIC_ARCH = true;
       NO_AVX512 = true;
-      USE_OPENMP = true;
+      USE_OPENMP = !stdenv.hostPlatform.isMusl;
     };
   };
 in
@@ -115,6 +116,9 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     perl
     which
+  ];
+
+  depsBuildBuild = [
     buildPackages.gfortran
     buildPackages.stdenv.cc
   ];
@@ -126,6 +130,7 @@ stdenv.mkDerivation rec {
     NUM_THREADS = 64;
     INTERFACE64 = blas64;
     NO_STATIC = !enableStatic;
+    NO_SHARED = !enableShared;
     CROSS = stdenv.hostPlatform != stdenv.buildPlatform;
     HOSTCC = "cc";
     # Makefile.system only checks defined status
diff --git a/nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix b/nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix
index 6fc96623a33c..e4a3241c1f38 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix
@@ -2,10 +2,10 @@
 
 stdenv.mkDerivation rec {
   pname = "openlibm";
-  version = "0.6.0";
+  version = "0.7.0";
   src = fetchurl {
     url = "https://github.com/JuliaLang/openlibm/archive/v${version}.tar.gz";
-    sha256 = "0a5fpm8nra5ldhjk0cqd2rx1qh32wiarkxmcqcm5xl8z7l4kjm6l";
+    sha256 = "18q6mrq4agvlpvhix2k13qcyvqqzh30vj7b329dva64035rzg68n";
   };
 
   makeFlags = [ "prefix=$(out)" ];
diff --git a/nixpkgs/pkgs/development/libraries/science/math/or-tools/build.patch b/nixpkgs/pkgs/development/libraries/science/math/or-tools/build.patch
new file mode 100644
index 000000000000..a67e137ff4af
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/or-tools/build.patch
@@ -0,0 +1,5 @@
+--- a/makefiles/Makefile.python.mk
++++ b/makefiles/Makefile.python.mk
+@@ -1070 +1070 @@ $(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools/data: $(PYDATA_LIBS) | $(PYPI_ARCHIVE_T
+-$(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools/util: $(PYUTIL_LIBS) | $(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools
++$(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools/util: $(PYSORTED_INTERVAL_LIST_LIBS) | $(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools
diff --git a/nixpkgs/pkgs/development/libraries/science/math/or-tools/default.nix b/nixpkgs/pkgs/development/libraries/science/math/or-tools/default.nix
index c6e065320a26..15aea5803bf1 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/or-tools/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/or-tools/default.nix
@@ -5,15 +5,20 @@
 
 stdenv.mkDerivation rec {
   pname = "or-tools";
-  version = "v7.0";
+  version = "7.3";
 
   src = fetchFromGitHub {
     owner = "google";
     repo = "or-tools";
-    rev = version;
-    sha256 = "09rs2j3w4ljw9qhhnsjlvfii297njjszwvkbgj1i6kns3wnlr7cp";
+    rev = "v${version}";
+    sha256 = "0q06vxmds6nm3dpjw4y5jzr8j98qgfb9i8pbm9pfhmqigv791hwc";
   };
 
+  patches = [
+    ./build.patch # https://github.com/google/or-tools/pull/1619
+    ./protobuf.patch # Otherwise it tries to install protobuf from pypi.
+  ];
+
   # The original build system uses cmake which does things like pull
   # in dependencies through git and Makefile creation time. We
   # obviously don't want to do this so instead we provide the
@@ -64,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/nixpkgs/pkgs/development/libraries/science/math/or-tools/protobuf.patch b/nixpkgs/pkgs/development/libraries/science/math/or-tools/protobuf.patch
new file mode 100644
index 000000000000..b0cce40434c6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/or-tools/protobuf.patch
@@ -0,0 +1,10 @@
+--- a/makefiles/Makefile.third_party.unix.mk
++++ b/makefiles/Makefile.third_party.unix.mk
+@@ -24,1 +24,1 @@ GLOG_TAG = 0.4.0
+-PROTOBUF_TAG = 3.9.0
++PROTOBUF_TAG = 3.7.0
+--- a/makefiles/Makefile.third_party.win.mk
++++ b/makefiles/Makefile.third_party.win.mk
+@@ -40 +40 @@ GLOG_TAG = 0.4.0
+-PROTOBUF_TAG = 3.9.0
++PROTOBUF_TAG = 3.7.0
diff --git a/nixpkgs/pkgs/development/libraries/science/math/osi/default.nix b/nixpkgs/pkgs/development/libraries/science/math/osi/default.nix
index 1cc80e78a100..6dc7e746fd35 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/osi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/osi/default.nix
@@ -22,10 +22,10 @@ stdenv.mkDerivation rec {
     ++ lib.optionals withCplex [ "--with-cplex-incdir=${cplex}/cplex/include/ilcplex" "--with-cplex-lib=-lcplex${cplex.libSuffix}" ];
 
   NIX_LDFLAGS =
-    lib.optional withCplex "-L${cplex}/cplex/bin/${cplex.libArch}";
+    lib.optionalString withCplex "-L${cplex}/cplex/bin/${cplex.libArch}";
 
-  # Compile errors 
-  NIX_CFLAGS_COMPILE = [ "-Wno-cast-qual" ];
+  # Compile errors
+  NIX_CFLAGS_COMPILE = "-Wno-cast-qual";
   hardeningDisable = [ "format" ];
 
   enableParallelBuilding = true;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix b/nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix
index faa219044bd3..46709ff218a0 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "primesieve";
-  version = "7.4";
+  version = "7.5";
 
   nativeBuildInputs = [cmake];
 
   src = fetchurl {
     url = "https://github.com/kimwalisch/primesieve/archive/v${version}.tar.gz";
-    sha256 = "16930d021ai8cl3gsnn2v6l30n6mklwwqd53z51cddd3dj69x6zz";
+    sha256 = "0g60br3p8di92jx3pr2bb51xh15gg57l7qvwzwn7xf7l585hgi7v";
   };
 
   meta = with stdenv.lib; {
diff --git a/nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix b/nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix
index 14277c8c6318..bff0d9a85fa2 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/science/math/scalapack/openmpi4.patch b/nixpkgs/pkgs/development/libraries/science/math/scalapack/openmpi4.patch
deleted file mode 100644
index 5d0afb58c027..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/science/math/tensorflow/bin.nix b/nixpkgs/pkgs/development/libraries/science/math/tensorflow/bin.nix
index 3db7a6f1d1e2..f9f300883a16 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/tensorflow/bin.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/tensorflow/bin.nix
@@ -1,6 +1,6 @@
 { stdenv
 , fetchurl
-, patchelf
+, addOpenGLRunpath
 , cudaSupport ? false, symlinkJoin, cudatoolkit, cudnn, nvidia_x11
 }:
 
@@ -35,6 +35,9 @@ let
     else ''
       patchelf --set-rpath "${rpath}:$out/lib" $out/lib/libtensorflow.so
       patchelf --set-rpath "${rpath}" $out/lib/libtensorflow_framework.so
+      ${optionalString cudaSupport ''
+        addOpenGLRunpath $out/lib/libtensorflow.so $out/lib/libtensorflow_framework.so
+      ''}
     '';
 
 in stdenv.mkDerivation rec {
@@ -43,6 +46,8 @@ in stdenv.mkDerivation rec {
 
   src = fetchurl url;
 
+  nativeBuildInputs = optional cudaSupport addOpenGLRunpath;
+
   # Patch library to use our libc, libstdc++ and others
   buildCommand = ''
     mkdir -pv $out
diff --git a/nixpkgs/pkgs/development/libraries/sentencepiece/default.nix b/nixpkgs/pkgs/development/libraries/sentencepiece/default.nix
new file mode 100644
index 000000000000..556f77ef8b51
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/serd/default.nix b/nixpkgs/pkgs/development/libraries/serd/default.nix
index 63b6ae94a385..c390603c51da 100644
--- a/nixpkgs/pkgs/development/libraries/serd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/serd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, python, wafHook }:
+{ stdenv, fetchurl, pkgconfig, python3, wafHook }:
 
 stdenv.mkDerivation rec {
   pname = "serd";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "1yyfyvc6kwagi5w43ljp1bbjdvdpmgpds74lmjxycm91bkx0xyvf";
   };
 
-  nativeBuildInputs = [ pkgconfig python wafHook ];
+  nativeBuildInputs = [ pkgconfig python3 wafHook ];
 
   meta = with stdenv.lib; {
     homepage = http://drobilla.net/software/serd;
diff --git a/nixpkgs/pkgs/development/libraries/serialdv/default.nix b/nixpkgs/pkgs/development/libraries/serialdv/default.nix
index 11f9d3013471..178cee5e69ac 100644
--- a/nixpkgs/pkgs/development/libraries/serialdv/default.nix
+++ b/nixpkgs/pkgs/development/libraries/serialdv/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "serialdv";
-  version ="1.1.1";
+  version ="1.1.4";
 
   src = fetchFromGitHub {
     owner = "f4exb";
     repo = "serialdv";
     rev = "v${version}";
-    sha256 = "0swalyp8cbs7if6gxbcl7wf83ml8ch3k7ww4hws89rzpjvf070fr";
+    sha256 = "0d88h2wjhf79nisiv96bq522hkbknzm88wsv0q9k33mzmrwnrx93";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/development/libraries/shhmsg/default.nix b/nixpkgs/pkgs/development/libraries/shhmsg/default.nix
index 5f14a7bb5ee5..596ea1cfaf88 100644
--- a/nixpkgs/pkgs/development/libraries/shhmsg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/shhmsg/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0ax02fzqpaxr7d30l5xbndy1s5vgg1ag643c7zwiw2wj1czrxil8";
   };
 
-  installFlags = "INSTBASEDIR=$(out)";
+  installFlags = [ "INSTBASEDIR=$(out)" ];
 
   meta = with stdenv.lib; {
     description = "A library for displaying messages";
diff --git a/nixpkgs/pkgs/development/libraries/shhopt/default.nix b/nixpkgs/pkgs/development/libraries/shhopt/default.nix
index dbac4c859619..985ee59348b1 100644
--- a/nixpkgs/pkgs/development/libraries/shhopt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/shhopt/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0yd6bl6qw675sxa81nxw6plhpjf9d2ywlm8a5z66zyjf28sl7sds";
   };
 
-  installFlags = "INSTBASEDIR=$(out)";
+  installFlags = [ "INSTBASEDIR=$(out)" ];
 
   meta = with stdenv.lib; {
     description = "A library for parsing command line options";
diff --git a/nixpkgs/pkgs/development/libraries/silgraphite/graphite2.nix b/nixpkgs/pkgs/development/libraries/silgraphite/graphite2.nix
index 14af55c2afc1..6b1c4ca97ba6 100644
--- a/nixpkgs/pkgs/development/libraries/silgraphite/graphite2.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/simgear/default.nix b/nixpkgs/pkgs/development/libraries/simgear/default.nix
index 471bcb222347..bdd8dd9d9998 100644
--- a/nixpkgs/pkgs/development/libraries/simgear/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/simpleitk/default.nix b/nixpkgs/pkgs/development/libraries/simpleitk/default.nix
index 1cf40c92db66..cbb6a4b64f17 100644
--- a/nixpkgs/pkgs/development/libraries/simpleitk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/simpleitk/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "simpleitk";
-  version = "1.2.2";
+  version = "1.2.4";
 
   src = fetchFromGitHub {
     owner = "SimpleITK";
     repo = "SimpleITK";
     rev = "v${version}";
-    sha256 = "1cgq9cxxplv6bkm2zfvcc0lgyh5zw1hbry30k1429n9737wnadaw";
+    sha256 = "0dvf2407z9n6lczm0l5vzcvpw6r6z1wzrs2gk3dqjrgynq6952qr";
   };
 
   nativeBuildInputs = [ cmake git swig ];
diff --git a/nixpkgs/pkgs/development/libraries/skalibs/default.nix b/nixpkgs/pkgs/development/libraries/skalibs/default.nix
index c885f00a33c5..e5443c5d53a0 100644
--- a/nixpkgs/pkgs/development/libraries/skalibs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/skalibs/default.nix
@@ -4,8 +4,8 @@ with skawarePackages;
 
 buildPackage {
   pname = "skalibs";
-  version = "2.8.1.0";
-  sha256 = "1fk6n402ywn4kpy6ng7sfnnqcg0mp6wq2hrv8sv3kxd0nh3na723";
+  version = "2.9.1.0";
+  sha256 = "19c6s3f7vxi96l2yqzjk9x9i4xkfg4fdzxhn1jg6bfb2qjph9cnk";
 
   description = "A set of general-purpose C programming libraries";
 
@@ -18,6 +18,9 @@ buildPackage {
     "--dynlibdir=\${lib}/lib"
     "--includedir=\${dev}/include"
     "--sysdepdir=\${lib}/lib/skalibs/sysdeps"
+    # Empty the default path, which would be "/usr/bin:bin".
+    # It would be set when PATH is empty. This hurts hermeticity.
+    "--with-default-path="
   ];
 
   postInstall = ''
diff --git a/nixpkgs/pkgs/development/libraries/slang/default.nix b/nixpkgs/pkgs/development/libraries/slang/default.nix
index f868f6bd4947..d1cafbce1174 100644
--- a/nixpkgs/pkgs/development/libraries/slang/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/smarty3/default.nix b/nixpkgs/pkgs/development/libraries/smarty3/default.nix
index 4876c39ce83c..b3214cc01dfc 100644
--- a/nixpkgs/pkgs/development/libraries/smarty3/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/smpeg/default.nix b/nixpkgs/pkgs/development/libraries/smpeg/default.nix
index e28667883020..4d74ee7ca063 100644
--- a/nixpkgs/pkgs/development/libraries/smpeg/default.nix
+++ b/nixpkgs/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 ];
 
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
       --prefix PKG_CONFIG_PATH ":" "${SDL.dev}/lib/pkgconfig"
   '';
 
-  NIX_LDFLAGS = [ "-lX11" ];
+  NIX_LDFLAGS = "-lX11";
 
   meta = {
     homepage = http://icculus.org/smpeg/;
diff --git a/nixpkgs/pkgs/development/libraries/snappy/default.nix b/nixpkgs/pkgs/development/libraries/snappy/default.nix
index 80c3630af29e..0ad1a4b28987 100644
--- a/nixpkgs/pkgs/development/libraries/snappy/default.nix
+++ b/nixpkgs/pkgs/development/libraries/snappy/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ stdenv, fetchFromGitHub, cmake, static ? false }:
 
 stdenv.mkDerivation rec {
   pname = "snappy";
@@ -17,7 +17,10 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DCMAKE_SKIP_BUILD_RPATH=OFF" ];
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
+    "-DCMAKE_SKIP_BUILD_RPATH=OFF"
+  ];
 
   postInstall = ''
     substituteInPlace "$out"/lib/cmake/Snappy/SnappyTargets.cmake \
@@ -29,9 +32,9 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   meta = with stdenv.lib; {
-    homepage = https://google.github.io/snappy/;
+    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/nixpkgs/pkgs/development/libraries/sonic/default.nix b/nixpkgs/pkgs/development/libraries/sonic/default.nix
index 4a744c08ae33..3e93302f3d7d 100644
--- a/nixpkgs/pkgs/development/libraries/sonic/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/sord/default.nix b/nixpkgs/pkgs/development/libraries/sord/default.nix
index c1c22cb910d7..2113d7bd49b4 100644
--- a/nixpkgs/pkgs/development/libraries/sord/default.nix
+++ b/nixpkgs/pkgs/development/libraries/sord/default.nix
@@ -1,16 +1,16 @@
-{ stdenv, fetchurl, pkgconfig, python, serd, pcre, wafHook }:
+{ stdenv, fetchurl, pkgconfig, python3, serd, pcre, wafHook }:
 
 stdenv.mkDerivation rec {
   pname = "sord";
-  version = "0.16.2";
+  version = "0.16.4";
 
   src = fetchurl {
     url = "https://download.drobilla.net/${pname}-${version}.tar.bz2";
-    sha256 = "13fshxwpipjrvsah1m2jw1kf022z2q5vpw24bzcznglgvms13x89";
+    sha256 = "1mwh4qvp9q4vgrgg5bz9sgjhxscncrylf2b06h0q55ddwzs9hndi";
   };
 
-  nativeBuildInputs = [ pkgconfig wafHook ];
-  buildInputs = [ python serd pcre ];
+  nativeBuildInputs = [ pkgconfig python3 wafHook ];
+  buildInputs = [ serd pcre ];
 
   meta = with stdenv.lib; {
     homepage = http://drobilla.net/software/sord;
diff --git a/nixpkgs/pkgs/development/libraries/soxt/default.nix b/nixpkgs/pkgs/development/libraries/soxt/default.nix
index 11ba48c59716..4afb310d49ac 100644
--- a/nixpkgs/pkgs/development/libraries/soxt/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/spandsp/default.nix b/nixpkgs/pkgs/development/libraries/spandsp/default.nix
index c2dc20cc3927..95827ba364ab 100644
--- a/nixpkgs/pkgs/development/libraries/spandsp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/spandsp/default.nix
@@ -6,9 +6,12 @@ stdenv.mkDerivation rec {
     url = "https://www.soft-switch.org/downloads/spandsp/spandsp-${version}.tar.gz";
     sha256 = "0rclrkyspzk575v8fslzjpgp4y2s4x7xk3r55ycvpi4agv33l1fc";
   };
-  buildInputs = [];
+
+  outputs = [ "out" "dev" ];
+
   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];
@@ -18,4 +21,3 @@ stdenv.mkDerivation rec {
     updateWalker = true;
   };
 }
-
diff --git a/nixpkgs/pkgs/development/libraries/spatialite-tools/default.nix b/nixpkgs/pkgs/development/libraries/spatialite-tools/default.nix
index 2708e49eb2b6..83eef355f2db 100644
--- a/nixpkgs/pkgs/development/libraries/spatialite-tools/default.nix
+++ b/nixpkgs/pkgs/development/libraries/spatialite-tools/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  NIX_LDFLAGS = [ "-lsqlite3" ];
+  NIX_LDFLAGS = "-lsqlite3";
 
   meta = {
     description = "A complete sqlite3-compatible CLI front-end for libspatialite";
diff --git a/nixpkgs/pkgs/development/libraries/spdk/default.nix b/nixpkgs/pkgs/development/libraries/spdk/default.nix
index a18edc0a6dff..51583fdbbcd6 100644
--- a/nixpkgs/pkgs/development/libraries/spdk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/spdk/default.nix
@@ -1,19 +1,21 @@
-{ stdenv, fetchFromGitHub, python, cunit, dpdk, libaio, libuuid, numactl, openssl }:
+{ stdenv, fetchFromGitHub, python, cunit, dpdk, libaio, libbsd, libuuid, numactl, openssl }:
 
 stdenv.mkDerivation rec {
   pname = "spdk";
-  version = "19.04";
+  version = "19.10";
 
   src = fetchFromGitHub {
     owner = "spdk";
     repo = "spdk";
     rev = "v${version}";
-    sha256 = "10mzal1hspnh26ws5d7sc54gyjfzkf6amr0gkd7b368ng2a9z8s6";
+    sha256 = "16v2vswn3rnnj7ak5w5rsak6r8f9b85gyhyll4ac1k4xpyj488hj";
   };
 
+  patches = [ ./spdk-dpdk-meson.patch ];
+
   nativeBuildInputs = [ python ];
 
-  buildInputs = [ cunit dpdk libaio libuuid numactl openssl ];
+  buildInputs = [ cunit dpdk libaio libbsd libuuid numactl openssl ];
 
   postPatch = ''
     patchShebangs .
@@ -21,7 +23,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--with-dpdk=${dpdk}" ];
 
-  NIX_CFLAGS_COMPILE = [ "-mssse3" ]; # Necessary to compile.
+  NIX_CFLAGS_COMPILE = "-mssse3"; # Necessary to compile.
 
   enableParallelBuilding = true;
 
diff --git a/nixpkgs/pkgs/development/libraries/spdk/spdk-dpdk-meson.patch b/nixpkgs/pkgs/development/libraries/spdk/spdk-dpdk-meson.patch
new file mode 100644
index 000000000000..9cc6d89ce50e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/spdk/spdk-dpdk-meson.patch
@@ -0,0 +1,17 @@
+1. dpdk built with meson generates rte_build_config.h rather than rte_config.h.
+2. dpdk configured with libbsd requires that dependents link with libbsd.
+
+--- a/lib/env_dpdk/env.mk
++++ b/lib/env_dpdk/env.mk
+@@ -140,6 +140,9 @@ endif
+ 
+-ifneq (,$(wildcard $(DPDK_INC_DIR)/rte_config.h))
+-ifneq (,$(shell grep -e "define RTE_LIBRTE_VHOST_NUMA 1" -e "define RTE_EAL_NUMA_AWARE_HUGEPAGES 1" $(DPDK_INC_DIR)/rte_config.h))
++ifneq (,$(wildcard $(DPDK_INC_DIR)/rte_build_config.h))
++ifneq (,$(shell grep -e "define RTE_LIBRTE_VHOST_NUMA 1" -e "define RTE_EAL_NUMA_AWARE_HUGEPAGES 1" $(DPDK_INC_DIR)/rte_build_config.h))
+ ENV_LINKER_ARGS += -lnuma
+ endif
++ifneq (,$(shell grep -e "define RTE_USE_LIBBSD 1" $(DPDK_INC_DIR)/rte_build_config.h))
++ENV_LINKER_ARGS += -lbsd
++endif
+ endif
diff --git a/nixpkgs/pkgs/development/libraries/spdlog/default.nix b/nixpkgs/pkgs/development/libraries/spdlog/default.nix
index c746925150bb..1839bb7bff16 100644
--- a/nixpkgs/pkgs/development/libraries/spdlog/default.nix
+++ b/nixpkgs/pkgs/development/libraries/spdlog/default.nix
@@ -3,7 +3,7 @@
 let
   generic = { version, sha256 }:
     stdenv.mkDerivation {
-      name = "spdlog-${version}";
+      pname = "spdlog";
       inherit version;
 
       src = fetchFromGitHub {
@@ -15,7 +15,7 @@ let
 
       nativeBuildInputs = [ cmake ];
 
-      cmakeFlags = [ "-DSPDLOG_BUILD_EXAMPLES=OFF" "-DSPDLOG_BUILD_BENCH=OFF" ];
+      cmakeFlags = [ "-DSPDLOG_BUILD_EXAMPLE=OFF" "-DSPDLOG_BUILD_BENCH=OFF" ];
 
       outputs = [ "out" "doc" ];
 
@@ -25,8 +25,8 @@ let
       '';
 
       meta = with stdenv.lib; {
-        description    = "Very fast, header only, C++ logging library.";
-        homepage       = https://github.com/gabime/spdlog;
+        description    = "Very fast, header only, C++ logging library";
+        homepage       = "https://github.com/gabime/spdlog";
         license        = licenses.mit;
         maintainers    = with maintainers; [ obadz ];
         platforms      = platforms.all;
@@ -35,8 +35,8 @@ let
 in
 {
   spdlog_1 = generic {
-    version = "1.3.1";
-    sha256 = "1rd4zmrlkcdjx0m0wpmjm1g9srj7jak6ai08qkhbn2lsn0niifzd";
+    version = "1.4.2";
+    sha256 = "1qc3rphvik44136ms0gjq2wmkl6qglri4fqxlhr2l5jwm8zhr8fc";
   };
 
   spdlog_0 = generic {
diff --git a/nixpkgs/pkgs/development/libraries/sphinxbase/default.nix b/nixpkgs/pkgs/development/libraries/sphinxbase/default.nix
index 57c3ae40fd97..3e4d64c47ada 100644
--- a/nixpkgs/pkgs/development/libraries/sphinxbase/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/spirv-headers/default.nix b/nixpkgs/pkgs/development/libraries/spirv-headers/default.nix
index 9b2c0032d4e9..86a7ab048fab 100644
--- a/nixpkgs/pkgs/development/libraries/spirv-headers/default.nix
+++ b/nixpkgs/pkgs/development/libraries/spirv-headers/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "spirv-headers";
-  version = "1.4.1";
+  version = "1.5.1";
 
   src = fetchFromGitHub {
     owner = "KhronosGroup";
     repo = "SPIRV-Headers";
     rev = version;
-    sha256 = "1zfmvg3x0q9w652s8g5m5rcckzm6jiiw8rif2qck4vlsryl55akp";
+    sha256 = "1fnd8qwss6pxcch5j9qi1pdz70828zxsg4m8apgrhyj0p9lm0rbg";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/development/libraries/sqlcipher/default.nix b/nixpkgs/pkgs/development/libraries/sqlcipher/default.nix
index 9365ee006d14..d187187246b2 100644
--- a/nixpkgs/pkgs/development/libraries/sqlcipher/default.nix
+++ b/nixpkgs/pkgs/development/libraries/sqlcipher/default.nix
@@ -4,13 +4,13 @@ assert readline != null -> ncurses != null;
 
 stdenv.mkDerivation rec {
   pname = "sqlcipher";
-  version = "4.2.0";
+  version = "4.3.0";
 
   src = fetchFromGitHub {
     owner = "sqlcipher";
     repo = "sqlcipher";
     rev = "v${version}";
-    sha256 = "1wpymql2ps4k2qkfa5mdifihb1n815xlz7imcd8ri1gn2qla8q8i";
+    sha256 = "0s1aiwl61nl3b4ym4v050wlbbx0iypknqsj3ar12dw5hljlzx6f8";
   };
 
   buildInputs = [ readline ncurses openssl tcl ];
diff --git a/nixpkgs/pkgs/development/libraries/sqlite/analyzer.nix b/nixpkgs/pkgs/development/libraries/sqlite/analyzer.nix
index 3c5761b767ec..6de71d066ade 100644
--- a/nixpkgs/pkgs/development/libraries/sqlite/analyzer.nix
+++ b/nixpkgs/pkgs/development/libraries/sqlite/analyzer.nix
@@ -6,11 +6,11 @@ in
 
 stdenv.mkDerivation rec {
   pname = "sqlite-analyzer";
-  version = "3.28.0";
+  version = "3.30.0";
 
   src = assert version == sqlite.version; fetchurl {
     url = "https://sqlite.org/2019/sqlite-src-${archiveVersion version}.zip";
-    sha256 = "15v57b113bpgcshfsx5jw93szar3da94rr03i053xhl15la7jllh";
+    sha256 = "0d4i87q0f618pmrgax0mr5x7m8bywikrwjvixag3biyhgl5rx7fd";
   };
 
   nativeBuildInputs = [ unzip ];
diff --git a/nixpkgs/pkgs/development/libraries/sqlite/archive-version.nix b/nixpkgs/pkgs/development/libraries/sqlite/archive-version.nix
index 1f312ecef23a..75d70680fbf9 100644
--- a/nixpkgs/pkgs/development/libraries/sqlite/archive-version.nix
+++ b/nixpkgs/pkgs/development/libraries/sqlite/archive-version.nix
@@ -1,9 +1,9 @@
 lib: version:
 
 with lib;
-  
+
 let
-  fragments = splitString "." version;
+  fragments = splitVersion version;
   major = head fragments;
   minor = concatMapStrings (fixedWidthNumber 2) (tail fragments);
 in
diff --git a/nixpkgs/pkgs/development/libraries/sqlite/default.nix b/nixpkgs/pkgs/development/libraries/sqlite/default.nix
index 9ba5da0c910c..d904637fcd38 100644
--- a/nixpkgs/pkgs/development/libraries/sqlite/default.nix
+++ b/nixpkgs/pkgs/development/libraries/sqlite/default.nix
@@ -10,12 +10,12 @@ in
 
 stdenv.mkDerivation rec {
   pname = "sqlite";
-  version = "3.28.0";
+  version = "3.30.1";
 
   # NB! Make sure to update analyzer.nix src (in the same directory).
   src = fetchurl {
     url = "https://sqlite.org/2019/sqlite-autoconf-${archiveVersion version}.tar.gz";
-    sha256 = "1hxpi45crbqp6lacl7z611lna02k956m9bsy2bjzrbb2y23546yn";
+    sha256 = "0q4f57a5995wz9c7dfiqy9zwl0kn0b900nxwinqa3llv13dm0nlc";
   };
 
   outputs = [ "bin" "dev" "out" ];
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--enable-threadsafe" ] ++ optional interactive "--enable-readline";
 
-  NIX_CFLAGS_COMPILE = [
+  NIX_CFLAGS_COMPILE = toString [
     "-DSQLITE_ENABLE_COLUMN_METADATA"
     "-DSQLITE_ENABLE_DBSTAT_VTAB"
     "-DSQLITE_ENABLE_JSON1"
diff --git a/nixpkgs/pkgs/development/libraries/srt/default.nix b/nixpkgs/pkgs/development/libraries/srt/default.nix
index 5edb2d92b551..953ba9484fad 100644
--- a/nixpkgs/pkgs/development/libraries/srt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/srt/default.nix
@@ -4,13 +4,13 @@
 with stdenv.lib;
 stdenv.mkDerivation rec {
   pname = "srt";
-  version = "1.3.3";
+  version = "1.4.1";
 
   src = fetchFromGitHub {
     owner = "Haivision";
     repo = "srt";
     rev = "v${version}";
-    sha256 = "1dwz7qrkdrbmsbh66rbdx36b60r8whkz0wvf47jfckzsj37d2w22";
+    sha256 = "01xaq44j95kbgqfl41pnybvqy0yq6wd4wdw88ckylzf0nzp977xz";
   };
 
   nativeBuildInputs = [ cmake ];
@@ -18,6 +18,10 @@ stdenv.mkDerivation rec {
   buildInputs = [ openssl ];
 
   cmakeFlags = [
+    # the cmake package does not handle absolute CMAKE_INSTALL_INCLUDEDIR correctly
+    # (setting it to an absolute path causes include files to go to $out/$out/include,
+    #  because the absolute path is interpreted with root at $out).
+    "-DCMAKE_INSTALL_INCLUDEDIR=include"
     # TODO Remove this when https://github.com/Haivision/srt/issues/538 is fixed and available to nixpkgs
     # Workaround for the fact that srt incorrectly disables GNUInstallDirs when LIBDIR is specified,
     # see https://github.com/NixOS/nixpkgs/pull/54463#discussion_r249878330
diff --git a/nixpkgs/pkgs/development/libraries/srtp/default.nix b/nixpkgs/pkgs/development/libraries/srtp/default.nix
index 3940faf1d6d1..129d57904d1e 100644
--- a/nixpkgs/pkgs/development/libraries/srtp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/srtp/default.nix
@@ -14,6 +14,8 @@ stdenv.mkDerivation rec {
     sha256 = "1ac7xs1djb03j131f1gmqyfmrplblid9qqyxahs0shdy707r5ll6";
   };
 
+  outputs = [ "out" "dev" ];
+
   nativeBuildInputs = [ pkgconfig ];
 
   # libsrtp.pc references -lcrypto -lpcap without -L
diff --git a/nixpkgs/pkgs/development/libraries/sundials/default.nix b/nixpkgs/pkgs/development/libraries/sundials/default.nix
index 4bc066df32e2..d19ecf34ab95 100644
--- a/nixpkgs/pkgs/development/libraries/sundials/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/sundials/tests-parallel.patch b/nixpkgs/pkgs/development/libraries/sundials/tests-parallel.patch
deleted file mode 100644
index a785a1dade9b..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/symengine/default.nix b/nixpkgs/pkgs/development/libraries/symengine/default.nix
index 47b93ab373a6..a41b086016b7 100644
--- a/nixpkgs/pkgs/development/libraries/symengine/default.nix
+++ b/nixpkgs/pkgs/development/libraries/symengine/default.nix
@@ -9,13 +9,13 @@
 
 stdenv.mkDerivation rec {
   pname = "symengine";
-  version = "0.4.1";
+  version = "0.5.0";
 
   src = fetchFromGitHub {
     owner = "symengine";
     repo = "symengine";
     rev = "v${version}";
-    sha256 = "0qqxr7l5lr81k6fs2h5isr43x0dw07rwg3ivl6vd8zmmcgsp9ygd";
+    sha256 = "1zgfhqv43qcfkfdyf1p82bcfv05n6iix6yw6qx1y5bnb7dv74irw";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/development/libraries/t1lib/default.nix b/nixpkgs/pkgs/development/libraries/t1lib/default.nix
index b8e7518cd332..010838efab5d 100644
--- a/nixpkgs/pkgs/development/libraries/t1lib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/t1lib/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
   inherit patches;
 
   buildInputs = [ libX11 libXaw ];
-  buildFlags = "without_doc";
+  buildFlags = [ "without_doc" ];
 
   postInstall = stdenv.lib.optional (!stdenv.isDarwin) "chmod +x $out/lib/*.so.*"; # ??
 
diff --git a/nixpkgs/pkgs/development/libraries/tachyon/default.nix b/nixpkgs/pkgs/development/libraries/tachyon/default.nix
index 5e0f37bbb526..d1d4ee806b80 100644
--- a/nixpkgs/pkgs/development/libraries/tachyon/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tachyon/default.nix
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
          if stdenv.hostPlatform.system == "x86_64-freebsd" then "bsd"           else
          if stdenv.hostPlatform.system == "x686-freebsd"   then "bsd"           else
          throw "Don't know what arch to select for tachyon build";
-  makeFlags = arch;
+  makeFlags = [ arch ];
   patches = [
     # Remove absolute paths in Make-config (and unset variables so they can be set in preBuild)
     ./no-absolute-paths.patch
diff --git a/nixpkgs/pkgs/development/libraries/taglib/1.9.nix b/nixpkgs/pkgs/development/libraries/taglib/1.9.nix
deleted file mode 100644
index 401c2562167f..000000000000
--- a/nixpkgs/pkgs/development/libraries/taglib/1.9.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-{stdenv, fetchurl, zlib, cmake}:
-
-stdenv.mkDerivation {
-  name = "taglib-1.9.1";
-
-  src = fetchurl {
-    url = https://taglib.github.io/releases/taglib-1.9.1.tar.gz;
-    sha256 = "06n7gnbcqa3r6c9gv00y0y1r48dyyazm6yj403i7ma0r2k6p3lvj";
-  };
-
-  nativeBuildInputs = [ cmake ];
-
-  buildInputs = [ zlib ];
-
-  meta = {
-    homepage = https://taglib.org/;
-    repositories.git = git://github.com/taglib/taglib.git;
-    description = "A library for reading and editing the meta-data of several popular audio formats";
-    inherit (cmake.meta) platforms;
-    license = with stdenv.lib.licenses; [ lgpl21 mpl11 ];
-  };
-}
diff --git a/nixpkgs/pkgs/development/libraries/taglib/default.nix b/nixpkgs/pkgs/development/libraries/taglib/default.nix
index 6dcfa3068c11..c553405878f2 100644
--- a/nixpkgs/pkgs/development/libraries/taglib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/taglib/default.nix
@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
   cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
 
   meta = with stdenv.lib; {
-    homepage = "http://taglib.org/";
+    homepage = "https://taglib.org/";
     repositories.git = "git://github.com/taglib/taglib.git";
     description = "A library for reading and editing audio file metadata.";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/tbb/default.nix b/nixpkgs/pkgs/development/libraries/tbb/default.nix
index 6fe4e45521ed..18f9e541acd4 100644
--- a/nixpkgs/pkgs/development/libraries/tbb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tbb/default.nix
@@ -2,19 +2,17 @@
 
 with stdenv.lib; stdenv.mkDerivation rec {
   pname = "tbb";
-  version = "2019_U8";
+  version = "2019_U9";
 
   src = fetchFromGitHub {
     owner = "01org";
     repo = "tbb";
     rev = version;
-    sha256 = "0z0kh1a5g28gckcxlv3x7qqskh5fsl8knf2ypbbvk7z9ln9k3wfq";
+    sha256 = "1a39nflw7b2n51jfp3fdprnkpgzaspzww1dckfvaigflfli9s8rj";
   };
 
-  makeFlags = concatStringsSep " " (
-    optional (compiler != null) "compiler=${compiler}" ++
-    optional (stdver != null) "stdver=${stdver}"
-  );
+  makeFlags = optional (compiler != null) "compiler=${compiler}"
+    ++ optional (stdver != null) "stdver=${stdver}";
 
   patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ./glibc-struct-mallinfo.patch;
 
diff --git a/nixpkgs/pkgs/development/libraries/tcllib/default.nix b/nixpkgs/pkgs/development/libraries/tcllib/default.nix
index 40e137204e26..b1add708902f 100644
--- a/nixpkgs/pkgs/development/libraries/tcllib/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/tdb/default.nix b/nixpkgs/pkgs/development/libraries/tdb/default.nix
index 4df80140aa5d..9e90e3d3be43 100644
--- a/nixpkgs/pkgs/development/libraries/tdb/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/tdlib/default.nix b/nixpkgs/pkgs/development/libraries/tdlib/default.nix
index 716f3d313b42..96ae5c1ec9ad 100644
--- a/nixpkgs/pkgs/development/libraries/tdlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tdlib/default.nix
@@ -1,14 +1,14 @@
 { fetchFromGitHub, gperf, openssl, readline, zlib, cmake, stdenv }:
 
 stdenv.mkDerivation rec {
-  version = "1.4.0";
+  version = "1.5.0";
   pname = "tdlib";
 
   src = fetchFromGitHub {
     owner = "tdlib";
     repo = "td";
     rev = "v${version}";
-    sha256 = "1ijyn14rjb87rqm39hg7md8ab33yiy8cgzw3p0m37scn58gabpp7";
+    sha256 = "1rqxdvzlryqln5jzj35cwz1fjwy4s8xq97p0wdnpzbfjpcalvrm5";
   };
 
   buildInputs = [ gperf openssl readline zlib ];
diff --git a/nixpkgs/pkgs/development/libraries/template-glib/default.nix b/nixpkgs/pkgs/development/libraries/template-glib/default.nix
index 4314abd2548a..070953d0bbcf 100644
--- a/nixpkgs/pkgs/development/libraries/template-glib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/template-glib/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, meson, ninja, pkgconfig, glib, gobject-introspection, flex, bison, vala, gettext, gnome3, gtk-doc, docbook_xsl, docbook_xml_dtd_43 }:
 let
-  version = "3.32.0";
+  version = "3.34.0";
   pname = "template-glib";
 in
 stdenv.mkDerivation {
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1g0zx0sxpw8kqp7p3sgl9kngaqrg9xl6cir24nrahks0vgsk98rr";
+    sha256 = "1z9xkin5fyfh071ma9y045jcw83hgx33dfbjraw6cxk0qdmfysr1";
   };
 
   buildInputs = [ meson ninja pkgconfig gettext flex bison vala glib gtk-doc docbook_xsl docbook_xml_dtd_43 ];
diff --git a/nixpkgs/pkgs/development/libraries/tepl/default.nix b/nixpkgs/pkgs/development/libraries/tepl/default.nix
index 0ca382baeca3..997b874ac5b8 100644
--- a/nixpkgs/pkgs/development/libraries/tepl/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/thrift/default.nix b/nixpkgs/pkgs/development/libraries/thrift/default.nix
index 0fce957df229..b1b66ed052fb 100644
--- a/nixpkgs/pkgs/development/libraries/thrift/default.nix
+++ b/nixpkgs/pkgs/development/libraries/thrift/default.nix
@@ -1,37 +1,45 @@
-{ stdenv, fetchurl, boost, zlib, libevent, openssl, python, pkgconfig, bison
-, flex, twisted
-}:
+{ stdenv, fetchurl, boost, zlib, libevent, openssl, python, cmake, pkgconfig
+, bison, flex, twisted, static ? false }:
 
 stdenv.mkDerivation rec {
   pname = "thrift";
-  version = "0.12.0";
+  version = "0.13.0";
 
   src = fetchurl {
     url = "https://archive.apache.org/dist/thrift/${version}/${pname}-${version}.tar.gz";
-    sha256 = "0a04v7dgm1qzgii7v0sisnljhxc9xpq2vxkka60scrdp6aahjdn3";
+    sha256 = "0yai9c3bdsrkkjshgim7zk0i7malwfprg00l9774dbrkh2w4ilvs";
   };
 
-  #enableParallelBuilding = true; problems on hydra
-
   # Workaround to make the python wrapper not drop this package:
   # pythonFull.buildEnv.override { extraLibs = [ thrift ]; }
   pythonPath = [];
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [
-    boost zlib libevent openssl python bison flex twisted
-  ];
+  nativeBuildInputs = [ cmake pkgconfig ];
+  buildInputs = [ boost zlib libevent openssl python bison flex ]
+    ++ stdenv.lib.optional (!static) twisted;
 
   preConfigure = "export PY_PREFIX=$out";
 
-  # TODO: package boost-test, so we can run the test suite. (Currently it fails
-  # to find libboost_unit_test_framework.a.)
-  configureFlags = [ "--enable-tests=no" ];
-  doCheck = false;
+  cmakeFlags = [
+    # FIXME: Fails to link in static mode with undefined reference to
+    # `boost::unit_test::unit_test_main(bool (*)(), int, char**)'
+    "-DBUILD_TESTING:BOOL=${if static then "OFF" else "ON"}"
+  ] ++ stdenv.lib.optionals static [
+    "-DWITH_STATIC_LIB:BOOL=ON"
+    "-DOPENSSL_USE_STATIC_LIBS=ON"
+  ];
+
+  doCheck = !static;
+  checkPhase = ''
+    runHook preCheck
+    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib ctest -E PythonTestSSLSocket
+    runHook postCheck
+  '';
+  enableParallelChecking = false;
 
   meta = with stdenv.lib; {
     description = "Library for scalable cross-language services";
-    homepage = http://thrift.apache.org/;
+    homepage = "http://thrift.apache.org/";
     license = licenses.asl20;
     platforms = platforms.linux ++ platforms.darwin;
     maintainers = [ maintainers.bjornfor ];
diff --git a/nixpkgs/pkgs/development/libraries/tiledb/default.nix b/nixpkgs/pkgs/development/libraries/tiledb/default.nix
new file mode 100644
index 000000000000..395dd6952f69
--- /dev/null
+++ b/nixpkgs/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.2";
+
+  src = fetchFromGitHub {
+    owner = "TileDB-Inc";
+    repo = "TileDB";
+    rev = version;
+    sha256 = "00ykfc7p6n0nc97lvjnqjar95xyv8b2b77cjqczy03wh5i4gmifj";
+  };
+
+  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/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2.nix b/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2.nix
index cc7c996f7c3a..0cc4038b64e7 100644
--- a/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2.nix
+++ b/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2.nix
@@ -28,7 +28,7 @@ in stdenv.mkDerivation {
   hardeningDisable = [ "format" ];
 
   NIX_CFLAGS_COMPILE =
-    stdenv.lib.optional stdenv.isDarwin "-mmacosx-version-min=10.9";
+    stdenv.lib.optionalString stdenv.isDarwin "-mmacosx-version-min=10.9";
 
   buildInputs = [ unzip ];
   buildPhase = ''
diff --git a/nixpkgs/pkgs/development/libraries/tntdb/default.nix b/nixpkgs/pkgs/development/libraries/tntdb/default.nix
index 13b4e6b97a9a..2d6ae3f18cad 100644
--- a/nixpkgs/pkgs/development/libraries/tntdb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tntdb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cxxtools, postgresql, mysql, sqlite, zlib, openssl }:
+{ stdenv, fetchurl, cxxtools, postgresql, libmysqlclient, sqlite, zlib, openssl }:
 
 stdenv.mkDerivation rec {
   pname = "tntdb";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "0js79dbvkic30bzw1pf26m64vs2ssw2sbj55w1dc0sy69dlv4fh9";
   };
 
-  buildInputs = [ cxxtools postgresql mysql.connector-c sqlite zlib openssl ];
+  buildInputs = [ cxxtools postgresql libmysqlclient sqlite zlib openssl ];
 
   enableParallelBuilding = true;
 
diff --git a/nixpkgs/pkgs/development/libraries/torch/default.nix b/nixpkgs/pkgs/development/libraries/torch/default.nix
index ff8c26062d3c..b5cb0f76e9ff 100644
--- a/nixpkgs/pkgs/development/libraries/torch/default.nix
+++ b/nixpkgs/pkgs/development/libraries/torch/default.nix
@@ -33,5 +33,6 @@ stdenv.mkDerivation rec{
     license = stdenv.lib.licenses.bsd3 ;
     maintainers = [stdenv.lib.maintainers.raskin];
     platforms = stdenv.lib.platforms.linux;
+    broken = true;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/tpm2-tss/default.nix b/nixpkgs/pkgs/development/libraries/tpm2-tss/default.nix
index cb1052356786..6195c80e24bf 100644
--- a/nixpkgs/pkgs/development/libraries/tpm2-tss/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tpm2-tss/default.nix
@@ -1,16 +1,25 @@
-{ stdenv, lib, fetchurl
+{ stdenv, lib, fetchurl, fetchpatch
 , cmocka, doxygen, ibm-sw-tpm2, iproute, openssl, perl, pkgconfig, procps
-, uthash, which }:
+, uthash, which
+}:
 
 stdenv.mkDerivation rec {
   pname = "tpm2-tss";
-  version = "2.2.3";
+  version = "2.3.2";
 
   src = fetchurl {
     url = "https://github.com/tpm2-software/${pname}/releases/download/${version}/${pname}-${version}.tar.gz";
-    sha256 = "1hwrka0g817a4d1177vv0z13gp66bxzxhflfxswjhcdk93kaws8k";
+    sha256 = "19jg09sxy3aj4dc1yv32jjv0m62cnmhjlw02jbh4d4pk2439m4l2";
   };
 
+  patches = [
+    # Fix test failure. see https://github.com/tpm2-software/tpm2-tss/pull/1585
+    (fetchpatch {
+      url = "https://patch-diff.githubusercontent.com/raw/tpm2-software/tpm2-tss/pull/1585.patch";
+      sha256 = "0ak3l588ahzv3yx1gfa4sa6p74lsffxzkr23ppznm34wvlcci86n";
+    })
+  ];
+
   nativeBuildInputs = [
     doxygen perl pkgconfig
     # For unit tests and integration tests.
diff --git a/nixpkgs/pkgs/development/libraries/tracker-miners/default.nix b/nixpkgs/pkgs/development/libraries/tracker-miners/default.nix
index 9f31e70ad531..3f171f47e79c 100644
--- a/nixpkgs/pkgs/development/libraries/tracker-miners/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tracker-miners/default.nix
@@ -45,11 +45,11 @@
 
 stdenv.mkDerivation rec {
   pname = "tracker-miners";
-  version = "2.2.2";
+  version = "2.3.1";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0kk5xaajamb8jlm6cfdbc2m3axzr6bnph84m7697xmb0pkg8hdiw";
+    sha256 = "1q4hlpl3nkr0y13rzkwryyajnpy5s661z8n82dw1rskrg9mf07bv";
   };
 
   nativeBuildInputs = [
diff --git a/nixpkgs/pkgs/development/libraries/tracker-miners/fix-paths.patch b/nixpkgs/pkgs/development/libraries/tracker-miners/fix-paths.patch
index 724c51cb56f8..ce44416055c4 100644
--- a/nixpkgs/pkgs/development/libraries/tracker-miners/fix-paths.patch
+++ b/nixpkgs/pkgs/development/libraries/tracker-miners/fix-paths.patch
@@ -9,12 +9,3 @@
  		                         DEFAULT_RULE, NULL);
  
  		if (!g_file_test (path, G_FILE_TEST_IS_REGULAR)) {
-@@ -388,7 +388,7 @@
- 	if (!priv->ontology_location) {
- 		gchar *ontology_path;
- 
--		ontology_path = g_build_filename (SHAREDIR, "tracker", "ontologies",
-+		ontology_path = g_build_filename ("@tracker@", "share", "tracker", "ontologies",
- 		                                  priv->ontology_name, NULL);
- 
- 		if (!g_file_test (ontology_path, G_FILE_TEST_IS_DIR)) {
diff --git a/nixpkgs/pkgs/development/libraries/tracker/default.nix b/nixpkgs/pkgs/development/libraries/tracker/default.nix
index db4f620a740f..79b0b2e92031 100644
--- a/nixpkgs/pkgs/development/libraries/tracker/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tracker/default.nix
@@ -1,37 +1,33 @@
-{ stdenv, fetchurl, intltool, meson, ninja, pkgconfig, gobject-introspection, python3
+{ stdenv, fetchurl, gettext, meson, ninja, pkgconfig, gobject-introspection, python3
 , gtk-doc, docbook_xsl, docbook_xml_dtd_412, docbook_xml_dtd_43, glibcLocales
 , libxml2, upower, glib, wrapGAppsHook, vala, sqlite, libxslt, libstemmer
-, gnome3, icu, libuuid, networkmanager, libsoup, json-glib
-, substituteAll}:
+, gnome3, icu, libuuid, networkmanager, libsoup, json-glib, systemd, dbus
+, substituteAll }:
 
-let
+stdenv.mkDerivation rec {
   pname = "tracker";
-  version = "2.2.2";
-in stdenv.mkDerivation rec {
-  name = "${pname}-${version}";
+  version = "2.3.1";
 
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
-    sha256 = "1rp2c6k7ajcm553p9kpni87zgi9aplm3s01rl7pk575az5i399y6";
+    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1888vyz2l5n46ywb70fryd0qipyh3x5n6q0mk56jzbb5whk8fx5n";
   };
 
   nativeBuildInputs = [
-    meson ninja vala pkgconfig intltool libxslt wrapGAppsHook gobject-introspection
+    meson ninja vala pkgconfig gettext libxslt wrapGAppsHook gobject-introspection
     gtk-doc docbook_xsl docbook_xml_dtd_412 docbook_xml_dtd_43 glibcLocales
     python3 # for data-generators
+    systemd # used for checks to install systemd user service
+    dbus # used for checks and pkgconfig to install dbus service/s
   ];
 
   buildInputs = [
     glib libxml2 sqlite upower icu networkmanager libsoup libuuid json-glib libstemmer
   ];
 
-  LC_ALL = "en_US.UTF-8";
-
   mesonFlags = [
-    "-Ddbus_services=${placeholder "out"}/share/dbus-1/services"
-    "-Dsystemd_user_services=${placeholder "out"}/lib/systemd/user"
     # TODO: figure out wrapping unit tests, some of them fail on missing gsettings-desktop-schemas
     "-Dfunctional_tests=false"
     "-Ddocs=true"
diff --git a/nixpkgs/pkgs/development/libraries/tre/default.nix b/nixpkgs/pkgs/development/libraries/tre/default.nix
index 901b6aa097fd..d5ed35694c58 100644
--- a/nixpkgs/pkgs/development/libraries/tre/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/tremor/default.nix b/nixpkgs/pkgs/development/libraries/tremor/default.nix
index 291336076892..91b6d2cb1674 100644
--- a/nixpkgs/pkgs/development/libraries/tremor/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tremor/default.nix
@@ -9,6 +9,8 @@ stdenv.mkDerivation {
     sha256 = "0m07gq4zfgigsiz8b518xyb19v7qqp76qmp7lb262825vkqzl3zq";
   };
 
+  outputs = [ "out" "dev" ];
+
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
   propagatedBuildInputs = [ libogg ];
 
diff --git a/nixpkgs/pkgs/development/libraries/trompeloeil/default.nix b/nixpkgs/pkgs/development/libraries/trompeloeil/default.nix
index af2fc6c879a7..0ab115daeefb 100644
--- a/nixpkgs/pkgs/development/libraries/trompeloeil/default.nix
+++ b/nixpkgs/pkgs/development/libraries/trompeloeil/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "trompeloeil";
-  version = "34";
+  version = "35";
 
   src = fetchFromGitHub {
     owner = "rollbear";
     repo = "trompeloeil";
     rev = "v${version}";
-    sha256 = "0mj3zni18kfm04jrqjaa1p6ii5q0dz6qdm3hi57z9lzygaxbdc97";
+    sha256 = "07jxvssasgmi2dk4wl6qzspx88g9cnz597flsapdzp0qd5j7xixd";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/development/libraries/umockdev/default.nix b/nixpkgs/pkgs/development/libraries/umockdev/default.nix
index e257088c41fb..1c0b70f6896a 100644
--- a/nixpkgs/pkgs/development/libraries/umockdev/default.nix
+++ b/nixpkgs/pkgs/development/libraries/umockdev/default.nix
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
   meta = with stdenv.lib; {
     description = "Mock hardware devices for creating unit tests";
     license = licenses.lgpl2;
-    maintainers = with maintainers; [ ndowens ];
+    maintainers = with maintainers; [];
     platforms = with platforms; linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/unibilium/default.nix b/nixpkgs/pkgs/development/libraries/unibilium/default.nix
index 73ca55cffd08..dca24c7f9ea5 100644
--- a/nixpkgs/pkgs/development/libraries/unibilium/default.nix
+++ b/nixpkgs/pkgs/development/libraries/unibilium/default.nix
@@ -1,15 +1,15 @@
 { stdenv, lib, fetchFromGitHub, libtool, pkgconfig, perl, ncurses }:
 
 stdenv.mkDerivation rec {
-  pname = "unibilium";
+  pname = "unibilium-unstable";
 
-  version = "2.0.0";
+  version = "20190811";
 
   src = fetchFromGitHub {
-    owner = "mauke";
+    owner = "neovim";
     repo = "unibilium";
-    rev = "v${version}";
-    sha256 = "1wa9a32wzqnxqh1jh554afj13dzjr6mw2wzqzw8d08nza9pg2ra2";
+    rev = "92d929fabaf94ea4feb48149bbc3bbea77c4fab0";
+    sha256 = "1l8p3fpdymba62x1f5d990v72z3m5f5g2yf505g0rlf2ysc5r1di";
   };
 
   makeFlags = [ "PREFIX=$(out)" ]
diff --git a/nixpkgs/pkgs/development/libraries/unicorn-emu/default.nix b/nixpkgs/pkgs/development/libraries/unicorn-emu/default.nix
index 96f318ff0ef5..7917b6954064 100644
--- a/nixpkgs/pkgs/development/libraries/unicorn-emu/default.nix
+++ b/nixpkgs/pkgs/development/libraries/unicorn-emu/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   };
 
   configurePhase = '' patchShebangs make.sh '';
-  buildPhase = '' ./make.sh '';
+  buildPhase = '' ./make.sh '' + stdenv.lib.optionalString stdenv.isDarwin "macos-universal-no";
   installPhase = '' env PREFIX=$out ./make.sh install '';
 
   nativeBuildInputs = [ pkgconfig python ];
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     description = "Lightweight multi-platform CPU emulator library";
     homepage    = "http://www.unicorn-engine.org";
     license     = stdenv.lib.licenses.bsd3;
-    platforms   = stdenv.lib.platforms.linux;
+    platforms   = stdenv.lib.platforms.unix;
     maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/unixODBCDrivers/default.nix b/nixpkgs/pkgs/development/libraries/unixODBCDrivers/default.nix
index b9aa1696d487..6cfaef5ef993 100644
--- a/nixpkgs/pkgs/development/libraries/unixODBCDrivers/default.nix
+++ b/nixpkgs/pkgs/development/libraries/unixODBCDrivers/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, unixODBC, cmake, postgresql, mysql, mariadb, sqlite, zlib, libxml2, dpkg, lib, kerberos, curl, libuuid, autoPatchelfHook }:
+{ 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,30 +29,42 @@
 
   mariadb = stdenv.mkDerivation rec {
     pname = "mariadb-connector-odbc";
-    version = "2.0.10";
-
-    src = fetchurl {
-      url = "https://downloads.mariadb.org/interstitial/connector-odbc-${version}/src/${pname}-${version}-ga-src.tar.gz";
-      sha256 = "0b6ximy0dg0xhqbrm1l7pn8hjapgpmddi67kh54h6i9cq9hqfdvz";
+    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 mariadb.connector-c ];
+    buildInputs = [ unixODBC openssl libiconv ];
+
+    preConfigure = ''
+      # we don't want to build a .pkg
+      sed -i 's/ADD_SUBDIRECTORY(osxinstall)//g' CMakeLists.txt
+    '';
 
     cmakeFlags = [
-      "-DMARIADB_INCLUDE_DIR=${mariadb.connector-c}/include/mariadb"
+      "-DWITH_OPENSSL=ON"
+      # 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;
     };
   };
 
@@ -88,16 +100,16 @@
   sqlite = stdenv.mkDerivation rec {
     pname = "sqlite-connector-odbc";
     version = "0.9993";
- 
+
     src = fetchurl {
       url = "http://www.ch-werner.de/sqliteodbc/sqliteodbc-${version}.tar.gz";
       sha256 = "0dgsj28sc7f7aprmdd0n5a1rmcx6pv7170c8dfjl0x1qsjxim6hs";
     };
- 
+
     buildInputs = [ unixODBC sqlite zlib libxml2 ];
- 
+
     configureFlags = [ "--with-odbc=${unixODBC}" ];
- 
+
     installTargets = [ "install-3" ];
 
     # move libraries to $out/lib where they're expected to be
@@ -105,7 +117,7 @@
       mkdir -p "$out/lib"
       mv "$out"/*.* "$out/lib"
     '';
- 
+
     passthru = {
       fancyName = "SQLite";
       driver = "lib/libsqlite3odbc.so";
@@ -133,8 +145,7 @@
       sha256 = "0jb16irr7qlgd2zshg0vyia7zqipd0pcvwfcr6z807pss1mnzj8w";
     };
 
-    nativeBuildInputs = [ autoPatchelfHook ];
-    buildInputs = [ unixODBC dpkg kerberos libuuid stdenv.cc.cc ];
+    nativeBuildInputs = [ dpkg patchelf ];
 
     unpackPhase = "dpkg -x $src ./";
     buildPhase = "";
@@ -145,6 +156,11 @@
       cp -r opt/microsoft/msodbcsql${versionMajor}/lib64 opt/microsoft/msodbcsql${versionMajor}/share $out/
     '';
 
+    postFixup = ''
+      patchelf --set-rpath ${lib.makeLibraryPath [ unixODBC openssl.out kerberos libuuid stdenv.cc.cc ]} \
+        $out/lib/libmsodbcsql-${versionMajor}.${versionMinor}.so.${versionAdditional}
+    '';
+
     passthru = {
       fancyName = "ODBC Driver 17 for SQL Server";
       driver = "lib/libmsodbcsql-${versionMajor}.${versionMinor}.so.${versionAdditional}";
diff --git a/nixpkgs/pkgs/development/libraries/uri/default.nix b/nixpkgs/pkgs/development/libraries/uri/default.nix
index 61246748ac73..5e5f4c9e8ca6 100644
--- a/nixpkgs/pkgs/development/libraries/uri/default.nix
+++ b/nixpkgs/pkgs/development/libraries/uri/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "148361pixrm94q6v04k13s1msa04bx9yc3djb0lxpa7dlw19vhcd";
   };
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=parentheses" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error=parentheses";
 
   nativeBuildInputs = [ cmake doxygen ];
 
diff --git a/nixpkgs/pkgs/development/libraries/usbredir/default.nix b/nixpkgs/pkgs/development/libraries/usbredir/default.nix
index 2eee80a76969..8e43135196c9 100644
--- a/nixpkgs/pkgs/development/libraries/usbredir/default.nix
+++ b/nixpkgs/pkgs/development/libraries/usbredir/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "002yik1x7kn0427xahvnhjby2np14a6xqw7c3dx530n9h5d9rg47";
   };
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error";
 
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ libusb ];
diff --git a/nixpkgs/pkgs/development/libraries/utmps/default.nix b/nixpkgs/pkgs/development/libraries/utmps/default.nix
index 16d4a8fa40b5..073674f8571f 100644
--- a/nixpkgs/pkgs/development/libraries/utmps/default.nix
+++ b/nixpkgs/pkgs/development/libraries/utmps/default.nix
@@ -4,8 +4,8 @@ with skawarePackages;
 
 buildPackage {
   pname = "utmps";
-  version = "0.0.2.1";
-  sha256 = "1q90mcn50irhhrzl3h9bvhsn7hac0zgg67b6hfhmc5yvh4c8wnr4";
+  version = "0.0.3.1";
+  sha256 = "1h4hgjdrai51qkalgcx2ff60drpnw0ich66z90p8wk74am0vgc0h";
 
   description = "A secure utmpx and wtmp implementation";
 
diff --git a/nixpkgs/pkgs/development/libraries/v8/3.14.nix b/nixpkgs/pkgs/development/libraries/v8/3.14.nix
index 3d36245631be..febadc2d6ac8 100644
--- a/nixpkgs/pkgs/development/libraries/v8/3.14.nix
+++ b/nixpkgs/pkgs/development/libraries/v8/3.14.nix
@@ -80,7 +80,7 @@ stdenv.mkDerivation {
 
   meta = with stdenv.lib; {
     description = "Google's open source JavaScript engine";
-    platforms = platforms.linux;
+    platforms = [ "x86_64-linux" "i686-linux" ];
     license = licenses.bsd3;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/v8/3.16.14.nix b/nixpkgs/pkgs/development/libraries/v8/3.16.14.nix
deleted file mode 100644
index e134c9ea60f5..000000000000
--- a/nixpkgs/pkgs/development/libraries/v8/3.16.14.nix
+++ /dev/null
@@ -1,81 +0,0 @@
-{ stdenv, lib, fetchurl, gyp, readline, python, which, icu, utillinux, cctools }:
-
-assert readline != null;
-
-let
-  arch = if stdenv.isAarch32
-    then (if stdenv.is64bit then "arm64" else "arm")
-    else (if stdenv.is64bit then "x64" else "ia32");
-  armHardFloat = stdenv.isAarch32 && (stdenv.hostPlatform.platform.gcc.float or null) == "hard";
-in
-
-stdenv.mkDerivation rec {
-  pname = "v8";
-  version = "3.16.14.11";
-
-  src = fetchurl {
-    url = "https://commondatastorage.googleapis.com/chromium-browser-official/"
-        + "${pname}-${version}.tar.bz2";
-    sha256 = "1gpf2xvhxfs5ll3m2jlslsx9jfjbmrbz55iq362plflrvf8mbxhj";
-  };
-
-  postPatch = ''
-    sed -i 's/-Werror//' build/standalone.gypi build/common.gypi
-  '';
-
-  configurePhase = stdenv.lib.optionalString stdenv.isDarwin ''
-    export GYP_DEFINES="mac_deployment_target=$MACOSX_DEPLOYMENT_TARGET"
-  '' + ''
-    PYTHONPATH="tools/generate_shim_headers:$PYTHONPATH" \
-      ${gyp}/bin/gyp \
-        -f make \
-        --generator-output="out" \
-        -Dflock_index=0 \
-        -Dv8_enable_i18n_support=1 \
-        -Duse_system_icu=1 \
-        -Dconsole=readline \
-        -Dcomponent=shared_library \
-        -Dv8_target_arch=${arch} \
-        ${lib.optionalString armHardFloat "-Dv8_use_arm_eabi_hardfloat=true"} \
-        --depth=. -Ibuild/standalone.gypi \
-        build/all.gyp
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
-    sed -i 's@/usr/bin/env python@${python}/bin/python@g' out/gyp-mac-tool
-  '';
-
-  nativeBuildInputs = [ which ];
-  buildInputs = [ readline python icu ]
-                  ++ lib.optional stdenv.isLinux utillinux
-                  ++ lib.optional stdenv.isDarwin cctools;
-
-  NIX_CFLAGS_COMPILE = "-Wno-error -w";
-
-  buildFlags = [
-    "-C out"
-    "builddir=$(CURDIR)/Release"
-    "BUILDTYPE=Release"
-  ];
-
-  enableParallelBuilding = true;
-
-  installPhase = ''
-    install -vD out/Release/d8 "$out/bin/d8"
-    ${if stdenv.isDarwin then ''
-    install -vD out/Release/libv8.dylib "$out/lib/libv8.dylib"
-    '' else ''
-    install -vD out/Release/lib.target/libv8.so "$out/lib/libv8.so"
-    ''}
-    cp -vr include "$out/"
-  '';
-
-  postFixup = if stdenv.isDarwin then ''
-    install_name_tool -change /usr/local/lib/libv8.dylib $out/lib/libv8.dylib $out/bin/d8
-    install_name_tool -id $out/lib/libv8.dylib $out/lib/libv8.dylib
-  '' else null;
-
-  meta = with stdenv.lib; {
-    description = "V8 is Google's open source JavaScript engine";
-    platforms = platforms.linux ++ platforms.darwin;
-    license = licenses.bsd3;
-  };
-}
diff --git a/nixpkgs/pkgs/development/libraries/v8/default.nix b/nixpkgs/pkgs/development/libraries/v8/default.nix
index fa2a0f4f5946..a02e540173d8 100644
--- a/nixpkgs/pkgs/development/libraries/v8/default.nix
+++ b/nixpkgs/pkgs/development/libraries/v8/default.nix
@@ -97,6 +97,10 @@ stdenv.mkDerivation rec {
     ''v8_snapshot_toolchain="//build/toolchain/linux/unbundle:default"''
   ] ++ stdenv.lib.optional stdenv.cc.isClang ''clang_base_path="${stdenv.cc}"'';
 
+  # with gcc8, -Wclass-memaccess became part of -Wall and causes logging limit
+  # to be exceeded
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-class-memaccess";
+
   nativeBuildInputs = [ gn ninja pkgconfig python ]
     ++ stdenv.lib.optionals stdenv.isDarwin [ xcbuild darwin.DarwinTools ];
   buildInputs = [ glib icu ];
diff --git a/nixpkgs/pkgs/development/libraries/vaapi-intel/default.nix b/nixpkgs/pkgs/development/libraries/vaapi-intel/default.nix
index 722079ff3478..1775d5fffc59 100644
--- a/nixpkgs/pkgs/development/libraries/vaapi-intel/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/vaapi-vdpau/default.nix b/nixpkgs/pkgs/development/libraries/vaapi-vdpau/default.nix
index e3fd7ad57e02..94f96b867d55 100644
--- a/nixpkgs/pkgs/development/libraries/vaapi-vdpau/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/vapoursynth/default.nix b/nixpkgs/pkgs/development/libraries/vapoursynth/default.nix
index 0d96829b6baf..0cdbe396a109 100644
--- a/nixpkgs/pkgs/development/libraries/vapoursynth/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vapoursynth/default.nix
@@ -12,13 +12,13 @@ with stdenv.lib;
 
 stdenv.mkDerivation rec {
   pname = "vapoursynth";
-  version = "R47.2";
+  version = "R48";
 
   src = fetchFromGitHub {
     owner  = "vapoursynth";
     repo   = "vapoursynth";
     rev    = version;
-    sha256 = "004h0vvih7dlhkcz6l2786pf7s04qhiv0bii4gjx23cxyklglh9i";
+    sha256 = "1i6163bidlp0p9zcnxpsphr44ayfzd51fig4ri7vbrbl9lw9jaih";
   };
 
   nativeBuildInputs = [ pkgconfig autoreconfHook nasm makeWrapper ];
diff --git a/nixpkgs/pkgs/development/libraries/vapoursynth/editor.nix b/nixpkgs/pkgs/development/libraries/vapoursynth/editor.nix
index 3853718c1541..196c700af17a 100644
--- a/nixpkgs/pkgs/development/libraries/vapoursynth/editor.nix
+++ b/nixpkgs/pkgs/development/libraries/vapoursynth/editor.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchFromBitbucket, makeWrapper
+{ stdenv, mkDerivation, fetchFromBitbucket
 , python3, vapoursynth
 , qmake, qtbase, qtwebsockets
 }:
 
-stdenv.mkDerivation rec {
+mkDerivation rec {
   pname = "vapoursynth-editor";
   version = "R19";
 
@@ -14,18 +14,20 @@ stdenv.mkDerivation rec {
     sha256 = "1zlaynkkvizf128ln50yvzz3b764f5a0yryp6993s9fkwa7djb6n";
   };
 
-  nativeBuildInputs = [ qmake makeWrapper ];
+  nativeBuildInputs = [ qmake ];
   buildInputs = [ qtbase vapoursynth qtwebsockets ];
 
+  dontWrapQtApps = true;
+
   preConfigure = "cd pro";
 
-  installPhase = ''
+  preFixup = ''
     cd ../build/release*
     mkdir -p $out/bin
     for bin in vsedit{,-job-server{,-watcher}}; do
         mv $bin $out/bin
 
-        wrapProgram $out/bin/$bin \
+        wrapQtApp $out/bin/$bin \
             --prefix PYTHONPATH : ${vapoursynth}/${python3.sitePackages} \
             --prefix LD_LIBRARY_PATH : ${vapoursynth}/lib
     done
diff --git a/nixpkgs/pkgs/development/libraries/vrpn/default.nix b/nixpkgs/pkgs/development/libraries/vrpn/default.nix
index 0ae5ba147cb7..688dc8d451ee 100644
--- a/nixpkgs/pkgs/development/libraries/vrpn/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/vte/default.nix b/nixpkgs/pkgs/development/libraries/vte/default.nix
index 35bc881d3d1c..8b19e1ee9ae0 100644
--- a/nixpkgs/pkgs/development/libraries/vte/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vte/default.nix
@@ -1,36 +1,80 @@
-{ stdenv, fetchurl, intltool, pkgconfig
-, gnome3, glib, gtk3, ncurses, gobject-introspection, vala, libxml2, gnutls
-, gperf, pcre2
+{ stdenv
+, lib
+, fetchurl
+, fetchpatch
+, gettext
+, pkgconfig
+, meson
+, ninja
+, gnome3
+, glib
+, gtk3
+, gobject-introspection
+, vala
+, libxml2
+, gnutls
+, gperf
+, pango
+, pcre2
+, fribidi
+, zlib
 }:
 
 stdenv.mkDerivation rec {
   pname = "vte";
-  version = "0.56.3";
+  version = "0.58.2";
+
+  outputs = [ "out" "dev" ];
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0j166gic5znssdb9r45qazq4kb4v9fial82czand5wa8i2yd988p";
+    sha256 = "1h1bljr090cgnzim00q4pnsmjqblzn1sig3d87wv1hzjn796dj9k";
   };
 
   passthru = {
     updateScript = gnome3.updateScript { packageName = pname; };
   };
 
-  nativeBuildInputs = [ gobject-introspection intltool pkgconfig vala gperf libxml2 ];
-  buildInputs = [ glib gtk3 ncurses ];
+  nativeBuildInputs = [
+    gettext
+    gobject-introspection
+    gperf
+    libxml2
+    meson
+    ninja
+    pkgconfig
+    vala
+  ];
 
-  propagatedBuildInputs = [
-    # Required by vte-2.91.pc.
-    gtk3
+  buildInputs = [
+    fribidi
     gnutls
     pcre2
+    zlib
   ];
 
-  preConfigure = "patchShebangs .";
+  propagatedBuildInputs = [
+    # Required by vte-2.91.pc.
+    gtk3
+    glib
+    pango
+  ];
 
-  configureFlags = [ "--enable-introspection" "--disable-Bsymbolic" ];
+  patches =
+    # VTE needs a small patch to work with musl:
+    # https://gitlab.gnome.org/GNOME/vte/issues/72
+    lib.optional
+      stdenv.hostPlatform.isMusl
+      (fetchpatch {
+            name = "0001-Add-W_EXITCODE-macro-for-non-glibc-systems.patch";
+            url = "https://gitlab.gnome.org/GNOME/vte/uploads/c334f767f5d605e0f30ecaa2a0e4d226/0001-Add-W_EXITCODE-macro-for-non-glibc-systems.patch";
+            sha256 = "1ii9db9i5l3fy2alxz7bjfsgjs3lappnlx339dvxbi2141zknf5r";
+      });
 
-  enableParallelBuilding = true;
+  postPatch = ''
+    patchShebangs perf/*
+    patchShebangs src/box_drawing_generate.sh
+  '';
 
   meta = with stdenv.lib; {
     homepage = https://www.gnome.org/;
@@ -44,8 +88,7 @@ stdenv.mkDerivation rec {
       the system's terminfo database.
     '';
     license = licenses.lgpl2;
-    maintainers = with maintainers; [ astsmtl antono lethalman ];
-    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ astsmtl antono lethalman ] ++ gnome3.maintainers;
+    platforms = platforms.unix;
   };
 }
-
diff --git a/nixpkgs/pkgs/development/libraries/vte/ng.nix b/nixpkgs/pkgs/development/libraries/vte/ng.nix
deleted file mode 100644
index c00be4c008f7..000000000000
--- a/nixpkgs/pkgs/development/libraries/vte/ng.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ vte, fetchFromGitHub, fetchpatch, autoconf, automake, gtk-doc, gettext, libtool, gperf }:
-
-vte.overrideAttrs (oldAttrs: rec {
-  name = "vte-ng-${version}";
-  version = "0.54.2.a";
-
-  src = fetchFromGitHub {
-    owner = "thestinger";
-    repo = "vte-ng";
-    rev = version;
-    sha256 = "1r7d9m07cpdr4f7rw3yx33hmp4jmsk0dn5byq5wgksb2qjbc4ags";
-  };
-
-  patches = [
-    # Fix build with vala 0.44
-    # See: https://github.com/thestinger/vte-ng/issues/32
-    (fetchpatch {
-      url = "https://gitlab.gnome.org/GNOME/vte/commit/53690d5cee51bdb7c3f7680d3c22b316b1086f2c.patch";
-      sha256 = "1jrpqsx5hqa01g7cfqrsns6vz51mwyqwdp43ifcpkhz3wlp5dy66";
-    })
-  ];
-
-  preConfigure = oldAttrs.preConfigure + "; NOCONFIGURE=1 ./autogen.sh";
-
-  nativeBuildInputs = oldAttrs.nativeBuildInputs or []
-    ++ [ gtk-doc autoconf automake gettext libtool gperf ];
-})
diff --git a/nixpkgs/pkgs/development/libraries/vtk/default.nix b/nixpkgs/pkgs/development/libraries/vtk/default.nix
index 3cb8998485a9..482d691fc7c6 100644
--- a/nixpkgs/pkgs/development/libraries/vtk/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/vxl/default.nix b/nixpkgs/pkgs/development/libraries/vxl/default.nix
index 9651e9a5f80c..17d11d4fb749 100644
--- a/nixpkgs/pkgs/development/libraries/vxl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vxl/default.nix
@@ -11,14 +11,17 @@ stdenv.mkDerivation {
 
   buildInputs = [ cmake unzip libtiff expat zlib libpng libjpeg ];
 
-  # BUILD_OUL wants old linux headers for videodev.h, not available
-  # in stdenv linux headers
-  # BUILD_BRL fails to find open()
-  cmakeFlags = "-DBUILD_OUL=OFF -DBUILD_BRL=OFF -DBUILD_CONTRIB=OFF "
-    + (if stdenv.hostPlatform.system == "x86_64-linux" then
-      "-DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_C_FLAGS=-fPIC"
-    else
-      "");
+  cmakeFlags = [
+    # BUILD_OUL wants old linux headers for videodev.h, not available
+    # in stdenv linux headers
+    "-DBUILD_OUL=OFF"
+    # BUILD_BRL fails to find open()
+    "-DBUILD_BRL=OFF"
+    "-DBUILD_CONTRIB=OFF"
+  ] ++ stdenv.lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [
+    "-DCMAKE_CXX_FLAGS=-fPIC"
+    "-DCMAKE_C_FLAGS=-fPIC"
+  ];
 
   enableParallelBuilding = true;
 
diff --git a/nixpkgs/pkgs/development/libraries/wayland/1.9.nix b/nixpkgs/pkgs/development/libraries/wayland/1.9.nix
deleted file mode 100644
index 7572051b1de0..000000000000
--- a/nixpkgs/pkgs/development/libraries/wayland/1.9.nix
+++ /dev/null
@@ -1,33 +0,0 @@
-{ lib, stdenv, fetchurl, pkgconfig
-, libffi, libxml2
-, expat ? null # Build wayland-scanner (currently cannot be disabled as of 1.7.0)
-}:
-
-# Require the optional to be enabled until upstream fixes or removes the configure flag
-assert expat != null;
-
-stdenv.mkDerivation rec {
-  pname = "wayland";
-  version = "1.9.0";
-
-  src = fetchurl {
-    url = "https://wayland.freedesktop.org/releases/${pname}-${version}.tar.xz";
-    sha256 = "1yhy62vkbq8j8c9zaa6yzvn75cd99kfa8n2zfdwl80x019r711ww";
-  };
-
-  configureFlags = [ "--with-scanner" "--disable-documentation" ];
-
-  nativeBuildInputs = [ pkgconfig ];
-
-  buildInputs = [ libffi /* docbook_xsl doxygen graphviz libxslt xmlto */ expat libxml2 ];
-
-  meta = {
-    description = "Reference implementation of the wayland protocol";
-    homepage    = https://wayland.freedesktop.org/;
-    license     = lib.licenses.mit;
-    platforms   = lib.platforms.linux;
-    maintainers = with lib.maintainers; [ codyopel ];
-  };
-
-  passthru.version = version;
-}
diff --git a/nixpkgs/pkgs/development/libraries/webkitgtk/2.4.nix b/nixpkgs/pkgs/development/libraries/webkitgtk/2.4.nix
deleted file mode 100644
index 060109072b49..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/webkitgtk/configure.patch b/nixpkgs/pkgs/development/libraries/webkitgtk/configure.patch
deleted file mode 100644
index 2f4c1e7ad314..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/webkitgtk/default.nix b/nixpkgs/pkgs/development/libraries/webkitgtk/default.nix
index c0fae2f71765..d1e171566eea 100644
--- a/nixpkgs/pkgs/development/libraries/webkitgtk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/webkitgtk/default.nix
@@ -1,11 +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
+{ 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;
@@ -13,71 +58,117 @@ assert enableGtk2Plugins -> gtk2 != null;
 assert stdenv.isDarwin -> !enableGtk2Plugins;
 
 with stdenv.lib;
+
 stdenv.mkDerivation rec {
   pname = "webkitgtk";
-  version = "2.24.4";
+  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 = "1n3x5g1z6rg9n1ssna7wi0z6zlprjm4wzk544v14wqi6q0lv2s46";
+    sha256 = "04k5h0sid9azsqz9pyq436v1rx4lnfrhvmcgmicqb0c0g9iz103b";
   };
 
-  patches = optionals stdenv.isDarwin [
-    ## TODO add necessary patches for Darwin
-  ];
-
-  postPatch = ''
-    patchShebangs .
-  '';
-
-  cmakeFlags = [
-  "-DPORT=GTK"
-  "-DUSE_LIBHYPHEN=0"
-  "-DENABLE_INTROSPECTION=ON"
-  ]
-  ++ 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"
+  patches = optionals stdenv.isLinux [
+    (substituteAll {
+      src = ./fix-bubblewrap-paths.patch;
+      inherit (builtins) storeDir;
+    })
+    ./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 ]
-    ++ optional stdenv.isLinux wayland;
+    ++ 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/nixpkgs/pkgs/development/libraries/webkitgtk/fix-bubblewrap-paths.patch b/nixpkgs/pkgs/development/libraries/webkitgtk/fix-bubblewrap-paths.patch
new file mode 100644
index 000000000000..6485ba0f261f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/webkitgtk/fix-bubblewrap-paths.patch
@@ -0,0 +1,23 @@
+diff -ru old/webkitgtk-2.26.0/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp webkitgtk-2.26.0/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
+--- old/webkitgtk-2.26.0/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp	2019-09-09 04:47:07.000000000 -0400
++++ webkitgtk-2.26.0/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp	2019-09-20 21:14:10.537921173 -0400
+@@ -585,7 +585,7 @@
+         { SCMP_SYS(keyctl), nullptr },
+         { SCMP_SYS(request_key), nullptr },
+ 
+-        // Scary VM/NUMA ops 
++        // Scary VM/NUMA ops
+         { SCMP_SYS(move_pages), nullptr },
+         { SCMP_SYS(mbind), nullptr },
+         { SCMP_SYS(get_mempolicy), nullptr },
+@@ -724,6 +724,10 @@
+         "--ro-bind-try", "/usr/local/lib64", "/usr/local/lib64",
+ 
+         "--ro-bind-try", PKGLIBEXECDIR, PKGLIBEXECDIR,
++
++        // Nix Directories
++        "--ro-bind", "@storeDir@", "@storeDir@",
++        "--ro-bind", "/run/current-system", "/run/current-system",
+     };
+     // We would have to parse ld config files for more info.
+     bindPathVar(sandboxArgs, "LD_LIBRARY_PATH");
diff --git a/nixpkgs/pkgs/development/libraries/webkitgtk/fix-execinfo.patch b/nixpkgs/pkgs/development/libraries/webkitgtk/fix-execinfo.patch
deleted file mode 100644
index eb825312f3be..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/webkitgtk/libc++.patch b/nixpkgs/pkgs/development/libraries/webkitgtk/libc++.patch
deleted file mode 100644
index 5a9df0ddae98..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/webkitgtk/libglvnd-headers.patch b/nixpkgs/pkgs/development/libraries/webkitgtk/libglvnd-headers.patch
new file mode 100644
index 000000000000..17264f3b5886
--- /dev/null
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/webkitgtk/plugin-none.patch b/nixpkgs/pkgs/development/libraries/webkitgtk/plugin-none.patch
deleted file mode 100644
index 5e2b36bf62dd..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/webkitgtk/quartz-webcore.patch b/nixpkgs/pkgs/development/libraries/webkitgtk/quartz-webcore.patch
deleted file mode 100644
index a7bf859d6c62..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/webkitgtk/webcore-svg-libxml-cflags.patch b/nixpkgs/pkgs/development/libraries/webkitgtk/webcore-svg-libxml-cflags.patch
deleted file mode 100644
index 03fc3f3f97de..000000000000
--- a/nixpkgs/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/nixpkgs/pkgs/development/libraries/wiredtiger/default.nix b/nixpkgs/pkgs/development/libraries/wiredtiger/default.nix
index 2ebad693de50..9025abcb3fe9 100644
--- a/nixpkgs/pkgs/development/libraries/wiredtiger/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wiredtiger/default.nix
@@ -26,13 +26,13 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "wiredtiger";
-  version = "3.2.0";
+  version = "3.2.1";
 
   src = fetchFromGitHub {
     repo = "wiredtiger";
     owner = "wiredtiger";
     rev = version;
-    sha256 = "1s27l51p2p3kbdjmccvlg43i7zx84hhchs3779w9giab4nvd0y19";
+    sha256 = "04j2zw8b9jym43r682rh4kpdippxx7iw3ry16nxlbybzar9kgk83";
   };
 
   nativeBuildInputs = [ automake autoconf libtool ];
diff --git a/nixpkgs/pkgs/development/libraries/wlroots/default.nix b/nixpkgs/pkgs/development/libraries/wlroots/default.nix
index 4d820bd95198..a567e66285cc 100644
--- a/nixpkgs/pkgs/development/libraries/wlroots/default.nix
+++ b/nixpkgs/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
@@ -6,15 +6,24 @@
 
 stdenv.mkDerivation rec {
   pname = "wlroots";
-  version = "0.7.0";
+  version = "0.8.1";
 
   src = fetchFromGitHub {
     owner = "swaywm";
     repo = "wlroots";
     rev = version;
-    sha256 = "0jzxa6psbc7ddxli7rbfqxmv1svxnis51l1vch4hb9fdixqm284a";
+    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/nixpkgs/pkgs/development/libraries/wolfssl/default.nix b/nixpkgs/pkgs/development/libraries/wolfssl/default.nix
index 780d7df47cb0..438b40d91404 100644
--- a/nixpkgs/pkgs/development/libraries/wolfssl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wolfssl/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "wolfssl";
-  version = "4.1.0";
+  version = "4.3.0";
 
   src = fetchFromGitHub {
     owner = "wolfSSL";
     repo = "wolfssl";
     rev = "v${version}-stable";
-    sha256 = "16d1dzbdx6x7czbxf6i1rlb5mv59yzzpnha7qgwab3yq62rlsgw3";
+    sha256 = "1gd613k4qh9yhl0d8yh0flqn2cvm9qb5pp2p0khk31b1fh1p4vin";
   };
 
   configureFlags = [ "--enable-all" ];
diff --git a/nixpkgs/pkgs/development/libraries/wt/default.nix b/nixpkgs/pkgs/development/libraries/wt/default.nix
index 319b0effc578..7c819487a334 100644
--- a/nixpkgs/pkgs/development/libraries/wt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wt/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchFromGitHub, cmake, boost, pkgconfig, doxygen, qt48Full, libharu
-, pango, fcgi, firebird, mysql, postgresql, graphicsmagick, glew, openssl
+, pango, fcgi, firebird, libmysqlclient, postgresql, graphicsmagick, glew, openssl
 , pcre, harfbuzz
 }:
 
@@ -22,18 +22,22 @@ let
       nativeBuildInputs = [ pkgconfig ];
       buildInputs = [
         cmake boost doxygen qt48Full libharu
-        pango fcgi firebird mysql.connector-c postgresql graphicsmagick glew
+        pango fcgi firebird libmysqlclient postgresql graphicsmagick glew
         openssl pcre
       ];
 
       cmakeFlags = [
-        "-DWT_WRASTERIMAGE_IMPLEMENTATION=GraphicsMagick"
         "-DWT_CPP_11_MODE=-std=c++11"
+        "--no-warn-unused-cli"
+      ]
+      ++ stdenv.lib.optionals (graphicsmagick != null) [
+        "-DWT_WRASTERIMAGE_IMPLEMENTATION=GraphicsMagick"
         "-DGM_PREFIX=${graphicsmagick}"
-        "-DMYSQL_PREFIX=${mysql.connector-c}"
+      ]
+      ++ stdenv.lib.optional (harfbuzz != null)
         "-DHARFBUZZ_INCLUDE_DIR=${harfbuzz.dev}/include"
-        "--no-warn-unused-cli"
-      ];
+      ++ stdenv.lib.optional (libmysqlclient != null)
+        "-DMYSQL_PREFIX=${libmysqlclient}";
 
       meta = with stdenv.lib; {
         homepage = "https://www.webtoolkit.eu/wt";
@@ -45,12 +49,12 @@ let
     };
 in {
   wt3 = generic {
-    version = "3.4.1";
-    sha256 = "1bsx7hmy6g2x9p3vl5xw9lv1xk891pnvs93a87s15g257gznkjmj";
+    version = "3.5.0";
+    sha256 = "1xcwzldbval5zrf7f3n2gkpscagg51cw2jp6p3q1yh6bi59haida";
   };
 
   wt4 = generic {
-    version = "4.1.1";
-    sha256 = "1f1imx5kbpqlysrqx5h75hf2f8pkq972rz42x0pl6cxbnsyzngid";
+    version = "4.2.0";
+    sha256 = "0zrrdjz0sa8hrmybjp4aap1lcqcqvsicd7dj49zj1m5k8gnfpm4v";
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/wxSVG/default.nix b/nixpkgs/pkgs/development/libraries/wxSVG/default.nix
index bdc8f8c3435c..e2e227a6327a 100644
--- a/nixpkgs/pkgs/development/libraries/wxSVG/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wxSVG/default.nix
@@ -7,11 +7,11 @@ stdenv.mkDerivation rec {
 
   pname = "wxSVG";
   srcName = "wxsvg-${version}";
-  version = "1.5.20";
+  version = "1.5.21";
 
   src = fetchurl {
     url = "mirror://sourceforge/project/wxsvg/wxsvg/${version}/${srcName}.tar.bz2";
-    sha256 = "17j5j61l5mv7x0ncsm1kv3k5mmjqyxfpddjn7j84wdgrj62xldhm";
+    sha256 = "0v368qgqad49saklwcbq76f1xkg126g0ll1jw9x2bdds02kvg1fw";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/nixpkgs/pkgs/development/libraries/wxwidgets/2.8/default.nix b/nixpkgs/pkgs/development/libraries/wxwidgets/2.8/default.nix
index 38ee4376ac2d..73dac47307a9 100644
--- a/nixpkgs/pkgs/development/libraries/wxwidgets/2.8/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wxwidgets/2.8/default.nix
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
     + optionalString withMesa "${libGLU.out}/lib ${libGL.out}/lib ";
 
   # Work around a bug in configure.
-  NIX_CFLAGS_COMPILE = [ "-DHAVE_X11_XLIB_H=1" "-lX11" "-lcairo" "-Wno-narrowing" ];
+  NIX_CFLAGS_COMPILE = "-DHAVE_X11_XLIB_H=1 -lX11 -lcairo -Wno-narrowing";
 
   preConfigure = "
     substituteInPlace configure --replace 'SEARCH_INCLUDE=' 'DUMMY_SEARCH_INCLUDE='
diff --git a/nixpkgs/pkgs/development/libraries/wxwidgets/3.0/default.nix b/nixpkgs/pkgs/development/libraries/wxwidgets/3.0/default.nix
index a12447562b81..3bbfb1392794 100644
--- a/nixpkgs/pkgs/development/libraries/wxwidgets/3.0/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/wxwidgets/3.1/default.nix b/nixpkgs/pkgs/development/libraries/wxwidgets/3.1/default.nix
index 8fe75153de6d..0984472e860b 100644
--- a/nixpkgs/pkgs/development/libraries/wxwidgets/3.1/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/x265/default.nix b/nixpkgs/pkgs/development/libraries/x265/default.nix
index 634847941d00..dbf1a098f1f7 100644
--- a/nixpkgs/pkgs/development/libraries/x265/default.nix
+++ b/nixpkgs/pkgs/development/libraries/x265/default.nix
@@ -17,14 +17,14 @@ in
 
 stdenv.mkDerivation rec {
   pname = "x265";
-  version = "3.1.1";
+  version = "3.2";
 
   src = fetchurl {
     urls = [
       "https://get.videolan.org/x265/x265_${version}.tar.gz"
       "ftp://ftp.videolan.org/pub/videolan/x265/x265_${version}.tar.gz"
     ];
-    sha256 = "1l68lgdbsi4wjz5vad98ggx7mf92rnvzlq34m6w0a08ark3h0yc2";
+    sha256 = "0fqkhfhr22gzavxn60cpnj3agwdf5afivszxf3haj5k1sny7jk9n";
   };
 
   enableParallelBuilding = true;
diff --git a/nixpkgs/pkgs/development/libraries/xapian/default.nix b/nixpkgs/pkgs/development/libraries/xapian/default.nix
index bb14f3437ba5..971ab485221d 100644
--- a/nixpkgs/pkgs/development/libraries/xapian/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xapian/default.nix
@@ -37,5 +37,5 @@ let
     };
   };
 in {
-  xapian_1_4 = generic "1.4.12" "0z5c1y9vp519h2x2igjq39v6j615nppry0wasd0xn4hphgd3d2jg";
+  xapian_1_4 = generic "1.4.14" "0ja95vn0lkf6qkjhg2blkx306i10hg4fr8wlrhalmly93307lnlp";
 }
diff --git a/nixpkgs/pkgs/development/libraries/xapian/skip-flaky-darwin-test.patch b/nixpkgs/pkgs/development/libraries/xapian/skip-flaky-darwin-test.patch
index 72a7c3e721f4..cce96a2762bf 100644
--- a/nixpkgs/pkgs/development/libraries/xapian/skip-flaky-darwin-test.patch
+++ b/nixpkgs/pkgs/development/libraries/xapian/skip-flaky-darwin-test.patch
@@ -1,14 +1,14 @@
 diff -Naur xapian-core.old/tests/api_db.cc xapian-core.new/tests/api_db.cc
 --- xapian-core.old/tests/api_db.cc
 +++ xapian-core.new/tests/api_db.cc
-@@ -998,6 +998,7 @@
+@@ -1020,6 +1020,7 @@
  
  // test for keepalives
  DEFINE_TESTCASE(keepalive1, remote) {
 +    SKIP_TEST("Fails in darwin nix build environment");
-     Xapian::Database db(get_remote_database("apitest_simpledata", 5000));
+     XFAIL_FOR_BACKEND("multi_glass_remoteprog_glass",
+ 		      "Multi remote databases are currently buggy");
  
-     /* Test that keep-alives work */
 diff -Naur xapian-core.old/tests/api_scalability.cc xapian-core.new/tests/api_scalability.cc
 --- xapian-core.old/tests/api_scalability.cc
 +++ xapian-core.new/tests/api_scalability.cc
diff --git a/nixpkgs/pkgs/development/libraries/xdg-dbus-proxy/default.nix b/nixpkgs/pkgs/development/libraries/xdg-dbus-proxy/default.nix
index d1605aac3342..d00b5398a19a 100644
--- a/nixpkgs/pkgs/development/libraries/xdg-dbus-proxy/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xdg-dbus-proxy/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "xdg-dbus-proxy";
-  version = "0.1.1";
+  version = "0.1.2";
 
   src = fetchurl {
     url = "https://github.com/flatpak/xdg-dbus-proxy/releases/download/${version}/${pname}-${version}.tar.xz";
-    sha256 = "1w8yg5j51zsr9d97d4jjp9dvd7iq893p2xk54i6lf3lx01ribdqh";
+    sha256 = "03sj1h0c2l08xa8phw013fnxr4fgav7l2mkjhzf9xk3dykwxcj8p";
   };
 
   nativeBuildInputs = [ pkgconfig libxslt docbook_xsl docbook_xml_dtd_43 ];
diff --git a/nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix b/nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix
index 4be7bd1474cf..d16c5d670e5e 100644
--- a/nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/xine-lib/default.nix b/nixpkgs/pkgs/development/libraries/xine-lib/default.nix
index fd772a1ff9d2..adcb2e74b0bb 100644
--- a/nixpkgs/pkgs/development/libraries/xine-lib/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/xmlsec/default.nix b/nixpkgs/pkgs/development/libraries/xmlsec/default.nix
index 25c5bf458887..a8c751330b7c 100644
--- a/nixpkgs/pkgs/development/libraries/xmlsec/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xmlsec/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
   configureFlags = [ "--enable-soap" ];
 
   # otherwise libxmlsec1-gnutls.so won't find libgcrypt.so, after #909
-  NIX_LDFLAGS = [ "-lgcrypt" ];
+  NIX_LDFLAGS = "-lgcrypt";
 
   postInstall = ''
     moveToOutput "bin/xmlsec1-config" "$dev"
diff --git a/nixpkgs/pkgs/development/libraries/xxHash/default.nix b/nixpkgs/pkgs/development/libraries/xxHash/default.nix
index 51165f47a219..1ea25fb7209d 100644
--- a/nixpkgs/pkgs/development/libraries/xxHash/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xxHash/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "xxHash";
-  version = "0.7.1";
+  version = "0.7.2";
 
   src = fetchFromGitHub {
     owner = "Cyan4973";
     repo = "xxHash";
     rev = "v${version}";
-    sha256 = "0hh1ypwk86m3b0x4433k95f94b48kvl7s79dml0f3g0cv8jdvkgw";
+    sha256 = "1f9gl0cymmi92ihsfan0p4zmyf2hxwx4arjimpbmbp719nbcvdsx";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/nixpkgs/pkgs/development/libraries/yajl/default.nix b/nixpkgs/pkgs/development/libraries/yajl/default.nix
index f9ce555cf27d..947b08e7bc58 100644
--- a/nixpkgs/pkgs/development/libraries/yajl/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/yder/default.nix b/nixpkgs/pkgs/development/libraries/yder/default.nix
index 82d2d20cb3ee..7025fd2eb1cc 100644
--- a/nixpkgs/pkgs/development/libraries/yder/default.nix
+++ b/nixpkgs/pkgs/development/libraries/yder/default.nix
@@ -4,13 +4,13 @@
 assert withSystemd -> systemd != null;
 stdenv.mkDerivation rec {
   pname = "yder";
-  version = "1.4.7";
+  version = "1.4.8";
 
   src = fetchFromGitHub {
     owner = "babelouest";
     repo = pname;
     rev = "v${version}";
-    sha256 = "19ghiwpi972wjqvlgg576nk2nkf1ii5l1kvzb056496xfmlysrwa";
+    sha256 = "0r3rhcsp182cg0vmx8wwibb415mg2qkx8zrfpb0b97nz30h9hbvd";
   };
 
   patches = [
diff --git a/nixpkgs/pkgs/development/libraries/zeitgeist/default.nix b/nixpkgs/pkgs/development/libraries/zeitgeist/default.nix
index 9e3b06453bfa..98c94cfeccaa 100644
--- a/nixpkgs/pkgs/development/libraries/zeitgeist/default.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/libraries/zeroc-ice/default.nix b/nixpkgs/pkgs/development/libraries/zeroc-ice/default.nix
index e4d0c0fde174..3a5b1690f2d0 100644
--- a/nixpkgs/pkgs/development/libraries/zeroc-ice/default.nix
+++ b/nixpkgs/pkgs/development/libraries/zeroc-ice/default.nix
@@ -32,7 +32,7 @@ in stdenv.mkDerivation rec {
   buildInputs = [ zeroc_mcpp bzip2 expat openssl lmdb ]
     ++ lib.optionals stdenv.isDarwin [ darwin.cctools libiconv Security ];
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=class-memaccess" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error=class-memaccess -Wno-error=deprecated-copy";
 
   prePatch = lib.optional stdenv.isDarwin ''
     substituteInPlace Make.rules.Darwin \
diff --git a/nixpkgs/pkgs/development/libraries/zeromq/4.x.nix b/nixpkgs/pkgs/development/libraries/zeromq/4.x.nix
index db5d90e2f021..1a8f07a3ae0e 100644
--- a/nixpkgs/pkgs/development/libraries/zeromq/4.x.nix
+++ b/nixpkgs/pkgs/development/libraries/zeromq/4.x.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # fails all the tests (ctest)
 
-  cmakeFlags = if enableDrafts then [ "-DENABLE_DRAFTS=ON" ] else null;
+  cmakeFlags = stdenv.lib.optional enableDrafts "-DENABLE_DRAFTS=ON";
 
   meta = with stdenv.lib; {
     branch = "4";
diff --git a/nixpkgs/pkgs/development/libraries/zlib/default.nix b/nixpkgs/pkgs/development/libraries/zlib/default.nix
index b0f8ae503ea4..71da686ce48f 100644
--- a/nixpkgs/pkgs/development/libraries/zlib/default.nix
+++ b/nixpkgs/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.
diff --git a/nixpkgs/pkgs/development/libraries/zookeeper_mt/default.nix b/nixpkgs/pkgs/development/libraries/zookeeper_mt/default.nix
index 4f69c1c80790..127ea4f7162b 100644
--- a/nixpkgs/pkgs/development/libraries/zookeeper_mt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/zookeeper_mt/default.nix
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
 
   setSourceRoot = "export sourceRoot=${zookeeper.name}/src/c";
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=format-overflow" ];
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!stdenv.isDarwin) "-Wno-error=format-overflow -Wno-error=stringop-truncation";
 
   buildInputs = [ zookeeper bash ];
 
diff --git a/nixpkgs/pkgs/development/libraries/zziplib/default.nix b/nixpkgs/pkgs/development/libraries/zziplib/default.nix
index 8b199d3e89a2..74bfeb09c0d3 100644
--- a/nixpkgs/pkgs/development/libraries/zziplib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/zziplib/default.nix
@@ -15,6 +15,22 @@ stdenv.mkDerivation rec {
       url = "https://github.com/gdraheim/zziplib/commit/f609ae8971f3c0ce6.diff";
       sha256 = "0jhiz4fgr93wzh6q03avn95b2nsf6402jaki6hxirxyhs5v9ahry";
     })
+
+    (fetchpatch {
+      name = "CVE-2018-16548-part1.patch";
+      url = "https://github.com/gdraheim/zziplib/commit/9411bde3e4a70a81ff3ffd256b71927b2d90dcbb.patch";
+      sha256 = "0cy8i182zbvcqzs5z2j13d5sl7hbh59pkgw4xkyg5yz739q4fp9b";
+    })
+    (fetchpatch {
+      name = "CVE-2018-16548-part2.patch";
+      url = "https://github.com/gdraheim/zziplib/commit/d2e5d5c53212e54a97ad64b793a4389193fec687.patch";
+      sha256 = "153wd4vab8xqj9avcpx8g2zw9qsp9nkaqi7yc65pz3r7xfcxwdla";
+    })
+    (fetchpatch {
+      name = "CVE-2018-16548-part3.patch";
+      url = "https://github.com/gdraheim/zziplib/commit/0e1dadb05c1473b9df2d7b8f298dab801778ef99.patch";
+      sha256 = "0fs6dns8l7dz5a900397g8b7x62z72b0pbpdmwk1hnx6vb7z5rz5";
+    })
   ];
   postPatch = ''
     sed -i -e s,--export-dynamic,, configure